{"diffoscope-json-version": 1, "source1": "/srv/reproducible-results/rbuild-debian/r-b-build.AbCIaARL/b1/dune-functions_2.9.0-2_armhf.changes", "source2": "/srv/reproducible-results/rbuild-debian/r-b-build.AbCIaARL/b2/dune-functions_2.9.0-2_armhf.changes", "unified_diff": null, "details": [{"source1": "Files", "source2": "Files", "unified_diff": "@@ -1,3 +1,3 @@\n \n 95a527c934281b71789d5f160185af88 83196 libdevel optional libdune-functions-dev_2.9.0-2_armhf.deb\n- 1af98441e2c67fac59ba8e2a8dccef7f 1778972 doc optional libdune-functions-doc_2.9.0-2_all.deb\n+ 7e175c1d1f29085e2c11a92a06df30de 1779596 doc optional libdune-functions-doc_2.9.0-2_all.deb\n"}, {"source1": "libdune-functions-doc_2.9.0-2_all.deb", "source2": "libdune-functions-doc_2.9.0-2_all.deb", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -1,3 +1,3 @@\n -rw-r--r-- 0 0 0 4 2023-01-12 22:26:33.000000 debian-binary\n--rw-r--r-- 0 0 0 13164 2023-01-12 22:26:33.000000 control.tar.xz\n--rw-r--r-- 0 0 0 1765616 2023-01-12 22:26:33.000000 data.tar.xz\n+-rw-r--r-- 0 0 0 13152 2023-01-12 22:26:33.000000 control.tar.xz\n+-rw-r--r-- 0 0 0 1766252 2023-01-12 22:26:33.000000 data.tar.xz\n"}, {"source1": "control.tar.xz", "source2": "control.tar.xz", "unified_diff": null, "details": [{"source1": "control.tar", "source2": "control.tar", "unified_diff": null, "details": [{"source1": "./md5sums", "source2": "./md5sums", "unified_diff": null, "details": [{"source1": "./md5sums", "source2": "./md5sums", "comments": ["Files differ"], "unified_diff": null}, {"source1": "line order", "source2": "line order", "unified_diff": "@@ -43,18 +43,18 @@\n usr/share/doc/libdune-functions-doc/doxygen/a00059_source.html\n usr/share/doc/libdune-functions-doc/doxygen/a00062.html\n usr/share/doc/libdune-functions-doc/doxygen/a00062_source.html\n usr/share/doc/libdune-functions-doc/doxygen/a00065.html\n usr/share/doc/libdune-functions-doc/doxygen/a00065_source.html\n usr/share/doc/libdune-functions-doc/doxygen/a00068.html\n usr/share/doc/libdune-functions-doc/doxygen/a00068_source.html\n-usr/share/doc/libdune-functions-doc/doxygen/a00071.html\n-usr/share/doc/libdune-functions-doc/doxygen/a00071_source.html\n usr/share/doc/libdune-functions-doc/doxygen/a00074.html\n usr/share/doc/libdune-functions-doc/doxygen/a00074_source.html\n+usr/share/doc/libdune-functions-doc/doxygen/a00077.html\n+usr/share/doc/libdune-functions-doc/doxygen/a00077_source.html\n usr/share/doc/libdune-functions-doc/doxygen/a00080.html\n usr/share/doc/libdune-functions-doc/doxygen/a00080_source.html\n usr/share/doc/libdune-functions-doc/doxygen/a00083.html\n usr/share/doc/libdune-functions-doc/doxygen/a00083_source.html\n usr/share/doc/libdune-functions-doc/doxygen/a00086.html\n usr/share/doc/libdune-functions-doc/doxygen/a00086_source.html\n usr/share/doc/libdune-functions-doc/doxygen/a00089.html\n"}]}]}]}, {"source1": "data.tar.xz", "source2": "data.tar.xz", "unified_diff": null, "details": [{"source1": "data.tar", "source2": "data.tar", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -3,140 +3,140 @@\n drwxr-xr-x 0 root (0) root (0) 0 2023-01-12 22:26:33.000000 ./usr/share/\n drwxr-xr-x 0 root (0) root (0) 0 2023-01-12 22:26:33.000000 ./usr/share/doc/\n drwxr-xr-x 0 root (0) root (0) 0 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/\n -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\n -rw-r--r-- 0 root (0) root (0) 4118 2022-11-16 12:11:40.000000 ./usr/share/doc/libdune-functions-doc/changelog.gz\n -rw-r--r-- 0 root (0) root (0) 3331 2023-01-12 15:07:37.000000 ./usr/share/doc/libdune-functions-doc/copyright\n drwxr-xr-x 0 root (0) root (0) 0 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/\n--rw-r--r-- 0 root (0) root (0) 5328 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00002.html\n--rw-r--r-- 0 root (0) root (0) 25921 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00002_source.html\n--rw-r--r-- 0 root (0) root (0) 6513 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00005.html\n--rw-r--r-- 0 root (0) root (0) 16008 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00005_source.html\n--rw-r--r-- 0 root (0) root (0) 4395 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00008.html\n--rw-r--r-- 0 root (0) root (0) 18047 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00008_source.html\n--rw-r--r-- 0 root (0) root (0) 7509 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00011.html\n--rw-r--r-- 0 root (0) root (0) 28251 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00011_source.html\n--rw-r--r-- 0 root (0) root (0) 5486 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00014.html\n--rw-r--r-- 0 root (0) root (0) 11779 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00014_source.html\n--rw-r--r-- 0 root (0) root (0) 10231 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00017.html\n--rw-r--r-- 0 root (0) root (0) 51362 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00017_source.html\n--rw-r--r-- 0 root (0) root (0) 7683 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00020.html\n--rw-r--r-- 0 root (0) root (0) 27200 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00020_source.html\n--rw-r--r-- 0 root (0) root (0) 4388 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00023.html\n--rw-r--r-- 0 root (0) root (0) 13611 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00023_source.html\n--rw-r--r-- 0 root (0) root (0) 23350 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00026.html\n--rw-r--r-- 0 root (0) root (0) 68684 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00026_source.html\n--rw-r--r-- 0 root (0) root (0) 7651 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00029.html\n--rw-r--r-- 0 root (0) root (0) 15189 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00029_source.html\n--rw-r--r-- 0 root (0) root (0) 7280 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00032.html\n--rw-r--r-- 0 root (0) root (0) 11255 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00032_source.html\n--rw-r--r-- 0 root (0) root (0) 4981 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00035.html\n--rw-r--r-- 0 root (0) root (0) 27963 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00035_source.html\n--rw-r--r-- 0 root (0) root (0) 5136 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00038.html\n--rw-r--r-- 0 root (0) root (0) 49466 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00038_source.html\n--rw-r--r-- 0 root (0) root (0) 5074 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00041.html\n--rw-r--r-- 0 root (0) root (0) 12567 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00041_source.html\n--rw-r--r-- 0 root (0) root (0) 15745 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00044.html\n--rw-r--r-- 0 root (0) root (0) 48865 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00044_source.html\n--rw-r--r-- 0 root (0) root (0) 4881 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00047.html\n--rw-r--r-- 0 root (0) root (0) 10069 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00047_source.html\n--rw-r--r-- 0 root (0) root (0) 6093 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00050.html\n--rw-r--r-- 0 root (0) root (0) 22105 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00050_source.html\n--rw-r--r-- 0 root (0) root (0) 6731 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00053.html\n--rw-r--r-- 0 root (0) root (0) 48399 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00053_source.html\n--rw-r--r-- 0 root (0) root (0) 6923 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00056.html\n--rw-r--r-- 0 root (0) root (0) 14988 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00056_source.html\n--rw-r--r-- 0 root (0) root (0) 6686 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00059.html\n--rw-r--r-- 0 root (0) root (0) 17547 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00059_source.html\n--rw-r--r-- 0 root (0) root (0) 5963 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00062.html\n--rw-r--r-- 0 root (0) root (0) 26463 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00062_source.html\n--rw-r--r-- 0 root (0) root (0) 6659 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00065.html\n--rw-r--r-- 0 root (0) root (0) 45971 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00065_source.html\n--rw-r--r-- 0 root (0) root (0) 6149 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00068.html\n--rw-r--r-- 0 root (0) root (0) 10192 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00068_source.html\n--rw-r--r-- 0 root (0) root (0) 4953 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00071.html\n--rw-r--r-- 0 root (0) root (0) 20264 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00071_source.html\n--rw-r--r-- 0 root (0) root (0) 8161 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00074.html\n--rw-r--r-- 0 root (0) root (0) 52869 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00074_source.html\n--rw-r--r-- 0 root (0) root (0) 4906 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00080.html\n--rw-r--r-- 0 root (0) root (0) 21677 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00080_source.html\n--rw-r--r-- 0 root (0) root (0) 4509 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00083.html\n--rw-r--r-- 0 root (0) root (0) 13605 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00083_source.html\n--rw-r--r-- 0 root (0) root (0) 5486 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00086.html\n--rw-r--r-- 0 root (0) root (0) 35187 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00086_source.html\n--rw-r--r-- 0 root (0) root (0) 6668 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00089.html\n--rw-r--r-- 0 root (0) root (0) 36917 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00089_source.html\n--rw-r--r-- 0 root (0) root (0) 7229 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00092.html\n--rw-r--r-- 0 root (0) root (0) 46756 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00092_source.html\n--rw-r--r-- 0 root (0) root (0) 8120 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00095.html\n--rw-r--r-- 0 root (0) root (0) 16692 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00095_source.html\n--rw-r--r-- 0 root (0) root (0) 6209 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00098.html\n--rw-r--r-- 0 root (0) root (0) 28013 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00098_source.html\n--rw-r--r-- 0 root (0) root (0) 9885 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00101.html\n--rw-r--r-- 0 root (0) root (0) 129555 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00101_source.html\n--rw-r--r-- 0 root (0) root (0) 5723 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00104.html\n--rw-r--r-- 0 root (0) root (0) 12131 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00104_source.html\n--rw-r--r-- 0 root (0) root (0) 7995 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00107.html\n--rw-r--r-- 0 root (0) root (0) 79863 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00107_source.html\n--rw-r--r-- 0 root (0) root (0) 7931 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00110.html\n--rw-r--r-- 0 root (0) root (0) 51127 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00110_source.html\n--rw-r--r-- 0 root (0) root (0) 5337 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00113.html\n--rw-r--r-- 0 root (0) root (0) 7264 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00113_source.html\n--rw-r--r-- 0 root (0) root (0) 5531 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00116.html\n--rw-r--r-- 0 root (0) root (0) 16841 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00116_source.html\n--rw-r--r-- 0 root (0) root (0) 8146 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00119.html\n--rw-r--r-- 0 root (0) root (0) 55287 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00119_source.html\n--rw-r--r-- 0 root (0) root (0) 5166 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00122.html\n--rw-r--r-- 0 root (0) root (0) 34473 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00122_source.html\n--rw-r--r-- 0 root (0) root (0) 8422 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00125.html\n--rw-r--r-- 0 root (0) root (0) 67255 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00125_source.html\n--rw-r--r-- 0 root (0) root (0) 8275 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00128.html\n--rw-r--r-- 0 root (0) root (0) 42991 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00128_source.html\n--rw-r--r-- 0 root (0) root (0) 5502 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00131.html\n--rw-r--r-- 0 root (0) root (0) 41013 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00131_source.html\n--rw-r--r-- 0 root (0) root (0) 9047 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00134.html\n--rw-r--r-- 0 root (0) root (0) 119825 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00134_source.html\n--rw-r--r-- 0 root (0) root (0) 5633 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00137.html\n--rw-r--r-- 0 root (0) root (0) 16399 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00137_source.html\n--rw-r--r-- 0 root (0) root (0) 7067 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00140.html\n--rw-r--r-- 0 root (0) root (0) 30363 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00140_source.html\n--rw-r--r-- 0 root (0) root (0) 8289 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00143.html\n--rw-r--r-- 0 root (0) root (0) 73804 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00143_source.html\n--rw-r--r-- 0 root (0) root (0) 8734 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00146.html\n--rw-r--r-- 0 root (0) root (0) 76258 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00146_source.html\n--rw-r--r-- 0 root (0) root (0) 8932 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00149.html\n--rw-r--r-- 0 root (0) root (0) 84710 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00149_source.html\n--rw-r--r-- 0 root (0) root (0) 8515 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00152.html\n--rw-r--r-- 0 root (0) root (0) 73752 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00152_source.html\n--rw-r--r-- 0 root (0) root (0) 8181 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00155.html\n--rw-r--r-- 0 root (0) root (0) 58888 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00155_source.html\n--rw-r--r-- 0 root (0) root (0) 8424 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00158.html\n--rw-r--r-- 0 root (0) root (0) 38765 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00158_source.html\n--rw-r--r-- 0 root (0) root (0) 12925 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00161.html\n--rw-r--r-- 0 root (0) root (0) 22115 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00161_source.html\n--rw-r--r-- 0 root (0) root (0) 7961 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00164.html\n--rw-r--r-- 0 root (0) root (0) 25642 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00164_source.html\n--rw-r--r-- 0 root (0) root (0) 10568 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00167.html\n--rw-r--r-- 0 root (0) root (0) 222246 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00167_source.html\n--rw-r--r-- 0 root (0) root (0) 7007 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00170.html\n--rw-r--r-- 0 root (0) root (0) 23394 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00170_source.html\n--rw-r--r-- 0 root (0) root (0) 4827 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00173.html\n--rw-r--r-- 0 root (0) root (0) 49470 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00173_source.html\n--rw-r--r-- 0 root (0) root (0) 7711 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00176.html\n--rw-r--r-- 0 root (0) root (0) 47942 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00176_source.html\n--rw-r--r-- 0 root (0) root (0) 10569 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00179.html\n--rw-r--r-- 0 root (0) root (0) 57247 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00179_source.html\n--rw-r--r-- 0 root (0) root (0) 8154 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00182.html\n--rw-r--r-- 0 root (0) root (0) 51505 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00182_source.html\n--rw-r--r-- 0 root (0) root (0) 5264 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00185.html\n--rw-r--r-- 0 root (0) root (0) 12341 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00185_source.html\n--rw-r--r-- 0 root (0) root (0) 8298 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00188.html\n--rw-r--r-- 0 root (0) root (0) 46365 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00188_source.html\n--rw-r--r-- 0 root (0) root (0) 7093 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00191.html\n--rw-r--r-- 0 root (0) root (0) 32392 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00191_source.html\n+-rw-r--r-- 0 root (0) root (0) 5963 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00002.html\n+-rw-r--r-- 0 root (0) root (0) 26463 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00002_source.html\n+-rw-r--r-- 0 root (0) root (0) 23350 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00005.html\n+-rw-r--r-- 0 root (0) root (0) 68684 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00005_source.html\n+-rw-r--r-- 0 root (0) root (0) 7280 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00008.html\n+-rw-r--r-- 0 root (0) root (0) 11255 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00008_source.html\n+-rw-r--r-- 0 root (0) root (0) 4388 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00011.html\n+-rw-r--r-- 0 root (0) root (0) 13611 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00011_source.html\n+-rw-r--r-- 0 root (0) root (0) 7509 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00014.html\n+-rw-r--r-- 0 root (0) root (0) 28251 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00014_source.html\n+-rw-r--r-- 0 root (0) root (0) 7683 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00017.html\n+-rw-r--r-- 0 root (0) root (0) 27200 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00017_source.html\n+-rw-r--r-- 0 root (0) root (0) 4395 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00020.html\n+-rw-r--r-- 0 root (0) root (0) 18047 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00020_source.html\n+-rw-r--r-- 0 root (0) root (0) 6923 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00023.html\n+-rw-r--r-- 0 root (0) root (0) 14988 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00023_source.html\n+-rw-r--r-- 0 root (0) root (0) 6659 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00026.html\n+-rw-r--r-- 0 root (0) root (0) 45971 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00026_source.html\n+-rw-r--r-- 0 root (0) root (0) 5328 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00029.html\n+-rw-r--r-- 0 root (0) root (0) 25921 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00029_source.html\n+-rw-r--r-- 0 root (0) root (0) 10231 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00032.html\n+-rw-r--r-- 0 root (0) root (0) 51362 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00032_source.html\n+-rw-r--r-- 0 root (0) root (0) 7651 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00035.html\n+-rw-r--r-- 0 root (0) root (0) 15189 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00035_source.html\n+-rw-r--r-- 0 root (0) root (0) 6093 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00038.html\n+-rw-r--r-- 0 root (0) root (0) 22105 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00038_source.html\n+-rw-r--r-- 0 root (0) root (0) 6731 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00041.html\n+-rw-r--r-- 0 root (0) root (0) 48399 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00041_source.html\n+-rw-r--r-- 0 root (0) root (0) 6513 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00044.html\n+-rw-r--r-- 0 root (0) root (0) 16008 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00044_source.html\n+-rw-r--r-- 0 root (0) root (0) 15745 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00047.html\n+-rw-r--r-- 0 root (0) root (0) 48865 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00047_source.html\n+-rw-r--r-- 0 root (0) root (0) 5486 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00050.html\n+-rw-r--r-- 0 root (0) root (0) 11779 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00050_source.html\n+-rw-r--r-- 0 root (0) root (0) 4881 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00053.html\n+-rw-r--r-- 0 root (0) root (0) 10069 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00053_source.html\n+-rw-r--r-- 0 root (0) root (0) 6686 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00056.html\n+-rw-r--r-- 0 root (0) root (0) 17547 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00056_source.html\n+-rw-r--r-- 0 root (0) root (0) 5074 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00059.html\n+-rw-r--r-- 0 root (0) root (0) 12567 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00059_source.html\n+-rw-r--r-- 0 root (0) root (0) 4981 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00062.html\n+-rw-r--r-- 0 root (0) root (0) 27963 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00062_source.html\n+-rw-r--r-- 0 root (0) root (0) 5136 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00065.html\n+-rw-r--r-- 0 root (0) root (0) 49466 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00065_source.html\n+-rw-r--r-- 0 root (0) root (0) 7007 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00068.html\n+-rw-r--r-- 0 root (0) root (0) 23394 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00068_source.html\n+-rw-r--r-- 0 root (0) root (0) 5531 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00074.html\n+-rw-r--r-- 0 root (0) root (0) 16841 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00074_source.html\n+-rw-r--r-- 0 root (0) root (0) 8422 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00077.html\n+-rw-r--r-- 0 root (0) root (0) 67255 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00077_source.html\n+-rw-r--r-- 0 root (0) root (0) 8298 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00080.html\n+-rw-r--r-- 0 root (0) root (0) 46365 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00080_source.html\n+-rw-r--r-- 0 root (0) root (0) 10568 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00083.html\n+-rw-r--r-- 0 root (0) root (0) 222246 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00083_source.html\n+-rw-r--r-- 0 root (0) root (0) 8515 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00086.html\n+-rw-r--r-- 0 root (0) root (0) 73752 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00086_source.html\n+-rw-r--r-- 0 root (0) root (0) 7961 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00089.html\n+-rw-r--r-- 0 root (0) root (0) 25642 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00089_source.html\n+-rw-r--r-- 0 root (0) root (0) 12925 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00092.html\n+-rw-r--r-- 0 root (0) root (0) 22115 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00092_source.html\n+-rw-r--r-- 0 root (0) root (0) 7067 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00095.html\n+-rw-r--r-- 0 root (0) root (0) 30363 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00095_source.html\n+-rw-r--r-- 0 root (0) root (0) 8734 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00098.html\n+-rw-r--r-- 0 root (0) root (0) 76258 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00098_source.html\n+-rw-r--r-- 0 root (0) root (0) 5166 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00101.html\n+-rw-r--r-- 0 root (0) root (0) 34473 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00101_source.html\n+-rw-r--r-- 0 root (0) root (0) 8424 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00104.html\n+-rw-r--r-- 0 root (0) root (0) 38765 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00104_source.html\n+-rw-r--r-- 0 root (0) root (0) 7093 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00107.html\n+-rw-r--r-- 0 root (0) root (0) 32392 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00107_source.html\n+-rw-r--r-- 0 root (0) root (0) 5633 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00110.html\n+-rw-r--r-- 0 root (0) root (0) 16399 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00110_source.html\n+-rw-r--r-- 0 root (0) root (0) 8154 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00113.html\n+-rw-r--r-- 0 root (0) root (0) 51505 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00113_source.html\n+-rw-r--r-- 0 root (0) root (0) 7931 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00116.html\n+-rw-r--r-- 0 root (0) root (0) 51127 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00116_source.html\n+-rw-r--r-- 0 root (0) root (0) 9047 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00119.html\n+-rw-r--r-- 0 root (0) root (0) 119825 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00119_source.html\n+-rw-r--r-- 0 root (0) root (0) 5337 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00122.html\n+-rw-r--r-- 0 root (0) root (0) 7264 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00122_source.html\n+-rw-r--r-- 0 root (0) root (0) 7995 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00125.html\n+-rw-r--r-- 0 root (0) root (0) 79863 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00125_source.html\n+-rw-r--r-- 0 root (0) root (0) 8146 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00128.html\n+-rw-r--r-- 0 root (0) root (0) 55287 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00128_source.html\n+-rw-r--r-- 0 root (0) root (0) 7711 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00131.html\n+-rw-r--r-- 0 root (0) root (0) 47942 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00131_source.html\n+-rw-r--r-- 0 root (0) root (0) 5264 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00134.html\n+-rw-r--r-- 0 root (0) root (0) 12341 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00134_source.html\n+-rw-r--r-- 0 root (0) root (0) 10569 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00137.html\n+-rw-r--r-- 0 root (0) root (0) 57247 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00137_source.html\n+-rw-r--r-- 0 root (0) root (0) 8932 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00140.html\n+-rw-r--r-- 0 root (0) root (0) 84710 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00140_source.html\n+-rw-r--r-- 0 root (0) root (0) 5502 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00143.html\n+-rw-r--r-- 0 root (0) root (0) 41013 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00143_source.html\n+-rw-r--r-- 0 root (0) root (0) 8181 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00146.html\n+-rw-r--r-- 0 root (0) root (0) 58888 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00146_source.html\n+-rw-r--r-- 0 root (0) root (0) 8275 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00149.html\n+-rw-r--r-- 0 root (0) root (0) 42991 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00149_source.html\n+-rw-r--r-- 0 root (0) root (0) 8289 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00152.html\n+-rw-r--r-- 0 root (0) root (0) 73804 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00152_source.html\n+-rw-r--r-- 0 root (0) root (0) 4827 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00155.html\n+-rw-r--r-- 0 root (0) root (0) 49470 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00155_source.html\n+-rw-r--r-- 0 root (0) root (0) 8161 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00158.html\n+-rw-r--r-- 0 root (0) root (0) 52869 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00158_source.html\n+-rw-r--r-- 0 root (0) root (0) 4953 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00161.html\n+-rw-r--r-- 0 root (0) root (0) 20264 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00161_source.html\n+-rw-r--r-- 0 root (0) root (0) 6149 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00164.html\n+-rw-r--r-- 0 root (0) root (0) 10192 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00164_source.html\n+-rw-r--r-- 0 root (0) root (0) 6668 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00167.html\n+-rw-r--r-- 0 root (0) root (0) 36917 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00167_source.html\n+-rw-r--r-- 0 root (0) root (0) 6209 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00170.html\n+-rw-r--r-- 0 root (0) root (0) 28013 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00170_source.html\n+-rw-r--r-- 0 root (0) root (0) 4509 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00173.html\n+-rw-r--r-- 0 root (0) root (0) 13605 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00173_source.html\n+-rw-r--r-- 0 root (0) root (0) 4906 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00176.html\n+-rw-r--r-- 0 root (0) root (0) 21677 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00176_source.html\n+-rw-r--r-- 0 root (0) root (0) 5723 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00179.html\n+-rw-r--r-- 0 root (0) root (0) 12131 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00179_source.html\n+-rw-r--r-- 0 root (0) root (0) 8120 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00182.html\n+-rw-r--r-- 0 root (0) root (0) 16692 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00182_source.html\n+-rw-r--r-- 0 root (0) root (0) 7229 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00185.html\n+-rw-r--r-- 0 root (0) root (0) 46756 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00185_source.html\n+-rw-r--r-- 0 root (0) root (0) 5486 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00188.html\n+-rw-r--r-- 0 root (0) root (0) 35187 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00188_source.html\n+-rw-r--r-- 0 root (0) root (0) 9885 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00191.html\n+-rw-r--r-- 0 root (0) root (0) 129555 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00191_source.html\n -rw-r--r-- 0 root (0) root (0) 2871 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00194.html\n -rw-r--r-- 0 root (0) root (0) 2879 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00197.html\n -rw-r--r-- 0 root (0) root (0) 2877 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00200.html\n -rw-r--r-- 0 root (0) root (0) 3925 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00203.html\n -rw-r--r-- 0 root (0) root (0) 6471 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00204.html\n -rw-r--r-- 0 root (0) root (0) 6184 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00206.html\n -rw-r--r-- 0 root (0) root (0) 12066 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/a00206.png\n@@ -513,15 +513,15 @@\n -rw-r--r-- 0 root (0) root (0) 6938 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/dir_a5545368301c4029d7054f90c0ed45fc.html\n -rw-r--r-- 0 root (0) root (0) 27691 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/dir_a5545368301c4029d7054f90c0ed45fc_dep.png\n -rw-r--r-- 0 root (0) root (0) 4682 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/dir_e22f2c69b2799e923164d7b2e4fa3f8c.html\n -rw-r--r-- 0 root (0) root (0) 3046 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/dir_e22f2c69b2799e923164d7b2e4fa3f8c_dep.png\n -rw-r--r-- 0 root (0) root (0) 3482 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/dir_e68e8157741866f444e17edd764ebbae.html\n -rw-r--r-- 0 root (0) root (0) 746 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/doc.png\n -rw-r--r-- 0 root (0) root (0) 33676 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/doxygen.css\n--rw-r--r-- 0 root (0) root (0) 55020 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/dune-functions.tag.gz\n+-rw-r--r-- 0 root (0) root (0) 55035 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/dune-functions.tag.gz\n -rw-r--r-- 0 root (0) root (0) 4452 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/dynsections.js\n -rw-r--r-- 0 root (0) root (0) 24524 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/files.html\n -rw-r--r-- 0 root (0) root (0) 616 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/folderclosed.png\n -rw-r--r-- 0 root (0) root (0) 597 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/folderopen.png\n -rw-r--r-- 0 root (0) root (0) 3926 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/functions.html\n -rw-r--r-- 0 root (0) root (0) 9073 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/functions_b.html\n -rw-r--r-- 0 root (0) root (0) 7791 2023-01-12 22:26:33.000000 ./usr/share/doc/libdune-functions-doc/doxygen/functions_c.html\n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00002.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00002.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: typeerasure.hh File Reference\n+dune-functions: localfunction.hh File Reference\n \n \n \n \n \n \n \n@@ -65,29 +65,33 @@\n
  • dune
  • functions
  • common
  • \n \n \n
    \n
    \n Classes |\n Namespaces
    \n-
    typeerasure.hh File Reference
    \n+
    localfunction.hh File Reference
    \n
    \n
    \n-
    #include <typeinfo>
    \n+\n

    Go to the source code of this file.

    \n \n \n-\n-\n+\n+\n+\n+\n \n

    \n Classes

    class  Dune::Functions::TypeErasureBase< Interface, Implementation, bufferSize >
     Base class for type-erased interface wrapper. 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...
     
    \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,25 +6,30 @@\n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n Classes | Namespaces\n-typeerasure.hh File Reference\n-#include \n+localfunction.hh File Reference\n+#include \n #include \n-#include \n-#include \n-#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::TypeErasureBase<_Interface,_Implementation,_bufferSize\n- >\n-\u00a0 Base class for type-erased interface wrapper. More...\n+class \u00a0Dune::Functions::LocalFunction<_Signature,_LocalContext,\n+ DerivativeTraits,_bufferSize_>\n+\u00a0\n+class \u00a0Dune::Functions::LocalFunction<_Range(Domain),_LocalContext,\n+ DerivativeTraits,_bufferSize_>\n+\u00a0 Class storing local functions using type erasure. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n \n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00002_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00002_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: typeerasure.hh Source File\n+dune-functions: localfunction.hh Source File\n \n \n \n \n \n \n \n@@ -62,159 +62,152 @@\n \n \n \n
    \n-
    typeerasure.hh
    \n+
    localfunction.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH
    \n-
    4#define DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH
    \n+
    4#define DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH
    \n
    5
    \n-
    6#include <typeinfo>
    \n+
    6#include <type_traits>
    \n
    7
    \n
    8#include <dune/common/typeutilities.hh>
    \n
    9
    \n-\n-\n-\n-
    13
    \n-
    14namespace Dune {
    \n-
    15namespace Functions {
    \n-
    16namespace Imp {
    \n+\n+\n+\n+\n+\n+
    15
    \n+
    16
    \n
    17
    \n-
    18
    \n-
    19
    \n-
    33template<class Interface>
    \n-
    34class TypeErasureWrapperInterface :
    \n-
    35 public Interface,
    \n-
    36 public PolymorphicType<TypeErasureWrapperInterface<Interface>>
    \n-
    37{
    \n-
    38public:
    \n-
    39 virtual const std::type_info& target_type() const = 0;
    \n-
    40};
    \n-
    41
    \n-
    42
    \n-
    43
    \n-
    60template<class Interface, class T>
    \n-
    61class TypeErasureWrapperBase :
    \n-
    62 public TypeErasureWrapperInterface<Interface>
    \n-
    63{
    \n-
    64public:
    \n-
    65 template<class TT, disableCopyMove<TypeErasureWrapperBase, TT> = 0>
    \n-
    66 TypeErasureWrapperBase(TT&& t) :
    \n-
    67 wrapped_(std::forward<TT>(t))
    \n-
    68 {}
    \n-
    69
    \n-
    71 T& get()
    \n-
    72 {
    \n-
    73 return wrapped_;
    \n-
    74 }
    \n-
    75
    \n-
    77 const T& get() const
    \n-
    78 {
    \n-
    79 return wrapped_;
    \n-
    80 }
    \n-
    81
    \n-
    82protected:
    \n-
    83 using Wrapped = T;
    \n-
    84 Wrapped wrapped_;
    \n-
    85};
    \n-
    86
    \n-
    87
    \n-
    88
    \n-
    112template<class Interface, template<class> class Implementation, class T>
    \n-
    113class TypeErasureWrapperImplementation :
    \n-
    114 public Implementation<TypeErasureWrapperBase<Interface, T> >
    \n-
    115{
    \n-
    116public:
    \n+
    18namespace Dune {
    \n+
    19namespace Functions {
    \n+
    20
    \n+
    21
    \n+
    22
    \n+
    23/*
    \n+
    24 * Default implementation is empty
    \n+
    25 * The actual implementation is only given if Signature is an type
    \n+
    26 * describing a function signature as Range(Domain).
    \n+
    27 */
    \n+
    28template<class Signature, class LocalContext, template<class> class DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>
    \n+\n+
    30{};
    \n+
    31
    \n+
    32
    \n+
    33
    \n+
    34namespace Imp
    \n+
    35{
    \n+
    36
    \n+
    38 template<class S, class L, template<class> class DerivativeTraits, size_t bufferSize>
    \n+
    39 struct LocalFunctionTraits :
    \n+
    40 DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>
    \n+
    41 {
    \n+
    42 protected:
    \n+
    43 using Base=DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>;
    \n+
    44
    \n+
    45 public:
    \n+
    47 using LocalContext = L;
    \n+
    48
    \n+
    50 using DerivativeSignature = typename Base::DerivativeSignature;
    \n+
    51
    \n+\n+
    54
    \n+
    56 using Concept = LocalFunctionWrapperInterface<S, DerivativeInterface, L>;
    \n+
    57
    \n+
    59 template<class B>
    \n+
    60 using Model = LocalFunctionWrapperImplementation<S, DerivativeInterface, L, B>;
    \n+
    61 };
    \n+
    62}
    \n+
    63
    \n+
    64
    \n+
    65
    \n+
    86template<class Range, class Domain, class LocalContext, template<class> class DerivativeTraits, size_t bufferSize>
    \n+
    87class LocalFunction< Range(Domain), LocalContext, DerivativeTraits, bufferSize> :
    \n+
    88 public TypeErasureBase<
    \n+
    89 typename Imp::LocalFunctionTraits<Range(Domain), LocalContext, DerivativeTraits, bufferSize>::Concept,
    \n+
    90 Imp::LocalFunctionTraits<Range(Domain), LocalContext, DerivativeTraits, bufferSize>::template Model>
    \n+
    91{
    \n+
    92 using Traits = Imp::LocalFunctionTraits<Range(Domain), LocalContext, DerivativeTraits, bufferSize>;
    \n+
    93
    \n+\n+
    95
    \n+
    96 using DerivativeInterface = typename Traits::DerivativeInterface;
    \n+
    97
    \n+
    98public:
    \n+
    99
    \n+
    111 template<class F, disableCopyMove<LocalFunction, F> = 0 >
    \n+\n+
    113 Base(std::forward<F>(f))
    \n+
    114 {
    \n+
    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");
    \n+
    116 }
    \n
    117
    \n-
    119 template<class TT, disableCopyMove<TypeErasureWrapperImplementation, T> = 0>
    \n-
    120 TypeErasureWrapperImplementation(TT&& t) :
    \n-
    121 Implementation<TypeErasureWrapperBase<Interface, T> >(std::forward<TT>(t))
    \n-
    122 {}
    \n-
    123
    \n-
    125 virtual TypeErasureWrapperImplementation* clone() const
    \n-
    126 {
    \n-
    127 return new TypeErasureWrapperImplementation(*this);
    \n-
    128 }
    \n-
    129
    \n-
    131 virtual TypeErasureWrapperImplementation* clone(void* buffer) const
    \n-
    132 {
    \n-
    133 return new (buffer) TypeErasureWrapperImplementation(*this);
    \n-
    134 }
    \n-
    135
    \n-
    137 virtual TypeErasureWrapperImplementation* move(void* buffer)
    \n-
    138 {
    \n-
    139 return new (buffer) TypeErasureWrapperImplementation(std::move(*this));
    \n-
    140 }
    \n-
    141
    \n-
    143 virtual const std::type_info& target_type() const
    \n-
    144 {
    \n-
    145 return typeid(T);
    \n-
    146 }
    \n-
    147};
    \n-
    148
    \n-
    149} // namespace Dune::Functions::Imp
    \n+
    118 LocalFunction() = default;
    \n+
    119
    \n+
    123 Range operator() (const Domain& x) const
    \n+
    124 {
    \n+
    125 return this->asInterface().operator()(x);
    \n+
    126 }
    \n+
    127
    \n+
    135 friend DerivativeInterface derivative(const LocalFunction& t)
    \n+
    136 {
    \n+
    137 return t.asInterface().derivative();
    \n+
    138 }
    \n+
    139
    \n+
    146 void bind(const LocalContext& context)
    \n+
    147 {
    \n+
    148 this->asInterface().bind(context);
    \n+
    149 }
    \n
    150
    \n-
    151
    \n-
    152
    \n-
    163template<class Interface, template<class> class Implementation, size_t bufferSize = 56>
    \n-\n-
    165{
    \n-
    166public:
    \n-
    167
    \n-
    169 template<class T, disableCopyMove<TypeErasureBase, T> = 0 >
    \n-\n-
    171 wrapped_(Imp::TypeErasureWrapperImplementation<Interface, Implementation, typename std::decay<T>::type>(std::forward<T>(t)))
    \n-
    172 {}
    \n-
    173
    \n-
    175 TypeErasureBase() = default;
    \n+
    154 void unbind()
    \n+
    155 {
    \n+
    156 this->asInterface().unbind();
    \n+
    157 }
    \n+
    158
    \n+
    161 bool bound() const
    \n+
    162 {
    \n+
    163 return this->asInterface().bound();
    \n+
    164 }
    \n+
    165
    \n+
    169 const LocalContext& localContext() const
    \n+
    170 {
    \n+
    171 return this->asInterface().localContext();
    \n+
    172 }
    \n+
    173};
    \n+
    174
    \n+
    175
    \n
    176
    \n-
    178 Interface& asInterface()
    \n-
    179 {
    \n-
    180 return wrapped_.get();
    \n-
    181 }
    \n-
    182
    \n-
    184 const Interface& asInterface() const
    \n-
    185 {
    \n-
    186 return wrapped_.get();
    \n-
    187 }
    \n-
    188
    \n-
    190 const std::type_info& target_type() const
    \n-
    191 {
    \n-
    192 return wrapped_.get().target_type();
    \n-
    193 }
    \n-
    194
    \n-
    195protected:
    \n-\n-
    197};
    \n-
    198
    \n-
    199
    \n-
    200}} // namespace Dune::Functions
    \n-
    201
    \n-
    202
    \n-
    203
    \n-
    204#endif // DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH
    \n-\n-\n-\n+
    177}} // namespace Dune::Functions
    \n+
    178
    \n+
    179
    \n+
    180
    \n+
    181#endif // DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH
    \n+\n+\n+\n+\n+\n+
    friend DerivativeInterface derivative(const LocalFunction &t)
    Get derivative of wrapped function.
    Definition: localfunction.hh:135
    \n
    Definition: polynomial.hh:10
    \n-
    A wrapper providing small object optimization with polymorphic types.
    Definition: polymorphicsmallobject.hh:45
    \n+
    Definition: localfunction.hh:30
    \n+
    const LocalContext & localContext() const
    Obtain local context this LocalFunction is bound to.
    Definition: localfunction.hh:169
    \n+
    LocalFunction(F &&f)
    Construct from function.
    Definition: localfunction.hh:112
    \n+
    void unbind()
    Unbind from local context.
    Definition: localfunction.hh:154
    \n+
    bool bound() const
    Return if the local function is bound to a grid element.
    Definition: localfunction.hh:161
    \n+
    void bind(const LocalContext &context)
    Bind function to a local context.
    Definition: localfunction.hh:146
    \n+\n
    Base class for type-erased interface wrapper.
    Definition: typeerasure.hh:165
    \n-
    const std::type_info & target_type() const
    Get type of stored object.
    Definition: typeerasure.hh:190
    \n-
    TypeErasureBase(T &&t)
    Construct wrapper from object.
    Definition: typeerasure.hh:170
    \n-
    PolymorphicSmallObject< Imp::TypeErasureWrapperInterface< Interface >, bufferSize > wrapped_
    Definition: typeerasure.hh:196
    \n-
    TypeErasureBase()=default
    Default constructor.
    \n-
    Interface & asInterface()
    Get mutable reference to wrapped object.
    Definition: typeerasure.hh:178
    \n-
    const Interface & asInterface() const
    Get reference to wrapped object.
    Definition: typeerasure.hh:184
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,180 +5,189 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-typeerasure.hh\n+localfunction.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH\n- 4#define DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH\n+ 3#ifndef DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH\n+ 4#define DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH\n 5\n- 6#include \n+ 6#include \n 7\n 8#include \n 9\n- 10#include \n- 11#include \n- 12#include \n- 13\n- 14namespace Dune {\n- 15namespace Functions {\n- 16namespace Imp {\n+ 10#include \n+ 11#include \n+ 12#include \n+ 13#include \n+ 14#include \n+ 15\n+ 16\n 17\n- 18\n- 19\n- 33template\n- 34class TypeErasureWrapperInterface :\n- 35 public Interface,\n- 36 public PolymorphicType>\n- 37{\n- 38public:\n- 39 virtual const std::type_info& target_type() const = 0;\n- 40};\n- 41\n- 42\n- 43\n- 60template\n- 61class TypeErasureWrapperBase :\n- 62 public TypeErasureWrapperInterface\n- 63{\n- 64public:\n- 65 template = 0>\n- 66 TypeErasureWrapperBase(TT&& t) :\n- 67 wrapped_(std::forward(t))\n- 68 {}\n- 69\n- 71 T& get()\n- 72 {\n- 73 return wrapped_;\n- 74 }\n- 75\n- 77 const T& get() const\n- 78 {\n- 79 return wrapped_;\n- 80 }\n- 81\n- 82protected:\n- 83 using Wrapped = T;\n- 84 Wrapped wrapped_;\n- 85};\n- 86\n- 87\n- 88\n- 112template class Implementation, class T>\n- 113class TypeErasureWrapperImplementation :\n- 114 public Implementation >\n- 115{\n- 116public:\n+ 18namespace Dune {\n+ 19namespace Functions {\n+ 20\n+ 21\n+ 22\n+ 23/*\n+ 24 * Default implementation is empty\n+ 25 * The actual implementation is only given if Signature is an type\n+ 26 * describing a function signature as Range(Domain).\n+ 27 */\n+ 28template class\n+DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>\n+29class LocalFunction\n+ 30{};\n+ 31\n+ 32\n+ 33\n+ 34namespace Imp\n+ 35{\n+ 36\n+ 38 template class DerivativeTraits, size_t\n+bufferSize>\n+ 39 struct LocalFunctionTraits :\n+ 40 DifferentiableFunctionTraits\n+ 41 {\n+ 42 protected:\n+ 43 using Base=DifferentiableFunctionTraits;\n+ 44\n+ 45 public:\n+ 47 using LocalContext = L;\n+ 48\n+ 50 using DerivativeSignature = typename Base::DerivativeSignature;\n+ 51\n+ 53 using DerivativeInterface = LocalFunction;\n+ 54\n+ 56 using Concept = LocalFunctionWrapperInterface;\n+ 57\n+ 59 template\n+ 60 using Model = LocalFunctionWrapperImplementation;\n+ 61 };\n+ 62}\n+ 63\n+ 64\n+ 65\n+ 86template\n+class DerivativeTraits, size_t bufferSize>\n+87class LocalFunction< Range(Domain), LocalContext, DerivativeTraits,\n+bufferSize> :\n+ 88 public TypeErasureBase<\n+ 89 typename Imp::LocalFunctionTraits::Concept,\n+ 90 Imp::LocalFunctionTraits::template Model>\n+ 91{\n+ 92 using Traits = Imp::LocalFunctionTraits;\n+ 93\n+ 94 using Base = TypeErasureBase;\n+ 95\n+ 96 using DerivativeInterface = typename Traits::DerivativeInterface;\n+ 97\n+ 98public:\n+ 99\n+ 111 template = 0 >\n+112 LocalFunction(F&& f) :\n+ 113 Base(std::forward(f))\n+ 114 {\n+ 115 static_assert(Dune::Functions::Concept::isLocalFunction(), \"Trying to construct a LocalFunction from type that does not\n+model the LocalFunction concept\");\n+ 116 }\n 117\n- 119 template =\n-0>\n- 120 TypeErasureWrapperImplementation(TT&& t) :\n- 121 Implementation >(std::forward(t))\n- 122 {}\n- 123\n- 125 virtual TypeErasureWrapperImplementation* clone() const\n- 126 {\n- 127 return new TypeErasureWrapperImplementation(*this);\n- 128 }\n- 129\n- 131 virtual TypeErasureWrapperImplementation* clone(void* buffer) const\n- 132 {\n- 133 return new (buffer) TypeErasureWrapperImplementation(*this);\n- 134 }\n- 135\n- 137 virtual TypeErasureWrapperImplementation* move(void* buffer)\n- 138 {\n- 139 return new (buffer) TypeErasureWrapperImplementation(std::move(*this));\n- 140 }\n- 141\n- 143 virtual const std::type_info& target_type() const\n- 144 {\n- 145 return typeid(T);\n- 146 }\n- 147};\n- 148\n- 149} // namespace Dune::Functions::Imp\n+118 LocalFunction() = default;\n+ 119\n+123 Range operator() (const Domain& x) const\n+ 124 {\n+ 125 return this->asInterface().operator()(x);\n+ 126 }\n+ 127\n+135 friend DerivativeInterface derivative(const LocalFunction& t)\n+ 136 {\n+ 137 return t.asInterface().derivative();\n+ 138 }\n+ 139\n+146 void bind(const LocalContext& context)\n+ 147 {\n+ 148 this->asInterface().bind(context);\n+ 149 }\n 150\n- 151\n- 152\n- 163template class Implementation, size_t\n-bufferSize = 56>\n-164class TypeErasureBase\n- 165{\n- 166public:\n- 167\n- 169 template = 0 >\n-170 TypeErasureBase(T&& t) :\n- 171 wrapped_(Imp::TypeErasureWrapperImplementation::type>(std::forward(t)))\n- 172 {}\n- 173\n-175 TypeErasureBase() = default;\n+154 void unbind()\n+ 155 {\n+ 156 this->asInterface().unbind();\n+ 157 }\n+ 158\n+161 bool bound() const\n+ 162 {\n+ 163 return this->asInterface().bound();\n+ 164 }\n+ 165\n+169 const LocalContext& localContext() const\n+ 170 {\n+ 171 return this->asInterface().localContext();\n+ 172 }\n+ 173};\n+ 174\n+ 175\n 176\n-178 Interface& asInterface()\n- 179 {\n- 180 return wrapped_.get();\n- 181 }\n- 182\n-184 const Interface& asInterface() const\n- 185 {\n- 186 return wrapped_.get();\n- 187 }\n- 188\n-190 const std::type_info& target_type() const\n- 191 {\n- 192 return wrapped_.get().target_type();\n- 193 }\n- 194\n- 195protected:\n-196 PolymorphicSmallObject,\n-bufferSize > wrapped_;\n- 197};\n- 198\n- 199\n- 200}} // namespace Dune::Functions\n- 201\n- 202\n- 203\n- 204#endif // DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH\n-type_traits.hh\n-polymorphicsmallobject.hh\n-interfaces.hh\n+ 177}} // namespace Dune::Functions\n+ 178\n+ 179\n+ 180\n+ 181#endif // DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH\n+functionconcepts.hh\n+localfunction_imp.hh\n+typeerasure.hh\n+defaultderivativetraits.hh\n+differentiablefunction.hh\n+Dune::Functions::LocalFunction<_Range(Domain),_LocalContext,_DerivativeTraits,\n+bufferSize_>::derivative\n+friend DerivativeInterface derivative(const LocalFunction &t)\n+Get derivative of wrapped function.\n+Definition: localfunction.hh:135\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::PolymorphicSmallObject\n-A wrapper providing small object optimization with polymorphic types.\n-Definition: polymorphicsmallobject.hh:45\n+Dune::Functions::LocalFunction\n+Definition: localfunction.hh:30\n+Dune::Functions::LocalFunction<_Range(Domain),_LocalContext,_DerivativeTraits,\n+bufferSize_>::localContext\n+const LocalContext & localContext() const\n+Obtain local context this LocalFunction is bound to.\n+Definition: localfunction.hh:169\n+Dune::Functions::LocalFunction<_Range(Domain),_LocalContext,_DerivativeTraits,\n+bufferSize_>::LocalFunction\n+LocalFunction(F &&f)\n+Construct from function.\n+Definition: localfunction.hh:112\n+Dune::Functions::LocalFunction<_Range(Domain),_LocalContext,_DerivativeTraits,\n+bufferSize_>::unbind\n+void unbind()\n+Unbind from local context.\n+Definition: localfunction.hh:154\n+Dune::Functions::LocalFunction<_Range(Domain),_LocalContext,_DerivativeTraits,\n+bufferSize_>::bound\n+bool bound() const\n+Return if the local function is bound to a grid element.\n+Definition: localfunction.hh:161\n+Dune::Functions::LocalFunction<_Range(Domain),_LocalContext,_DerivativeTraits,\n+bufferSize_>::bind\n+void bind(const LocalContext &context)\n+Bind function to a local context.\n+Definition: localfunction.hh:146\n+Dune::Functions::LocalFunction<_Range(Domain),_LocalContext,_DerivativeTraits,\n+bufferSize_>::LocalFunction\n+LocalFunction()=default\n Dune::Functions::TypeErasureBase\n Base class for type-erased interface wrapper.\n Definition: typeerasure.hh:165\n-Dune::Functions::TypeErasureBase::target_type\n-const std::type_info & target_type() const\n-Get type of stored object.\n-Definition: typeerasure.hh:190\n-Dune::Functions::TypeErasureBase::TypeErasureBase\n-TypeErasureBase(T &&t)\n-Construct wrapper from object.\n-Definition: typeerasure.hh:170\n-Dune::Functions::TypeErasureBase::wrapped_\n-PolymorphicSmallObject< Imp::TypeErasureWrapperInterface< Interface >,\n-bufferSize > wrapped_\n-Definition: typeerasure.hh:196\n-Dune::Functions::TypeErasureBase::TypeErasureBase\n-TypeErasureBase()=default\n-Default constructor.\n-Dune::Functions::TypeErasureBase::asInterface\n-Interface & asInterface()\n-Get mutable reference to wrapped object.\n-Definition: typeerasure.hh:178\n-Dune::Functions::TypeErasureBase::asInterface\n-const Interface & asInterface() const\n-Get reference to wrapped object.\n-Definition: typeerasure.hh:184\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00005.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00005.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: type_traits.hh File Reference\n+dune-functions: functionconcepts.hh File Reference\n \n \n \n \n \n \n \n@@ -65,45 +65,122 @@\n
  • dune
  • functions
  • common
  • \n \n \n
    \n \n-
    type_traits.hh File Reference
    \n+Functions
    \n+
    functionconcepts.hh File Reference
    \n \n
    \n-
    #include <type_traits>
    \n-#include <dune/common/typeutilities.hh>
    \n+
    #include <dune/common/typelist.hh>
    \n+#include <dune/common/concept.hh>
    \n+#include <dune/functions/common/signature.hh>
    \n+#include <dune/functions/gridfunctions/localderivativetraits.hh>
    \n+#include <dune/functions/gridfunctions/gridviewentityset.hh>
    \n
    \n

    Go to the source code of this file.

    \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
    \n \n-\n-\n+\n+\n \n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n

    \n Classes

    struct  Dune::Functions::HasStaticSize< T >
     Check if type is a statically sized container. More...
    struct  Dune::Functions::Concept::Callable< Args >
     Concept objects that can be called with given argument list. More...
     
    struct  Dune::Functions::StaticSize< T >
     Obtain size of statically sized container. 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...
     
    \n \n \n \n \n \n+\n+\n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    namespace  Dune::Functions::Concept
     
    \n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n

    \n-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. More...
     

    \n+Functions

    template<class F , class... Args>
    static constexpr auto Dune::Functions::Concept::isCallable ()
     Check if f is callable with given argument list. More...
     
    template<class F , class... Args>
    static constexpr auto Dune::Functions::Concept::isCallable (F &&, Args &&...)
     Check if f is callable with given argument list. More...
     
    template<class F , class Signature >
    static constexpr bool Dune::Functions::Concept::isFunction ()
     Check if F models the Function concept with given signature. More...
     
    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. More...
     
    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. More...
     
    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. More...
     
    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. More...
     
    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. More...
     
    template<class E >
    static constexpr bool Dune::Functions::Concept::isEntitySet ()
     Check if F models the GridFunction concept with given signature and entity set. More...
     
    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. More...
     
    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. More...
     
    template<class F , class Signature , class GridView >
    static constexpr bool Dune::Functions::Concept::isGridViewFunction ()
     Check if F models the GridViewFunction concept with given signature. More...
     
    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. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,33 +5,137 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-Classes | Namespaces | Typedefs\n-type_traits.hh File Reference\n-#include \n-#include \n+Classes | Namespaces | Functions\n+functionconcepts.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0Dune::Functions::HasStaticSize<_T_>\n-\u00a0 Check if type is a statically sized container. More...\n+struct \u00a0Dune::Functions::Concept::Callable<_Args_>\n+\u00a0 Concept objects that can be called with given argument list. More...\n \u00a0\n-struct \u00a0Dune::Functions::StaticSize<_T_>\n-\u00a0 Obtain size of statically sized container. More...\n+struct \u00a0Dune::Functions::Concept::Function<_Range(Domain)>\n+\u00a0 Concept for a function mapping Domain to Range. More...\n+\u00a0\n+struct \u00a0Dune::Functions::Concept::DifferentiableFunction<_Range(Domain),\n+ DerivativeTraits_>\n+\u00a0 Concept for a differentiable function mapping Domain to Range. More...\n+\u00a0\n+struct \u00a0Dune::Functions::Concept::LocalFunction<_Range(Domain),_LocalContext_>\n+\u00a0 Concept for a local function mapping Domain to Range. More...\n+\u00a0\n+struct \u00a0Dune::Functions::Concept::DifferentiableLocalFunction<_Range(Domain),\n+ LocalContext,_DerivativeTraits_>\n+\u00a0 Concept for a differentiable local function mapping Domain to Range.\n+ More...\n+\u00a0\n+struct \u00a0Dune::Functions::Concept::EntitySet\n+\u00a0 Concept for an entity set for a Concept::GridFunction More...\n+\u00a0\n+struct \u00a0Dune::Functions::Concept::GridFunction<_Range(Domain),_EntitySet_>\n+\u00a0 Concept for a grid function mapping Domain to Range. More...\n+\u00a0\n+struct \u00a0Dune::Functions::Concept::DifferentiableGridFunction<_Range(Domain),\n+ EntitySet,_DerivativeTraits_>\n+\u00a0 Concept for a differentiable grid function mapping Domain to Range.\n+ More...\n+\u00a0\n+struct \u00a0Dune::Functions::Concept::GridViewFunction<_Range(Domain),_GridView_>\n+\u00a0 Concept for a grid view function mapping Domain to Range. More...\n+\u00a0\n+struct \u00a0Dune::Functions::Concept::DifferentiableGridViewFunction<_Range\n+ (Domain),_GridView,_DerivativeTraits_>\n+\u00a0 Concept for a differentiable grid view function mapping Domain to\n+ Range. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n- Typedefs\n-template\n-using\u00a0Dune::Functions::enableIfConstructible = typename std::enable_if< std::\n- is_constructible< T, Args... >::value, int >::type\n-\u00a0 Helper to constrain forwarding constructors. More...\n+namespace \u00a0Dune::Functions::Concept\n+\u00a0\n+ Functions\n+template\n+static constexpr auto\u00a0Dune::Functions::Concept::isCallable ()\n+\u00a0 Check if f is callable with given argument list. More...\n+\u00a0\n+template\n+static constexpr auto\u00a0Dune::Functions::Concept::isCallable (F &&, Args &&...)\n+\u00a0 Check if f is callable with given argument list. More...\n+\u00a0\n+template\n+static constexpr bool\u00a0Dune::Functions::Concept::isFunction ()\n+\u00a0 Check if F models the Function concept with given\n+ signature. More...\n+\u00a0\n+template class DerivativeTraits>\n+static constexpr bool\u00a0Dune::Functions::Concept::isFunction (F &&f,\n+ SignatureTag< Signature, DerivativeTraits >)\n+\u00a0 Check if f models the Function concept with given\n+ signature. More...\n+\u00a0\n+template class DerivativeTraits =\n+DefaultDerivativeTraits>\n+static constexpr bool\u00a0Dune::Functions::Concept::isDifferentiableFunction ()\n+\u00a0 Check if F models the DifferentiableFunction concept\n+ with given signature. More...\n+\u00a0\n+template class DerivativeTraits>\n+static constexpr bool\u00a0Dune::Functions::Concept::isDifferentiableFunction (F\n+ &&f, SignatureTag< Signature, DerivativeTraits >)\n+\u00a0 Check if f models the DifferentiableFunction concept\n+ with given signature. More...\n+\u00a0\n+template\n+static constexpr bool\u00a0Dune::Functions::Concept::isLocalFunction ()\n+\u00a0 Check if F models the LocalFunction concept with given\n+ signature and local context. More...\n+\u00a0\n+template\n+class DerivativeTraits = DefaultDerivativeTraits>\n+static constexpr bool\u00a0Dune::Functions::Concept::isDifferentiableLocalFunction\n+ ()\n+\u00a0 Check if F models the DifferentiableLocalFunction\n+ concept with given signature and local context. More...\n+\u00a0\n+template\n+static constexpr bool\u00a0Dune::Functions::Concept::isEntitySet ()\n+\u00a0 Check if F models the GridFunction concept with given\n+ signature and entity set. More...\n+\u00a0\n+template\n+static constexpr bool\u00a0Dune::Functions::Concept::isGridFunction ()\n+\u00a0 Check if F models the GridFunction concept with given\n+ signature and entity set. More...\n+\u00a0\n+template class\n+DerivativeTraits = DefaultDerivativeTraits>\n+static constexpr bool\u00a0Dune::Functions::Concept::isDifferentiableGridFunction\n+ ()\n+\u00a0 Check if F models the DifferentiableGridFunction concept\n+ with given signature and entity set. More...\n+\u00a0\n+template\n+static constexpr bool\u00a0Dune::Functions::Concept::isGridViewFunction ()\n+\u00a0 Check if F models the GridViewFunction concept with\n+ given signature. More...\n+\u00a0\n+template class\n+DerivativeTraits = DefaultDerivativeTraits>\n+static constexpr bool\u00a0Dune::Functions::Concept::\n+ isDifferentiableGridViewFunction ()\n+\u00a0 Check if F models the DifferentiableGridViewFunction\n+ concept with given signature. More...\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00005_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00005_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: type_traits.hh Source File\n+dune-functions: functionconcepts.hh Source File\n \n \n \n \n \n \n \n@@ -62,100 +62,320 @@\n \n \n
    \n
    \n-
    type_traits.hh
    \n+
    functionconcepts.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH
    \n-
    4#define DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH
    \n+
    4#define DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH
    \n
    5
    \n-
    6#include <type_traits>
    \n-
    7
    \n-
    8#include <dune/common/typeutilities.hh>
    \n-
    9
    \n-
    10namespace Dune {
    \n-
    11namespace Functions {
    \n+
    6#include <dune/common/typelist.hh>
    \n+
    7#include <dune/common/concept.hh>
    \n+
    8
    \n+\n+\n+\n
    12
    \n-
    13
    \n-
    24template<class T, class... Args>
    \n-
    25using enableIfConstructible = typename std::enable_if<
    \n-
    26 std::is_constructible<T, Args...>::value, int>::type;
    \n-
    27
    \n-
    28
    \n-
    29
    \n-
    30namespace Imp {
    \n-
    31
    \n-
    32 // As a last resort try if there's a static constexpr size()
    \n-
    33 template<class T>
    \n-
    34 constexpr auto staticSize(const T*, const PriorityTag<0>&)
    \n-
    35 -> decltype(std::integral_constant<std::size_t,T::size()>())
    \n-
    36 {
    \n-
    37 return {};
    \n-
    38 }
    \n+
    13namespace Dune {
    \n+
    14namespace Functions {
    \n+
    15namespace Concept {
    \n+
    16
    \n+
    17using namespace Dune::Concept;
    \n+
    18
    \n+
    19
    \n+
    20
    \n+
    21// Callable concept ############################################################
    \n+
    22
    \n+
    23
    \n+
    31template<class... Args>
    \n+\n+
    33{
    \n+
    34 template<class F>
    \n+
    35 auto require(F&& f) -> decltype(
    \n+
    36 f(std::declval<Args>()...)
    \n+
    37 );
    \n+
    38};
    \n
    39
    \n-
    40 // Try if class has constexpr default constructor and size method
    \n-
    41 template<class T>
    \n-
    42 constexpr auto staticSize(const T*, const PriorityTag<1>&)
    \n-
    43 -> decltype(std::integral_constant<std::size_t,T().size()>())
    \n-
    44 {
    \n-
    45 return {};
    \n-
    46 }
    \n-
    47
    \n-
    48 // Try if tuple_size is implemented for class
    \n-
    49 template<class T>
    \n-
    50 constexpr auto staticSize(const T*, const PriorityTag<2>&)
    \n-
    51 -> decltype(std::integral_constant<std::size_t,std::tuple_size<T>::value>())
    \n-
    52 {
    \n-
    53 return {};
    \n-
    54 }
    \n-
    55
    \n-
    56 template<class T>
    \n-
    57 constexpr std::false_type hasStaticSize(const T* t, const PriorityTag<0>& p)
    \n-
    58 {
    \n-
    59 return {};
    \n-
    60 }
    \n+
    46template<class F, class... Args>
    \n+
    47static constexpr auto isCallable()
    \n+
    48{ return models<Concept::Callable<Args...>, F>(); }
    \n+
    49
    \n+
    56template<class F, class... Args>
    \n+
    57static constexpr auto isCallable(F&&, Args&&...)
    \n+
    58{
    \n+
    59 return models<Concept::Callable<Args&&...>, F>();
    \n+
    60}
    \n
    61
    \n-
    62 template<class T>
    \n-
    63 constexpr auto hasStaticSize(const T* t, const PriorityTag<1>& p)
    \n-
    64 -> decltype(staticSize(t ,PriorityTag<42>()), std::true_type())
    \n-
    65 {
    \n-
    66 return {};
    \n-
    67 }
    \n-
    68
    \n-
    69}
    \n-
    70
    \n-
    71
    \n-
    72
    \n-
    80template<class T>
    \n-\n-
    82 public decltype(Imp::hasStaticSize((typename std::decay<T>::type*)(nullptr), PriorityTag<42>()))
    \n-
    83{};
    \n-
    84
    \n+
    62
    \n+
    63
    \n+
    64// Function concept ############################################################
    \n+
    65template<class Signature>
    \n+
    66struct Function;
    \n+
    67
    \n+
    76template<class Range, class Domain>
    \n+
    77struct Function<Range(Domain)> : Refines<Callable<Domain> >
    \n+
    78{
    \n+
    79 template<class F>
    \n+
    80 auto require(F&& f) -> decltype(
    \n+
    81 // F models Function<Range(Domain)> if the result of F(Domain) is implicitly convertible to Range
    \n+
    82 requireConvertible<Range>(f(std::declval<Domain>()))
    \n+
    83 );
    \n+
    84};
    \n
    85
    \n-
    86
    \n-
    94template<class T>
    \n-
    95struct StaticSize :
    \n-
    96 public decltype(Imp::staticSize((typename std::decay<T>::type*)(nullptr), PriorityTag<42>()))
    \n-
    97{};
    \n-
    98
    \n-
    99
    \n-
    100
    \n-
    101}} // namespace Dune::Functions
    \n-
    102
    \n-
    103#endif // DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH
    \n-
    typename std::enable_if< std::is_constructible< T, Args... >::value, int >::type enableIfConstructible
    Helper to constrain forwarding constructors.
    Definition: type_traits.hh:26
    \n+
    87template<class F, class Signature>
    \n+
    88static constexpr bool isFunction()
    \n+
    89{ return models<Concept::Function<Signature>, F>(); }
    \n+
    90
    \n+
    92template<class F, class Signature, template<class> class DerivativeTraits>
    \n+\n+
    94{ return models<Concept::Function<Signature>, F>(); }
    \n+
    95
    \n+
    96
    \n+
    97
    \n+
    98// DifferentiableFunction concept ##############################################
    \n+
    99template<class Signature, template<class> class DerivativeTraits = DefaultDerivativeTraits>
    \n+\n+
    101
    \n+
    113template<class Range, class Domain, template<class> class DerivativeTraits>
    \n+
    114struct DifferentiableFunction<Range(Domain), DerivativeTraits> : Refines<Dune::Functions::Concept::Function<Range(Domain)> >
    \n+
    115{
    \n+\n+
    117
    \n+
    118 template<class F>
    \n+
    119 auto require(F&& f) -> decltype(
    \n+
    120 derivative(f),
    \n+
    121 requireConcept<Function<DerivativeSignature>>(derivative(f))
    \n+
    122 );
    \n+
    123};
    \n+
    124
    \n+
    126template<class F, class Signature, template<class> class DerivativeTraits = DefaultDerivativeTraits>
    \n+
    127static constexpr bool isDifferentiableFunction()
    \n+
    128{ return models<Concept::DifferentiableFunction<Signature, DerivativeTraits>, F>(); }
    \n+
    129
    \n+
    131template<class F, class Signature, template<class> class DerivativeTraits>
    \n+\n+
    133{ return models<Concept::DifferentiableFunction<Signature, DerivativeTraits>, F>(); }
    \n+
    134
    \n+
    135
    \n+
    136
    \n+
    137// LocalFunction concept ##############################################
    \n+
    138template<class Signature, class LocalContext>
    \n+\n+
    140
    \n+
    150template<class Range, class Domain, class LocalContext>
    \n+
    151struct LocalFunction<Range(Domain), LocalContext> :
    \n+
    152 Refines<Dune::Functions::Concept::Function<Range(Domain)> >
    \n+
    153{
    \n+
    154 template<class F>
    \n+
    155 auto require(F&& f) -> decltype(
    \n+
    156 f.bind(std::declval<LocalContext>()),
    \n+
    157 f.unbind(),
    \n+
    158 requireConvertible<bool>(f.bound()),
    \n+
    159 f.localContext(),
    \n+
    160 requireConvertible<LocalContext>(f.localContext())
    \n+
    161 );
    \n+
    162};
    \n+
    163
    \n+
    165template<class F, class Signature, class LocalContext>
    \n+
    166static constexpr bool isLocalFunction()
    \n+
    167{ return models<Concept::LocalFunction<Signature, LocalContext>, F>(); }
    \n+
    168
    \n+
    169
    \n+
    170// DifferentiableLocalFunction concept ##############################################
    \n+
    171template<class Signature, class LocalContext, template<class> class DerivativeTraits = DefaultDerivativeTraits>
    \n+\n+
    173
    \n+
    186template<class Range, class Domain, class LocalContext, template<class> class DerivativeTraits>
    \n+
    187struct DifferentiableLocalFunction<Range(Domain), LocalContext, DerivativeTraits> :
    \n+
    188 Refines<
    \n+
    189 Dune::Functions::Concept::DifferentiableFunction<Range(Domain), DerivativeTraits>,
    \n+
    190 Dune::Functions::Concept::LocalFunction<Range(Domain),LocalContext>
    \n+
    191 >
    \n+
    192{
    \n+
    193 template<class F>
    \n+
    194 auto require(F&& f) -> decltype(
    \n+
    195 f.bind(std::declval<LocalContext>()),
    \n+
    196 f.unbind(),
    \n+
    197 f.localContext(),
    \n+
    198 requireConvertible<LocalContext>(f.localContext())
    \n+
    199 );
    \n+
    200};
    \n+
    201
    \n+
    203template<class F, class Signature, class LocalContext, template<class> class DerivativeTraits = DefaultDerivativeTraits>
    \n+
    204static constexpr bool isDifferentiableLocalFunction()
    \n+
    205{ return models<Concept::DifferentiableLocalFunction<Signature, LocalContext, DerivativeTraits>, F>(); }
    \n+
    206
    \n+
    207
    \n+
    208// EntitySet concept ##############################################
    \n+
    209
    \n+\n+
    220{
    \n+
    221 template<class E>
    \n+
    222 auto require(E&& f) -> decltype(
    \n+
    223 requireType<typename E::Element>(),
    \n+
    224 requireType<typename E::LocalCoordinate>(),
    \n+
    225 requireType<typename E::GlobalCoordinate>()
    \n+
    226 );
    \n+
    227};
    \n+
    228
    \n+
    230template<class E>
    \n+
    231static constexpr bool isEntitySet()
    \n+
    232{ return models<Concept::EntitySet, E>(); }
    \n+
    233
    \n+
    234
    \n+
    235
    \n+
    236// GridFunction concept ##############################################
    \n+
    237template<class Signature, class EntitySet>
    \n+\n+
    239
    \n+
    249template<class Range, class Domain, class EntitySet>
    \n+
    250struct GridFunction<Range(Domain), EntitySet> :
    \n+
    251 Refines<Dune::Functions::Concept::Function<Range(Domain)> >
    \n+
    252{
    \n+
    253 using LocalSignature = Range(typename EntitySet::LocalCoordinate);
    \n+
    254 using LocalContext = typename EntitySet::Element;
    \n+
    255
    \n+
    256 template<class F>
    \n+
    257 auto require(F&& f) -> decltype(
    \n+
    258 localFunction(f),
    \n+
    259 f.entitySet(),
    \n+
    260 requireConcept<LocalFunction<LocalSignature, LocalContext>>(localFunction(f)),
    \n+
    261 requireConcept<Concept::EntitySet, EntitySet>(),
    \n+
    262 requireConvertible<EntitySet>(f.entitySet()),
    \n+
    263 requireConvertible<typename EntitySet::GlobalCoordinate, Domain>()
    \n+
    264 );
    \n+
    265};
    \n+
    266
    \n+
    268template<class F, class Signature, class EntitySet>
    \n+
    269static constexpr bool isGridFunction()
    \n+
    270{ return models<Concept::GridFunction<Signature, EntitySet>, F>(); }
    \n+
    271
    \n+
    272
    \n+
    273// DifferentiableGridFunction concept ##############################################
    \n+
    274template<class Signature, class EntitySet, template<class> class DerivativeTraits = DefaultDerivativeTraits>
    \n+\n+
    276
    \n+
    289template<class Range, class Domain, class EntitySet, template<class> class DerivativeTraits>
    \n+
    290struct DifferentiableGridFunction<Range(Domain), EntitySet, DerivativeTraits> :
    \n+
    291 Refines<
    \n+
    292 Dune::Functions::Concept::DifferentiableFunction<Range(Domain), DerivativeTraits>,
    \n+
    293 Dune::Functions::Concept::GridFunction<Range(Domain),EntitySet>
    \n+
    294 >
    \n+
    295{
    \n+
    296 using LocalSignature = Range(typename EntitySet::LocalCoordinate);
    \n+
    297 using LocalContext = typename EntitySet::Element;
    \n+
    298
    \n+
    299 template<class R>
    \n+\n+
    301
    \n+
    302 template<class F>
    \n+
    303 auto require(F&& f) -> decltype(
    \n+
    304 requireConcept<DifferentiableLocalFunction<LocalSignature, LocalContext, LocalDerivativeTraits>>(localFunction(f))
    \n+
    305 );
    \n+
    306};
    \n+
    307
    \n+
    309template<class F, class Signature, class EntitySet, template<class> class DerivativeTraits = DefaultDerivativeTraits>
    \n+
    310static constexpr bool isDifferentiableGridFunction()
    \n+
    311{ return models<Concept::DifferentiableGridFunction<Signature, EntitySet, DerivativeTraits>, F>(); }
    \n+
    312
    \n+
    313
    \n+
    314
    \n+
    315// GridViewFunction concept ##############################################
    \n+
    316template<class Signature, class GridView>
    \n+\n+
    318
    \n+
    331template<class Range, class Domain, class GridView>
    \n+
    332struct GridViewFunction<Range(Domain), GridView> :
    \n+
    333 Refines<Dune::Functions::Concept::GridFunction<Range(Domain), GridViewEntitySet<GridView,0>>>
    \n+
    334{
    \n+
    335 template<class F>
    \n+
    336 auto require(F&& f) -> decltype(
    \n+
    337 0 // We don't need to check any further expressions, because a GridViewFunction is just a GridFunction with a special EntitySet
    \n+
    338 );
    \n+
    339};
    \n+
    340
    \n+
    342template<class F, class Signature, class GridView>
    \n+
    343static constexpr bool isGridViewFunction()
    \n+
    344{ return models<Concept::GridViewFunction<Signature, GridView>, F>(); }
    \n+
    345
    \n+
    346
    \n+
    347// DifferentiableGridViewFunction concept ##############################################
    \n+
    348template<class Signature, class GridView, template<class> class DerivativeTraits = DefaultDerivativeTraits>
    \n+\n+
    350
    \n+
    364template<class Range, class Domain, class GridView, template<class> class DerivativeTraits>
    \n+
    365struct DifferentiableGridViewFunction<Range(Domain), GridView, DerivativeTraits> :
    \n+
    366 Refines<Dune::Functions::Concept::DifferentiableGridFunction<Range(Domain), GridViewEntitySet<GridView,0>, DerivativeTraits>>
    \n+
    367{
    \n+
    368 template<class F>
    \n+
    369 auto require(F&& f) -> decltype(
    \n+
    370 0 // We don't need to check any further expressions, because a GridViewFunction is just a GridFunction with a special EntitySet
    \n+
    371 );
    \n+
    372};
    \n+
    373
    \n+
    375template<class F, class Signature, class GridView, template<class> class DerivativeTraits = DefaultDerivativeTraits>
    \n+
    376static constexpr bool isDifferentiableGridViewFunction()
    \n+
    377{ return models<Concept::DifferentiableGridViewFunction<Signature, GridView, DerivativeTraits>, F>(); }
    \n+
    378
    \n+
    379
    \n+
    380
    \n+
    381}}} // namespace Dune::Functions::Concept
    \n+
    382
    \n+
    383#endif // DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH
    \n+\n+\n+\n+
    static constexpr bool isGridFunction()
    Check if F models the GridFunction concept with given signature and entity set.
    Definition: functionconcepts.hh:269
    \n+
    static constexpr bool isDifferentiableLocalFunction()
    Check if F models the DifferentiableLocalFunction concept with given signature and local context.
    Definition: functionconcepts.hh:204
    \n+
    static constexpr bool isFunction()
    Check if F models the Function concept with given signature.
    Definition: functionconcepts.hh:88
    \n+
    static constexpr bool isDifferentiableGridViewFunction()
    Check if F models the DifferentiableGridViewFunction concept with given signature.
    Definition: functionconcepts.hh:376
    \n+
    static constexpr bool isDifferentiableFunction()
    Check if F models the DifferentiableFunction concept with given signature.
    Definition: functionconcepts.hh:127
    \n+
    static constexpr bool isGridViewFunction()
    Check if F models the GridViewFunction concept with given signature.
    Definition: functionconcepts.hh:343
    \n+
    static constexpr bool isEntitySet()
    Check if F models the GridFunction concept with given signature and entity set.
    Definition: functionconcepts.hh:231
    \n+
    static constexpr bool isDifferentiableGridFunction()
    Check if F models the DifferentiableGridFunction concept with given signature and entity set.
    Definition: functionconcepts.hh:310
    \n+
    static constexpr bool isLocalFunction()
    Check if F models the LocalFunction concept with given signature and local context.
    Definition: functionconcepts.hh:166
    \n+
    TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
    Obtain derivative of TrigonometricFunction function.
    Definition: trigonometricfunction.hh:39
    \n+
    static constexpr auto isCallable()
    Check if f is callable with given argument list.
    Definition: functionconcepts.hh:47
    \n
    Definition: polynomial.hh:10
    \n-
    Check if type is a statically sized container.
    Definition: type_traits.hh:83
    \n-
    Obtain size of statically sized container.
    Definition: type_traits.hh:97
    \n+
    Default implementation for derivative traits.
    Definition: defaultderivativetraits.hh:37
    \n+
    Concept objects that can be called with given argument list.
    Definition: functionconcepts.hh:33
    \n+
    auto require(F &&f) -> decltype(f(std::declval< Args >()...))
    \n+
    Definition: functionconcepts.hh:66
    \n+
    auto require(F &&f) -> decltype(requireConvertible< Range >(f(std::declval< Domain >())))
    \n+
    Definition: functionconcepts.hh:100
    \n+
    typename SignatureTraits< Range(Domain)>::template DerivativeSignature< DerivativeTraits > DerivativeSignature
    Definition: functionconcepts.hh:116
    \n+
    auto require(F &&f) -> decltype(derivative(f), requireConcept< Function< DerivativeSignature > >(derivative(f)))
    \n+
    Definition: functionconcepts.hh:139
    \n+
    auto require(F &&f) -> decltype(f.bind(std::declval< LocalContext >()), f.unbind(), requireConvertible< bool >(f.bound()), f.localContext(), requireConvertible< LocalContext >(f.localContext()))
    \n+\n+
    auto require(F &&f) -> decltype(f.bind(std::declval< LocalContext >()), f.unbind(), f.localContext(), requireConvertible< LocalContext >(f.localContext()))
    \n+
    Concept for an entity set for a Concept::GridFunction<Range(Domain), EntitySet, DerivativeTraits>
    Definition: functionconcepts.hh:220
    \n+
    auto require(E &&f) -> decltype(requireType< typename E::Element >(), requireType< typename E::LocalCoordinate >(), requireType< typename E::GlobalCoordinate >())
    \n+
    Definition: functionconcepts.hh:238
    \n+
    typename EntitySet::Element LocalContext
    Definition: functionconcepts.hh:254
    \n+
    Range(typename EntitySet::LocalCoordinate) LocalSignature
    Definition: functionconcepts.hh:253
    \n+
    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 >())
    \n+
    Definition: functionconcepts.hh:275
    \n+
    typename Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits >::template Traits< R > LocalDerivativeTraits
    Definition: functionconcepts.hh:300
    \n+
    auto require(F &&f) -> decltype(requireConcept< DifferentiableLocalFunction< LocalSignature, LocalContext, LocalDerivativeTraits > >(localFunction(f)))
    \n+
    Range(typename EntitySet::LocalCoordinate) LocalSignature
    Definition: functionconcepts.hh:296
    \n+
    typename EntitySet::Element LocalContext
    Definition: functionconcepts.hh:297
    \n+
    Definition: functionconcepts.hh:317
    \n+\n+\n+\n+
    Helper class to deduce the signature of a callable.
    Definition: signature.hh:56
    \n+
    Definition: signature.hh:102
    \n+
    Derivative traits for local functions.
    Definition: localderivativetraits.hh:28
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,108 +5,460 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-type_traits.hh\n+functionconcepts.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH\n- 4#define DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH\n+ 3#ifndef DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH\n+ 4#define DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH\n 5\n- 6#include \n- 7\n- 8#include \n- 9\n- 10namespace Dune {\n- 11namespace Functions {\n+ 6#include \n+ 7#include \n+ 8\n+ 9#include \n+ 10#include \n+ 11#include \n 12\n- 13\n- 24template\n-25using enableIfConstructible = typename std::enable_if<\n- 26 std::is_constructible::value, int>::type;\n- 27\n- 28\n- 29\n- 30namespace Imp {\n- 31\n- 32 // As a last resort try if there's a static constexpr size()\n- 33 template\n- 34 constexpr auto staticSize(const T*, const PriorityTag<0>&)\n- 35 -> decltype(std::integral_constant())\n- 36 {\n- 37 return {};\n- 38 }\n+ 13namespace Dune {\n+ 14namespace Functions {\n+ 15namespace Concept {\n+ 16\n+ 17using namespace Dune::Concept;\n+ 18\n+ 19\n+ 20\n+ 21// Callable concept\n+############################################################\n+ 22\n+ 23\n+ 31template\n+32struct Callable\n+ 33{\n+ 34 template\n+35 auto require(F&& f) -> decltype(\n+ 36 f(std::declval()...)\n+ 37 );\n+ 38};\n 39\n- 40 // Try if class has constexpr default constructor and size method\n- 41 template\n- 42 constexpr auto staticSize(const T*, const PriorityTag<1>&)\n- 43 -> decltype(std::integral_constant())\n- 44 {\n- 45 return {};\n- 46 }\n- 47\n- 48 // Try if tuple_size is implemented for class\n- 49 template\n- 50 constexpr auto staticSize(const T*, const PriorityTag<2>&)\n- 51 -> decltype(std::integral_constant::value>\n-())\n- 52 {\n- 53 return {};\n- 54 }\n- 55\n- 56 template\n- 57 constexpr std::false_type hasStaticSize(const T* t, const PriorityTag<0>&\n-p)\n- 58 {\n- 59 return {};\n- 60 }\n+ 46template\n+47static constexpr auto isCallable()\n+ 48{ return models, F>(); }\n+ 49\n+ 56template\n+57static constexpr auto isCallable(F&&, Args&&...)\n+ 58{\n+ 59 return models, F>();\n+ 60}\n 61\n- 62 template\n- 63 constexpr auto hasStaticSize(const T* t, const PriorityTag<1>& p)\n- 64 -> decltype(staticSize(t ,PriorityTag<42>()), std::true_type())\n- 65 {\n- 66 return {};\n- 67 }\n- 68\n- 69}\n- 70\n- 71\n- 72\n- 80template\n-81struct HasStaticSize :\n- 82 public decltype(Imp::hasStaticSize((typename std::decay::type*)\n-(nullptr), PriorityTag<42>()))\n- 83{};\n- 84\n+ 62\n+ 63\n+ 64// Function concept\n+############################################################\n+ 65template\n+66struct Function;\n+ 67\n+ 76template\n+77struct Function : Refines >\n+ 78{\n+ 79 template\n+80 auto require(F&& f) -> decltype(\n+ 81 // F models Function if the result of F(Domain) is\n+implicitly convertible to Range\n+ 82 requireConvertible(f(std::declval()))\n+ 83 );\n+ 84};\n 85\n- 86\n- 94template\n-95struct StaticSize :\n- 96 public decltype(Imp::staticSize((typename std::decay::type*)(nullptr),\n-PriorityTag<42>()))\n- 97{};\n- 98\n- 99\n- 100\n- 101}} // namespace Dune::Functions\n- 102\n- 103#endif // DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH\n-Dune::Functions::enableIfConstructible\n-typename std::enable_if< std::is_constructible< T, Args... >::value, int >::\n-type enableIfConstructible\n-Helper to constrain forwarding constructors.\n-Definition: type_traits.hh:26\n+ 87template\n+88static constexpr bool isFunction()\n+ 89{ return models, F>(); }\n+ 90\n+ 92template class DerivativeTraits>\n+93static constexpr bool isFunction(F&& f, SignatureTag)\n+ 94{ return models, F>(); }\n+ 95\n+ 96\n+ 97\n+ 98// DifferentiableFunction concept\n+##############################################\n+ 99template class DerivativeTraits =\n+DefaultDerivativeTraits>\n+100struct DifferentiableFunction;\n+ 101\n+ 113template class DerivativeTraits>\n+114struct DifferentiableFunction :\n+Refines >\n+ 115{\n+116 using DerivativeSignature = typename SignatureTraits::\n+template DerivativeSignature;\n+ 117\n+ 118 template\n+119 auto require(F&& f) -> decltype(\n+ 120 derivative(f),\n+ 121 requireConcept>(derivative(f))\n+ 122 );\n+ 123};\n+ 124\n+ 126template class DerivativeTraits =\n+DefaultDerivativeTraits>\n+127static constexpr bool isDifferentiableFunction()\n+ 128{ return models, F>(); }\n+ 129\n+ 131template class DerivativeTraits>\n+132static constexpr bool isDifferentiableFunction(F&& f,\n+SignatureTag)\n+ 133{ return models, F>(); }\n+ 134\n+ 135\n+ 136\n+ 137// LocalFunction concept ##############################################\n+ 138template\n+139struct LocalFunction;\n+ 140\n+ 150template\n+151struct LocalFunction :\n+ 152 Refines >\n+ 153{\n+ 154 template\n+155 auto require(F&& f) -> decltype(\n+ 156 f.bind(std::declval()),\n+ 157 f.unbind(),\n+ 158 requireConvertible(f.bound()),\n+ 159 f.localContext(),\n+ 160 requireConvertible(f.localContext())\n+ 161 );\n+ 162};\n+ 163\n+ 165template\n+166static constexpr bool isLocalFunction()\n+ 167{ return models, F>(); }\n+ 168\n+ 169\n+ 170// DifferentiableLocalFunction concept\n+##############################################\n+ 171template class\n+DerivativeTraits = DefaultDerivativeTraits>\n+172struct DifferentiableLocalFunction;\n+ 173\n+ 186template\n+class DerivativeTraits>\n+187struct DifferentiableLocalFunction :\n+ 188 Refines<\n+ 189 Dune::Functions::Concept::DifferentiableFunction,\n+ 190 Dune::Functions::Concept::LocalFunction\n+ 191 >\n+ 192{\n+ 193 template\n+194 auto require(F&& f) -> decltype(\n+ 195 f.bind(std::declval()),\n+ 196 f.unbind(),\n+ 197 f.localContext(),\n+ 198 requireConvertible(f.localContext())\n+ 199 );\n+ 200};\n+ 201\n+ 203template\n+class DerivativeTraits = DefaultDerivativeTraits>\n+204static constexpr bool isDifferentiableLocalFunction()\n+ 205{ return models, F>(); }\n+ 206\n+ 207\n+ 208// EntitySet concept ##############################################\n+ 209\n+219struct EntitySet\n+ 220{\n+ 221 template\n+222 auto require(E&& f) -> decltype(\n+ 223 requireType(),\n+ 224 requireType(),\n+ 225 requireType()\n+ 226 );\n+ 227};\n+ 228\n+ 230template\n+231static constexpr bool isEntitySet()\n+ 232{ return models(); }\n+ 233\n+ 234\n+ 235\n+ 236// GridFunction concept ##############################################\n+ 237template\n+238struct GridFunction;\n+ 239\n+ 249template\n+250struct GridFunction :\n+ 251 Refines >\n+ 252{\n+253 using LocalSignature = Range(typename EntitySet::LocalCoordinate);\n+254 using LocalContext = typename EntitySet::Element;\n+ 255\n+ 256 template\n+257 auto require(F&& f) -> decltype(\n+ 258 localFunction(f),\n+ 259 f.entitySet(),\n+ 260 requireConcept>(localFunction\n+(f)),\n+ 261 requireConcept(),\n+ 262 requireConvertible(f.entitySet()),\n+ 263 requireConvertible()\n+ 264 );\n+ 265};\n+ 266\n+ 268template\n+269static constexpr bool isGridFunction()\n+ 270{ return models, F>(); }\n+ 271\n+ 272\n+ 273// DifferentiableGridFunction concept\n+##############################################\n+ 274template class\n+DerivativeTraits = DefaultDerivativeTraits>\n+275struct DifferentiableGridFunction;\n+ 276\n+ 289template class\n+DerivativeTraits>\n+290struct DifferentiableGridFunction :\n+ 291 Refines<\n+ 292 Dune::Functions::Concept::DifferentiableFunction,\n+ 293 Dune::Functions::Concept::GridFunction\n+ 294 >\n+ 295{\n+296 using LocalSignature = Range(typename EntitySet::LocalCoordinate);\n+297 using LocalContext = typename EntitySet::Element;\n+ 298\n+ 299 template\n+300 using LocalDerivativeTraits = typename Dune::Functions::\n+LocalDerivativeTraits::template Traits;\n+ 301\n+ 302 template\n+303 auto require(F&& f) -> decltype(\n+ 304 requireConcept>(localFunction(f))\n+ 305 );\n+ 306};\n+ 307\n+ 309template class\n+DerivativeTraits = DefaultDerivativeTraits>\n+310static constexpr bool isDifferentiableGridFunction()\n+ 311{ return models, F>(); }\n+ 312\n+ 313\n+ 314\n+ 315// GridViewFunction concept ##############################################\n+ 316template\n+317struct GridViewFunction;\n+ 318\n+ 331template\n+332struct GridViewFunction :\n+ 333 Refines>>\n+ 334{\n+ 335 template\n+336 auto require(F&& f) -> decltype(\n+ 337 0 // We don't need to check any further expressions, because a\n+GridViewFunction is just a GridFunction with a special EntitySet\n+ 338 );\n+ 339};\n+ 340\n+ 342template\n+343static constexpr bool isGridViewFunction()\n+ 344{ return models, F>(); }\n+ 345\n+ 346\n+ 347// DifferentiableGridViewFunction concept\n+##############################################\n+ 348template class\n+DerivativeTraits = DefaultDerivativeTraits>\n+349struct DifferentiableGridViewFunction;\n+ 350\n+ 364template class\n+DerivativeTraits>\n+365struct DifferentiableGridViewFunction :\n+ 366 Refines, DerivativeTraits>>\n+ 367{\n+ 368 template\n+369 auto require(F&& f) -> decltype(\n+ 370 0 // We don't need to check any further expressions, because a\n+GridViewFunction is just a GridFunction with a special EntitySet\n+ 371 );\n+ 372};\n+ 373\n+ 375template class\n+DerivativeTraits = DefaultDerivativeTraits>\n+376static constexpr bool isDifferentiableGridViewFunction()\n+ 377{ return models, F>(); }\n+ 378\n+ 379\n+ 380\n+ 381}}} // namespace Dune::Functions::Concept\n+ 382\n+ 383#endif // DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH\n+signature.hh\n+gridviewentityset.hh\n+localderivativetraits.hh\n+Dune::Functions::Concept::isGridFunction\n+static constexpr bool isGridFunction()\n+Check if F models the GridFunction concept with given signature and entity set.\n+Definition: functionconcepts.hh:269\n+Dune::Functions::Concept::isDifferentiableLocalFunction\n+static constexpr bool isDifferentiableLocalFunction()\n+Check if F models the DifferentiableLocalFunction concept with given signature\n+and local context.\n+Definition: functionconcepts.hh:204\n+Dune::Functions::Concept::isFunction\n+static constexpr bool isFunction()\n+Check if F models the Function concept with given signature.\n+Definition: functionconcepts.hh:88\n+Dune::Functions::Concept::isDifferentiableGridViewFunction\n+static constexpr bool isDifferentiableGridViewFunction()\n+Check if F models the DifferentiableGridViewFunction concept with given\n+signature.\n+Definition: functionconcepts.hh:376\n+Dune::Functions::Concept::isDifferentiableFunction\n+static constexpr bool isDifferentiableFunction()\n+Check if F models the DifferentiableFunction concept with given signature.\n+Definition: functionconcepts.hh:127\n+Dune::Functions::Concept::isGridViewFunction\n+static constexpr bool isGridViewFunction()\n+Check if F models the GridViewFunction concept with given signature.\n+Definition: functionconcepts.hh:343\n+Dune::Functions::Concept::isEntitySet\n+static constexpr bool isEntitySet()\n+Check if F models the GridFunction concept with given signature and entity set.\n+Definition: functionconcepts.hh:231\n+Dune::Functions::Concept::isDifferentiableGridFunction\n+static constexpr bool isDifferentiableGridFunction()\n+Check if F models the DifferentiableGridFunction concept with given signature\n+and entity set.\n+Definition: functionconcepts.hh:310\n+Dune::Functions::Concept::isLocalFunction\n+static constexpr bool isLocalFunction()\n+Check if F models the LocalFunction concept with given signature and local\n+context.\n+Definition: functionconcepts.hh:166\n+Dune::Functions::derivative\n+TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const\n+TrigonometricFunction< K, sinFactor, cosFactor > &f)\n+Obtain derivative of TrigonometricFunction function.\n+Definition: trigonometricfunction.hh:39\n+Dune::Functions::Concept::isCallable\n+static constexpr auto isCallable()\n+Check if f is callable with given argument list.\n+Definition: functionconcepts.hh:47\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::HasStaticSize\n-Check if type is a statically sized container.\n-Definition: type_traits.hh:83\n-Dune::Functions::StaticSize\n-Obtain size of statically sized container.\n-Definition: type_traits.hh:97\n+Dune::Functions::DefaultDerivativeTraits\n+Default implementation for derivative traits.\n+Definition: defaultderivativetraits.hh:37\n+Dune::Functions::Concept::Callable\n+Concept objects that can be called with given argument list.\n+Definition: functionconcepts.hh:33\n+Dune::Functions::Concept::Callable::require\n+auto require(F &&f) -> decltype(f(std::declval< Args >()...))\n+Dune::Functions::Concept::Function\n+Definition: functionconcepts.hh:66\n+Dune::Functions::Concept::Function<_Range(Domain)>::require\n+auto require(F &&f) -> decltype(requireConvertible< Range >(f(std::declval<\n+Domain >())))\n+Dune::Functions::Concept::DifferentiableFunction\n+Definition: functionconcepts.hh:100\n+Dune::Functions::Concept::DifferentiableFunction<_Range(Domain),\n+DerivativeTraits_>::DerivativeSignature\n+typename SignatureTraits< Range(Domain)>::template DerivativeSignature<\n+DerivativeTraits > DerivativeSignature\n+Definition: functionconcepts.hh:116\n+Dune::Functions::Concept::DifferentiableFunction<_Range(Domain),\n+DerivativeTraits_>::require\n+auto require(F &&f) -> decltype(derivative(f), requireConcept< Function<\n+DerivativeSignature > >(derivative(f)))\n+Dune::Functions::Concept::LocalFunction\n+Definition: functionconcepts.hh:139\n+Dune::Functions::Concept::LocalFunction<_Range(Domain),_LocalContext_>::require\n+auto require(F &&f) -> decltype(f.bind(std::declval< LocalContext >()),\n+f.unbind(), requireConvertible< bool >(f.bound()), f.localContext(),\n+requireConvertible< LocalContext >(f.localContext()))\n+Dune::Functions::Concept::DifferentiableLocalFunction\n+Definition: functionconcepts.hh:172\n+Dune::Functions::Concept::DifferentiableLocalFunction<_Range(Domain),\n+LocalContext,_DerivativeTraits_>::require\n+auto require(F &&f) -> decltype(f.bind(std::declval< LocalContext >()),\n+f.unbind(), f.localContext(), requireConvertible< LocalContext >(f.localContext\n+()))\n+Dune::Functions::Concept::EntitySet\n+Concept for an entity set for a Concept::GridFunction\n+Definition: functionconcepts.hh:220\n+Dune::Functions::Concept::EntitySet::require\n+auto require(E &&f) -> decltype(requireType< typename E::Element >(),\n+requireType< typename E::LocalCoordinate >(), requireType< typename E::\n+GlobalCoordinate >())\n+Dune::Functions::Concept::GridFunction\n+Definition: functionconcepts.hh:238\n+Dune::Functions::Concept::GridFunction<_Range(Domain),_EntitySet_>::\n+LocalContext\n+typename EntitySet::Element LocalContext\n+Definition: functionconcepts.hh:254\n+Dune::Functions::Concept::GridFunction<_Range(Domain),_EntitySet_>::\n+LocalSignature\n+Range(typename EntitySet::LocalCoordinate) LocalSignature\n+Definition: functionconcepts.hh:253\n+Dune::Functions::Concept::GridFunction<_Range(Domain),_EntitySet_>::require\n+auto require(F &&f) -> decltype(localFunction(f), f.entitySet(),\n+requireConcept< LocalFunction< LocalSignature, LocalContext > >(localFunction\n+(f)), requireConcept< Concept::EntitySet, EntitySet >(), requireConvertible<\n+EntitySet >(f.entitySet()), requireConvertible< typename EntitySet::\n+GlobalCoordinate, Domain >())\n+Dune::Functions::Concept::DifferentiableGridFunction\n+Definition: functionconcepts.hh:275\n+Dune::Functions::Concept::DifferentiableGridFunction<_Range(Domain),_EntitySet,\n+DerivativeTraits_>::LocalDerivativeTraits\n+typename Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits\n+>::template Traits< R > LocalDerivativeTraits\n+Definition: functionconcepts.hh:300\n+Dune::Functions::Concept::DifferentiableGridFunction<_Range(Domain),_EntitySet,\n+DerivativeTraits_>::require\n+auto require(F &&f) -> decltype(requireConcept< DifferentiableLocalFunction<\n+LocalSignature, LocalContext, LocalDerivativeTraits > >(localFunction(f)))\n+Dune::Functions::Concept::DifferentiableGridFunction<_Range(Domain),_EntitySet,\n+DerivativeTraits_>::LocalSignature\n+Range(typename EntitySet::LocalCoordinate) LocalSignature\n+Definition: functionconcepts.hh:296\n+Dune::Functions::Concept::DifferentiableGridFunction<_Range(Domain),_EntitySet,\n+DerivativeTraits_>::LocalContext\n+typename EntitySet::Element LocalContext\n+Definition: functionconcepts.hh:297\n+Dune::Functions::Concept::GridViewFunction\n+Definition: functionconcepts.hh:317\n+Dune::Functions::Concept::GridViewFunction<_Range(Domain),_GridView_>::require\n+auto require(F &&f) -> decltype(0)\n+Dune::Functions::Concept::DifferentiableGridViewFunction\n+Definition: functionconcepts.hh:349\n+Dune::Functions::Concept::DifferentiableGridViewFunction<_Range(Domain),\n+GridView,_DerivativeTraits_>::require\n+auto require(F &&f) -> decltype(0)\n+Dune::Functions::SignatureTraits\n+Helper class to deduce the signature of a callable.\n+Definition: signature.hh:56\n+Dune::Functions::SignatureTag\n+Definition: signature.hh:102\n+Dune::Functions::LocalDerivativeTraits\n+Derivative traits for local functions.\n+Definition: localderivativetraits.hh:28\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00008.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00008.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: differentiablefunction_imp.hh File Reference\n+dune-functions: referencehelper.hh File Reference\n \n \n \n \n \n \n \n@@ -63,30 +63,53 @@\n \n \n
    \n \n-
    differentiablefunction_imp.hh File Reference
    \n+Namespaces |\n+Typedefs |\n+Functions |\n+Variables
    \n+
    referencehelper.hh File Reference
    \n \n
    \n-
    #include <dune/common/exceptions.hh>
    \n-#include <dune/common/concept.hh>
    \n-#include <dune/functions/common/type_traits.hh>
    \n+
    #include <type_traits>
    \n+#include <dune/common/referencehelper.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n \n \n \n \n+

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n+\n+\n+\n+\n+\n+

    \n+Typedefs

    template<class T >
    using Dune::Functions::ResolveRef_t = Dune::ResolveRef_t< T >
     This is an alias for Dune::ResolveRef_t. More...
     
    \n+\n+\n+\n+\n+\n+

    \n+Functions

    template<class T >
    decltype(auto) Dune::Functions::resolveRef (T &&t)
     This is an alias for Dune::resolveRef. More...
     
    \n+\n+\n+\n+\n+\n

    \n+Variables

    template<class T >
    constexpr bool Dune::Functions::IsReferenceWrapper_v = Dune::IsReferenceWrapper_v<T>
     This is an alias for Dune::IsReferenceWrapper_v. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,21 +5,36 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-Namespaces\n-differentiablefunction_imp.hh File Reference\n-#include \n-#include \n-#include \n+Namespaces | Typedefs | Functions | Variables\n+referencehelper.hh File Reference\n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n+ Typedefs\n+template\n+using\u00a0Dune::Functions::ResolveRef_t = Dune::ResolveRef_t< T >\n+\u00a0 This is an alias for Dune::ResolveRef_t. More...\n+\u00a0\n+ Functions\n+template\n+decltype(auto)\u00a0Dune::Functions::resolveRef (T &&t)\n+\u00a0 This is an alias for Dune::resolveRef. More...\n+\u00a0\n+ Variables\n+template\n+constexpr bool\u00a0Dune::Functions::IsReferenceWrapper_v = Dune::\n+ IsReferenceWrapper_v\n+\u00a0 This is an alias for Dune::IsReferenceWrapper_v. More...\n+\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00008_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00008_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: differentiablefunction_imp.hh Source File\n+dune-functions: referencehelper.hh Source File\n \n \n \n \n \n \n \n@@ -62,116 +62,65 @@\n \n \n
    \n
    \n-
    differentiablefunction_imp.hh
    \n+
    referencehelper.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH
    \n-
    4#define DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_COMMON_REFERENCE_HELPER_HH
    \n+
    4#define DUNE_FUNCTIONS_COMMON_REFERENCE_HELPER_HH
    \n
    5
    \n-
    6#include <dune/common/exceptions.hh>
    \n-
    7#include <dune/common/concept.hh>
    \n-
    8
    \n-\n-
    10
    \n+
    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.
    \n+
    7
    \n+
    8#include <type_traits>
    \n+
    9
    \n+
    10#include <dune/common/referencehelper.hh>
    \n
    11
    \n-
    12namespace Dune {
    \n-
    13namespace Functions {
    \n-
    14namespace Imp {
    \n-
    15
    \n-
    19struct HasFreeDerivative
    \n-
    20{
    \n-
    21 template<class F>
    \n-
    22 auto require(F&& f) -> decltype(
    \n-
    23 derivative(f)
    \n-
    24 );
    \n-
    25};
    \n-
    26
    \n+
    12
    \n+
    13
    \n+
    14
    \n+
    15namespace Dune {
    \n+
    16namespace Functions {
    \n+
    17
    \n+
    18
    \n+
    23template<class T>
    \n+
    24[[deprecated("Use Dune::IsReferenceWrapper_v instead. Will be removed after release 2.9.")]]
    \n+
    25constexpr bool
    \n+
    26IsReferenceWrapper_v = Dune::IsReferenceWrapper_v<T>;
    \n
    27
    \n
    28
    \n-
    29template<class Dummy, class F,
    \n-
    30 typename std::enable_if<
    \n-
    31 models< HasFreeDerivative, F>() , int>::type = 0>
    \n-
    32auto derivativeIfImplemented(const F& f) -> decltype(derivative(f))
    \n-
    33{
    \n-
    34 return derivative(f);
    \n-
    35}
    \n-
    36
    \n-
    37
    \n-
    38
    \n-
    39template<class Dummy, class F,
    \n-
    40 typename std::enable_if<
    \n-
    41 not(models< HasFreeDerivative, F>()) , int>::type = 0>
    \n-
    42Dummy derivativeIfImplemented(const F& f)
    \n-
    43{
    \n-
    44 DUNE_THROW(Dune::NotImplemented, "Derivative not implemented");
    \n-
    45}
    \n-
    46
    \n-
    47
    \n-
    48
    \n-
    49template<class Signature, class DerivativeInterface>
    \n-
    50class DifferentiableFunctionWrapperInterface
    \n-
    51{};
    \n-
    52
    \n-
    53// Interface of type erasure wrapper
    \n-
    54//
    \n-
    55// Notice that the basic interface of polymorphic classes (destructor, clone, ...)
    \n-
    56// will be added by the type erasure foundation classes.
    \n-
    57template<class Range, class Domain, class DerivativeInterface>
    \n-
    58class DifferentiableFunctionWrapperInterface<Range(Domain), DerivativeInterface>
    \n-
    59{
    \n-
    60public:
    \n-
    61 virtual Range operator() (const Domain& x) const = 0;
    \n-
    62
    \n-
    63 virtual DerivativeInterface derivative() const = 0;
    \n-
    64};
    \n-
    65
    \n-
    66
    \n-
    67
    \n-
    68template<class Signature, class DerivativeInterface, class B>
    \n-
    69class DifferentiableFunctionWrapperImplementation
    \n-
    70{};
    \n-
    71
    \n-
    72// Implementation of type erasure wrapper
    \n-
    73template<class Range, class Domain, class DerivativeInterface, class B>
    \n-
    74class DifferentiableFunctionWrapperImplementation< Range(Domain), DerivativeInterface, B> :
    \n-
    75 public B
    \n-
    76{
    \n-
    77public:
    \n-
    78
    \n-
    79 using B::B;
    \n-
    80 using Wrapped = typename B::Wrapped;
    \n-
    81
    \n-
    82 virtual Range operator() (const Domain& x) const
    \n-
    83 {
    \n-
    84 return this->get()(x);
    \n-
    85 }
    \n-
    86
    \n-
    87 virtual DerivativeInterface derivative() const
    \n-
    88 {
    \n-
    89 return derivativeIfImplemented<DerivativeInterface, Wrapped>(this->get());
    \n-
    90 }
    \n-
    91};
    \n-
    92
    \n-
    93
    \n-
    94
    \n-
    95}}} // namespace Dune::Functions::Imp
    \n-
    96
    \n-
    97
    \n-
    98
    \n-
    99#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH
    \n-\n-
    TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
    Obtain derivative of TrigonometricFunction function.
    Definition: trigonometricfunction.hh:39
    \n+
    33template<class T>
    \n+
    34decltype(auto)
    \n+\n+
    36[[deprecated("Use Dune::resolveRef instead. Will be removed after release 2.9.")]]
    \n+
    37(T&& t)
    \n+
    38{
    \n+
    39 return Dune::resolveRef(std::forward<T>(t));
    \n+
    40}
    \n+
    41
    \n+
    46template<class T>
    \n+\n+
    48[[deprecated("Use Dune::ResolveRef_t instead. Will be removed after release 2.9.")]]
    \n+
    49 = Dune::ResolveRef_t<T>;
    \n+
    50
    \n+
    51
    \n+
    52}} // namespace Dune::Functions
    \n+
    53
    \n+
    54
    \n+
    55
    \n+
    56#endif // DUNE_FUNCTIONS_COMMON_REFERENCE_HELPER_HH
    \n
    Definition: polynomial.hh:10
    \n+
    constexpr bool IsReferenceWrapper_v
    This is an alias for Dune::IsReferenceWrapper_v.
    Definition: referencehelper.hh:26
    \n+
    Dune::ResolveRef_t< T > ResolveRef_t
    This is an alias for Dune::ResolveRef_t.
    Definition: referencehelper.hh:49
    \n+
    decltype(auto) resolveRef(T &&t)
    This is an alias for Dune::resolveRef.
    Definition: referencehelper.hh:37
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,119 +5,75 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-differentiablefunction_imp.hh\n+referencehelper.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH\n- 4#define DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH\n+ 3#ifndef DUNE_FUNCTIONS_COMMON_REFERENCE_HELPER_HH\n+ 4#define DUNE_FUNCTIONS_COMMON_REFERENCE_HELPER_HH\n 5\n- 6#include \n- 7#include \n- 8\n- 9#include \n- 10\n+ 6#warning The header dune/functions/common/referencehelper.hh is deprecated\n+and will be removed after release 2.9. Include dune/common/referencehelper.hh\n+instead.\n+ 7\n+ 8#include \n+ 9\n+ 10#include \n 11\n- 12namespace Dune {\n- 13namespace Functions {\n- 14namespace Imp {\n- 15\n- 19struct HasFreeDerivative\n- 20{\n- 21 template\n- 22 auto require(F&& f) -> decltype(\n- 23 derivative(f)\n- 24 );\n- 25};\n- 26\n+ 12\n+ 13\n+ 14\n+ 15namespace Dune {\n+ 16namespace Functions {\n+ 17\n+ 18\n+ 23template\n+ 24[[deprecated(\"Use Dune::IsReferenceWrapper_v instead. Will be removed after\n+release 2.9.\")]]\n+ 25constexpr bool\n+26IsReferenceWrapper_v = Dune::IsReferenceWrapper_v;\n 27\n 28\n- 29template() , int>::type = 0>\n- 32auto derivativeIfImplemented(const F& f) -> decltype(derivative(f))\n- 33{\n- 34 return derivative(f);\n- 35}\n- 36\n- 37\n- 38\n- 39template()) , int>::type = 0>\n- 42Dummy derivativeIfImplemented(const F& f)\n- 43{\n- 44 DUNE_THROW(Dune::NotImplemented, \"Derivative not implemented\");\n- 45}\n- 46\n- 47\n- 48\n- 49template\n- 50class DifferentiableFunctionWrapperInterface\n- 51{};\n- 52\n- 53// Interface of type erasure wrapper\n- 54//\n- 55// Notice that the basic interface of polymorphic classes (destructor,\n-clone, ...)\n- 56// will be added by the type erasure foundation classes.\n- 57template\n- 58class DifferentiableFunctionWrapperInterface\n- 59{\n- 60public:\n- 61 virtual Range operator() (const Domain& x) const = 0;\n- 62\n- 63 virtual DerivativeInterface derivative() const = 0;\n- 64};\n- 65\n- 66\n- 67\n- 68template\n- 69class DifferentiableFunctionWrapperImplementation\n- 70{};\n- 71\n- 72// Implementation of type erasure wrapper\n- 73template\n- 74class DifferentiableFunctionWrapperImplementation< Range(Domain),\n-DerivativeInterface, B> :\n- 75 public B\n- 76{\n- 77public:\n- 78\n- 79 using B::B;\n- 80 using Wrapped = typename B::Wrapped;\n- 81\n- 82 virtual Range operator() (const Domain& x) const\n- 83 {\n- 84 return this->get()(x);\n- 85 }\n- 86\n- 87 virtual DerivativeInterface derivative() const\n- 88 {\n- 89 return derivativeIfImplemented(this->get());\n- 90 }\n- 91};\n- 92\n- 93\n- 94\n- 95}}} // namespace Dune::Functions::Imp\n- 96\n- 97\n- 98\n- 99#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH\n-type_traits.hh\n-Dune::Functions::derivative\n-TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const\n-TrigonometricFunction< K, sinFactor, cosFactor > &f)\n-Obtain derivative of TrigonometricFunction function.\n-Definition: trigonometricfunction.hh:39\n+ 33template\n+ 34decltype(auto)\n+35resolveRef\n+ 36[[deprecated(\"Use Dune::resolveRef instead. Will be removed after release\n+2.9.\")]]\n+ 37(T&& t)\n+ 38{\n+ 39 return Dune::resolveRef(std::forward(t));\n+ 40}\n+ 41\n+ 46template\n+47using ResolveRef_t\n+ 48[[deprecated(\"Use Dune::ResolveRef_t instead. Will be removed after release\n+2.9.\")]]\n+ 49 = Dune::ResolveRef_t;\n+ 50\n+ 51\n+ 52}} // namespace Dune::Functions\n+ 53\n+ 54\n+ 55\n+ 56#endif // DUNE_FUNCTIONS_COMMON_REFERENCE_HELPER_HH\n Dune\n Definition: polynomial.hh:10\n+Dune::Functions::IsReferenceWrapper_v\n+constexpr bool IsReferenceWrapper_v\n+This is an alias for Dune::IsReferenceWrapper_v.\n+Definition: referencehelper.hh:26\n+Dune::Functions::ResolveRef_t\n+Dune::ResolveRef_t< T > ResolveRef_t\n+This is an alias for Dune::ResolveRef_t.\n+Definition: referencehelper.hh:49\n+Dune::Functions::resolveRef\n+decltype(auto) resolveRef(T &&t)\n+This is an alias for Dune::resolveRef.\n+Definition: referencehelper.hh:37\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00011.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00011.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: differentiablefunctionfromcallables.hh File Reference\n+dune-functions: localfunction_imp.hh File Reference\n \n \n \n \n \n \n \n@@ -63,50 +63,29 @@\n \n \n
    \n \n-
    differentiablefunctionfromcallables.hh File Reference
    \n+Namespaces
    \n+
    localfunction_imp.hh File Reference
    \n \n
    \n-
    #include <dune/common/typeutilities.hh>
    \n-#include <dune/common/hybridutilities.hh>
    \n-#include <dune/functions/common/signature.hh>
    \n-#include <dune/functions/common/differentiablefunction.hh>
    \n-#include <dune/functions/common/functionconcepts.hh>
    \n+\n

    Go to the source code of this file.

    \n \n-\n-\n-\n-\n-\n-\n-\n-

    \n-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...
     
    \n \n \n \n \n \n-

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n-\n-\n-\n-\n-\n

    \n-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. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,47 +5,20 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-Classes | Namespaces | Functions\n-differentiablefunctionfromcallables.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n+Namespaces\n+localfunction_imp.hh File Reference\n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n- Classes\n-class \u00a0Dune::Functions::DifferentiableFunctionFromCallables<_Range(Domain),\n- DerivativeTraits,_F_>\n- Wrap a list of callable objects as derivative sequence modelling\n-\u00a0 Concept::DifferentiableFunction\n- More...\n-\u00a0\n-class \u00a0Dune::Functions::DifferentiableFunctionFromCallables<_Range(Domain),\n- DerivativeTraits,_F,_DF,_Derivatives..._>\n- Wrap a list of callable objects as derivative sequence modelling\n-\u00a0 Concept::DifferentiableFunction\n- More...\n-\u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n- Functions\n-template class DerivativeTraits, class...\n-F>\n- DifferentiableFunctionFromCallables< Dune::Functions::\n- Signature, DerivativeTraits, F... >\u00a0makeDifferentiableFunctionFromCallables\n- (const SignatureTag< Signature,\n- DerivativeTraits > &signatureTag, F &&...\n- f)\n-\u00a0 Create a DifferentiableFunction from\n- callables. More...\n-\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00011_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00011_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: differentiablefunctionfromcallables.hh Source File\n+dune-functions: localfunction_imp.hh Source File\n \n \n \n \n \n \n \n@@ -62,141 +62,88 @@\n \n \n
    \n
    \n-
    differentiablefunctionfromcallables.hh
    \n+
    localfunction_imp.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH
    \n-
    4#define DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_COMMON_LOCALFUNCTION_FUNCTION_IMP_HH
    \n+
    4#define DUNE_FUNCTIONS_COMMON_LOCALFUNCTION_FUNCTION_IMP_HH
    \n
    5
    \n-
    6
    \n-
    7#include <dune/common/typeutilities.hh>
    \n-
    8#include <dune/common/hybridutilities.hh>
    \n+\n+\n+
    8
    \n
    9
    \n-\n-
    11
    \n-\n-\n+
    10
    \n+
    11namespace Dune {
    \n+
    12namespace Functions {
    \n+
    13namespace Imp {
    \n
    14
    \n-
    15
    \n-
    16
    \n-
    17namespace Dune {
    \n-
    18namespace Functions {
    \n-
    19
    \n-
    20
    \n-
    21
    \n-
    22template<class Signature, template<class> class DerivativeTraits, class... Callables>
    \n-\n-
    24
    \n+
    15// Interface of type erasure wrapper
    \n+
    16//
    \n+
    17// Notice that the basic interface of polymorphic classes (destructor, clone, ...)
    \n+
    18// will be added by the type erasure foundation classes.
    \n+
    19template<class Signature, class DerivativeInterface, class LocalContext>
    \n+
    20class LocalFunctionWrapperInterface :
    \n+
    21 public DifferentiableFunctionWrapperInterface<Signature, DerivativeInterface>
    \n+
    22{
    \n+
    23public:
    \n+
    24 virtual void bind(const LocalContext&) = 0;
    \n
    25
    \n-
    26
    \n-
    43template<class Range, class Domain, template<class> class DerivativeTraits, class F>
    \n-
    44class DifferentiableFunctionFromCallables<Range(Domain), DerivativeTraits, F>
    \n-
    45{
    \n-
    46public:
    \n+
    26 virtual void unbind() = 0;
    \n+
    27
    \n+
    28 virtual bool bound() const = 0;
    \n+
    29
    \n+
    30 virtual const LocalContext& localContext() const = 0;
    \n+
    31};
    \n+
    32
    \n+
    33
    \n+
    34// Implementation of type erasure wrapper
    \n+
    35template<class Signature, class DerivativeInterface, class LocalContext, class B>
    \n+
    36class LocalFunctionWrapperImplementation :
    \n+
    37 public DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>
    \n+
    38{
    \n+
    39 using Base = DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>;
    \n+
    40public:
    \n+
    41 using Base::Base;
    \n+
    42
    \n+
    43 virtual void bind(const LocalContext& context)
    \n+
    44 {
    \n+
    45 this->get().bind(context);
    \n+
    46 }
    \n
    47
    \n-
    49 using Signature = Range(Domain);
    \n-
    50
    \n-\n+
    48 virtual void unbind()
    \n+
    49 {
    \n+
    50 this->get().unbind();
    \n+
    51 }
    \n
    52
    \n-
    54 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(Domain);
    \n-
    55
    \n-\n-
    58
    \n-
    60 template<class FF, disableCopyMove<DifferentiableFunctionFromCallables, FF> = 0>
    \n-\n-
    62 f_(std::forward<FF>(f))
    \n-
    63 {}
    \n-
    64
    \n-
    66 Range operator() (const Domain& x) const
    \n-
    67 {
    \n-
    68 return f_(x);
    \n-
    69 }
    \n-
    70
    \n-\n-
    77 {
    \n-
    78 DUNE_THROW(Dune::NotImplemented, "Derivative not implemented");
    \n-
    79 }
    \n-
    80
    \n-
    81private:
    \n-
    82 F f_;
    \n-
    83};
    \n-
    84
    \n-
    85
    \n-
    86
    \n-
    103template<class Range, class Domain, template<class> class DerivativeTraits, class F, class DF, class... Derivatives>
    \n-
    104class DifferentiableFunctionFromCallables<Range(Domain), DerivativeTraits, F, DF, Derivatives...>
    \n-
    105{
    \n-
    106public:
    \n-
    107
    \n-
    108 using Signature = Range(Domain);
    \n-\n-
    110 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(Domain);
    \n-
    111
    \n-
    112 using Derivative = DifferentiableFunctionFromCallables<DerivativeSignature, DerivativeTraits, DF, Derivatives...>;
    \n-
    113
    \n-
    120 template<class FF, class DFF, class... DDFF>
    \n-
    121 DifferentiableFunctionFromCallables(FF&& f, DFF&& df, DDFF&&... ddf) :
    \n-
    122 f_(std::forward<FF>(f)),
    \n-
    123 df_(std::forward<DFF>(df), std::forward<DDFF>(ddf)...)
    \n-
    124 {}
    \n-
    125
    \n-
    127 Range operator() (const Domain& x) const
    \n-
    128 {
    \n-
    129 return f_(x);
    \n-
    130 }
    \n-
    131
    \n-\n-
    138 {
    \n-
    139 return t.df_;
    \n-
    140 }
    \n-
    141
    \n-
    142private:
    \n-
    143 F f_;
    \n-
    144 Derivative df_;
    \n-
    145};
    \n-
    146
    \n-
    147
    \n-
    162template<class Signature, template<class> class DerivativeTraits, class... F>
    \n-
    163DifferentiableFunctionFromCallables<Signature, DerivativeTraits, F...>
    \n-\n-
    165{
    \n-
    166 return DifferentiableFunctionFromCallables<Signature, DerivativeTraits, F...>(f...);
    \n-
    167}
    \n-
    168
    \n-
    169
    \n-
    170
    \n-
    171} // namespace Functions
    \n-
    172} // namespace Dune
    \n-
    173
    \n-
    174#endif //DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH
    \n-\n-\n-\n-
    friend Derivative derivative(const DifferentiableFunctionFromCallables &t)
    Get derivative of DifferentiableFunctionFromCallables.
    Definition: differentiablefunctionfromcallables.hh:76
    \n-
    DifferentiableFunctionFromCallables< Signature, DerivativeTraits, F... > makeDifferentiableFunctionFromCallables(const SignatureTag< Signature, DerivativeTraits > &signatureTag, F &&... f)
    Create a DifferentiableFunction from callables.
    Definition: differentiablefunctionfromcallables.hh:164
    \n+
    53 virtual bool bound() const
    \n+
    54 {
    \n+
    55 return this->get().bound();
    \n+
    56 }
    \n+
    57
    \n+
    58 virtual const LocalContext& localContext() const
    \n+
    59 {
    \n+
    60 return this->get().localContext();
    \n+
    61 }
    \n+
    62};
    \n+
    63
    \n+
    64}}} // namespace Dune::Functions::Imp
    \n+
    65
    \n+
    66
    \n+
    67
    \n+
    68#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH
    \n+\n+\n
    Definition: polynomial.hh:10
    \n-
    Definition: differentiablefunction.hh:29
    \n-
    Definition: differentiablefunctionfromcallables.hh:23
    \n-
    DifferentiableFunctionFromCallables(FF &&f)
    Constructor copying the given function.
    Definition: differentiablefunctionfromcallables.hh:61
    \n-
    typename SignatureTraits< Signature >::RawSignature RawSignature
    Definition: differentiablefunctionfromcallables.hh:51
    \n-
    Range(Domain) Signature
    Signature of function.
    Definition: differentiablefunctionfromcallables.hh:49
    \n-
    typename DerivativeTraits< RawSignature >::Range(Domain) DerivativeSignature
    Signature of derivative.
    Definition: differentiablefunctionfromcallables.hh:54
    \n-
    typename DerivativeTraits< RawSignature >::Range(Domain) DerivativeSignature
    Definition: differentiablefunctionfromcallables.hh:110
    \n-\n-
    typename SignatureTraits< Signature >::RawSignature RawSignature
    Definition: differentiablefunctionfromcallables.hh:109
    \n-
    DifferentiableFunctionFromCallables(FF &&f, DFF &&df, DDFF &&... ddf)
    Constructor copying the given functions.
    Definition: differentiablefunctionfromcallables.hh:121
    \n-
    Helper class to deduce the signature of a callable.
    Definition: signature.hh:56
    \n-
    Definition: signature.hh:102
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,191 +5,89 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-differentiablefunctionfromcallables.hh\n+localfunction_imp.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH\n- 4#define DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH\n+ 3#ifndef DUNE_FUNCTIONS_COMMON_LOCALFUNCTION_FUNCTION_IMP_HH\n+ 4#define DUNE_FUNCTIONS_COMMON_LOCALFUNCTION_FUNCTION_IMP_HH\n 5\n- 6\n- 7#include \n- 8#include \n+ 6#include \n+ 7#include \n+ 8\n 9\n- 10#include \n- 11\n- 12#include \n- 13#include \n+ 10\n+ 11namespace Dune {\n+ 12namespace Functions {\n+ 13namespace Imp {\n 14\n- 15\n- 16\n- 17namespace Dune {\n- 18namespace Functions {\n- 19\n- 20\n- 21\n- 22template class DerivativeTraits, class...\n-Callables>\n-23class DifferentiableFunctionFromCallables;\n- 24\n+ 15// Interface of type erasure wrapper\n+ 16//\n+ 17// Notice that the basic interface of polymorphic classes (destructor,\n+clone, ...)\n+ 18// will be added by the type erasure foundation classes.\n+ 19template\n+ 20class LocalFunctionWrapperInterface :\n+ 21 public DifferentiableFunctionWrapperInterface\n+ 22{\n+ 23public:\n+ 24 virtual void bind(const LocalContext&) = 0;\n 25\n- 26\n- 43template class DerivativeTraits,\n-class F>\n-44class DifferentiableFunctionFromCallables\n- 45{\n- 46public:\n+ 26 virtual void unbind() = 0;\n+ 27\n+ 28 virtual bool bound() const = 0;\n+ 29\n+ 30 virtual const LocalContext& localContext() const = 0;\n+ 31};\n+ 32\n+ 33\n+ 34// Implementation of type erasure wrapper\n+ 35template\n+ 36class LocalFunctionWrapperImplementation :\n+ 37 public DifferentiableFunctionWrapperImplementation\n+ 38{\n+ 39 using Base = DifferentiableFunctionWrapperImplementation;\n+ 40public:\n+ 41 using Base::Base;\n+ 42\n+ 43 virtual void bind(const LocalContext& context)\n+ 44 {\n+ 45 this->get().bind(context);\n+ 46 }\n 47\n-49 using Signature = Range(Domain);\n- 50\n-51 using RawSignature = typename SignatureTraits::RawSignature;\n+ 48 virtual void unbind()\n+ 49 {\n+ 50 this->get().unbind();\n+ 51 }\n 52\n-54 using DerivativeSignature = typename DerivativeTraits::Range\n-(Domain);\n- 55\n-57 using Derivative = DifferentiableFunction;\n- 58\n- 60 template\n-= 0>\n-61 DifferentiableFunctionFromCallables(FF&& f) :\n- 62 f_(std::forward(f))\n- 63 {}\n- 64\n-66 Range operator() (const Domain& x) const\n- 67 {\n- 68 return f_(x);\n- 69 }\n- 70\n-76 friend Derivative derivative(const DifferentiableFunctionFromCallables& t)\n- 77 {\n- 78 DUNE_THROW(Dune::NotImplemented, \"Derivative not implemented\");\n- 79 }\n- 80\n- 81private:\n- 82 F f_;\n- 83};\n- 84\n- 85\n- 86\n- 103template class DerivativeTraits,\n-class F, class DF, class... Derivatives>\n-104class DifferentiableFunctionFromCallables\n- 105{\n- 106public:\n- 107\n-108 using Signature = Range(Domain);\n-109 using RawSignature = typename SignatureTraits::RawSignature;\n-110 using DerivativeSignature = typename DerivativeTraits::Range\n-(Domain);\n- 111\n-112 using Derivative = DifferentiableFunctionFromCallables;\n- 113\n- 120 template\n-121 DifferentiableFunctionFromCallables(FF&& f, DFF&& df, DDFF&&... ddf) :\n- 122 f_(std::forward(f)),\n- 123 df_(std::forward(df), std::forward(ddf)...)\n- 124 {}\n- 125\n-127 Range operator() (const Domain& x) const\n- 128 {\n- 129 return f_(x);\n- 130 }\n- 131\n-137 friend Derivative derivative(const DifferentiableFunctionFromCallables& t)\n- 138 {\n- 139 return t.df_;\n- 140 }\n- 141\n- 142private:\n- 143 F f_;\n- 144 Derivative df_;\n- 145};\n- 146\n- 147\n- 162template class DerivativeTraits, class...\n-F>\n- 163DifferentiableFunctionFromCallables\n-164 makeDifferentiableFunctionFromCallables(const SignatureTag& signatureTag, F&&... f)\n- 165{\n- 166 return DifferentiableFunctionFromCallables(f...);\n- 167}\n- 168\n- 169\n- 170\n- 171} // namespace Functions\n- 172} // namespace Dune\n- 173\n- 174#endif //DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH\n-signature.hh\n-functionconcepts.hh\n-differentiablefunction.hh\n-Dune::Functions::DifferentiableFunctionFromCallables<_Range(Domain),\n-DerivativeTraits,_F_>::derivative\n-friend Derivative derivative(const DifferentiableFunctionFromCallables &t)\n-Get derivative of DifferentiableFunctionFromCallables.\n-Definition: differentiablefunctionfromcallables.hh:76\n-Dune::Functions::makeDifferentiableFunctionFromCallables\n-DifferentiableFunctionFromCallables< Signature, DerivativeTraits, F... >\n-makeDifferentiableFunctionFromCallables(const SignatureTag< Signature,\n-DerivativeTraits > &signatureTag, F &&... f)\n-Create a DifferentiableFunction from callables.\n-Definition: differentiablefunctionfromcallables.hh:164\n+ 53 virtual bool bound() const\n+ 54 {\n+ 55 return this->get().bound();\n+ 56 }\n+ 57\n+ 58 virtual const LocalContext& localContext() const\n+ 59 {\n+ 60 return this->get().localContext();\n+ 61 }\n+ 62};\n+ 63\n+ 64}}} // namespace Dune::Functions::Imp\n+ 65\n+ 66\n+ 67\n+ 68#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH\n+differentiablefunction_imp.hh\n+type_traits.hh\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::DifferentiableFunction\n-Definition: differentiablefunction.hh:29\n-Dune::Functions::DifferentiableFunctionFromCallables\n-Definition: differentiablefunctionfromcallables.hh:23\n-Dune::Functions::DifferentiableFunctionFromCallables<_Range(Domain),\n-DerivativeTraits,_F_>::DifferentiableFunctionFromCallables\n-DifferentiableFunctionFromCallables(FF &&f)\n-Constructor copying the given function.\n-Definition: differentiablefunctionfromcallables.hh:61\n-Dune::Functions::DifferentiableFunctionFromCallables<_Range(Domain),\n-DerivativeTraits,_F_>::RawSignature\n-typename SignatureTraits< Signature >::RawSignature RawSignature\n-Definition: differentiablefunctionfromcallables.hh:51\n-Dune::Functions::DifferentiableFunctionFromCallables<_Range(Domain),\n-DerivativeTraits,_F_>::Signature\n-Range(Domain) Signature\n-Signature of function.\n-Definition: differentiablefunctionfromcallables.hh:49\n-Dune::Functions::DifferentiableFunctionFromCallables<_Range(Domain),\n-DerivativeTraits,_F_>::DerivativeSignature\n-typename DerivativeTraits< RawSignature >::Range(Domain) DerivativeSignature\n-Signature of derivative.\n-Definition: differentiablefunctionfromcallables.hh:54\n-Dune::Functions::DifferentiableFunctionFromCallables<_Range(Domain),\n-DerivativeTraits,_F,_DF,_Derivatives..._>::DerivativeSignature\n-typename DerivativeTraits< RawSignature >::Range(Domain) DerivativeSignature\n-Definition: differentiablefunctionfromcallables.hh:110\n-Dune::Functions::DifferentiableFunctionFromCallables<_Range(Domain),\n-DerivativeTraits,_F,_DF,_Derivatives..._>::Signature\n-Range(Domain) Signature\n-Definition: differentiablefunctionfromcallables.hh:108\n-Dune::Functions::DifferentiableFunctionFromCallables<_Range(Domain),\n-DerivativeTraits,_F,_DF,_Derivatives..._>::RawSignature\n-typename SignatureTraits< Signature >::RawSignature RawSignature\n-Definition: differentiablefunctionfromcallables.hh:109\n-Dune::Functions::DifferentiableFunctionFromCallables<_Range(Domain),\n-DerivativeTraits,_F,_DF,_Derivatives..._>::DifferentiableFunctionFromCallables\n-DifferentiableFunctionFromCallables(FF &&f, DFF &&df, DDFF &&... ddf)\n-Constructor copying the given functions.\n-Definition: differentiablefunctionfromcallables.hh:121\n-Dune::Functions::SignatureTraits\n-Helper class to deduce the signature of a callable.\n-Definition: signature.hh:56\n-Dune::Functions::SignatureTag\n-Definition: signature.hh:102\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00014.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00014.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: staticforloop.hh File Reference\n+dune-functions: differentiablefunctionfromcallables.hh File Reference\n \n \n \n \n \n \n \n@@ -63,38 +63,50 @@\n \n \n
    \n \n-
    staticforloop.hh File Reference
    \n+
    differentiablefunctionfromcallables.hh File Reference
    \n
    \n
    \n-
    #include <dune/common/concept.hh>
    \n-#include <dune/functions/common/type_traits.hh>
    \n-#include <dune/functions/functionspacebases/concepts.hh>
    \n+
    #include <dune/common/typeutilities.hh>
    \n+#include <dune/common/hybridutilities.hh>
    \n+#include <dune/functions/common/signature.hh>
    \n+#include <dune/functions/common/differentiablefunction.hh>
    \n+#include <dune/functions/common/functionconcepts.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n+\n+\n+\n+\n+\n+\n+\n+

    \n+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...
     
    \n \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n \n-\n-\n-\n-\n+\n+\n+\n+\n

    \n 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. More...
     
    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. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,26 +5,47 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-Namespaces | Functions\n-staticforloop.hh File Reference\n-#include \n-#include \n-#include \n+Classes | Namespaces | Functions\n+differentiablefunctionfromcallables.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n+ Classes\n+class \u00a0Dune::Functions::DifferentiableFunctionFromCallables<_Range(Domain),\n+ DerivativeTraits,_F_>\n+ Wrap a list of callable objects as derivative sequence modelling\n+\u00a0 Concept::DifferentiableFunction\n+ More...\n+\u00a0\n+class \u00a0Dune::Functions::DifferentiableFunctionFromCallables<_Range(Domain),\n+ DerivativeTraits,_F,_DF,_Derivatives..._>\n+ Wrap a list of callable objects as derivative sequence modelling\n+\u00a0 Concept::DifferentiableFunction\n+ More...\n+\u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n Functions\n-template\n-void\u00a0Dune::Functions::staticFindInRange (F &&f, Args &&... args)\n-\u00a0 Static find loop. More...\n+template class DerivativeTraits, class...\n+F>\n+ DifferentiableFunctionFromCallables< Dune::Functions::\n+ Signature, DerivativeTraits, F... >\u00a0makeDifferentiableFunctionFromCallables\n+ (const SignatureTag< Signature,\n+ DerivativeTraits > &signatureTag, F &&...\n+ f)\n+\u00a0 Create a DifferentiableFunction from\n+ callables. More...\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00014_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00014_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: staticforloop.hh Source File\n+dune-functions: differentiablefunctionfromcallables.hh Source File\n \n \n \n \n \n \n \n@@ -62,75 +62,141 @@\n \n \n
    \n
    \n-
    staticforloop.hh
    \n+
    differentiablefunctionfromcallables.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH
    \n-
    4#define DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH
    \n+
    4#define DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH
    \n
    5
    \n
    6
    \n-
    7#include <dune/common/concept.hh>
    \n-
    8
    \n-\n-\n+
    7#include <dune/common/typeutilities.hh>
    \n+
    8#include <dune/common/hybridutilities.hh>
    \n+
    9
    \n+\n
    11
    \n-
    12
    \n-
    13namespace Dune {
    \n-
    14namespace Functions {
    \n+\n+\n+
    14
    \n
    15
    \n-
    16namespace Imp {
    \n-
    17
    \n-
    18template<class ST, ST begin, ST end>
    \n-
    19struct StaticFindInRange
    \n-
    20{
    \n-
    21 template<class F, class...Args>
    \n-
    22 static void apply(F&& f, Args&&... args)
    \n-
    23 {
    \n-
    24 if (f(std::integral_constant<ST, begin>(), std::forward<Args>(args)...))
    \n-
    25 return;
    \n-
    26 StaticFindInRange<ST, begin+1, end>::apply(std::forward<F>(f), std::forward<Args>(args)...);
    \n-
    27 }
    \n-
    28};
    \n-
    29
    \n-
    30template<class ST, ST end>
    \n-
    31struct StaticFindInRange<ST, end, end>
    \n-
    32{
    \n-
    33 template<class F, class...Args>
    \n-
    34 static void apply(F&& f, Args&&...)
    \n-
    35 {}
    \n-
    36};
    \n-
    37
    \n-
    38} //end namespace Imp
    \n-
    39
    \n-
    40
    \n-
    41
    \n-
    55template<std::size_t begin_t, std::size_t end_t, class F, class... Args>
    \n-
    56void staticFindInRange(F&& f, Args&&... args)
    \n-
    57{
    \n-
    58 Imp::StaticFindInRange<std::size_t, begin_t, end_t>::apply(std::forward<F>(f), std::forward<Args>(args)...);
    \n-
    59}
    \n-
    60
    \n-
    61
    \n-
    62} // namespace Dune::Functions
    \n-
    63} // namespace Dune
    \n+
    16
    \n+
    17namespace Dune {
    \n+
    18namespace Functions {
    \n+
    19
    \n+
    20
    \n+
    21
    \n+
    22template<class Signature, template<class> class DerivativeTraits, class... Callables>
    \n+\n+
    24
    \n+
    25
    \n+
    26
    \n+
    43template<class Range, class Domain, template<class> class DerivativeTraits, class F>
    \n+
    44class DifferentiableFunctionFromCallables<Range(Domain), DerivativeTraits, F>
    \n+
    45{
    \n+
    46public:
    \n+
    47
    \n+
    49 using Signature = Range(Domain);
    \n+
    50
    \n+\n+
    52
    \n+
    54 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(Domain);
    \n+
    55
    \n+\n+
    58
    \n+
    60 template<class FF, disableCopyMove<DifferentiableFunctionFromCallables, FF> = 0>
    \n+\n+
    62 f_(std::forward<FF>(f))
    \n+
    63 {}
    \n
    64
    \n-
    65
    \n-
    66
    \n-
    67#endif //DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH
    \n-\n-
    void staticFindInRange(F &&f, Args &&... args)
    Static find loop.
    Definition: staticforloop.hh:56
    \n+
    66 Range operator() (const Domain& x) const
    \n+
    67 {
    \n+
    68 return f_(x);
    \n+
    69 }
    \n+
    70
    \n+\n+
    77 {
    \n+
    78 DUNE_THROW(Dune::NotImplemented, "Derivative not implemented");
    \n+
    79 }
    \n+
    80
    \n+
    81private:
    \n+
    82 F f_;
    \n+
    83};
    \n+
    84
    \n+
    85
    \n+
    86
    \n+
    103template<class Range, class Domain, template<class> class DerivativeTraits, class F, class DF, class... Derivatives>
    \n+
    104class DifferentiableFunctionFromCallables<Range(Domain), DerivativeTraits, F, DF, Derivatives...>
    \n+
    105{
    \n+
    106public:
    \n+
    107
    \n+
    108 using Signature = Range(Domain);
    \n+\n+
    110 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(Domain);
    \n+
    111
    \n+
    112 using Derivative = DifferentiableFunctionFromCallables<DerivativeSignature, DerivativeTraits, DF, Derivatives...>;
    \n+
    113
    \n+
    120 template<class FF, class DFF, class... DDFF>
    \n+
    121 DifferentiableFunctionFromCallables(FF&& f, DFF&& df, DDFF&&... ddf) :
    \n+
    122 f_(std::forward<FF>(f)),
    \n+
    123 df_(std::forward<DFF>(df), std::forward<DDFF>(ddf)...)
    \n+
    124 {}
    \n+
    125
    \n+
    127 Range operator() (const Domain& x) const
    \n+
    128 {
    \n+
    129 return f_(x);
    \n+
    130 }
    \n+
    131
    \n+\n+
    138 {
    \n+
    139 return t.df_;
    \n+
    140 }
    \n+
    141
    \n+
    142private:
    \n+
    143 F f_;
    \n+
    144 Derivative df_;
    \n+
    145};
    \n+
    146
    \n+
    147
    \n+
    162template<class Signature, template<class> class DerivativeTraits, class... F>
    \n+
    163DifferentiableFunctionFromCallables<Signature, DerivativeTraits, F...>
    \n+\n+
    165{
    \n+
    166 return DifferentiableFunctionFromCallables<Signature, DerivativeTraits, F...>(f...);
    \n+
    167}
    \n+
    168
    \n+
    169
    \n+
    170
    \n+
    171} // namespace Functions
    \n+
    172} // namespace Dune
    \n+
    173
    \n+
    174#endif //DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH
    \n+\n+\n+\n+
    friend Derivative derivative(const DifferentiableFunctionFromCallables &t)
    Get derivative of DifferentiableFunctionFromCallables.
    Definition: differentiablefunctionfromcallables.hh:76
    \n+
    DifferentiableFunctionFromCallables< Signature, DerivativeTraits, F... > makeDifferentiableFunctionFromCallables(const SignatureTag< Signature, DerivativeTraits > &signatureTag, F &&... f)
    Create a DifferentiableFunction from callables.
    Definition: differentiablefunctionfromcallables.hh:164
    \n
    Definition: polynomial.hh:10
    \n-\n+
    Definition: differentiablefunction.hh:29
    \n+
    Definition: differentiablefunctionfromcallables.hh:23
    \n+
    DifferentiableFunctionFromCallables(FF &&f)
    Constructor copying the given function.
    Definition: differentiablefunctionfromcallables.hh:61
    \n+
    typename SignatureTraits< Signature >::RawSignature RawSignature
    Definition: differentiablefunctionfromcallables.hh:51
    \n+
    Range(Domain) Signature
    Signature of function.
    Definition: differentiablefunctionfromcallables.hh:49
    \n+
    typename DerivativeTraits< RawSignature >::Range(Domain) DerivativeSignature
    Signature of derivative.
    Definition: differentiablefunctionfromcallables.hh:54
    \n+
    typename DerivativeTraits< RawSignature >::Range(Domain) DerivativeSignature
    Definition: differentiablefunctionfromcallables.hh:110
    \n+\n+
    typename SignatureTraits< Signature >::RawSignature RawSignature
    Definition: differentiablefunctionfromcallables.hh:109
    \n+
    DifferentiableFunctionFromCallables(FF &&f, DFF &&df, DDFF &&... ddf)
    Constructor copying the given functions.
    Definition: differentiablefunctionfromcallables.hh:121
    \n+
    Helper class to deduce the signature of a callable.
    Definition: signature.hh:56
    \n+
    Definition: signature.hh:102
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,76 +5,191 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-staticforloop.hh\n+differentiablefunctionfromcallables.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH\n- 4#define DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH\n+ 3#ifndef DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH\n+ 4#define DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH\n 5\n 6\n- 7#include \n- 8\n- 9#include \n- 10#include \n+ 7#include \n+ 8#include \n+ 9\n+ 10#include \n 11\n- 12\n- 13namespace Dune {\n- 14namespace Functions {\n+ 12#include \n+ 13#include \n+ 14\n 15\n- 16namespace Imp {\n- 17\n- 18template\n- 19struct StaticFindInRange\n- 20{\n- 21 template\n- 22 static void apply(F&& f, Args&&... args)\n- 23 {\n- 24 if (f(std::integral_constant(), std::forward(args)...))\n- 25 return;\n- 26 StaticFindInRange::apply(std::forward(f), std::\n-forward(args)...);\n- 27 }\n- 28};\n- 29\n- 30template\n- 31struct StaticFindInRange\n- 32{\n- 33 template\n- 34 static void apply(F&& f, Args&&...)\n- 35 {}\n- 36};\n- 37\n- 38} //end namespace Imp\n- 39\n- 40\n- 41\n- 55template\n-56void staticFindInRange(F&& f, Args&&... args)\n- 57{\n- 58 Imp::StaticFindInRange::apply(std::forward\n-(f), std::forward(args)...);\n- 59}\n- 60\n- 61\n- 62} // namespace Dune::Functions\n- 63} // namespace Dune\n+ 16\n+ 17namespace Dune {\n+ 18namespace Functions {\n+ 19\n+ 20\n+ 21\n+ 22template class DerivativeTraits, class...\n+Callables>\n+23class DifferentiableFunctionFromCallables;\n+ 24\n+ 25\n+ 26\n+ 43template class DerivativeTraits,\n+class F>\n+44class DifferentiableFunctionFromCallables\n+ 45{\n+ 46public:\n+ 47\n+49 using Signature = Range(Domain);\n+ 50\n+51 using RawSignature = typename SignatureTraits::RawSignature;\n+ 52\n+54 using DerivativeSignature = typename DerivativeTraits::Range\n+(Domain);\n+ 55\n+57 using Derivative = DifferentiableFunction;\n+ 58\n+ 60 template\n+= 0>\n+61 DifferentiableFunctionFromCallables(FF&& f) :\n+ 62 f_(std::forward(f))\n+ 63 {}\n 64\n- 65\n- 66\n- 67#endif //DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH\n-type_traits.hh\n-Dune::Functions::staticFindInRange\n-void staticFindInRange(F &&f, Args &&... args)\n-Static find loop.\n-Definition: staticforloop.hh:56\n+66 Range operator() (const Domain& x) const\n+ 67 {\n+ 68 return f_(x);\n+ 69 }\n+ 70\n+76 friend Derivative derivative(const DifferentiableFunctionFromCallables& t)\n+ 77 {\n+ 78 DUNE_THROW(Dune::NotImplemented, \"Derivative not implemented\");\n+ 79 }\n+ 80\n+ 81private:\n+ 82 F f_;\n+ 83};\n+ 84\n+ 85\n+ 86\n+ 103template class DerivativeTraits,\n+class F, class DF, class... Derivatives>\n+104class DifferentiableFunctionFromCallables\n+ 105{\n+ 106public:\n+ 107\n+108 using Signature = Range(Domain);\n+109 using RawSignature = typename SignatureTraits::RawSignature;\n+110 using DerivativeSignature = typename DerivativeTraits::Range\n+(Domain);\n+ 111\n+112 using Derivative = DifferentiableFunctionFromCallables;\n+ 113\n+ 120 template\n+121 DifferentiableFunctionFromCallables(FF&& f, DFF&& df, DDFF&&... ddf) :\n+ 122 f_(std::forward(f)),\n+ 123 df_(std::forward(df), std::forward(ddf)...)\n+ 124 {}\n+ 125\n+127 Range operator() (const Domain& x) const\n+ 128 {\n+ 129 return f_(x);\n+ 130 }\n+ 131\n+137 friend Derivative derivative(const DifferentiableFunctionFromCallables& t)\n+ 138 {\n+ 139 return t.df_;\n+ 140 }\n+ 141\n+ 142private:\n+ 143 F f_;\n+ 144 Derivative df_;\n+ 145};\n+ 146\n+ 147\n+ 162template class DerivativeTraits, class...\n+F>\n+ 163DifferentiableFunctionFromCallables\n+164 makeDifferentiableFunctionFromCallables(const SignatureTag& signatureTag, F&&... f)\n+ 165{\n+ 166 return DifferentiableFunctionFromCallables(f...);\n+ 167}\n+ 168\n+ 169\n+ 170\n+ 171} // namespace Functions\n+ 172} // namespace Dune\n+ 173\n+ 174#endif //DUNE_FUNCTIONS_COMMON_DIFFEREENTIONABEFUNCTIONFROMCALLABLES_HH\n+functionconcepts.hh\n+signature.hh\n+differentiablefunction.hh\n+Dune::Functions::DifferentiableFunctionFromCallables<_Range(Domain),\n+DerivativeTraits,_F_>::derivative\n+friend Derivative derivative(const DifferentiableFunctionFromCallables &t)\n+Get derivative of DifferentiableFunctionFromCallables.\n+Definition: differentiablefunctionfromcallables.hh:76\n+Dune::Functions::makeDifferentiableFunctionFromCallables\n+DifferentiableFunctionFromCallables< Signature, DerivativeTraits, F... >\n+makeDifferentiableFunctionFromCallables(const SignatureTag< Signature,\n+DerivativeTraits > &signatureTag, F &&... f)\n+Create a DifferentiableFunction from callables.\n+Definition: differentiablefunctionfromcallables.hh:164\n Dune\n Definition: polynomial.hh:10\n-concepts.hh\n+Dune::Functions::DifferentiableFunction\n+Definition: differentiablefunction.hh:29\n+Dune::Functions::DifferentiableFunctionFromCallables\n+Definition: differentiablefunctionfromcallables.hh:23\n+Dune::Functions::DifferentiableFunctionFromCallables<_Range(Domain),\n+DerivativeTraits,_F_>::DifferentiableFunctionFromCallables\n+DifferentiableFunctionFromCallables(FF &&f)\n+Constructor copying the given function.\n+Definition: differentiablefunctionfromcallables.hh:61\n+Dune::Functions::DifferentiableFunctionFromCallables<_Range(Domain),\n+DerivativeTraits,_F_>::RawSignature\n+typename SignatureTraits< Signature >::RawSignature RawSignature\n+Definition: differentiablefunctionfromcallables.hh:51\n+Dune::Functions::DifferentiableFunctionFromCallables<_Range(Domain),\n+DerivativeTraits,_F_>::Signature\n+Range(Domain) Signature\n+Signature of function.\n+Definition: differentiablefunctionfromcallables.hh:49\n+Dune::Functions::DifferentiableFunctionFromCallables<_Range(Domain),\n+DerivativeTraits,_F_>::DerivativeSignature\n+typename DerivativeTraits< RawSignature >::Range(Domain) DerivativeSignature\n+Signature of derivative.\n+Definition: differentiablefunctionfromcallables.hh:54\n+Dune::Functions::DifferentiableFunctionFromCallables<_Range(Domain),\n+DerivativeTraits,_F,_DF,_Derivatives..._>::DerivativeSignature\n+typename DerivativeTraits< RawSignature >::Range(Domain) DerivativeSignature\n+Definition: differentiablefunctionfromcallables.hh:110\n+Dune::Functions::DifferentiableFunctionFromCallables<_Range(Domain),\n+DerivativeTraits,_F,_DF,_Derivatives..._>::Signature\n+Range(Domain) Signature\n+Definition: differentiablefunctionfromcallables.hh:108\n+Dune::Functions::DifferentiableFunctionFromCallables<_Range(Domain),\n+DerivativeTraits,_F,_DF,_Derivatives..._>::RawSignature\n+typename SignatureTraits< Signature >::RawSignature RawSignature\n+Definition: differentiablefunctionfromcallables.hh:109\n+Dune::Functions::DifferentiableFunctionFromCallables<_Range(Domain),\n+DerivativeTraits,_F,_DF,_Derivatives..._>::DifferentiableFunctionFromCallables\n+DifferentiableFunctionFromCallables(FF &&f, DFF &&df, DDFF &&... ddf)\n+Constructor copying the given functions.\n+Definition: differentiablefunctionfromcallables.hh:121\n+Dune::Functions::SignatureTraits\n+Helper class to deduce the signature of a callable.\n+Definition: signature.hh:56\n+Dune::Functions::SignatureTag\n+Definition: signature.hh:102\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00017.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00017.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: indexaccess.hh File Reference\n+dune-functions: signature.hh File Reference\n \n \n \n \n \n \n \n@@ -63,61 +63,52 @@\n \n \n
    \n \n-
    indexaccess.hh File Reference
    \n+
    signature.hh File Reference
    \n
    \n
    \n-
    #include <utility>
    \n-#include <type_traits>
    \n-#include <dune/common/typetraits.hh>
    \n-#include <dune/common/concept.hh>
    \n-#include <dune/common/hybridutilities.hh>
    \n-#include <dune/functions/common/utility.hh>
    \n+
    #include <type_traits>
    \n+#include <tuple>
    \n+#include <dune/functions/common/defaultderivativetraits.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n+\n+\n+\n+\n+\n+\n+\n+

    \n+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...
     
    \n \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n

    \n 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. More...
     
    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. More...
     
    template<class Result , class C , class MultiIndex >
    Result Dune::Functions::hybridMultiIndexAccess (C &&c, const MultiIndex &index)
     Provide multi-index access by chaining operator[]. More...
     
    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[]. More...
     
    template<class C , class MultiIndex >
    constexpr decltype(auto) Dune::Functions::resolveDynamicMultiIndex (C &&c, const MultiIndex &multiIndex)
     Provide multi-index access by chaining operator[]. More...
     
    template<class C , class MultiIndex >
    constexpr decltype(auto) Dune::Functions::resolveStaticMultiIndex (C &&c, const MultiIndex &multiIndex)
     Provide multi-index access by chaining operator[]. More...
     
    template<class Range , class Domain , template< class > class DerivativeTraits>
    auto Dune::Functions::derivativeSignatureTag (SignatureTag< Range(Domain), DerivativeTraits > tag)
     Construct SignatureTag for derivative. More...
     
    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. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,63 +5,41 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-Namespaces | Functions\n-indexaccess.hh File Reference\n-#include \n+Classes | Namespaces | Functions\n+signature.hh File Reference\n #include \n-#include \n-#include \n-#include \n-#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n+ Classes\n+struct \u00a0Dune::Functions::SignatureTraits<_Signature,_isCallable_>\n+\u00a0 Helper class to deduce the signature of a callable. More...\n+\u00a0\n+struct \u00a0Dune::Functions::SignatureTag<_Range(Domain),_DerivativeTraitsT_>\n+\u00a0 Tag-class to encapsulate signature information. More...\n+\u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n Functions\n-template, C >(), int >::type = 0>\n- auto\u00a0Dune::Functions::hybridIndexAccess (C &&c, const I\n- &i, F &&f) -> decltype(f(c[i]))\n-\u00a0 Provide operator[] index-access for containers.\n- More...\n-\u00a0\n-template, C >(), int >::type = 0>\n- decltype(auto)\u00a0Dune::Functions::hybridIndexAccess (C &&c, const I\n- &i, F &&f)\n-\u00a0 Provide operator[] index-access for containers.\n- More...\n-\u00a0\n-template\n- Result\u00a0Dune::Functions::hybridMultiIndexAccess (C &&c, const\n- MultiIndex &index)\n-\u00a0 Provide multi-index access by chaining operator[].\n- More...\n-\u00a0\n-template\n-constexpr decltype(auto)\u00a0Dune::Functions::resolveDynamicMultiIndex (C &&c,\n- const MultiIndex &multiIndex, const IsFinal &isFinal)\n-\u00a0 Provide multi-index access by chaining operator[].\n- More...\n-\u00a0\n-template\n-constexpr decltype(auto)\u00a0Dune::Functions::resolveDynamicMultiIndex (C &&c,\n- const MultiIndex &multiIndex)\n-\u00a0 Provide multi-index access by chaining operator[].\n- More...\n-\u00a0\n-template\n-constexpr decltype(auto)\u00a0Dune::Functions::resolveStaticMultiIndex (C &&c,\n- const MultiIndex &multiIndex)\n-\u00a0 Provide multi-index access by chaining operator[].\n- More...\n+template class\n+DerivativeTraits>\n+auto\u00a0Dune::Functions::derivativeSignatureTag (SignatureTag< Range(Domain),\n+ DerivativeTraits > tag)\n+\u00a0 Construct SignatureTag for derivative. More...\n+\u00a0\n+template class\n+DerivativeTraits>\n+auto\u00a0Dune::Functions::derivativeSignatureTags (Dune::Functions::SignatureTag<\n+ Signature, DerivativeTraits > tag)\n+\u00a0 Construct SignatureTags for derivatives. More...\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00017_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00017_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: indexaccess.hh Source File\n+dune-functions: signature.hh Source File\n \n \n \n \n \n \n \n@@ -62,313 +62,158 @@\n \n \n
    \n
    \n-
    indexaccess.hh
    \n+
    signature.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH
    \n-
    4#define DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_COMMON_SIGNATURE_HH
    \n+
    4#define DUNE_FUNCTIONS_COMMON_SIGNATURE_HH
    \n
    5
    \n-
    6
    \n-
    7#include <utility>
    \n-
    8#include <type_traits>
    \n-
    9
    \n-
    10#include <dune/common/typetraits.hh>
    \n-
    11#include <dune/common/concept.hh>
    \n-
    12#include <dune/common/hybridutilities.hh>
    \n+
    6#include <type_traits>
    \n+
    7#include <tuple>
    \n+
    8
    \n+\n+
    10
    \n+
    11namespace Dune {
    \n+
    12namespace Functions {
    \n
    13
    \n-\n-
    15
    \n-
    16
    \n-
    17
    \n-
    18namespace Dune {
    \n-
    19namespace Functions {
    \n-
    20
    \n+
    19template<typename F>
    \n+\n
    21
    \n-
    22namespace Imp {
    \n-
    23
    \n-
    24namespace Concept {
    \n-
    25
    \n-
    26template<class size_type>
    \n-
    27struct HasDynamicIndexAccess
    \n-
    28{
    \n-
    29 template<class C>
    \n-
    30 auto require(C&& c) -> decltype(
    \n-
    31 c[std::declval<size_type>()]
    \n-
    32 );
    \n-
    33};
    \n-
    34
    \n-
    35struct HasStaticIndexAccess
    \n-
    36{
    \n-
    37 template<class C>
    \n-
    38 auto require(C&& c) -> decltype(
    \n-
    39 c[Dune::Indices::_0]
    \n-
    40 );
    \n+
    22#ifndef DOXYGEN
    \n+
    23template<typename F>
    \n+
    24struct IsCallable
    \n+
    25{
    \n+
    26 struct yes { std::size_t dummy[2]; };
    \n+
    27 struct no { std::size_t dummy[1]; };
    \n+
    28
    \n+
    29 template<typename C>
    \n+
    30 static yes test(const decltype(&C::operator()) *);
    \n+
    31 template<typename C>
    \n+
    32 static no test(...);
    \n+
    33
    \n+
    34 enum { value = (sizeof(test<F>(0)) == sizeof(yes)) };
    \n+
    35};
    \n+
    36
    \n+
    37template<typename R, typename D>
    \n+
    38struct IsCallable<R(D)>
    \n+
    39{
    \n+
    40 enum { value = true };
    \n
    41};
    \n
    42
    \n-
    43} // namespace Concept
    \n-
    44
    \n-
    45} // namespace Imp
    \n-
    46
    \n-
    47
    \n-
    48
    \n-
    61template<class C, class I, class F,
    \n-
    62 typename std::enable_if< Dune::models<Imp::Concept::HasDynamicIndexAccess<I>, C>(), int>::type = 0>
    \n-
    63auto hybridIndexAccess(C&& c, const I& i, F&& f)
    \n-
    64 -> decltype(f(c[i]))
    \n-
    65{
    \n-
    66 return f(c[i]);
    \n-
    67}
    \n-
    68
    \n-
    86template<class C, class I, class F,
    \n-
    87 typename std::enable_if< not Dune::models<Imp::Concept::HasDynamicIndexAccess<I>, C>(), int>::type = 0>
    \n-
    88decltype(auto) hybridIndexAccess(C&& c, const I& i, F&& f)
    \n-
    89{
    \n-
    90 using Size = decltype(Hybrid::size(c));
    \n-
    91 return Hybrid::switchCases(std::make_index_sequence<Size::value>(), i,
    \n-
    92 [&](const auto& ii) -> decltype(auto){
    \n-
    93 return f(c[ii]);
    \n-
    94 }, [&]() -> decltype(auto){
    \n-
    95 return f(c[Dune::Indices::_0]);
    \n-
    96 });
    \n-
    97}
    \n-
    98
    \n+
    43template<typename R, typename D>
    \n+
    44struct IsCallable<R(*)(D)>
    \n+
    45{
    \n+
    46 enum { value = true };
    \n+
    47};
    \n+
    48#endif
    \n+
    49
    \n+
    55template<class Signature, bool isCallable = IsCallable<Signature>::value >
    \n+\n+
    57
    \n+
    58#ifndef DOXYGEN
    \n+
    60template<class T>
    \n+
    61struct SignatureTraits<T, true>
    \n+
    62 : public SignatureTraits<decltype(&T::operator()), true>
    \n+
    63{};
    \n+
    64
    \n+
    66template <typename C, typename R, typename D>
    \n+
    67struct SignatureTraits<R(C::*)(D) const, true>
    \n+
    68 : public SignatureTraits<R(D), true>
    \n+
    69{};
    \n+
    70
    \n+
    72template <typename C, typename R, typename D>
    \n+
    73struct SignatureTraits<R(C::*)(D), true>
    \n+
    74 : public SignatureTraits<R(D), true>
    \n+
    75{};
    \n+
    76
    \n+
    78template <typename R, typename D>
    \n+
    79struct SignatureTraits<R(*)(D), true>
    \n+
    80 : public SignatureTraits<R(D), true>
    \n+
    81{};
    \n+
    82
    \n+
    84template<class R, class D>
    \n+
    85struct SignatureTraits<R(D), true>
    \n+
    86{
    \n+
    87 using Range = R;
    \n+
    88 using Domain = D;
    \n+
    89
    \n+
    90 using RawRange = typename std::decay<Range>::type;
    \n+
    91 using RawDomain = typename std::decay<Domain>::type;
    \n+
    92
    \n+
    93 using RawSignature = RawRange(RawDomain);
    \n+
    94
    \n+
    95 template<template<class> class DerivativeTraits=DefaultDerivativeTraits>
    \n+
    96 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(Domain);
    \n+
    97};
    \n+
    98#endif
    \n
    99
    \n-
    100namespace Imp {
    \n-
    101
    \n-
    115 template<class Index, std::size_t offset=1>
    \n-
    116 class ShiftedDynamicMultiIndex
    \n-
    117 {
    \n-
    118 public:
    \n-
    119 ShiftedDynamicMultiIndex(const Index& index) :
    \n-
    120 index_(index)
    \n-
    121 {}
    \n+
    100
    \n+
    101template<class Signature, template<class> class DerivativeTraits=DefaultDerivativeTraits>
    \n+\n+
    103
    \n+
    113template<class Range, class Domain, template<class> class DerivativeTraitsT>
    \n+
    114struct SignatureTag<Range(Domain), DerivativeTraitsT>
    \n+
    115{
    \n+
    116 using Signature = Range(Domain);
    \n+
    117
    \n+
    118 template<class T>
    \n+
    119 using DerivativeTraits = DerivativeTraitsT<T>;
    \n+
    120};
    \n+
    121
    \n
    122
    \n-
    123 std::size_t operator[](std::size_t position) const
    \n-
    124 {
    \n-
    125 if (position<size())
    \n-
    126 return index_[position+offset];
    \n-
    127 else
    \n-
    128 return 0;
    \n-
    129 }
    \n-
    130
    \n-
    134 ShiftedDynamicMultiIndex<Index, offset+1> pop() const
    \n-
    135 {
    \n-
    136 return {index_};
    \n-
    137 }
    \n+
    123
    \n+
    132template<class Range, class Domain, template<class> class DerivativeTraits>
    \n+
    133auto derivativeSignatureTag(SignatureTag<Range(Domain), DerivativeTraits> tag)
    \n+
    134{
    \n+
    135 using DerivativeRange = typename DerivativeTraits<Range(Domain)>::Range;
    \n+\n+
    137}
    \n
    138
    \n-
    139 std::size_t size() const
    \n-
    140 {
    \n-
    141 if (offset < index_.size())
    \n-
    142 return index_.size() - offset;
    \n-
    143 else
    \n-
    144 return 0;
    \n-
    145 }
    \n-
    146
    \n-
    147 private:
    \n-
    148 const Index& index_;
    \n-
    149 };
    \n-
    150
    \n-
    151 template<class Index, std::size_t offset=1>
    \n-
    152 class ShiftedStaticMultiIndex
    \n-
    153 {
    \n-
    154 public:
    \n-
    155 ShiftedStaticMultiIndex(const Index& index) :
    \n-
    156 index_(index)
    \n-
    157 {}
    \n-
    158
    \n-
    159 template<std::size_t i>
    \n-
    160 auto operator[](Dune::index_constant<i>) const
    \n-
    161 {
    \n-
    162 if constexpr (i<size()) {
    \n-
    163 return index_[Dune::index_constant<i+offset>{}];
    \n-
    164 } else {
    \n-
    165 return Dune::index_constant<0>{};
    \n-
    166 }
    \n-
    167 }
    \n-
    168
    \n-
    172 ShiftedStaticMultiIndex<Index, offset+1> pop() const
    \n-
    173 {
    \n-
    174 return {index_};
    \n-
    175 }
    \n+
    139
    \n+
    140
    \n+
    154template<std::size_t maxOrder, class Signature, template<class> class DerivativeTraits>
    \n+\n+
    156{
    \n+
    157 if constexpr (maxOrder==0) {
    \n+
    158 // If maxOrder== 0 we just need the given SignatureTag
    \n+
    159 return std::make_tuple(tag);
    \n+
    160 } else {
    \n+
    161 // else we first construct the tail tuple with SignatureTags for derivatives
    \n+
    162 // of order 1 to maxOrder
    \n+
    163 auto tailTagsTuple = derivativeSignatureTags<std::size_t(maxOrder-1)>(derivativeSignatureTag(tag));
    \n+
    164 // and prepend this with the given SignatureTag.
    \n+
    165 // This is done by unpacking the tail tuple with apply().
    \n+
    166 return std::apply([&](auto&&... tailTags){
    \n+
    167 return std::make_tuple(tag, tailTags...);
    \n+
    168 }, tailTagsTuple);
    \n+
    169 }
    \n+
    170}
    \n+
    171
    \n+
    172
    \n+
    173
    \n+
    174} // namespace Functions
    \n+
    175} // namespace Dune
    \n
    176
    \n-
    177 static constexpr std::size_t size()
    \n-
    178 {
    \n-
    179 auto fullSize = decltype(Hybrid::size(std::declval<Index>()))::value;
    \n-
    180 if (offset < fullSize)
    \n-
    181 return fullSize - offset;
    \n-
    182 else
    \n-
    183 return 0;
    \n-
    184 }
    \n-
    185
    \n-
    186 private:
    \n-
    187 const Index& index_;
    \n-
    188 };
    \n-
    189
    \n-
    195 template<std::size_t offset, class Index>
    \n-
    196 ShiftedDynamicMultiIndex<Index, offset> shiftedDynamicMultiIndex(const Index& index)
    \n-
    197 {
    \n-
    198 return {index};
    \n-
    199 }
    \n-
    200
    \n-
    201 template<std::size_t offset, class Index>
    \n-
    202 ShiftedStaticMultiIndex<Index, offset> shiftedStaticMultiIndex(const Index& index)
    \n-
    203 {
    \n-
    204 return {index};
    \n-
    205 }
    \n-
    206
    \n-
    207} // namespace Imp
    \n-
    208
    \n-
    209
    \n-
    210
    \n-
    211
    \n-
    212namespace Imp {
    \n-
    213
    \n-
    214template<class Result, class Index>
    \n-
    215struct MultiIndexResolver
    \n-
    216{
    \n-
    217 MultiIndexResolver(const Index& index) :
    \n-
    218 index_(index)
    \n-
    219 {}
    \n-
    220
    \n-
    221 template<class C,
    \n-
    222 typename std::enable_if<not std::is_convertible<C&, Result>::value, int>::type = 0>
    \n-
    223 Result operator()(C&& c)
    \n-
    224 {
    \n-
    225 auto&& subIndex = Imp::shiftedDynamicMultiIndex<1>(index_);
    \n-
    226 auto&& subIndexResolver = MultiIndexResolver<Result, decltype(subIndex)>(subIndex);
    \n-
    227 return (Result)(hybridIndexAccess(c, index_[Dune::Indices::_0], subIndexResolver));
    \n-
    228 }
    \n-
    229
    \n-
    230 template<class C,
    \n-
    231 typename std::enable_if<std::is_convertible<C&, Result>::value, int>::type = 0>
    \n-
    232 Result operator()(C&& c)
    \n-
    233 {
    \n-
    234 return (Result)(std::forward<C>(c));
    \n-
    235 }
    \n-
    236
    \n-
    237 const Index& index_;
    \n-
    238};
    \n-
    239
    \n-
    240} // namespace Imp
    \n-
    241
    \n-
    242
    \n-
    243
    \n-
    262template<class Result, class C, class MultiIndex>
    \n-
    263Result hybridMultiIndexAccess(C&& c, const MultiIndex& index)
    \n-
    264{
    \n-
    265
    \n-
    266 Imp::MultiIndexResolver<Result, MultiIndex> multiIndexResolver(index);
    \n-
    267 return multiIndexResolver(c);
    \n-
    268}
    \n-
    269
    \n-
    270
    \n-
    271
    \n-
    272
    \n-
    273
    \n-
    274
    \n-
    275namespace Imp {
    \n-
    276
    \n-
    277 template<class C, class MultiIndex, class IsFinal>
    \n-
    278 constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex& multiIndex, const IsFinal& isFinal)
    \n-
    279 {
    \n-
    280 // If c is already considered final simply return it,
    \n-
    281 // else resolve the next multiIndex entry.
    \n-
    282 return Hybrid::ifElse(isFinal(c), [&, c = forwardCapture(std::forward<C>(c))](auto) -> decltype(auto) {
    \n-
    283 assert(multiIndex.size() == 0);
    \n-
    284 return c.forward();
    \n-
    285 }, [&](auto) -> decltype(auto) {
    \n-
    286 auto hasDynamicAccess = callableCheck([](auto&& cc) -> std::void_t<decltype(cc[0])> {});
    \n-
    287
    \n-
    288 // Split multiIndex into first entry and remaining ones.
    \n-
    289 auto i = multiIndex[0];
    \n-
    290 auto tail = multiIndex.pop();
    \n-
    291
    \n-
    292 // Resolve first multiIndex entry by c[multiIndex[0]] and
    \n-
    293 // continue resolving with the remaining remaining ones.
    \n-
    294 // If c has a dynamic operator[] this is straight forward.
    \n-
    295 // Else the dynamic multiIndex[0] has to be translated into
    \n-
    296 // a static one using hybridIndexAccess.
    \n-
    297 return Hybrid::ifElse(hasDynamicAccess(c), [&](auto id) -> decltype(auto) {
    \n-
    298 return Imp::resolveDynamicMultiIndex(id(c)[i], tail, isFinal);
    \n-
    299 }, [&](auto id) -> decltype(auto) {
    \n-
    300 // auto indexRange = range(Hybrid::size(id(c)));
    \n-
    301 auto indexRange = typename decltype(range(Hybrid::size(id(c))))::integer_sequence();
    \n-
    302 return Hybrid::switchCases(indexRange, i, [&](auto static_i) -> decltype(auto){
    \n-
    303 // Do rescursion with static version of i
    \n-
    304 return Imp::resolveDynamicMultiIndex(id(c)[static_i], tail, isFinal);
    \n-
    305 }, [&]() -> decltype(auto){
    \n-
    306 // As fallback we use c[0] this is needed, because there must be one branch that matches.
    \n-
    307 return Imp::resolveDynamicMultiIndex(id(c)[Dune::Indices::_0], tail, isFinal);
    \n-
    308 });
    \n-
    309 });
    \n-
    310 });
    \n-
    311 }
    \n-
    312
    \n-
    313 template<class C, class MultiIndex>
    \n-
    314 constexpr decltype(auto) resolveStaticMultiIndex(C&& c, const MultiIndex& multiIndex)
    \n-
    315 {
    \n-
    316 auto isExhausted = Hybrid::equals(Hybrid::size(multiIndex), Dune::Indices::_0);
    \n-
    317 return Hybrid::ifElse(isExhausted, [&, c = forwardCapture(std::forward<C>(c))](auto) -> decltype(auto) {
    \n-
    318 return c.forward();
    \n-
    319 }, [&](auto id) -> decltype(auto) {
    \n-
    320 auto head = multiIndex[Dune::Indices::_0];
    \n-
    321 auto tail = multiIndex.pop();
    \n-
    322
    \n-
    323 return Imp::resolveStaticMultiIndex(id(c)[head], tail);
    \n-
    324 });
    \n-
    325 }
    \n-
    326
    \n-
    327} // namespace Imp
    \n-
    328
    \n-
    329
    \n-
    330
    \n-
    353template<class C, class MultiIndex, class IsFinal>
    \n-
    354constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex& multiIndex, const IsFinal& isFinal)
    \n-
    355{
    \n-
    356 return Imp::resolveDynamicMultiIndex(std::forward<C>(c), Imp::shiftedDynamicMultiIndex<0>(multiIndex), isFinal);
    \n-
    357}
    \n-
    358
    \n-
    375template<class C, class MultiIndex>
    \n-
    376constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex& multiIndex)
    \n-
    377{
    \n-
    378 auto hasNoIndexAccess = negatePredicate(callableCheck([](auto&& cc) -> std::void_t<decltype(cc[Dune::Indices::_0])> {}));
    \n-
    379 return Imp::resolveDynamicMultiIndex(std::forward<C>(c), Imp::shiftedDynamicMultiIndex<0>(multiIndex), hasNoIndexAccess);
    \n-
    380}
    \n-
    381
    \n-
    397template<class C, class MultiIndex>
    \n-
    398constexpr decltype(auto) resolveStaticMultiIndex(C&& c, const MultiIndex& multiIndex)
    \n-
    399{
    \n-
    400 return Imp::resolveStaticMultiIndex(std::forward<C>(c), Imp::shiftedStaticMultiIndex<0>(multiIndex));
    \n-
    401}
    \n-
    402
    \n-
    403
    \n-
    404
    \n-
    405} // namespace Dune::Functions
    \n-
    406} // namespace Dune
    \n-
    407
    \n-
    408
    \n-
    409
    \n-
    410#endif // DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH
    \n-\n-
    auto hybridIndexAccess(C &&c, const I &i, F &&f) -> decltype(f(c[i]))
    Provide operator[] index-access for containers.
    Definition: indexaccess.hh:63
    \n-
    constexpr decltype(auto) resolveStaticMultiIndex(C &&c, const MultiIndex &multiIndex)
    Provide multi-index access by chaining operator[].
    Definition: indexaccess.hh:398
    \n-
    auto callableCheck(Expression f)
    Create a predicate for checking validity of expressions.
    Definition: utility.hh:279
    \n-
    constexpr decltype(auto) resolveDynamicMultiIndex(C &&c, const MultiIndex &multiIndex)
    Provide multi-index access by chaining operator[].
    Definition: indexaccess.hh:376
    \n-
    constexpr decltype(auto) resolveDynamicMultiIndex(C &&c, const MultiIndex &multiIndex, const IsFinal &isFinal)
    Provide multi-index access by chaining operator[].
    Definition: indexaccess.hh:354
    \n-
    Result hybridMultiIndexAccess(C &&c, const MultiIndex &index)
    Provide multi-index access by chaining operator[].
    Definition: indexaccess.hh:263
    \n-
    auto negatePredicate(Check check)
    Negate given predicate.
    Definition: utility.hh:304
    \n+
    177#endif // DUNE_FUNCTIONS_COMMON_SIGNATURE_HH
    \n+\n+
    auto derivativeSignatureTag(SignatureTag< Range(Domain), DerivativeTraits > tag)
    Construct SignatureTag for derivative.
    Definition: signature.hh:133
    \n+
    auto derivativeSignatureTags(Dune::Functions::SignatureTag< Signature, DerivativeTraits > tag)
    Construct SignatureTags for derivatives.
    Definition: signature.hh:155
    \n
    Definition: polynomial.hh:10
    \n-
    auto forwardCapture(T &&t)
    Create a capture object for perfect forwarding.
    Definition: utility.hh:372
    \n+
    Helper class to check that F is callable.
    Definition: signature.hh:20
    \n+
    Helper class to deduce the signature of a callable.
    Definition: signature.hh:56
    \n+
    Definition: signature.hh:102
    \n+
    DerivativeTraitsT< T > DerivativeTraits
    Definition: signature.hh:119
    \n+
    Range(Domain) Signature
    Definition: signature.hh:116
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,362 +5,180 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-indexaccess.hh\n+signature.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH\n- 4#define DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH\n+ 3#ifndef DUNE_FUNCTIONS_COMMON_SIGNATURE_HH\n+ 4#define DUNE_FUNCTIONS_COMMON_SIGNATURE_HH\n 5\n- 6\n- 7#include \n- 8#include \n- 9\n- 10#include \n- 11#include \n- 12#include \n+ 6#include \n+ 7#include \n+ 8\n+ 9#include \n+ 10\n+ 11namespace Dune {\n+ 12namespace Functions {\n 13\n- 14#include \n- 15\n- 16\n- 17\n- 18namespace Dune {\n- 19namespace Functions {\n- 20\n+ 19template\n+20struct IsCallable;\n 21\n- 22namespace Imp {\n- 23\n- 24namespace Concept {\n- 25\n- 26template\n- 27struct HasDynamicIndexAccess\n- 28{\n- 29 template\n- 30 auto require(C&& c) -> decltype(\n- 31 c[std::declval()]\n- 32 );\n- 33};\n- 34\n- 35struct HasStaticIndexAccess\n- 36{\n- 37 template\n- 38 auto require(C&& c) -> decltype(\n- 39 c[Dune::Indices::_0]\n- 40 );\n+ 22#ifndef DOXYGEN\n+ 23template\n+ 24struct IsCallable\n+ 25{\n+ 26 struct yes { std::size_t dummy[2]; };\n+ 27 struct no { std::size_t dummy[1]; };\n+ 28\n+ 29 template\n+ 30 static yes test(const decltype(&C::operator()) *);\n+ 31 template\n+ 32 static no test(...);\n+ 33\n+ 34 enum { value = (sizeof(test(0)) == sizeof(yes)) };\n+ 35};\n+ 36\n+ 37template\n+ 38struct IsCallable\n+ 39{\n+ 40 enum { value = true };\n 41};\n 42\n- 43} // namespace Concept\n- 44\n- 45} // namespace Imp\n- 46\n- 47\n- 48\n- 61template, C>(), int>::type = 0>\n-63auto hybridIndexAccess(C&& c, const I& i, F&& f)\n- 64 -> decltype(f(c[i]))\n- 65{\n- 66 return f(c[i]);\n- 67}\n- 68\n- 86template, C>(), int>::type = 0>\n-88decltype(auto) hybridIndexAccess(C&& c, const I& i, F&& f)\n- 89{\n- 90 using Size = decltype(Hybrid::size(c));\n- 91 return Hybrid::switchCases(std::make_index_sequence(), i,\n- 92 [&](const auto& ii) -> decltype(auto){\n- 93 return f(c[ii]);\n- 94 }, [&]() -> decltype(auto){\n- 95 return f(c[Dune::Indices::_0]);\n- 96 });\n- 97}\n- 98\n+ 43template\n+ 44struct IsCallable\n+ 45{\n+ 46 enum { value = true };\n+ 47};\n+ 48#endif\n+ 49\n+ 55template::value >\n+56struct SignatureTraits {};\n+ 57\n+ 58#ifndef DOXYGEN\n+ 60template\n+ 61struct SignatureTraits\n+ 62 : public SignatureTraits\n+ 63{};\n+ 64\n+ 66template \n+ 67struct SignatureTraits\n+ 68 : public SignatureTraits\n+ 69{};\n+ 70\n+ 72template \n+ 73struct SignatureTraits\n+ 74 : public SignatureTraits\n+ 75{};\n+ 76\n+ 78template \n+ 79struct SignatureTraits\n+ 80 : public SignatureTraits\n+ 81{};\n+ 82\n+ 84template\n+ 85struct SignatureTraits\n+ 86{\n+ 87 using Range = R;\n+ 88 using Domain = D;\n+ 89\n+ 90 using RawRange = typename std::decay::type;\n+ 91 using RawDomain = typename std::decay::type;\n+ 92\n+ 93 using RawSignature = RawRange(RawDomain);\n+ 94\n+ 95 template class DerivativeTraits=DefaultDerivativeTraits>\n+ 96 using DerivativeSignature = typename DerivativeTraits::Range\n+(Domain);\n+ 97};\n+ 98#endif\n 99\n- 100namespace Imp {\n- 101\n- 115 template\n- 116 class ShiftedDynamicMultiIndex\n- 117 {\n- 118 public:\n- 119 ShiftedDynamicMultiIndex(const Index& index) :\n- 120 index_(index)\n- 121 {}\n+ 100\n+ 101template class\n+DerivativeTraits=DefaultDerivativeTraits>\n+102struct SignatureTag;\n+ 103\n+ 113template class\n+DerivativeTraitsT>\n+114struct SignatureTag\n+ 115{\n+116 using Signature = Range(Domain);\n+ 117\n+ 118 template\n+119 using DerivativeTraits = DerivativeTraitsT;\n+ 120};\n+ 121\n 122\n- 123 std::size_t operator[](std::size_t position) const\n- 124 {\n- 125 if (position pop() const\n- 135 {\n- 136 return {index_};\n- 137 }\n+ 123\n+ 132template class DerivativeTraits>\n+133auto derivativeSignatureTag(SignatureTag\n+tag)\n+ 134{\n+ 135 using DerivativeRange = typename DerivativeTraits::Range;\n+ 136 return SignatureTag();\n+ 137}\n 138\n- 139 std::size_t size() const\n- 140 {\n- 141 if (offset < index_.size())\n- 142 return index_.size() - offset;\n- 143 else\n- 144 return 0;\n- 145 }\n- 146\n- 147 private:\n- 148 const Index& index_;\n- 149 };\n- 150\n- 151 template\n- 152 class ShiftedStaticMultiIndex\n- 153 {\n- 154 public:\n- 155 ShiftedStaticMultiIndex(const Index& index) :\n- 156 index_(index)\n- 157 {}\n- 158\n- 159 template\n- 160 auto operator[](Dune::index_constant) const\n- 161 {\n- 162 if constexpr (i{}];\n- 164 } else {\n- 165 return Dune::index_constant<0>{};\n- 166 }\n- 167 }\n- 168\n- 172 ShiftedStaticMultiIndex pop() const\n- 173 {\n- 174 return {index_};\n- 175 }\n+ 139\n+ 140\n+ 154template class\n+DerivativeTraits>\n+155auto derivativeSignatureTags(Dune::Functions::SignatureTag tag)\n+ 156{\n+ 157 if constexpr (maxOrder==0) {\n+ 158 // If maxOrder== 0 we just need the given SignatureTag\n+ 159 return std::make_tuple(tag);\n+ 160 } else {\n+ 161 // else we first construct the tail tuple with SignatureTags for\n+derivatives\n+ 162 // of order 1 to maxOrder\n+ 163 auto tailTagsTuple = derivativeSignatureTags\n+(derivativeSignatureTag(tag));\n+ 164 // and prepend this with the given SignatureTag.\n+ 165 // This is done by unpacking the tail tuple with apply().\n+ 166 return std::apply([&](auto&&... tailTags){\n+ 167 return std::make_tuple(tag, tailTags...);\n+ 168 }, tailTagsTuple);\n+ 169 }\n+ 170}\n+ 171\n+ 172\n+ 173\n+ 174} // namespace Functions\n+ 175} // namespace Dune\n 176\n- 177 static constexpr std::size_t size()\n- 178 {\n- 179 auto fullSize = decltype(Hybrid::size(std::declval()))::value;\n- 180 if (offset < fullSize)\n- 181 return fullSize - offset;\n- 182 else\n- 183 return 0;\n- 184 }\n- 185\n- 186 private:\n- 187 const Index& index_;\n- 188 };\n- 189\n- 195 template\n- 196 ShiftedDynamicMultiIndex shiftedDynamicMultiIndex(const\n-Index& index)\n- 197 {\n- 198 return {index};\n- 199 }\n- 200\n- 201 template\n- 202 ShiftedStaticMultiIndex shiftedStaticMultiIndex(const\n-Index& index)\n- 203 {\n- 204 return {index};\n- 205 }\n- 206\n- 207} // namespace Imp\n- 208\n- 209\n- 210\n- 211\n- 212namespace Imp {\n- 213\n- 214template\n- 215struct MultiIndexResolver\n- 216{\n- 217 MultiIndexResolver(const Index& index) :\n- 218 index_(index)\n- 219 {}\n- 220\n- 221 template::value, int>::\n-type = 0>\n- 223 Result operator()(C&& c)\n- 224 {\n- 225 auto&& subIndex = Imp::shiftedDynamicMultiIndex<1>(index_);\n- 226 auto&& subIndexResolver = MultiIndexResolver\n-(subIndex);\n- 227 return (Result)(hybridIndexAccess(c, index_[Dune::Indices::_0],\n-subIndexResolver));\n- 228 }\n- 229\n- 230 template::value, int>::type\n-= 0>\n- 232 Result operator()(C&& c)\n- 233 {\n- 234 return (Result)(std::forward(c));\n- 235 }\n- 236\n- 237 const Index& index_;\n- 238};\n- 239\n- 240} // namespace Imp\n- 241\n- 242\n- 243\n- 262template\n-263Result hybridMultiIndexAccess(C&& c, const MultiIndex& index)\n- 264{\n- 265\n- 266 Imp::MultiIndexResolver multiIndexResolver(index);\n- 267 return multiIndexResolver(c);\n- 268}\n- 269\n- 270\n- 271\n- 272\n- 273\n- 274\n- 275namespace Imp {\n- 276\n- 277 template\n- 278 constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex&\n-multiIndex, const IsFinal& isFinal)\n- 279 {\n- 280 // If c is already considered final simply return it,\n- 281 // else resolve the next multiIndex entry.\n- 282 return Hybrid::ifElse(isFinal(c), [&, c = forwardCapture(std::forward\n-(c))](auto) -> decltype(auto) {\n- 283 assert(multiIndex.size() == 0);\n- 284 return c.forward();\n- 285 }, [&](auto) -> decltype(auto) {\n- 286 auto hasDynamicAccess = callableCheck([](auto&& cc) -> std::\n-void_t {});\n- 287\n- 288 // Split multiIndex into first entry and remaining ones.\n- 289 auto i = multiIndex[0];\n- 290 auto tail = multiIndex.pop();\n- 291\n- 292 // Resolve first multiIndex entry by c[multiIndex[0]] and\n- 293 // continue resolving with the remaining remaining ones.\n- 294 // If c has a dynamic operator[] this is straight forward.\n- 295 // Else the dynamic multiIndex[0] has to be translated into\n- 296 // a static one using hybridIndexAccess.\n- 297 return Hybrid::ifElse(hasDynamicAccess(c), [&](auto id) -> decltype(auto)\n-{\n- 298 return Imp::resolveDynamicMultiIndex(id(c)[i], tail, isFinal);\n- 299 }, [&](auto id) -> decltype(auto) {\n- 300 // auto indexRange = range(Hybrid::size(id(c)));\n- 301 auto indexRange = typename decltype(range(Hybrid::size(id(c))))::\n-integer_sequence();\n- 302 return Hybrid::switchCases(indexRange, i, [&](auto static_i) -> decltype\n-(auto){\n- 303 // Do rescursion with static version of i\n- 304 return Imp::resolveDynamicMultiIndex(id(c)[static_i], tail, isFinal);\n- 305 }, [&]() -> decltype(auto){\n- 306 // As fallback we use c[0] this is needed, because there must be one\n-branch that matches.\n- 307 return Imp::resolveDynamicMultiIndex(id(c)[Dune::Indices::_0], tail,\n-isFinal);\n- 308 });\n- 309 });\n- 310 });\n- 311 }\n- 312\n- 313 template\n- 314 constexpr decltype(auto) resolveStaticMultiIndex(C&& c, const MultiIndex&\n-multiIndex)\n- 315 {\n- 316 auto isExhausted = Hybrid::equals(Hybrid::size(multiIndex), Dune::\n-Indices::_0);\n- 317 return Hybrid::ifElse(isExhausted, [&, c = forwardCapture(std::forward\n-(c))](auto) -> decltype(auto) {\n- 318 return c.forward();\n- 319 }, [&](auto id) -> decltype(auto) {\n- 320 auto head = multiIndex[Dune::Indices::_0];\n- 321 auto tail = multiIndex.pop();\n- 322\n- 323 return Imp::resolveStaticMultiIndex(id(c)[head], tail);\n- 324 });\n- 325 }\n- 326\n- 327} // namespace Imp\n- 328\n- 329\n- 330\n- 353template\n-354constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex&\n-multiIndex, const IsFinal& isFinal)\n- 355{\n- 356 return Imp::resolveDynamicMultiIndex(std::forward(c), Imp::\n-shiftedDynamicMultiIndex<0>(multiIndex), isFinal);\n- 357}\n- 358\n- 375template\n-376constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex&\n-multiIndex)\n- 377{\n- 378 auto hasNoIndexAccess = negatePredicate(callableCheck([](auto&& cc) -\n-> std::void_t {}));\n- 379 return Imp::resolveDynamicMultiIndex(std::forward(c), Imp::\n-shiftedDynamicMultiIndex<0>(multiIndex), hasNoIndexAccess);\n- 380}\n- 381\n- 397template\n-398constexpr decltype(auto) resolveStaticMultiIndex(C&& c, const MultiIndex&\n-multiIndex)\n- 399{\n- 400 return Imp::resolveStaticMultiIndex(std::forward(c), Imp::\n-shiftedStaticMultiIndex<0>(multiIndex));\n- 401}\n- 402\n- 403\n- 404\n- 405} // namespace Dune::Functions\n- 406} // namespace Dune\n- 407\n- 408\n- 409\n- 410#endif // DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH\n-utility.hh\n-Dune::Functions::hybridIndexAccess\n-auto hybridIndexAccess(C &&c, const I &i, F &&f) -> decltype(f(c[i]))\n-Provide operator[] index-access for containers.\n-Definition: indexaccess.hh:63\n-Dune::Functions::resolveStaticMultiIndex\n-constexpr decltype(auto) resolveStaticMultiIndex(C &&c, const MultiIndex\n-&multiIndex)\n-Provide multi-index access by chaining operator[].\n-Definition: indexaccess.hh:398\n-Dune::Functions::callableCheck\n-auto callableCheck(Expression f)\n-Create a predicate for checking validity of expressions.\n-Definition: utility.hh:279\n-Dune::Functions::resolveDynamicMultiIndex\n-constexpr decltype(auto) resolveDynamicMultiIndex(C &&c, const MultiIndex\n-&multiIndex)\n-Provide multi-index access by chaining operator[].\n-Definition: indexaccess.hh:376\n-Dune::Functions::resolveDynamicMultiIndex\n-constexpr decltype(auto) resolveDynamicMultiIndex(C &&c, const MultiIndex\n-&multiIndex, const IsFinal &isFinal)\n-Provide multi-index access by chaining operator[].\n-Definition: indexaccess.hh:354\n-Dune::Functions::hybridMultiIndexAccess\n-Result hybridMultiIndexAccess(C &&c, const MultiIndex &index)\n-Provide multi-index access by chaining operator[].\n-Definition: indexaccess.hh:263\n-Dune::Functions::negatePredicate\n-auto negatePredicate(Check check)\n-Negate given predicate.\n-Definition: utility.hh:304\n+ 177#endif // DUNE_FUNCTIONS_COMMON_SIGNATURE_HH\n+defaultderivativetraits.hh\n+Dune::Functions::derivativeSignatureTag\n+auto derivativeSignatureTag(SignatureTag< Range(Domain), DerivativeTraits >\n+tag)\n+Construct SignatureTag for derivative.\n+Definition: signature.hh:133\n+Dune::Functions::derivativeSignatureTags\n+auto derivativeSignatureTags(Dune::Functions::SignatureTag< Signature,\n+DerivativeTraits > tag)\n+Construct SignatureTags for derivatives.\n+Definition: signature.hh:155\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::forwardCapture\n-auto forwardCapture(T &&t)\n-Create a capture object for perfect forwarding.\n-Definition: utility.hh:372\n+Dune::Functions::IsCallable\n+Helper class to check that F is callable.\n+Definition: signature.hh:20\n+Dune::Functions::SignatureTraits\n+Helper class to deduce the signature of a callable.\n+Definition: signature.hh:56\n+Dune::Functions::SignatureTag\n+Definition: signature.hh:102\n+Dune::Functions::SignatureTag<_Range(Domain),_DerivativeTraitsT_>::\n+DerivativeTraits\n+DerivativeTraitsT< T > DerivativeTraits\n+Definition: signature.hh:119\n+Dune::Functions::SignatureTag<_Range(Domain),_DerivativeTraitsT_>::Signature\n+Range(Domain) Signature\n+Definition: signature.hh:116\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00020.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00020.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: signature.hh File Reference\n+dune-functions: differentiablefunction_imp.hh File Reference\n \n \n \n \n \n \n \n@@ -63,52 +63,30 @@\n \n \n
    \n \n-
    signature.hh File Reference
    \n+Namespaces
    \n+
    differentiablefunction_imp.hh File Reference
    \n \n
    \n-
    #include <type_traits>
    \n-#include <tuple>
    \n-#include <dune/functions/common/defaultderivativetraits.hh>
    \n+
    #include <dune/common/exceptions.hh>
    \n+#include <dune/common/concept.hh>
    \n+#include <dune/functions/common/type_traits.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n-\n-\n-\n-\n-\n-\n-\n-

    \n-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...
     
    \n \n \n \n \n \n-

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n

    \n-Functions

    template<class Range , class Domain , template< class > class DerivativeTraits>
    auto Dune::Functions::derivativeSignatureTag (SignatureTag< Range(Domain), DerivativeTraits > tag)
     Construct SignatureTag for derivative. More...
     
    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. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,41 +5,21 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-Classes | Namespaces | Functions\n-signature.hh File Reference\n-#include \n-#include \n-#include \n+Namespaces\n+differentiablefunction_imp.hh File Reference\n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n- Classes\n-struct \u00a0Dune::Functions::SignatureTraits<_Signature,_isCallable_>\n-\u00a0 Helper class to deduce the signature of a callable. More...\n-\u00a0\n-struct \u00a0Dune::Functions::SignatureTag<_Range(Domain),_DerivativeTraitsT_>\n-\u00a0 Tag-class to encapsulate signature information. More...\n-\u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n- Functions\n-template class\n-DerivativeTraits>\n-auto\u00a0Dune::Functions::derivativeSignatureTag (SignatureTag< Range(Domain),\n- DerivativeTraits > tag)\n-\u00a0 Construct SignatureTag for derivative. More...\n-\u00a0\n-template class\n-DerivativeTraits>\n-auto\u00a0Dune::Functions::derivativeSignatureTags (Dune::Functions::SignatureTag<\n- Signature, DerivativeTraits > tag)\n-\u00a0 Construct SignatureTags for derivatives. More...\n-\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00020_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00020_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: signature.hh Source File\n+dune-functions: differentiablefunction_imp.hh Source File\n \n \n \n \n \n \n \n@@ -62,158 +62,116 @@\n \n \n
    \n
    \n-
    signature.hh
    \n+
    differentiablefunction_imp.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_COMMON_SIGNATURE_HH
    \n-
    4#define DUNE_FUNCTIONS_COMMON_SIGNATURE_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH
    \n+
    4#define DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH
    \n
    5
    \n-
    6#include <type_traits>
    \n-
    7#include <tuple>
    \n+
    6#include <dune/common/exceptions.hh>
    \n+
    7#include <dune/common/concept.hh>
    \n
    8
    \n-\n+\n
    10
    \n-
    11namespace Dune {
    \n-
    12namespace Functions {
    \n-
    13
    \n-
    19template<typename F>
    \n-\n-
    21
    \n-
    22#ifndef DOXYGEN
    \n-
    23template<typename F>
    \n-
    24struct IsCallable
    \n-
    25{
    \n-
    26 struct yes { std::size_t dummy[2]; };
    \n-
    27 struct no { std::size_t dummy[1]; };
    \n+
    11
    \n+
    12namespace Dune {
    \n+
    13namespace Functions {
    \n+
    14namespace Imp {
    \n+
    15
    \n+
    19struct HasFreeDerivative
    \n+
    20{
    \n+
    21 template<class F>
    \n+
    22 auto require(F&& f) -> decltype(
    \n+
    23 derivative(f)
    \n+
    24 );
    \n+
    25};
    \n+
    26
    \n+
    27
    \n
    28
    \n-
    29 template<typename C>
    \n-
    30 static yes test(const decltype(&C::operator()) *);
    \n-
    31 template<typename C>
    \n-
    32 static no test(...);
    \n-
    33
    \n-
    34 enum { value = (sizeof(test<F>(0)) == sizeof(yes)) };
    \n-
    35};
    \n+
    29template<class Dummy, class F,
    \n+
    30 typename std::enable_if<
    \n+
    31 models< HasFreeDerivative, F>() , int>::type = 0>
    \n+
    32auto derivativeIfImplemented(const F& f) -> decltype(derivative(f))
    \n+
    33{
    \n+
    34 return derivative(f);
    \n+
    35}
    \n
    36
    \n-
    37template<typename R, typename D>
    \n-
    38struct IsCallable<R(D)>
    \n-
    39{
    \n-
    40 enum { value = true };
    \n-
    41};
    \n-
    42
    \n-
    43template<typename R, typename D>
    \n-
    44struct IsCallable<R(*)(D)>
    \n-
    45{
    \n-
    46 enum { value = true };
    \n-
    47};
    \n-
    48#endif
    \n-
    49
    \n-
    55template<class Signature, bool isCallable = IsCallable<Signature>::value >
    \n-\n-
    57
    \n-
    58#ifndef DOXYGEN
    \n-
    60template<class T>
    \n-
    61struct SignatureTraits<T, true>
    \n-
    62 : public SignatureTraits<decltype(&T::operator()), true>
    \n-
    63{};
    \n-
    64
    \n-
    66template <typename C, typename R, typename D>
    \n-
    67struct SignatureTraits<R(C::*)(D) const, true>
    \n-
    68 : public SignatureTraits<R(D), true>
    \n-
    69{};
    \n-
    70
    \n-
    72template <typename C, typename R, typename D>
    \n-
    73struct SignatureTraits<R(C::*)(D), true>
    \n-
    74 : public SignatureTraits<R(D), true>
    \n-
    75{};
    \n-
    76
    \n-
    78template <typename R, typename D>
    \n-
    79struct SignatureTraits<R(*)(D), true>
    \n-
    80 : public SignatureTraits<R(D), true>
    \n-
    81{};
    \n-
    82
    \n-
    84template<class R, class D>
    \n-
    85struct SignatureTraits<R(D), true>
    \n-
    86{
    \n-
    87 using Range = R;
    \n-
    88 using Domain = D;
    \n-
    89
    \n-
    90 using RawRange = typename std::decay<Range>::type;
    \n-
    91 using RawDomain = typename std::decay<Domain>::type;
    \n+
    37
    \n+
    38
    \n+
    39template<class Dummy, class F,
    \n+
    40 typename std::enable_if<
    \n+
    41 not(models< HasFreeDerivative, F>()) , int>::type = 0>
    \n+
    42Dummy derivativeIfImplemented(const F& f)
    \n+
    43{
    \n+
    44 DUNE_THROW(Dune::NotImplemented, "Derivative not implemented");
    \n+
    45}
    \n+
    46
    \n+
    47
    \n+
    48
    \n+
    49template<class Signature, class DerivativeInterface>
    \n+
    50class DifferentiableFunctionWrapperInterface
    \n+
    51{};
    \n+
    52
    \n+
    53// Interface of type erasure wrapper
    \n+
    54//
    \n+
    55// Notice that the basic interface of polymorphic classes (destructor, clone, ...)
    \n+
    56// will be added by the type erasure foundation classes.
    \n+
    57template<class Range, class Domain, class DerivativeInterface>
    \n+
    58class DifferentiableFunctionWrapperInterface<Range(Domain), DerivativeInterface>
    \n+
    59{
    \n+
    60public:
    \n+
    61 virtual Range operator() (const Domain& x) const = 0;
    \n+
    62
    \n+
    63 virtual DerivativeInterface derivative() const = 0;
    \n+
    64};
    \n+
    65
    \n+
    66
    \n+
    67
    \n+
    68template<class Signature, class DerivativeInterface, class B>
    \n+
    69class DifferentiableFunctionWrapperImplementation
    \n+
    70{};
    \n+
    71
    \n+
    72// Implementation of type erasure wrapper
    \n+
    73template<class Range, class Domain, class DerivativeInterface, class B>
    \n+
    74class DifferentiableFunctionWrapperImplementation< Range(Domain), DerivativeInterface, B> :
    \n+
    75 public B
    \n+
    76{
    \n+
    77public:
    \n+
    78
    \n+
    79 using B::B;
    \n+
    80 using Wrapped = typename B::Wrapped;
    \n+
    81
    \n+
    82 virtual Range operator() (const Domain& x) const
    \n+
    83 {
    \n+
    84 return this->get()(x);
    \n+
    85 }
    \n+
    86
    \n+
    87 virtual DerivativeInterface derivative() const
    \n+
    88 {
    \n+
    89 return derivativeIfImplemented<DerivativeInterface, Wrapped>(this->get());
    \n+
    90 }
    \n+
    91};
    \n
    92
    \n-
    93 using RawSignature = RawRange(RawDomain);
    \n+
    93
    \n
    94
    \n-
    95 template<template<class> class DerivativeTraits=DefaultDerivativeTraits>
    \n-
    96 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(Domain);
    \n-
    97};
    \n-
    98#endif
    \n-
    99
    \n-
    100
    \n-
    101template<class Signature, template<class> class DerivativeTraits=DefaultDerivativeTraits>
    \n-\n-
    103
    \n-
    113template<class Range, class Domain, template<class> class DerivativeTraitsT>
    \n-
    114struct SignatureTag<Range(Domain), DerivativeTraitsT>
    \n-
    115{
    \n-
    116 using Signature = Range(Domain);
    \n-
    117
    \n-
    118 template<class T>
    \n-
    119 using DerivativeTraits = DerivativeTraitsT<T>;
    \n-
    120};
    \n-
    121
    \n-
    122
    \n-
    123
    \n-
    132template<class Range, class Domain, template<class> class DerivativeTraits>
    \n-
    133auto derivativeSignatureTag(SignatureTag<Range(Domain), DerivativeTraits> tag)
    \n-
    134{
    \n-
    135 using DerivativeRange = typename DerivativeTraits<Range(Domain)>::Range;
    \n-\n-
    137}
    \n-
    138
    \n-
    139
    \n-
    140
    \n-
    154template<std::size_t maxOrder, class Signature, template<class> class DerivativeTraits>
    \n-\n-
    156{
    \n-
    157 if constexpr (maxOrder==0) {
    \n-
    158 // If maxOrder== 0 we just need the given SignatureTag
    \n-
    159 return std::make_tuple(tag);
    \n-
    160 } else {
    \n-
    161 // else we first construct the tail tuple with SignatureTags for derivatives
    \n-
    162 // of order 1 to maxOrder
    \n-
    163 auto tailTagsTuple = derivativeSignatureTags<std::size_t(maxOrder-1)>(derivativeSignatureTag(tag));
    \n-
    164 // and prepend this with the given SignatureTag.
    \n-
    165 // This is done by unpacking the tail tuple with apply().
    \n-
    166 return std::apply([&](auto&&... tailTags){
    \n-
    167 return std::make_tuple(tag, tailTags...);
    \n-
    168 }, tailTagsTuple);
    \n-
    169 }
    \n-
    170}
    \n-
    171
    \n-
    172
    \n-
    173
    \n-
    174} // namespace Functions
    \n-
    175} // namespace Dune
    \n-
    176
    \n-
    177#endif // DUNE_FUNCTIONS_COMMON_SIGNATURE_HH
    \n-\n-
    auto derivativeSignatureTag(SignatureTag< Range(Domain), DerivativeTraits > tag)
    Construct SignatureTag for derivative.
    Definition: signature.hh:133
    \n-
    auto derivativeSignatureTags(Dune::Functions::SignatureTag< Signature, DerivativeTraits > tag)
    Construct SignatureTags for derivatives.
    Definition: signature.hh:155
    \n+
    95}}} // namespace Dune::Functions::Imp
    \n+
    96
    \n+
    97
    \n+
    98
    \n+
    99#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH
    \n+\n+
    TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
    Obtain derivative of TrigonometricFunction function.
    Definition: trigonometricfunction.hh:39
    \n
    Definition: polynomial.hh:10
    \n-
    Helper class to check that F is callable.
    Definition: signature.hh:20
    \n-
    Helper class to deduce the signature of a callable.
    Definition: signature.hh:56
    \n-
    Definition: signature.hh:102
    \n-
    DerivativeTraitsT< T > DerivativeTraits
    Definition: signature.hh:119
    \n-
    Range(Domain) Signature
    Definition: signature.hh:116
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,180 +5,119 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-signature.hh\n+differentiablefunction_imp.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_COMMON_SIGNATURE_HH\n- 4#define DUNE_FUNCTIONS_COMMON_SIGNATURE_HH\n+ 3#ifndef DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH\n+ 4#define DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH\n 5\n- 6#include \n- 7#include \n+ 6#include \n+ 7#include \n 8\n- 9#include \n+ 9#include \n 10\n- 11namespace Dune {\n- 12namespace Functions {\n- 13\n- 19template\n-20struct IsCallable;\n- 21\n- 22#ifndef DOXYGEN\n- 23template\n- 24struct IsCallable\n- 25{\n- 26 struct yes { std::size_t dummy[2]; };\n- 27 struct no { std::size_t dummy[1]; };\n+ 11\n+ 12namespace Dune {\n+ 13namespace Functions {\n+ 14namespace Imp {\n+ 15\n+ 19struct HasFreeDerivative\n+ 20{\n+ 21 template\n+ 22 auto require(F&& f) -> decltype(\n+ 23 derivative(f)\n+ 24 );\n+ 25};\n+ 26\n+ 27\n 28\n- 29 template\n- 30 static yes test(const decltype(&C::operator()) *);\n- 31 template\n- 32 static no test(...);\n- 33\n- 34 enum { value = (sizeof(test(0)) == sizeof(yes)) };\n- 35};\n+ 29template() , int>::type = 0>\n+ 32auto derivativeIfImplemented(const F& f) -> decltype(derivative(f))\n+ 33{\n+ 34 return derivative(f);\n+ 35}\n 36\n- 37template\n- 38struct IsCallable\n- 39{\n- 40 enum { value = true };\n- 41};\n- 42\n- 43template\n- 44struct IsCallable\n- 45{\n- 46 enum { value = true };\n- 47};\n- 48#endif\n- 49\n- 55template::value >\n-56struct SignatureTraits {};\n- 57\n- 58#ifndef DOXYGEN\n- 60template\n- 61struct SignatureTraits\n- 62 : public SignatureTraits\n- 63{};\n- 64\n- 66template \n- 67struct SignatureTraits\n- 68 : public SignatureTraits\n- 69{};\n- 70\n- 72template \n- 73struct SignatureTraits\n- 74 : public SignatureTraits\n- 75{};\n- 76\n- 78template \n- 79struct SignatureTraits\n- 80 : public SignatureTraits\n- 81{};\n- 82\n- 84template\n- 85struct SignatureTraits\n- 86{\n- 87 using Range = R;\n- 88 using Domain = D;\n- 89\n- 90 using RawRange = typename std::decay::type;\n- 91 using RawDomain = typename std::decay::type;\n+ 37\n+ 38\n+ 39template()) , int>::type = 0>\n+ 42Dummy derivativeIfImplemented(const F& f)\n+ 43{\n+ 44 DUNE_THROW(Dune::NotImplemented, \"Derivative not implemented\");\n+ 45}\n+ 46\n+ 47\n+ 48\n+ 49template\n+ 50class DifferentiableFunctionWrapperInterface\n+ 51{};\n+ 52\n+ 53// Interface of type erasure wrapper\n+ 54//\n+ 55// Notice that the basic interface of polymorphic classes (destructor,\n+clone, ...)\n+ 56// will be added by the type erasure foundation classes.\n+ 57template\n+ 58class DifferentiableFunctionWrapperInterface\n+ 59{\n+ 60public:\n+ 61 virtual Range operator() (const Domain& x) const = 0;\n+ 62\n+ 63 virtual DerivativeInterface derivative() const = 0;\n+ 64};\n+ 65\n+ 66\n+ 67\n+ 68template\n+ 69class DifferentiableFunctionWrapperImplementation\n+ 70{};\n+ 71\n+ 72// Implementation of type erasure wrapper\n+ 73template\n+ 74class DifferentiableFunctionWrapperImplementation< Range(Domain),\n+DerivativeInterface, B> :\n+ 75 public B\n+ 76{\n+ 77public:\n+ 78\n+ 79 using B::B;\n+ 80 using Wrapped = typename B::Wrapped;\n+ 81\n+ 82 virtual Range operator() (const Domain& x) const\n+ 83 {\n+ 84 return this->get()(x);\n+ 85 }\n+ 86\n+ 87 virtual DerivativeInterface derivative() const\n+ 88 {\n+ 89 return derivativeIfImplemented(this->get());\n+ 90 }\n+ 91};\n 92\n- 93 using RawSignature = RawRange(RawDomain);\n+ 93\n 94\n- 95 template class DerivativeTraits=DefaultDerivativeTraits>\n- 96 using DerivativeSignature = typename DerivativeTraits::Range\n-(Domain);\n- 97};\n- 98#endif\n- 99\n- 100\n- 101template class\n-DerivativeTraits=DefaultDerivativeTraits>\n-102struct SignatureTag;\n- 103\n- 113template class\n-DerivativeTraitsT>\n-114struct SignatureTag\n- 115{\n-116 using Signature = Range(Domain);\n- 117\n- 118 template\n-119 using DerivativeTraits = DerivativeTraitsT;\n- 120};\n- 121\n- 122\n- 123\n- 132template class DerivativeTraits>\n-133auto derivativeSignatureTag(SignatureTag\n-tag)\n- 134{\n- 135 using DerivativeRange = typename DerivativeTraits::Range;\n- 136 return SignatureTag();\n- 137}\n- 138\n- 139\n- 140\n- 154template class\n-DerivativeTraits>\n-155auto derivativeSignatureTags(Dune::Functions::SignatureTag tag)\n- 156{\n- 157 if constexpr (maxOrder==0) {\n- 158 // If maxOrder== 0 we just need the given SignatureTag\n- 159 return std::make_tuple(tag);\n- 160 } else {\n- 161 // else we first construct the tail tuple with SignatureTags for\n-derivatives\n- 162 // of order 1 to maxOrder\n- 163 auto tailTagsTuple = derivativeSignatureTags\n-(derivativeSignatureTag(tag));\n- 164 // and prepend this with the given SignatureTag.\n- 165 // This is done by unpacking the tail tuple with apply().\n- 166 return std::apply([&](auto&&... tailTags){\n- 167 return std::make_tuple(tag, tailTags...);\n- 168 }, tailTagsTuple);\n- 169 }\n- 170}\n- 171\n- 172\n- 173\n- 174} // namespace Functions\n- 175} // namespace Dune\n- 176\n- 177#endif // DUNE_FUNCTIONS_COMMON_SIGNATURE_HH\n-defaultderivativetraits.hh\n-Dune::Functions::derivativeSignatureTag\n-auto derivativeSignatureTag(SignatureTag< Range(Domain), DerivativeTraits >\n-tag)\n-Construct SignatureTag for derivative.\n-Definition: signature.hh:133\n-Dune::Functions::derivativeSignatureTags\n-auto derivativeSignatureTags(Dune::Functions::SignatureTag< Signature,\n-DerivativeTraits > tag)\n-Construct SignatureTags for derivatives.\n-Definition: signature.hh:155\n+ 95}}} // namespace Dune::Functions::Imp\n+ 96\n+ 97\n+ 98\n+ 99#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH\n+type_traits.hh\n+Dune::Functions::derivative\n+TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const\n+TrigonometricFunction< K, sinFactor, cosFactor > &f)\n+Obtain derivative of TrigonometricFunction function.\n+Definition: trigonometricfunction.hh:39\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::IsCallable\n-Helper class to check that F is callable.\n-Definition: signature.hh:20\n-Dune::Functions::SignatureTraits\n-Helper class to deduce the signature of a callable.\n-Definition: signature.hh:56\n-Dune::Functions::SignatureTag\n-Definition: signature.hh:102\n-Dune::Functions::SignatureTag<_Range(Domain),_DerivativeTraitsT_>::\n-DerivativeTraits\n-DerivativeTraitsT< T > DerivativeTraits\n-Definition: signature.hh:119\n-Dune::Functions::SignatureTag<_Range(Domain),_DerivativeTraitsT_>::Signature\n-Range(Domain) Signature\n-Definition: signature.hh:116\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00023.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00023.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: localfunction_imp.hh File Reference\n+dune-functions: callable.hh File Reference\n \n \n \n \n \n \n \n@@ -63,29 +63,50 @@\n \n \n
    \n \n-
    localfunction_imp.hh File Reference
    \n+Classes |\n+Namespaces |\n+Functions
    \n+
    callable.hh File Reference
    \n \n
    \n-
    #include <dune/functions/common/type_traits.hh>
    \n-#include <dune/functions/common/differentiablefunction_imp.hh>
    \n+
    #include <memory>
    \n+#include <functional>
    \n+#include <dune/common/function.hh>
    \n+#include <dune/common/shared_ptr.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n+\n+\n+\n+\n+

    \n+Classes

    class  Dune::Functions::CallableFunctionWrapper< F >
     Wrap a Dune::VirtualFunction into a callable object. More...
     
    \n \n \n \n \n \n+

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n

    \n+Functions

    template<class F >
    CallableFunctionWrapper< F > Dune::Functions::callable (const F &f)
     Create a callable object from some Dune::VirtualFunction. More...
     
    template<class F >
    CallableFunctionWrapper< F > Dune::Functions::callable (const std::shared_ptr< F > &fp)
     Create a callable object from std::shared_ptr<F> More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,20 +5,38 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-Namespaces\n-localfunction_imp.hh File Reference\n-#include \n-#include \n+Classes | Namespaces | Functions\n+callable.hh File Reference\n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n+ Classes\n+class \u00a0Dune::Functions::CallableFunctionWrapper<_F_>\n+\u00a0 Wrap a Dune::VirtualFunction into a callable object. More...\n+\u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n+ Functions\n+template\n+CallableFunctionWrapper< F >\u00a0Dune::Functions::callable (const F &f)\n+\u00a0 Create a callable object from some Dune::\n+ VirtualFunction. More...\n+\u00a0\n+template\n+CallableFunctionWrapper< F >\u00a0Dune::Functions::callable (const std::shared_ptr<\n+ F > &fp)\n+\u00a0 Create a callable object from std::shared_ptr\n+ More...\n+\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00023_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00023_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: localfunction_imp.hh Source File\n+dune-functions: callable.hh Source File\n \n \n \n \n \n \n \n@@ -62,88 +62,90 @@\n \n \n
    \n
    \n-
    localfunction_imp.hh
    \n+
    callable.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_COMMON_LOCALFUNCTION_FUNCTION_IMP_HH
    \n-
    4#define DUNE_FUNCTIONS_COMMON_LOCALFUNCTION_FUNCTION_IMP_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_COMMON_CALLABLE_HH
    \n+
    4#define DUNE_FUNCTIONS_COMMON_CALLABLE_HH
    \n
    5
    \n-\n-\n+
    6#include <memory>
    \n+
    7#include <functional>
    \n
    8
    \n-
    9
    \n-
    10
    \n-
    11namespace Dune {
    \n-
    12namespace Functions {
    \n-
    13namespace Imp {
    \n-
    14
    \n-
    15// Interface of type erasure wrapper
    \n-
    16//
    \n-
    17// Notice that the basic interface of polymorphic classes (destructor, clone, ...)
    \n-
    18// will be added by the type erasure foundation classes.
    \n-
    19template<class Signature, class DerivativeInterface, class LocalContext>
    \n-
    20class LocalFunctionWrapperInterface :
    \n-
    21 public DifferentiableFunctionWrapperInterface<Signature, DerivativeInterface>
    \n-
    22{
    \n-
    23public:
    \n-
    24 virtual void bind(const LocalContext&) = 0;
    \n-
    25
    \n-
    26 virtual void unbind() = 0;
    \n-
    27
    \n-
    28 virtual bool bound() const = 0;
    \n-
    29
    \n-
    30 virtual const LocalContext& localContext() const = 0;
    \n-
    31};
    \n-
    32
    \n-
    33
    \n-
    34// Implementation of type erasure wrapper
    \n-
    35template<class Signature, class DerivativeInterface, class LocalContext, class B>
    \n-
    36class LocalFunctionWrapperImplementation :
    \n-
    37 public DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>
    \n+
    9#include <dune/common/function.hh>
    \n+
    10#include <dune/common/shared_ptr.hh>
    \n+
    11
    \n+
    12
    \n+
    13namespace Dune {
    \n+
    14namespace Functions {
    \n+
    15
    \n+
    16
    \n+
    17
    \n+
    18
    \n+
    36template<class F>
    \n+\n
    38{
    \n-
    39 using Base = DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>;
    \n-
    40public:
    \n-
    41 using Base::Base;
    \n-
    42
    \n-
    43 virtual void bind(const LocalContext& context)
    \n-
    44 {
    \n-
    45 this->get().bind(context);
    \n-
    46 }
    \n-
    47
    \n-
    48 virtual void unbind()
    \n-
    49 {
    \n-
    50 this->get().unbind();
    \n-
    51 }
    \n-
    52
    \n-
    53 virtual bool bound() const
    \n-
    54 {
    \n-
    55 return this->get().bound();
    \n-
    56 }
    \n-
    57
    \n-
    58 virtual const LocalContext& localContext() const
    \n-
    59 {
    \n-
    60 return this->get().localContext();
    \n-
    61 }
    \n-
    62};
    \n-
    63
    \n-
    64}}} // namespace Dune::Functions::Imp
    \n-
    65
    \n-
    66
    \n-
    67
    \n-
    68#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH
    \n-\n-\n+
    39 using Range = typename F::RangeType;
    \n+
    40 using Domain = typename F::DomainType;
    \n+
    41
    \n+
    42 public:
    \n+
    43
    \n+\n+
    51 {
    \n+
    52 f_ = Dune::stackobject_to_shared_ptr(f);
    \n+
    53 }
    \n+
    54
    \n+
    61 CallableFunctionWrapper(const std::shared_ptr<const F>& f) :
    \n+
    62 f_(f)
    \n+
    63 {}
    \n+
    64
    \n+
    70 Range operator()(const Domain& x) const
    \n+
    71 {
    \n+
    72 Range y;
    \n+
    73 f_->evaluate(x, y);
    \n+
    74 return y;
    \n+
    75 }
    \n+
    76
    \n+
    77 private:
    \n+
    78 std::shared_ptr<const F> f_;
    \n+
    79};
    \n+
    80
    \n+
    81
    \n+
    82
    \n+
    104template<class F>
    \n+\n+
    106{
    \n+\n+
    108}
    \n+
    109
    \n+
    110
    \n+
    136template<class F>
    \n+
    137CallableFunctionWrapper<F> callable(const std::shared_ptr<F>& fp)
    \n+
    138{
    \n+\n+
    140}
    \n+
    141
    \n+
    142
    \n+
    143
    \n+
    144} // namespace Functions
    \n+
    145} // namespace Dune
    \n+
    146
    \n+
    147#endif //DUNE_FUNCTIONS_COMMON_CALLABLE_HH
    \n+
    CallableFunctionWrapper< F > callable(const F &f)
    Create a callable object from some Dune::VirtualFunction.
    Definition: callable.hh:105
    \n
    Definition: polynomial.hh:10
    \n+
    Wrap a Dune::VirtualFunction into a callable object.
    Definition: callable.hh:38
    \n+
    Range operator()(const Domain &x) const
    Forward operator() to F::evaluate()
    Definition: callable.hh:70
    \n+
    CallableFunctionWrapper(const F &f)
    Instantiate from reference to f.
    Definition: callable.hh:50
    \n+
    CallableFunctionWrapper(const std::shared_ptr< const F > &f)
    Instantiate from std::shared_ptr to f.
    Definition: callable.hh:61
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,89 +5,100 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-localfunction_imp.hh\n+callable.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_COMMON_LOCALFUNCTION_FUNCTION_IMP_HH\n- 4#define DUNE_FUNCTIONS_COMMON_LOCALFUNCTION_FUNCTION_IMP_HH\n+ 3#ifndef DUNE_FUNCTIONS_COMMON_CALLABLE_HH\n+ 4#define DUNE_FUNCTIONS_COMMON_CALLABLE_HH\n 5\n- 6#include \n- 7#include \n+ 6#include \n+ 7#include \n 8\n- 9\n- 10\n- 11namespace Dune {\n- 12namespace Functions {\n- 13namespace Imp {\n- 14\n- 15// Interface of type erasure wrapper\n- 16//\n- 17// Notice that the basic interface of polymorphic classes (destructor,\n-clone, ...)\n- 18// will be added by the type erasure foundation classes.\n- 19template\n- 20class LocalFunctionWrapperInterface :\n- 21 public DifferentiableFunctionWrapperInterface\n- 22{\n- 23public:\n- 24 virtual void bind(const LocalContext&) = 0;\n- 25\n- 26 virtual void unbind() = 0;\n- 27\n- 28 virtual bool bound() const = 0;\n- 29\n- 30 virtual const LocalContext& localContext() const = 0;\n- 31};\n- 32\n- 33\n- 34// Implementation of type erasure wrapper\n- 35template\n- 36class LocalFunctionWrapperImplementation :\n- 37 public DifferentiableFunctionWrapperImplementation\n+ 9#include \n+ 10#include \n+ 11\n+ 12\n+ 13namespace Dune {\n+ 14namespace Functions {\n+ 15\n+ 16\n+ 17\n+ 18\n+ 36template\n+37class CallableFunctionWrapper\n 38{\n- 39 using Base = DifferentiableFunctionWrapperImplementation;\n- 40public:\n- 41 using Base::Base;\n- 42\n- 43 virtual void bind(const LocalContext& context)\n- 44 {\n- 45 this->get().bind(context);\n- 46 }\n- 47\n- 48 virtual void unbind()\n- 49 {\n- 50 this->get().unbind();\n- 51 }\n- 52\n- 53 virtual bool bound() const\n- 54 {\n- 55 return this->get().bound();\n- 56 }\n- 57\n- 58 virtual const LocalContext& localContext() const\n- 59 {\n- 60 return this->get().localContext();\n- 61 }\n- 62};\n- 63\n- 64}}} // namespace Dune::Functions::Imp\n- 65\n- 66\n- 67\n- 68#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_IMP_HH\n-type_traits.hh\n-differentiablefunction_imp.hh\n+ 39 using Range = typename F::RangeType;\n+ 40 using Domain = typename F::DomainType;\n+ 41\n+ 42 public:\n+ 43\n+50 CallableFunctionWrapper(const F& f)\n+ 51 {\n+ 52 f_ = Dune::stackobject_to_shared_ptr(f);\n+ 53 }\n+ 54\n+61 CallableFunctionWrapper(const std::shared_ptr& f) :\n+ 62 f_(f)\n+ 63 {}\n+ 64\n+70 Range operator()(const Domain& x) const\n+ 71 {\n+ 72 Range y;\n+ 73 f_->evaluate(x, y);\n+ 74 return y;\n+ 75 }\n+ 76\n+ 77 private:\n+ 78 std::shared_ptr f_;\n+ 79};\n+ 80\n+ 81\n+ 82\n+ 104template\n+105CallableFunctionWrapper callable(const F& f)\n+ 106{\n+ 107 return CallableFunctionWrapper(f);\n+ 108}\n+ 109\n+ 110\n+ 136template\n+137CallableFunctionWrapper callable(const std::shared_ptr& fp)\n+ 138{\n+ 139 return CallableFunctionWrapper(fp);\n+ 140}\n+ 141\n+ 142\n+ 143\n+ 144} // namespace Functions\n+ 145} // namespace Dune\n+ 146\n+ 147#endif //DUNE_FUNCTIONS_COMMON_CALLABLE_HH\n+Dune::Functions::callable\n+CallableFunctionWrapper< F > callable(const F &f)\n+Create a callable object from some Dune::VirtualFunction.\n+Definition: callable.hh:105\n Dune\n Definition: polynomial.hh:10\n+Dune::Functions::CallableFunctionWrapper\n+Wrap a Dune::VirtualFunction into a callable object.\n+Definition: callable.hh:38\n+Dune::Functions::CallableFunctionWrapper::operator()\n+Range operator()(const Domain &x) const\n+Forward operator() to F::evaluate()\n+Definition: callable.hh:70\n+Dune::Functions::CallableFunctionWrapper::CallableFunctionWrapper\n+CallableFunctionWrapper(const F &f)\n+Instantiate from reference to f.\n+Definition: callable.hh:50\n+Dune::Functions::CallableFunctionWrapper::CallableFunctionWrapper\n+CallableFunctionWrapper(const std::shared_ptr< const F > &f)\n+Instantiate from std::shared_ptr to f.\n+Definition: callable.hh:61\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00026.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00026.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: functionconcepts.hh File Reference\n+dune-functions: reserveddeque.hh File Reference\n \n \n \n \n \n \n \n@@ -65,123 +65,68 @@\n
  • dune
  • functions
  • common
  • \n \n \n
    \n \n-
    functionconcepts.hh File Reference
    \n+Macros
    \n+
    reserveddeque.hh File Reference
    \n \n
    \n-
    #include <dune/common/typelist.hh>
    \n-#include <dune/common/concept.hh>
    \n-#include <dune/functions/common/signature.hh>
    \n-#include <dune/functions/gridfunctions/localderivativetraits.hh>
    \n-#include <dune/functions/gridfunctions/gridviewentityset.hh>
    \n+\n+

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

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

    Go to the source code of this file.

    \n \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n \n

    \n Classes

    struct  Dune::Functions::Concept::Callable< Args >
     Concept objects that can be called with given argument list. More...
     
    struct  Dune::Functions::Concept::Function< Range(Domain)>
     Concept for a function mapping Domain to Range. More...
     
    struct  Dune::Functions::Concept::DifferentiableFunction< Range(Domain), DerivativeTraits >
     Concept for a differentiable function mapping Domain to Range. More...
     
    struct  Dune::Functions::Concept::LocalFunction< Range(Domain), LocalContext >
     Concept for a local function mapping Domain to Range. More...
     
    struct  Dune::Functions::Concept::DifferentiableLocalFunction< Range(Domain), LocalContext, DerivativeTraits >
     Concept for a differentiable local function mapping Domain to Range. More...
     
    struct  Dune::Functions::Concept::EntitySet
     Concept for an entity set for a Concept::GridFunction<Range(Domain), EntitySet, DerivativeTraits> More...
     
    struct  Dune::Functions::Concept::GridFunction< Range(Domain), EntitySet >
     Concept for a grid function mapping Domain to Range. More...
     
    struct  Dune::Functions::Concept::DifferentiableGridFunction< Range(Domain), EntitySet, DerivativeTraits >
     Concept for a differentiable grid function mapping Domain to Range. More...
     
    struct  Dune::Functions::Concept::GridViewFunction< Range(Domain), GridView >
     Concept for a grid view function mapping Domain to Range. More...
     
    struct  Dune::Functions::Concept::DifferentiableGridViewFunction< Range(Domain), GridView, DerivativeTraits >
     Concept for a differentiable grid view function mapping Domain to Range. More...
    class  Dune::Functions::ReservedDeque< T, n >
     A double-ended queue (deque) class with statically reserved memory. More...
     
    \n \n \n \n \n \n-\n-\n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    namespace  Dune::Functions::Concept
     
    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n

    \n-Functions

    template<class F , class... Args>
    static constexpr auto Dune::Functions::Concept::isCallable ()
     Check if f is callable with given argument list. More...
     
    template<class F , class... Args>
    static constexpr auto Dune::Functions::Concept::isCallable (F &&, Args &&...)
     Check if f is callable with given argument list. More...
     
    template<class F , class Signature >
    static constexpr bool Dune::Functions::Concept::isFunction ()
     Check if F models the Function concept with given signature. More...
     
    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. More...
     
    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. More...
     
    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. More...
     
    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. More...
     
    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. More...
     
    template<class E >
    static constexpr bool Dune::Functions::Concept::isEntitySet ()
     Check if F models the GridFunction concept with given signature and entity set. More...
     
    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. More...
     
    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. More...
     
    template<class F , class Signature , class GridView >
    static constexpr bool Dune::Functions::Concept::isGridViewFunction ()
     Check if F models the GridViewFunction concept with given signature. More...
     
    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. More...
     

    \n+Macros

    #define CHECKSIZE(X)   {}
     
    \n+

    Detailed Description

    \n+

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

    \n+

    Macro Definition Documentation

    \n+\n+

    ◆ CHECKSIZE

    \n+\n+
    \n+
    \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+ \n+
    #define CHECKSIZE( X)   {}
    \n+
    \n+\n+
    \n+
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,137 +5,38 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-Classes | Namespaces | Functions\n-functionconcepts.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n+Classes | Namespaces | Macros\n+reserveddeque.hh File Reference\n+An stl-compliant double-ended queue which stores everything on the stack.\n+More...\n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0Dune::Functions::Concept::Callable<_Args_>\n-\u00a0 Concept objects that can be called with given argument list. More...\n-\u00a0\n-struct \u00a0Dune::Functions::Concept::Function<_Range(Domain)>\n-\u00a0 Concept for a function mapping Domain to Range. More...\n-\u00a0\n-struct \u00a0Dune::Functions::Concept::DifferentiableFunction<_Range(Domain),\n- DerivativeTraits_>\n-\u00a0 Concept for a differentiable function mapping Domain to Range. More...\n-\u00a0\n-struct \u00a0Dune::Functions::Concept::LocalFunction<_Range(Domain),_LocalContext_>\n-\u00a0 Concept for a local function mapping Domain to Range. More...\n-\u00a0\n-struct \u00a0Dune::Functions::Concept::DifferentiableLocalFunction<_Range(Domain),\n- LocalContext,_DerivativeTraits_>\n-\u00a0 Concept for a differentiable local function mapping Domain to Range.\n- More...\n-\u00a0\n-struct \u00a0Dune::Functions::Concept::EntitySet\n-\u00a0 Concept for an entity set for a Concept::GridFunction More...\n-\u00a0\n-struct \u00a0Dune::Functions::Concept::GridFunction<_Range(Domain),_EntitySet_>\n-\u00a0 Concept for a grid function mapping Domain to Range. More...\n-\u00a0\n-struct \u00a0Dune::Functions::Concept::DifferentiableGridFunction<_Range(Domain),\n- EntitySet,_DerivativeTraits_>\n-\u00a0 Concept for a differentiable grid function mapping Domain to Range.\n- More...\n-\u00a0\n-struct \u00a0Dune::Functions::Concept::GridViewFunction<_Range(Domain),_GridView_>\n-\u00a0 Concept for a grid view function mapping Domain to Range. More...\n-\u00a0\n-struct \u00a0Dune::Functions::Concept::DifferentiableGridViewFunction<_Range\n- (Domain),_GridView,_DerivativeTraits_>\n-\u00a0 Concept for a differentiable grid view function mapping Domain to\n- Range. More...\n+class \u00a0Dune::Functions::ReservedDeque<_T,_n_>\n+\u00a0 A double-ended queue (deque) class with statically reserved memory.\n+ More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n-namespace \u00a0Dune::Functions::Concept\n-\u00a0\n- Functions\n-template\n-static constexpr auto\u00a0Dune::Functions::Concept::isCallable ()\n-\u00a0 Check if f is callable with given argument list. More...\n-\u00a0\n-template\n-static constexpr auto\u00a0Dune::Functions::Concept::isCallable (F &&, Args &&...)\n-\u00a0 Check if f is callable with given argument list. More...\n-\u00a0\n-template\n-static constexpr bool\u00a0Dune::Functions::Concept::isFunction ()\n-\u00a0 Check if F models the Function concept with given\n- signature. More...\n-\u00a0\n-template class DerivativeTraits>\n-static constexpr bool\u00a0Dune::Functions::Concept::isFunction (F &&f,\n- SignatureTag< Signature, DerivativeTraits >)\n-\u00a0 Check if f models the Function concept with given\n- signature. More...\n-\u00a0\n-template class DerivativeTraits =\n-DefaultDerivativeTraits>\n-static constexpr bool\u00a0Dune::Functions::Concept::isDifferentiableFunction ()\n-\u00a0 Check if F models the DifferentiableFunction concept\n- with given signature. More...\n-\u00a0\n-template class DerivativeTraits>\n-static constexpr bool\u00a0Dune::Functions::Concept::isDifferentiableFunction (F\n- &&f, SignatureTag< Signature, DerivativeTraits >)\n-\u00a0 Check if f models the DifferentiableFunction concept\n- with given signature. More...\n-\u00a0\n-template\n-static constexpr bool\u00a0Dune::Functions::Concept::isLocalFunction ()\n-\u00a0 Check if F models the LocalFunction concept with given\n- signature and local context. More...\n-\u00a0\n-template\n-class DerivativeTraits = DefaultDerivativeTraits>\n-static constexpr bool\u00a0Dune::Functions::Concept::isDifferentiableLocalFunction\n- ()\n-\u00a0 Check if F models the DifferentiableLocalFunction\n- concept with given signature and local context. More...\n-\u00a0\n-template\n-static constexpr bool\u00a0Dune::Functions::Concept::isEntitySet ()\n-\u00a0 Check if F models the GridFunction concept with given\n- signature and entity set. More...\n-\u00a0\n-template\n-static constexpr bool\u00a0Dune::Functions::Concept::isGridFunction ()\n-\u00a0 Check if F models the GridFunction concept with given\n- signature and entity set. More...\n-\u00a0\n-template class\n-DerivativeTraits = DefaultDerivativeTraits>\n-static constexpr bool\u00a0Dune::Functions::Concept::isDifferentiableGridFunction\n- ()\n-\u00a0 Check if F models the DifferentiableGridFunction concept\n- with given signature and entity set. More...\n-\u00a0\n-template\n-static constexpr bool\u00a0Dune::Functions::Concept::isGridViewFunction ()\n-\u00a0 Check if F models the GridViewFunction concept with\n- given signature. More...\n-\u00a0\n-template class\n-DerivativeTraits = DefaultDerivativeTraits>\n-static constexpr bool\u00a0Dune::Functions::Concept::\n- isDifferentiableGridViewFunction ()\n-\u00a0 Check if F models the DifferentiableGridViewFunction\n- concept with given signature. More...\n+ Macros\n+#define\u00a0CHECKSIZE(X)\u00a0\u00a0\u00a0{}\n \u00a0\n+***** Detailed Description *****\n+An stl-compliant double-ended queue which stores everything on the stack.\n+***** Macro Definition Documentation *****\n+***** \u25c6\u00a0CHECKSIZE *****\n+#define CHECKSIZE ( \u00a0X ) \u00a0\u00a0\u00a0{}\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00026_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00026_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: functionconcepts.hh Source File\n+dune-functions: reserveddeque.hh Source File\n \n \n \n \n \n \n \n@@ -62,320 +62,229 @@\n \n \n
    \n
    \n-
    functionconcepts.hh
    \n+
    reserveddeque.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH
    \n-
    4#define DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH
    \n+
    4#define DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH
    \n
    5
    \n-
    6#include <dune/common/typelist.hh>
    \n-
    7#include <dune/common/concept.hh>
    \n-
    8
    \n-\n-\n-\n-
    12
    \n-
    13namespace Dune {
    \n-
    14namespace Functions {
    \n-
    15namespace Concept {
    \n+
    10#include <algorithm>
    \n+
    11#include <iostream>
    \n+
    12#include <cstddef>
    \n+
    13#include <initializer_list>
    \n+
    14
    \n+
    15#include <dune/common/genericiterator.hh>
    \n
    16
    \n-
    17using namespace Dune::Concept;
    \n-
    18
    \n-
    19
    \n-
    20
    \n-
    21// Callable concept ############################################################
    \n+
    17#ifdef CHECK_RESERVEDDEQUE
    \n+
    18#define CHECKSIZE(X) assert(X)
    \n+
    19#else
    \n+
    20#define CHECKSIZE(X) {}
    \n+
    21#endif
    \n
    22
    \n-
    23
    \n-
    31template<class... Args>
    \n-\n-
    33{
    \n-
    34 template<class F>
    \n-
    35 auto require(F&& f) -> decltype(
    \n-
    36 f(std::declval<Args>()...)
    \n-
    37 );
    \n-
    38};
    \n-
    39
    \n-
    46template<class F, class... Args>
    \n-
    47static constexpr auto isCallable()
    \n-
    48{ return models<Concept::Callable<Args...>, F>(); }
    \n-
    49
    \n-
    56template<class F, class... Args>
    \n-
    57static constexpr auto isCallable(F&&, Args&&...)
    \n-
    58{
    \n-
    59 return models<Concept::Callable<Args&&...>, F>();
    \n-
    60}
    \n-
    61
    \n-
    62
    \n-
    63
    \n-
    64// Function concept ############################################################
    \n-
    65template<class Signature>
    \n-
    66struct Function;
    \n-
    67
    \n-
    76template<class Range, class Domain>
    \n-
    77struct Function<Range(Domain)> : Refines<Callable<Domain> >
    \n-
    78{
    \n-
    79 template<class F>
    \n-
    80 auto require(F&& f) -> decltype(
    \n-
    81 // F models Function<Range(Domain)> if the result of F(Domain) is implicitly convertible to Range
    \n-
    82 requireConvertible<Range>(f(std::declval<Domain>()))
    \n-
    83 );
    \n-
    84};
    \n-
    85
    \n-
    87template<class F, class Signature>
    \n-
    88static constexpr bool isFunction()
    \n-
    89{ return models<Concept::Function<Signature>, F>(); }
    \n-
    90
    \n-
    92template<class F, class Signature, template<class> class DerivativeTraits>
    \n-\n-
    94{ return models<Concept::Function<Signature>, F>(); }
    \n-
    95
    \n-
    96
    \n-
    97
    \n-
    98// DifferentiableFunction concept ##############################################
    \n-
    99template<class Signature, template<class> class DerivativeTraits = DefaultDerivativeTraits>
    \n-\n+
    23namespace Dune {
    \n+
    24namespace Functions {
    \n+
    25
    \n+
    43 template<class T, int n>
    \n+\n+
    45 {
    \n+
    46 public:
    \n+
    47
    \n+
    51 typedef T value_type;
    \n+
    53 typedef T* pointer;
    \n+
    55 typedef T& reference;
    \n+
    57 typedef const T& const_reference;
    \n+
    59 typedef size_t size_type;
    \n+
    61 typedef std::ptrdiff_t difference_type;
    \n+
    63 typedef Dune::GenericIterator<ReservedDeque, value_type> iterator;
    \n+
    65 typedef Dune::GenericIterator<const ReservedDeque, const value_type> const_iterator;
    \n+
    66
    \n+\n+
    73 size_(0),
    \n+
    74 first_(0)
    \n+
    75 {}
    \n+
    76
    \n+
    77 ReservedDeque(std::initializer_list<T> const &l)
    \n+
    78 {
    \n+
    79 assert(l.size() <= n);// Actually, this is not needed any more!
    \n+
    80 size_ = l.size();
    \n+
    81 std::copy_n(l.begin(), size_, data_);
    \n+
    82 }
    \n+
    83
    \n+
    89 void clear()
    \n+
    90 {
    \n+
    91 first_ = 0;
    \n+
    92 size_ = 0;
    \n+
    93 }
    \n+
    94
    \n+
    96 void resize(size_t s)
    \n+
    97 {
    \n+
    98 CHECKSIZE(s<=n);
    \n+
    99 size_ = s;
    \n+
    100 }
    \n
    101
    \n-
    113template<class Range, class Domain, template<class> class DerivativeTraits>
    \n-
    114struct DifferentiableFunction<Range(Domain), DerivativeTraits> : Refines<Dune::Functions::Concept::Function<Range(Domain)> >
    \n-
    115{
    \n-\n+
    103 void push_back(const T& t)
    \n+
    104 {
    \n+
    105 CHECKSIZE(size_<n);
    \n+
    106 data_[size_++ % n] = t;
    \n+
    107 }
    \n+
    108
    \n+
    110 void push_front(const T& t)
    \n+
    111 {
    \n+
    112 CHECKSIZE(size_<n);
    \n+
    113 ++size_;
    \n+
    114 first_ = (first_+(n-1)) % n;
    \n+
    115 data_[first_] = t;
    \n+
    116 }
    \n
    117
    \n-
    118 template<class F>
    \n-
    119 auto require(F&& f) -> decltype(
    \n-
    120 derivative(f),
    \n-
    121 requireConcept<Function<DerivativeSignature>>(derivative(f))
    \n-
    122 );
    \n-
    123};
    \n+
    119 void pop_back()
    \n+
    120 {
    \n+
    121 if (! empty())
    \n+
    122 size_--;
    \n+
    123 }
    \n
    124
    \n-
    126template<class F, class Signature, template<class> class DerivativeTraits = DefaultDerivativeTraits>
    \n-
    127static constexpr bool isDifferentiableFunction()
    \n-
    128{ return models<Concept::DifferentiableFunction<Signature, DerivativeTraits>, F>(); }
    \n-
    129
    \n-
    131template<class F, class Signature, template<class> class DerivativeTraits>
    \n-\n-
    133{ return models<Concept::DifferentiableFunction<Signature, DerivativeTraits>, F>(); }
    \n+\n+
    127 {
    \n+
    128 if (! empty())
    \n+
    129 {
    \n+
    130 size_--;
    \n+
    131 first_ = (++first_) % n;
    \n+
    132 }
    \n+
    133 }
    \n
    134
    \n-
    135
    \n-
    136
    \n-
    137// LocalFunction concept ##############################################
    \n-
    138template<class Signature, class LocalContext>
    \n-\n-
    140
    \n-
    150template<class Range, class Domain, class LocalContext>
    \n-
    151struct LocalFunction<Range(Domain), LocalContext> :
    \n-
    152 Refines<Dune::Functions::Concept::Function<Range(Domain)> >
    \n-
    153{
    \n-
    154 template<class F>
    \n-
    155 auto require(F&& f) -> decltype(
    \n-
    156 f.bind(std::declval<LocalContext>()),
    \n-
    157 f.unbind(),
    \n-
    158 requireConvertible<bool>(f.bound()),
    \n-
    159 f.localContext(),
    \n-
    160 requireConvertible<LocalContext>(f.localContext())
    \n-
    161 );
    \n-
    162};
    \n-
    163
    \n-
    165template<class F, class Signature, class LocalContext>
    \n-
    166static constexpr bool isLocalFunction()
    \n-
    167{ return models<Concept::LocalFunction<Signature, LocalContext>, F>(); }
    \n+\n+
    137 return iterator(*this, 0);
    \n+
    138 }
    \n+
    139
    \n+\n+
    142 return const_iterator(*this, 0);
    \n+
    143 }
    \n+
    144
    \n+\n+
    147 return iterator(*this, size_);
    \n+
    148 }
    \n+
    149
    \n+\n+
    152 return const_iterator(*this, size_);
    \n+
    153 }
    \n+
    154
    \n+\n+
    157 {
    \n+
    158 CHECKSIZE(size_>i);
    \n+
    159 return data_[(first_ + i) % n];
    \n+
    160 }
    \n+
    161
    \n+\n+
    164 {
    \n+
    165 CHECKSIZE(size_>i);
    \n+
    166 return data_[(first_ + i) % n];
    \n+
    167 }
    \n
    168
    \n-
    169
    \n-
    170// DifferentiableLocalFunction concept ##############################################
    \n-
    171template<class Signature, class LocalContext, template<class> class DerivativeTraits = DefaultDerivativeTraits>
    \n-\n-
    173
    \n-
    186template<class Range, class Domain, class LocalContext, template<class> class DerivativeTraits>
    \n-
    187struct DifferentiableLocalFunction<Range(Domain), LocalContext, DerivativeTraits> :
    \n-
    188 Refines<
    \n-
    189 Dune::Functions::Concept::DifferentiableFunction<Range(Domain), DerivativeTraits>,
    \n-
    190 Dune::Functions::Concept::LocalFunction<Range(Domain),LocalContext>
    \n-
    191 >
    \n-
    192{
    \n-
    193 template<class F>
    \n-
    194 auto require(F&& f) -> decltype(
    \n-
    195 f.bind(std::declval<LocalContext>()),
    \n-
    196 f.unbind(),
    \n-
    197 f.localContext(),
    \n-
    198 requireConvertible<LocalContext>(f.localContext())
    \n-
    199 );
    \n-
    200};
    \n-
    201
    \n-
    203template<class F, class Signature, class LocalContext, template<class> class DerivativeTraits = DefaultDerivativeTraits>
    \n-
    204static constexpr bool isDifferentiableLocalFunction()
    \n-
    205{ return models<Concept::DifferentiableLocalFunction<Signature, LocalContext, DerivativeTraits>, F>(); }
    \n+\n+
    171 {
    \n+
    172 CHECKSIZE(size_>0);
    \n+
    173 return data_[first_];
    \n+
    174 }
    \n+
    175
    \n+\n+
    178 {
    \n+
    179 CHECKSIZE(size_>0);
    \n+
    180 return data_[first_];
    \n+
    181 }
    \n+
    182
    \n+\n+
    185 {
    \n+
    186 CHECKSIZE(size_>0);
    \n+
    187 return data_[(first_ + size_-1) % n];
    \n+
    188 }
    \n+
    189
    \n+\n+
    192 {
    \n+
    193 CHECKSIZE(size_>0);
    \n+
    194 return data_[(first_ + size_-1) % n];
    \n+
    195 }
    \n+
    196
    \n+\n+
    203 {
    \n+
    204 return size_;
    \n+
    205 }
    \n
    206
    \n-
    207
    \n-
    208// EntitySet concept ##############################################
    \n-
    209
    \n-\n-
    220{
    \n-
    221 template<class E>
    \n-
    222 auto require(E&& f) -> decltype(
    \n-
    223 requireType<typename E::Element>(),
    \n-
    224 requireType<typename E::LocalCoordinate>(),
    \n-
    225 requireType<typename E::GlobalCoordinate>()
    \n-
    226 );
    \n-
    227};
    \n-
    228
    \n-
    230template<class E>
    \n-
    231static constexpr bool isEntitySet()
    \n-
    232{ return models<Concept::EntitySet, E>(); }
    \n-
    233
    \n+
    208 bool empty() const
    \n+
    209 {
    \n+
    210 return size_==0;
    \n+
    211 }
    \n+
    212
    \n+
    214 static constexpr size_type capacity()
    \n+
    215 {
    \n+
    216 return n;
    \n+
    217 }
    \n+
    218
    \n+
    220 static constexpr size_type max_size()
    \n+
    221 {
    \n+
    222 return n;
    \n+
    223 }
    \n+
    224
    \n+
    228 friend std::ostream& operator<< (std::ostream& s, const ReservedDeque& v)
    \n+
    229 {
    \n+
    230 for (size_t i=0; i<v.size(); i++)
    \n+
    231 s << v[i] << " ";
    \n+
    232 return s;
    \n+
    233 }
    \n
    234
    \n-
    235
    \n-
    236// GridFunction concept ##############################################
    \n-
    237template<class Signature, class EntitySet>
    \n-\n-
    239
    \n-
    249template<class Range, class Domain, class EntitySet>
    \n-
    250struct GridFunction<Range(Domain), EntitySet> :
    \n-
    251 Refines<Dune::Functions::Concept::Function<Range(Domain)> >
    \n-
    252{
    \n-
    253 using LocalSignature = Range(typename EntitySet::LocalCoordinate);
    \n-
    254 using LocalContext = typename EntitySet::Element;
    \n-
    255
    \n-
    256 template<class F>
    \n-
    257 auto require(F&& f) -> decltype(
    \n-
    258 localFunction(f),
    \n-
    259 f.entitySet(),
    \n-
    260 requireConcept<LocalFunction<LocalSignature, LocalContext>>(localFunction(f)),
    \n-
    261 requireConcept<Concept::EntitySet, EntitySet>(),
    \n-
    262 requireConvertible<EntitySet>(f.entitySet()),
    \n-
    263 requireConvertible<typename EntitySet::GlobalCoordinate, Domain>()
    \n-
    264 );
    \n-
    265};
    \n-
    266
    \n-
    268template<class F, class Signature, class EntitySet>
    \n-
    269static constexpr bool isGridFunction()
    \n-
    270{ return models<Concept::GridFunction<Signature, EntitySet>, F>(); }
    \n-
    271
    \n-
    272
    \n-
    273// DifferentiableGridFunction concept ##############################################
    \n-
    274template<class Signature, class EntitySet, template<class> class DerivativeTraits = DefaultDerivativeTraits>
    \n-\n-
    276
    \n-
    289template<class Range, class Domain, class EntitySet, template<class> class DerivativeTraits>
    \n-
    290struct DifferentiableGridFunction<Range(Domain), EntitySet, DerivativeTraits> :
    \n-
    291 Refines<
    \n-
    292 Dune::Functions::Concept::DifferentiableFunction<Range(Domain), DerivativeTraits>,
    \n-
    293 Dune::Functions::Concept::GridFunction<Range(Domain),EntitySet>
    \n-
    294 >
    \n-
    295{
    \n-
    296 using LocalSignature = Range(typename EntitySet::LocalCoordinate);
    \n-
    297 using LocalContext = typename EntitySet::Element;
    \n-
    298
    \n-
    299 template<class R>
    \n-\n-
    301
    \n-
    302 template<class F>
    \n-
    303 auto require(F&& f) -> decltype(
    \n-
    304 requireConcept<DifferentiableLocalFunction<LocalSignature, LocalContext, LocalDerivativeTraits>>(localFunction(f))
    \n-
    305 );
    \n-
    306};
    \n-
    307
    \n-
    309template<class F, class Signature, class EntitySet, template<class> class DerivativeTraits = DefaultDerivativeTraits>
    \n-
    310static constexpr bool isDifferentiableGridFunction()
    \n-
    311{ return models<Concept::DifferentiableGridFunction<Signature, EntitySet, DerivativeTraits>, F>(); }
    \n-
    312
    \n-
    313
    \n-
    314
    \n-
    315// GridViewFunction concept ##############################################
    \n-
    316template<class Signature, class GridView>
    \n-\n-
    318
    \n-
    331template<class Range, class Domain, class GridView>
    \n-
    332struct GridViewFunction<Range(Domain), GridView> :
    \n-
    333 Refines<Dune::Functions::Concept::GridFunction<Range(Domain), GridViewEntitySet<GridView,0>>>
    \n-
    334{
    \n-
    335 template<class F>
    \n-
    336 auto require(F&& f) -> decltype(
    \n-
    337 0 // We don't need to check any further expressions, because a GridViewFunction is just a GridFunction with a special EntitySet
    \n-
    338 );
    \n-
    339};
    \n-
    340
    \n-
    342template<class F, class Signature, class GridView>
    \n-
    343static constexpr bool isGridViewFunction()
    \n-
    344{ return models<Concept::GridViewFunction<Signature, GridView>, F>(); }
    \n-
    345
    \n-
    346
    \n-
    347// DifferentiableGridViewFunction concept ##############################################
    \n-
    348template<class Signature, class GridView, template<class> class DerivativeTraits = DefaultDerivativeTraits>
    \n-\n-
    350
    \n-
    364template<class Range, class Domain, class GridView, template<class> class DerivativeTraits>
    \n-
    365struct DifferentiableGridViewFunction<Range(Domain), GridView, DerivativeTraits> :
    \n-
    366 Refines<Dune::Functions::Concept::DifferentiableGridFunction<Range(Domain), GridViewEntitySet<GridView,0>, DerivativeTraits>>
    \n-
    367{
    \n-
    368 template<class F>
    \n-
    369 auto require(F&& f) -> decltype(
    \n-
    370 0 // We don't need to check any further expressions, because a GridViewFunction is just a GridFunction with a special EntitySet
    \n-
    371 );
    \n-
    372};
    \n-
    373
    \n-
    375template<class F, class Signature, class GridView, template<class> class DerivativeTraits = DefaultDerivativeTraits>
    \n-
    376static constexpr bool isDifferentiableGridViewFunction()
    \n-
    377{ return models<Concept::DifferentiableGridViewFunction<Signature, GridView, DerivativeTraits>, F>(); }
    \n-
    378
    \n-
    379
    \n-
    380
    \n-
    381}}} // namespace Dune::Functions::Concept
    \n-
    382
    \n-
    383#endif // DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH
    \n-\n-\n-\n-
    static constexpr bool isGridFunction()
    Check if F models the GridFunction concept with given signature and entity set.
    Definition: functionconcepts.hh:269
    \n-
    static constexpr bool isDifferentiableLocalFunction()
    Check if F models the DifferentiableLocalFunction concept with given signature and local context.
    Definition: functionconcepts.hh:204
    \n-
    static constexpr bool isFunction()
    Check if F models the Function concept with given signature.
    Definition: functionconcepts.hh:88
    \n-
    static constexpr bool isDifferentiableGridViewFunction()
    Check if F models the DifferentiableGridViewFunction concept with given signature.
    Definition: functionconcepts.hh:376
    \n-
    static constexpr bool isDifferentiableFunction()
    Check if F models the DifferentiableFunction concept with given signature.
    Definition: functionconcepts.hh:127
    \n-
    static constexpr bool isGridViewFunction()
    Check if F models the GridViewFunction concept with given signature.
    Definition: functionconcepts.hh:343
    \n-
    static constexpr bool isEntitySet()
    Check if F models the GridFunction concept with given signature and entity set.
    Definition: functionconcepts.hh:231
    \n-
    static constexpr bool isDifferentiableGridFunction()
    Check if F models the DifferentiableGridFunction concept with given signature and entity set.
    Definition: functionconcepts.hh:310
    \n-
    static constexpr bool isLocalFunction()
    Check if F models the LocalFunction concept with given signature and local context.
    Definition: functionconcepts.hh:166
    \n-
    TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
    Obtain derivative of TrigonometricFunction function.
    Definition: trigonometricfunction.hh:39
    \n-
    static constexpr auto isCallable()
    Check if f is callable with given argument list.
    Definition: functionconcepts.hh:47
    \n+
    235 private:
    \n+
    236 T data_[n];
    \n+
    237 size_type first_;
    \n+
    238 size_type size_;
    \n+
    239 };
    \n+
    240
    \n+
    241} // end namespace Functions
    \n+
    242} // end namespace Dune
    \n+
    243
    \n+
    244#undef CHECKSIZE
    \n+
    245
    \n+
    246#endif // DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH
    \n+
    #define CHECKSIZE(X)
    Definition: reserveddeque.hh:20
    \n
    Definition: polynomial.hh:10
    \n-
    Default implementation for derivative traits.
    Definition: defaultderivativetraits.hh:37
    \n-
    Concept objects that can be called with given argument list.
    Definition: functionconcepts.hh:33
    \n-
    auto require(F &&f) -> decltype(f(std::declval< Args >()...))
    \n-
    Definition: functionconcepts.hh:66
    \n-
    auto require(F &&f) -> decltype(requireConvertible< Range >(f(std::declval< Domain >())))
    \n-
    Definition: functionconcepts.hh:100
    \n-
    typename SignatureTraits< Range(Domain)>::template DerivativeSignature< DerivativeTraits > DerivativeSignature
    Definition: functionconcepts.hh:116
    \n-
    auto require(F &&f) -> decltype(derivative(f), requireConcept< Function< DerivativeSignature > >(derivative(f)))
    \n-
    Definition: functionconcepts.hh:139
    \n-
    auto require(F &&f) -> decltype(f.bind(std::declval< LocalContext >()), f.unbind(), requireConvertible< bool >(f.bound()), f.localContext(), requireConvertible< LocalContext >(f.localContext()))
    \n-\n-
    auto require(F &&f) -> decltype(f.bind(std::declval< LocalContext >()), f.unbind(), f.localContext(), requireConvertible< LocalContext >(f.localContext()))
    \n-
    Concept for an entity set for a Concept::GridFunction<Range(Domain), EntitySet, DerivativeTraits>
    Definition: functionconcepts.hh:220
    \n-
    auto require(E &&f) -> decltype(requireType< typename E::Element >(), requireType< typename E::LocalCoordinate >(), requireType< typename E::GlobalCoordinate >())
    \n-
    Definition: functionconcepts.hh:238
    \n-
    typename EntitySet::Element LocalContext
    Definition: functionconcepts.hh:254
    \n-
    Range(typename EntitySet::LocalCoordinate) LocalSignature
    Definition: functionconcepts.hh:253
    \n-
    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 >())
    \n-
    Definition: functionconcepts.hh:275
    \n-
    typename Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits >::template Traits< R > LocalDerivativeTraits
    Definition: functionconcepts.hh:300
    \n-
    auto require(F &&f) -> decltype(requireConcept< DifferentiableLocalFunction< LocalSignature, LocalContext, LocalDerivativeTraits > >(localFunction(f)))
    \n-
    Range(typename EntitySet::LocalCoordinate) LocalSignature
    Definition: functionconcepts.hh:296
    \n-
    typename EntitySet::Element LocalContext
    Definition: functionconcepts.hh:297
    \n-
    Definition: functionconcepts.hh:317
    \n-\n-\n-\n-
    Helper class to deduce the signature of a callable.
    Definition: signature.hh:56
    \n-
    Definition: signature.hh:102
    \n-
    Derivative traits for local functions.
    Definition: localderivativetraits.hh:28
    \n+
    A double-ended queue (deque) class with statically reserved memory.
    Definition: reserveddeque.hh:45
    \n+
    void pop_front()
    Erases the first element of the vector, O(1) time.
    Definition: reserveddeque.hh:126
    \n+
    static constexpr size_type capacity()
    Returns current capacity (allocated memory) of the vector.
    Definition: reserveddeque.hh:214
    \n+
    void clear()
    Erases all elements.
    Definition: reserveddeque.hh:89
    \n+
    Dune::GenericIterator< ReservedDeque, value_type > iterator
    Iterator used to iterate through a vector.
    Definition: reserveddeque.hh:63
    \n+
    T value_type
    The type of object, T, stored in the vector.
    Definition: reserveddeque.hh:51
    \n+
    ReservedDeque()
    Constructor.
    Definition: reserveddeque.hh:72
    \n+
    bool empty() const
    Returns true if vector has no elements.
    Definition: reserveddeque.hh:208
    \n+
    const_reference back() const
    Returns const reference to last element of vector.
    Definition: reserveddeque.hh:191
    \n+
    friend std::ostream & operator<<(std::ostream &s, const ReservedDeque &v)
    Send ReservedDeque to an output stream.
    Definition: reserveddeque.hh:228
    \n+
    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
    \n+
    reference operator[](size_type i)
    Returns reference to the i'th element.
    Definition: reserveddeque.hh:156
    \n+
    reference front()
    Returns reference to first element of vector.
    Definition: reserveddeque.hh:170
    \n+
    T * pointer
    Pointer to T.
    Definition: reserveddeque.hh:53
    \n+
    const_reference front() const
    Returns const reference to first element of vector.
    Definition: reserveddeque.hh:177
    \n+
    iterator end()
    Returns an iterator pointing to the end of the vector.
    Definition: reserveddeque.hh:146
    \n+
    reference back()
    Returns reference to last element of vector.
    Definition: reserveddeque.hh:184
    \n+
    void pop_back()
    Erases the last element of the vector, O(1) time.
    Definition: reserveddeque.hh:119
    \n+
    const T & const_reference
    Const reference to T.
    Definition: reserveddeque.hh:57
    \n+
    static constexpr size_type max_size()
    Returns the maximum length of the vector.
    Definition: reserveddeque.hh:220
    \n+
    std::ptrdiff_t difference_type
    A signed integral type.
    Definition: reserveddeque.hh:61
    \n+
    T & reference
    Reference to T.
    Definition: reserveddeque.hh:55
    \n+
    Dune::GenericIterator< const ReservedDeque, const value_type > const_iterator
    Const iterator used to iterate through a vector.
    Definition: reserveddeque.hh:65
    \n+
    size_type size() const
    Returns number of elements in the vector.
    Definition: reserveddeque.hh:202
    \n+
    const_iterator end() const
    Returns a const_iterator pointing to the end of the vector.
    Definition: reserveddeque.hh:151
    \n+
    void resize(size_t s)
    Specifies a new size for the vector.
    Definition: reserveddeque.hh:96
    \n+
    iterator begin()
    Returns a iterator pointing to the beginning of the vector.
    Definition: reserveddeque.hh:136
    \n+
    const_iterator begin() const
    Returns a const_iterator pointing to the beginning of the vector.
    Definition: reserveddeque.hh:141
    \n+
    ReservedDeque(std::initializer_list< T > const &l)
    Definition: reserveddeque.hh:77
    \n+
    size_t size_type
    An unsigned integral type.
    Definition: reserveddeque.hh:59
    \n+
    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
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,460 +5,319 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-functionconcepts.hh\n+reserveddeque.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH\n- 4#define DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH\n+ 3#ifndef DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH\n+ 4#define DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH\n 5\n- 6#include \n- 7#include \n- 8\n- 9#include \n- 10#include \n- 11#include \n- 12\n- 13namespace Dune {\n- 14namespace Functions {\n- 15namespace Concept {\n+ 10#include \n+ 11#include \n+ 12#include \n+ 13#include \n+ 14\n+ 15#include \n 16\n- 17using namespace Dune::Concept;\n- 18\n- 19\n- 20\n- 21// Callable concept\n-############################################################\n+ 17#ifdef CHECK_RESERVEDDEQUE\n+ 18#define CHECKSIZE(X) assert(X)\n+ 19#else\n+20#define CHECKSIZE(X) {}\n+ 21#endif\n 22\n- 23\n- 31template\n-32struct Callable\n- 33{\n- 34 template\n-35 auto require(F&& f) -> decltype(\n- 36 f(std::declval()...)\n- 37 );\n- 38};\n- 39\n- 46template\n-47static constexpr auto isCallable()\n- 48{ return models, F>(); }\n- 49\n- 56template\n-57static constexpr auto isCallable(F&&, Args&&...)\n- 58{\n- 59 return models, F>();\n- 60}\n- 61\n- 62\n- 63\n- 64// Function concept\n-############################################################\n- 65template\n-66struct Function;\n- 67\n- 76template\n-77struct Function : Refines >\n- 78{\n- 79 template\n-80 auto require(F&& f) -> decltype(\n- 81 // F models Function if the result of F(Domain) is\n-implicitly convertible to Range\n- 82 requireConvertible(f(std::declval()))\n- 83 );\n- 84};\n- 85\n- 87template\n-88static constexpr bool isFunction()\n- 89{ return models, F>(); }\n- 90\n- 92template class DerivativeTraits>\n-93static constexpr bool isFunction(F&& f, SignatureTag)\n- 94{ return models, F>(); }\n- 95\n- 96\n- 97\n- 98// DifferentiableFunction concept\n-##############################################\n- 99template class DerivativeTraits =\n-DefaultDerivativeTraits>\n-100struct DifferentiableFunction;\n+ 23namespace Dune {\n+ 24namespace Functions {\n+ 25\n+ 43 template\n+44 class ReservedDeque\n+ 45 {\n+ 46 public:\n+ 47\n+51 typedef T value_type;\n+53 typedef T* pointer;\n+55 typedef T& reference;\n+57 typedef const T& const_reference;\n+59 typedef size_t size_type;\n+61 typedef std::ptrdiff_t difference_type;\n+63 typedef Dune::GenericIterator iterator;\n+65 typedef Dune::GenericIterator\n+const_iterator;\n+ 66\n+72 ReservedDeque() :\n+ 73 size_(0),\n+ 74 first_(0)\n+ 75 {}\n+ 76\n+77 ReservedDeque(std::initializer_list const &l)\n+ 78 {\n+ 79 assert(l.size() <= n);// Actually, this is not needed any more!\n+ 80 size_ = l.size();\n+ 81 std::copy_n(l.begin(), size_, data_);\n+ 82 }\n+ 83\n+89 void clear()\n+ 90 {\n+ 91 first_ = 0;\n+ 92 size_ = 0;\n+ 93 }\n+ 94\n+96 void resize(size_t s)\n+ 97 {\n+ 98 CHECKSIZE(s<=n);\n+ 99 size_ = s;\n+ 100 }\n 101\n- 113template class DerivativeTraits>\n-114struct DifferentiableFunction :\n-Refines >\n- 115{\n-116 using DerivativeSignature = typename SignatureTraits::\n-template DerivativeSignature;\n+103 void push_back(const T& t)\n+ 104 {\n+ 105 CHECKSIZE(size_\n-119 auto require(F&& f) -> decltype(\n- 120 derivative(f),\n- 121 requireConcept>(derivative(f))\n- 122 );\n- 123};\n+119 void pop_back()\n+ 120 {\n+ 121 if (! empty())\n+ 122 size_--;\n+ 123 }\n 124\n- 126template class DerivativeTraits =\n-DefaultDerivativeTraits>\n-127static constexpr bool isDifferentiableFunction()\n- 128{ return models, F>(); }\n- 129\n- 131template class DerivativeTraits>\n-132static constexpr bool isDifferentiableFunction(F&& f,\n-SignatureTag)\n- 133{ return models, F>(); }\n+126 void pop_front()\n+ 127 {\n+ 128 if (! empty())\n+ 129 {\n+ 130 size_--;\n+ 131 first_ = (++first_) % n;\n+ 132 }\n+ 133 }\n 134\n- 135\n- 136\n- 137// LocalFunction concept ##############################################\n- 138template\n-139struct LocalFunction;\n- 140\n- 150template\n-151struct LocalFunction :\n- 152 Refines >\n- 153{\n- 154 template\n-155 auto require(F&& f) -> decltype(\n- 156 f.bind(std::declval()),\n- 157 f.unbind(),\n- 158 requireConvertible(f.bound()),\n- 159 f.localContext(),\n- 160 requireConvertible(f.localContext())\n- 161 );\n- 162};\n- 163\n- 165template\n-166static constexpr bool isLocalFunction()\n- 167{ return models, F>(); }\n+136 iterator begin(){\n+ 137 return iterator(*this, 0);\n+ 138 }\n+ 139\n+141 const_iterator begin() const {\n+ 142 return const_iterator(*this, 0);\n+ 143 }\n+ 144\n+146 iterator end(){\n+ 147 return iterator(*this, size_);\n+ 148 }\n+ 149\n+151 const_iterator end() const {\n+ 152 return const_iterator(*this, size_);\n+ 153 }\n+ 154\n+156 reference operator[](size_type i)\n+ 157 {\n+ 158 CHECKSIZE(size_>i);\n+ 159 return data_[(first_ + i) % n];\n+ 160 }\n+ 161\n+163 const_reference operator[](size_type i) const\n+ 164 {\n+ 165 CHECKSIZE(size_>i);\n+ 166 return data_[(first_ + i) % n];\n+ 167 }\n 168\n- 169\n- 170// DifferentiableLocalFunction concept\n-##############################################\n- 171template class\n-DerivativeTraits = DefaultDerivativeTraits>\n-172struct DifferentiableLocalFunction;\n- 173\n- 186template\n-class DerivativeTraits>\n-187struct DifferentiableLocalFunction :\n- 188 Refines<\n- 189 Dune::Functions::Concept::DifferentiableFunction,\n- 190 Dune::Functions::Concept::LocalFunction\n- 191 >\n- 192{\n- 193 template\n-194 auto require(F&& f) -> decltype(\n- 195 f.bind(std::declval()),\n- 196 f.unbind(),\n- 197 f.localContext(),\n- 198 requireConvertible(f.localContext())\n- 199 );\n- 200};\n- 201\n- 203template\n-class DerivativeTraits = DefaultDerivativeTraits>\n-204static constexpr bool isDifferentiableLocalFunction()\n- 205{ return models, F>(); }\n+170 reference front()\n+ 171 {\n+ 172 CHECKSIZE(size_>0);\n+ 173 return data_[first_];\n+ 174 }\n+ 175\n+177 const_reference front() const\n+ 178 {\n+ 179 CHECKSIZE(size_>0);\n+ 180 return data_[first_];\n+ 181 }\n+ 182\n+184 reference back()\n+ 185 {\n+ 186 CHECKSIZE(size_>0);\n+ 187 return data_[(first_ + size_-1) % n];\n+ 188 }\n+ 189\n+191 const_reference back() const\n+ 192 {\n+ 193 CHECKSIZE(size_>0);\n+ 194 return data_[(first_ + size_-1) % n];\n+ 195 }\n+ 196\n+202 size_type size () const\n+ 203 {\n+ 204 return size_;\n+ 205 }\n 206\n- 207\n- 208// EntitySet concept ##############################################\n- 209\n-219struct EntitySet\n- 220{\n- 221 template\n-222 auto require(E&& f) -> decltype(\n- 223 requireType(),\n- 224 requireType(),\n- 225 requireType()\n- 226 );\n- 227};\n- 228\n- 230template\n-231static constexpr bool isEntitySet()\n- 232{ return models(); }\n- 233\n+208 bool empty() const\n+ 209 {\n+ 210 return size_==0;\n+ 211 }\n+ 212\n+214 static constexpr size_type capacity()\n+ 215 {\n+ 216 return n;\n+ 217 }\n+ 218\n+220 static constexpr size_type max_size()\n+ 221 {\n+ 222 return n;\n+ 223 }\n+ 224\n+228 friend std::ostream& operator<<(std::ostream& s, const ReservedDeque& v)\n+ 229 {\n+ 230 for (size_t i=0; i\n-238struct GridFunction;\n- 239\n- 249template\n-250struct GridFunction :\n- 251 Refines >\n- 252{\n-253 using LocalSignature = Range(typename EntitySet::LocalCoordinate);\n-254 using LocalContext = typename EntitySet::Element;\n- 255\n- 256 template\n-257 auto require(F&& f) -> decltype(\n- 258 localFunction(f),\n- 259 f.entitySet(),\n- 260 requireConcept>(localFunction\n-(f)),\n- 261 requireConcept(),\n- 262 requireConvertible(f.entitySet()),\n- 263 requireConvertible()\n- 264 );\n- 265};\n- 266\n- 268template\n-269static constexpr bool isGridFunction()\n- 270{ return models, F>(); }\n- 271\n- 272\n- 273// DifferentiableGridFunction concept\n-##############################################\n- 274template class\n-DerivativeTraits = DefaultDerivativeTraits>\n-275struct DifferentiableGridFunction;\n- 276\n- 289template class\n-DerivativeTraits>\n-290struct DifferentiableGridFunction :\n- 291 Refines<\n- 292 Dune::Functions::Concept::DifferentiableFunction,\n- 293 Dune::Functions::Concept::GridFunction\n- 294 >\n- 295{\n-296 using LocalSignature = Range(typename EntitySet::LocalCoordinate);\n-297 using LocalContext = typename EntitySet::Element;\n- 298\n- 299 template\n-300 using LocalDerivativeTraits = typename Dune::Functions::\n-LocalDerivativeTraits::template Traits;\n- 301\n- 302 template\n-303 auto require(F&& f) -> decltype(\n- 304 requireConcept>(localFunction(f))\n- 305 );\n- 306};\n- 307\n- 309template class\n-DerivativeTraits = DefaultDerivativeTraits>\n-310static constexpr bool isDifferentiableGridFunction()\n- 311{ return models, F>(); }\n- 312\n- 313\n- 314\n- 315// GridViewFunction concept ##############################################\n- 316template\n-317struct GridViewFunction;\n- 318\n- 331template\n-332struct GridViewFunction :\n- 333 Refines>>\n- 334{\n- 335 template\n-336 auto require(F&& f) -> decltype(\n- 337 0 // We don't need to check any further expressions, because a\n-GridViewFunction is just a GridFunction with a special EntitySet\n- 338 );\n- 339};\n- 340\n- 342template\n-343static constexpr bool isGridViewFunction()\n- 344{ return models, F>(); }\n- 345\n- 346\n- 347// DifferentiableGridViewFunction concept\n-##############################################\n- 348template class\n-DerivativeTraits = DefaultDerivativeTraits>\n-349struct DifferentiableGridViewFunction;\n- 350\n- 364template class\n-DerivativeTraits>\n-365struct DifferentiableGridViewFunction :\n- 366 Refines, DerivativeTraits>>\n- 367{\n- 368 template\n-369 auto require(F&& f) -> decltype(\n- 370 0 // We don't need to check any further expressions, because a\n-GridViewFunction is just a GridFunction with a special EntitySet\n- 371 );\n- 372};\n- 373\n- 375template class\n-DerivativeTraits = DefaultDerivativeTraits>\n-376static constexpr bool isDifferentiableGridViewFunction()\n- 377{ return models, F>(); }\n- 378\n- 379\n- 380\n- 381}}} // namespace Dune::Functions::Concept\n- 382\n- 383#endif // DUNE_FUNCTIONS_COMMON_FUNCTIONCONCEPT_HH\n-signature.hh\n-gridviewentityset.hh\n-localderivativetraits.hh\n-Dune::Functions::Concept::isGridFunction\n-static constexpr bool isGridFunction()\n-Check if F models the GridFunction concept with given signature and entity set.\n-Definition: functionconcepts.hh:269\n-Dune::Functions::Concept::isDifferentiableLocalFunction\n-static constexpr bool isDifferentiableLocalFunction()\n-Check if F models the DifferentiableLocalFunction concept with given signature\n-and local context.\n-Definition: functionconcepts.hh:204\n-Dune::Functions::Concept::isFunction\n-static constexpr bool isFunction()\n-Check if F models the Function concept with given signature.\n-Definition: functionconcepts.hh:88\n-Dune::Functions::Concept::isDifferentiableGridViewFunction\n-static constexpr bool isDifferentiableGridViewFunction()\n-Check if F models the DifferentiableGridViewFunction concept with given\n-signature.\n-Definition: functionconcepts.hh:376\n-Dune::Functions::Concept::isDifferentiableFunction\n-static constexpr bool isDifferentiableFunction()\n-Check if F models the DifferentiableFunction concept with given signature.\n-Definition: functionconcepts.hh:127\n-Dune::Functions::Concept::isGridViewFunction\n-static constexpr bool isGridViewFunction()\n-Check if F models the GridViewFunction concept with given signature.\n-Definition: functionconcepts.hh:343\n-Dune::Functions::Concept::isEntitySet\n-static constexpr bool isEntitySet()\n-Check if F models the GridFunction concept with given signature and entity set.\n-Definition: functionconcepts.hh:231\n-Dune::Functions::Concept::isDifferentiableGridFunction\n-static constexpr bool isDifferentiableGridFunction()\n-Check if F models the DifferentiableGridFunction concept with given signature\n-and entity set.\n-Definition: functionconcepts.hh:310\n-Dune::Functions::Concept::isLocalFunction\n-static constexpr bool isLocalFunction()\n-Check if F models the LocalFunction concept with given signature and local\n-context.\n-Definition: functionconcepts.hh:166\n-Dune::Functions::derivative\n-TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const\n-TrigonometricFunction< K, sinFactor, cosFactor > &f)\n-Obtain derivative of TrigonometricFunction function.\n-Definition: trigonometricfunction.hh:39\n-Dune::Functions::Concept::isCallable\n-static constexpr auto isCallable()\n-Check if f is callable with given argument list.\n-Definition: functionconcepts.hh:47\n+ 235 private:\n+ 236 T data_[n];\n+ 237 size_type first_;\n+ 238 size_type size_;\n+ 239 };\n+ 240\n+ 241} // end namespace Functions\n+ 242} // end namespace Dune\n+ 243\n+ 244#undef CHECKSIZE\n+ 245\n+ 246#endif // DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH\n+CHECKSIZE\n+#define CHECKSIZE(X)\n+Definition: reserveddeque.hh:20\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::DefaultDerivativeTraits\n-Default implementation for derivative traits.\n-Definition: defaultderivativetraits.hh:37\n-Dune::Functions::Concept::Callable\n-Concept objects that can be called with given argument list.\n-Definition: functionconcepts.hh:33\n-Dune::Functions::Concept::Callable::require\n-auto require(F &&f) -> decltype(f(std::declval< Args >()...))\n-Dune::Functions::Concept::Function\n-Definition: functionconcepts.hh:66\n-Dune::Functions::Concept::Function<_Range(Domain)>::require\n-auto require(F &&f) -> decltype(requireConvertible< Range >(f(std::declval<\n-Domain >())))\n-Dune::Functions::Concept::DifferentiableFunction\n-Definition: functionconcepts.hh:100\n-Dune::Functions::Concept::DifferentiableFunction<_Range(Domain),\n-DerivativeTraits_>::DerivativeSignature\n-typename SignatureTraits< Range(Domain)>::template DerivativeSignature<\n-DerivativeTraits > DerivativeSignature\n-Definition: functionconcepts.hh:116\n-Dune::Functions::Concept::DifferentiableFunction<_Range(Domain),\n-DerivativeTraits_>::require\n-auto require(F &&f) -> decltype(derivative(f), requireConcept< Function<\n-DerivativeSignature > >(derivative(f)))\n-Dune::Functions::Concept::LocalFunction\n-Definition: functionconcepts.hh:139\n-Dune::Functions::Concept::LocalFunction<_Range(Domain),_LocalContext_>::require\n-auto require(F &&f) -> decltype(f.bind(std::declval< LocalContext >()),\n-f.unbind(), requireConvertible< bool >(f.bound()), f.localContext(),\n-requireConvertible< LocalContext >(f.localContext()))\n-Dune::Functions::Concept::DifferentiableLocalFunction\n-Definition: functionconcepts.hh:172\n-Dune::Functions::Concept::DifferentiableLocalFunction<_Range(Domain),\n-LocalContext,_DerivativeTraits_>::require\n-auto require(F &&f) -> decltype(f.bind(std::declval< LocalContext >()),\n-f.unbind(), f.localContext(), requireConvertible< LocalContext >(f.localContext\n-()))\n-Dune::Functions::Concept::EntitySet\n-Concept for an entity set for a Concept::GridFunction\n-Definition: functionconcepts.hh:220\n-Dune::Functions::Concept::EntitySet::require\n-auto require(E &&f) -> decltype(requireType< typename E::Element >(),\n-requireType< typename E::LocalCoordinate >(), requireType< typename E::\n-GlobalCoordinate >())\n-Dune::Functions::Concept::GridFunction\n-Definition: functionconcepts.hh:238\n-Dune::Functions::Concept::GridFunction<_Range(Domain),_EntitySet_>::\n-LocalContext\n-typename EntitySet::Element LocalContext\n-Definition: functionconcepts.hh:254\n-Dune::Functions::Concept::GridFunction<_Range(Domain),_EntitySet_>::\n-LocalSignature\n-Range(typename EntitySet::LocalCoordinate) LocalSignature\n-Definition: functionconcepts.hh:253\n-Dune::Functions::Concept::GridFunction<_Range(Domain),_EntitySet_>::require\n-auto require(F &&f) -> decltype(localFunction(f), f.entitySet(),\n-requireConcept< LocalFunction< LocalSignature, LocalContext > >(localFunction\n-(f)), requireConcept< Concept::EntitySet, EntitySet >(), requireConvertible<\n-EntitySet >(f.entitySet()), requireConvertible< typename EntitySet::\n-GlobalCoordinate, Domain >())\n-Dune::Functions::Concept::DifferentiableGridFunction\n-Definition: functionconcepts.hh:275\n-Dune::Functions::Concept::DifferentiableGridFunction<_Range(Domain),_EntitySet,\n-DerivativeTraits_>::LocalDerivativeTraits\n-typename Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits\n->::template Traits< R > LocalDerivativeTraits\n-Definition: functionconcepts.hh:300\n-Dune::Functions::Concept::DifferentiableGridFunction<_Range(Domain),_EntitySet,\n-DerivativeTraits_>::require\n-auto require(F &&f) -> decltype(requireConcept< DifferentiableLocalFunction<\n-LocalSignature, LocalContext, LocalDerivativeTraits > >(localFunction(f)))\n-Dune::Functions::Concept::DifferentiableGridFunction<_Range(Domain),_EntitySet,\n-DerivativeTraits_>::LocalSignature\n-Range(typename EntitySet::LocalCoordinate) LocalSignature\n-Definition: functionconcepts.hh:296\n-Dune::Functions::Concept::DifferentiableGridFunction<_Range(Domain),_EntitySet,\n-DerivativeTraits_>::LocalContext\n-typename EntitySet::Element LocalContext\n-Definition: functionconcepts.hh:297\n-Dune::Functions::Concept::GridViewFunction\n-Definition: functionconcepts.hh:317\n-Dune::Functions::Concept::GridViewFunction<_Range(Domain),_GridView_>::require\n-auto require(F &&f) -> decltype(0)\n-Dune::Functions::Concept::DifferentiableGridViewFunction\n-Definition: functionconcepts.hh:349\n-Dune::Functions::Concept::DifferentiableGridViewFunction<_Range(Domain),\n-GridView,_DerivativeTraits_>::require\n-auto require(F &&f) -> decltype(0)\n-Dune::Functions::SignatureTraits\n-Helper class to deduce the signature of a callable.\n-Definition: signature.hh:56\n-Dune::Functions::SignatureTag\n-Definition: signature.hh:102\n-Dune::Functions::LocalDerivativeTraits\n-Derivative traits for local functions.\n-Definition: localderivativetraits.hh:28\n+Dune::Functions::ReservedDeque\n+A double-ended queue (deque) class with statically reserved memory.\n+Definition: reserveddeque.hh:45\n+Dune::Functions::ReservedDeque::pop_front\n+void pop_front()\n+Erases the first element of the vector, O(1) time.\n+Definition: reserveddeque.hh:126\n+Dune::Functions::ReservedDeque::capacity\n+static constexpr size_type capacity()\n+Returns current capacity (allocated memory) of the vector.\n+Definition: reserveddeque.hh:214\n+Dune::Functions::ReservedDeque::clear\n+void clear()\n+Erases all elements.\n+Definition: reserveddeque.hh:89\n+Dune::Functions::ReservedDeque::iterator\n+Dune::GenericIterator< ReservedDeque, value_type > iterator\n+Iterator used to iterate through a vector.\n+Definition: reserveddeque.hh:63\n+Dune::Functions::ReservedDeque::value_type\n+T value_type\n+The type of object, T, stored in the vector.\n+Definition: reserveddeque.hh:51\n+Dune::Functions::ReservedDeque::ReservedDeque\n+ReservedDeque()\n+Constructor.\n+Definition: reserveddeque.hh:72\n+Dune::Functions::ReservedDeque::empty\n+bool empty() const\n+Returns true if vector has no elements.\n+Definition: reserveddeque.hh:208\n+Dune::Functions::ReservedDeque::back\n+const_reference back() const\n+Returns const reference to last element of vector.\n+Definition: reserveddeque.hh:191\n+Dune::Functions::ReservedDeque::operator<<\n+friend std::ostream & operator<<(std::ostream &s, const ReservedDeque &v)\n+Send ReservedDeque to an output stream.\n+Definition: reserveddeque.hh:228\n+Dune::Functions::ReservedDeque::push_front\n+void push_front(const T &t)\n+Prepends an element to the begin of a deque if size const_iterator\n+Const iterator used to iterate through a vector.\n+Definition: reserveddeque.hh:65\n+Dune::Functions::ReservedDeque::size\n+size_type size() const\n+Returns number of elements in the vector.\n+Definition: reserveddeque.hh:202\n+Dune::Functions::ReservedDeque::end\n+const_iterator end() const\n+Returns a const_iterator pointing to the end of the vector.\n+Definition: reserveddeque.hh:151\n+Dune::Functions::ReservedDeque::resize\n+void resize(size_t s)\n+Specifies a new size for the vector.\n+Definition: reserveddeque.hh:96\n+Dune::Functions::ReservedDeque::begin\n+iterator begin()\n+Returns a iterator pointing to the beginning of the vector.\n+Definition: reserveddeque.hh:136\n+Dune::Functions::ReservedDeque::begin\n+const_iterator begin() const\n+Returns a const_iterator pointing to the beginning of the vector.\n+Definition: reserveddeque.hh:141\n+Dune::Functions::ReservedDeque::ReservedDeque\n+ReservedDeque(std::initializer_list< T > const &l)\n+Definition: reserveddeque.hh:77\n+Dune::Functions::ReservedDeque::size_type\n+size_t size_type\n+An unsigned integral type.\n+Definition: reserveddeque.hh:59\n+Dune::Functions::ReservedDeque::push_back\n+void push_back(const T &t)\n+Appends an element to the end of a vector, up to the maximum size n, O(1) time.\n+Definition: reserveddeque.hh:103\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00029.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00029.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: defaultderivativetraits.hh File Reference\n+dune-functions: typeerasure.hh File Reference\n \n \n \n \n \n \n \n@@ -65,43 +65,29 @@\n
  • dune
  • functions
  • common
  • \n \n \n
    \n \n-
    defaultderivativetraits.hh File Reference
    \n+
    typeerasure.hh File Reference
    \n
    \n
    \n-
    #include <type_traits>
    \n-#include <utility>
    \n-#include <dune/common/fvector.hh>
    \n-#include <dune/common/fmatrix.hh>
    \n+
    #include <typeinfo>
    \n+#include <dune/common/typeutilities.hh>
    \n+#include <dune/functions/common/type_traits.hh>
    \n+#include <dune/functions/common/interfaces.hh>
    \n+#include <dune/functions/common/polymorphicsmallobject.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n \n

    \n Classes

    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...
    class  Dune::Functions::TypeErasureBase< Interface, Implementation, bufferSize >
     Base class for type-erased interface wrapper. More...
     
    \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,40 +6,25 @@\n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n Classes | Namespaces\n-defaultderivativetraits.hh File Reference\n-#include \n-#include \n-#include \n-#include \n+typeerasure.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n- class \u00a0Dune::Functions::InvalidRange\n-\u00a0 Dummy range class to be used if no proper type is available. More...\n-\u00a0\n-struct \u00a0Dune::Functions::DefaultDerivativeTraits<_Signature_>\n-\u00a0 Default implementation for derivative traits. More...\n-\u00a0\n-struct \u00a0Dune::Functions::DefaultDerivativeTraits<_double(double)_>\n-\u00a0 Default implementation for derivative traits. More...\n-\u00a0\n-struct \u00a0Dune::Functions::DefaultDerivativeTraits<_K(FieldVector<_K,_n_>)>\n-\u00a0 Default implementation for derivative traits. More...\n-\u00a0\n-struct \u00a0Dune::Functions::DefaultDerivativeTraits<_FieldVector<_K,_m_>\n- (FieldVector<_K,_n_>)>\n-\u00a0 Default implementation for derivative traits. More...\n-\u00a0\n-struct \u00a0Dune::Functions::DefaultDerivativeTraits<_FieldMatrix<_K,_1,_m_>\n- (FieldVector<_K,_n_>)>\n-\u00a0 Default implementation for derivative traits. More...\n+class \u00a0Dune::Functions::TypeErasureBase<_Interface,_Implementation,_bufferSize\n+ >\n+\u00a0 Base class for type-erased interface wrapper. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n \n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00029_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00029_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: defaultderivativetraits.hh Source File\n+dune-functions: typeerasure.hh Source File\n \n \n \n \n \n \n \n@@ -62,81 +62,159 @@\n \n \n \n
    \n-
    defaultderivativetraits.hh
    \n+
    typeerasure.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH
    \n-
    4#define DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH
    \n+
    4#define DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH
    \n
    5
    \n-
    6#include <type_traits>
    \n-
    7#include <utility>
    \n-
    8
    \n-
    9#include <dune/common/fvector.hh>
    \n-
    10#include <dune/common/fmatrix.hh>
    \n-
    11
    \n-
    12namespace Dune {
    \n-
    13namespace Functions {
    \n-
    14
    \n-
    15
    \n-
    16
    \n-\n-
    23{};
    \n-
    24
    \n-
    25
    \n-
    35template<class Signature>
    \n-\n+
    6#include <typeinfo>
    \n+
    7
    \n+
    8#include <dune/common/typeutilities.hh>
    \n+
    9
    \n+\n+\n+\n+
    13
    \n+
    14namespace Dune {
    \n+
    15namespace Functions {
    \n+
    16namespace Imp {
    \n+
    17
    \n+
    18
    \n+
    19
    \n+
    33template<class Interface>
    \n+
    34class TypeErasureWrapperInterface :
    \n+
    35 public Interface,
    \n+
    36 public PolymorphicType<TypeErasureWrapperInterface<Interface>>
    \n
    37{
    \n-\n+
    38public:
    \n+
    39 virtual const std::type_info& target_type() const = 0;
    \n
    40};
    \n
    41
    \n
    42
    \n-
    50template<>
    \n-
    51struct DefaultDerivativeTraits< double(double) >
    \n-
    52{
    \n-
    54 typedef double Range;
    \n-
    55};
    \n-
    56
    \n-
    66template<typename K, int n>
    \n-
    67struct DefaultDerivativeTraits<K(FieldVector<K,n>)>
    \n-
    68{
    \n-
    70 typedef FieldVector<K,n> Range;
    \n-
    71};
    \n-
    72
    \n-
    82template<typename K, int n, int m>
    \n-
    83struct DefaultDerivativeTraits<FieldVector<K,m>(FieldVector<K,n>)>
    \n-
    84{
    \n-
    86 typedef FieldMatrix<K,m,n> Range;
    \n-
    87};
    \n+
    43
    \n+
    60template<class Interface, class T>
    \n+
    61class TypeErasureWrapperBase :
    \n+
    62 public TypeErasureWrapperInterface<Interface>
    \n+
    63{
    \n+
    64public:
    \n+
    65 template<class TT, disableCopyMove<TypeErasureWrapperBase, TT> = 0>
    \n+
    66 TypeErasureWrapperBase(TT&& t) :
    \n+
    67 wrapped_(std::forward<TT>(t))
    \n+
    68 {}
    \n+
    69
    \n+
    71 T& get()
    \n+
    72 {
    \n+
    73 return wrapped_;
    \n+
    74 }
    \n+
    75
    \n+
    77 const T& get() const
    \n+
    78 {
    \n+
    79 return wrapped_;
    \n+
    80 }
    \n+
    81
    \n+
    82protected:
    \n+
    83 using Wrapped = T;
    \n+
    84 Wrapped wrapped_;
    \n+
    85};
    \n+
    86
    \n+
    87
    \n
    88
    \n-
    98template<typename K, int n, int m>
    \n-
    99struct DefaultDerivativeTraits<FieldMatrix<K,1,m>(FieldVector<K,n>)>
    \n-
    100{
    \n-
    102 typedef FieldMatrix<K,m,n> Range;
    \n-
    103};
    \n-
    104
    \n-
    105
    \n-
    106}} // namespace Dune::Functions
    \n-
    107
    \n-
    108
    \n-
    109#endif // DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH
    \n+
    112template<class Interface, template<class> class Implementation, class T>
    \n+
    113class TypeErasureWrapperImplementation :
    \n+
    114 public Implementation<TypeErasureWrapperBase<Interface, T> >
    \n+
    115{
    \n+
    116public:
    \n+
    117
    \n+
    119 template<class TT, disableCopyMove<TypeErasureWrapperImplementation, T> = 0>
    \n+
    120 TypeErasureWrapperImplementation(TT&& t) :
    \n+
    121 Implementation<TypeErasureWrapperBase<Interface, T> >(std::forward<TT>(t))
    \n+
    122 {}
    \n+
    123
    \n+
    125 virtual TypeErasureWrapperImplementation* clone() const
    \n+
    126 {
    \n+
    127 return new TypeErasureWrapperImplementation(*this);
    \n+
    128 }
    \n+
    129
    \n+
    131 virtual TypeErasureWrapperImplementation* clone(void* buffer) const
    \n+
    132 {
    \n+
    133 return new (buffer) TypeErasureWrapperImplementation(*this);
    \n+
    134 }
    \n+
    135
    \n+
    137 virtual TypeErasureWrapperImplementation* move(void* buffer)
    \n+
    138 {
    \n+
    139 return new (buffer) TypeErasureWrapperImplementation(std::move(*this));
    \n+
    140 }
    \n+
    141
    \n+
    143 virtual const std::type_info& target_type() const
    \n+
    144 {
    \n+
    145 return typeid(T);
    \n+
    146 }
    \n+
    147};
    \n+
    148
    \n+
    149} // namespace Dune::Functions::Imp
    \n+
    150
    \n+
    151
    \n+
    152
    \n+
    163template<class Interface, template<class> class Implementation, size_t bufferSize = 56>
    \n+\n+
    165{
    \n+
    166public:
    \n+
    167
    \n+
    169 template<class T, disableCopyMove<TypeErasureBase, T> = 0 >
    \n+\n+
    171 wrapped_(Imp::TypeErasureWrapperImplementation<Interface, Implementation, typename std::decay<T>::type>(std::forward<T>(t)))
    \n+
    172 {}
    \n+
    173
    \n+
    175 TypeErasureBase() = default;
    \n+
    176
    \n+
    178 Interface& asInterface()
    \n+
    179 {
    \n+
    180 return wrapped_.get();
    \n+
    181 }
    \n+
    182
    \n+
    184 const Interface& asInterface() const
    \n+
    185 {
    \n+
    186 return wrapped_.get();
    \n+
    187 }
    \n+
    188
    \n+
    190 const std::type_info& target_type() const
    \n+
    191 {
    \n+
    192 return wrapped_.get().target_type();
    \n+
    193 }
    \n+
    194
    \n+
    195protected:
    \n+\n+
    197};
    \n+
    198
    \n+
    199
    \n+
    200}} // namespace Dune::Functions
    \n+
    201
    \n+
    202
    \n+
    203
    \n+
    204#endif // DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH
    \n+\n+\n+\n
    Definition: polynomial.hh:10
    \n-
    Dummy range class to be used if no proper type is available.
    Definition: defaultderivativetraits.hh:23
    \n-
    Default implementation for derivative traits.
    Definition: defaultderivativetraits.hh:37
    \n-
    InvalidRange Range
    Range of derivative for function with given signature.
    Definition: defaultderivativetraits.hh:39
    \n-
    double Range
    Range of derivative for function with given signature.
    Definition: defaultderivativetraits.hh:54
    \n-
    FieldVector< K, n > Range
    Range of derivative for function with given signature.
    Definition: defaultderivativetraits.hh:70
    \n-
    FieldMatrix< K, m, n > Range
    Range of derivative for function with given signature.
    Definition: defaultderivativetraits.hh:86
    \n-
    FieldMatrix< K, m, n > Range
    Range of derivative for function with given signature.
    Definition: defaultderivativetraits.hh:102
    \n+
    A wrapper providing small object optimization with polymorphic types.
    Definition: polymorphicsmallobject.hh:45
    \n+
    Base class for type-erased interface wrapper.
    Definition: typeerasure.hh:165
    \n+
    const std::type_info & target_type() const
    Get type of stored object.
    Definition: typeerasure.hh:190
    \n+
    TypeErasureBase(T &&t)
    Construct wrapper from object.
    Definition: typeerasure.hh:170
    \n+
    PolymorphicSmallObject< Imp::TypeErasureWrapperInterface< Interface >, bufferSize > wrapped_
    Definition: typeerasure.hh:196
    \n+
    TypeErasureBase()=default
    Default constructor.
    \n+
    Interface & asInterface()
    Get mutable reference to wrapped object.
    Definition: typeerasure.hh:178
    \n+
    const Interface & asInterface() const
    Get reference to wrapped object.
    Definition: typeerasure.hh:184
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,98 +5,180 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-defaultderivativetraits.hh\n+typeerasure.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH\n- 4#define DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH\n+ 3#ifndef DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH\n+ 4#define DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH\n 5\n- 6#include \n- 7#include \n- 8\n- 9#include \n- 10#include \n- 11\n- 12namespace Dune {\n- 13namespace Functions {\n- 14\n- 15\n- 16\n-22class InvalidRange\n- 23{};\n- 24\n- 25\n- 35template\n-36struct DefaultDerivativeTraits\n+ 6#include \n+ 7\n+ 8#include \n+ 9\n+ 10#include \n+ 11#include \n+ 12#include \n+ 13\n+ 14namespace Dune {\n+ 15namespace Functions {\n+ 16namespace Imp {\n+ 17\n+ 18\n+ 19\n+ 33template\n+ 34class TypeErasureWrapperInterface :\n+ 35 public Interface,\n+ 36 public PolymorphicType>\n 37{\n-39 typedef InvalidRange Range;\n+ 38public:\n+ 39 virtual const std::type_info& target_type() const = 0;\n 40};\n 41\n 42\n- 50template<>\n-51struct DefaultDerivativeTraits< double(double) >\n- 52{\n-54 typedef double Range;\n- 55};\n- 56\n- 66template\n-67struct DefaultDerivativeTraits)>\n- 68{\n-70 typedef FieldVector Range;\n- 71};\n- 72\n- 82template\n-83struct DefaultDerivativeTraits(FieldVector)>\n- 84{\n-86 typedef FieldMatrix Range;\n- 87};\n+ 43\n+ 60template\n+ 61class TypeErasureWrapperBase :\n+ 62 public TypeErasureWrapperInterface\n+ 63{\n+ 64public:\n+ 65 template = 0>\n+ 66 TypeErasureWrapperBase(TT&& t) :\n+ 67 wrapped_(std::forward(t))\n+ 68 {}\n+ 69\n+ 71 T& get()\n+ 72 {\n+ 73 return wrapped_;\n+ 74 }\n+ 75\n+ 77 const T& get() const\n+ 78 {\n+ 79 return wrapped_;\n+ 80 }\n+ 81\n+ 82protected:\n+ 83 using Wrapped = T;\n+ 84 Wrapped wrapped_;\n+ 85};\n+ 86\n+ 87\n 88\n- 98template\n-99struct DefaultDerivativeTraits(FieldVector)>\n- 100{\n-102 typedef FieldMatrix Range;\n- 103};\n- 104\n- 105\n- 106}} // namespace Dune::Functions\n- 107\n- 108\n- 109#endif // DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH\n+ 112template class Implementation, class T>\n+ 113class TypeErasureWrapperImplementation :\n+ 114 public Implementation >\n+ 115{\n+ 116public:\n+ 117\n+ 119 template =\n+0>\n+ 120 TypeErasureWrapperImplementation(TT&& t) :\n+ 121 Implementation >(std::forward(t))\n+ 122 {}\n+ 123\n+ 125 virtual TypeErasureWrapperImplementation* clone() const\n+ 126 {\n+ 127 return new TypeErasureWrapperImplementation(*this);\n+ 128 }\n+ 129\n+ 131 virtual TypeErasureWrapperImplementation* clone(void* buffer) const\n+ 132 {\n+ 133 return new (buffer) TypeErasureWrapperImplementation(*this);\n+ 134 }\n+ 135\n+ 137 virtual TypeErasureWrapperImplementation* move(void* buffer)\n+ 138 {\n+ 139 return new (buffer) TypeErasureWrapperImplementation(std::move(*this));\n+ 140 }\n+ 141\n+ 143 virtual const std::type_info& target_type() const\n+ 144 {\n+ 145 return typeid(T);\n+ 146 }\n+ 147};\n+ 148\n+ 149} // namespace Dune::Functions::Imp\n+ 150\n+ 151\n+ 152\n+ 163template class Implementation, size_t\n+bufferSize = 56>\n+164class TypeErasureBase\n+ 165{\n+ 166public:\n+ 167\n+ 169 template = 0 >\n+170 TypeErasureBase(T&& t) :\n+ 171 wrapped_(Imp::TypeErasureWrapperImplementation::type>(std::forward(t)))\n+ 172 {}\n+ 173\n+175 TypeErasureBase() = default;\n+ 176\n+178 Interface& asInterface()\n+ 179 {\n+ 180 return wrapped_.get();\n+ 181 }\n+ 182\n+184 const Interface& asInterface() const\n+ 185 {\n+ 186 return wrapped_.get();\n+ 187 }\n+ 188\n+190 const std::type_info& target_type() const\n+ 191 {\n+ 192 return wrapped_.get().target_type();\n+ 193 }\n+ 194\n+ 195protected:\n+196 PolymorphicSmallObject,\n+bufferSize > wrapped_;\n+ 197};\n+ 198\n+ 199\n+ 200}} // namespace Dune::Functions\n+ 201\n+ 202\n+ 203\n+ 204#endif // DUNE_FUNCTIONS_COMMON_TYPEERASURE_HH\n+type_traits.hh\n+interfaces.hh\n+polymorphicsmallobject.hh\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::InvalidRange\n-Dummy range class to be used if no proper type is available.\n-Definition: defaultderivativetraits.hh:23\n-Dune::Functions::DefaultDerivativeTraits\n-Default implementation for derivative traits.\n-Definition: defaultderivativetraits.hh:37\n-Dune::Functions::DefaultDerivativeTraits::Range\n-InvalidRange Range\n-Range of derivative for function with given signature.\n-Definition: defaultderivativetraits.hh:39\n-Dune::Functions::DefaultDerivativeTraits<_double(double)_>::Range\n-double Range\n-Range of derivative for function with given signature.\n-Definition: defaultderivativetraits.hh:54\n-Dune::Functions::DefaultDerivativeTraits<_K(FieldVector<_K,_n_>)>::Range\n-FieldVector< K, n > Range\n-Range of derivative for function with given signature.\n-Definition: defaultderivativetraits.hh:70\n-Dune::Functions::DefaultDerivativeTraits<_FieldVector<_K,_m_>(FieldVector<_K,_n\n->)>::Range\n-FieldMatrix< K, m, n > Range\n-Range of derivative for function with given signature.\n-Definition: defaultderivativetraits.hh:86\n-Dune::Functions::DefaultDerivativeTraits<_FieldMatrix<_K,_1,_m_>(FieldVector<\n-K,_n_>)>::Range\n-FieldMatrix< K, m, n > Range\n-Range of derivative for function with given signature.\n-Definition: defaultderivativetraits.hh:102\n+Dune::Functions::PolymorphicSmallObject\n+A wrapper providing small object optimization with polymorphic types.\n+Definition: polymorphicsmallobject.hh:45\n+Dune::Functions::TypeErasureBase\n+Base class for type-erased interface wrapper.\n+Definition: typeerasure.hh:165\n+Dune::Functions::TypeErasureBase::target_type\n+const std::type_info & target_type() const\n+Get type of stored object.\n+Definition: typeerasure.hh:190\n+Dune::Functions::TypeErasureBase::TypeErasureBase\n+TypeErasureBase(T &&t)\n+Construct wrapper from object.\n+Definition: typeerasure.hh:170\n+Dune::Functions::TypeErasureBase::wrapped_\n+PolymorphicSmallObject< Imp::TypeErasureWrapperInterface< Interface >,\n+bufferSize > wrapped_\n+Definition: typeerasure.hh:196\n+Dune::Functions::TypeErasureBase::TypeErasureBase\n+TypeErasureBase()=default\n+Default constructor.\n+Dune::Functions::TypeErasureBase::asInterface\n+Interface & asInterface()\n+Get mutable reference to wrapped object.\n+Definition: typeerasure.hh:178\n+Dune::Functions::TypeErasureBase::asInterface\n+const Interface & asInterface() const\n+Get reference to wrapped object.\n+Definition: typeerasure.hh:184\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00032.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00032.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: referencehelper.hh File Reference\n+dune-functions: indexaccess.hh File Reference\n \n \n \n \n \n \n \n@@ -64,52 +64,60 @@\n \n \n \n
    \n \n-
    referencehelper.hh File Reference
    \n+Functions
    \n+
    indexaccess.hh File Reference
    \n \n
    \n-
    #include <type_traits>
    \n-#include <dune/common/referencehelper.hh>
    \n+
    #include <utility>
    \n+#include <type_traits>
    \n+#include <dune/common/typetraits.hh>
    \n+#include <dune/common/concept.hh>
    \n+#include <dune/common/hybridutilities.hh>
    \n+#include <dune/functions/common/utility.hh>
    \n
    \n

    Go to the source code of this file.

    \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
    \n \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n-\n-\n-\n-\n-\n-

    \n-Typedefs

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

    \n Functions

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

    \n-Variables

    template<class T >
    constexpr bool Dune::Functions::IsReferenceWrapper_v = Dune::IsReferenceWrapper_v<T>
     This is an alias for Dune::IsReferenceWrapper_v. More...
     
    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. More...
     
    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. More...
     
    template<class Result , class C , class MultiIndex >
    Result Dune::Functions::hybridMultiIndexAccess (C &&c, const MultiIndex &index)
     Provide multi-index access by chaining operator[]. More...
     
    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[]. More...
     
    template<class C , class MultiIndex >
    constexpr decltype(auto) Dune::Functions::resolveDynamicMultiIndex (C &&c, const MultiIndex &multiIndex)
     Provide multi-index access by chaining operator[]. More...
     
    template<class C , class MultiIndex >
    constexpr decltype(auto) Dune::Functions::resolveStaticMultiIndex (C &&c, const MultiIndex &multiIndex)
     Provide multi-index access by chaining operator[]. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,36 +5,63 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-Namespaces | Typedefs | Functions | Variables\n-referencehelper.hh File Reference\n+Namespaces | Functions\n+indexaccess.hh File Reference\n+#include \n #include \n-#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n- Typedefs\n-template\n-using\u00a0Dune::Functions::ResolveRef_t = Dune::ResolveRef_t< T >\n-\u00a0 This is an alias for Dune::ResolveRef_t. More...\n-\u00a0\n Functions\n-template\n-decltype(auto)\u00a0Dune::Functions::resolveRef (T &&t)\n-\u00a0 This is an alias for Dune::resolveRef. More...\n-\u00a0\n- Variables\n-template\n-constexpr bool\u00a0Dune::Functions::IsReferenceWrapper_v = Dune::\n- IsReferenceWrapper_v\n-\u00a0 This is an alias for Dune::IsReferenceWrapper_v. More...\n+template, C >(), int >::type = 0>\n+ auto\u00a0Dune::Functions::hybridIndexAccess (C &&c, const I\n+ &i, F &&f) -> decltype(f(c[i]))\n+\u00a0 Provide operator[] index-access for containers.\n+ More...\n+\u00a0\n+template, C >(), int >::type = 0>\n+ decltype(auto)\u00a0Dune::Functions::hybridIndexAccess (C &&c, const I\n+ &i, F &&f)\n+\u00a0 Provide operator[] index-access for containers.\n+ More...\n+\u00a0\n+template\n+ Result\u00a0Dune::Functions::hybridMultiIndexAccess (C &&c, const\n+ MultiIndex &index)\n+\u00a0 Provide multi-index access by chaining operator[].\n+ More...\n+\u00a0\n+template\n+constexpr decltype(auto)\u00a0Dune::Functions::resolveDynamicMultiIndex (C &&c,\n+ const MultiIndex &multiIndex, const IsFinal &isFinal)\n+\u00a0 Provide multi-index access by chaining operator[].\n+ More...\n+\u00a0\n+template\n+constexpr decltype(auto)\u00a0Dune::Functions::resolveDynamicMultiIndex (C &&c,\n+ const MultiIndex &multiIndex)\n+\u00a0 Provide multi-index access by chaining operator[].\n+ More...\n+\u00a0\n+template\n+constexpr decltype(auto)\u00a0Dune::Functions::resolveStaticMultiIndex (C &&c,\n+ const MultiIndex &multiIndex)\n+\u00a0 Provide multi-index access by chaining operator[].\n+ More...\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00032_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00032_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: referencehelper.hh Source File\n+dune-functions: indexaccess.hh Source File\n \n \n \n \n \n \n \n@@ -62,65 +62,313 @@\n \n \n
    \n
    \n-
    referencehelper.hh
    \n+
    indexaccess.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_COMMON_REFERENCE_HELPER_HH
    \n-
    4#define DUNE_FUNCTIONS_COMMON_REFERENCE_HELPER_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH
    \n+
    4#define DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH
    \n
    5
    \n-
    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.
    \n-
    7
    \n+
    6
    \n+
    7#include <utility>
    \n
    8#include <type_traits>
    \n
    9
    \n-
    10#include <dune/common/referencehelper.hh>
    \n-
    11
    \n-
    12
    \n+
    10#include <dune/common/typetraits.hh>
    \n+
    11#include <dune/common/concept.hh>
    \n+
    12#include <dune/common/hybridutilities.hh>
    \n
    13
    \n-
    14
    \n-
    15namespace Dune {
    \n-
    16namespace Functions {
    \n+\n+
    15
    \n+
    16
    \n
    17
    \n-
    18
    \n-
    23template<class T>
    \n-
    24[[deprecated("Use Dune::IsReferenceWrapper_v instead. Will be removed after release 2.9.")]]
    \n-
    25constexpr bool
    \n-
    26IsReferenceWrapper_v = Dune::IsReferenceWrapper_v<T>;
    \n-
    27
    \n-
    28
    \n-
    33template<class T>
    \n-
    34decltype(auto)
    \n-\n-
    36[[deprecated("Use Dune::resolveRef instead. Will be removed after release 2.9.")]]
    \n-
    37(T&& t)
    \n-
    38{
    \n-
    39 return Dune::resolveRef(std::forward<T>(t));
    \n-
    40}
    \n-
    41
    \n-
    46template<class T>
    \n-\n-
    48[[deprecated("Use Dune::ResolveRef_t instead. Will be removed after release 2.9.")]]
    \n-
    49 = Dune::ResolveRef_t<T>;
    \n-
    50
    \n-
    51
    \n-
    52}} // namespace Dune::Functions
    \n-
    53
    \n-
    54
    \n-
    55
    \n-
    56#endif // DUNE_FUNCTIONS_COMMON_REFERENCE_HELPER_HH
    \n+
    18namespace Dune {
    \n+
    19namespace Functions {
    \n+
    20
    \n+
    21
    \n+
    22namespace Imp {
    \n+
    23
    \n+
    24namespace Concept {
    \n+
    25
    \n+
    26template<class size_type>
    \n+
    27struct HasDynamicIndexAccess
    \n+
    28{
    \n+
    29 template<class C>
    \n+
    30 auto require(C&& c) -> decltype(
    \n+
    31 c[std::declval<size_type>()]
    \n+
    32 );
    \n+
    33};
    \n+
    34
    \n+
    35struct HasStaticIndexAccess
    \n+
    36{
    \n+
    37 template<class C>
    \n+
    38 auto require(C&& c) -> decltype(
    \n+
    39 c[Dune::Indices::_0]
    \n+
    40 );
    \n+
    41};
    \n+
    42
    \n+
    43} // namespace Concept
    \n+
    44
    \n+
    45} // namespace Imp
    \n+
    46
    \n+
    47
    \n+
    48
    \n+
    61template<class C, class I, class F,
    \n+
    62 typename std::enable_if< Dune::models<Imp::Concept::HasDynamicIndexAccess<I>, C>(), int>::type = 0>
    \n+
    63auto hybridIndexAccess(C&& c, const I& i, F&& f)
    \n+
    64 -> decltype(f(c[i]))
    \n+
    65{
    \n+
    66 return f(c[i]);
    \n+
    67}
    \n+
    68
    \n+
    86template<class C, class I, class F,
    \n+
    87 typename std::enable_if< not Dune::models<Imp::Concept::HasDynamicIndexAccess<I>, C>(), int>::type = 0>
    \n+
    88decltype(auto) hybridIndexAccess(C&& c, const I& i, F&& f)
    \n+
    89{
    \n+
    90 using Size = decltype(Hybrid::size(c));
    \n+
    91 return Hybrid::switchCases(std::make_index_sequence<Size::value>(), i,
    \n+
    92 [&](const auto& ii) -> decltype(auto){
    \n+
    93 return f(c[ii]);
    \n+
    94 }, [&]() -> decltype(auto){
    \n+
    95 return f(c[Dune::Indices::_0]);
    \n+
    96 });
    \n+
    97}
    \n+
    98
    \n+
    99
    \n+
    100namespace Imp {
    \n+
    101
    \n+
    115 template<class Index, std::size_t offset=1>
    \n+
    116 class ShiftedDynamicMultiIndex
    \n+
    117 {
    \n+
    118 public:
    \n+
    119 ShiftedDynamicMultiIndex(const Index& index) :
    \n+
    120 index_(index)
    \n+
    121 {}
    \n+
    122
    \n+
    123 std::size_t operator[](std::size_t position) const
    \n+
    124 {
    \n+
    125 if (position<size())
    \n+
    126 return index_[position+offset];
    \n+
    127 else
    \n+
    128 return 0;
    \n+
    129 }
    \n+
    130
    \n+
    134 ShiftedDynamicMultiIndex<Index, offset+1> pop() const
    \n+
    135 {
    \n+
    136 return {index_};
    \n+
    137 }
    \n+
    138
    \n+
    139 std::size_t size() const
    \n+
    140 {
    \n+
    141 if (offset < index_.size())
    \n+
    142 return index_.size() - offset;
    \n+
    143 else
    \n+
    144 return 0;
    \n+
    145 }
    \n+
    146
    \n+
    147 private:
    \n+
    148 const Index& index_;
    \n+
    149 };
    \n+
    150
    \n+
    151 template<class Index, std::size_t offset=1>
    \n+
    152 class ShiftedStaticMultiIndex
    \n+
    153 {
    \n+
    154 public:
    \n+
    155 ShiftedStaticMultiIndex(const Index& index) :
    \n+
    156 index_(index)
    \n+
    157 {}
    \n+
    158
    \n+
    159 template<std::size_t i>
    \n+
    160 auto operator[](Dune::index_constant<i>) const
    \n+
    161 {
    \n+
    162 if constexpr (i<size()) {
    \n+
    163 return index_[Dune::index_constant<i+offset>{}];
    \n+
    164 } else {
    \n+
    165 return Dune::index_constant<0>{};
    \n+
    166 }
    \n+
    167 }
    \n+
    168
    \n+
    172 ShiftedStaticMultiIndex<Index, offset+1> pop() const
    \n+
    173 {
    \n+
    174 return {index_};
    \n+
    175 }
    \n+
    176
    \n+
    177 static constexpr std::size_t size()
    \n+
    178 {
    \n+
    179 auto fullSize = decltype(Hybrid::size(std::declval<Index>()))::value;
    \n+
    180 if (offset < fullSize)
    \n+
    181 return fullSize - offset;
    \n+
    182 else
    \n+
    183 return 0;
    \n+
    184 }
    \n+
    185
    \n+
    186 private:
    \n+
    187 const Index& index_;
    \n+
    188 };
    \n+
    189
    \n+
    195 template<std::size_t offset, class Index>
    \n+
    196 ShiftedDynamicMultiIndex<Index, offset> shiftedDynamicMultiIndex(const Index& index)
    \n+
    197 {
    \n+
    198 return {index};
    \n+
    199 }
    \n+
    200
    \n+
    201 template<std::size_t offset, class Index>
    \n+
    202 ShiftedStaticMultiIndex<Index, offset> shiftedStaticMultiIndex(const Index& index)
    \n+
    203 {
    \n+
    204 return {index};
    \n+
    205 }
    \n+
    206
    \n+
    207} // namespace Imp
    \n+
    208
    \n+
    209
    \n+
    210
    \n+
    211
    \n+
    212namespace Imp {
    \n+
    213
    \n+
    214template<class Result, class Index>
    \n+
    215struct MultiIndexResolver
    \n+
    216{
    \n+
    217 MultiIndexResolver(const Index& index) :
    \n+
    218 index_(index)
    \n+
    219 {}
    \n+
    220
    \n+
    221 template<class C,
    \n+
    222 typename std::enable_if<not std::is_convertible<C&, Result>::value, int>::type = 0>
    \n+
    223 Result operator()(C&& c)
    \n+
    224 {
    \n+
    225 auto&& subIndex = Imp::shiftedDynamicMultiIndex<1>(index_);
    \n+
    226 auto&& subIndexResolver = MultiIndexResolver<Result, decltype(subIndex)>(subIndex);
    \n+
    227 return (Result)(hybridIndexAccess(c, index_[Dune::Indices::_0], subIndexResolver));
    \n+
    228 }
    \n+
    229
    \n+
    230 template<class C,
    \n+
    231 typename std::enable_if<std::is_convertible<C&, Result>::value, int>::type = 0>
    \n+
    232 Result operator()(C&& c)
    \n+
    233 {
    \n+
    234 return (Result)(std::forward<C>(c));
    \n+
    235 }
    \n+
    236
    \n+
    237 const Index& index_;
    \n+
    238};
    \n+
    239
    \n+
    240} // namespace Imp
    \n+
    241
    \n+
    242
    \n+
    243
    \n+
    262template<class Result, class C, class MultiIndex>
    \n+
    263Result hybridMultiIndexAccess(C&& c, const MultiIndex& index)
    \n+
    264{
    \n+
    265
    \n+
    266 Imp::MultiIndexResolver<Result, MultiIndex> multiIndexResolver(index);
    \n+
    267 return multiIndexResolver(c);
    \n+
    268}
    \n+
    269
    \n+
    270
    \n+
    271
    \n+
    272
    \n+
    273
    \n+
    274
    \n+
    275namespace Imp {
    \n+
    276
    \n+
    277 template<class C, class MultiIndex, class IsFinal>
    \n+
    278 constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex& multiIndex, const IsFinal& isFinal)
    \n+
    279 {
    \n+
    280 // If c is already considered final simply return it,
    \n+
    281 // else resolve the next multiIndex entry.
    \n+
    282 return Hybrid::ifElse(isFinal(c), [&, c = forwardCapture(std::forward<C>(c))](auto) -> decltype(auto) {
    \n+
    283 assert(multiIndex.size() == 0);
    \n+
    284 return c.forward();
    \n+
    285 }, [&](auto) -> decltype(auto) {
    \n+
    286 auto hasDynamicAccess = callableCheck([](auto&& cc) -> std::void_t<decltype(cc[0])> {});
    \n+
    287
    \n+
    288 // Split multiIndex into first entry and remaining ones.
    \n+
    289 auto i = multiIndex[0];
    \n+
    290 auto tail = multiIndex.pop();
    \n+
    291
    \n+
    292 // Resolve first multiIndex entry by c[multiIndex[0]] and
    \n+
    293 // continue resolving with the remaining remaining ones.
    \n+
    294 // If c has a dynamic operator[] this is straight forward.
    \n+
    295 // Else the dynamic multiIndex[0] has to be translated into
    \n+
    296 // a static one using hybridIndexAccess.
    \n+
    297 return Hybrid::ifElse(hasDynamicAccess(c), [&](auto id) -> decltype(auto) {
    \n+
    298 return Imp::resolveDynamicMultiIndex(id(c)[i], tail, isFinal);
    \n+
    299 }, [&](auto id) -> decltype(auto) {
    \n+
    300 // auto indexRange = range(Hybrid::size(id(c)));
    \n+
    301 auto indexRange = typename decltype(range(Hybrid::size(id(c))))::integer_sequence();
    \n+
    302 return Hybrid::switchCases(indexRange, i, [&](auto static_i) -> decltype(auto){
    \n+
    303 // Do rescursion with static version of i
    \n+
    304 return Imp::resolveDynamicMultiIndex(id(c)[static_i], tail, isFinal);
    \n+
    305 }, [&]() -> decltype(auto){
    \n+
    306 // As fallback we use c[0] this is needed, because there must be one branch that matches.
    \n+
    307 return Imp::resolveDynamicMultiIndex(id(c)[Dune::Indices::_0], tail, isFinal);
    \n+
    308 });
    \n+
    309 });
    \n+
    310 });
    \n+
    311 }
    \n+
    312
    \n+
    313 template<class C, class MultiIndex>
    \n+
    314 constexpr decltype(auto) resolveStaticMultiIndex(C&& c, const MultiIndex& multiIndex)
    \n+
    315 {
    \n+
    316 auto isExhausted = Hybrid::equals(Hybrid::size(multiIndex), Dune::Indices::_0);
    \n+
    317 return Hybrid::ifElse(isExhausted, [&, c = forwardCapture(std::forward<C>(c))](auto) -> decltype(auto) {
    \n+
    318 return c.forward();
    \n+
    319 }, [&](auto id) -> decltype(auto) {
    \n+
    320 auto head = multiIndex[Dune::Indices::_0];
    \n+
    321 auto tail = multiIndex.pop();
    \n+
    322
    \n+
    323 return Imp::resolveStaticMultiIndex(id(c)[head], tail);
    \n+
    324 });
    \n+
    325 }
    \n+
    326
    \n+
    327} // namespace Imp
    \n+
    328
    \n+
    329
    \n+
    330
    \n+
    353template<class C, class MultiIndex, class IsFinal>
    \n+
    354constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex& multiIndex, const IsFinal& isFinal)
    \n+
    355{
    \n+
    356 return Imp::resolveDynamicMultiIndex(std::forward<C>(c), Imp::shiftedDynamicMultiIndex<0>(multiIndex), isFinal);
    \n+
    357}
    \n+
    358
    \n+
    375template<class C, class MultiIndex>
    \n+
    376constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex& multiIndex)
    \n+
    377{
    \n+
    378 auto hasNoIndexAccess = negatePredicate(callableCheck([](auto&& cc) -> std::void_t<decltype(cc[Dune::Indices::_0])> {}));
    \n+
    379 return Imp::resolveDynamicMultiIndex(std::forward<C>(c), Imp::shiftedDynamicMultiIndex<0>(multiIndex), hasNoIndexAccess);
    \n+
    380}
    \n+
    381
    \n+
    397template<class C, class MultiIndex>
    \n+
    398constexpr decltype(auto) resolveStaticMultiIndex(C&& c, const MultiIndex& multiIndex)
    \n+
    399{
    \n+
    400 return Imp::resolveStaticMultiIndex(std::forward<C>(c), Imp::shiftedStaticMultiIndex<0>(multiIndex));
    \n+
    401}
    \n+
    402
    \n+
    403
    \n+
    404
    \n+
    405} // namespace Dune::Functions
    \n+
    406} // namespace Dune
    \n+
    407
    \n+
    408
    \n+
    409
    \n+
    410#endif // DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH
    \n+\n+
    auto hybridIndexAccess(C &&c, const I &i, F &&f) -> decltype(f(c[i]))
    Provide operator[] index-access for containers.
    Definition: indexaccess.hh:63
    \n+
    constexpr decltype(auto) resolveStaticMultiIndex(C &&c, const MultiIndex &multiIndex)
    Provide multi-index access by chaining operator[].
    Definition: indexaccess.hh:398
    \n+
    auto callableCheck(Expression f)
    Create a predicate for checking validity of expressions.
    Definition: utility.hh:279
    \n+
    constexpr decltype(auto) resolveDynamicMultiIndex(C &&c, const MultiIndex &multiIndex)
    Provide multi-index access by chaining operator[].
    Definition: indexaccess.hh:376
    \n+
    constexpr decltype(auto) resolveDynamicMultiIndex(C &&c, const MultiIndex &multiIndex, const IsFinal &isFinal)
    Provide multi-index access by chaining operator[].
    Definition: indexaccess.hh:354
    \n+
    Result hybridMultiIndexAccess(C &&c, const MultiIndex &index)
    Provide multi-index access by chaining operator[].
    Definition: indexaccess.hh:263
    \n+
    auto negatePredicate(Check check)
    Negate given predicate.
    Definition: utility.hh:304
    \n
    Definition: polynomial.hh:10
    \n-
    constexpr bool IsReferenceWrapper_v
    This is an alias for Dune::IsReferenceWrapper_v.
    Definition: referencehelper.hh:26
    \n-
    Dune::ResolveRef_t< T > ResolveRef_t
    This is an alias for Dune::ResolveRef_t.
    Definition: referencehelper.hh:49
    \n-
    decltype(auto) resolveRef(T &&t)
    This is an alias for Dune::resolveRef.
    Definition: referencehelper.hh:37
    \n+
    auto forwardCapture(T &&t)
    Create a capture object for perfect forwarding.
    Definition: utility.hh:372
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,75 +5,362 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-referencehelper.hh\n+indexaccess.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_COMMON_REFERENCE_HELPER_HH\n- 4#define DUNE_FUNCTIONS_COMMON_REFERENCE_HELPER_HH\n+ 3#ifndef DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH\n+ 4#define DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH\n 5\n- 6#warning The header dune/functions/common/referencehelper.hh is deprecated\n-and will be removed after release 2.9. Include dune/common/referencehelper.hh\n-instead.\n- 7\n+ 6\n+ 7#include \n 8#include \n 9\n- 10#include \n- 11\n- 12\n+ 10#include \n+ 11#include \n+ 12#include \n 13\n- 14\n- 15namespace Dune {\n- 16namespace Functions {\n+ 14#include \n+ 15\n+ 16\n 17\n- 18\n- 23template\n- 24[[deprecated(\"Use Dune::IsReferenceWrapper_v instead. Will be removed after\n-release 2.9.\")]]\n- 25constexpr bool\n-26IsReferenceWrapper_v = Dune::IsReferenceWrapper_v;\n- 27\n- 28\n- 33template\n- 34decltype(auto)\n-35resolveRef\n- 36[[deprecated(\"Use Dune::resolveRef instead. Will be removed after release\n-2.9.\")]]\n- 37(T&& t)\n- 38{\n- 39 return Dune::resolveRef(std::forward(t));\n- 40}\n- 41\n- 46template\n-47using ResolveRef_t\n- 48[[deprecated(\"Use Dune::ResolveRef_t instead. Will be removed after release\n-2.9.\")]]\n- 49 = Dune::ResolveRef_t;\n- 50\n- 51\n- 52}} // namespace Dune::Functions\n- 53\n- 54\n- 55\n- 56#endif // DUNE_FUNCTIONS_COMMON_REFERENCE_HELPER_HH\n+ 18namespace Dune {\n+ 19namespace Functions {\n+ 20\n+ 21\n+ 22namespace Imp {\n+ 23\n+ 24namespace Concept {\n+ 25\n+ 26template\n+ 27struct HasDynamicIndexAccess\n+ 28{\n+ 29 template\n+ 30 auto require(C&& c) -> decltype(\n+ 31 c[std::declval()]\n+ 32 );\n+ 33};\n+ 34\n+ 35struct HasStaticIndexAccess\n+ 36{\n+ 37 template\n+ 38 auto require(C&& c) -> decltype(\n+ 39 c[Dune::Indices::_0]\n+ 40 );\n+ 41};\n+ 42\n+ 43} // namespace Concept\n+ 44\n+ 45} // namespace Imp\n+ 46\n+ 47\n+ 48\n+ 61template, C>(), int>::type = 0>\n+63auto hybridIndexAccess(C&& c, const I& i, F&& f)\n+ 64 -> decltype(f(c[i]))\n+ 65{\n+ 66 return f(c[i]);\n+ 67}\n+ 68\n+ 86template, C>(), int>::type = 0>\n+88decltype(auto) hybridIndexAccess(C&& c, const I& i, F&& f)\n+ 89{\n+ 90 using Size = decltype(Hybrid::size(c));\n+ 91 return Hybrid::switchCases(std::make_index_sequence(), i,\n+ 92 [&](const auto& ii) -> decltype(auto){\n+ 93 return f(c[ii]);\n+ 94 }, [&]() -> decltype(auto){\n+ 95 return f(c[Dune::Indices::_0]);\n+ 96 });\n+ 97}\n+ 98\n+ 99\n+ 100namespace Imp {\n+ 101\n+ 115 template\n+ 116 class ShiftedDynamicMultiIndex\n+ 117 {\n+ 118 public:\n+ 119 ShiftedDynamicMultiIndex(const Index& index) :\n+ 120 index_(index)\n+ 121 {}\n+ 122\n+ 123 std::size_t operator[](std::size_t position) const\n+ 124 {\n+ 125 if (position pop() const\n+ 135 {\n+ 136 return {index_};\n+ 137 }\n+ 138\n+ 139 std::size_t size() const\n+ 140 {\n+ 141 if (offset < index_.size())\n+ 142 return index_.size() - offset;\n+ 143 else\n+ 144 return 0;\n+ 145 }\n+ 146\n+ 147 private:\n+ 148 const Index& index_;\n+ 149 };\n+ 150\n+ 151 template\n+ 152 class ShiftedStaticMultiIndex\n+ 153 {\n+ 154 public:\n+ 155 ShiftedStaticMultiIndex(const Index& index) :\n+ 156 index_(index)\n+ 157 {}\n+ 158\n+ 159 template\n+ 160 auto operator[](Dune::index_constant) const\n+ 161 {\n+ 162 if constexpr (i{}];\n+ 164 } else {\n+ 165 return Dune::index_constant<0>{};\n+ 166 }\n+ 167 }\n+ 168\n+ 172 ShiftedStaticMultiIndex pop() const\n+ 173 {\n+ 174 return {index_};\n+ 175 }\n+ 176\n+ 177 static constexpr std::size_t size()\n+ 178 {\n+ 179 auto fullSize = decltype(Hybrid::size(std::declval()))::value;\n+ 180 if (offset < fullSize)\n+ 181 return fullSize - offset;\n+ 182 else\n+ 183 return 0;\n+ 184 }\n+ 185\n+ 186 private:\n+ 187 const Index& index_;\n+ 188 };\n+ 189\n+ 195 template\n+ 196 ShiftedDynamicMultiIndex shiftedDynamicMultiIndex(const\n+Index& index)\n+ 197 {\n+ 198 return {index};\n+ 199 }\n+ 200\n+ 201 template\n+ 202 ShiftedStaticMultiIndex shiftedStaticMultiIndex(const\n+Index& index)\n+ 203 {\n+ 204 return {index};\n+ 205 }\n+ 206\n+ 207} // namespace Imp\n+ 208\n+ 209\n+ 210\n+ 211\n+ 212namespace Imp {\n+ 213\n+ 214template\n+ 215struct MultiIndexResolver\n+ 216{\n+ 217 MultiIndexResolver(const Index& index) :\n+ 218 index_(index)\n+ 219 {}\n+ 220\n+ 221 template::value, int>::\n+type = 0>\n+ 223 Result operator()(C&& c)\n+ 224 {\n+ 225 auto&& subIndex = Imp::shiftedDynamicMultiIndex<1>(index_);\n+ 226 auto&& subIndexResolver = MultiIndexResolver\n+(subIndex);\n+ 227 return (Result)(hybridIndexAccess(c, index_[Dune::Indices::_0],\n+subIndexResolver));\n+ 228 }\n+ 229\n+ 230 template::value, int>::type\n+= 0>\n+ 232 Result operator()(C&& c)\n+ 233 {\n+ 234 return (Result)(std::forward(c));\n+ 235 }\n+ 236\n+ 237 const Index& index_;\n+ 238};\n+ 239\n+ 240} // namespace Imp\n+ 241\n+ 242\n+ 243\n+ 262template\n+263Result hybridMultiIndexAccess(C&& c, const MultiIndex& index)\n+ 264{\n+ 265\n+ 266 Imp::MultiIndexResolver multiIndexResolver(index);\n+ 267 return multiIndexResolver(c);\n+ 268}\n+ 269\n+ 270\n+ 271\n+ 272\n+ 273\n+ 274\n+ 275namespace Imp {\n+ 276\n+ 277 template\n+ 278 constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex&\n+multiIndex, const IsFinal& isFinal)\n+ 279 {\n+ 280 // If c is already considered final simply return it,\n+ 281 // else resolve the next multiIndex entry.\n+ 282 return Hybrid::ifElse(isFinal(c), [&, c = forwardCapture(std::forward\n+(c))](auto) -> decltype(auto) {\n+ 283 assert(multiIndex.size() == 0);\n+ 284 return c.forward();\n+ 285 }, [&](auto) -> decltype(auto) {\n+ 286 auto hasDynamicAccess = callableCheck([](auto&& cc) -> std::\n+void_t {});\n+ 287\n+ 288 // Split multiIndex into first entry and remaining ones.\n+ 289 auto i = multiIndex[0];\n+ 290 auto tail = multiIndex.pop();\n+ 291\n+ 292 // Resolve first multiIndex entry by c[multiIndex[0]] and\n+ 293 // continue resolving with the remaining remaining ones.\n+ 294 // If c has a dynamic operator[] this is straight forward.\n+ 295 // Else the dynamic multiIndex[0] has to be translated into\n+ 296 // a static one using hybridIndexAccess.\n+ 297 return Hybrid::ifElse(hasDynamicAccess(c), [&](auto id) -> decltype(auto)\n+{\n+ 298 return Imp::resolveDynamicMultiIndex(id(c)[i], tail, isFinal);\n+ 299 }, [&](auto id) -> decltype(auto) {\n+ 300 // auto indexRange = range(Hybrid::size(id(c)));\n+ 301 auto indexRange = typename decltype(range(Hybrid::size(id(c))))::\n+integer_sequence();\n+ 302 return Hybrid::switchCases(indexRange, i, [&](auto static_i) -> decltype\n+(auto){\n+ 303 // Do rescursion with static version of i\n+ 304 return Imp::resolveDynamicMultiIndex(id(c)[static_i], tail, isFinal);\n+ 305 }, [&]() -> decltype(auto){\n+ 306 // As fallback we use c[0] this is needed, because there must be one\n+branch that matches.\n+ 307 return Imp::resolveDynamicMultiIndex(id(c)[Dune::Indices::_0], tail,\n+isFinal);\n+ 308 });\n+ 309 });\n+ 310 });\n+ 311 }\n+ 312\n+ 313 template\n+ 314 constexpr decltype(auto) resolveStaticMultiIndex(C&& c, const MultiIndex&\n+multiIndex)\n+ 315 {\n+ 316 auto isExhausted = Hybrid::equals(Hybrid::size(multiIndex), Dune::\n+Indices::_0);\n+ 317 return Hybrid::ifElse(isExhausted, [&, c = forwardCapture(std::forward\n+(c))](auto) -> decltype(auto) {\n+ 318 return c.forward();\n+ 319 }, [&](auto id) -> decltype(auto) {\n+ 320 auto head = multiIndex[Dune::Indices::_0];\n+ 321 auto tail = multiIndex.pop();\n+ 322\n+ 323 return Imp::resolveStaticMultiIndex(id(c)[head], tail);\n+ 324 });\n+ 325 }\n+ 326\n+ 327} // namespace Imp\n+ 328\n+ 329\n+ 330\n+ 353template\n+354constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex&\n+multiIndex, const IsFinal& isFinal)\n+ 355{\n+ 356 return Imp::resolveDynamicMultiIndex(std::forward(c), Imp::\n+shiftedDynamicMultiIndex<0>(multiIndex), isFinal);\n+ 357}\n+ 358\n+ 375template\n+376constexpr decltype(auto) resolveDynamicMultiIndex(C&& c, const MultiIndex&\n+multiIndex)\n+ 377{\n+ 378 auto hasNoIndexAccess = negatePredicate(callableCheck([](auto&& cc) -\n+> std::void_t {}));\n+ 379 return Imp::resolveDynamicMultiIndex(std::forward(c), Imp::\n+shiftedDynamicMultiIndex<0>(multiIndex), hasNoIndexAccess);\n+ 380}\n+ 381\n+ 397template\n+398constexpr decltype(auto) resolveStaticMultiIndex(C&& c, const MultiIndex&\n+multiIndex)\n+ 399{\n+ 400 return Imp::resolveStaticMultiIndex(std::forward(c), Imp::\n+shiftedStaticMultiIndex<0>(multiIndex));\n+ 401}\n+ 402\n+ 403\n+ 404\n+ 405} // namespace Dune::Functions\n+ 406} // namespace Dune\n+ 407\n+ 408\n+ 409\n+ 410#endif // DUNE_FUNCTIONS_COMMON_INDEX_ACCESS_HH\n+utility.hh\n+Dune::Functions::hybridIndexAccess\n+auto hybridIndexAccess(C &&c, const I &i, F &&f) -> decltype(f(c[i]))\n+Provide operator[] index-access for containers.\n+Definition: indexaccess.hh:63\n+Dune::Functions::resolveStaticMultiIndex\n+constexpr decltype(auto) resolveStaticMultiIndex(C &&c, const MultiIndex\n+&multiIndex)\n+Provide multi-index access by chaining operator[].\n+Definition: indexaccess.hh:398\n+Dune::Functions::callableCheck\n+auto callableCheck(Expression f)\n+Create a predicate for checking validity of expressions.\n+Definition: utility.hh:279\n+Dune::Functions::resolveDynamicMultiIndex\n+constexpr decltype(auto) resolveDynamicMultiIndex(C &&c, const MultiIndex\n+&multiIndex)\n+Provide multi-index access by chaining operator[].\n+Definition: indexaccess.hh:376\n+Dune::Functions::resolveDynamicMultiIndex\n+constexpr decltype(auto) resolveDynamicMultiIndex(C &&c, const MultiIndex\n+&multiIndex, const IsFinal &isFinal)\n+Provide multi-index access by chaining operator[].\n+Definition: indexaccess.hh:354\n+Dune::Functions::hybridMultiIndexAccess\n+Result hybridMultiIndexAccess(C &&c, const MultiIndex &index)\n+Provide multi-index access by chaining operator[].\n+Definition: indexaccess.hh:263\n+Dune::Functions::negatePredicate\n+auto negatePredicate(Check check)\n+Negate given predicate.\n+Definition: utility.hh:304\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::IsReferenceWrapper_v\n-constexpr bool IsReferenceWrapper_v\n-This is an alias for Dune::IsReferenceWrapper_v.\n-Definition: referencehelper.hh:26\n-Dune::Functions::ResolveRef_t\n-Dune::ResolveRef_t< T > ResolveRef_t\n-This is an alias for Dune::ResolveRef_t.\n-Definition: referencehelper.hh:49\n-Dune::Functions::resolveRef\n-decltype(auto) resolveRef(T &&t)\n-This is an alias for Dune::resolveRef.\n-Definition: referencehelper.hh:37\n+Dune::Functions::forwardCapture\n+auto forwardCapture(T &&t)\n+Create a capture object for perfect forwarding.\n+Definition: utility.hh:372\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00035.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00035.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: polymorphicsmallobject.hh File Reference\n+dune-functions: defaultderivativetraits.hh File Reference\n \n \n \n \n \n \n \n@@ -65,26 +65,43 @@\n
  • dune
  • functions
  • common
  • \n \n \n
    \n \n-
    polymorphicsmallobject.hh File Reference
    \n+
    defaultderivativetraits.hh File Reference
    \n
    \n
    \n-
    #include <utility>
    \n-#include <type_traits>
    \n+
    #include <type_traits>
    \n+#include <utility>
    \n+#include <dune/common/fvector.hh>
    \n+#include <dune/common/fmatrix.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n

    \n Classes

    class  Dune::Functions::PolymorphicSmallObject< Base, bufferSize >
     A wrapper providing small object optimization with polymorphic types. More...
    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...
     
    \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,22 +6,40 @@\n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n Classes | Namespaces\n-polymorphicsmallobject.hh File Reference\n-#include \n+defaultderivativetraits.hh File Reference\n #include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::PolymorphicSmallObject<_Base,_bufferSize_>\n-\u00a0 A wrapper providing small object optimization with polymorphic types.\n- More...\n+ class \u00a0Dune::Functions::InvalidRange\n+\u00a0 Dummy range class to be used if no proper type is available. More...\n+\u00a0\n+struct \u00a0Dune::Functions::DefaultDerivativeTraits<_Signature_>\n+\u00a0 Default implementation for derivative traits. More...\n+\u00a0\n+struct \u00a0Dune::Functions::DefaultDerivativeTraits<_double(double)_>\n+\u00a0 Default implementation for derivative traits. More...\n+\u00a0\n+struct \u00a0Dune::Functions::DefaultDerivativeTraits<_K(FieldVector<_K,_n_>)>\n+\u00a0 Default implementation for derivative traits. More...\n+\u00a0\n+struct \u00a0Dune::Functions::DefaultDerivativeTraits<_FieldVector<_K,_m_>\n+ (FieldVector<_K,_n_>)>\n+\u00a0 Default implementation for derivative traits. More...\n+\u00a0\n+struct \u00a0Dune::Functions::DefaultDerivativeTraits<_FieldMatrix<_K,_1,_m_>\n+ (FieldVector<_K,_n_>)>\n+\u00a0 Default implementation for derivative traits. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n \n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00035_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00035_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: polymorphicsmallobject.hh Source File\n+dune-functions: defaultderivativetraits.hh Source File\n \n \n \n \n \n \n \n@@ -62,164 +62,81 @@\n \n \n \n
    \n-
    polymorphicsmallobject.hh
    \n+
    defaultderivativetraits.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH
    \n-
    4#define DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH
    \n+
    4#define DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH
    \n
    5
    \n-
    6#include <utility>
    \n-
    7#include <type_traits>
    \n+
    6#include <type_traits>
    \n+
    7#include <utility>
    \n
    8
    \n-
    9namespace Dune {
    \n-
    10namespace Functions {
    \n+
    9#include <dune/common/fvector.hh>
    \n+
    10#include <dune/common/fmatrix.hh>
    \n
    11
    \n-
    12
    \n-
    43template<class Base, size_t bufferSize>
    \n-\n-
    45{
    \n-
    46public:
    \n-
    47
    \n-\n-
    50 p_(nullptr)
    \n-
    51 {}
    \n-
    52
    \n-
    59 template<class Derived,
    \n-
    60 typename std::enable_if<std::is_base_of<Base, std::remove_cv_t<
    \n-
    61 std::remove_reference_t<Derived>>>::value, int>::type = 0>
    \n-
    62 PolymorphicSmallObject(Derived&& derived)
    \n-
    63 {
    \n-
    64 constexpr bool useBuffer = sizeof(Derived) <= bufferSize;
    \n-
    65 if constexpr (useBuffer) {
    \n-
    66 p_ = new (&buffer_) Derived(std::forward<Derived>(derived));
    \n-
    67 } else {
    \n-
    68 p_ = new Derived(std::forward<Derived>(derived));
    \n-
    69 }
    \n-
    70 }
    \n-
    71
    \n-\n-
    74 {
    \n-
    75 moveToWrappedObject(std::move(other));
    \n-
    76 }
    \n-
    77
    \n-\n-
    80 {
    \n-
    81 copyToWrappedObject(other);
    \n-
    82 }
    \n-
    83
    \n-\n-
    86 {
    \n-
    87 destroyWrappedObject();
    \n-
    88 }
    \n-
    89
    \n-\n-
    92 {
    \n-
    93 if (&other!=this)
    \n-
    94 {
    \n-
    95 destroyWrappedObject();
    \n-
    96 copyToWrappedObject(other);
    \n-
    97 }
    \n-
    98 return *this;
    \n-
    99 }
    \n-
    100
    \n-\n-
    103 {
    \n-
    104 destroyWrappedObject();
    \n-
    105 moveToWrappedObject(std::move(other));
    \n-
    106 return *this;
    \n-
    107 }
    \n+
    12namespace Dune {
    \n+
    13namespace Functions {
    \n+
    14
    \n+
    15
    \n+
    16
    \n+\n+
    23{};
    \n+
    24
    \n+
    25
    \n+
    35template<class Signature>
    \n+\n+
    37{
    \n+\n+
    40};
    \n+
    41
    \n+
    42
    \n+
    50template<>
    \n+
    51struct DefaultDerivativeTraits< double(double) >
    \n+
    52{
    \n+
    54 typedef double Range;
    \n+
    55};
    \n+
    56
    \n+
    66template<typename K, int n>
    \n+
    67struct DefaultDerivativeTraits<K(FieldVector<K,n>)>
    \n+
    68{
    \n+
    70 typedef FieldVector<K,n> Range;
    \n+
    71};
    \n+
    72
    \n+
    82template<typename K, int n, int m>
    \n+
    83struct DefaultDerivativeTraits<FieldVector<K,m>(FieldVector<K,n>)>
    \n+
    84{
    \n+
    86 typedef FieldMatrix<K,m,n> Range;
    \n+
    87};
    \n+
    88
    \n+
    98template<typename K, int n, int m>
    \n+
    99struct DefaultDerivativeTraits<FieldMatrix<K,1,m>(FieldVector<K,n>)>
    \n+
    100{
    \n+
    102 typedef FieldMatrix<K,m,n> Range;
    \n+
    103};
    \n+
    104
    \n+
    105
    \n+
    106}} // namespace Dune::Functions
    \n+
    107
    \n
    108
    \n-
    110 explicit operator bool() const
    \n-
    111 {
    \n-
    112 return p_;
    \n-
    113 }
    \n-
    114
    \n-
    116 bool bufferUsed() const
    \n-
    117 {
    \n-
    118 return ((void*) (p_) == (void*)(&buffer_));
    \n-
    119 }
    \n-
    120
    \n-
    122 const Base& get() const
    \n-
    123 {
    \n-
    124 return *p_;
    \n-
    125 }
    \n-
    126
    \n-
    128 Base& get()
    \n-
    129 {
    \n-
    130 return *p_;
    \n-
    131 }
    \n-
    132
    \n-
    133private:
    \n-
    134
    \n-
    135 void destroyWrappedObject() noexcept
    \n-
    136 {
    \n-
    137 if (operator bool())
    \n-
    138 {
    \n-
    139 if (bufferUsed())
    \n-
    140 p_->~Base();
    \n-
    141 else
    \n-
    142 delete p_;
    \n-
    143 }
    \n-
    144 }
    \n-
    145
    \n-
    146 void moveToWrappedObject(PolymorphicSmallObject&& other) noexcept
    \n-
    147 {
    \n-
    148 if (other.bufferUsed())
    \n-
    149 p_ = other.p_->move(&buffer_);
    \n-
    150 else
    \n-
    151 {
    \n-
    152 // We don't need to check for &other_!=this, because you can't
    \n-
    153 // have an rvalue to *this and call it's assignment/constructor
    \n-
    154 // at the same time. (Despite trying to shoot yourself in the foot
    \n-
    155 // with std::move explicitly.)
    \n-
    156
    \n-
    157 // Take ownership of allocated object
    \n-
    158 p_ = other.p_;
    \n-
    159
    \n-
    160 // Leave pointer in a clean state to avoid double freeing it.
    \n-
    161 other.p_ = 0;
    \n-
    162 }
    \n-
    163 }
    \n-
    164
    \n-
    165 void copyToWrappedObject(const PolymorphicSmallObject& other)
    \n-
    166 {
    \n-
    167 if (other.bufferUsed())
    \n-
    168 p_ = other.p_->clone(&buffer_);
    \n-
    169 else
    \n-
    170 p_ = other.p_->clone();
    \n-
    171 }
    \n-
    172
    \n-
    173 std::aligned_storage_t<bufferSize> buffer_;
    \n-
    174 Base* p_;
    \n-
    175};
    \n-
    176
    \n-
    177
    \n-
    178} // namespace Functions
    \n-
    179} // namespace Dune
    \n-
    180
    \n-
    181#endif // DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH
    \n+
    109#endif // DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH
    \n
    Definition: polynomial.hh:10
    \n-
    A wrapper providing small object optimization with polymorphic types.
    Definition: polymorphicsmallobject.hh:45
    \n-
    const Base & get() const
    Obtain reference to stored object.
    Definition: polymorphicsmallobject.hh:122
    \n-
    bool bufferUsed() const
    Check if object is stored in internal stack buffer.
    Definition: polymorphicsmallobject.hh:116
    \n-
    PolymorphicSmallObject(Derived &&derived)
    Construct from object.
    Definition: polymorphicsmallobject.hh:62
    \n-
    PolymorphicSmallObject(PolymorphicSmallObject &&other) noexcept
    Move constructor from other PolymorphicSmallObject.
    Definition: polymorphicsmallobject.hh:73
    \n-
    PolymorphicSmallObject & operator=(const PolymorphicSmallObject &other)
    Copy assignment from other PolymorphicSmallObject.
    Definition: polymorphicsmallobject.hh:91
    \n-
    PolymorphicSmallObject & operator=(PolymorphicSmallObject &&other) noexcept
    Move assignment from other PolymorphicSmallObject.
    Definition: polymorphicsmallobject.hh:102
    \n-
    PolymorphicSmallObject(const PolymorphicSmallObject &other)
    Copy constructor from other PolymorphicSmallObject.
    Definition: polymorphicsmallobject.hh:79
    \n-
    ~PolymorphicSmallObject()
    Destructor.
    Definition: polymorphicsmallobject.hh:85
    \n-
    PolymorphicSmallObject()
    Default constructor.
    Definition: polymorphicsmallobject.hh:49
    \n-
    Base & get()
    Obtain mutable reference to stored object.
    Definition: polymorphicsmallobject.hh:128
    \n+
    Dummy range class to be used if no proper type is available.
    Definition: defaultderivativetraits.hh:23
    \n+
    Default implementation for derivative traits.
    Definition: defaultderivativetraits.hh:37
    \n+
    InvalidRange Range
    Range of derivative for function with given signature.
    Definition: defaultderivativetraits.hh:39
    \n+
    double Range
    Range of derivative for function with given signature.
    Definition: defaultderivativetraits.hh:54
    \n+
    FieldVector< K, n > Range
    Range of derivative for function with given signature.
    Definition: defaultderivativetraits.hh:70
    \n+
    FieldMatrix< K, m, n > Range
    Range of derivative for function with given signature.
    Definition: defaultderivativetraits.hh:86
    \n+
    FieldMatrix< K, m, n > Range
    Range of derivative for function with given signature.
    Definition: defaultderivativetraits.hh:102
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,192 +5,98 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-polymorphicsmallobject.hh\n+defaultderivativetraits.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH\n- 4#define DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH\n+ 3#ifndef DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH\n+ 4#define DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH\n 5\n- 6#include \n- 7#include \n+ 6#include \n+ 7#include \n 8\n- 9namespace Dune {\n- 10namespace Functions {\n+ 9#include \n+ 10#include \n 11\n- 12\n- 43template\n-44class PolymorphicSmallObject\n- 45{\n- 46public:\n- 47\n-49 PolymorphicSmallObject() :\n- 50 p_(nullptr)\n- 51 {}\n- 52\n- 59 template>>::value, int>::type = 0>\n-62 PolymorphicSmallObject(Derived&& derived)\n- 63 {\n- 64 constexpr bool useBuffer = sizeof(Derived) <= bufferSize;\n- 65 if constexpr (useBuffer) {\n- 66 p_ = new (&buffer_) Derived(std::forward(derived));\n- 67 } else {\n- 68 p_ = new Derived(std::forward(derived));\n- 69 }\n- 70 }\n- 71\n-73 PolymorphicSmallObject(PolymorphicSmallObject&& other) noexcept\n- 74 {\n- 75 moveToWrappedObject(std::move(other));\n- 76 }\n- 77\n-79 PolymorphicSmallObject(const PolymorphicSmallObject& other)\n- 80 {\n- 81 copyToWrappedObject(other);\n- 82 }\n- 83\n-85 ~PolymorphicSmallObject()\n- 86 {\n- 87 destroyWrappedObject();\n- 88 }\n- 89\n-91 PolymorphicSmallObject& operator=(const PolymorphicSmallObject& other)\n- 92 {\n- 93 if (&other!=this)\n- 94 {\n- 95 destroyWrappedObject();\n- 96 copyToWrappedObject(other);\n- 97 }\n- 98 return *this;\n- 99 }\n- 100\n-102 PolymorphicSmallObject& operator=(PolymorphicSmallObject&& other) noexcept\n- 103 {\n- 104 destroyWrappedObject();\n- 105 moveToWrappedObject(std::move(other));\n- 106 return *this;\n- 107 }\n+ 12namespace Dune {\n+ 13namespace Functions {\n+ 14\n+ 15\n+ 16\n+22class InvalidRange\n+ 23{};\n+ 24\n+ 25\n+ 35template\n+36struct DefaultDerivativeTraits\n+ 37{\n+39 typedef InvalidRange Range;\n+ 40};\n+ 41\n+ 42\n+ 50template<>\n+51struct DefaultDerivativeTraits< double(double) >\n+ 52{\n+54 typedef double Range;\n+ 55};\n+ 56\n+ 66template\n+67struct DefaultDerivativeTraits)>\n+ 68{\n+70 typedef FieldVector Range;\n+ 71};\n+ 72\n+ 82template\n+83struct DefaultDerivativeTraits(FieldVector)>\n+ 84{\n+86 typedef FieldMatrix Range;\n+ 87};\n+ 88\n+ 98template\n+99struct DefaultDerivativeTraits(FieldVector)>\n+ 100{\n+102 typedef FieldMatrix Range;\n+ 103};\n+ 104\n+ 105\n+ 106}} // namespace Dune::Functions\n+ 107\n 108\n-110 explicit operator bool() const\n- 111 {\n- 112 return p_;\n- 113 }\n- 114\n-116 bool bufferUsed() const\n- 117 {\n- 118 return ((void*) (p_) == (void*)(&buffer_));\n- 119 }\n- 120\n-122 const Base& get() const\n- 123 {\n- 124 return *p_;\n- 125 }\n- 126\n-128 Base& get()\n- 129 {\n- 130 return *p_;\n- 131 }\n- 132\n- 133private:\n- 134\n- 135 void destroyWrappedObject() noexcept\n- 136 {\n- 137 if (operator bool())\n- 138 {\n- 139 if (bufferUsed())\n- 140 p_->~Base();\n- 141 else\n- 142 delete p_;\n- 143 }\n- 144 }\n- 145\n- 146 void moveToWrappedObject(PolymorphicSmallObject&& other) noexcept\n- 147 {\n- 148 if (other.bufferUsed())\n- 149 p_ = other.p_->move(&buffer_);\n- 150 else\n- 151 {\n- 152 // We don't need to check for &other_!=this, because you can't\n- 153 // have an rvalue to *this and call it's assignment/constructor\n- 154 // at the same time. (Despite trying to shoot yourself in the foot\n- 155 // with std::move explicitly.)\n- 156\n- 157 // Take ownership of allocated object\n- 158 p_ = other.p_;\n- 159\n- 160 // Leave pointer in a clean state to avoid double freeing it.\n- 161 other.p_ = 0;\n- 162 }\n- 163 }\n- 164\n- 165 void copyToWrappedObject(const PolymorphicSmallObject& other)\n- 166 {\n- 167 if (other.bufferUsed())\n- 168 p_ = other.p_->clone(&buffer_);\n- 169 else\n- 170 p_ = other.p_->clone();\n- 171 }\n- 172\n- 173 std::aligned_storage_t buffer_;\n- 174 Base* p_;\n- 175};\n- 176\n- 177\n- 178} // namespace Functions\n- 179} // namespace Dune\n- 180\n- 181#endif // DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH\n+ 109#endif // DUNE_FUNCTIONS_COMMON_DEFAULT_DERIVATIVE_TRAITS_HH\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::PolymorphicSmallObject\n-A wrapper providing small object optimization with polymorphic types.\n-Definition: polymorphicsmallobject.hh:45\n-Dune::Functions::PolymorphicSmallObject::get\n-const Base & get() const\n-Obtain reference to stored object.\n-Definition: polymorphicsmallobject.hh:122\n-Dune::Functions::PolymorphicSmallObject::bufferUsed\n-bool bufferUsed() const\n-Check if object is stored in internal stack buffer.\n-Definition: polymorphicsmallobject.hh:116\n-Dune::Functions::PolymorphicSmallObject::PolymorphicSmallObject\n-PolymorphicSmallObject(Derived &&derived)\n-Construct from object.\n-Definition: polymorphicsmallobject.hh:62\n-Dune::Functions::PolymorphicSmallObject::PolymorphicSmallObject\n-PolymorphicSmallObject(PolymorphicSmallObject &&other) noexcept\n-Move constructor from other PolymorphicSmallObject.\n-Definition: polymorphicsmallobject.hh:73\n-Dune::Functions::PolymorphicSmallObject::operator=\n-PolymorphicSmallObject & operator=(const PolymorphicSmallObject &other)\n-Copy assignment from other PolymorphicSmallObject.\n-Definition: polymorphicsmallobject.hh:91\n-Dune::Functions::PolymorphicSmallObject::operator=\n-PolymorphicSmallObject & operator=(PolymorphicSmallObject &&other) noexcept\n-Move assignment from other PolymorphicSmallObject.\n-Definition: polymorphicsmallobject.hh:102\n-Dune::Functions::PolymorphicSmallObject::PolymorphicSmallObject\n-PolymorphicSmallObject(const PolymorphicSmallObject &other)\n-Copy constructor from other PolymorphicSmallObject.\n-Definition: polymorphicsmallobject.hh:79\n-Dune::Functions::PolymorphicSmallObject::~PolymorphicSmallObject\n-~PolymorphicSmallObject()\n-Destructor.\n-Definition: polymorphicsmallobject.hh:85\n-Dune::Functions::PolymorphicSmallObject::PolymorphicSmallObject\n-PolymorphicSmallObject()\n-Default constructor.\n-Definition: polymorphicsmallobject.hh:49\n-Dune::Functions::PolymorphicSmallObject::get\n-Base & get()\n-Obtain mutable reference to stored object.\n-Definition: polymorphicsmallobject.hh:128\n+Dune::Functions::InvalidRange\n+Dummy range class to be used if no proper type is available.\n+Definition: defaultderivativetraits.hh:23\n+Dune::Functions::DefaultDerivativeTraits\n+Default implementation for derivative traits.\n+Definition: defaultderivativetraits.hh:37\n+Dune::Functions::DefaultDerivativeTraits::Range\n+InvalidRange Range\n+Range of derivative for function with given signature.\n+Definition: defaultderivativetraits.hh:39\n+Dune::Functions::DefaultDerivativeTraits<_double(double)_>::Range\n+double Range\n+Range of derivative for function with given signature.\n+Definition: defaultderivativetraits.hh:54\n+Dune::Functions::DefaultDerivativeTraits<_K(FieldVector<_K,_n_>)>::Range\n+FieldVector< K, n > Range\n+Range of derivative for function with given signature.\n+Definition: defaultderivativetraits.hh:70\n+Dune::Functions::DefaultDerivativeTraits<_FieldVector<_K,_m_>(FieldVector<_K,_n\n+>)>::Range\n+FieldMatrix< K, m, n > Range\n+Range of derivative for function with given signature.\n+Definition: defaultderivativetraits.hh:86\n+Dune::Functions::DefaultDerivativeTraits<_FieldMatrix<_K,_1,_m_>(FieldVector<\n+K,_n_>)>::Range\n+FieldMatrix< K, m, n > Range\n+Range of derivative for function with given signature.\n+Definition: defaultderivativetraits.hh:102\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00038.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00038.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: overflowarray.hh File Reference\n+dune-functions: differentiablefunction.hh File Reference\n \n \n \n \n \n \n \n@@ -65,30 +65,34 @@\n
  • dune
  • functions
  • common
  • \n \n \n
    \n \n-
    overflowarray.hh File Reference
    \n+
    differentiablefunction.hh File Reference
    \n
    \n
    \n-
    #include <algorithm>
    \n-#include <iostream>
    \n-#include <cstddef>
    \n-#include <array>
    \n-#include <initializer_list>
    \n-#include <dune/common/genericiterator.hh>
    \n+\n

    Go to the source code of this file.

    \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
    \n \n-\n-\n+\n+\n+\n+\n \n

    \n Classes

    class  Dune::Functions::OverflowArray< BA, maxSize >
     A dynamically sized array-like class with overflow. More...
    class  Dune::Functions::DifferentiableFunction< Signature, DerivativeTraits, bufferSize >
     
    class  Dune::Functions::DifferentiableFunction< Range(Domain), DerivativeTraits, bufferSize >
     Class storing differentiable functions using type erasure. More...
     
    \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,25 +6,31 @@\n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n Classes | Namespaces\n-overflowarray.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+differentiablefunction.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::OverflowArray<_BA,_maxSize_>\n-\u00a0 A dynamically sized array-like class with overflow. More...\n+class \u00a0Dune::Functions::DifferentiableFunction<_Signature,_DerivativeTraits,\n+ bufferSize_>\n+\u00a0\n+class \u00a0Dune::Functions::DifferentiableFunction<_Range(Domain),\n+ DerivativeTraits,_bufferSize_>\n+\u00a0 Class storing differentiable functions using type erasure. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n \n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00038_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00038_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: overflowarray.hh Source File\n+dune-functions: differentiablefunction.hh Source File\n \n \n \n \n \n \n \n@@ -62,230 +62,128 @@\n \n \n \n
    \n-
    overflowarray.hh
    \n+
    differentiablefunction.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH
    \n-
    4#define DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH
    \n+
    4#define DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH
    \n
    5
    \n-
    6#include <algorithm>
    \n-
    7#include <iostream>
    \n-
    8#include <cstddef>
    \n-
    9#include <array>
    \n-
    10#include <initializer_list>
    \n-
    11
    \n-
    12#include <dune/common/genericiterator.hh>
    \n-
    13
    \n-
    14
    \n-
    15
    \n-
    16namespace Dune::Functions {
    \n-
    17
    \n-
    18
    \n-
    42template<class BA, std::size_t maxSize = std::tuple_size_v<BA>>
    \n-\n-
    44 public BA
    \n-
    45{
    \n-
    46 static constexpr std::size_t baseSize = std::tuple_size_v<BA>;
    \n-
    47
    \n-
    48public:
    \n-
    49 using BaseArray = BA;
    \n-
    50
    \n-
    51 using value_type = typename BaseArray::value_type;
    \n-\n-\n-\n-
    55 using difference_type = std::ptrdiff_t;
    \n-
    56 using size_type = std::size_t;
    \n-
    57 using iterator = Dune::GenericIterator<OverflowArray, value_type>;
    \n-
    58 using const_iterator = Dune::GenericIterator<const OverflowArray, const value_type>;
    \n-
    59
    \n-
    60private:
    \n-
    61 using OverflowBuffer = std::array<value_type, maxSize-baseSize>;
    \n-
    62
    \n-
    63public:
    \n+
    6#include <type_traits>
    \n+
    7
    \n+
    8#include <dune/common/typeutilities.hh>
    \n+
    9
    \n+\n+\n+\n+\n+\n+\n+
    16
    \n+
    17namespace Dune {
    \n+
    18namespace Functions {
    \n+
    19
    \n+
    20
    \n+
    21
    \n+
    22/*
    \n+
    23 * Default implementation is empty
    \n+
    24 * The actual implementation is only given if Signature is an type
    \n+
    25 * describing a function signature as Range(Domain).
    \n+
    26 */
    \n+
    27template<class Signature, template<class> class DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>
    \n+\n+
    29{};
    \n+
    30
    \n+
    31
    \n+
    32
    \n+
    33namespace Imp
    \n+
    34{
    \n+
    35
    \n+
    37 template<class S, template<class> class DerivativeTraits, size_t bufferSize>
    \n+
    38 struct DifferentiableFunctionTraits
    \n+
    39 {
    \n+
    41 using Signature = S;
    \n+
    42
    \n+
    44 using Range = typename SignatureTraits<Signature>::Range;
    \n+
    45
    \n+
    47 using Domain = typename SignatureTraits<Signature>::Domain;
    \n+
    48
    \n+
    50 using DerivativeSignature = typename SignatureTraits<Signature>::template DerivativeSignature<DerivativeTraits>;
    \n+
    51
    \n+\n+
    54
    \n+
    56 using Concept = DifferentiableFunctionWrapperInterface<Signature, DerivativeInterface>;
    \n+
    57
    \n+
    59 template<class B>
    \n+
    60 using Model = DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>;
    \n+
    61 };
    \n+
    62}
    \n+
    63
    \n
    64
    \n-
    65 OverflowArray() = default;
    \n-
    66
    \n-
    67 OverflowArray(const std::initializer_list<value_type>& l) {
    \n-
    68 assert(l.size() <= capacity());
    \n-
    69 size_ = l.size();
    \n-
    70 std::copy_n(l.begin(), size_, begin());
    \n-
    71 }
    \n-
    72
    \n-
    73 bool operator == (const OverflowArray& other) const {
    \n-
    74 if (size() != other.size())
    \n-
    75 return false;
    \n-
    76 for (size_type i=0; i<size(); ++i)
    \n-
    77 if ((*this)[i] != other[i])
    \n-
    78 return false;
    \n-
    79 return true;
    \n-
    80 }
    \n-
    81
    \n-
    83 void clear() {
    \n-
    84 size_ = 0;
    \n-
    85 }
    \n-
    86
    \n-
    93 void resize(size_type n) {
    \n-
    94 assert(n <= capacity());
    \n-
    95 size_ = n;
    \n-
    96 }
    \n-
    97
    \n-
    104 void push_back(const value_type& t) {
    \n-
    105 assert(size() < capacity());
    \n-
    106 (*this)[size_++] = t;
    \n-
    107 }
    \n-
    108
    \n-
    110 void pop_back() {
    \n-
    111 assert(size() > 0);
    \n-
    112 if (! empty())
    \n-
    113 size_--;
    \n-
    114 }
    \n-
    115
    \n-
    122 void push_front(const value_type& t) {
    \n-
    123 assert(size() < capacity());
    \n-
    124 for (size_type i=0; i<size(); i++)
    \n-
    125 (*this)[i+1] = (*this)[i];
    \n-
    126 (*this)[0] = t;
    \n-
    127 }
    \n-
    128
    \n-\n-
    131 return iterator(*this, 0);
    \n-
    132 }
    \n-
    133
    \n-\n-
    136 return const_iterator(*this, 0);
    \n-
    137 }
    \n-
    138
    \n-\n-
    141 return iterator(*this, size());
    \n-
    142 }
    \n-
    143
    \n-\n-
    146 return const_iterator(*this, size());
    \n-
    147 }
    \n-
    148
    \n-\n-
    151 assert(i < size());
    \n-
    152 // If there's no padding between the base class and the overflow_ member,
    \n-
    153 // the compiler should be able to optimize this to
    \n-
    154 // return *(&BaseArray::operator[](0) + i);
    \n-
    155 if (i<baseSize)
    \n-
    156 return BaseArray::operator[](i);
    \n-
    157 return overflow_[i-baseSize];
    \n-
    158 }
    \n-
    159
    \n-\n-
    162 assert(i < size());
    \n-
    163 // If there's no padding between the base class and the overflow_ member,
    \n-
    164 // the compiler should be able to optimize this to
    \n-
    165 // return *(&BaseArray::operator[](0) + i);
    \n-
    166 if (i<baseSize)
    \n-
    167 return BaseArray::operator[](i);
    \n-
    168 return overflow_[i-baseSize];
    \n-
    169 }
    \n-
    170
    \n-\n-
    173 assert(size() > 0);
    \n-
    174 return (*this)[0];
    \n-
    175 }
    \n-
    176
    \n-\n-
    179 assert(size() > 0);
    \n-
    180 return (*this)[0];
    \n-
    181 }
    \n-
    182
    \n-\n-
    185 assert(size() > 0);
    \n-
    186 return (*this)[size()-1];
    \n-
    187 }
    \n-
    188
    \n-\n-
    191 assert(size() > 0);
    \n-
    192 return (*this)[size()-1];
    \n-
    193 }
    \n-
    194
    \n-
    196 size_type size () const {
    \n-
    197 return size_;
    \n-
    198 }
    \n-
    199
    \n-
    201 bool empty() const {
    \n-
    202 return size() == 0;
    \n-
    203 }
    \n-
    204
    \n-
    206 static constexpr size_type capacity() {
    \n-
    207 return maxSize;
    \n-
    208 }
    \n-
    209
    \n-
    211 static constexpr size_type max_size() {
    \n-
    212 return maxSize;
    \n-
    213 }
    \n-
    214
    \n-
    216 inline friend std::size_t hash_value(const OverflowArray& v) noexcept {
    \n-
    217 return hash_range(v.begin(), v.end());
    \n-
    218 }
    \n-
    219
    \n-
    221 friend std::ostream& operator<< (std::ostream& s, const OverflowArray& c) {
    \n-
    222 for (const auto& ci : c)
    \n-
    223 s << ci << " ";
    \n-
    224 return s;
    \n-
    225 }
    \n-
    226
    \n-
    227private:
    \n-
    228 OverflowBuffer overflow_;
    \n-
    229 size_type size_ = 0;
    \n-
    230};
    \n-
    231
    \n-
    232
    \n-
    233
    \n-
    234} // namespace Dune::Functions
    \n-
    235
    \n-
    236
    \n-
    237
    \n-
    238#endif // DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH
    \n-
    Definition: polynomial.hh:11
    \n-
    A dynamically sized array-like class with overflow.
    Definition: overflowarray.hh:45
    \n-
    const value_type & const_reference
    Definition: overflowarray.hh:53
    \n-
    value_type & reference
    Definition: overflowarray.hh:52
    \n-
    const_iterator end() const
    Returns a const_iterator pointing to the end of the OverflowArray.
    Definition: overflowarray.hh:145
    \n-
    bool operator==(const OverflowArray &other) const
    Definition: overflowarray.hh:73
    \n-
    friend std::size_t hash_value(const OverflowArray &v) noexcept
    Compute hash value.
    Definition: overflowarray.hh:216
    \n-
    void push_back(const value_type &t)
    Appends an element to the end of the OverflowArray,.
    Definition: overflowarray.hh:104
    \n-
    friend std::ostream & operator<<(std::ostream &s, const OverflowArray &c)
    Write container to an output stream.
    Definition: overflowarray.hh:221
    \n-
    iterator begin()
    Returns a iterator pointing to the beginning of the OverflowArray.
    Definition: overflowarray.hh:130
    \n-
    bool empty() const
    Returns true if OverflowArray has no elements.
    Definition: overflowarray.hh:201
    \n-
    size_type size() const
    Returns number of elements in the OverflowArray.
    Definition: overflowarray.hh:196
    \n-
    typename BaseArray::value_type value_type
    Definition: overflowarray.hh:51
    \n-
    void pop_back()
    Erases the last element of the OverflowArray, O(1) time.
    Definition: overflowarray.hh:110
    \n-
    Dune::GenericIterator< OverflowArray, value_type > iterator
    Definition: overflowarray.hh:57
    \n-
    const_iterator begin() const
    Returns a const_iterator pointing to the beginning of the OverflowArray.
    Definition: overflowarray.hh:135
    \n-
    std::ptrdiff_t difference_type
    Definition: overflowarray.hh:55
    \n-\n-
    BA BaseArray
    Definition: overflowarray.hh:49
    \n-
    static constexpr size_type capacity()
    Returns the capacity of the OverflowArray.
    Definition: overflowarray.hh:206
    \n-
    static constexpr size_type max_size()
    Returns the maximum length of the OverflowArray.
    Definition: overflowarray.hh:211
    \n-
    const_reference front() const
    Returns const reference to first element of OverflowArray.
    Definition: overflowarray.hh:178
    \n-
    void clear()
    Erases all elements.
    Definition: overflowarray.hh:83
    \n-
    iterator end()
    Returns an iterator pointing to the end of the OverflowArray.
    Definition: overflowarray.hh:140
    \n-
    std::size_t size_type
    Definition: overflowarray.hh:56
    \n-
    void resize(size_type n)
    Specifies a new size for the OverflowArray.
    Definition: overflowarray.hh:93
    \n-
    value_type * pointer
    Definition: overflowarray.hh:54
    \n-
    Dune::GenericIterator< const OverflowArray, const value_type > const_iterator
    Definition: overflowarray.hh:58
    \n-
    const_reference back() const
    Returns const reference to last element of OverflowArray.
    Definition: overflowarray.hh:190
    \n-
    OverflowArray(const std::initializer_list< value_type > &l)
    Definition: overflowarray.hh:67
    \n-
    reference back()
    Returns reference to last element of OverflowArray.
    Definition: overflowarray.hh:184
    \n-
    void push_front(const value_type &t)
    Inserts an element to the begin of the OverflowArray,.
    Definition: overflowarray.hh:122
    \n-
    reference front()
    Returns reference to first element of OverflowArray.
    Definition: overflowarray.hh:172
    \n-
    reference operator[](size_type i)
    Returns reference to the i'th element.
    Definition: overflowarray.hh:150
    \n+
    65
    \n+
    80template<class Range, class Domain, template<class> class DerivativeTraits, size_t bufferSize>
    \n+
    81class DifferentiableFunction< Range(Domain), DerivativeTraits, bufferSize> :
    \n+
    82 public TypeErasureBase<
    \n+
    83 typename Imp::DifferentiableFunctionTraits<Range(Domain), DerivativeTraits, bufferSize>::Concept,
    \n+
    84 Imp::DifferentiableFunctionTraits<Range(Domain), DerivativeTraits, bufferSize>::template Model>
    \n+
    85{
    \n+
    86 using Traits = Imp::DifferentiableFunctionTraits<Range(Domain), DerivativeTraits, bufferSize>;
    \n+
    87
    \n+\n+
    89
    \n+
    90 using DerivativeInterface = typename Traits::DerivativeInterface;
    \n+
    91
    \n+
    92public:
    \n+
    93
    \n+
    105 template<class F, disableCopyMove<DifferentiableFunction, F> = 0 >
    \n+\n+
    107 Base(std::forward<F>(f))
    \n+
    108 {
    \n+
    109 static_assert(Dune::Functions::Concept::isFunction<F, Range(Domain)>(), "Trying to construct a DifferentiableFunction from type that does not model the Function concept");
    \n+
    110 }
    \n+
    111
    \n+\n+
    114
    \n+
    118 Range operator() (const Domain& x) const
    \n+
    119 {
    \n+
    120 return this->asInterface().operator()(x);
    \n+
    121 }
    \n+
    122
    \n+
    130 friend DerivativeInterface derivative(const DifferentiableFunction& t)
    \n+
    131 {
    \n+
    132 return t.asInterface().derivative();
    \n+
    133 }
    \n+
    134};
    \n+
    135
    \n+
    136
    \n+
    137
    \n+
    138}} // namespace Dune::Functions
    \n+
    139
    \n+
    140
    \n+
    141
    \n+
    142#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH
    \n+\n+\n+\n+\n+\n+\n+
    friend DerivativeInterface derivative(const DifferentiableFunction &t)
    Get derivative of wrapped function.
    Definition: differentiablefunction.hh:130
    \n+
    Definition: polynomial.hh:10
    \n+
    Definition: differentiablefunction.hh:29
    \n+
    DifferentiableFunction(F &&f)
    Construct from function.
    Definition: differentiablefunction.hh:106
    \n+\n+
    Helper class to deduce the signature of a callable.
    Definition: signature.hh:56
    \n+
    Base class for type-erased interface wrapper.
    Definition: typeerasure.hh:165
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,312 +5,153 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-overflowarray.hh\n+differentiablefunction.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH\n- 4#define DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH\n+ 3#ifndef DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH\n+ 4#define DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH\n 5\n- 6#include \n- 7#include \n- 8#include \n- 9#include \n- 10#include \n- 11\n- 12#include \n- 13\n- 14\n- 15\n- 16namespace Dune::Functions {\n- 17\n- 18\n- 42template>\n-43class OverflowArray :\n- 44 public BA\n- 45{\n- 46 static constexpr std::size_t baseSize = std::tuple_size_v;\n- 47\n- 48public:\n-49 using BaseArray = BA;\n- 50\n-51 using value_type = typename BaseArray::value_type;\n-52 using reference = value_type&;\n-53 using const_reference = const value_type&;\n-54 using pointer = value_type*;\n-55 using difference_type = std::ptrdiff_t;\n-56 using size_type = std::size_t;\n-57 using iterator = Dune::GenericIterator;\n-58 using const_iterator = Dune::GenericIterator;\n- 59\n- 60private:\n- 61 using OverflowBuffer = std::array;\n- 62\n- 63public:\n+ 6#include \n+ 7\n+ 8#include \n+ 9\n+ 10#include \n+ 11#include \n+ 12#include \n+ 13#include \n+ 14#include \n+ 15#include \n+ 16\n+ 17namespace Dune {\n+ 18namespace Functions {\n+ 19\n+ 20\n+ 21\n+ 22/*\n+ 23 * Default implementation is empty\n+ 24 * The actual implementation is only given if Signature is an type\n+ 25 * describing a function signature as Range(Domain).\n+ 26 */\n+ 27template class\n+DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>\n+28class DifferentiableFunction\n+ 29{};\n+ 30\n+ 31\n+ 32\n+ 33namespace Imp\n+ 34{\n+ 35\n+ 37 template class DerivativeTraits, size_t\n+bufferSize>\n+ 38 struct DifferentiableFunctionTraits\n+ 39 {\n+ 41 using Signature = S;\n+ 42\n+ 44 using Range = typename SignatureTraits::Range;\n+ 45\n+ 47 using Domain = typename SignatureTraits::Domain;\n+ 48\n+ 50 using DerivativeSignature = typename SignatureTraits::template\n+DerivativeSignature;\n+ 51\n+ 53 using DerivativeInterface = DifferentiableFunction;\n+ 54\n+ 56 using Concept = DifferentiableFunctionWrapperInterface;\n+ 57\n+ 59 template\n+ 60 using Model = DifferentiableFunctionWrapperImplementation;\n+ 61 };\n+ 62}\n+ 63\n 64\n-65 OverflowArray() = default;\n- 66\n-67 OverflowArray(const std::initializer_list& l) {\n- 68 assert(l.size() <= capacity());\n- 69 size_ = l.size();\n- 70 std::copy_n(l.begin(), size_, begin());\n- 71 }\n- 72\n-73 bool operator_==(const OverflowArray& other) const {\n- 74 if (size() != other.size())\n- 75 return false;\n- 76 for (size_type i=0; i 0);\n- 112 if (! empty())\n- 113 size_--;\n- 114 }\n- 115\n-122 void push_front(const value_type& t) {\n- 123 assert(size() < capacity());\n- 124 for (size_type i=0; i 0);\n- 174 return (*this)[0];\n- 175 }\n- 176\n-178 const_reference front() const {\n- 179 assert(size() > 0);\n- 180 return (*this)[0];\n- 181 }\n- 182\n-184 reference back() {\n- 185 assert(size() > 0);\n- 186 return (*this)[size()-1];\n- 187 }\n- 188\n-190 const_reference back() const {\n- 191 assert(size() > 0);\n- 192 return (*this)[size()-1];\n- 193 }\n- 194\n-196 size_type size () const {\n- 197 return size_;\n- 198 }\n- 199\n-201 bool empty() const {\n- 202 return size() == 0;\n- 203 }\n- 204\n-206 static constexpr size_type capacity() {\n- 207 return maxSize;\n- 208 }\n- 209\n-211 static constexpr size_type max_size() {\n- 212 return maxSize;\n- 213 }\n- 214\n-216 inline friend std::size_t hash_value(const OverflowArray& v) noexcept {\n- 217 return hash_range(v.begin(), v.end());\n- 218 }\n- 219\n-221 friend std::ostream& operator<<(std::ostream& s, const OverflowArray& c) {\n- 222 for (const auto& ci : c)\n- 223 s << ci << \" \";\n- 224 return s;\n- 225 }\n- 226\n- 227private:\n- 228 OverflowBuffer overflow_;\n- 229 size_type size_ = 0;\n- 230};\n- 231\n- 232\n- 233\n- 234} // namespace Dune::Functions\n- 235\n- 236\n- 237\n- 238#endif // DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH\n-Dune::Functions\n-Definition: polynomial.hh:11\n-Dune::Functions::OverflowArray\n-A dynamically sized array-like class with overflow.\n-Definition: overflowarray.hh:45\n-Dune::Functions::OverflowArray::const_reference\n-const value_type & const_reference\n-Definition: overflowarray.hh:53\n-Dune::Functions::OverflowArray::reference\n-value_type & reference\n-Definition: overflowarray.hh:52\n-Dune::Functions::OverflowArray::end\n-const_iterator end() const\n-Returns a const_iterator pointing to the end of the OverflowArray.\n-Definition: overflowarray.hh:145\n-Dune::Functions::OverflowArray::operator==\n-bool operator==(const OverflowArray &other) const\n-Definition: overflowarray.hh:73\n-Dune::Functions::OverflowArray::hash_value\n-friend std::size_t hash_value(const OverflowArray &v) noexcept\n-Compute hash value.\n-Definition: overflowarray.hh:216\n-Dune::Functions::OverflowArray::push_back\n-void push_back(const value_type &t)\n-Appends an element to the end of the OverflowArray,.\n-Definition: overflowarray.hh:104\n-Dune::Functions::OverflowArray::operator<<\n-friend std::ostream & operator<<(std::ostream &s, const OverflowArray &c)\n-Write container to an output stream.\n-Definition: overflowarray.hh:221\n-Dune::Functions::OverflowArray::begin\n-iterator begin()\n-Returns a iterator pointing to the beginning of the OverflowArray.\n-Definition: overflowarray.hh:130\n-Dune::Functions::OverflowArray::empty\n-bool empty() const\n-Returns true if OverflowArray has no elements.\n-Definition: overflowarray.hh:201\n-Dune::Functions::OverflowArray::size\n-size_type size() const\n-Returns number of elements in the OverflowArray.\n-Definition: overflowarray.hh:196\n-Dune::Functions::OverflowArray::value_type\n-typename BaseArray::value_type value_type\n-Definition: overflowarray.hh:51\n-Dune::Functions::OverflowArray::pop_back\n-void pop_back()\n-Erases the last element of the OverflowArray, O(1) time.\n-Definition: overflowarray.hh:110\n-Dune::Functions::OverflowArray::iterator\n-Dune::GenericIterator< OverflowArray, value_type > iterator\n-Definition: overflowarray.hh:57\n-Dune::Functions::OverflowArray::begin\n-const_iterator begin() const\n-Returns a const_iterator pointing to the beginning of the OverflowArray.\n-Definition: overflowarray.hh:135\n-Dune::Functions::OverflowArray::difference_type\n-std::ptrdiff_t difference_type\n-Definition: overflowarray.hh:55\n-Dune::Functions::OverflowArray::OverflowArray\n-OverflowArray()=default\n-Dune::Functions::OverflowArray::BaseArray\n-BA BaseArray\n-Definition: overflowarray.hh:49\n-Dune::Functions::OverflowArray::capacity\n-static constexpr size_type capacity()\n-Returns the capacity of the OverflowArray.\n-Definition: overflowarray.hh:206\n-Dune::Functions::OverflowArray::max_size\n-static constexpr size_type max_size()\n-Returns the maximum length of the OverflowArray.\n-Definition: overflowarray.hh:211\n-Dune::Functions::OverflowArray::front\n-const_reference front() const\n-Returns const reference to first element of OverflowArray.\n-Definition: overflowarray.hh:178\n-Dune::Functions::OverflowArray::clear\n-void clear()\n-Erases all elements.\n-Definition: overflowarray.hh:83\n-Dune::Functions::OverflowArray::end\n-iterator end()\n-Returns an iterator pointing to the end of the OverflowArray.\n-Definition: overflowarray.hh:140\n-Dune::Functions::OverflowArray::size_type\n-std::size_t size_type\n-Definition: overflowarray.hh:56\n-Dune::Functions::OverflowArray::resize\n-void resize(size_type n)\n-Specifies a new size for the OverflowArray.\n-Definition: overflowarray.hh:93\n-Dune::Functions::OverflowArray::pointer\n-value_type * pointer\n-Definition: overflowarray.hh:54\n-Dune::Functions::OverflowArray::const_iterator\n-Dune::GenericIterator< const OverflowArray, const value_type > const_iterator\n-Definition: overflowarray.hh:58\n-Dune::Functions::OverflowArray::back\n-const_reference back() const\n-Returns const reference to last element of OverflowArray.\n-Definition: overflowarray.hh:190\n-Dune::Functions::OverflowArray::OverflowArray\n-OverflowArray(const std::initializer_list< value_type > &l)\n-Definition: overflowarray.hh:67\n-Dune::Functions::OverflowArray::back\n-reference back()\n-Returns reference to last element of OverflowArray.\n-Definition: overflowarray.hh:184\n-Dune::Functions::OverflowArray::push_front\n-void push_front(const value_type &t)\n-Inserts an element to the begin of the OverflowArray,.\n-Definition: overflowarray.hh:122\n-Dune::Functions::OverflowArray::front\n-reference front()\n-Returns reference to first element of OverflowArray.\n-Definition: overflowarray.hh:172\n-Dune::Functions::OverflowArray::operator[]\n-reference operator[](size_type i)\n-Returns reference to the i'th element.\n-Definition: overflowarray.hh:150\n+ 65\n+ 80template class DerivativeTraits,\n+size_t bufferSize>\n+81class DifferentiableFunction< Range(Domain), DerivativeTraits, bufferSize> :\n+ 82 public TypeErasureBase<\n+ 83 typename Imp::DifferentiableFunctionTraits::Concept,\n+ 84 Imp::DifferentiableFunctionTraits::template Model>\n+ 85{\n+ 86 using Traits = Imp::DifferentiableFunctionTraits;\n+ 87\n+ 88 using Base = TypeErasureBase;\n+ 89\n+ 90 using DerivativeInterface = typename Traits::DerivativeInterface;\n+ 91\n+ 92public:\n+ 93\n+ 105 template = 0 >\n+106 DifferentiableFunction(F&& f) :\n+ 107 Base(std::forward(f))\n+ 108 {\n+ 109 static_assert(Dune::Functions::Concept::isFunction(),\n+\"Trying to construct a DifferentiableFunction from type that does not model the\n+Function concept\");\n+ 110 }\n+ 111\n+113 DifferentiableFunction() = default;\n+ 114\n+118 Range operator() (const Domain& x) const\n+ 119 {\n+ 120 return this->asInterface().operator()(x);\n+ 121 }\n+ 122\n+130 friend DerivativeInterface derivative(const DifferentiableFunction& t)\n+ 131 {\n+ 132 return t.asInterface().derivative();\n+ 133 }\n+ 134};\n+ 135\n+ 136\n+ 137\n+ 138}} // namespace Dune::Functions\n+ 139\n+ 140\n+ 141\n+ 142#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH\n+functionconcepts.hh\n+signature.hh\n+differentiablefunction_imp.hh\n+typeerasure.hh\n+defaultderivativetraits.hh\n+type_traits.hh\n+Dune::Functions::DifferentiableFunction<_Range(Domain),_DerivativeTraits,\n+bufferSize_>::derivative\n+friend DerivativeInterface derivative(const DifferentiableFunction &t)\n+Get derivative of wrapped function.\n+Definition: differentiablefunction.hh:130\n+Dune\n+Definition: polynomial.hh:10\n+Dune::Functions::DifferentiableFunction\n+Definition: differentiablefunction.hh:29\n+Dune::Functions::DifferentiableFunction<_Range(Domain),_DerivativeTraits,\n+bufferSize_>::DifferentiableFunction\n+DifferentiableFunction(F &&f)\n+Construct from function.\n+Definition: differentiablefunction.hh:106\n+Dune::Functions::DifferentiableFunction<_Range(Domain),_DerivativeTraits,\n+bufferSize_>::DifferentiableFunction\n+DifferentiableFunction()=default\n+Default constructor.\n+Dune::Functions::SignatureTraits\n+Helper class to deduce the signature of a callable.\n+Definition: signature.hh:56\n+Dune::Functions::TypeErasureBase\n+Base class for type-erased interface wrapper.\n+Definition: typeerasure.hh:165\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00041.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00041.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: functionfromcallable.hh File Reference\n+dune-functions: treedata.hh File Reference\n \n \n \n \n \n \n \n@@ -65,26 +65,38 @@\n
  • dune
  • functions
  • common
  • \n \n \n
    \n \n-
    functionfromcallable.hh File Reference
    \n+
    treedata.hh File Reference
    \n
    \n
    \n-
    #include <dune/common/function.hh>
    \n-#include <dune/functions/common/signature.hh>
    \n+
    #include <memory>
    \n+#include <dune/common/shared_ptr.hh>
    \n+#include <dune/typetree/pairtraversal.hh>
    \n+#include <dune/functions/gridfunctions/gridviewentityset.hh>
    \n+#include <dune/functions/gridfunctions/gridfunction.hh>
    \n
    \n

    Go to the source code of this file.

    \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
    \n \n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n

    \n Classes

    class  Dune::Functions::FunctionFromCallable< Range(Domain), F, FunctionInterface >
     Wrap a callable object as Dune::Function or Dune::VirtualFunction. More...
    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
     
    \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,23 +6,34 @@\n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n Classes | Namespaces\n-functionfromcallable.hh File Reference\n-#include \n-#include \n+treedata.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::FunctionFromCallable<_Range(Domain),_F,\n- FunctionInterface_>\n-\u00a0 Wrap a callable object as Dune::Function or Dune::VirtualFunction.\n- More...\n+struct \u00a0Dune::Functions::UniformNodeVisitor<_SimpleNodeVisitorImp,_leafOnly_>\n+\u00a0 Mixin for visitors that should apply the same action on all nodes.\n+ More...\n+\u00a0\n+ class \u00a0Dune::Functions::TreeData<_T,_ND,_LO_>\n+\u00a0 Container allowing to attach data to each node of a tree. More...\n+\u00a0\n+struct \u00a0Dune::Functions::TreeData<_T,_ND,_LO_>::InitVisitor\n+\u00a0\n+struct \u00a0Dune::Functions::TreeData<_T,_ND,_LO_>::DestroyVisitor\n+\u00a0\n+struct \u00a0Dune::Functions::TreeData<_T,_ND,_LO_>::CopyVisitor\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n \n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00041_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00041_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: functionfromcallable.hh Source File\n+dune-functions: treedata.hh Source File\n \n \n \n \n \n \n \n@@ -62,73 +62,256 @@\n \n \n \n
    \n-
    functionfromcallable.hh
    \n+
    treedata.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_COMMON_FUNCTION_FROM_CALLABLE_HH
    \n-
    4#define DUNE_FUNCTIONS_COMMON_FUNCTION_FROM_CALLABLE_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_COMMON_TREEDATA_HH
    \n+
    4#define DUNE_FUNCTIONS_COMMON_TREEDATA_HH
    \n
    5
    \n-
    6#include <dune/common/function.hh>
    \n-
    7
    \n-\n-
    9
    \n+
    6
    \n+
    7#warning This file is deprecated. Please use TreeContainer from dune-typetree instead.
    \n+
    8
    \n+
    9#include <memory>
    \n
    10
    \n-
    11namespace Dune {
    \n-
    12namespace Functions {
    \n-
    13
    \n+
    11#include <dune/common/shared_ptr.hh>
    \n+
    12
    \n+
    13#include <dune/typetree/pairtraversal.hh>
    \n
    14
    \n-
    15
    \n-
    16template<class Signature, class F,
    \n-
    17 class FunctionInterface = typename Dune::VirtualFunction<
    \n-
    18 typename SignatureTraits<Signature>::RawDomain,
    \n-
    19 typename SignatureTraits<Signature>::RawRange> >
    \n-\n-
    21
    \n-
    37template<class Range, class Domain, class F, class FunctionInterface>
    \n-
    38class FunctionFromCallable<Range(Domain), F, FunctionInterface> :
    \n-
    39 public FunctionInterface
    \n+\n+\n+
    17
    \n+
    18namespace Dune {
    \n+
    19namespace Functions {
    \n+
    20
    \n+
    34template<class SimpleNodeVisitorImp, bool leafOnly>
    \n+
    35struct
    \n+
    36[[deprecated("This is an implementation detail of the deprecated class TreeDate and thus deprecated itself.")]]
    \n+\n+
    38 public TypeTree::TreeVisitor,
    \n+
    39 public TypeTree::DynamicTraversal
    \n
    40{
    \n-
    41public:
    \n-
    42
    \n-\n-
    53 f_(f)
    \n-
    54 {}
    \n+
    41 // This is only enabled, if we want to incorporate inner nodes.
    \n+
    42 // Checking leafOnly would be sufficient, but for SFINAE the
    \n+
    43 // the enable_if condition must depend on the template parameter.
    \n+
    44 template<typename Node, typename TreePath,
    \n+
    45 typename std::enable_if<(not leafOnly) and (not Node::isLeaf), int>::type = 0>
    \n+
    46 void pre(Node& node, TreePath treePath)
    \n+
    47 {
    \n+
    48 static_cast<SimpleNodeVisitorImp*>(this)->apply(node, treePath);
    \n+
    49 }
    \n+
    50
    \n+
    51 template<typename Node, typename TreePath,
    \n+
    52 typename std::enable_if<(leafOnly) and (not Node::isLeaf), int>::type = 0>
    \n+
    53 void pre(Node& node, TreePath treePath)
    \n+
    54 {}
    \n
    55
    \n-\n-
    65 f_(f)
    \n-
    66 {}
    \n-
    67
    \n-
    73 void evaluate(const Domain& x, Range&y) const
    \n-
    74 {
    \n-
    75 y = f_(x);
    \n-
    76 }
    \n-
    77
    \n-
    78private:
    \n-
    79 F f_;
    \n-
    80};
    \n-
    81
    \n-
    82
    \n-
    83
    \n-
    84} // namespace Functions
    \n-
    85} // namespace Dune
    \n-
    86
    \n-
    87#endif //DUNE_FUNCTIONS_COMMON_FUNCTION_FROM_CALLABLE_HH
    \n-\n+
    56 template<typename Node, typename TreePath>
    \n+
    57 void leaf(Node& node, TreePath treePath)
    \n+
    58 {
    \n+
    59 static_cast<SimpleNodeVisitorImp*>(this)->apply(node, treePath);
    \n+
    60 }
    \n+
    61};
    \n+
    62
    \n+
    63
    \n+
    64
    \n+
    91template<class T, template<class> class ND, bool LO>
    \n+
    92class
    \n+
    93[[deprecated("This class is deprecated. Please use TreeContainer from dune-typetree instead.")]]
    \n+\n+
    95{
    \n+
    96
    \n+
    97public:
    \n+
    98
    \n+
    100 using Tree = T;
    \n+
    101
    \n+
    103 using size_type = typename Tree::size_type;
    \n+
    104
    \n+
    106 static const bool leafOnly = LO;
    \n+
    107
    \n+
    109 template<class Node>
    \n+
    110 using NodeData = ND<Node>;
    \n+
    111
    \n+
    112protected:
    \n+
    113 using RawContainer = std::vector<void*>;
    \n+
    114
    \n+
    115
    \n+
    116 // Since we can generate the node data type only if
    \n+
    117 // we know the type of the node, we have to do
    \n+
    118 // initialization, copy, and destruction via a
    \n+
    119 // tree traversal. Once we can use C++14 this can
    \n+
    120 // be written in a much easier and more selfcontained
    \n+
    121 // ways using generic lambda functions.
    \n+
    122 // Until then we need explicit visitor classes for
    \n+
    123 // each operation.
    \n+
    124
    \n+
    125 struct InitVisitor :
    \n+
    126 public UniformNodeVisitor<InitVisitor, leafOnly>
    \n+
    127 {
    \n+\n+
    129 data_(data)
    \n+
    130 {}
    \n+
    131
    \n+
    132 template<typename Node, typename TreePath>
    \n+
    133 void apply(Node& node, TreePath treePath)
    \n+
    134 {
    \n+
    135 auto&& index = node.treeIndex();
    \n+
    136 if (data_.size() < index+1)
    \n+
    137 data_.resize(index+1, nullptr);
    \n+
    138 data_[index] = new NodeData<Node>;
    \n+
    139 }
    \n+
    140
    \n+
    141
    \n+\n+
    143 };
    \n+
    144
    \n+\n+
    146 public UniformNodeVisitor<DestroyVisitor, leafOnly>
    \n+
    147 {
    \n+\n+
    149 data_(data)
    \n+
    150 {}
    \n+
    151
    \n+
    152 template<typename Node, typename TreePath>
    \n+
    153 void apply(Node& node, TreePath treePath)
    \n+
    154 {
    \n+
    155 auto&& index = node.treeIndex();
    \n+
    156 auto p = (NodeData<Node>*)(data_[index]);
    \n+
    157 delete p;
    \n+
    158 data_[index] = nullptr;
    \n+
    159 }
    \n+
    160
    \n+\n+
    162 };
    \n+
    163
    \n+
    164 struct CopyVisitor :
    \n+
    165 public UniformNodeVisitor<CopyVisitor, leafOnly>
    \n+
    166 {
    \n+
    167 CopyVisitor(TreeData& thisTD, const TreeData& otherTD) :
    \n+
    168 thisTD_(thisTD),
    \n+
    169 otherTD_(otherTD)
    \n+
    170 {}
    \n+
    171
    \n+
    172 template<typename Node, typename TreePath>
    \n+
    173 void apply(Node& node, TreePath treePath)
    \n+
    174 {
    \n+
    175 thisTD_[node] = otherTD_[node];
    \n+
    176 }
    \n+
    177
    \n+\n+\n+
    180 };
    \n+
    181
    \n+
    182public:
    \n+
    183
    \n+\n+
    186 tree_(nullptr)
    \n+
    187 {}
    \n+
    188
    \n+
    196 void init(const Tree& tree)
    \n+
    197 {
    \n+
    198 if (tree_)
    \n+
    199 destroy();
    \n+
    200 tree_ = &tree;
    \n+
    201 TypeTree::applyToTree(*tree_, InitVisitor(data_));
    \n+
    202 }
    \n+
    203
    \n+
    205 TreeData(const TreeData& other) :
    \n+
    206 tree_(other.tree_)
    \n+
    207 {
    \n+
    208 TypeTree::applyToTree(*tree_, InitVisitor(data_));
    \n+
    209 TypeTree::applyToTree(*tree_, CopyVisitor(*this, other));
    \n+
    210 }
    \n+
    211
    \n+\n+
    214 {
    \n+
    215 if (tree_)
    \n+
    216 TypeTree::applyToTree(*tree_, DestroyVisitor(data_));
    \n+
    217 tree_ = other.tree_;
    \n+
    218 TypeTree::applyToTree(*tree_, CopyVisitor(*this, other));
    \n+
    219 return *this;
    \n+
    220 }
    \n+
    221
    \n+
    223 void destroy()
    \n+
    224 {
    \n+
    225 if (tree_)
    \n+
    226 TypeTree::applyToTree(*tree_, DestroyVisitor(data_));
    \n+
    227 tree_ = nullptr;
    \n+
    228 }
    \n+
    229
    \n+\n+
    232 {
    \n+
    233 if (tree_)
    \n+
    234 TypeTree::applyToTree(*tree_, DestroyVisitor(data_));
    \n+
    235 }
    \n+
    236
    \n+
    238 template<class Node>
    \n+
    239 NodeData<Node>& operator[](const Node& node)
    \n+
    240 {
    \n+
    241 return *(NodeData<Node>*)(data_[node.treeIndex()]);
    \n+
    242 }
    \n+
    243
    \n+
    245 template<class Node>
    \n+
    246 const NodeData<Node>& operator[](const Node& node) const
    \n+
    247 {
    \n+
    248 return *(NodeData<Node>*)(data_[node.treeIndex()]);
    \n+
    249 }
    \n+
    250
    \n+
    251protected:
    \n+
    252
    \n+
    253 const Tree* tree_;
    \n+\n+
    255};
    \n+
    256
    \n+
    257
    \n+
    258
    \n+
    259} // namespace Functions
    \n+
    260} // namespace Dune
    \n+
    261
    \n+
    262#endif // DUNE_FUNCTIONS_COMMON_TREEDATA_HH
    \n+\n+\n
    Definition: polynomial.hh:10
    \n-
    Definition: functionfromcallable.hh:20
    \n-
    FunctionFromCallable(F &&f)
    Create VirtualFunction from callable object.
    Definition: functionfromcallable.hh:52
    \n-
    void evaluate(const Domain &x, Range &y) const
    Evaluate function.
    Definition: functionfromcallable.hh:73
    \n-
    FunctionFromCallable(const F &f)
    Create VirtualFunction from callable object.
    Definition: functionfromcallable.hh:64
    \n+
    Mixin for visitors that should apply the same action on all nodes.
    Definition: treedata.hh:40
    \n+
    void pre(Node &node, TreePath treePath)
    Definition: treedata.hh:46
    \n+
    void leaf(Node &node, TreePath treePath)
    Definition: treedata.hh:57
    \n+
    Container allowing to attach data to each node of a tree.
    Definition: treedata.hh:95
    \n+
    TreeData(const TreeData &other)
    Copy constructor.
    Definition: treedata.hh:205
    \n+
    void init(const Tree &tree)
    Initialize from tree.
    Definition: treedata.hh:196
    \n+
    T Tree
    Type of tree the data is associated with.
    Definition: treedata.hh:100
    \n+
    const Tree * tree_
    Definition: treedata.hh:253
    \n+
    void destroy()
    Destroy data.
    Definition: treedata.hh:223
    \n+
    const NodeData< Node > & operator[](const Node &node) const
    Get reference to data associated to given node.
    Definition: treedata.hh:246
    \n+
    TreeData & operator=(const TreeData &other)
    Copy assignment.
    Definition: treedata.hh:213
    \n+
    ~TreeData()
    Destructor.
    Definition: treedata.hh:231
    \n+
    ND< Node > NodeData
    Template to determine the data type for given node type.
    Definition: treedata.hh:110
    \n+
    TreeData()
    Default constructor.
    Definition: treedata.hh:185
    \n+
    std::vector< void * > RawContainer
    Definition: treedata.hh:113
    \n+
    NodeData< Node > & operator[](const Node &node)
    Get mutable reference to data associated to given node.
    Definition: treedata.hh:239
    \n+
    typename Tree::size_type size_type
    Type used for indices and size information.
    Definition: treedata.hh:103
    \n+
    RawContainer data_
    Definition: treedata.hh:254
    \n+
    Definition: treedata.hh:127
    \n+
    InitVisitor(RawContainer &data)
    Definition: treedata.hh:128
    \n+
    void apply(Node &node, TreePath treePath)
    Definition: treedata.hh:133
    \n+
    RawContainer & data_
    Definition: treedata.hh:142
    \n+\n+
    RawContainer & data_
    Definition: treedata.hh:161
    \n+
    DestroyVisitor(RawContainer &data)
    Definition: treedata.hh:148
    \n+
    void apply(Node &node, TreePath treePath)
    Definition: treedata.hh:153
    \n+
    Definition: treedata.hh:166
    \n+
    CopyVisitor(TreeData &thisTD, const TreeData &otherTD)
    Definition: treedata.hh:167
    \n+
    void apply(Node &node, TreePath treePath)
    Definition: treedata.hh:173
    \n+
    TreeData & thisTD_
    Definition: treedata.hh:178
    \n+
    const TreeData & otherTD_
    Definition: treedata.hh:179
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,82 +5,326 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-functionfromcallable.hh\n+treedata.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_COMMON_FUNCTION_FROM_CALLABLE_HH\n- 4#define DUNE_FUNCTIONS_COMMON_FUNCTION_FROM_CALLABLE_HH\n+ 3#ifndef DUNE_FUNCTIONS_COMMON_TREEDATA_HH\n+ 4#define DUNE_FUNCTIONS_COMMON_TREEDATA_HH\n 5\n- 6#include \n- 7\n- 8#include \n- 9\n+ 6\n+ 7#warning This file is deprecated. Please use TreeContainer from dune-typetree\n+instead.\n+ 8\n+ 9#include \n 10\n- 11namespace Dune {\n- 12namespace Functions {\n- 13\n+ 11#include \n+ 12\n+ 13#include \n 14\n- 15\n- 16template::RawDomain,\n- 19 typename SignatureTraits::RawRange> >\n-20class FunctionFromCallable;\n- 21\n- 37template\n-38class FunctionFromCallable :\n- 39 public FunctionInterface\n+ 15#include \n+ 16#include \n+ 17\n+ 18namespace Dune {\n+ 19namespace Functions {\n+ 20\n+ 34template\n+35struct\n+ 36[[deprecated(\"This is an implementation detail of the deprecated class\n+TreeDate and thus deprecated itself.\")]]\n+ 37UniformNodeVisitor :\n+ 38 public TypeTree::TreeVisitor,\n+ 39 public TypeTree::DynamicTraversal\n 40{\n- 41public:\n- 42\n-52 FunctionFromCallable(F&& f) :\n- 53 f_(f)\n+ 41 // This is only enabled, if we want to incorporate inner nodes.\n+ 42 // Checking leafOnly would be sufficient, but for SFINAE the\n+ 43 // the enable_if condition must depend on the template parameter.\n+ 44 template::type =\n+0>\n+46 void pre(Node& node, TreePath treePath)\n+ 47 {\n+ 48 static_cast(this)->apply(node, treePath);\n+ 49 }\n+ 50\n+ 51 template::type = 0>\n+53 void pre(Node& node, TreePath treePath)\n 54 {}\n 55\n-64 FunctionFromCallable(const F& f) :\n- 65 f_(f)\n- 66 {}\n- 67\n-73 void evaluate(const Domain& x, Range&y) const\n- 74 {\n- 75 y = f_(x);\n- 76 }\n- 77\n- 78private:\n- 79 F f_;\n- 80};\n- 81\n- 82\n- 83\n- 84} // namespace Functions\n- 85} // namespace Dune\n- 86\n- 87#endif //DUNE_FUNCTIONS_COMMON_FUNCTION_FROM_CALLABLE_HH\n-signature.hh\n+ 56 template\n+57 void leaf(Node& node, TreePath treePath)\n+ 58 {\n+ 59 static_cast(this)->apply(node, treePath);\n+ 60 }\n+ 61};\n+ 62\n+ 63\n+ 64\n+ 91template class ND, bool LO>\n+92class\n+ 93[[deprecated(\"This class is deprecated. Please use TreeContainer from dune-\n+typetree instead.\")]]\n+ 94TreeData\n+ 95{\n+ 96\n+ 97public:\n+ 98\n+100 using Tree = T;\n+ 101\n+103 using size_type = typename Tree::size_type;\n+ 104\n+106 static const bool leafOnly = LO;\n+ 107\n+ 109 template\n+110 using NodeData = ND;\n+ 111\n+ 112protected:\n+113 using RawContainer = std::vector;\n+ 114\n+ 115\n+ 116 // Since we can generate the node data type only if\n+ 117 // we know the type of the node, we have to do\n+ 118 // initialization, copy, and destruction via a\n+ 119 // tree traversal. Once we can use C++14 this can\n+ 120 // be written in a much easier and more selfcontained\n+ 121 // ways using generic lambda functions.\n+ 122 // Until then we need explicit visitor classes for\n+ 123 // each operation.\n+ 124\n+125 struct InitVisitor :\n+ 126 public UniformNodeVisitor\n+ 127 {\n+128 InitVisitor(RawContainer& data) :\n+ 129 data_(data)\n+ 130 {}\n+ 131\n+ 132 template\n+133 void apply(Node& node, TreePath treePath)\n+ 134 {\n+ 135 auto&& index = node.treeIndex();\n+ 136 if (data_.size() < index+1)\n+ 137 data_.resize(index+1, nullptr);\n+ 138 data_[index] = new NodeData;\n+ 139 }\n+ 140\n+ 141\n+142 RawContainer& data_;\n+ 143 };\n+ 144\n+145 struct DestroyVisitor :\n+ 146 public UniformNodeVisitor\n+ 147 {\n+148 DestroyVisitor(RawContainer& data) :\n+ 149 data_(data)\n+ 150 {}\n+ 151\n+ 152 template\n+153 void apply(Node& node, TreePath treePath)\n+ 154 {\n+ 155 auto&& index = node.treeIndex();\n+ 156 auto p = (NodeData*)(data_[index]);\n+ 157 delete p;\n+ 158 data_[index] = nullptr;\n+ 159 }\n+ 160\n+161 RawContainer& data_;\n+ 162 };\n+ 163\n+164 struct CopyVisitor :\n+ 165 public UniformNodeVisitor\n+ 166 {\n+167 CopyVisitor(TreeData& thisTD, const TreeData& otherTD) :\n+ 168 thisTD_(thisTD),\n+ 169 otherTD_(otherTD)\n+ 170 {}\n+ 171\n+ 172 template\n+173 void apply(Node& node, TreePath treePath)\n+ 174 {\n+ 175 thisTD_[node] = otherTD_[node];\n+ 176 }\n+ 177\n+178 TreeData& thisTD_;\n+179 const TreeData& otherTD_;\n+ 180 };\n+ 181\n+ 182public:\n+ 183\n+185 TreeData() :\n+ 186 tree_(nullptr)\n+ 187 {}\n+ 188\n+196 void init(const Tree& tree)\n+ 197 {\n+ 198 if (tree_)\n+ 199 destroy();\n+ 200 tree_ = &tree;\n+ 201 TypeTree::applyToTree(*tree_, InitVisitor(data_));\n+ 202 }\n+ 203\n+205 TreeData(const TreeData& other) :\n+ 206 tree_(other.tree_)\n+ 207 {\n+ 208 TypeTree::applyToTree(*tree_, InitVisitor(data_));\n+ 209 TypeTree::applyToTree(*tree_, CopyVisitor(*this, other));\n+ 210 }\n+ 211\n+213 TreeData& operator=(const TreeData& other)\n+ 214 {\n+ 215 if (tree_)\n+ 216 TypeTree::applyToTree(*tree_, DestroyVisitor(data_));\n+ 217 tree_ = other.tree_;\n+ 218 TypeTree::applyToTree(*tree_, CopyVisitor(*this, other));\n+ 219 return *this;\n+ 220 }\n+ 221\n+223 void destroy()\n+ 224 {\n+ 225 if (tree_)\n+ 226 TypeTree::applyToTree(*tree_, DestroyVisitor(data_));\n+ 227 tree_ = nullptr;\n+ 228 }\n+ 229\n+231 ~TreeData()\n+ 232 {\n+ 233 if (tree_)\n+ 234 TypeTree::applyToTree(*tree_, DestroyVisitor(data_));\n+ 235 }\n+ 236\n+ 238 template\n+239 NodeData& operator[](const Node& node)\n+ 240 {\n+ 241 return *(NodeData*)(data_[node.treeIndex()]);\n+ 242 }\n+ 243\n+ 245 template\n+246 const NodeData& operator[](const Node& node) const\n+ 247 {\n+ 248 return *(NodeData*)(data_[node.treeIndex()]);\n+ 249 }\n+ 250\n+ 251protected:\n+ 252\n+253 const Tree* tree_;\n+254 RawContainer data_;\n+ 255};\n+ 256\n+ 257\n+ 258\n+ 259} // namespace Functions\n+ 260} // namespace Dune\n+ 261\n+ 262#endif // DUNE_FUNCTIONS_COMMON_TREEDATA_HH\n+gridfunction.hh\n+gridviewentityset.hh\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::FunctionFromCallable\n-Definition: functionfromcallable.hh:20\n-Dune::Functions::FunctionFromCallable<_Range(Domain),_F,_FunctionInterface_>::\n-FunctionFromCallable\n-FunctionFromCallable(F &&f)\n-Create VirtualFunction from callable object.\n-Definition: functionfromcallable.hh:52\n-Dune::Functions::FunctionFromCallable<_Range(Domain),_F,_FunctionInterface_>::\n-evaluate\n-void evaluate(const Domain &x, Range &y) const\n-Evaluate function.\n-Definition: functionfromcallable.hh:73\n-Dune::Functions::FunctionFromCallable<_Range(Domain),_F,_FunctionInterface_>::\n-FunctionFromCallable\n-FunctionFromCallable(const F &f)\n-Create VirtualFunction from callable object.\n-Definition: functionfromcallable.hh:64\n+Dune::Functions::UniformNodeVisitor\n+Mixin for visitors that should apply the same action on all nodes.\n+Definition: treedata.hh:40\n+Dune::Functions::UniformNodeVisitor::pre\n+void pre(Node &node, TreePath treePath)\n+Definition: treedata.hh:46\n+Dune::Functions::UniformNodeVisitor::leaf\n+void leaf(Node &node, TreePath treePath)\n+Definition: treedata.hh:57\n+Dune::Functions::TreeData\n+Container allowing to attach data to each node of a tree.\n+Definition: treedata.hh:95\n+Dune::Functions::TreeData::TreeData\n+TreeData(const TreeData &other)\n+Copy constructor.\n+Definition: treedata.hh:205\n+Dune::Functions::TreeData::init\n+void init(const Tree &tree)\n+Initialize from tree.\n+Definition: treedata.hh:196\n+Dune::Functions::TreeData::Tree\n+T Tree\n+Type of tree the data is associated with.\n+Definition: treedata.hh:100\n+Dune::Functions::TreeData::tree_\n+const Tree * tree_\n+Definition: treedata.hh:253\n+Dune::Functions::TreeData::destroy\n+void destroy()\n+Destroy data.\n+Definition: treedata.hh:223\n+Dune::Functions::TreeData::operator[]\n+const NodeData< Node > & operator[](const Node &node) const\n+Get reference to data associated to given node.\n+Definition: treedata.hh:246\n+Dune::Functions::TreeData::operator=\n+TreeData & operator=(const TreeData &other)\n+Copy assignment.\n+Definition: treedata.hh:213\n+Dune::Functions::TreeData::~TreeData\n+~TreeData()\n+Destructor.\n+Definition: treedata.hh:231\n+Dune::Functions::TreeData::NodeData\n+ND< Node > NodeData\n+Template to determine the data type for given node type.\n+Definition: treedata.hh:110\n+Dune::Functions::TreeData::TreeData\n+TreeData()\n+Default constructor.\n+Definition: treedata.hh:185\n+Dune::Functions::TreeData::RawContainer\n+std::vector< void * > RawContainer\n+Definition: treedata.hh:113\n+Dune::Functions::TreeData::operator[]\n+NodeData< Node > & operator[](const Node &node)\n+Get mutable reference to data associated to given node.\n+Definition: treedata.hh:239\n+Dune::Functions::TreeData::size_type\n+typename Tree::size_type size_type\n+Type used for indices and size information.\n+Definition: treedata.hh:103\n+Dune::Functions::TreeData::data_\n+RawContainer data_\n+Definition: treedata.hh:254\n+Dune::Functions::TreeData::InitVisitor\n+Definition: treedata.hh:127\n+Dune::Functions::TreeData::InitVisitor::InitVisitor\n+InitVisitor(RawContainer &data)\n+Definition: treedata.hh:128\n+Dune::Functions::TreeData::InitVisitor::apply\n+void apply(Node &node, TreePath treePath)\n+Definition: treedata.hh:133\n+Dune::Functions::TreeData::InitVisitor::data_\n+RawContainer & data_\n+Definition: treedata.hh:142\n+Dune::Functions::TreeData::DestroyVisitor\n+Definition: treedata.hh:147\n+Dune::Functions::TreeData::DestroyVisitor::data_\n+RawContainer & data_\n+Definition: treedata.hh:161\n+Dune::Functions::TreeData::DestroyVisitor::DestroyVisitor\n+DestroyVisitor(RawContainer &data)\n+Definition: treedata.hh:148\n+Dune::Functions::TreeData::DestroyVisitor::apply\n+void apply(Node &node, TreePath treePath)\n+Definition: treedata.hh:153\n+Dune::Functions::TreeData::CopyVisitor\n+Definition: treedata.hh:166\n+Dune::Functions::TreeData::CopyVisitor::CopyVisitor\n+CopyVisitor(TreeData &thisTD, const TreeData &otherTD)\n+Definition: treedata.hh:167\n+Dune::Functions::TreeData::CopyVisitor::apply\n+void apply(Node &node, TreePath treePath)\n+Definition: treedata.hh:173\n+Dune::Functions::TreeData::CopyVisitor::thisTD_\n+TreeData & thisTD_\n+Definition: treedata.hh:178\n+Dune::Functions::TreeData::CopyVisitor::otherTD_\n+const TreeData & otherTD_\n+Definition: treedata.hh:179\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00044.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00044.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: utility.hh File Reference\n+dune-functions: type_traits.hh File Reference\n \n \n \n \n \n \n \n@@ -65,90 +65,45 @@\n
  • dune
  • functions
  • common
  • \n \n \n
    \n \n-
    utility.hh File Reference
    \n+Typedefs
    \n+
    type_traits.hh File Reference
    \n \n
    \n-
    #include <utility>
    \n-#include <type_traits>
    \n-#include <dune/common/overloadset.hh>
    \n-#include <dune/common/indices.hh>
    \n-#include <dune/functions/common/functionconcepts.hh>
    \n+
    #include <type_traits>
    \n+#include <dune/common/typeutilities.hh>
    \n
    \n

    Go to the source code of this file.

    \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
    \n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n

    \n Classes

    struct  Dune::Functions::LastType< T >
     Get last entry of type list. More...
    struct  Dune::Functions::HasStaticSize< T >
     Check if type is a statically sized container. More...
     
    struct  Dune::Functions::RotateTuple< T >
     Rotate type list by one, such that last entry is moved to first position. More...
    struct  Dune::Functions::StaticSize< T >
     Obtain size of statically sized container. More...
     
    \n \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-

    \n Typedefs

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

    \n-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. More...
     
    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. More...
     
    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. More...
     
    template<class Expression >
    auto Dune::Functions::callableCheck (Expression f)
     Create a predicate for checking validity of expressions. More...
     
    template<class Check >
    auto Dune::Functions::negatePredicate (Check check)
     Negate given predicate. More...
     
    template<class T >
    auto Dune::Functions::forwardCapture (T &&t)
     Create a capture object for perfect forwarding. More...
     
    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. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,94 +5,33 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-Classes | Namespaces | Typedefs | Functions\n-utility.hh File Reference\n-#include \n+Classes | Namespaces | Typedefs\n+type_traits.hh File Reference\n #include \n-#include \n-#include \n-#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0Dune::Functions::LastType<_T_>\n-\u00a0 Get last entry of type list. More...\n+struct \u00a0Dune::Functions::HasStaticSize<_T_>\n+\u00a0 Check if type is a statically sized container. More...\n \u00a0\n-struct \u00a0Dune::Functions::RotateTuple<_T_>\n-\u00a0 Rotate type list by one, such that last entry is moved to first\n- position. More...\n+struct \u00a0Dune::Functions::StaticSize<_T_>\n+\u00a0 Obtain size of statically sized container. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n Typedefs\n-template class T, class ArgTuple >\n-using\u00a0Dune::Functions::ExpandTuple = typename Imp::ExpandTupleHelper< T,\n- ArgTuple >::Type\n-\u00a0 Expand tuple arguments as template arguments. More...\n-\u00a0\n-template class F, class... Tuples>\n-using\u00a0Dune::Functions::TransformTuple = typename Imp::TransformTupleHelper< F,\n- Tuples... >::Type\n-\u00a0 Transform tuple types argument using type-functor. More...\n-\u00a0\n-template\n-using\u00a0Dune::Functions::IntegerSequenceTuple = typename Imp::\n- IntegerSequenceTupleHelper< IntegerSequence >::Type\n-\u00a0 Transform integer_sequence to tuple...>\n- More...\n-\u00a0\n- Functions\n-template\n-auto\u00a0Dune::Functions::forwardAsStaticInteger (std::integer_sequence<\n- size_type, firstValue > values, const size_type &i, F &&f, Args &&...\n- args) -> decltype(f(std::integral_constant< size_type, firstValue >(),\n- std::forward< Args >(args)...))\n-\u00a0\n-template\n-auto\u00a0Dune::Functions::forwardAsStaticInteger (std::integer_sequence<\n- size_type, firstValue, secondValue, otherValues... > values, const\n- size_type i, F &&f, Args &&... args) -> decltype(f(std::\n- integral_constant< size_type, firstValue >(), std::forward< Args >\n- (args)...))\n-\u00a0\n-template\n-auto\u00a0Dune::Functions::forwardAsStaticIndex (const size_type &i, F &&f, Args\n- &&... args) -> decltype(f(Dune::Indices::_0, std::forward< Args >\n- (args)...))\n-\u00a0 Transform dynamic index to static index_constant. More...\n-\u00a0\n-template\n-auto\u00a0Dune::Functions::transformTuple (F &&f, const std::tuple< T... > &tuple)\n- -> decltype(Imp::transformTupleHelper(std::forward< F >(f), tuple, std::\n- index_sequence_for< T... >{}))\n-\u00a0 Transform tuple value using a functor. More...\n-\u00a0\n-template\n-auto\u00a0Dune::Functions::transformTuple (F &&f, const std::tuple< T1... >\n- &tuple1, const std::tuple< T2... > &tuple2) -> decltype(Imp::\n- transformTupleHelper(std::forward< F >(f), tuple1, tuple2, std::\n- index_sequence_for< T1... >{}))\n-\u00a0 Transform tuple value using a binary functor. More...\n-\u00a0\n-template\n-auto\u00a0Dune::Functions::callableCheck (Expression f)\n-\u00a0 Create a predicate for checking validity of expressions. More...\n-\u00a0\n-template\n-auto\u00a0Dune::Functions::negatePredicate (Check check)\n-\u00a0 Negate given predicate. More...\n-\u00a0\n-template\n-auto\u00a0Dune::Functions::forwardCapture (T &&t)\n-\u00a0 Create a capture object for perfect forwarding. More...\n+template\n+using\u00a0Dune::Functions::enableIfConstructible = typename std::enable_if< std::\n+ is_constructible< T, Args... >::value, int >::type\n+\u00a0 Helper to constrain forwarding constructors. More...\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00044_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00044_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: utility.hh Source File\n+dune-functions: type_traits.hh Source File\n \n \n \n \n \n \n \n@@ -62,284 +62,100 @@\n \n \n
    \n
    \n-
    utility.hh
    \n+
    type_traits.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_COMMON_UTILITY_HH
    \n-
    4#define DUNE_FUNCTIONS_COMMON_UTILITY_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH
    \n+
    4#define DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH
    \n
    5
    \n-
    6
    \n-
    7#include <utility>
    \n-
    8#include <type_traits>
    \n+
    6#include <type_traits>
    \n+
    7
    \n+
    8#include <dune/common/typeutilities.hh>
    \n
    9
    \n-
    10#include <dune/common/overloadset.hh>
    \n-
    11#include <dune/common/indices.hh>
    \n+
    10namespace Dune {
    \n+
    11namespace Functions {
    \n
    12
    \n-\n-
    14
    \n-
    15namespace Dune {
    \n-
    16namespace Functions {
    \n-
    17
    \n-
    18
    \n-
    19
    \n-
    20template<class F, class size_type, size_type firstValue, class... Args>
    \n-
    21auto forwardAsStaticInteger(std::integer_sequence<size_type, firstValue> values, const size_type& i, F&& f, Args&&... args)
    \n-
    22 ->decltype(f(std::integral_constant<size_type, firstValue>(), std::forward<Args>(args)...))
    \n-
    23{
    \n-
    24 return f(std::integral_constant<size_type, firstValue>(), std::forward<Args>(args)...);
    \n-
    25}
    \n-
    26
    \n-
    27template<class F, class size_type, size_type firstValue, size_type secondValue, size_type... otherValues, class... Args>
    \n-
    28auto forwardAsStaticInteger(std::integer_sequence<size_type, firstValue, secondValue, otherValues...> values, const size_type i, F&& f, Args&&... args)
    \n-
    29 ->decltype(f(std::integral_constant<size_type, firstValue>(), std::forward<Args>(args)...))
    \n-
    30{
    \n-
    31 if (i==firstValue)
    \n-
    32 return f(std::integral_constant<size_type, firstValue>(), std::forward<Args>(args)...);
    \n-
    33 return forwardAsStaticInteger(std::integer_sequence<size_type, secondValue, otherValues...>(), i, std::forward<F>(f), std::forward<Args>(args)...);
    \n-
    34}
    \n-
    35
    \n-
    36
    \n-
    37
    \n-
    59template<std::size_t end, class F, class size_type, class... Args>
    \n-
    60auto forwardAsStaticIndex(const size_type& i, F&& f, Args&&... args)
    \n-
    61 ->decltype(f(Dune::Indices::_0, std::forward<Args>(args)...))
    \n-
    62{
    \n-
    63 return forwardAsStaticInteger(std::make_index_sequence<end>{}, i, std::forward<F>(f), std::forward<Args>(args)...);
    \n-
    64}
    \n-
    65
    \n-
    66
    \n-
    67
    \n-
    68namespace Imp {
    \n-
    69
    \n-
    70 template<template<class...> class T, class List>
    \n-
    71 struct ExpandTupleHelper
    \n-
    72 {};
    \n-
    73
    \n-
    74 template<template<class...> class T, template<class...> class ListType, class... Args>
    \n-
    75 struct ExpandTupleHelper<T, ListType<Args...>>
    \n-
    76 {
    \n-
    77 using Type = T<Args...>;
    \n-
    78 };
    \n-
    79
    \n-
    80} // end namespace Imp
    \n-
    81
    \n-
    93template<template<class...> class T, class ArgTuple>
    \n-
    94using ExpandTuple = typename Imp::ExpandTupleHelper<T, ArgTuple>::Type;
    \n-
    95
    \n-
    96
    \n-
    97
    \n-
    98namespace Imp {
    \n+
    13
    \n+
    24template<class T, class... Args>
    \n+
    25using enableIfConstructible = typename std::enable_if<
    \n+
    26 std::is_constructible<T, Args...>::value, int>::type;
    \n+
    27
    \n+
    28
    \n+
    29
    \n+
    30namespace Imp {
    \n+
    31
    \n+
    32 // As a last resort try if there's a static constexpr size()
    \n+
    33 template<class T>
    \n+
    34 constexpr auto staticSize(const T*, const PriorityTag<0>&)
    \n+
    35 -> decltype(std::integral_constant<std::size_t,T::size()>())
    \n+
    36 {
    \n+
    37 return {};
    \n+
    38 }
    \n+
    39
    \n+
    40 // Try if class has constexpr default constructor and size method
    \n+
    41 template<class T>
    \n+
    42 constexpr auto staticSize(const T*, const PriorityTag<1>&)
    \n+
    43 -> decltype(std::integral_constant<std::size_t,T().size()>())
    \n+
    44 {
    \n+
    45 return {};
    \n+
    46 }
    \n+
    47
    \n+
    48 // Try if tuple_size is implemented for class
    \n+
    49 template<class T>
    \n+
    50 constexpr auto staticSize(const T*, const PriorityTag<2>&)
    \n+
    51 -> decltype(std::integral_constant<std::size_t,std::tuple_size<T>::value>())
    \n+
    52 {
    \n+
    53 return {};
    \n+
    54 }
    \n+
    55
    \n+
    56 template<class T>
    \n+
    57 constexpr std::false_type hasStaticSize(const T* t, const PriorityTag<0>& p)
    \n+
    58 {
    \n+
    59 return {};
    \n+
    60 }
    \n+
    61
    \n+
    62 template<class T>
    \n+
    63 constexpr auto hasStaticSize(const T* t, const PriorityTag<1>& p)
    \n+
    64 -> decltype(staticSize(t ,PriorityTag<42>()), std::true_type())
    \n+
    65 {
    \n+
    66 return {};
    \n+
    67 }
    \n+
    68
    \n+
    69}
    \n+
    70
    \n+
    71
    \n+
    72
    \n+
    80template<class T>
    \n+\n+
    82 public decltype(Imp::hasStaticSize((typename std::decay<T>::type*)(nullptr), PriorityTag<42>()))
    \n+
    83{};
    \n+
    84
    \n+
    85
    \n+
    86
    \n+
    94template<class T>
    \n+
    95struct StaticSize :
    \n+
    96 public decltype(Imp::staticSize((typename std::decay<T>::type*)(nullptr), PriorityTag<42>()))
    \n+
    97{};
    \n+
    98
    \n
    99
    \n-
    100 template<template<class...> class T, class... Tuple>
    \n-
    101 struct TransformTupleHelper
    \n-
    102 {};
    \n-
    103
    \n-
    104 template<template<class...> class T, class... Args1>
    \n-
    105 struct TransformTupleHelper<T, typename std::tuple<Args1...>>
    \n-
    106 {
    \n-
    107 using Type = std::tuple<T<Args1>...>;
    \n-
    108 };
    \n-
    109
    \n-
    110 template<template<class...> class T, class... Args1, class... Args2>
    \n-
    111 struct TransformTupleHelper<T, typename std::tuple<Args1...>, typename std::tuple<Args2...>>
    \n-
    112 {
    \n-
    113 using Type = std::tuple<T<Args1, Args2>...>;
    \n-
    114 };
    \n-
    115
    \n-
    116} // end namespace Imp
    \n-
    117
    \n-
    130template<template<class...> class F, class... Tuples>
    \n-
    131using TransformTuple = typename Imp::TransformTupleHelper<F, Tuples...>::Type;
    \n-
    132
    \n-
    133
    \n-
    134
    \n-
    135namespace Imp {
    \n-
    136
    \n-
    137 template<class F, class... T, std::size_t... k>
    \n-
    138 auto transformTupleHelper(F&& f, const std::tuple<T...>& tuple, std::index_sequence<k...>)
    \n-
    139 -> decltype(std::make_tuple(f(std::get<k>(tuple))...))
    \n-
    140 {
    \n-
    141 return std::make_tuple(f(std::get<k>(tuple))...);
    \n-
    142 }
    \n-
    143
    \n-
    144 template<class F, class... T1, class...T2, std::size_t... k>
    \n-
    145 auto transformTupleHelper(F&& f, const std::tuple<T1...>& tuple1, const std::tuple<T2...>& tuple2, std::index_sequence<k...>)
    \n-
    146 -> decltype(std::make_tuple(f(std::get<k>(tuple1), std::get<k>(tuple2))...))
    \n-
    147 {
    \n-
    148 return std::make_tuple(f(std::get<k>(tuple1), std::get<k>(tuple2))...);
    \n-
    149 }
    \n-
    150
    \n-
    151} // end namespace Imp
    \n-
    152
    \n-
    164template<class F, class... T>
    \n-
    165auto transformTuple(F&& f, const std::tuple<T...>& tuple)
    \n-
    166 -> decltype(Imp::transformTupleHelper(std::forward<F>(f), tuple, std::index_sequence_for<T...>{}))
    \n-
    167{
    \n-
    168 return Imp::transformTupleHelper(std::forward<F>(f), tuple, std::index_sequence_for<T...>{});
    \n-
    169}
    \n-
    170
    \n-
    184template<class F, class... T1, class... T2>
    \n-
    185auto transformTuple(F&& f, const std::tuple<T1...>& tuple1, const std::tuple<T2...>& tuple2)
    \n-
    186 -> decltype(Imp::transformTupleHelper(std::forward<F>(f), tuple1, tuple2, std::index_sequence_for<T1...>{}))
    \n-
    187{
    \n-
    188 return Imp::transformTupleHelper(std::forward<F>(f), tuple1, tuple2, std::index_sequence_for<T1...>{});
    \n-
    189}
    \n-
    190
    \n-
    191
    \n-
    192
    \n-
    193namespace Imp {
    \n-
    194
    \n-
    195 template<class IntegerSequence>
    \n-
    196 struct IntegerSequenceTupleHelper
    \n-
    197 {};
    \n-
    198
    \n-
    199 template<class I, I... k>
    \n-
    200 struct IntegerSequenceTupleHelper<std::integer_sequence<I, k...>>
    \n-
    201 {
    \n-
    202 using Type = std::tuple<std::integral_constant<I, k>...>;
    \n-
    203 };
    \n-
    204
    \n-
    205} // end namespace Imp
    \n-
    206
    \n-
    210template<class IntegerSequence>
    \n-
    211using IntegerSequenceTuple= typename Imp::IntegerSequenceTupleHelper<IntegerSequence>::Type;
    \n-
    212
    \n-
    213
    \n-
    214
    \n-
    220template<class... T>
    \n-\n-
    222{
    \n-
    223 using type = typename std::tuple_element<sizeof...(T)-1, std::tuple<T...>>::type;
    \n-
    224};
    \n-
    225
    \n-
    226
    \n-
    227
    \n-
    228namespace Imp {
    \n-
    229
    \n-
    230template<class T, class I>
    \n-
    231struct RotateHelper;
    \n-
    232
    \n-
    233template<class... T, std::size_t... I>
    \n-
    234struct RotateHelper<std::tuple<T...>, std::index_sequence<I...> >
    \n-
    235{
    \n-
    236 using type = typename std::tuple<typename LastType<T...>::type, typename std::tuple_element<I,std::tuple<T...>>::type...>;
    \n-
    237};
    \n-
    238
    \n-
    239} // end namespace Imp
    \n-
    240
    \n-
    241
    \n-
    249template<class... T>
    \n-\n-
    251{
    \n-
    252 using type = typename Imp::RotateHelper<std::tuple<T...>, std::make_index_sequence<sizeof...(T)-1>>::type;
    \n-
    253};
    \n-
    254
    \n-
    255
    \n-
    256
    \n-
    278template<class Expression>
    \n-
    279auto callableCheck(Expression f)
    \n-
    280{
    \n-
    281 return [f](auto&&... args){
    \n-
    282 return Functions::Concept::isCallable(f, std::forward<decltype(args)>(args)...);
    \n-
    283 };
    \n-
    284}
    \n-
    285
    \n-
    286
    \n-
    287
    \n-
    303template<class Check>
    \n-
    304auto negatePredicate(Check check)
    \n-
    305{
    \n-
    306 return [check](auto&&... args){
    \n-
    307 auto negate = overload(
    \n-
    308 [](std::true_type) { return std::false_type{};},
    \n-
    309 [](std::false_type) { return std::true_type{};},
    \n-
    310 [](bool v) { return not v;});
    \n-
    311 return negate(check(std::forward<decltype(args)>(args)...));
    \n-
    312 };
    \n-
    313}
    \n-
    314
    \n-
    315
    \n-
    316namespace Impl {
    \n-
    317
    \n-
    318 // Wrapper to capture values in a lambda for perfect forwarding.
    \n-
    319 // This captures value types by value and reference types by reference.
    \n-
    320 template <typename T>
    \n-
    321 struct ForwardCaptureWrapper;
    \n-
    322
    \n-
    323 template <typename T>
    \n-
    324 struct ForwardCaptureWrapper
    \n-
    325 {
    \n-
    326 template <typename TT>
    \n-
    327 ForwardCaptureWrapper(TT&& t) : t_{std::forward<TT>(t)} {}
    \n-
    328
    \n-
    329 auto forward() const { return std::move(t_); }
    \n-
    330
    \n-
    331 T t_;
    \n-
    332 };
    \n-
    333
    \n-
    334 template <typename T>
    \n-
    335 struct ForwardCaptureWrapper<T&>
    \n-
    336 {
    \n-
    337 ForwardCaptureWrapper(T& t) : t_{t} {}
    \n-
    338
    \n-
    339 T& forward() const { return t_; };
    \n-
    340
    \n-
    341 T& t_;
    \n-
    342 };
    \n-
    343
    \n-
    344 template <typename T>
    \n-
    345 struct ForwardCaptureWrapper<const T&>
    \n-
    346 {
    \n-
    347 ForwardCaptureWrapper(const T& t) : t_{t} {}
    \n-
    348
    \n-
    349 const T& forward() const { return t_; };
    \n-
    350
    \n-
    351 const T& t_;
    \n-
    352 };
    \n-
    353
    \n-
    354} // end namespace Dune::Functions::Impl
    \n-
    355
    \n-
    356
    \n-
    357
    \n-
    371template <class T>
    \n-
    372auto forwardCapture(T&& t)
    \n-
    373{
    \n-
    374 return Impl::ForwardCaptureWrapper<T>(std::forward<T>(t));
    \n-
    375}
    \n-
    376
    \n-
    377
    \n-
    378
    \n-
    379} // namespace Dune::Functions
    \n-
    380} // namespace Dune
    \n-
    381
    \n-
    382
    \n-
    383#endif // DUNE_FUNCTIONS_COMMON_UTILITY_HH
    \n-\n-
    typename Imp::ExpandTupleHelper< T, ArgTuple >::Type ExpandTuple
    Expand tuple arguments as template arguments.
    Definition: utility.hh:94
    \n-
    typename Imp::TransformTupleHelper< F, Tuples... >::Type TransformTuple
    Transform tuple types argument using type-functor.
    Definition: utility.hh:131
    \n-
    static constexpr auto isCallable()
    Check if f is callable with given argument list.
    Definition: functionconcepts.hh:47
    \n-
    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
    \n-
    auto callableCheck(Expression f)
    Create a predicate for checking validity of expressions.
    Definition: utility.hh:279
    \n-
    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
    \n-
    auto negatePredicate(Check check)
    Negate given predicate.
    Definition: utility.hh:304
    \n+
    100
    \n+
    101}} // namespace Dune::Functions
    \n+
    102
    \n+
    103#endif // DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH
    \n+
    typename std::enable_if< std::is_constructible< T, Args... >::value, int >::type enableIfConstructible
    Helper to constrain forwarding constructors.
    Definition: type_traits.hh:26
    \n
    Definition: polynomial.hh:10
    \n-
    auto forwardCapture(T &&t)
    Create a capture object for perfect forwarding.
    Definition: utility.hh:372
    \n-
    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
    \n-
    typename Imp::IntegerSequenceTupleHelper< IntegerSequence >::Type IntegerSequenceTuple
    Transform integer_sequence<I,k...> to tuple<integral_constant<I,k>...>
    Definition: utility.hh:211
    \n-
    Get last entry of type list.
    Definition: utility.hh:222
    \n-
    typename std::tuple_element< sizeof...(T) -1, std::tuple< T... > >::type type
    Definition: utility.hh:223
    \n-
    Rotate type list by one, such that last entry is moved to first position.
    Definition: utility.hh:251
    \n-
    typename Imp::RotateHelper< std::tuple< T... >, std::make_index_sequence< sizeof...(T) -1 > >::type type
    Definition: utility.hh:252
    \n+
    Check if type is a statically sized container.
    Definition: type_traits.hh:83
    \n+
    Obtain size of statically sized container.
    Definition: type_traits.hh:97
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,349 +5,108 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-utility.hh\n+type_traits.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_COMMON_UTILITY_HH\n- 4#define DUNE_FUNCTIONS_COMMON_UTILITY_HH\n+ 3#ifndef DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH\n+ 4#define DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH\n 5\n- 6\n- 7#include \n- 8#include \n+ 6#include \n+ 7\n+ 8#include \n 9\n- 10#include \n- 11#include \n+ 10namespace Dune {\n+ 11namespace Functions {\n 12\n- 13#include \n- 14\n- 15namespace Dune {\n- 16namespace Functions {\n- 17\n- 18\n- 19\n- 20template\n-21auto forwardAsStaticInteger(std::integer_sequence\n-values, const size_type& i, F&& f, Args&&... args)\n- 22 ->decltype(f(std::integral_constant(), std::\n-forward(args)...))\n- 23{\n- 24 return f(std::integral_constant(), std::\n-forward(args)...);\n- 25}\n- 26\n- 27template\n-28auto forwardAsStaticInteger(std::integer_sequence values, const size_type i, F&& f, Args&&... args)\n- 29 ->decltype(f(std::integral_constant(), std::\n-forward(args)...))\n- 30{\n- 31 if (i==firstValue)\n- 32 return f(std::integral_constant(), std::\n-forward(args)...);\n- 33 return forwardAsStaticInteger(std::integer_sequence(), i, std::forward(f), std::forward(args)...);\n- 34}\n- 35\n- 36\n- 37\n- 59template\n-60auto forwardAsStaticIndex(const size_type& i, F&& f, Args&&... args)\n- 61 ->decltype(f(Dune::Indices::_0, std::forward(args)...))\n- 62{\n- 63 return forwardAsStaticInteger(std::make_index_sequence{}, i, std::\n-forward(f), std::forward(args)...);\n- 64}\n- 65\n- 66\n- 67\n- 68namespace Imp {\n- 69\n- 70 template class T, class List>\n- 71 struct ExpandTupleHelper\n- 72 {};\n- 73\n- 74 template class T, template class ListType,\n-class... Args>\n- 75 struct ExpandTupleHelper>\n- 76 {\n- 77 using Type = T;\n- 78 };\n- 79\n- 80} // end namespace Imp\n- 81\n- 93template class T, class ArgTuple>\n-94using ExpandTuple = typename Imp::ExpandTupleHelper::Type;\n- 95\n- 96\n- 97\n- 98namespace Imp {\n+ 13\n+ 24template\n+25using enableIfConstructible = typename std::enable_if<\n+ 26 std::is_constructible::value, int>::type;\n+ 27\n+ 28\n+ 29\n+ 30namespace Imp {\n+ 31\n+ 32 // As a last resort try if there's a static constexpr size()\n+ 33 template\n+ 34 constexpr auto staticSize(const T*, const PriorityTag<0>&)\n+ 35 -> decltype(std::integral_constant())\n+ 36 {\n+ 37 return {};\n+ 38 }\n+ 39\n+ 40 // Try if class has constexpr default constructor and size method\n+ 41 template\n+ 42 constexpr auto staticSize(const T*, const PriorityTag<1>&)\n+ 43 -> decltype(std::integral_constant())\n+ 44 {\n+ 45 return {};\n+ 46 }\n+ 47\n+ 48 // Try if tuple_size is implemented for class\n+ 49 template\n+ 50 constexpr auto staticSize(const T*, const PriorityTag<2>&)\n+ 51 -> decltype(std::integral_constant::value>\n+())\n+ 52 {\n+ 53 return {};\n+ 54 }\n+ 55\n+ 56 template\n+ 57 constexpr std::false_type hasStaticSize(const T* t, const PriorityTag<0>&\n+p)\n+ 58 {\n+ 59 return {};\n+ 60 }\n+ 61\n+ 62 template\n+ 63 constexpr auto hasStaticSize(const T* t, const PriorityTag<1>& p)\n+ 64 -> decltype(staticSize(t ,PriorityTag<42>()), std::true_type())\n+ 65 {\n+ 66 return {};\n+ 67 }\n+ 68\n+ 69}\n+ 70\n+ 71\n+ 72\n+ 80template\n+81struct HasStaticSize :\n+ 82 public decltype(Imp::hasStaticSize((typename std::decay::type*)\n+(nullptr), PriorityTag<42>()))\n+ 83{};\n+ 84\n+ 85\n+ 86\n+ 94template\n+95struct StaticSize :\n+ 96 public decltype(Imp::staticSize((typename std::decay::type*)(nullptr),\n+PriorityTag<42>()))\n+ 97{};\n+ 98\n 99\n- 100 template class T, class... Tuple>\n- 101 struct TransformTupleHelper\n- 102 {};\n- 103\n- 104 template class T, class... Args1>\n- 105 struct TransformTupleHelper>\n- 106 {\n- 107 using Type = std::tuple...>;\n- 108 };\n- 109\n- 110 template class T, class... Args1, class... Args2>\n- 111 struct TransformTupleHelper, typename\n-std::tuple>\n- 112 {\n- 113 using Type = std::tuple...>;\n- 114 };\n- 115\n- 116} // end namespace Imp\n- 117\n- 130template class F, class... Tuples>\n-131using TransformTuple = typename Imp::TransformTupleHelper::\n-Type;\n- 132\n- 133\n- 134\n- 135namespace Imp {\n- 136\n- 137 template\n- 138 auto transformTupleHelper(F&& f, const std::tuple& tuple, std::\n-index_sequence)\n- 139 -> decltype(std::make_tuple(f(std::get(tuple))...))\n- 140 {\n- 141 return std::make_tuple(f(std::get(tuple))...);\n- 142 }\n- 143\n- 144 template\n- 145 auto transformTupleHelper(F&& f, const std::tuple& tuple1, const\n-std::tuple& tuple2, std::index_sequence)\n- 146 -> decltype(std::make_tuple(f(std::get(tuple1), std::get\n-(tuple2))...))\n- 147 {\n- 148 return std::make_tuple(f(std::get(tuple1), std::get(tuple2))...);\n- 149 }\n- 150\n- 151} // end namespace Imp\n- 152\n- 164template\n-165auto transformTuple(F&& f, const std::tuple& tuple)\n- 166 -> decltype(Imp::transformTupleHelper(std::forward(f), tuple, std::\n-index_sequence_for{}))\n- 167{\n- 168 return Imp::transformTupleHelper(std::forward(f), tuple, std::\n-index_sequence_for{});\n- 169}\n- 170\n- 184template\n-185auto transformTuple(F&& f, const std::tuple& tuple1, const std::\n-tuple& tuple2)\n- 186 -> decltype(Imp::transformTupleHelper(std::forward(f), tuple1, tuple2,\n-std::index_sequence_for{}))\n- 187{\n- 188 return Imp::transformTupleHelper(std::forward(f), tuple1, tuple2, std::\n-index_sequence_for{});\n- 189}\n- 190\n- 191\n- 192\n- 193namespace Imp {\n- 194\n- 195 template\n- 196 struct IntegerSequenceTupleHelper\n- 197 {};\n- 198\n- 199 template\n- 200 struct IntegerSequenceTupleHelper>\n- 201 {\n- 202 using Type = std::tuple...>;\n- 203 };\n- 204\n- 205} // end namespace Imp\n- 206\n- 210template\n-211using IntegerSequenceTuple= typename Imp::\n-IntegerSequenceTupleHelper::Type;\n- 212\n- 213\n- 214\n- 220template\n-221struct LastType\n- 222{\n-223 using type = typename std::tuple_element>::type;\n- 224};\n- 225\n- 226\n- 227\n- 228namespace Imp {\n- 229\n- 230template\n- 231struct RotateHelper;\n- 232\n- 233template\n- 234struct RotateHelper, std::index_sequence >\n- 235{\n- 236 using type = typename std::tuple::type, typename\n-std::tuple_element>::type...>;\n- 237};\n- 238\n- 239} // end namespace Imp\n- 240\n- 241\n- 249template\n-250struct RotateTuple\n- 251{\n-252 using type = typename Imp::RotateHelper, std::\n-make_index_sequence>::type;\n- 253};\n- 254\n- 255\n- 256\n- 278template\n-279auto callableCheck(Expression f)\n- 280{\n- 281 return [f](auto&&... args){\n- 282 return Functions::Concept::isCallable(f, std::forward\n-(args)...);\n- 283 };\n- 284}\n- 285\n- 286\n- 287\n- 303template\n-304auto negatePredicate(Check check)\n- 305{\n- 306 return [check](auto&&... args){\n- 307 auto negate = overload(\n- 308 [](std::true_type) { return std::false_type{};},\n- 309 [](std::false_type) { return std::true_type{};},\n- 310 [](bool v) { return not v;});\n- 311 return negate(check(std::forward(args)...));\n- 312 };\n- 313}\n- 314\n- 315\n- 316namespace Impl {\n- 317\n- 318 // Wrapper to capture values in a lambda for perfect forwarding.\n- 319 // This captures value types by value and reference types by reference.\n- 320 template \n- 321 struct ForwardCaptureWrapper;\n- 322\n- 323 template \n- 324 struct ForwardCaptureWrapper\n- 325 {\n- 326 template \n- 327 ForwardCaptureWrapper(TT&& t) : t_{std::forward(t)} {}\n- 328\n- 329 auto forward() const { return std::move(t_); }\n- 330\n- 331 T t_;\n- 332 };\n- 333\n- 334 template \n- 335 struct ForwardCaptureWrapper\n- 336 {\n- 337 ForwardCaptureWrapper(T& t) : t_{t} {}\n- 338\n- 339 T& forward() const { return t_; };\n- 340\n- 341 T& t_;\n- 342 };\n- 343\n- 344 template \n- 345 struct ForwardCaptureWrapper\n- 346 {\n- 347 ForwardCaptureWrapper(const T& t) : t_{t} {}\n- 348\n- 349 const T& forward() const { return t_; };\n- 350\n- 351 const T& t_;\n- 352 };\n- 353\n- 354} // end namespace Dune::Functions::Impl\n- 355\n- 356\n- 357\n- 371template \n-372auto forwardCapture(T&& t)\n- 373{\n- 374 return Impl::ForwardCaptureWrapper(std::forward(t));\n- 375}\n- 376\n- 377\n- 378\n- 379} // namespace Dune::Functions\n- 380} // namespace Dune\n- 381\n- 382\n- 383#endif // DUNE_FUNCTIONS_COMMON_UTILITY_HH\n-functionconcepts.hh\n-Dune::Functions::ExpandTuple\n-typename Imp::ExpandTupleHelper< T, ArgTuple >::Type ExpandTuple\n-Expand tuple arguments as template arguments.\n-Definition: utility.hh:94\n-Dune::Functions::TransformTuple\n-typename Imp::TransformTupleHelper< F, Tuples... >::Type TransformTuple\n-Transform tuple types argument using type-functor.\n-Definition: utility.hh:131\n-Dune::Functions::Concept::isCallable\n-static constexpr auto isCallable()\n-Check if f is callable with given argument list.\n-Definition: functionconcepts.hh:47\n-Dune::Functions::transformTuple\n-auto transformTuple(F &&f, const std::tuple< T... > &tuple) -> decltype(Imp::\n-transformTupleHelper(std::forward< F >(f), tuple, std::index_sequence_for< T...\n->{}))\n-Transform tuple value using a functor.\n-Definition: utility.hh:165\n-Dune::Functions::callableCheck\n-auto callableCheck(Expression f)\n-Create a predicate for checking validity of expressions.\n-Definition: utility.hh:279\n-Dune::Functions::forwardAsStaticIndex\n-auto forwardAsStaticIndex(const size_type &i, F &&f, Args &&... args) -\n-> decltype(f(Dune::Indices::_0, std::forward< Args >(args)...))\n-Transform dynamic index to static index_constant.\n-Definition: utility.hh:60\n-Dune::Functions::negatePredicate\n-auto negatePredicate(Check check)\n-Negate given predicate.\n-Definition: utility.hh:304\n+ 100\n+ 101}} // namespace Dune::Functions\n+ 102\n+ 103#endif // DUNE_FUNCTIONS_COMMON_TYPE_TRAITS_HH\n+Dune::Functions::enableIfConstructible\n+typename std::enable_if< std::is_constructible< T, Args... >::value, int >::\n+type enableIfConstructible\n+Helper to constrain forwarding constructors.\n+Definition: type_traits.hh:26\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::forwardCapture\n-auto forwardCapture(T &&t)\n-Create a capture object for perfect forwarding.\n-Definition: utility.hh:372\n-Dune::Functions::forwardAsStaticInteger\n-auto forwardAsStaticInteger(std::integer_sequence< size_type, firstValue >\n-values, const size_type &i, F &&f, Args &&... args) -> decltype(f(std::\n-integral_constant< size_type, firstValue >(), std::forward< Args >(args)...))\n-Definition: utility.hh:21\n-Dune::Functions::IntegerSequenceTuple\n-typename Imp::IntegerSequenceTupleHelper< IntegerSequence >::Type\n-IntegerSequenceTuple\n-Transform integer_sequence to tuple...>\n-Definition: utility.hh:211\n-Dune::Functions::LastType\n-Get last entry of type list.\n-Definition: utility.hh:222\n-Dune::Functions::LastType::type\n-typename std::tuple_element< sizeof...(T) -1, std::tuple< T... > >::type type\n-Definition: utility.hh:223\n-Dune::Functions::RotateTuple\n-Rotate type list by one, such that last entry is moved to first position.\n-Definition: utility.hh:251\n-Dune::Functions::RotateTuple::type\n-typename Imp::RotateHelper< std::tuple< T... >, std::make_index_sequence<\n-sizeof...(T) -1 > >::type type\n-Definition: utility.hh:252\n+Dune::Functions::HasStaticSize\n+Check if type is a statically sized container.\n+Definition: type_traits.hh:83\n+Dune::Functions::StaticSize\n+Obtain size of statically sized container.\n+Definition: type_traits.hh:97\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00047.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00047.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: interfaces.hh File Reference\n+dune-functions: utility.hh File Reference\n \n \n \n \n \n \n \n@@ -64,34 +64,91 @@\n \n \n \n
    \n \n-
    interfaces.hh File Reference
    \n+Namespaces |\n+Typedefs |\n+Functions
    \n+
    utility.hh File Reference
    \n \n
    \n-
    #include <type_traits>
    \n+
    #include <utility>
    \n+#include <type_traits>
    \n+#include <dune/common/overloadset.hh>
    \n+#include <dune/common/indices.hh>
    \n+#include <dune/functions/common/functionconcepts.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n+\n+\n+\n+\n+\n \n

    \n Classes

    class  Dune::Functions::PolymorphicType< Interface >
     Base class with polymorphic type boiler plate code. More...
    struct  Dune::Functions::LastType< T >
     Get last entry of type list. More...
     
    struct  Dune::Functions::RotateTuple< T >
     Rotate type list by one, such that last entry is moved to first position. More...
     
    \n \n \n \n \n \n+

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+

    \n+Typedefs

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

    \n+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. More...
     
    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. More...
     
    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. More...
     
    template<class Expression >
    auto Dune::Functions::callableCheck (Expression f)
     Create a predicate for checking validity of expressions. More...
     
    template<class Check >
    auto Dune::Functions::negatePredicate (Check check)
     Negate given predicate. More...
     
    template<class T >
    auto Dune::Functions::forwardCapture (T &&t)
     Create a capture object for perfect forwarding. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,23 +5,94 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-Classes | Namespaces\n-interfaces.hh File Reference\n+Classes | Namespaces | Typedefs | Functions\n+utility.hh File Reference\n+#include \n #include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::PolymorphicType<_Interface_>\n-\u00a0 Base class with polymorphic type boiler plate code. More...\n+struct \u00a0Dune::Functions::LastType<_T_>\n+\u00a0 Get last entry of type list. More...\n+\u00a0\n+struct \u00a0Dune::Functions::RotateTuple<_T_>\n+\u00a0 Rotate type list by one, such that last entry is moved to first\n+ position. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n+ Typedefs\n+template class T, class ArgTuple >\n+using\u00a0Dune::Functions::ExpandTuple = typename Imp::ExpandTupleHelper< T,\n+ ArgTuple >::Type\n+\u00a0 Expand tuple arguments as template arguments. More...\n+\u00a0\n+template class F, class... Tuples>\n+using\u00a0Dune::Functions::TransformTuple = typename Imp::TransformTupleHelper< F,\n+ Tuples... >::Type\n+\u00a0 Transform tuple types argument using type-functor. More...\n+\u00a0\n+template\n+using\u00a0Dune::Functions::IntegerSequenceTuple = typename Imp::\n+ IntegerSequenceTupleHelper< IntegerSequence >::Type\n+\u00a0 Transform integer_sequence to tuple...>\n+ More...\n+\u00a0\n+ Functions\n+template\n+auto\u00a0Dune::Functions::forwardAsStaticInteger (std::integer_sequence<\n+ size_type, firstValue > values, const size_type &i, F &&f, Args &&...\n+ args) -> decltype(f(std::integral_constant< size_type, firstValue >(),\n+ std::forward< Args >(args)...))\n+\u00a0\n+template\n+auto\u00a0Dune::Functions::forwardAsStaticInteger (std::integer_sequence<\n+ size_type, firstValue, secondValue, otherValues... > values, const\n+ size_type i, F &&f, Args &&... args) -> decltype(f(std::\n+ integral_constant< size_type, firstValue >(), std::forward< Args >\n+ (args)...))\n+\u00a0\n+template\n+auto\u00a0Dune::Functions::forwardAsStaticIndex (const size_type &i, F &&f, Args\n+ &&... args) -> decltype(f(Dune::Indices::_0, std::forward< Args >\n+ (args)...))\n+\u00a0 Transform dynamic index to static index_constant. More...\n+\u00a0\n+template\n+auto\u00a0Dune::Functions::transformTuple (F &&f, const std::tuple< T... > &tuple)\n+ -> decltype(Imp::transformTupleHelper(std::forward< F >(f), tuple, std::\n+ index_sequence_for< T... >{}))\n+\u00a0 Transform tuple value using a functor. More...\n+\u00a0\n+template\n+auto\u00a0Dune::Functions::transformTuple (F &&f, const std::tuple< T1... >\n+ &tuple1, const std::tuple< T2... > &tuple2) -> decltype(Imp::\n+ transformTupleHelper(std::forward< F >(f), tuple1, tuple2, std::\n+ index_sequence_for< T1... >{}))\n+\u00a0 Transform tuple value using a binary functor. More...\n+\u00a0\n+template\n+auto\u00a0Dune::Functions::callableCheck (Expression f)\n+\u00a0 Create a predicate for checking validity of expressions. More...\n+\u00a0\n+template\n+auto\u00a0Dune::Functions::negatePredicate (Check check)\n+\u00a0 Negate given predicate. More...\n+\u00a0\n+template\n+auto\u00a0Dune::Functions::forwardCapture (T &&t)\n+\u00a0 Create a capture object for perfect forwarding. More...\n+\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00047_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00047_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: interfaces.hh Source File\n+dune-functions: utility.hh Source File\n \n \n \n \n \n \n \n@@ -62,56 +62,284 @@\n \n \n
    \n
    \n-
    interfaces.hh
    \n+
    utility.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_COMMON_INTERFACES_HH
    \n-
    4#define DUNE_FUNCTIONS_COMMON_INTERFACES_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_COMMON_UTILITY_HH
    \n+
    4#define DUNE_FUNCTIONS_COMMON_UTILITY_HH
    \n
    5
    \n-
    6#include <type_traits>
    \n-
    7
    \n-
    8
    \n-
    9namespace Dune {
    \n-
    10namespace Functions {
    \n-
    11
    \n+
    6
    \n+
    7#include <utility>
    \n+
    8#include <type_traits>
    \n+
    9
    \n+
    10#include <dune/common/overloadset.hh>
    \n+
    11#include <dune/common/indices.hh>
    \n
    12
    \n-
    13
    \n-
    23template<class Interface>
    \n-\n-
    25{
    \n-
    26public:
    \n-
    27
    \n-\n-
    30 {}
    \n-
    31
    \n-
    40 virtual Interface* clone() const = 0;
    \n-
    41
    \n-
    51 virtual Interface* clone(void* buffer) const = 0;
    \n-
    52
    \n-
    62 virtual Interface* move(void* buffer) = 0;
    \n-
    63};
    \n-
    64
    \n+\n+
    14
    \n+
    15namespace Dune {
    \n+
    16namespace Functions {
    \n+
    17
    \n+
    18
    \n+
    19
    \n+
    20template<class F, class size_type, size_type firstValue, class... Args>
    \n+
    21auto forwardAsStaticInteger(std::integer_sequence<size_type, firstValue> values, const size_type& i, F&& f, Args&&... args)
    \n+
    22 ->decltype(f(std::integral_constant<size_type, firstValue>(), std::forward<Args>(args)...))
    \n+
    23{
    \n+
    24 return f(std::integral_constant<size_type, firstValue>(), std::forward<Args>(args)...);
    \n+
    25}
    \n+
    26
    \n+
    27template<class F, class size_type, size_type firstValue, size_type secondValue, size_type... otherValues, class... Args>
    \n+
    28auto forwardAsStaticInteger(std::integer_sequence<size_type, firstValue, secondValue, otherValues...> values, const size_type i, F&& f, Args&&... args)
    \n+
    29 ->decltype(f(std::integral_constant<size_type, firstValue>(), std::forward<Args>(args)...))
    \n+
    30{
    \n+
    31 if (i==firstValue)
    \n+
    32 return f(std::integral_constant<size_type, firstValue>(), std::forward<Args>(args)...);
    \n+
    33 return forwardAsStaticInteger(std::integer_sequence<size_type, secondValue, otherValues...>(), i, std::forward<F>(f), std::forward<Args>(args)...);
    \n+
    34}
    \n+
    35
    \n+
    36
    \n+
    37
    \n+
    59template<std::size_t end, class F, class size_type, class... Args>
    \n+
    60auto forwardAsStaticIndex(const size_type& i, F&& f, Args&&... args)
    \n+
    61 ->decltype(f(Dune::Indices::_0, std::forward<Args>(args)...))
    \n+
    62{
    \n+
    63 return forwardAsStaticInteger(std::make_index_sequence<end>{}, i, std::forward<F>(f), std::forward<Args>(args)...);
    \n+
    64}
    \n
    65
    \n
    66
    \n-
    67}} // namespace Dune::Functions
    \n-
    68
    \n-
    69#endif // DUNE_FUNCTIONS_COMMON_EXTENDED_CLONEABLE_HH
    \n+
    67
    \n+
    68namespace Imp {
    \n+
    69
    \n+
    70 template<template<class...> class T, class List>
    \n+
    71 struct ExpandTupleHelper
    \n+
    72 {};
    \n+
    73
    \n+
    74 template<template<class...> class T, template<class...> class ListType, class... Args>
    \n+
    75 struct ExpandTupleHelper<T, ListType<Args...>>
    \n+
    76 {
    \n+
    77 using Type = T<Args...>;
    \n+
    78 };
    \n+
    79
    \n+
    80} // end namespace Imp
    \n+
    81
    \n+
    93template<template<class...> class T, class ArgTuple>
    \n+
    94using ExpandTuple = typename Imp::ExpandTupleHelper<T, ArgTuple>::Type;
    \n+
    95
    \n+
    96
    \n+
    97
    \n+
    98namespace Imp {
    \n+
    99
    \n+
    100 template<template<class...> class T, class... Tuple>
    \n+
    101 struct TransformTupleHelper
    \n+
    102 {};
    \n+
    103
    \n+
    104 template<template<class...> class T, class... Args1>
    \n+
    105 struct TransformTupleHelper<T, typename std::tuple<Args1...>>
    \n+
    106 {
    \n+
    107 using Type = std::tuple<T<Args1>...>;
    \n+
    108 };
    \n+
    109
    \n+
    110 template<template<class...> class T, class... Args1, class... Args2>
    \n+
    111 struct TransformTupleHelper<T, typename std::tuple<Args1...>, typename std::tuple<Args2...>>
    \n+
    112 {
    \n+
    113 using Type = std::tuple<T<Args1, Args2>...>;
    \n+
    114 };
    \n+
    115
    \n+
    116} // end namespace Imp
    \n+
    117
    \n+
    130template<template<class...> class F, class... Tuples>
    \n+
    131using TransformTuple = typename Imp::TransformTupleHelper<F, Tuples...>::Type;
    \n+
    132
    \n+
    133
    \n+
    134
    \n+
    135namespace Imp {
    \n+
    136
    \n+
    137 template<class F, class... T, std::size_t... k>
    \n+
    138 auto transformTupleHelper(F&& f, const std::tuple<T...>& tuple, std::index_sequence<k...>)
    \n+
    139 -> decltype(std::make_tuple(f(std::get<k>(tuple))...))
    \n+
    140 {
    \n+
    141 return std::make_tuple(f(std::get<k>(tuple))...);
    \n+
    142 }
    \n+
    143
    \n+
    144 template<class F, class... T1, class...T2, std::size_t... k>
    \n+
    145 auto transformTupleHelper(F&& f, const std::tuple<T1...>& tuple1, const std::tuple<T2...>& tuple2, std::index_sequence<k...>)
    \n+
    146 -> decltype(std::make_tuple(f(std::get<k>(tuple1), std::get<k>(tuple2))...))
    \n+
    147 {
    \n+
    148 return std::make_tuple(f(std::get<k>(tuple1), std::get<k>(tuple2))...);
    \n+
    149 }
    \n+
    150
    \n+
    151} // end namespace Imp
    \n+
    152
    \n+
    164template<class F, class... T>
    \n+
    165auto transformTuple(F&& f, const std::tuple<T...>& tuple)
    \n+
    166 -> decltype(Imp::transformTupleHelper(std::forward<F>(f), tuple, std::index_sequence_for<T...>{}))
    \n+
    167{
    \n+
    168 return Imp::transformTupleHelper(std::forward<F>(f), tuple, std::index_sequence_for<T...>{});
    \n+
    169}
    \n+
    170
    \n+
    184template<class F, class... T1, class... T2>
    \n+
    185auto transformTuple(F&& f, const std::tuple<T1...>& tuple1, const std::tuple<T2...>& tuple2)
    \n+
    186 -> decltype(Imp::transformTupleHelper(std::forward<F>(f), tuple1, tuple2, std::index_sequence_for<T1...>{}))
    \n+
    187{
    \n+
    188 return Imp::transformTupleHelper(std::forward<F>(f), tuple1, tuple2, std::index_sequence_for<T1...>{});
    \n+
    189}
    \n+
    190
    \n+
    191
    \n+
    192
    \n+
    193namespace Imp {
    \n+
    194
    \n+
    195 template<class IntegerSequence>
    \n+
    196 struct IntegerSequenceTupleHelper
    \n+
    197 {};
    \n+
    198
    \n+
    199 template<class I, I... k>
    \n+
    200 struct IntegerSequenceTupleHelper<std::integer_sequence<I, k...>>
    \n+
    201 {
    \n+
    202 using Type = std::tuple<std::integral_constant<I, k>...>;
    \n+
    203 };
    \n+
    204
    \n+
    205} // end namespace Imp
    \n+
    206
    \n+
    210template<class IntegerSequence>
    \n+
    211using IntegerSequenceTuple= typename Imp::IntegerSequenceTupleHelper<IntegerSequence>::Type;
    \n+
    212
    \n+
    213
    \n+
    214
    \n+
    220template<class... T>
    \n+\n+
    222{
    \n+
    223 using type = typename std::tuple_element<sizeof...(T)-1, std::tuple<T...>>::type;
    \n+
    224};
    \n+
    225
    \n+
    226
    \n+
    227
    \n+
    228namespace Imp {
    \n+
    229
    \n+
    230template<class T, class I>
    \n+
    231struct RotateHelper;
    \n+
    232
    \n+
    233template<class... T, std::size_t... I>
    \n+
    234struct RotateHelper<std::tuple<T...>, std::index_sequence<I...> >
    \n+
    235{
    \n+
    236 using type = typename std::tuple<typename LastType<T...>::type, typename std::tuple_element<I,std::tuple<T...>>::type...>;
    \n+
    237};
    \n+
    238
    \n+
    239} // end namespace Imp
    \n+
    240
    \n+
    241
    \n+
    249template<class... T>
    \n+\n+
    251{
    \n+
    252 using type = typename Imp::RotateHelper<std::tuple<T...>, std::make_index_sequence<sizeof...(T)-1>>::type;
    \n+
    253};
    \n+
    254
    \n+
    255
    \n+
    256
    \n+
    278template<class Expression>
    \n+
    279auto callableCheck(Expression f)
    \n+
    280{
    \n+
    281 return [f](auto&&... args){
    \n+
    282 return Functions::Concept::isCallable(f, std::forward<decltype(args)>(args)...);
    \n+
    283 };
    \n+
    284}
    \n+
    285
    \n+
    286
    \n+
    287
    \n+
    303template<class Check>
    \n+
    304auto negatePredicate(Check check)
    \n+
    305{
    \n+
    306 return [check](auto&&... args){
    \n+
    307 auto negate = overload(
    \n+
    308 [](std::true_type) { return std::false_type{};},
    \n+
    309 [](std::false_type) { return std::true_type{};},
    \n+
    310 [](bool v) { return not v;});
    \n+
    311 return negate(check(std::forward<decltype(args)>(args)...));
    \n+
    312 };
    \n+
    313}
    \n+
    314
    \n+
    315
    \n+
    316namespace Impl {
    \n+
    317
    \n+
    318 // Wrapper to capture values in a lambda for perfect forwarding.
    \n+
    319 // This captures value types by value and reference types by reference.
    \n+
    320 template <typename T>
    \n+
    321 struct ForwardCaptureWrapper;
    \n+
    322
    \n+
    323 template <typename T>
    \n+
    324 struct ForwardCaptureWrapper
    \n+
    325 {
    \n+
    326 template <typename TT>
    \n+
    327 ForwardCaptureWrapper(TT&& t) : t_{std::forward<TT>(t)} {}
    \n+
    328
    \n+
    329 auto forward() const { return std::move(t_); }
    \n+
    330
    \n+
    331 T t_;
    \n+
    332 };
    \n+
    333
    \n+
    334 template <typename T>
    \n+
    335 struct ForwardCaptureWrapper<T&>
    \n+
    336 {
    \n+
    337 ForwardCaptureWrapper(T& t) : t_{t} {}
    \n+
    338
    \n+
    339 T& forward() const { return t_; };
    \n+
    340
    \n+
    341 T& t_;
    \n+
    342 };
    \n+
    343
    \n+
    344 template <typename T>
    \n+
    345 struct ForwardCaptureWrapper<const T&>
    \n+
    346 {
    \n+
    347 ForwardCaptureWrapper(const T& t) : t_{t} {}
    \n+
    348
    \n+
    349 const T& forward() const { return t_; };
    \n+
    350
    \n+
    351 const T& t_;
    \n+
    352 };
    \n+
    353
    \n+
    354} // end namespace Dune::Functions::Impl
    \n+
    355
    \n+
    356
    \n+
    357
    \n+
    371template <class T>
    \n+
    372auto forwardCapture(T&& t)
    \n+
    373{
    \n+
    374 return Impl::ForwardCaptureWrapper<T>(std::forward<T>(t));
    \n+
    375}
    \n+
    376
    \n+
    377
    \n+
    378
    \n+
    379} // namespace Dune::Functions
    \n+
    380} // namespace Dune
    \n+
    381
    \n+
    382
    \n+
    383#endif // DUNE_FUNCTIONS_COMMON_UTILITY_HH
    \n+\n+
    typename Imp::ExpandTupleHelper< T, ArgTuple >::Type ExpandTuple
    Expand tuple arguments as template arguments.
    Definition: utility.hh:94
    \n+
    typename Imp::TransformTupleHelper< F, Tuples... >::Type TransformTuple
    Transform tuple types argument using type-functor.
    Definition: utility.hh:131
    \n+
    static constexpr auto isCallable()
    Check if f is callable with given argument list.
    Definition: functionconcepts.hh:47
    \n+
    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
    \n+
    auto callableCheck(Expression f)
    Create a predicate for checking validity of expressions.
    Definition: utility.hh:279
    \n+
    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
    \n+
    auto negatePredicate(Check check)
    Negate given predicate.
    Definition: utility.hh:304
    \n
    Definition: polynomial.hh:10
    \n-
    Base class with polymorphic type boiler plate code.
    Definition: interfaces.hh:25
    \n-
    virtual Interface * clone(void *buffer) const =0
    Clones the object into buffer.
    \n-
    virtual Interface * clone() const =0
    Clones the object.
    \n-
    virtual Interface * move(void *buffer)=0
    Move object into buffer.
    \n-
    virtual ~PolymorphicType()
    Destructor.
    Definition: interfaces.hh:29
    \n+
    auto forwardCapture(T &&t)
    Create a capture object for perfect forwarding.
    Definition: utility.hh:372
    \n+
    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
    \n+
    typename Imp::IntegerSequenceTupleHelper< IntegerSequence >::Type IntegerSequenceTuple
    Transform integer_sequence<I,k...> to tuple<integral_constant<I,k>...>
    Definition: utility.hh:211
    \n+
    Get last entry of type list.
    Definition: utility.hh:222
    \n+
    typename std::tuple_element< sizeof...(T) -1, std::tuple< T... > >::type type
    Definition: utility.hh:223
    \n+
    Rotate type list by one, such that last entry is moved to first position.
    Definition: utility.hh:251
    \n+
    typename Imp::RotateHelper< std::tuple< T... >, std::make_index_sequence< sizeof...(T) -1 > >::type type
    Definition: utility.hh:252
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,63 +5,349 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-interfaces.hh\n+utility.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_COMMON_INTERFACES_HH\n- 4#define DUNE_FUNCTIONS_COMMON_INTERFACES_HH\n+ 3#ifndef DUNE_FUNCTIONS_COMMON_UTILITY_HH\n+ 4#define DUNE_FUNCTIONS_COMMON_UTILITY_HH\n 5\n- 6#include \n- 7\n- 8\n- 9namespace Dune {\n- 10namespace Functions {\n- 11\n+ 6\n+ 7#include \n+ 8#include \n+ 9\n+ 10#include \n+ 11#include \n 12\n- 13\n- 23template\n-24class PolymorphicType\n- 25{\n- 26public:\n- 27\n-29 virtual ~PolymorphicType()\n- 30 {}\n- 31\n-40 virtual Interface* clone() const = 0;\n- 41\n-51 virtual Interface* clone(void* buffer) const = 0;\n- 52\n-62 virtual Interface* move(void* buffer) = 0;\n- 63};\n- 64\n+ 13#include \n+ 14\n+ 15namespace Dune {\n+ 16namespace Functions {\n+ 17\n+ 18\n+ 19\n+ 20template\n+21auto forwardAsStaticInteger(std::integer_sequence\n+values, const size_type& i, F&& f, Args&&... args)\n+ 22 ->decltype(f(std::integral_constant(), std::\n+forward(args)...))\n+ 23{\n+ 24 return f(std::integral_constant(), std::\n+forward(args)...);\n+ 25}\n+ 26\n+ 27template\n+28auto forwardAsStaticInteger(std::integer_sequence values, const size_type i, F&& f, Args&&... args)\n+ 29 ->decltype(f(std::integral_constant(), std::\n+forward(args)...))\n+ 30{\n+ 31 if (i==firstValue)\n+ 32 return f(std::integral_constant(), std::\n+forward(args)...);\n+ 33 return forwardAsStaticInteger(std::integer_sequence(), i, std::forward(f), std::forward(args)...);\n+ 34}\n+ 35\n+ 36\n+ 37\n+ 59template\n+60auto forwardAsStaticIndex(const size_type& i, F&& f, Args&&... args)\n+ 61 ->decltype(f(Dune::Indices::_0, std::forward(args)...))\n+ 62{\n+ 63 return forwardAsStaticInteger(std::make_index_sequence{}, i, std::\n+forward(f), std::forward(args)...);\n+ 64}\n 65\n 66\n- 67}} // namespace Dune::Functions\n- 68\n- 69#endif // DUNE_FUNCTIONS_COMMON_EXTENDED_CLONEABLE_HH\n+ 67\n+ 68namespace Imp {\n+ 69\n+ 70 template class T, class List>\n+ 71 struct ExpandTupleHelper\n+ 72 {};\n+ 73\n+ 74 template class T, template class ListType,\n+class... Args>\n+ 75 struct ExpandTupleHelper>\n+ 76 {\n+ 77 using Type = T;\n+ 78 };\n+ 79\n+ 80} // end namespace Imp\n+ 81\n+ 93template class T, class ArgTuple>\n+94using ExpandTuple = typename Imp::ExpandTupleHelper::Type;\n+ 95\n+ 96\n+ 97\n+ 98namespace Imp {\n+ 99\n+ 100 template class T, class... Tuple>\n+ 101 struct TransformTupleHelper\n+ 102 {};\n+ 103\n+ 104 template class T, class... Args1>\n+ 105 struct TransformTupleHelper>\n+ 106 {\n+ 107 using Type = std::tuple...>;\n+ 108 };\n+ 109\n+ 110 template class T, class... Args1, class... Args2>\n+ 111 struct TransformTupleHelper, typename\n+std::tuple>\n+ 112 {\n+ 113 using Type = std::tuple...>;\n+ 114 };\n+ 115\n+ 116} // end namespace Imp\n+ 117\n+ 130template class F, class... Tuples>\n+131using TransformTuple = typename Imp::TransformTupleHelper::\n+Type;\n+ 132\n+ 133\n+ 134\n+ 135namespace Imp {\n+ 136\n+ 137 template\n+ 138 auto transformTupleHelper(F&& f, const std::tuple& tuple, std::\n+index_sequence)\n+ 139 -> decltype(std::make_tuple(f(std::get(tuple))...))\n+ 140 {\n+ 141 return std::make_tuple(f(std::get(tuple))...);\n+ 142 }\n+ 143\n+ 144 template\n+ 145 auto transformTupleHelper(F&& f, const std::tuple& tuple1, const\n+std::tuple& tuple2, std::index_sequence)\n+ 146 -> decltype(std::make_tuple(f(std::get(tuple1), std::get\n+(tuple2))...))\n+ 147 {\n+ 148 return std::make_tuple(f(std::get(tuple1), std::get(tuple2))...);\n+ 149 }\n+ 150\n+ 151} // end namespace Imp\n+ 152\n+ 164template\n+165auto transformTuple(F&& f, const std::tuple& tuple)\n+ 166 -> decltype(Imp::transformTupleHelper(std::forward(f), tuple, std::\n+index_sequence_for{}))\n+ 167{\n+ 168 return Imp::transformTupleHelper(std::forward(f), tuple, std::\n+index_sequence_for{});\n+ 169}\n+ 170\n+ 184template\n+185auto transformTuple(F&& f, const std::tuple& tuple1, const std::\n+tuple& tuple2)\n+ 186 -> decltype(Imp::transformTupleHelper(std::forward(f), tuple1, tuple2,\n+std::index_sequence_for{}))\n+ 187{\n+ 188 return Imp::transformTupleHelper(std::forward(f), tuple1, tuple2, std::\n+index_sequence_for{});\n+ 189}\n+ 190\n+ 191\n+ 192\n+ 193namespace Imp {\n+ 194\n+ 195 template\n+ 196 struct IntegerSequenceTupleHelper\n+ 197 {};\n+ 198\n+ 199 template\n+ 200 struct IntegerSequenceTupleHelper>\n+ 201 {\n+ 202 using Type = std::tuple...>;\n+ 203 };\n+ 204\n+ 205} // end namespace Imp\n+ 206\n+ 210template\n+211using IntegerSequenceTuple= typename Imp::\n+IntegerSequenceTupleHelper::Type;\n+ 212\n+ 213\n+ 214\n+ 220template\n+221struct LastType\n+ 222{\n+223 using type = typename std::tuple_element>::type;\n+ 224};\n+ 225\n+ 226\n+ 227\n+ 228namespace Imp {\n+ 229\n+ 230template\n+ 231struct RotateHelper;\n+ 232\n+ 233template\n+ 234struct RotateHelper, std::index_sequence >\n+ 235{\n+ 236 using type = typename std::tuple::type, typename\n+std::tuple_element>::type...>;\n+ 237};\n+ 238\n+ 239} // end namespace Imp\n+ 240\n+ 241\n+ 249template\n+250struct RotateTuple\n+ 251{\n+252 using type = typename Imp::RotateHelper, std::\n+make_index_sequence>::type;\n+ 253};\n+ 254\n+ 255\n+ 256\n+ 278template\n+279auto callableCheck(Expression f)\n+ 280{\n+ 281 return [f](auto&&... args){\n+ 282 return Functions::Concept::isCallable(f, std::forward\n+(args)...);\n+ 283 };\n+ 284}\n+ 285\n+ 286\n+ 287\n+ 303template\n+304auto negatePredicate(Check check)\n+ 305{\n+ 306 return [check](auto&&... args){\n+ 307 auto negate = overload(\n+ 308 [](std::true_type) { return std::false_type{};},\n+ 309 [](std::false_type) { return std::true_type{};},\n+ 310 [](bool v) { return not v;});\n+ 311 return negate(check(std::forward(args)...));\n+ 312 };\n+ 313}\n+ 314\n+ 315\n+ 316namespace Impl {\n+ 317\n+ 318 // Wrapper to capture values in a lambda for perfect forwarding.\n+ 319 // This captures value types by value and reference types by reference.\n+ 320 template \n+ 321 struct ForwardCaptureWrapper;\n+ 322\n+ 323 template \n+ 324 struct ForwardCaptureWrapper\n+ 325 {\n+ 326 template \n+ 327 ForwardCaptureWrapper(TT&& t) : t_{std::forward(t)} {}\n+ 328\n+ 329 auto forward() const { return std::move(t_); }\n+ 330\n+ 331 T t_;\n+ 332 };\n+ 333\n+ 334 template \n+ 335 struct ForwardCaptureWrapper\n+ 336 {\n+ 337 ForwardCaptureWrapper(T& t) : t_{t} {}\n+ 338\n+ 339 T& forward() const { return t_; };\n+ 340\n+ 341 T& t_;\n+ 342 };\n+ 343\n+ 344 template \n+ 345 struct ForwardCaptureWrapper\n+ 346 {\n+ 347 ForwardCaptureWrapper(const T& t) : t_{t} {}\n+ 348\n+ 349 const T& forward() const { return t_; };\n+ 350\n+ 351 const T& t_;\n+ 352 };\n+ 353\n+ 354} // end namespace Dune::Functions::Impl\n+ 355\n+ 356\n+ 357\n+ 371template \n+372auto forwardCapture(T&& t)\n+ 373{\n+ 374 return Impl::ForwardCaptureWrapper(std::forward(t));\n+ 375}\n+ 376\n+ 377\n+ 378\n+ 379} // namespace Dune::Functions\n+ 380} // namespace Dune\n+ 381\n+ 382\n+ 383#endif // DUNE_FUNCTIONS_COMMON_UTILITY_HH\n+functionconcepts.hh\n+Dune::Functions::ExpandTuple\n+typename Imp::ExpandTupleHelper< T, ArgTuple >::Type ExpandTuple\n+Expand tuple arguments as template arguments.\n+Definition: utility.hh:94\n+Dune::Functions::TransformTuple\n+typename Imp::TransformTupleHelper< F, Tuples... >::Type TransformTuple\n+Transform tuple types argument using type-functor.\n+Definition: utility.hh:131\n+Dune::Functions::Concept::isCallable\n+static constexpr auto isCallable()\n+Check if f is callable with given argument list.\n+Definition: functionconcepts.hh:47\n+Dune::Functions::transformTuple\n+auto transformTuple(F &&f, const std::tuple< T... > &tuple) -> decltype(Imp::\n+transformTupleHelper(std::forward< F >(f), tuple, std::index_sequence_for< T...\n+>{}))\n+Transform tuple value using a functor.\n+Definition: utility.hh:165\n+Dune::Functions::callableCheck\n+auto callableCheck(Expression f)\n+Create a predicate for checking validity of expressions.\n+Definition: utility.hh:279\n+Dune::Functions::forwardAsStaticIndex\n+auto forwardAsStaticIndex(const size_type &i, F &&f, Args &&... args) -\n+> decltype(f(Dune::Indices::_0, std::forward< Args >(args)...))\n+Transform dynamic index to static index_constant.\n+Definition: utility.hh:60\n+Dune::Functions::negatePredicate\n+auto negatePredicate(Check check)\n+Negate given predicate.\n+Definition: utility.hh:304\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::PolymorphicType\n-Base class with polymorphic type boiler plate code.\n-Definition: interfaces.hh:25\n-Dune::Functions::PolymorphicType::clone\n-virtual Interface * clone(void *buffer) const =0\n-Clones the object into buffer.\n-Dune::Functions::PolymorphicType::clone\n-virtual Interface * clone() const =0\n-Clones the object.\n-Dune::Functions::PolymorphicType::move\n-virtual Interface * move(void *buffer)=0\n-Move object into buffer.\n-Dune::Functions::PolymorphicType::~PolymorphicType\n-virtual ~PolymorphicType()\n-Destructor.\n-Definition: interfaces.hh:29\n+Dune::Functions::forwardCapture\n+auto forwardCapture(T &&t)\n+Create a capture object for perfect forwarding.\n+Definition: utility.hh:372\n+Dune::Functions::forwardAsStaticInteger\n+auto forwardAsStaticInteger(std::integer_sequence< size_type, firstValue >\n+values, const size_type &i, F &&f, Args &&... args) -> decltype(f(std::\n+integral_constant< size_type, firstValue >(), std::forward< Args >(args)...))\n+Definition: utility.hh:21\n+Dune::Functions::IntegerSequenceTuple\n+typename Imp::IntegerSequenceTupleHelper< IntegerSequence >::Type\n+IntegerSequenceTuple\n+Transform integer_sequence to tuple...>\n+Definition: utility.hh:211\n+Dune::Functions::LastType\n+Get last entry of type list.\n+Definition: utility.hh:222\n+Dune::Functions::LastType::type\n+typename std::tuple_element< sizeof...(T) -1, std::tuple< T... > >::type type\n+Definition: utility.hh:223\n+Dune::Functions::RotateTuple\n+Rotate type list by one, such that last entry is moved to first position.\n+Definition: utility.hh:251\n+Dune::Functions::RotateTuple::type\n+typename Imp::RotateHelper< std::tuple< T... >, std::make_index_sequence<\n+sizeof...(T) -1 > >::type type\n+Definition: utility.hh:252\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00050.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00050.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: differentiablefunction.hh File Reference\n+dune-functions: staticforloop.hh File Reference\n \n \n \n \n \n \n \n@@ -63,44 +63,38 @@\n \n \n
    \n \n-
    differentiablefunction.hh File Reference
    \n+Namespaces |\n+Functions
    \n+
    staticforloop.hh File Reference
    \n \n
    \n-
    #include <type_traits>
    \n-#include <dune/common/typeutilities.hh>
    \n-#include <dune/functions/common/type_traits.hh>
    \n-#include <dune/functions/common/defaultderivativetraits.hh>
    \n-#include <dune/functions/common/differentiablefunction_imp.hh>
    \n-#include <dune/functions/common/signature.hh>
    \n-#include <dune/functions/common/typeerasure.hh>
    \n-#include <dune/functions/common/functionconcepts.hh>
    \n+
    #include <dune/common/concept.hh>
    \n+#include <dune/functions/common/type_traits.hh>
    \n+#include <dune/functions/functionspacebases/concepts.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n-\n-\n-\n-\n-\n-\n-

    \n-Classes

    class  Dune::Functions::DifferentiableFunction< Signature, DerivativeTraits, bufferSize >
     
    class  Dune::Functions::DifferentiableFunction< Range(Domain), DerivativeTraits, bufferSize >
     Class storing differentiable functions using type erasure. More...
     
    \n \n \n \n \n \n+

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n+\n+\n+\n+\n+\n

    \n+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. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,34 +5,26 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-Classes | Namespaces\n-differentiablefunction.hh File Reference\n-#include \n-#include \n+Namespaces | Functions\n+staticforloop.hh File Reference\n+#include \n #include \n-#include \n-#include \n-#include \n-#include \n-#include \n+#include \n Go_to_the_source_code_of_this_file.\n- Classes\n-class \u00a0Dune::Functions::DifferentiableFunction<_Signature,_DerivativeTraits,\n- bufferSize_>\n-\u00a0\n-class \u00a0Dune::Functions::DifferentiableFunction<_Range(Domain),\n- DerivativeTraits,_bufferSize_>\n-\u00a0 Class storing differentiable functions using type erasure. More...\n-\u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n+ Functions\n+template\n+void\u00a0Dune::Functions::staticFindInRange (F &&f, Args &&... args)\n+\u00a0 Static find loop. More...\n+\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00050_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00050_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: differentiablefunction.hh Source File\n+dune-functions: staticforloop.hh Source File\n \n \n \n \n \n \n \n@@ -62,128 +62,75 @@\n \n \n
    \n
    \n-
    differentiablefunction.hh
    \n+
    staticforloop.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH
    \n-
    4#define DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH
    \n+
    4#define DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH
    \n
    5
    \n-
    6#include <type_traits>
    \n-
    7
    \n-
    8#include <dune/common/typeutilities.hh>
    \n-
    9
    \n-\n-\n-\n-\n-\n-\n-
    16
    \n-
    17namespace Dune {
    \n-
    18namespace Functions {
    \n-
    19
    \n-
    20
    \n-
    21
    \n-
    22/*
    \n-
    23 * Default implementation is empty
    \n-
    24 * The actual implementation is only given if Signature is an type
    \n-
    25 * describing a function signature as Range(Domain).
    \n-
    26 */
    \n-
    27template<class Signature, template<class> class DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>
    \n-\n-
    29{};
    \n-
    30
    \n-
    31
    \n-
    32
    \n-
    33namespace Imp
    \n-
    34{
    \n-
    35
    \n-
    37 template<class S, template<class> class DerivativeTraits, size_t bufferSize>
    \n-
    38 struct DifferentiableFunctionTraits
    \n-
    39 {
    \n-
    41 using Signature = S;
    \n-
    42
    \n-
    44 using Range = typename SignatureTraits<Signature>::Range;
    \n-
    45
    \n-
    47 using Domain = typename SignatureTraits<Signature>::Domain;
    \n-
    48
    \n-
    50 using DerivativeSignature = typename SignatureTraits<Signature>::template DerivativeSignature<DerivativeTraits>;
    \n-
    51
    \n-\n-
    54
    \n-
    56 using Concept = DifferentiableFunctionWrapperInterface<Signature, DerivativeInterface>;
    \n-
    57
    \n-
    59 template<class B>
    \n-
    60 using Model = DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>;
    \n-
    61 };
    \n-
    62}
    \n-
    63
    \n+
    6
    \n+
    7#include <dune/common/concept.hh>
    \n+
    8
    \n+\n+\n+
    11
    \n+
    12
    \n+
    13namespace Dune {
    \n+
    14namespace Functions {
    \n+
    15
    \n+
    16namespace Imp {
    \n+
    17
    \n+
    18template<class ST, ST begin, ST end>
    \n+
    19struct StaticFindInRange
    \n+
    20{
    \n+
    21 template<class F, class...Args>
    \n+
    22 static void apply(F&& f, Args&&... args)
    \n+
    23 {
    \n+
    24 if (f(std::integral_constant<ST, begin>(), std::forward<Args>(args)...))
    \n+
    25 return;
    \n+
    26 StaticFindInRange<ST, begin+1, end>::apply(std::forward<F>(f), std::forward<Args>(args)...);
    \n+
    27 }
    \n+
    28};
    \n+
    29
    \n+
    30template<class ST, ST end>
    \n+
    31struct StaticFindInRange<ST, end, end>
    \n+
    32{
    \n+
    33 template<class F, class...Args>
    \n+
    34 static void apply(F&& f, Args&&...)
    \n+
    35 {}
    \n+
    36};
    \n+
    37
    \n+
    38} //end namespace Imp
    \n+
    39
    \n+
    40
    \n+
    41
    \n+
    55template<std::size_t begin_t, std::size_t end_t, class F, class... Args>
    \n+
    56void staticFindInRange(F&& f, Args&&... args)
    \n+
    57{
    \n+
    58 Imp::StaticFindInRange<std::size_t, begin_t, end_t>::apply(std::forward<F>(f), std::forward<Args>(args)...);
    \n+
    59}
    \n+
    60
    \n+
    61
    \n+
    62} // namespace Dune::Functions
    \n+
    63} // namespace Dune
    \n
    64
    \n
    65
    \n-
    80template<class Range, class Domain, template<class> class DerivativeTraits, size_t bufferSize>
    \n-
    81class DifferentiableFunction< Range(Domain), DerivativeTraits, bufferSize> :
    \n-
    82 public TypeErasureBase<
    \n-
    83 typename Imp::DifferentiableFunctionTraits<Range(Domain), DerivativeTraits, bufferSize>::Concept,
    \n-
    84 Imp::DifferentiableFunctionTraits<Range(Domain), DerivativeTraits, bufferSize>::template Model>
    \n-
    85{
    \n-
    86 using Traits = Imp::DifferentiableFunctionTraits<Range(Domain), DerivativeTraits, bufferSize>;
    \n-
    87
    \n-\n-
    89
    \n-
    90 using DerivativeInterface = typename Traits::DerivativeInterface;
    \n-
    91
    \n-
    92public:
    \n-
    93
    \n-
    105 template<class F, disableCopyMove<DifferentiableFunction, F> = 0 >
    \n-\n-
    107 Base(std::forward<F>(f))
    \n-
    108 {
    \n-
    109 static_assert(Dune::Functions::Concept::isFunction<F, Range(Domain)>(), "Trying to construct a DifferentiableFunction from type that does not model the Function concept");
    \n-
    110 }
    \n-
    111
    \n-\n-
    114
    \n-
    118 Range operator() (const Domain& x) const
    \n-
    119 {
    \n-
    120 return this->asInterface().operator()(x);
    \n-
    121 }
    \n-
    122
    \n-
    130 friend DerivativeInterface derivative(const DifferentiableFunction& t)
    \n-
    131 {
    \n-
    132 return t.asInterface().derivative();
    \n-
    133 }
    \n-
    134};
    \n-
    135
    \n-
    136
    \n-
    137
    \n-
    138}} // namespace Dune::Functions
    \n-
    139
    \n-
    140
    \n-
    141
    \n-
    142#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH
    \n-\n-\n-\n-\n-\n-\n-
    friend DerivativeInterface derivative(const DifferentiableFunction &t)
    Get derivative of wrapped function.
    Definition: differentiablefunction.hh:130
    \n+
    66
    \n+
    67#endif //DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH
    \n+\n+
    void staticFindInRange(F &&f, Args &&... args)
    Static find loop.
    Definition: staticforloop.hh:56
    \n
    Definition: polynomial.hh:10
    \n-
    Definition: differentiablefunction.hh:29
    \n-
    DifferentiableFunction(F &&f)
    Construct from function.
    Definition: differentiablefunction.hh:106
    \n-\n-
    Helper class to deduce the signature of a callable.
    Definition: signature.hh:56
    \n-
    Base class for type-erased interface wrapper.
    Definition: typeerasure.hh:165
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,153 +5,76 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-differentiablefunction.hh\n+staticforloop.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH\n- 4#define DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH\n+ 3#ifndef DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH\n+ 4#define DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH\n 5\n- 6#include \n- 7\n- 8#include \n- 9\n- 10#include \n- 11#include \n- 12#include \n- 13#include \n- 14#include \n- 15#include \n- 16\n- 17namespace Dune {\n- 18namespace Functions {\n- 19\n- 20\n- 21\n- 22/*\n- 23 * Default implementation is empty\n- 24 * The actual implementation is only given if Signature is an type\n- 25 * describing a function signature as Range(Domain).\n- 26 */\n- 27template class\n-DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>\n-28class DifferentiableFunction\n- 29{};\n- 30\n- 31\n- 32\n- 33namespace Imp\n- 34{\n- 35\n- 37 template class DerivativeTraits, size_t\n-bufferSize>\n- 38 struct DifferentiableFunctionTraits\n- 39 {\n- 41 using Signature = S;\n- 42\n- 44 using Range = typename SignatureTraits::Range;\n- 45\n- 47 using Domain = typename SignatureTraits::Domain;\n- 48\n- 50 using DerivativeSignature = typename SignatureTraits::template\n-DerivativeSignature;\n- 51\n- 53 using DerivativeInterface = DifferentiableFunction;\n- 54\n- 56 using Concept = DifferentiableFunctionWrapperInterface;\n- 57\n- 59 template\n- 60 using Model = DifferentiableFunctionWrapperImplementation;\n- 61 };\n- 62}\n- 63\n+ 6\n+ 7#include \n+ 8\n+ 9#include \n+ 10#include \n+ 11\n+ 12\n+ 13namespace Dune {\n+ 14namespace Functions {\n+ 15\n+ 16namespace Imp {\n+ 17\n+ 18template\n+ 19struct StaticFindInRange\n+ 20{\n+ 21 template\n+ 22 static void apply(F&& f, Args&&... args)\n+ 23 {\n+ 24 if (f(std::integral_constant(), std::forward(args)...))\n+ 25 return;\n+ 26 StaticFindInRange::apply(std::forward(f), std::\n+forward(args)...);\n+ 27 }\n+ 28};\n+ 29\n+ 30template\n+ 31struct StaticFindInRange\n+ 32{\n+ 33 template\n+ 34 static void apply(F&& f, Args&&...)\n+ 35 {}\n+ 36};\n+ 37\n+ 38} //end namespace Imp\n+ 39\n+ 40\n+ 41\n+ 55template\n+56void staticFindInRange(F&& f, Args&&... args)\n+ 57{\n+ 58 Imp::StaticFindInRange::apply(std::forward\n+(f), std::forward(args)...);\n+ 59}\n+ 60\n+ 61\n+ 62} // namespace Dune::Functions\n+ 63} // namespace Dune\n 64\n 65\n- 80template class DerivativeTraits,\n-size_t bufferSize>\n-81class DifferentiableFunction< Range(Domain), DerivativeTraits, bufferSize> :\n- 82 public TypeErasureBase<\n- 83 typename Imp::DifferentiableFunctionTraits::Concept,\n- 84 Imp::DifferentiableFunctionTraits::template Model>\n- 85{\n- 86 using Traits = Imp::DifferentiableFunctionTraits;\n- 87\n- 88 using Base = TypeErasureBase;\n- 89\n- 90 using DerivativeInterface = typename Traits::DerivativeInterface;\n- 91\n- 92public:\n- 93\n- 105 template = 0 >\n-106 DifferentiableFunction(F&& f) :\n- 107 Base(std::forward(f))\n- 108 {\n- 109 static_assert(Dune::Functions::Concept::isFunction(),\n-\"Trying to construct a DifferentiableFunction from type that does not model the\n-Function concept\");\n- 110 }\n- 111\n-113 DifferentiableFunction() = default;\n- 114\n-118 Range operator() (const Domain& x) const\n- 119 {\n- 120 return this->asInterface().operator()(x);\n- 121 }\n- 122\n-130 friend DerivativeInterface derivative(const DifferentiableFunction& t)\n- 131 {\n- 132 return t.asInterface().derivative();\n- 133 }\n- 134};\n- 135\n- 136\n- 137\n- 138}} // namespace Dune::Functions\n- 139\n- 140\n- 141\n- 142#endif // DUNE_FUNCTIONS_COMMON_DIFFERENTIABLE_FUNCTION_HH\n-typeerasure.hh\n+ 66\n+ 67#endif //DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH\n type_traits.hh\n-differentiablefunction_imp.hh\n-signature.hh\n-functionconcepts.hh\n-defaultderivativetraits.hh\n-Dune::Functions::DifferentiableFunction<_Range(Domain),_DerivativeTraits,\n-bufferSize_>::derivative\n-friend DerivativeInterface derivative(const DifferentiableFunction &t)\n-Get derivative of wrapped function.\n-Definition: differentiablefunction.hh:130\n+Dune::Functions::staticFindInRange\n+void staticFindInRange(F &&f, Args &&... args)\n+Static find loop.\n+Definition: staticforloop.hh:56\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::DifferentiableFunction\n-Definition: differentiablefunction.hh:29\n-Dune::Functions::DifferentiableFunction<_Range(Domain),_DerivativeTraits,\n-bufferSize_>::DifferentiableFunction\n-DifferentiableFunction(F &&f)\n-Construct from function.\n-Definition: differentiablefunction.hh:106\n-Dune::Functions::DifferentiableFunction<_Range(Domain),_DerivativeTraits,\n-bufferSize_>::DifferentiableFunction\n-DifferentiableFunction()=default\n-Default constructor.\n-Dune::Functions::SignatureTraits\n-Helper class to deduce the signature of a callable.\n-Definition: signature.hh:56\n-Dune::Functions::TypeErasureBase\n-Base class for type-erased interface wrapper.\n-Definition: typeerasure.hh:165\n+concepts.hh\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00053.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00053.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: treedata.hh File Reference\n+dune-functions: interfaces.hh File Reference\n \n \n \n \n \n \n \n@@ -65,38 +65,25 @@\n
  • dune
  • functions
  • common
  • \n \n \n
    \n \n-
    treedata.hh File Reference
    \n+
    interfaces.hh File Reference
    \n
    \n
    \n-
    #include <memory>
    \n-#include <dune/common/shared_ptr.hh>
    \n-#include <dune/typetree/pairtraversal.hh>
    \n-#include <dune/functions/gridfunctions/gridviewentityset.hh>
    \n-#include <dune/functions/gridfunctions/gridfunction.hh>
    \n+
    #include <type_traits>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n \n

    \n 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::PolymorphicType< Interface >
     Base class with polymorphic type boiler plate code. More...
     
    \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,34 +6,20 @@\n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n Classes | Namespaces\n-treedata.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n+interfaces.hh File Reference\n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0Dune::Functions::UniformNodeVisitor<_SimpleNodeVisitorImp,_leafOnly_>\n-\u00a0 Mixin for visitors that should apply the same action on all nodes.\n- More...\n-\u00a0\n- class \u00a0Dune::Functions::TreeData<_T,_ND,_LO_>\n-\u00a0 Container allowing to attach data to each node of a tree. More...\n-\u00a0\n-struct \u00a0Dune::Functions::TreeData<_T,_ND,_LO_>::InitVisitor\n-\u00a0\n-struct \u00a0Dune::Functions::TreeData<_T,_ND,_LO_>::DestroyVisitor\n-\u00a0\n-struct \u00a0Dune::Functions::TreeData<_T,_ND,_LO_>::CopyVisitor\n+class \u00a0Dune::Functions::PolymorphicType<_Interface_>\n+\u00a0 Base class with polymorphic type boiler plate code. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n \n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00053_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00053_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: treedata.hh Source File\n+dune-functions: interfaces.hh Source File\n \n \n \n \n \n \n \n@@ -62,256 +62,56 @@\n \n \n \n
    \n-
    treedata.hh
    \n+
    interfaces.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_COMMON_TREEDATA_HH
    \n-
    4#define DUNE_FUNCTIONS_COMMON_TREEDATA_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_COMMON_INTERFACES_HH
    \n+
    4#define DUNE_FUNCTIONS_COMMON_INTERFACES_HH
    \n
    5
    \n-
    6
    \n-
    7#warning This file is deprecated. Please use TreeContainer from dune-typetree instead.
    \n+
    6#include <type_traits>
    \n+
    7
    \n
    8
    \n-
    9#include <memory>
    \n-
    10
    \n-
    11#include <dune/common/shared_ptr.hh>
    \n+
    9namespace Dune {
    \n+
    10namespace Functions {
    \n+
    11
    \n
    12
    \n-
    13#include <dune/typetree/pairtraversal.hh>
    \n-
    14
    \n-\n-\n-
    17
    \n-
    18namespace Dune {
    \n-
    19namespace Functions {
    \n-
    20
    \n-
    34template<class SimpleNodeVisitorImp, bool leafOnly>
    \n-
    35struct
    \n-
    36[[deprecated("This is an implementation detail of the deprecated class TreeDate and thus deprecated itself.")]]
    \n-\n-
    38 public TypeTree::TreeVisitor,
    \n-
    39 public TypeTree::DynamicTraversal
    \n-
    40{
    \n-
    41 // This is only enabled, if we want to incorporate inner nodes.
    \n-
    42 // Checking leafOnly would be sufficient, but for SFINAE the
    \n-
    43 // the enable_if condition must depend on the template parameter.
    \n-
    44 template<typename Node, typename TreePath,
    \n-
    45 typename std::enable_if<(not leafOnly) and (not Node::isLeaf), int>::type = 0>
    \n-
    46 void pre(Node& node, TreePath treePath)
    \n-
    47 {
    \n-
    48 static_cast<SimpleNodeVisitorImp*>(this)->apply(node, treePath);
    \n-
    49 }
    \n-
    50
    \n-
    51 template<typename Node, typename TreePath,
    \n-
    52 typename std::enable_if<(leafOnly) and (not Node::isLeaf), int>::type = 0>
    \n-
    53 void pre(Node& node, TreePath treePath)
    \n-
    54 {}
    \n-
    55
    \n-
    56 template<typename Node, typename TreePath>
    \n-
    57 void leaf(Node& node, TreePath treePath)
    \n-
    58 {
    \n-
    59 static_cast<SimpleNodeVisitorImp*>(this)->apply(node, treePath);
    \n-
    60 }
    \n-
    61};
    \n-
    62
    \n-
    63
    \n+
    13
    \n+
    23template<class Interface>
    \n+\n+
    25{
    \n+
    26public:
    \n+
    27
    \n+\n+
    30 {}
    \n+
    31
    \n+
    40 virtual Interface* clone() const = 0;
    \n+
    41
    \n+
    51 virtual Interface* clone(void* buffer) const = 0;
    \n+
    52
    \n+
    62 virtual Interface* move(void* buffer) = 0;
    \n+
    63};
    \n
    64
    \n-
    91template<class T, template<class> class ND, bool LO>
    \n-
    92class
    \n-
    93[[deprecated("This class is deprecated. Please use TreeContainer from dune-typetree instead.")]]
    \n-\n-
    95{
    \n-
    96
    \n-
    97public:
    \n-
    98
    \n-
    100 using Tree = T;
    \n-
    101
    \n-
    103 using size_type = typename Tree::size_type;
    \n-
    104
    \n-
    106 static const bool leafOnly = LO;
    \n-
    107
    \n-
    109 template<class Node>
    \n-
    110 using NodeData = ND<Node>;
    \n-
    111
    \n-
    112protected:
    \n-
    113 using RawContainer = std::vector<void*>;
    \n-
    114
    \n-
    115
    \n-
    116 // Since we can generate the node data type only if
    \n-
    117 // we know the type of the node, we have to do
    \n-
    118 // initialization, copy, and destruction via a
    \n-
    119 // tree traversal. Once we can use C++14 this can
    \n-
    120 // be written in a much easier and more selfcontained
    \n-
    121 // ways using generic lambda functions.
    \n-
    122 // Until then we need explicit visitor classes for
    \n-
    123 // each operation.
    \n-
    124
    \n-
    125 struct InitVisitor :
    \n-
    126 public UniformNodeVisitor<InitVisitor, leafOnly>
    \n-
    127 {
    \n-\n-
    129 data_(data)
    \n-
    130 {}
    \n-
    131
    \n-
    132 template<typename Node, typename TreePath>
    \n-
    133 void apply(Node& node, TreePath treePath)
    \n-
    134 {
    \n-
    135 auto&& index = node.treeIndex();
    \n-
    136 if (data_.size() < index+1)
    \n-
    137 data_.resize(index+1, nullptr);
    \n-
    138 data_[index] = new NodeData<Node>;
    \n-
    139 }
    \n-
    140
    \n-
    141
    \n-\n-
    143 };
    \n-
    144
    \n-\n-
    146 public UniformNodeVisitor<DestroyVisitor, leafOnly>
    \n-
    147 {
    \n-\n-
    149 data_(data)
    \n-
    150 {}
    \n-
    151
    \n-
    152 template<typename Node, typename TreePath>
    \n-
    153 void apply(Node& node, TreePath treePath)
    \n-
    154 {
    \n-
    155 auto&& index = node.treeIndex();
    \n-
    156 auto p = (NodeData<Node>*)(data_[index]);
    \n-
    157 delete p;
    \n-
    158 data_[index] = nullptr;
    \n-
    159 }
    \n-
    160
    \n-\n-
    162 };
    \n-
    163
    \n-
    164 struct CopyVisitor :
    \n-
    165 public UniformNodeVisitor<CopyVisitor, leafOnly>
    \n-
    166 {
    \n-
    167 CopyVisitor(TreeData& thisTD, const TreeData& otherTD) :
    \n-
    168 thisTD_(thisTD),
    \n-
    169 otherTD_(otherTD)
    \n-
    170 {}
    \n-
    171
    \n-
    172 template<typename Node, typename TreePath>
    \n-
    173 void apply(Node& node, TreePath treePath)
    \n-
    174 {
    \n-
    175 thisTD_[node] = otherTD_[node];
    \n-
    176 }
    \n-
    177
    \n-\n-\n-
    180 };
    \n-
    181
    \n-
    182public:
    \n-
    183
    \n-\n-
    186 tree_(nullptr)
    \n-
    187 {}
    \n-
    188
    \n-
    196 void init(const Tree& tree)
    \n-
    197 {
    \n-
    198 if (tree_)
    \n-
    199 destroy();
    \n-
    200 tree_ = &tree;
    \n-
    201 TypeTree::applyToTree(*tree_, InitVisitor(data_));
    \n-
    202 }
    \n-
    203
    \n-
    205 TreeData(const TreeData& other) :
    \n-
    206 tree_(other.tree_)
    \n-
    207 {
    \n-
    208 TypeTree::applyToTree(*tree_, InitVisitor(data_));
    \n-
    209 TypeTree::applyToTree(*tree_, CopyVisitor(*this, other));
    \n-
    210 }
    \n-
    211
    \n-\n-
    214 {
    \n-
    215 if (tree_)
    \n-
    216 TypeTree::applyToTree(*tree_, DestroyVisitor(data_));
    \n-
    217 tree_ = other.tree_;
    \n-
    218 TypeTree::applyToTree(*tree_, CopyVisitor(*this, other));
    \n-
    219 return *this;
    \n-
    220 }
    \n-
    221
    \n-
    223 void destroy()
    \n-
    224 {
    \n-
    225 if (tree_)
    \n-
    226 TypeTree::applyToTree(*tree_, DestroyVisitor(data_));
    \n-
    227 tree_ = nullptr;
    \n-
    228 }
    \n-
    229
    \n-\n-
    232 {
    \n-
    233 if (tree_)
    \n-
    234 TypeTree::applyToTree(*tree_, DestroyVisitor(data_));
    \n-
    235 }
    \n-
    236
    \n-
    238 template<class Node>
    \n-
    239 NodeData<Node>& operator[](const Node& node)
    \n-
    240 {
    \n-
    241 return *(NodeData<Node>*)(data_[node.treeIndex()]);
    \n-
    242 }
    \n-
    243
    \n-
    245 template<class Node>
    \n-
    246 const NodeData<Node>& operator[](const Node& node) const
    \n-
    247 {
    \n-
    248 return *(NodeData<Node>*)(data_[node.treeIndex()]);
    \n-
    249 }
    \n-
    250
    \n-
    251protected:
    \n-
    252
    \n-
    253 const Tree* tree_;
    \n-\n-
    255};
    \n-
    256
    \n-
    257
    \n-
    258
    \n-
    259} // namespace Functions
    \n-
    260} // namespace Dune
    \n-
    261
    \n-
    262#endif // DUNE_FUNCTIONS_COMMON_TREEDATA_HH
    \n-\n-\n+
    65
    \n+
    66
    \n+
    67}} // namespace Dune::Functions
    \n+
    68
    \n+
    69#endif // DUNE_FUNCTIONS_COMMON_EXTENDED_CLONEABLE_HH
    \n
    Definition: polynomial.hh:10
    \n-
    Mixin for visitors that should apply the same action on all nodes.
    Definition: treedata.hh:40
    \n-
    void pre(Node &node, TreePath treePath)
    Definition: treedata.hh:46
    \n-
    void leaf(Node &node, TreePath treePath)
    Definition: treedata.hh:57
    \n-
    Container allowing to attach data to each node of a tree.
    Definition: treedata.hh:95
    \n-
    TreeData(const TreeData &other)
    Copy constructor.
    Definition: treedata.hh:205
    \n-
    void init(const Tree &tree)
    Initialize from tree.
    Definition: treedata.hh:196
    \n-
    T Tree
    Type of tree the data is associated with.
    Definition: treedata.hh:100
    \n-
    const Tree * tree_
    Definition: treedata.hh:253
    \n-
    void destroy()
    Destroy data.
    Definition: treedata.hh:223
    \n-
    const NodeData< Node > & operator[](const Node &node) const
    Get reference to data associated to given node.
    Definition: treedata.hh:246
    \n-
    TreeData & operator=(const TreeData &other)
    Copy assignment.
    Definition: treedata.hh:213
    \n-
    ~TreeData()
    Destructor.
    Definition: treedata.hh:231
    \n-
    ND< Node > NodeData
    Template to determine the data type for given node type.
    Definition: treedata.hh:110
    \n-
    TreeData()
    Default constructor.
    Definition: treedata.hh:185
    \n-
    std::vector< void * > RawContainer
    Definition: treedata.hh:113
    \n-
    NodeData< Node > & operator[](const Node &node)
    Get mutable reference to data associated to given node.
    Definition: treedata.hh:239
    \n-
    typename Tree::size_type size_type
    Type used for indices and size information.
    Definition: treedata.hh:103
    \n-
    RawContainer data_
    Definition: treedata.hh:254
    \n-
    Definition: treedata.hh:127
    \n-
    InitVisitor(RawContainer &data)
    Definition: treedata.hh:128
    \n-
    void apply(Node &node, TreePath treePath)
    Definition: treedata.hh:133
    \n-
    RawContainer & data_
    Definition: treedata.hh:142
    \n-\n-
    RawContainer & data_
    Definition: treedata.hh:161
    \n-
    DestroyVisitor(RawContainer &data)
    Definition: treedata.hh:148
    \n-
    void apply(Node &node, TreePath treePath)
    Definition: treedata.hh:153
    \n-
    Definition: treedata.hh:166
    \n-
    CopyVisitor(TreeData &thisTD, const TreeData &otherTD)
    Definition: treedata.hh:167
    \n-
    void apply(Node &node, TreePath treePath)
    Definition: treedata.hh:173
    \n-
    TreeData & thisTD_
    Definition: treedata.hh:178
    \n-
    const TreeData & otherTD_
    Definition: treedata.hh:179
    \n+
    Base class with polymorphic type boiler plate code.
    Definition: interfaces.hh:25
    \n+
    virtual Interface * clone(void *buffer) const =0
    Clones the object into buffer.
    \n+
    virtual Interface * clone() const =0
    Clones the object.
    \n+
    virtual Interface * move(void *buffer)=0
    Move object into buffer.
    \n+
    virtual ~PolymorphicType()
    Destructor.
    Definition: interfaces.hh:29
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,326 +5,63 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-treedata.hh\n+interfaces.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_COMMON_TREEDATA_HH\n- 4#define DUNE_FUNCTIONS_COMMON_TREEDATA_HH\n+ 3#ifndef DUNE_FUNCTIONS_COMMON_INTERFACES_HH\n+ 4#define DUNE_FUNCTIONS_COMMON_INTERFACES_HH\n 5\n- 6\n- 7#warning This file is deprecated. Please use TreeContainer from dune-typetree\n-instead.\n+ 6#include \n+ 7\n 8\n- 9#include \n- 10\n- 11#include \n+ 9namespace Dune {\n+ 10namespace Functions {\n+ 11\n 12\n- 13#include \n- 14\n- 15#include \n- 16#include \n- 17\n- 18namespace Dune {\n- 19namespace Functions {\n- 20\n- 34template\n-35struct\n- 36[[deprecated(\"This is an implementation detail of the deprecated class\n-TreeDate and thus deprecated itself.\")]]\n- 37UniformNodeVisitor :\n- 38 public TypeTree::TreeVisitor,\n- 39 public TypeTree::DynamicTraversal\n- 40{\n- 41 // This is only enabled, if we want to incorporate inner nodes.\n- 42 // Checking leafOnly would be sufficient, but for SFINAE the\n- 43 // the enable_if condition must depend on the template parameter.\n- 44 template::type =\n-0>\n-46 void pre(Node& node, TreePath treePath)\n- 47 {\n- 48 static_cast(this)->apply(node, treePath);\n- 49 }\n- 50\n- 51 template::type = 0>\n-53 void pre(Node& node, TreePath treePath)\n- 54 {}\n- 55\n- 56 template\n-57 void leaf(Node& node, TreePath treePath)\n- 58 {\n- 59 static_cast(this)->apply(node, treePath);\n- 60 }\n- 61};\n- 62\n- 63\n+ 13\n+ 23template\n+24class PolymorphicType\n+ 25{\n+ 26public:\n+ 27\n+29 virtual ~PolymorphicType()\n+ 30 {}\n+ 31\n+40 virtual Interface* clone() const = 0;\n+ 41\n+51 virtual Interface* clone(void* buffer) const = 0;\n+ 52\n+62 virtual Interface* move(void* buffer) = 0;\n+ 63};\n 64\n- 91template class ND, bool LO>\n-92class\n- 93[[deprecated(\"This class is deprecated. Please use TreeContainer from dune-\n-typetree instead.\")]]\n- 94TreeData\n- 95{\n- 96\n- 97public:\n- 98\n-100 using Tree = T;\n- 101\n-103 using size_type = typename Tree::size_type;\n- 104\n-106 static const bool leafOnly = LO;\n- 107\n- 109 template\n-110 using NodeData = ND;\n- 111\n- 112protected:\n-113 using RawContainer = std::vector;\n- 114\n- 115\n- 116 // Since we can generate the node data type only if\n- 117 // we know the type of the node, we have to do\n- 118 // initialization, copy, and destruction via a\n- 119 // tree traversal. Once we can use C++14 this can\n- 120 // be written in a much easier and more selfcontained\n- 121 // ways using generic lambda functions.\n- 122 // Until then we need explicit visitor classes for\n- 123 // each operation.\n- 124\n-125 struct InitVisitor :\n- 126 public UniformNodeVisitor\n- 127 {\n-128 InitVisitor(RawContainer& data) :\n- 129 data_(data)\n- 130 {}\n- 131\n- 132 template\n-133 void apply(Node& node, TreePath treePath)\n- 134 {\n- 135 auto&& index = node.treeIndex();\n- 136 if (data_.size() < index+1)\n- 137 data_.resize(index+1, nullptr);\n- 138 data_[index] = new NodeData;\n- 139 }\n- 140\n- 141\n-142 RawContainer& data_;\n- 143 };\n- 144\n-145 struct DestroyVisitor :\n- 146 public UniformNodeVisitor\n- 147 {\n-148 DestroyVisitor(RawContainer& data) :\n- 149 data_(data)\n- 150 {}\n- 151\n- 152 template\n-153 void apply(Node& node, TreePath treePath)\n- 154 {\n- 155 auto&& index = node.treeIndex();\n- 156 auto p = (NodeData*)(data_[index]);\n- 157 delete p;\n- 158 data_[index] = nullptr;\n- 159 }\n- 160\n-161 RawContainer& data_;\n- 162 };\n- 163\n-164 struct CopyVisitor :\n- 165 public UniformNodeVisitor\n- 166 {\n-167 CopyVisitor(TreeData& thisTD, const TreeData& otherTD) :\n- 168 thisTD_(thisTD),\n- 169 otherTD_(otherTD)\n- 170 {}\n- 171\n- 172 template\n-173 void apply(Node& node, TreePath treePath)\n- 174 {\n- 175 thisTD_[node] = otherTD_[node];\n- 176 }\n- 177\n-178 TreeData& thisTD_;\n-179 const TreeData& otherTD_;\n- 180 };\n- 181\n- 182public:\n- 183\n-185 TreeData() :\n- 186 tree_(nullptr)\n- 187 {}\n- 188\n-196 void init(const Tree& tree)\n- 197 {\n- 198 if (tree_)\n- 199 destroy();\n- 200 tree_ = &tree;\n- 201 TypeTree::applyToTree(*tree_, InitVisitor(data_));\n- 202 }\n- 203\n-205 TreeData(const TreeData& other) :\n- 206 tree_(other.tree_)\n- 207 {\n- 208 TypeTree::applyToTree(*tree_, InitVisitor(data_));\n- 209 TypeTree::applyToTree(*tree_, CopyVisitor(*this, other));\n- 210 }\n- 211\n-213 TreeData& operator=(const TreeData& other)\n- 214 {\n- 215 if (tree_)\n- 216 TypeTree::applyToTree(*tree_, DestroyVisitor(data_));\n- 217 tree_ = other.tree_;\n- 218 TypeTree::applyToTree(*tree_, CopyVisitor(*this, other));\n- 219 return *this;\n- 220 }\n- 221\n-223 void destroy()\n- 224 {\n- 225 if (tree_)\n- 226 TypeTree::applyToTree(*tree_, DestroyVisitor(data_));\n- 227 tree_ = nullptr;\n- 228 }\n- 229\n-231 ~TreeData()\n- 232 {\n- 233 if (tree_)\n- 234 TypeTree::applyToTree(*tree_, DestroyVisitor(data_));\n- 235 }\n- 236\n- 238 template\n-239 NodeData& operator[](const Node& node)\n- 240 {\n- 241 return *(NodeData*)(data_[node.treeIndex()]);\n- 242 }\n- 243\n- 245 template\n-246 const NodeData& operator[](const Node& node) const\n- 247 {\n- 248 return *(NodeData*)(data_[node.treeIndex()]);\n- 249 }\n- 250\n- 251protected:\n- 252\n-253 const Tree* tree_;\n-254 RawContainer data_;\n- 255};\n- 256\n- 257\n- 258\n- 259} // namespace Functions\n- 260} // namespace Dune\n- 261\n- 262#endif // DUNE_FUNCTIONS_COMMON_TREEDATA_HH\n-gridviewentityset.hh\n-gridfunction.hh\n+ 65\n+ 66\n+ 67}} // namespace Dune::Functions\n+ 68\n+ 69#endif // DUNE_FUNCTIONS_COMMON_EXTENDED_CLONEABLE_HH\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::UniformNodeVisitor\n-Mixin for visitors that should apply the same action on all nodes.\n-Definition: treedata.hh:40\n-Dune::Functions::UniformNodeVisitor::pre\n-void pre(Node &node, TreePath treePath)\n-Definition: treedata.hh:46\n-Dune::Functions::UniformNodeVisitor::leaf\n-void leaf(Node &node, TreePath treePath)\n-Definition: treedata.hh:57\n-Dune::Functions::TreeData\n-Container allowing to attach data to each node of a tree.\n-Definition: treedata.hh:95\n-Dune::Functions::TreeData::TreeData\n-TreeData(const TreeData &other)\n-Copy constructor.\n-Definition: treedata.hh:205\n-Dune::Functions::TreeData::init\n-void init(const Tree &tree)\n-Initialize from tree.\n-Definition: treedata.hh:196\n-Dune::Functions::TreeData::Tree\n-T Tree\n-Type of tree the data is associated with.\n-Definition: treedata.hh:100\n-Dune::Functions::TreeData::tree_\n-const Tree * tree_\n-Definition: treedata.hh:253\n-Dune::Functions::TreeData::destroy\n-void destroy()\n-Destroy data.\n-Definition: treedata.hh:223\n-Dune::Functions::TreeData::operator[]\n-const NodeData< Node > & operator[](const Node &node) const\n-Get reference to data associated to given node.\n-Definition: treedata.hh:246\n-Dune::Functions::TreeData::operator=\n-TreeData & operator=(const TreeData &other)\n-Copy assignment.\n-Definition: treedata.hh:213\n-Dune::Functions::TreeData::~TreeData\n-~TreeData()\n+Dune::Functions::PolymorphicType\n+Base class with polymorphic type boiler plate code.\n+Definition: interfaces.hh:25\n+Dune::Functions::PolymorphicType::clone\n+virtual Interface * clone(void *buffer) const =0\n+Clones the object into buffer.\n+Dune::Functions::PolymorphicType::clone\n+virtual Interface * clone() const =0\n+Clones the object.\n+Dune::Functions::PolymorphicType::move\n+virtual Interface * move(void *buffer)=0\n+Move object into buffer.\n+Dune::Functions::PolymorphicType::~PolymorphicType\n+virtual ~PolymorphicType()\n Destructor.\n-Definition: treedata.hh:231\n-Dune::Functions::TreeData::NodeData\n-ND< Node > NodeData\n-Template to determine the data type for given node type.\n-Definition: treedata.hh:110\n-Dune::Functions::TreeData::TreeData\n-TreeData()\n-Default constructor.\n-Definition: treedata.hh:185\n-Dune::Functions::TreeData::RawContainer\n-std::vector< void * > RawContainer\n-Definition: treedata.hh:113\n-Dune::Functions::TreeData::operator[]\n-NodeData< Node > & operator[](const Node &node)\n-Get mutable reference to data associated to given node.\n-Definition: treedata.hh:239\n-Dune::Functions::TreeData::size_type\n-typename Tree::size_type size_type\n-Type used for indices and size information.\n-Definition: treedata.hh:103\n-Dune::Functions::TreeData::data_\n-RawContainer data_\n-Definition: treedata.hh:254\n-Dune::Functions::TreeData::InitVisitor\n-Definition: treedata.hh:127\n-Dune::Functions::TreeData::InitVisitor::InitVisitor\n-InitVisitor(RawContainer &data)\n-Definition: treedata.hh:128\n-Dune::Functions::TreeData::InitVisitor::apply\n-void apply(Node &node, TreePath treePath)\n-Definition: treedata.hh:133\n-Dune::Functions::TreeData::InitVisitor::data_\n-RawContainer & data_\n-Definition: treedata.hh:142\n-Dune::Functions::TreeData::DestroyVisitor\n-Definition: treedata.hh:147\n-Dune::Functions::TreeData::DestroyVisitor::data_\n-RawContainer & data_\n-Definition: treedata.hh:161\n-Dune::Functions::TreeData::DestroyVisitor::DestroyVisitor\n-DestroyVisitor(RawContainer &data)\n-Definition: treedata.hh:148\n-Dune::Functions::TreeData::DestroyVisitor::apply\n-void apply(Node &node, TreePath treePath)\n-Definition: treedata.hh:153\n-Dune::Functions::TreeData::CopyVisitor\n-Definition: treedata.hh:166\n-Dune::Functions::TreeData::CopyVisitor::CopyVisitor\n-CopyVisitor(TreeData &thisTD, const TreeData &otherTD)\n-Definition: treedata.hh:167\n-Dune::Functions::TreeData::CopyVisitor::apply\n-void apply(Node &node, TreePath treePath)\n-Definition: treedata.hh:173\n-Dune::Functions::TreeData::CopyVisitor::thisTD_\n-TreeData & thisTD_\n-Definition: treedata.hh:178\n-Dune::Functions::TreeData::CopyVisitor::otherTD_\n-const TreeData & otherTD_\n-Definition: treedata.hh:179\n+Definition: interfaces.hh:29\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00056.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00056.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: callable.hh File Reference\n+dune-functions: multiindex.hh File Reference\n \n \n \n \n \n \n \n@@ -66,47 +66,47 @@\n \n \n
    \n \n-
    callable.hh File Reference
    \n+
    multiindex.hh File Reference
    \n
    \n
    \n-
    #include <memory>
    \n-#include <functional>
    \n-#include <dune/common/function.hh>
    \n-#include <dune/common/shared_ptr.hh>
    \n+
    #include <cstddef>
    \n+#include <array>
    \n+#include <iostream>
    \n+#include <dune/common/hash.hh>
    \n
    \n

    Go to the source code of this file.

    \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
    \n \n-\n-\n+\n+\n+\n+\n+\n+\n+\n \n

    \n Classes

    class  Dune::Functions::CallableFunctionWrapper< F >
     Wrap a Dune::VirtualFunction into a callable object. 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 > >
     
    \n \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n \n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n

    \n Functions

    template<class F >
    CallableFunctionWrapper< F > Dune::Functions::callable (const F &f)
     Create a callable object from some Dune::VirtualFunction. More...
     
    template<class F >
    CallableFunctionWrapper< F > Dune::Functions::callable (const std::shared_ptr< F > &fp)
     Create a callable object from std::shared_ptr<F> More...
     
    template<typename Stream , class size_type , std::size_t n>
    Stream & Dune::Functions::operator<< (Stream &stream, const StaticMultiIndex< size_type, n > &c)
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,37 +6,35 @@\n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n Classes | Namespaces | Functions\n-callable.hh File Reference\n-#include \n-#include \n-#include \n-#include \n+multiindex.hh File Reference\n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::CallableFunctionWrapper<_F_>\n-\u00a0 Wrap a Dune::VirtualFunction into a callable object. More...\n+ class \u00a0Dune::Functions::StaticMultiIndex<_size_type,_n_>\n+\u00a0 A statically sized MultiIndex type. More...\n+\u00a0\n+ class \u00a0Dune::Functions::StaticMultiIndex<_size_type,_1_>\n+\u00a0 A statically sized MultiIndex type. More...\n+\u00a0\n+struct \u00a0std::tuple_size<_Dune::Functions::StaticMultiIndex<_size_type,_n_>_>\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n Functions\n-template\n-CallableFunctionWrapper< F >\u00a0Dune::Functions::callable (const F &f)\n-\u00a0 Create a callable object from some Dune::\n- VirtualFunction. More...\n-\u00a0\n-template\n-CallableFunctionWrapper< F >\u00a0Dune::Functions::callable (const std::shared_ptr<\n- F > &fp)\n-\u00a0 Create a callable object from std::shared_ptr\n- More...\n+template\n+Stream &\u00a0Dune::Functions::operator<< (Stream &stream, const StaticMultiIndex<\n+ size_type, n > &c)\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00056_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00056_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: callable.hh Source File\n+dune-functions: multiindex.hh Source File\n \n \n \n \n \n \n \n@@ -62,90 +62,98 @@\n \n \n
    \n
    \n-
    callable.hh
    \n+
    multiindex.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_COMMON_CALLABLE_HH
    \n-
    4#define DUNE_FUNCTIONS_COMMON_CALLABLE_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH
    \n+
    4#define DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH
    \n
    5
    \n-
    6#include <memory>
    \n-
    7#include <functional>
    \n-
    8
    \n-
    9#include <dune/common/function.hh>
    \n-
    10#include <dune/common/shared_ptr.hh>
    \n+
    6#include <cstddef>
    \n+
    7#include <array>
    \n+
    8#include <iostream>
    \n+
    9
    \n+
    10#include <dune/common/hash.hh>
    \n
    11
    \n
    12
    \n-
    13namespace Dune {
    \n-
    14namespace Functions {
    \n+
    13namespace Dune::Functions {
    \n+
    14
    \n
    15
    \n
    16
    \n-
    17
    \n-
    18
    \n-
    36template<class F>
    \n-\n-
    38{
    \n-
    39 using Range = typename F::RangeType;
    \n-
    40 using Domain = typename F::DomainType;
    \n-
    41
    \n-
    42 public:
    \n-
    43
    \n-\n-
    51 {
    \n-
    52 f_ = Dune::stackobject_to_shared_ptr(f);
    \n-
    53 }
    \n-
    54
    \n-
    61 CallableFunctionWrapper(const std::shared_ptr<const F>& f) :
    \n-
    62 f_(f)
    \n-
    63 {}
    \n-
    64
    \n-
    70 Range operator()(const Domain& x) const
    \n-
    71 {
    \n-
    72 Range y;
    \n-
    73 f_->evaluate(x, y);
    \n-
    74 return y;
    \n-
    75 }
    \n+
    22template<class size_type, std::size_t n>
    \n+\n+
    24 public std::array<size_type, n>
    \n+
    25{
    \n+
    26public:
    \n+
    27 static constexpr std::size_t size() { return n; }
    \n+
    28
    \n+
    29 inline friend std::size_t hash_value(const StaticMultiIndex& v) noexcept {
    \n+
    30 return hash_range(v.begin(), v.end());
    \n+
    31 }
    \n+
    32
    \n+
    33};
    \n+
    34
    \n+
    35
    \n+
    36
    \n+
    46template<class size_type>
    \n+
    47class StaticMultiIndex<size_type,1> :
    \n+
    48 public std::array<size_type, 1>
    \n+
    49{
    \n+
    50public:
    \n+
    51
    \n+
    52 static constexpr std::size_t size() { return 1; }
    \n+
    53
    \n+
    54 operator const size_type& () const {
    \n+
    55 return (*this)[0];
    \n+
    56 }
    \n+
    57
    \n+
    58 inline friend std::size_t hash_value(const StaticMultiIndex& v) noexcept {
    \n+
    59 return hash_range(v.begin(), v.end());
    \n+
    60 }
    \n+
    61
    \n+
    62 operator size_type& () {
    \n+
    63 return (*this)[0];
    \n+
    64 }
    \n+
    65
    \n+
    66};
    \n+
    67
    \n+
    68
    \n+
    69
    \n+
    70template<typename Stream, class size_type, std::size_t n>
    \n+
    71inline Stream& operator<<(Stream& stream, const StaticMultiIndex<size_type,n>& c) {
    \n+
    72 for (const auto& ci : c)
    \n+
    73 stream << ci << " ";
    \n+
    74 return stream;
    \n+
    75}
    \n
    76
    \n-
    77 private:
    \n-
    78 std::shared_ptr<const F> f_;
    \n-
    79};
    \n+
    77
    \n+
    78
    \n+
    79} // namespace Dune::Functions
    \n
    80
    \n-
    81
    \n-
    82
    \n-
    104template<class F>
    \n-\n-
    106{
    \n-\n-
    108}
    \n-
    109
    \n-
    110
    \n-
    136template<class F>
    \n-
    137CallableFunctionWrapper<F> callable(const std::shared_ptr<F>& fp)
    \n-
    138{
    \n-\n-
    140}
    \n-
    141
    \n-
    142
    \n-
    143
    \n-
    144} // namespace Functions
    \n-
    145} // namespace Dune
    \n-
    146
    \n-
    147#endif //DUNE_FUNCTIONS_COMMON_CALLABLE_HH
    \n-
    CallableFunctionWrapper< F > callable(const F &f)
    Create a callable object from some Dune::VirtualFunction.
    Definition: callable.hh:105
    \n+
    81template<class size_type, std::size_t n>
    \n+
    82struct std::tuple_size< Dune::Functions::StaticMultiIndex<size_type,n> >
    \n+
    83 : std::integral_constant<std::size_t, n> { };
    \n+
    84
    \n+
    85DUNE_DEFINE_HASH(DUNE_HASH_TEMPLATE_ARGS(typename size_type, std::size_t n),DUNE_HASH_TYPE(Dune::Functions::StaticMultiIndex<size_type,n>))
    \n+
    86
    \n+
    87#endif // DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH
    \n
    Definition: polynomial.hh:10
    \n-
    Wrap a Dune::VirtualFunction into a callable object.
    Definition: callable.hh:38
    \n-
    Range operator()(const Domain &x) const
    Forward operator() to F::evaluate()
    Definition: callable.hh:70
    \n-
    CallableFunctionWrapper(const F &f)
    Instantiate from reference to f.
    Definition: callable.hh:50
    \n-
    CallableFunctionWrapper(const std::shared_ptr< const F > &f)
    Instantiate from std::shared_ptr to f.
    Definition: callable.hh:61
    \n+
    Definition: polynomial.hh:11
    \n+
    Stream & operator<<(Stream &stream, const StaticMultiIndex< size_type, n > &c)
    Definition: multiindex.hh:71
    \n+
    A statically sized MultiIndex type.
    Definition: multiindex.hh:25
    \n+
    static constexpr std::size_t size()
    Definition: multiindex.hh:27
    \n+
    friend std::size_t hash_value(const StaticMultiIndex &v) noexcept
    Definition: multiindex.hh:29
    \n+
    static constexpr std::size_t size()
    Definition: multiindex.hh:52
    \n+
    friend std::size_t hash_value(const StaticMultiIndex &v) noexcept
    Definition: multiindex.hh:58
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,100 +5,109 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-callable.hh\n+multiindex.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_COMMON_CALLABLE_HH\n- 4#define DUNE_FUNCTIONS_COMMON_CALLABLE_HH\n+ 3#ifndef DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH\n+ 4#define DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH\n 5\n- 6#include \n- 7#include \n- 8\n- 9#include \n- 10#include \n+ 6#include \n+ 7#include \n+ 8#include \n+ 9\n+ 10#include \n 11\n 12\n- 13namespace Dune {\n- 14namespace Functions {\n+ 13namespace Dune::Functions {\n+ 14\n 15\n 16\n- 17\n- 18\n- 36template\n-37class CallableFunctionWrapper\n- 38{\n- 39 using Range = typename F::RangeType;\n- 40 using Domain = typename F::DomainType;\n- 41\n- 42 public:\n- 43\n-50 CallableFunctionWrapper(const F& f)\n- 51 {\n- 52 f_ = Dune::stackobject_to_shared_ptr(f);\n- 53 }\n- 54\n-61 CallableFunctionWrapper(const std::shared_ptr& f) :\n- 62 f_(f)\n- 63 {}\n- 64\n-70 Range operator()(const Domain& x) const\n- 71 {\n- 72 Range y;\n- 73 f_->evaluate(x, y);\n- 74 return y;\n- 75 }\n+ 22template\n+23class StaticMultiIndex :\n+ 24 public std::array\n+ 25{\n+ 26public:\n+27 static constexpr std::size_t size() { return n; }\n+ 28\n+29 inline friend std::size_t hash_value(const StaticMultiIndex& v) noexcept {\n+ 30 return hash_range(v.begin(), v.end());\n+ 31 }\n+ 32\n+ 33};\n+ 34\n+ 35\n+ 36\n+ 46template\n+47class StaticMultiIndex :\n+ 48 public std::array\n+ 49{\n+ 50public:\n+ 51\n+52 static constexpr std::size_t size() { return 1; }\n+ 53\n+54 operator const size_type& () const {\n+ 55 return (*this)[0];\n+ 56 }\n+ 57\n+58 inline friend std::size_t hash_value(const StaticMultiIndex& v) noexcept {\n+ 59 return hash_range(v.begin(), v.end());\n+ 60 }\n+ 61\n+62 operator size_type& () {\n+ 63 return (*this)[0];\n+ 64 }\n+ 65\n+ 66};\n+ 67\n+ 68\n+ 69\n+ 70template\n+71inline Stream& operator<<(Stream& stream, const\n+StaticMultiIndex& c) {\n+ 72 for (const auto& ci : c)\n+ 73 stream << ci << \" \";\n+ 74 return stream;\n+ 75}\n 76\n- 77 private:\n- 78 std::shared_ptr f_;\n- 79};\n+ 77\n+ 78\n+ 79} // namespace Dune::Functions\n 80\n- 81\n- 82\n- 104template\n-105CallableFunctionWrapper callable(const F& f)\n- 106{\n- 107 return CallableFunctionWrapper(f);\n- 108}\n- 109\n- 110\n- 136template\n-137CallableFunctionWrapper callable(const std::shared_ptr& fp)\n- 138{\n- 139 return CallableFunctionWrapper(fp);\n- 140}\n- 141\n- 142\n- 143\n- 144} // namespace Functions\n- 145} // namespace Dune\n- 146\n- 147#endif //DUNE_FUNCTIONS_COMMON_CALLABLE_HH\n-Dune::Functions::callable\n-CallableFunctionWrapper< F > callable(const F &f)\n-Create a callable object from some Dune::VirtualFunction.\n-Definition: callable.hh:105\n+ 81template\n+82struct std::tuple_size< Dune::Functions::StaticMultiIndex >\n+ 83 : std::integral_constant { };\n+ 84\n+ 85DUNE_DEFINE_HASH(DUNE_HASH_TEMPLATE_ARGS(typename size_type, std::size_t\n+n),DUNE_HASH_TYPE(Dune::Functions::StaticMultiIndex))\n+ 86\n+ 87#endif // DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::CallableFunctionWrapper\n-Wrap a Dune::VirtualFunction into a callable object.\n-Definition: callable.hh:38\n-Dune::Functions::CallableFunctionWrapper::operator()\n-Range operator()(const Domain &x) const\n-Forward operator() to F::evaluate()\n-Definition: callable.hh:70\n-Dune::Functions::CallableFunctionWrapper::CallableFunctionWrapper\n-CallableFunctionWrapper(const F &f)\n-Instantiate from reference to f.\n-Definition: callable.hh:50\n-Dune::Functions::CallableFunctionWrapper::CallableFunctionWrapper\n-CallableFunctionWrapper(const std::shared_ptr< const F > &f)\n-Instantiate from std::shared_ptr to f.\n-Definition: callable.hh:61\n+Dune::Functions\n+Definition: polynomial.hh:11\n+Dune::Functions::operator<<\n+Stream & operator<<(Stream &stream, const StaticMultiIndex< size_type, n > &c)\n+Definition: multiindex.hh:71\n+Dune::Functions::StaticMultiIndex\n+A statically sized MultiIndex type.\n+Definition: multiindex.hh:25\n+Dune::Functions::StaticMultiIndex::size\n+static constexpr std::size_t size()\n+Definition: multiindex.hh:27\n+Dune::Functions::StaticMultiIndex::hash_value\n+friend std::size_t hash_value(const StaticMultiIndex &v) noexcept\n+Definition: multiindex.hh:29\n+Dune::Functions::StaticMultiIndex<_size_type,_1_>::size\n+static constexpr std::size_t size()\n+Definition: multiindex.hh:52\n+Dune::Functions::StaticMultiIndex<_size_type,_1_>::hash_value\n+friend std::size_t hash_value(const StaticMultiIndex &v) noexcept\n+Definition: multiindex.hh:58\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00059.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00059.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: multiindex.hh File Reference\n+dune-functions: functionfromcallable.hh File Reference\n \n \n \n \n \n \n \n@@ -64,49 +64,35 @@\n \n \n \n
    \n \n-
    multiindex.hh File Reference
    \n+Namespaces
    \n+
    functionfromcallable.hh File Reference
    \n \n
    \n-
    #include <cstddef>
    \n-#include <array>
    \n-#include <iostream>
    \n-#include <dune/common/hash.hh>
    \n+
    #include <dune/common/function.hh>
    \n+#include <dune/functions/common/signature.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n-\n-\n-\n-\n-\n+\n+\n \n

    \n Classes

    class  Dune::Functions::StaticMultiIndex< size_type, n >
     A statically sized MultiIndex type. More...
     
    class  Dune::Functions::StaticMultiIndex< size_type, 1 >
     A statically sized MultiIndex type. More...
     
    struct  std::tuple_size< Dune::Functions::StaticMultiIndex< size_type, n > >
    class  Dune::Functions::FunctionFromCallable< Range(Domain), F, FunctionInterface >
     Wrap a callable object as Dune::Function or Dune::VirtualFunction. More...
     
    \n \n \n \n \n \n-

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n-\n-\n-\n-\n

    \n-Functions

    template<typename Stream , class size_type , std::size_t n>
    Stream & Dune::Functions::operator<< (Stream &stream, const StaticMultiIndex< size_type, n > &c)
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,36 +5,26 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-Classes | Namespaces | Functions\n-multiindex.hh File Reference\n-#include \n-#include \n-#include \n-#include \n+Classes | Namespaces\n+functionfromcallable.hh File Reference\n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n- class \u00a0Dune::Functions::StaticMultiIndex<_size_type,_n_>\n-\u00a0 A statically sized MultiIndex type. More...\n-\u00a0\n- class \u00a0Dune::Functions::StaticMultiIndex<_size_type,_1_>\n-\u00a0 A statically sized MultiIndex type. More...\n-\u00a0\n-struct \u00a0std::tuple_size<_Dune::Functions::StaticMultiIndex<_size_type,_n_>_>\n+class \u00a0Dune::Functions::FunctionFromCallable<_Range(Domain),_F,\n+ FunctionInterface_>\n+\u00a0 Wrap a callable object as Dune::Function or Dune::VirtualFunction.\n+ More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n- Functions\n-template\n-Stream &\u00a0Dune::Functions::operator<< (Stream &stream, const StaticMultiIndex<\n- size_type, n > &c)\n-\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00059_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00059_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: multiindex.hh Source File\n+dune-functions: functionfromcallable.hh Source File\n \n \n \n \n \n \n \n@@ -62,98 +62,73 @@\n \n \n
    \n
    \n-
    multiindex.hh
    \n+
    functionfromcallable.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH
    \n-
    4#define DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_COMMON_FUNCTION_FROM_CALLABLE_HH
    \n+
    4#define DUNE_FUNCTIONS_COMMON_FUNCTION_FROM_CALLABLE_HH
    \n
    5
    \n-
    6#include <cstddef>
    \n-
    7#include <array>
    \n-
    8#include <iostream>
    \n+
    6#include <dune/common/function.hh>
    \n+
    7
    \n+\n
    9
    \n-
    10#include <dune/common/hash.hh>
    \n-
    11
    \n-
    12
    \n-
    13namespace Dune::Functions {
    \n+
    10
    \n+
    11namespace Dune {
    \n+
    12namespace Functions {
    \n+
    13
    \n
    14
    \n
    15
    \n-
    16
    \n-
    22template<class size_type, std::size_t n>
    \n-\n-
    24 public std::array<size_type, n>
    \n-
    25{
    \n-
    26public:
    \n-
    27 static constexpr std::size_t size() { return n; }
    \n-
    28
    \n-
    29 inline friend std::size_t hash_value(const StaticMultiIndex& v) noexcept {
    \n-
    30 return hash_range(v.begin(), v.end());
    \n-
    31 }
    \n-
    32
    \n-
    33};
    \n-
    34
    \n-
    35
    \n-
    36
    \n-
    46template<class size_type>
    \n-
    47class StaticMultiIndex<size_type,1> :
    \n-
    48 public std::array<size_type, 1>
    \n-
    49{
    \n-
    50public:
    \n-
    51
    \n-
    52 static constexpr std::size_t size() { return 1; }
    \n-
    53
    \n-
    54 operator const size_type& () const {
    \n-
    55 return (*this)[0];
    \n-
    56 }
    \n-
    57
    \n-
    58 inline friend std::size_t hash_value(const StaticMultiIndex& v) noexcept {
    \n-
    59 return hash_range(v.begin(), v.end());
    \n-
    60 }
    \n-
    61
    \n-
    62 operator size_type& () {
    \n-
    63 return (*this)[0];
    \n-
    64 }
    \n-
    65
    \n-
    66};
    \n+
    16template<class Signature, class F,
    \n+
    17 class FunctionInterface = typename Dune::VirtualFunction<
    \n+
    18 typename SignatureTraits<Signature>::RawDomain,
    \n+
    19 typename SignatureTraits<Signature>::RawRange> >
    \n+\n+
    21
    \n+
    37template<class Range, class Domain, class F, class FunctionInterface>
    \n+
    38class FunctionFromCallable<Range(Domain), F, FunctionInterface> :
    \n+
    39 public FunctionInterface
    \n+
    40{
    \n+
    41public:
    \n+
    42
    \n+\n+
    53 f_(f)
    \n+
    54 {}
    \n+
    55
    \n+\n+
    65 f_(f)
    \n+
    66 {}
    \n
    67
    \n-
    68
    \n-
    69
    \n-
    70template<typename Stream, class size_type, std::size_t n>
    \n-
    71inline Stream& operator<<(Stream& stream, const StaticMultiIndex<size_type,n>& c) {
    \n-
    72 for (const auto& ci : c)
    \n-
    73 stream << ci << " ";
    \n-
    74 return stream;
    \n-
    75}
    \n-
    76
    \n+
    73 void evaluate(const Domain& x, Range&y) const
    \n+
    74 {
    \n+
    75 y = f_(x);
    \n+
    76 }
    \n
    77
    \n-
    78
    \n-
    79} // namespace Dune::Functions
    \n-
    80
    \n-
    81template<class size_type, std::size_t n>
    \n-
    82struct std::tuple_size< Dune::Functions::StaticMultiIndex<size_type,n> >
    \n-
    83 : std::integral_constant<std::size_t, n> { };
    \n-
    84
    \n-
    85DUNE_DEFINE_HASH(DUNE_HASH_TEMPLATE_ARGS(typename size_type, std::size_t n),DUNE_HASH_TYPE(Dune::Functions::StaticMultiIndex<size_type,n>))
    \n+
    78private:
    \n+
    79 F f_;
    \n+
    80};
    \n+
    81
    \n+
    82
    \n+
    83
    \n+
    84} // namespace Functions
    \n+
    85} // namespace Dune
    \n
    86
    \n-
    87#endif // DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH
    \n+
    87#endif //DUNE_FUNCTIONS_COMMON_FUNCTION_FROM_CALLABLE_HH
    \n+\n
    Definition: polynomial.hh:10
    \n-
    Definition: polynomial.hh:11
    \n-
    Stream & operator<<(Stream &stream, const StaticMultiIndex< size_type, n > &c)
    Definition: multiindex.hh:71
    \n-
    A statically sized MultiIndex type.
    Definition: multiindex.hh:25
    \n-
    static constexpr std::size_t size()
    Definition: multiindex.hh:27
    \n-
    friend std::size_t hash_value(const StaticMultiIndex &v) noexcept
    Definition: multiindex.hh:29
    \n-
    static constexpr std::size_t size()
    Definition: multiindex.hh:52
    \n-
    friend std::size_t hash_value(const StaticMultiIndex &v) noexcept
    Definition: multiindex.hh:58
    \n+
    Definition: functionfromcallable.hh:20
    \n+
    FunctionFromCallable(F &&f)
    Create VirtualFunction from callable object.
    Definition: functionfromcallable.hh:52
    \n+
    void evaluate(const Domain &x, Range &y) const
    Evaluate function.
    Definition: functionfromcallable.hh:73
    \n+
    FunctionFromCallable(const F &f)
    Create VirtualFunction from callable object.
    Definition: functionfromcallable.hh:64
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,109 +5,82 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-multiindex.hh\n+functionfromcallable.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH\n- 4#define DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH\n+ 3#ifndef DUNE_FUNCTIONS_COMMON_FUNCTION_FROM_CALLABLE_HH\n+ 4#define DUNE_FUNCTIONS_COMMON_FUNCTION_FROM_CALLABLE_HH\n 5\n- 6#include \n- 7#include \n- 8#include \n+ 6#include \n+ 7\n+ 8#include \n 9\n- 10#include \n- 11\n- 12\n- 13namespace Dune::Functions {\n+ 10\n+ 11namespace Dune {\n+ 12namespace Functions {\n+ 13\n 14\n 15\n- 16\n- 22template\n-23class StaticMultiIndex :\n- 24 public std::array\n- 25{\n- 26public:\n-27 static constexpr std::size_t size() { return n; }\n- 28\n-29 inline friend std::size_t hash_value(const StaticMultiIndex& v) noexcept {\n- 30 return hash_range(v.begin(), v.end());\n- 31 }\n- 32\n- 33};\n- 34\n- 35\n- 36\n- 46template\n-47class StaticMultiIndex :\n- 48 public std::array\n- 49{\n- 50public:\n- 51\n-52 static constexpr std::size_t size() { return 1; }\n- 53\n-54 operator const size_type& () const {\n- 55 return (*this)[0];\n- 56 }\n- 57\n-58 inline friend std::size_t hash_value(const StaticMultiIndex& v) noexcept {\n- 59 return hash_range(v.begin(), v.end());\n- 60 }\n- 61\n-62 operator size_type& () {\n- 63 return (*this)[0];\n- 64 }\n- 65\n- 66};\n+ 16template::RawDomain,\n+ 19 typename SignatureTraits::RawRange> >\n+20class FunctionFromCallable;\n+ 21\n+ 37template\n+38class FunctionFromCallable :\n+ 39 public FunctionInterface\n+ 40{\n+ 41public:\n+ 42\n+52 FunctionFromCallable(F&& f) :\n+ 53 f_(f)\n+ 54 {}\n+ 55\n+64 FunctionFromCallable(const F& f) :\n+ 65 f_(f)\n+ 66 {}\n 67\n- 68\n- 69\n- 70template\n-71inline Stream& operator<<(Stream& stream, const\n-StaticMultiIndex& c) {\n- 72 for (const auto& ci : c)\n- 73 stream << ci << \" \";\n- 74 return stream;\n- 75}\n- 76\n+73 void evaluate(const Domain& x, Range&y) const\n+ 74 {\n+ 75 y = f_(x);\n+ 76 }\n 77\n- 78\n- 79} // namespace Dune::Functions\n- 80\n- 81template\n-82struct std::tuple_size< Dune::Functions::StaticMultiIndex >\n- 83 : std::integral_constant { };\n- 84\n- 85DUNE_DEFINE_HASH(DUNE_HASH_TEMPLATE_ARGS(typename size_type, std::size_t\n-n),DUNE_HASH_TYPE(Dune::Functions::StaticMultiIndex))\n+ 78private:\n+ 79 F f_;\n+ 80};\n+ 81\n+ 82\n+ 83\n+ 84} // namespace Functions\n+ 85} // namespace Dune\n 86\n- 87#endif // DUNE_FUNCTIONS_COMMON_MULTIINDEX_HH\n+ 87#endif //DUNE_FUNCTIONS_COMMON_FUNCTION_FROM_CALLABLE_HH\n+signature.hh\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions\n-Definition: polynomial.hh:11\n-Dune::Functions::operator<<\n-Stream & operator<<(Stream &stream, const StaticMultiIndex< size_type, n > &c)\n-Definition: multiindex.hh:71\n-Dune::Functions::StaticMultiIndex\n-A statically sized MultiIndex type.\n-Definition: multiindex.hh:25\n-Dune::Functions::StaticMultiIndex::size\n-static constexpr std::size_t size()\n-Definition: multiindex.hh:27\n-Dune::Functions::StaticMultiIndex::hash_value\n-friend std::size_t hash_value(const StaticMultiIndex &v) noexcept\n-Definition: multiindex.hh:29\n-Dune::Functions::StaticMultiIndex<_size_type,_1_>::size\n-static constexpr std::size_t size()\n-Definition: multiindex.hh:52\n-Dune::Functions::StaticMultiIndex<_size_type,_1_>::hash_value\n-friend std::size_t hash_value(const StaticMultiIndex &v) noexcept\n-Definition: multiindex.hh:58\n+Dune::Functions::FunctionFromCallable\n+Definition: functionfromcallable.hh:20\n+Dune::Functions::FunctionFromCallable<_Range(Domain),_F,_FunctionInterface_>::\n+FunctionFromCallable\n+FunctionFromCallable(F &&f)\n+Create VirtualFunction from callable object.\n+Definition: functionfromcallable.hh:52\n+Dune::Functions::FunctionFromCallable<_Range(Domain),_F,_FunctionInterface_>::\n+evaluate\n+void evaluate(const Domain &x, Range &y) const\n+Evaluate function.\n+Definition: functionfromcallable.hh:73\n+Dune::Functions::FunctionFromCallable<_Range(Domain),_F,_FunctionInterface_>::\n+FunctionFromCallable\n+FunctionFromCallable(const F &f)\n+Create VirtualFunction from callable object.\n+Definition: functionfromcallable.hh:64\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00062.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00062.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: localfunction.hh File Reference\n+dune-functions: polymorphicsmallobject.hh File Reference\n \n \n \n \n \n \n \n@@ -65,33 +65,26 @@\n
  • dune
  • functions
  • common
  • \n \n \n
    \n \n-
    localfunction.hh File Reference
    \n+
    polymorphicsmallobject.hh File Reference
    \n
    \n
    \n-
    #include <type_traits>
    \n-#include <dune/common/typeutilities.hh>
    \n-#include <dune/functions/common/defaultderivativetraits.hh>
    \n-#include <dune/functions/common/differentiablefunction.hh>
    \n-#include <dune/functions/common/localfunction_imp.hh>
    \n-#include <dune/functions/common/typeerasure.hh>
    \n-#include <dune/functions/common/functionconcepts.hh>
    \n+
    #include <utility>
    \n+#include <type_traits>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n-\n-\n+\n+\n \n

    \n Classes

    class  Dune::Functions::LocalFunction< Signature, LocalContext, DerivativeTraits, bufferSize >
     
    class  Dune::Functions::LocalFunction< Range(Domain), LocalContext, DerivativeTraits, bufferSize >
     Class storing local functions using type erasure. More...
    class  Dune::Functions::PolymorphicSmallObject< Base, bufferSize >
     A wrapper providing small object optimization with polymorphic types. More...
     
    \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,30 +6,22 @@\n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n Classes | Namespaces\n-localfunction.hh File Reference\n+polymorphicsmallobject.hh File Reference\n+#include \n #include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::LocalFunction<_Signature,_LocalContext,\n- DerivativeTraits,_bufferSize_>\n-\u00a0\n-class \u00a0Dune::Functions::LocalFunction<_Range(Domain),_LocalContext,\n- DerivativeTraits,_bufferSize_>\n-\u00a0 Class storing local functions using type erasure. More...\n+class \u00a0Dune::Functions::PolymorphicSmallObject<_Base,_bufferSize_>\n+\u00a0 A wrapper providing small object optimization with polymorphic types.\n+ More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n \n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00062_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00062_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: localfunction.hh Source File\n+dune-functions: polymorphicsmallobject.hh Source File\n \n \n \n \n \n \n \n@@ -62,152 +62,164 @@\n \n \n \n
    \n-
    localfunction.hh
    \n+
    polymorphicsmallobject.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH
    \n-
    4#define DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH
    \n+
    4#define DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH
    \n
    5
    \n-
    6#include <type_traits>
    \n-
    7
    \n-
    8#include <dune/common/typeutilities.hh>
    \n-
    9
    \n-\n-\n-\n-\n-\n-
    15
    \n-
    16
    \n-
    17
    \n-
    18namespace Dune {
    \n-
    19namespace Functions {
    \n-
    20
    \n-
    21
    \n-
    22
    \n-
    23/*
    \n-
    24 * Default implementation is empty
    \n-
    25 * The actual implementation is only given if Signature is an type
    \n-
    26 * describing a function signature as Range(Domain).
    \n-
    27 */
    \n-
    28template<class Signature, class LocalContext, template<class> class DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>
    \n-\n-
    30{};
    \n-
    31
    \n-
    32
    \n-
    33
    \n-
    34namespace Imp
    \n-
    35{
    \n-
    36
    \n-
    38 template<class S, class L, template<class> class DerivativeTraits, size_t bufferSize>
    \n-
    39 struct LocalFunctionTraits :
    \n-
    40 DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>
    \n-
    41 {
    \n-
    42 protected:
    \n-
    43 using Base=DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>;
    \n-
    44
    \n-
    45 public:
    \n-
    47 using LocalContext = L;
    \n-
    48
    \n-
    50 using DerivativeSignature = typename Base::DerivativeSignature;
    \n-
    51
    \n-\n-
    54
    \n-
    56 using Concept = LocalFunctionWrapperInterface<S, DerivativeInterface, L>;
    \n-
    57
    \n-
    59 template<class B>
    \n-
    60 using Model = LocalFunctionWrapperImplementation<S, DerivativeInterface, L, B>;
    \n-
    61 };
    \n-
    62}
    \n-
    63
    \n-
    64
    \n-
    65
    \n-
    86template<class Range, class Domain, class LocalContext, template<class> class DerivativeTraits, size_t bufferSize>
    \n-
    87class LocalFunction< Range(Domain), LocalContext, DerivativeTraits, bufferSize> :
    \n-
    88 public TypeErasureBase<
    \n-
    89 typename Imp::LocalFunctionTraits<Range(Domain), LocalContext, DerivativeTraits, bufferSize>::Concept,
    \n-
    90 Imp::LocalFunctionTraits<Range(Domain), LocalContext, DerivativeTraits, bufferSize>::template Model>
    \n-
    91{
    \n-
    92 using Traits = Imp::LocalFunctionTraits<Range(Domain), LocalContext, DerivativeTraits, bufferSize>;
    \n-
    93
    \n-\n-
    95
    \n-
    96 using DerivativeInterface = typename Traits::DerivativeInterface;
    \n-
    97
    \n-
    98public:
    \n-
    99
    \n-
    111 template<class F, disableCopyMove<LocalFunction, F> = 0 >
    \n-\n-
    113 Base(std::forward<F>(f))
    \n-
    114 {
    \n-
    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");
    \n-
    116 }
    \n-
    117
    \n-
    118 LocalFunction() = default;
    \n-
    119
    \n-
    123 Range operator() (const Domain& x) const
    \n-
    124 {
    \n-
    125 return this->asInterface().operator()(x);
    \n-
    126 }
    \n-
    127
    \n-
    135 friend DerivativeInterface derivative(const LocalFunction& t)
    \n+
    6#include <utility>
    \n+
    7#include <type_traits>
    \n+
    8
    \n+
    9namespace Dune {
    \n+
    10namespace Functions {
    \n+
    11
    \n+
    12
    \n+
    43template<class Base, size_t bufferSize>
    \n+\n+
    45{
    \n+
    46public:
    \n+
    47
    \n+\n+
    50 p_(nullptr)
    \n+
    51 {}
    \n+
    52
    \n+
    59 template<class Derived,
    \n+
    60 typename std::enable_if<std::is_base_of<Base, std::remove_cv_t<
    \n+
    61 std::remove_reference_t<Derived>>>::value, int>::type = 0>
    \n+
    62 PolymorphicSmallObject(Derived&& derived)
    \n+
    63 {
    \n+
    64 constexpr bool useBuffer = sizeof(Derived) <= bufferSize;
    \n+
    65 if constexpr (useBuffer) {
    \n+
    66 p_ = new (&buffer_) Derived(std::forward<Derived>(derived));
    \n+
    67 } else {
    \n+
    68 p_ = new Derived(std::forward<Derived>(derived));
    \n+
    69 }
    \n+
    70 }
    \n+
    71
    \n+\n+
    74 {
    \n+
    75 moveToWrappedObject(std::move(other));
    \n+
    76 }
    \n+
    77
    \n+\n+
    80 {
    \n+
    81 copyToWrappedObject(other);
    \n+
    82 }
    \n+
    83
    \n+\n+
    86 {
    \n+
    87 destroyWrappedObject();
    \n+
    88 }
    \n+
    89
    \n+\n+
    92 {
    \n+
    93 if (&other!=this)
    \n+
    94 {
    \n+
    95 destroyWrappedObject();
    \n+
    96 copyToWrappedObject(other);
    \n+
    97 }
    \n+
    98 return *this;
    \n+
    99 }
    \n+
    100
    \n+\n+
    103 {
    \n+
    104 destroyWrappedObject();
    \n+
    105 moveToWrappedObject(std::move(other));
    \n+
    106 return *this;
    \n+
    107 }
    \n+
    108
    \n+
    110 explicit operator bool() const
    \n+
    111 {
    \n+
    112 return p_;
    \n+
    113 }
    \n+
    114
    \n+
    116 bool bufferUsed() const
    \n+
    117 {
    \n+
    118 return ((void*) (p_) == (void*)(&buffer_));
    \n+
    119 }
    \n+
    120
    \n+
    122 const Base& get() const
    \n+
    123 {
    \n+
    124 return *p_;
    \n+
    125 }
    \n+
    126
    \n+
    128 Base& get()
    \n+
    129 {
    \n+
    130 return *p_;
    \n+
    131 }
    \n+
    132
    \n+
    133private:
    \n+
    134
    \n+
    135 void destroyWrappedObject() noexcept
    \n
    136 {
    \n-
    137 return t.asInterface().derivative();
    \n-
    138 }
    \n-
    139
    \n-
    146 void bind(const LocalContext& context)
    \n+
    137 if (operator bool())
    \n+
    138 {
    \n+
    139 if (bufferUsed())
    \n+
    140 p_->~Base();
    \n+
    141 else
    \n+
    142 delete p_;
    \n+
    143 }
    \n+
    144 }
    \n+
    145
    \n+
    146 void moveToWrappedObject(PolymorphicSmallObject&& other) noexcept
    \n
    147 {
    \n-
    148 this->asInterface().bind(context);
    \n-
    149 }
    \n-
    150
    \n-
    154 void unbind()
    \n-
    155 {
    \n-
    156 this->asInterface().unbind();
    \n-
    157 }
    \n-
    158
    \n-
    161 bool bound() const
    \n-
    162 {
    \n-
    163 return this->asInterface().bound();
    \n-
    164 }
    \n-
    165
    \n-
    169 const LocalContext& localContext() const
    \n-
    170 {
    \n-
    171 return this->asInterface().localContext();
    \n-
    172 }
    \n-
    173};
    \n-
    174
    \n-
    175
    \n+
    148 if (other.bufferUsed())
    \n+
    149 p_ = other.p_->move(&buffer_);
    \n+
    150 else
    \n+
    151 {
    \n+
    152 // We don't need to check for &other_!=this, because you can't
    \n+
    153 // have an rvalue to *this and call it's assignment/constructor
    \n+
    154 // at the same time. (Despite trying to shoot yourself in the foot
    \n+
    155 // with std::move explicitly.)
    \n+
    156
    \n+
    157 // Take ownership of allocated object
    \n+
    158 p_ = other.p_;
    \n+
    159
    \n+
    160 // Leave pointer in a clean state to avoid double freeing it.
    \n+
    161 other.p_ = 0;
    \n+
    162 }
    \n+
    163 }
    \n+
    164
    \n+
    165 void copyToWrappedObject(const PolymorphicSmallObject& other)
    \n+
    166 {
    \n+
    167 if (other.bufferUsed())
    \n+
    168 p_ = other.p_->clone(&buffer_);
    \n+
    169 else
    \n+
    170 p_ = other.p_->clone();
    \n+
    171 }
    \n+
    172
    \n+
    173 std::aligned_storage_t<bufferSize> buffer_;
    \n+
    174 Base* p_;
    \n+
    175};
    \n
    176
    \n-
    177}} // namespace Dune::Functions
    \n-
    178
    \n-
    179
    \n+
    177
    \n+
    178} // namespace Functions
    \n+
    179} // namespace Dune
    \n
    180
    \n-
    181#endif // DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH
    \n-\n-\n-\n-\n-\n-
    friend DerivativeInterface derivative(const LocalFunction &t)
    Get derivative of wrapped function.
    Definition: localfunction.hh:135
    \n+
    181#endif // DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH
    \n
    Definition: polynomial.hh:10
    \n-
    Definition: localfunction.hh:30
    \n-
    const LocalContext & localContext() const
    Obtain local context this LocalFunction is bound to.
    Definition: localfunction.hh:169
    \n-
    LocalFunction(F &&f)
    Construct from function.
    Definition: localfunction.hh:112
    \n-
    void unbind()
    Unbind from local context.
    Definition: localfunction.hh:154
    \n-
    bool bound() const
    Return if the local function is bound to a grid element.
    Definition: localfunction.hh:161
    \n-
    void bind(const LocalContext &context)
    Bind function to a local context.
    Definition: localfunction.hh:146
    \n-\n-
    Base class for type-erased interface wrapper.
    Definition: typeerasure.hh:165
    \n+
    A wrapper providing small object optimization with polymorphic types.
    Definition: polymorphicsmallobject.hh:45
    \n+
    const Base & get() const
    Obtain reference to stored object.
    Definition: polymorphicsmallobject.hh:122
    \n+
    bool bufferUsed() const
    Check if object is stored in internal stack buffer.
    Definition: polymorphicsmallobject.hh:116
    \n+
    PolymorphicSmallObject(Derived &&derived)
    Construct from object.
    Definition: polymorphicsmallobject.hh:62
    \n+
    PolymorphicSmallObject(PolymorphicSmallObject &&other) noexcept
    Move constructor from other PolymorphicSmallObject.
    Definition: polymorphicsmallobject.hh:73
    \n+
    PolymorphicSmallObject & operator=(const PolymorphicSmallObject &other)
    Copy assignment from other PolymorphicSmallObject.
    Definition: polymorphicsmallobject.hh:91
    \n+
    PolymorphicSmallObject & operator=(PolymorphicSmallObject &&other) noexcept
    Move assignment from other PolymorphicSmallObject.
    Definition: polymorphicsmallobject.hh:102
    \n+
    PolymorphicSmallObject(const PolymorphicSmallObject &other)
    Copy constructor from other PolymorphicSmallObject.
    Definition: polymorphicsmallobject.hh:79
    \n+
    ~PolymorphicSmallObject()
    Destructor.
    Definition: polymorphicsmallobject.hh:85
    \n+
    PolymorphicSmallObject()
    Default constructor.
    Definition: polymorphicsmallobject.hh:49
    \n+
    Base & get()
    Obtain mutable reference to stored object.
    Definition: polymorphicsmallobject.hh:128
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,189 +5,192 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-localfunction.hh\n+polymorphicsmallobject.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH\n- 4#define DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH\n+ 3#ifndef DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH\n+ 4#define DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH\n 5\n- 6#include \n- 7\n- 8#include \n- 9\n- 10#include \n- 11#include \n- 12#include \n- 13#include \n- 14#include \n- 15\n- 16\n- 17\n- 18namespace Dune {\n- 19namespace Functions {\n- 20\n- 21\n- 22\n- 23/*\n- 24 * Default implementation is empty\n- 25 * The actual implementation is only given if Signature is an type\n- 26 * describing a function signature as Range(Domain).\n- 27 */\n- 28template class\n-DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>\n-29class LocalFunction\n- 30{};\n- 31\n- 32\n- 33\n- 34namespace Imp\n- 35{\n- 36\n- 38 template class DerivativeTraits, size_t\n-bufferSize>\n- 39 struct LocalFunctionTraits :\n- 40 DifferentiableFunctionTraits\n- 41 {\n- 42 protected:\n- 43 using Base=DifferentiableFunctionTraits;\n- 44\n- 45 public:\n- 47 using LocalContext = L;\n- 48\n- 50 using DerivativeSignature = typename Base::DerivativeSignature;\n- 51\n- 53 using DerivativeInterface = LocalFunction;\n- 54\n- 56 using Concept = LocalFunctionWrapperInterface;\n- 57\n- 59 template\n- 60 using Model = LocalFunctionWrapperImplementation;\n- 61 };\n- 62}\n- 63\n- 64\n- 65\n- 86template\n-class DerivativeTraits, size_t bufferSize>\n-87class LocalFunction< Range(Domain), LocalContext, DerivativeTraits,\n-bufferSize> :\n- 88 public TypeErasureBase<\n- 89 typename Imp::LocalFunctionTraits::Concept,\n- 90 Imp::LocalFunctionTraits::template Model>\n- 91{\n- 92 using Traits = Imp::LocalFunctionTraits;\n- 93\n- 94 using Base = TypeErasureBase;\n- 95\n- 96 using DerivativeInterface = typename Traits::DerivativeInterface;\n- 97\n- 98public:\n- 99\n- 111 template = 0 >\n-112 LocalFunction(F&& f) :\n- 113 Base(std::forward(f))\n- 114 {\n- 115 static_assert(Dune::Functions::Concept::isLocalFunction(), \"Trying to construct a LocalFunction from type that does not\n-model the LocalFunction concept\");\n- 116 }\n- 117\n-118 LocalFunction() = default;\n- 119\n-123 Range operator() (const Domain& x) const\n- 124 {\n- 125 return this->asInterface().operator()(x);\n- 126 }\n- 127\n-135 friend DerivativeInterface derivative(const LocalFunction& t)\n+ 6#include \n+ 7#include \n+ 8\n+ 9namespace Dune {\n+ 10namespace Functions {\n+ 11\n+ 12\n+ 43template\n+44class PolymorphicSmallObject\n+ 45{\n+ 46public:\n+ 47\n+49 PolymorphicSmallObject() :\n+ 50 p_(nullptr)\n+ 51 {}\n+ 52\n+ 59 template>>::value, int>::type = 0>\n+62 PolymorphicSmallObject(Derived&& derived)\n+ 63 {\n+ 64 constexpr bool useBuffer = sizeof(Derived) <= bufferSize;\n+ 65 if constexpr (useBuffer) {\n+ 66 p_ = new (&buffer_) Derived(std::forward(derived));\n+ 67 } else {\n+ 68 p_ = new Derived(std::forward(derived));\n+ 69 }\n+ 70 }\n+ 71\n+73 PolymorphicSmallObject(PolymorphicSmallObject&& other) noexcept\n+ 74 {\n+ 75 moveToWrappedObject(std::move(other));\n+ 76 }\n+ 77\n+79 PolymorphicSmallObject(const PolymorphicSmallObject& other)\n+ 80 {\n+ 81 copyToWrappedObject(other);\n+ 82 }\n+ 83\n+85 ~PolymorphicSmallObject()\n+ 86 {\n+ 87 destroyWrappedObject();\n+ 88 }\n+ 89\n+91 PolymorphicSmallObject& operator=(const PolymorphicSmallObject& other)\n+ 92 {\n+ 93 if (&other!=this)\n+ 94 {\n+ 95 destroyWrappedObject();\n+ 96 copyToWrappedObject(other);\n+ 97 }\n+ 98 return *this;\n+ 99 }\n+ 100\n+102 PolymorphicSmallObject& operator=(PolymorphicSmallObject&& other) noexcept\n+ 103 {\n+ 104 destroyWrappedObject();\n+ 105 moveToWrappedObject(std::move(other));\n+ 106 return *this;\n+ 107 }\n+ 108\n+110 explicit operator bool() const\n+ 111 {\n+ 112 return p_;\n+ 113 }\n+ 114\n+116 bool bufferUsed() const\n+ 117 {\n+ 118 return ((void*) (p_) == (void*)(&buffer_));\n+ 119 }\n+ 120\n+122 const Base& get() const\n+ 123 {\n+ 124 return *p_;\n+ 125 }\n+ 126\n+128 Base& get()\n+ 129 {\n+ 130 return *p_;\n+ 131 }\n+ 132\n+ 133private:\n+ 134\n+ 135 void destroyWrappedObject() noexcept\n 136 {\n- 137 return t.asInterface().derivative();\n- 138 }\n- 139\n-146 void bind(const LocalContext& context)\n+ 137 if (operator bool())\n+ 138 {\n+ 139 if (bufferUsed())\n+ 140 p_->~Base();\n+ 141 else\n+ 142 delete p_;\n+ 143 }\n+ 144 }\n+ 145\n+ 146 void moveToWrappedObject(PolymorphicSmallObject&& other) noexcept\n 147 {\n- 148 this->asInterface().bind(context);\n- 149 }\n- 150\n-154 void unbind()\n- 155 {\n- 156 this->asInterface().unbind();\n- 157 }\n- 158\n-161 bool bound() const\n- 162 {\n- 163 return this->asInterface().bound();\n- 164 }\n- 165\n-169 const LocalContext& localContext() const\n- 170 {\n- 171 return this->asInterface().localContext();\n- 172 }\n- 173};\n- 174\n- 175\n+ 148 if (other.bufferUsed())\n+ 149 p_ = other.p_->move(&buffer_);\n+ 150 else\n+ 151 {\n+ 152 // We don't need to check for &other_!=this, because you can't\n+ 153 // have an rvalue to *this and call it's assignment/constructor\n+ 154 // at the same time. (Despite trying to shoot yourself in the foot\n+ 155 // with std::move explicitly.)\n+ 156\n+ 157 // Take ownership of allocated object\n+ 158 p_ = other.p_;\n+ 159\n+ 160 // Leave pointer in a clean state to avoid double freeing it.\n+ 161 other.p_ = 0;\n+ 162 }\n+ 163 }\n+ 164\n+ 165 void copyToWrappedObject(const PolymorphicSmallObject& other)\n+ 166 {\n+ 167 if (other.bufferUsed())\n+ 168 p_ = other.p_->clone(&buffer_);\n+ 169 else\n+ 170 p_ = other.p_->clone();\n+ 171 }\n+ 172\n+ 173 std::aligned_storage_t buffer_;\n+ 174 Base* p_;\n+ 175};\n 176\n- 177}} // namespace Dune::Functions\n- 178\n- 179\n+ 177\n+ 178} // namespace Functions\n+ 179} // namespace Dune\n 180\n- 181#endif // DUNE_FUNCTIONS_COMMON_LOCAL_FUNCTION_HH\n-typeerasure.hh\n-localfunction_imp.hh\n-functionconcepts.hh\n-defaultderivativetraits.hh\n-differentiablefunction.hh\n-Dune::Functions::LocalFunction<_Range(Domain),_LocalContext,_DerivativeTraits,\n-bufferSize_>::derivative\n-friend DerivativeInterface derivative(const LocalFunction &t)\n-Get derivative of wrapped function.\n-Definition: localfunction.hh:135\n+ 181#endif // DUNE_FUNCTIONS_COMMON_POLYMORPHICSMALLOBJECT_HH\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::LocalFunction\n-Definition: localfunction.hh:30\n-Dune::Functions::LocalFunction<_Range(Domain),_LocalContext,_DerivativeTraits,\n-bufferSize_>::localContext\n-const LocalContext & localContext() const\n-Obtain local context this LocalFunction is bound to.\n-Definition: localfunction.hh:169\n-Dune::Functions::LocalFunction<_Range(Domain),_LocalContext,_DerivativeTraits,\n-bufferSize_>::LocalFunction\n-LocalFunction(F &&f)\n-Construct from function.\n-Definition: localfunction.hh:112\n-Dune::Functions::LocalFunction<_Range(Domain),_LocalContext,_DerivativeTraits,\n-bufferSize_>::unbind\n-void unbind()\n-Unbind from local context.\n-Definition: localfunction.hh:154\n-Dune::Functions::LocalFunction<_Range(Domain),_LocalContext,_DerivativeTraits,\n-bufferSize_>::bound\n-bool bound() const\n-Return if the local function is bound to a grid element.\n-Definition: localfunction.hh:161\n-Dune::Functions::LocalFunction<_Range(Domain),_LocalContext,_DerivativeTraits,\n-bufferSize_>::bind\n-void bind(const LocalContext &context)\n-Bind function to a local context.\n-Definition: localfunction.hh:146\n-Dune::Functions::LocalFunction<_Range(Domain),_LocalContext,_DerivativeTraits,\n-bufferSize_>::LocalFunction\n-LocalFunction()=default\n-Dune::Functions::TypeErasureBase\n-Base class for type-erased interface wrapper.\n-Definition: typeerasure.hh:165\n+Dune::Functions::PolymorphicSmallObject\n+A wrapper providing small object optimization with polymorphic types.\n+Definition: polymorphicsmallobject.hh:45\n+Dune::Functions::PolymorphicSmallObject::get\n+const Base & get() const\n+Obtain reference to stored object.\n+Definition: polymorphicsmallobject.hh:122\n+Dune::Functions::PolymorphicSmallObject::bufferUsed\n+bool bufferUsed() const\n+Check if object is stored in internal stack buffer.\n+Definition: polymorphicsmallobject.hh:116\n+Dune::Functions::PolymorphicSmallObject::PolymorphicSmallObject\n+PolymorphicSmallObject(Derived &&derived)\n+Construct from object.\n+Definition: polymorphicsmallobject.hh:62\n+Dune::Functions::PolymorphicSmallObject::PolymorphicSmallObject\n+PolymorphicSmallObject(PolymorphicSmallObject &&other) noexcept\n+Move constructor from other PolymorphicSmallObject.\n+Definition: polymorphicsmallobject.hh:73\n+Dune::Functions::PolymorphicSmallObject::operator=\n+PolymorphicSmallObject & operator=(const PolymorphicSmallObject &other)\n+Copy assignment from other PolymorphicSmallObject.\n+Definition: polymorphicsmallobject.hh:91\n+Dune::Functions::PolymorphicSmallObject::operator=\n+PolymorphicSmallObject & operator=(PolymorphicSmallObject &&other) noexcept\n+Move assignment from other PolymorphicSmallObject.\n+Definition: polymorphicsmallobject.hh:102\n+Dune::Functions::PolymorphicSmallObject::PolymorphicSmallObject\n+PolymorphicSmallObject(const PolymorphicSmallObject &other)\n+Copy constructor from other PolymorphicSmallObject.\n+Definition: polymorphicsmallobject.hh:79\n+Dune::Functions::PolymorphicSmallObject::~PolymorphicSmallObject\n+~PolymorphicSmallObject()\n+Destructor.\n+Definition: polymorphicsmallobject.hh:85\n+Dune::Functions::PolymorphicSmallObject::PolymorphicSmallObject\n+PolymorphicSmallObject()\n+Default constructor.\n+Definition: polymorphicsmallobject.hh:49\n+Dune::Functions::PolymorphicSmallObject::get\n+Base & get()\n+Obtain mutable reference to stored object.\n+Definition: polymorphicsmallobject.hh:128\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00065.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00065.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: reserveddeque.hh File Reference\n+dune-functions: overflowarray.hh File Reference\n \n \n \n \n \n \n \n@@ -64,69 +64,40 @@\n \n \n \n
    \n \n-
    reserveddeque.hh File Reference
    \n+Namespaces
    \n+
    overflowarray.hh File Reference
    \n \n
    \n-\n-

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

    \n
    #include <algorithm>
    \n #include <iostream>
    \n #include <cstddef>
    \n+#include <array>
    \n #include <initializer_list>
    \n #include <dune/common/genericiterator.hh>
    \n
    \n

    Go to the source code of this file.

    \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
    \n \n-\n-\n+\n+\n \n

    \n Classes

    class  Dune::Functions::ReservedDeque< T, n >
     A double-ended queue (deque) class with statically reserved memory. More...
    class  Dune::Functions::OverflowArray< BA, maxSize >
     A dynamically sized array-like class with overflow. More...
     
    \n \n \n \n \n \n-

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n-\n-\n-\n

    \n-Macros

    #define CHECKSIZE(X)   {}
     
    \n-

    Detailed Description

    \n-

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

    \n-

    Macro Definition Documentation

    \n-\n-

    ◆ CHECKSIZE

    \n-\n-
    \n-
    \n- \n- \n- \n- \n- \n- \n- \n- \n-
    #define CHECKSIZE( X)   {}
    \n-
    \n-\n-
    \n-
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,38 +5,28 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-Classes | Namespaces | Macros\n-reserveddeque.hh File Reference\n-An stl-compliant double-ended queue which stores everything on the stack.\n-More...\n+Classes | Namespaces\n+overflowarray.hh File Reference\n #include \n #include \n #include \n+#include \n #include \n #include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::ReservedDeque<_T,_n_>\n-\u00a0 A double-ended queue (deque) class with statically reserved memory.\n- More...\n+class \u00a0Dune::Functions::OverflowArray<_BA,_maxSize_>\n+\u00a0 A dynamically sized array-like class with overflow. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n- Macros\n-#define\u00a0CHECKSIZE(X)\u00a0\u00a0\u00a0{}\n-\u00a0\n-***** Detailed Description *****\n-An stl-compliant double-ended queue which stores everything on the stack.\n-***** Macro Definition Documentation *****\n-***** \u25c6\u00a0CHECKSIZE *****\n-#define CHECKSIZE ( \u00a0X ) \u00a0\u00a0\u00a0{}\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00065_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00065_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: reserveddeque.hh Source File\n+dune-functions: overflowarray.hh Source File\n \n \n \n \n \n \n \n@@ -62,229 +62,230 @@\n \n \n
    \n
    \n-
    reserveddeque.hh
    \n+
    overflowarray.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH
    \n-
    4#define DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH
    \n+
    4#define DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH
    \n
    5
    \n-
    10#include <algorithm>
    \n-
    11#include <iostream>
    \n-
    12#include <cstddef>
    \n-
    13#include <initializer_list>
    \n+
    6#include <algorithm>
    \n+
    7#include <iostream>
    \n+
    8#include <cstddef>
    \n+
    9#include <array>
    \n+
    10#include <initializer_list>
    \n+
    11
    \n+
    12#include <dune/common/genericiterator.hh>
    \n+
    13
    \n
    14
    \n-
    15#include <dune/common/genericiterator.hh>
    \n-
    16
    \n-
    17#ifdef CHECK_RESERVEDDEQUE
    \n-
    18#define CHECKSIZE(X) assert(X)
    \n-
    19#else
    \n-
    20#define CHECKSIZE(X) {}
    \n-
    21#endif
    \n-
    22
    \n-
    23namespace Dune {
    \n-
    24namespace Functions {
    \n-
    25
    \n-
    43 template<class T, int n>
    \n-\n-
    45 {
    \n-
    46 public:
    \n+
    15
    \n+
    16namespace Dune::Functions {
    \n+
    17
    \n+
    18
    \n+
    42template<class BA, std::size_t maxSize = std::tuple_size_v<BA>>
    \n+\n+
    44 public BA
    \n+
    45{
    \n+
    46 static constexpr std::size_t baseSize = std::tuple_size_v<BA>;
    \n
    47
    \n-
    51 typedef T value_type;
    \n-
    53 typedef T* pointer;
    \n-
    55 typedef T& reference;
    \n-
    57 typedef const T& const_reference;
    \n-
    59 typedef size_t size_type;
    \n-
    61 typedef std::ptrdiff_t difference_type;
    \n-
    63 typedef Dune::GenericIterator<ReservedDeque, value_type> iterator;
    \n-
    65 typedef Dune::GenericIterator<const ReservedDeque, const value_type> const_iterator;
    \n+
    48public:
    \n+
    49 using BaseArray = BA;
    \n+
    50
    \n+
    51 using value_type = typename BaseArray::value_type;
    \n+\n+\n+\n+
    55 using difference_type = std::ptrdiff_t;
    \n+
    56 using size_type = std::size_t;
    \n+
    57 using iterator = Dune::GenericIterator<OverflowArray, value_type>;
    \n+
    58 using const_iterator = Dune::GenericIterator<const OverflowArray, const value_type>;
    \n+
    59
    \n+
    60private:
    \n+
    61 using OverflowBuffer = std::array<value_type, maxSize-baseSize>;
    \n+
    62
    \n+
    63public:
    \n+
    64
    \n+
    65 OverflowArray() = default;
    \n
    66
    \n-\n-
    73 size_(0),
    \n-
    74 first_(0)
    \n-
    75 {}
    \n-
    76
    \n-
    77 ReservedDeque(std::initializer_list<T> const &l)
    \n-
    78 {
    \n-
    79 assert(l.size() <= n);// Actually, this is not needed any more!
    \n-
    80 size_ = l.size();
    \n-
    81 std::copy_n(l.begin(), size_, data_);
    \n-
    82 }
    \n-
    83
    \n-
    89 void clear()
    \n-
    90 {
    \n-
    91 first_ = 0;
    \n-
    92 size_ = 0;
    \n-
    93 }
    \n-
    94
    \n-
    96 void resize(size_t s)
    \n-
    97 {
    \n-
    98 CHECKSIZE(s<=n);
    \n-
    99 size_ = s;
    \n-
    100 }
    \n-
    101
    \n-
    103 void push_back(const T& t)
    \n-
    104 {
    \n-
    105 CHECKSIZE(size_<n);
    \n-
    106 data_[size_++ % n] = t;
    \n-
    107 }
    \n+
    67 OverflowArray(const std::initializer_list<value_type>& l) {
    \n+
    68 assert(l.size() <= capacity());
    \n+
    69 size_ = l.size();
    \n+
    70 std::copy_n(l.begin(), size_, begin());
    \n+
    71 }
    \n+
    72
    \n+
    73 bool operator == (const OverflowArray& other) const {
    \n+
    74 if (size() != other.size())
    \n+
    75 return false;
    \n+
    76 for (size_type i=0; i<size(); ++i)
    \n+
    77 if ((*this)[i] != other[i])
    \n+
    78 return false;
    \n+
    79 return true;
    \n+
    80 }
    \n+
    81
    \n+
    83 void clear() {
    \n+
    84 size_ = 0;
    \n+
    85 }
    \n+
    86
    \n+
    93 void resize(size_type n) {
    \n+
    94 assert(n <= capacity());
    \n+
    95 size_ = n;
    \n+
    96 }
    \n+
    97
    \n+
    104 void push_back(const value_type& t) {
    \n+
    105 assert(size() < capacity());
    \n+
    106 (*this)[size_++] = t;
    \n+
    107 }
    \n
    108
    \n-
    110 void push_front(const T& t)
    \n-
    111 {
    \n-
    112 CHECKSIZE(size_<n);
    \n-
    113 ++size_;
    \n-
    114 first_ = (first_+(n-1)) % n;
    \n-
    115 data_[first_] = t;
    \n-
    116 }
    \n-
    117
    \n-
    119 void pop_back()
    \n-
    120 {
    \n-
    121 if (! empty())
    \n-
    122 size_--;
    \n-
    123 }
    \n-
    124
    \n-\n-
    127 {
    \n-
    128 if (! empty())
    \n-
    129 {
    \n-
    130 size_--;
    \n-
    131 first_ = (++first_) % n;
    \n-
    132 }
    \n-
    133 }
    \n-
    134
    \n-\n-
    137 return iterator(*this, 0);
    \n-
    138 }
    \n-
    139
    \n-\n-
    142 return const_iterator(*this, 0);
    \n-
    143 }
    \n-
    144
    \n-\n-
    147 return iterator(*this, size_);
    \n-
    148 }
    \n-
    149
    \n-\n-
    152 return const_iterator(*this, size_);
    \n-
    153 }
    \n-
    154
    \n-\n-
    157 {
    \n-
    158 CHECKSIZE(size_>i);
    \n-
    159 return data_[(first_ + i) % n];
    \n-
    160 }
    \n-
    161
    \n-\n-
    164 {
    \n-
    165 CHECKSIZE(size_>i);
    \n-
    166 return data_[(first_ + i) % n];
    \n-
    167 }
    \n-
    168
    \n-\n-
    171 {
    \n-
    172 CHECKSIZE(size_>0);
    \n-
    173 return data_[first_];
    \n-
    174 }
    \n-
    175
    \n-\n-
    178 {
    \n-
    179 CHECKSIZE(size_>0);
    \n-
    180 return data_[first_];
    \n-
    181 }
    \n+
    110 void pop_back() {
    \n+
    111 assert(size() > 0);
    \n+
    112 if (! empty())
    \n+
    113 size_--;
    \n+
    114 }
    \n+
    115
    \n+
    122 void push_front(const value_type& t) {
    \n+
    123 assert(size() < capacity());
    \n+
    124 for (size_type i=0; i<size(); i++)
    \n+
    125 (*this)[i+1] = (*this)[i];
    \n+
    126 (*this)[0] = t;
    \n+
    127 }
    \n+
    128
    \n+\n+
    131 return iterator(*this, 0);
    \n+
    132 }
    \n+
    133
    \n+\n+
    136 return const_iterator(*this, 0);
    \n+
    137 }
    \n+
    138
    \n+\n+
    141 return iterator(*this, size());
    \n+
    142 }
    \n+
    143
    \n+\n+
    146 return const_iterator(*this, size());
    \n+
    147 }
    \n+
    148
    \n+\n+
    151 assert(i < size());
    \n+
    152 // If there's no padding between the base class and the overflow_ member,
    \n+
    153 // the compiler should be able to optimize this to
    \n+
    154 // return *(&BaseArray::operator[](0) + i);
    \n+
    155 if (i<baseSize)
    \n+
    156 return BaseArray::operator[](i);
    \n+
    157 return overflow_[i-baseSize];
    \n+
    158 }
    \n+
    159
    \n+\n+
    162 assert(i < size());
    \n+
    163 // If there's no padding between the base class and the overflow_ member,
    \n+
    164 // the compiler should be able to optimize this to
    \n+
    165 // return *(&BaseArray::operator[](0) + i);
    \n+
    166 if (i<baseSize)
    \n+
    167 return BaseArray::operator[](i);
    \n+
    168 return overflow_[i-baseSize];
    \n+
    169 }
    \n+
    170
    \n+\n+
    173 assert(size() > 0);
    \n+
    174 return (*this)[0];
    \n+
    175 }
    \n+
    176
    \n+\n+
    179 assert(size() > 0);
    \n+
    180 return (*this)[0];
    \n+
    181 }
    \n
    182
    \n-\n-
    185 {
    \n-
    186 CHECKSIZE(size_>0);
    \n-
    187 return data_[(first_ + size_-1) % n];
    \n-
    188 }
    \n-
    189
    \n-\n-
    192 {
    \n-
    193 CHECKSIZE(size_>0);
    \n-
    194 return data_[(first_ + size_-1) % n];
    \n-
    195 }
    \n-
    196
    \n-\n-
    203 {
    \n-
    204 return size_;
    \n-
    205 }
    \n-
    206
    \n-
    208 bool empty() const
    \n-
    209 {
    \n-
    210 return size_==0;
    \n-
    211 }
    \n-
    212
    \n-
    214 static constexpr size_type capacity()
    \n-
    215 {
    \n-
    216 return n;
    \n-
    217 }
    \n-
    218
    \n-
    220 static constexpr size_type max_size()
    \n-
    221 {
    \n-
    222 return n;
    \n-
    223 }
    \n-
    224
    \n-
    228 friend std::ostream& operator<< (std::ostream& s, const ReservedDeque& v)
    \n-
    229 {
    \n-
    230 for (size_t i=0; i<v.size(); i++)
    \n-
    231 s << v[i] << " ";
    \n-
    232 return s;
    \n-
    233 }
    \n-
    234
    \n-
    235 private:
    \n-
    236 T data_[n];
    \n-
    237 size_type first_;
    \n-
    238 size_type size_;
    \n-
    239 };
    \n-
    240
    \n-
    241} // end namespace Functions
    \n-
    242} // end namespace Dune
    \n-
    243
    \n-
    244#undef CHECKSIZE
    \n-
    245
    \n-
    246#endif // DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH
    \n-
    #define CHECKSIZE(X)
    Definition: reserveddeque.hh:20
    \n-
    Definition: polynomial.hh:10
    \n-
    A double-ended queue (deque) class with statically reserved memory.
    Definition: reserveddeque.hh:45
    \n-
    void pop_front()
    Erases the first element of the vector, O(1) time.
    Definition: reserveddeque.hh:126
    \n-
    static constexpr size_type capacity()
    Returns current capacity (allocated memory) of the vector.
    Definition: reserveddeque.hh:214
    \n-
    void clear()
    Erases all elements.
    Definition: reserveddeque.hh:89
    \n-
    Dune::GenericIterator< ReservedDeque, value_type > iterator
    Iterator used to iterate through a vector.
    Definition: reserveddeque.hh:63
    \n-
    T value_type
    The type of object, T, stored in the vector.
    Definition: reserveddeque.hh:51
    \n-
    ReservedDeque()
    Constructor.
    Definition: reserveddeque.hh:72
    \n-
    bool empty() const
    Returns true if vector has no elements.
    Definition: reserveddeque.hh:208
    \n-
    const_reference back() const
    Returns const reference to last element of vector.
    Definition: reserveddeque.hh:191
    \n-
    friend std::ostream & operator<<(std::ostream &s, const ReservedDeque &v)
    Send ReservedDeque to an output stream.
    Definition: reserveddeque.hh:228
    \n-
    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
    \n-
    reference operator[](size_type i)
    Returns reference to the i'th element.
    Definition: reserveddeque.hh:156
    \n-
    reference front()
    Returns reference to first element of vector.
    Definition: reserveddeque.hh:170
    \n-
    T * pointer
    Pointer to T.
    Definition: reserveddeque.hh:53
    \n-
    const_reference front() const
    Returns const reference to first element of vector.
    Definition: reserveddeque.hh:177
    \n-
    iterator end()
    Returns an iterator pointing to the end of the vector.
    Definition: reserveddeque.hh:146
    \n-
    reference back()
    Returns reference to last element of vector.
    Definition: reserveddeque.hh:184
    \n-
    void pop_back()
    Erases the last element of the vector, O(1) time.
    Definition: reserveddeque.hh:119
    \n-
    const T & const_reference
    Const reference to T.
    Definition: reserveddeque.hh:57
    \n-
    static constexpr size_type max_size()
    Returns the maximum length of the vector.
    Definition: reserveddeque.hh:220
    \n-
    std::ptrdiff_t difference_type
    A signed integral type.
    Definition: reserveddeque.hh:61
    \n-
    T & reference
    Reference to T.
    Definition: reserveddeque.hh:55
    \n-
    Dune::GenericIterator< const ReservedDeque, const value_type > const_iterator
    Const iterator used to iterate through a vector.
    Definition: reserveddeque.hh:65
    \n-
    size_type size() const
    Returns number of elements in the vector.
    Definition: reserveddeque.hh:202
    \n-
    const_iterator end() const
    Returns a const_iterator pointing to the end of the vector.
    Definition: reserveddeque.hh:151
    \n-
    void resize(size_t s)
    Specifies a new size for the vector.
    Definition: reserveddeque.hh:96
    \n-
    iterator begin()
    Returns a iterator pointing to the beginning of the vector.
    Definition: reserveddeque.hh:136
    \n-
    const_iterator begin() const
    Returns a const_iterator pointing to the beginning of the vector.
    Definition: reserveddeque.hh:141
    \n-
    ReservedDeque(std::initializer_list< T > const &l)
    Definition: reserveddeque.hh:77
    \n-
    size_t size_type
    An unsigned integral type.
    Definition: reserveddeque.hh:59
    \n-
    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
    \n+\n+
    185 assert(size() > 0);
    \n+
    186 return (*this)[size()-1];
    \n+
    187 }
    \n+
    188
    \n+\n+
    191 assert(size() > 0);
    \n+
    192 return (*this)[size()-1];
    \n+
    193 }
    \n+
    194
    \n+
    196 size_type size () const {
    \n+
    197 return size_;
    \n+
    198 }
    \n+
    199
    \n+
    201 bool empty() const {
    \n+
    202 return size() == 0;
    \n+
    203 }
    \n+
    204
    \n+
    206 static constexpr size_type capacity() {
    \n+
    207 return maxSize;
    \n+
    208 }
    \n+
    209
    \n+
    211 static constexpr size_type max_size() {
    \n+
    212 return maxSize;
    \n+
    213 }
    \n+
    214
    \n+
    216 inline friend std::size_t hash_value(const OverflowArray& v) noexcept {
    \n+
    217 return hash_range(v.begin(), v.end());
    \n+
    218 }
    \n+
    219
    \n+
    221 friend std::ostream& operator<< (std::ostream& s, const OverflowArray& c) {
    \n+
    222 for (const auto& ci : c)
    \n+
    223 s << ci << " ";
    \n+
    224 return s;
    \n+
    225 }
    \n+
    226
    \n+
    227private:
    \n+
    228 OverflowBuffer overflow_;
    \n+
    229 size_type size_ = 0;
    \n+
    230};
    \n+
    231
    \n+
    232
    \n+
    233
    \n+
    234} // namespace Dune::Functions
    \n+
    235
    \n+
    236
    \n+
    237
    \n+
    238#endif // DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH
    \n+
    Definition: polynomial.hh:11
    \n+
    A dynamically sized array-like class with overflow.
    Definition: overflowarray.hh:45
    \n+
    const value_type & const_reference
    Definition: overflowarray.hh:53
    \n+
    value_type & reference
    Definition: overflowarray.hh:52
    \n+
    const_iterator end() const
    Returns a const_iterator pointing to the end of the OverflowArray.
    Definition: overflowarray.hh:145
    \n+
    bool operator==(const OverflowArray &other) const
    Definition: overflowarray.hh:73
    \n+
    friend std::size_t hash_value(const OverflowArray &v) noexcept
    Compute hash value.
    Definition: overflowarray.hh:216
    \n+
    void push_back(const value_type &t)
    Appends an element to the end of the OverflowArray,.
    Definition: overflowarray.hh:104
    \n+
    friend std::ostream & operator<<(std::ostream &s, const OverflowArray &c)
    Write container to an output stream.
    Definition: overflowarray.hh:221
    \n+
    iterator begin()
    Returns a iterator pointing to the beginning of the OverflowArray.
    Definition: overflowarray.hh:130
    \n+
    bool empty() const
    Returns true if OverflowArray has no elements.
    Definition: overflowarray.hh:201
    \n+
    size_type size() const
    Returns number of elements in the OverflowArray.
    Definition: overflowarray.hh:196
    \n+
    typename BaseArray::value_type value_type
    Definition: overflowarray.hh:51
    \n+
    void pop_back()
    Erases the last element of the OverflowArray, O(1) time.
    Definition: overflowarray.hh:110
    \n+
    Dune::GenericIterator< OverflowArray, value_type > iterator
    Definition: overflowarray.hh:57
    \n+
    const_iterator begin() const
    Returns a const_iterator pointing to the beginning of the OverflowArray.
    Definition: overflowarray.hh:135
    \n+
    std::ptrdiff_t difference_type
    Definition: overflowarray.hh:55
    \n+\n+
    BA BaseArray
    Definition: overflowarray.hh:49
    \n+
    static constexpr size_type capacity()
    Returns the capacity of the OverflowArray.
    Definition: overflowarray.hh:206
    \n+
    static constexpr size_type max_size()
    Returns the maximum length of the OverflowArray.
    Definition: overflowarray.hh:211
    \n+
    const_reference front() const
    Returns const reference to first element of OverflowArray.
    Definition: overflowarray.hh:178
    \n+
    void clear()
    Erases all elements.
    Definition: overflowarray.hh:83
    \n+
    iterator end()
    Returns an iterator pointing to the end of the OverflowArray.
    Definition: overflowarray.hh:140
    \n+
    std::size_t size_type
    Definition: overflowarray.hh:56
    \n+
    void resize(size_type n)
    Specifies a new size for the OverflowArray.
    Definition: overflowarray.hh:93
    \n+
    value_type * pointer
    Definition: overflowarray.hh:54
    \n+
    Dune::GenericIterator< const OverflowArray, const value_type > const_iterator
    Definition: overflowarray.hh:58
    \n+
    const_reference back() const
    Returns const reference to last element of OverflowArray.
    Definition: overflowarray.hh:190
    \n+
    OverflowArray(const std::initializer_list< value_type > &l)
    Definition: overflowarray.hh:67
    \n+
    reference back()
    Returns reference to last element of OverflowArray.
    Definition: overflowarray.hh:184
    \n+
    void push_front(const value_type &t)
    Inserts an element to the begin of the OverflowArray,.
    Definition: overflowarray.hh:122
    \n+
    reference front()
    Returns reference to first element of OverflowArray.
    Definition: overflowarray.hh:172
    \n+
    reference operator[](size_type i)
    Returns reference to the i'th element.
    Definition: overflowarray.hh:150
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,319 +5,312 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * common\n-reserveddeque.hh\n+overflowarray.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH\n- 4#define DUNE_FUNCTIONS_COMMON_RESERVEDDEQUE_HH\n+ 3#ifndef DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH\n+ 4#define DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH\n 5\n- 10#include \n- 11#include \n- 12#include \n- 13#include \n+ 6#include \n+ 7#include \n+ 8#include \n+ 9#include \n+ 10#include \n+ 11\n+ 12#include \n+ 13\n 14\n- 15#include \n- 16\n- 17#ifdef CHECK_RESERVEDDEQUE\n- 18#define CHECKSIZE(X) assert(X)\n- 19#else\n-20#define CHECKSIZE(X) {}\n- 21#endif\n- 22\n- 23namespace Dune {\n- 24namespace Functions {\n- 25\n- 43 template\n-44 class ReservedDeque\n- 45 {\n- 46 public:\n+ 15\n+ 16namespace Dune::Functions {\n+ 17\n+ 18\n+ 42template>\n+43class OverflowArray :\n+ 44 public BA\n+ 45{\n+ 46 static constexpr std::size_t baseSize = std::tuple_size_v;\n 47\n-51 typedef T value_type;\n-53 typedef T* pointer;\n-55 typedef T& reference;\n-57 typedef const T& const_reference;\n-59 typedef size_t size_type;\n-61 typedef std::ptrdiff_t difference_type;\n-63 typedef Dune::GenericIterator iterator;\n-65 typedef Dune::GenericIterator\n-const_iterator;\n+ 48public:\n+49 using BaseArray = BA;\n+ 50\n+51 using value_type = typename BaseArray::value_type;\n+52 using reference = value_type&;\n+53 using const_reference = const value_type&;\n+54 using pointer = value_type*;\n+55 using difference_type = std::ptrdiff_t;\n+56 using size_type = std::size_t;\n+57 using iterator = Dune::GenericIterator;\n+58 using const_iterator = Dune::GenericIterator;\n+ 59\n+ 60private:\n+ 61 using OverflowBuffer = std::array;\n+ 62\n+ 63public:\n+ 64\n+65 OverflowArray() = default;\n 66\n-72 ReservedDeque() :\n- 73 size_(0),\n- 74 first_(0)\n- 75 {}\n- 76\n-77 ReservedDeque(std::initializer_list const &l)\n- 78 {\n- 79 assert(l.size() <= n);// Actually, this is not needed any more!\n- 80 size_ = l.size();\n- 81 std::copy_n(l.begin(), size_, data_);\n- 82 }\n- 83\n-89 void clear()\n- 90 {\n- 91 first_ = 0;\n- 92 size_ = 0;\n- 93 }\n- 94\n-96 void resize(size_t s)\n- 97 {\n- 98 CHECKSIZE(s<=n);\n- 99 size_ = s;\n- 100 }\n- 101\n-103 void push_back(const T& t)\n- 104 {\n- 105 CHECKSIZE(size_& l) {\n+ 68 assert(l.size() <= capacity());\n+ 69 size_ = l.size();\n+ 70 std::copy_n(l.begin(), size_, begin());\n+ 71 }\n+ 72\n+73 bool operator_==(const OverflowArray& other) const {\n+ 74 if (size() != other.size())\n+ 75 return false;\n+ 76 for (size_type i=0; i 0);\n+ 112 if (! empty())\n+ 113 size_--;\n+ 114 }\n+ 115\n+122 void push_front(const value_type& t) {\n+ 123 assert(size() < capacity());\n+ 124 for (size_type i=0; ii);\n- 159 return data_[(first_ + i) % n];\n- 160 }\n- 161\n-163 const_reference operator[](size_type i) const\n- 164 {\n- 165 CHECKSIZE(size_>i);\n- 166 return data_[(first_ + i) % n];\n- 167 }\n- 168\n-170 reference front()\n- 171 {\n- 172 CHECKSIZE(size_>0);\n- 173 return data_[first_];\n- 174 }\n- 175\n-177 const_reference front() const\n- 178 {\n- 179 CHECKSIZE(size_>0);\n- 180 return data_[first_];\n+ 133\n+135 const_iterator begin() const {\n+ 136 return const_iterator(*this, 0);\n+ 137 }\n+ 138\n+140 iterator end() {\n+ 141 return iterator(*this, size());\n+ 142 }\n+ 143\n+145 const_iterator end() const {\n+ 146 return const_iterator(*this, size());\n+ 147 }\n+ 148\n+150 reference operator[](size_type i) {\n+ 151 assert(i < size());\n+ 152 // If there's no padding between the base class and the overflow_ member,\n+ 153 // the compiler should be able to optimize this to\n+ 154 // return *(&BaseArray::operator[](0) + i);\n+ 155 if (i 0);\n+ 174 return (*this)[0];\n+ 175 }\n+ 176\n+178 const_reference front() const {\n+ 179 assert(size() > 0);\n+ 180 return (*this)[0];\n 181 }\n 182\n-184 reference back()\n- 185 {\n- 186 CHECKSIZE(size_>0);\n- 187 return data_[(first_ + size_-1) % n];\n- 188 }\n- 189\n-191 const_reference back() const\n- 192 {\n- 193 CHECKSIZE(size_>0);\n- 194 return data_[(first_ + size_-1) % n];\n- 195 }\n- 196\n-202 size_type size () const\n- 203 {\n- 204 return size_;\n- 205 }\n- 206\n-208 bool empty() const\n- 209 {\n- 210 return size_==0;\n- 211 }\n- 212\n-214 static constexpr size_type capacity()\n- 215 {\n- 216 return n;\n- 217 }\n- 218\n-220 static constexpr size_type max_size()\n- 221 {\n- 222 return n;\n- 223 }\n- 224\n-228 friend std::ostream& operator<<(std::ostream& s, const ReservedDeque& v)\n- 229 {\n- 230 for (size_t i=0; i 0);\n+ 186 return (*this)[size()-1];\n+ 187 }\n+ 188\n+190 const_reference back() const {\n+ 191 assert(size() > 0);\n+ 192 return (*this)[size()-1];\n+ 193 }\n+ 194\n+196 size_type size () const {\n+ 197 return size_;\n+ 198 }\n+ 199\n+201 bool empty() const {\n+ 202 return size() == 0;\n+ 203 }\n+ 204\n+206 static constexpr size_type capacity() {\n+ 207 return maxSize;\n+ 208 }\n+ 209\n+211 static constexpr size_type max_size() {\n+ 212 return maxSize;\n+ 213 }\n+ 214\n+216 inline friend std::size_t hash_value(const OverflowArray& v) noexcept {\n+ 217 return hash_range(v.begin(), v.end());\n+ 218 }\n+ 219\n+221 friend std::ostream& operator<<(std::ostream& s, const OverflowArray& c) {\n+ 222 for (const auto& ci : c)\n+ 223 s << ci << \" \";\n+ 224 return s;\n+ 225 }\n+ 226\n+ 227private:\n+ 228 OverflowBuffer overflow_;\n+ 229 size_type size_ = 0;\n+ 230};\n+ 231\n+ 232\n+ 233\n+ 234} // namespace Dune::Functions\n+ 235\n+ 236\n+ 237\n+ 238#endif // DUNE_FUNCTIONS_COMMON_OVERFLOWARRAY_HH\n+Dune::Functions\n+Definition: polynomial.hh:11\n+Dune::Functions::OverflowArray\n+A dynamically sized array-like class with overflow.\n+Definition: overflowarray.hh:45\n+Dune::Functions::OverflowArray::const_reference\n+const value_type & const_reference\n+Definition: overflowarray.hh:53\n+Dune::Functions::OverflowArray::reference\n+value_type & reference\n+Definition: overflowarray.hh:52\n+Dune::Functions::OverflowArray::end\n+const_iterator end() const\n+Returns a const_iterator pointing to the end of the OverflowArray.\n+Definition: overflowarray.hh:145\n+Dune::Functions::OverflowArray::operator==\n+bool operator==(const OverflowArray &other) const\n+Definition: overflowarray.hh:73\n+Dune::Functions::OverflowArray::hash_value\n+friend std::size_t hash_value(const OverflowArray &v) noexcept\n+Compute hash value.\n+Definition: overflowarray.hh:216\n+Dune::Functions::OverflowArray::push_back\n+void push_back(const value_type &t)\n+Appends an element to the end of the OverflowArray,.\n+Definition: overflowarray.hh:104\n+Dune::Functions::OverflowArray::operator<<\n+friend std::ostream & operator<<(std::ostream &s, const OverflowArray &c)\n+Write container to an output stream.\n+Definition: overflowarray.hh:221\n+Dune::Functions::OverflowArray::begin\n+iterator begin()\n+Returns a iterator pointing to the beginning of the OverflowArray.\n+Definition: overflowarray.hh:130\n+Dune::Functions::OverflowArray::empty\n+bool empty() const\n+Returns true if OverflowArray has no elements.\n+Definition: overflowarray.hh:201\n+Dune::Functions::OverflowArray::size\n+size_type size() const\n+Returns number of elements in the OverflowArray.\n+Definition: overflowarray.hh:196\n+Dune::Functions::OverflowArray::value_type\n+typename BaseArray::value_type value_type\n+Definition: overflowarray.hh:51\n+Dune::Functions::OverflowArray::pop_back\n+void pop_back()\n+Erases the last element of the OverflowArray, O(1) time.\n+Definition: overflowarray.hh:110\n+Dune::Functions::OverflowArray::iterator\n+Dune::GenericIterator< OverflowArray, value_type > iterator\n+Definition: overflowarray.hh:57\n+Dune::Functions::OverflowArray::begin\n+const_iterator begin() const\n+Returns a const_iterator pointing to the beginning of the OverflowArray.\n+Definition: overflowarray.hh:135\n+Dune::Functions::OverflowArray::difference_type\n+std::ptrdiff_t difference_type\n+Definition: overflowarray.hh:55\n+Dune::Functions::OverflowArray::OverflowArray\n+OverflowArray()=default\n+Dune::Functions::OverflowArray::BaseArray\n+BA BaseArray\n+Definition: overflowarray.hh:49\n+Dune::Functions::OverflowArray::capacity\n static constexpr size_type capacity()\n-Returns current capacity (allocated memory) of the vector.\n-Definition: reserveddeque.hh:214\n-Dune::Functions::ReservedDeque::clear\n+Returns the capacity of the OverflowArray.\n+Definition: overflowarray.hh:206\n+Dune::Functions::OverflowArray::max_size\n+static constexpr size_type max_size()\n+Returns the maximum length of the OverflowArray.\n+Definition: overflowarray.hh:211\n+Dune::Functions::OverflowArray::front\n+const_reference front() const\n+Returns const reference to first element of OverflowArray.\n+Definition: overflowarray.hh:178\n+Dune::Functions::OverflowArray::clear\n void clear()\n Erases all elements.\n-Definition: reserveddeque.hh:89\n-Dune::Functions::ReservedDeque::iterator\n-Dune::GenericIterator< ReservedDeque, value_type > iterator\n-Iterator used to iterate through a vector.\n-Definition: reserveddeque.hh:63\n-Dune::Functions::ReservedDeque::value_type\n-T value_type\n-The type of object, T, stored in the vector.\n-Definition: reserveddeque.hh:51\n-Dune::Functions::ReservedDeque::ReservedDeque\n-ReservedDeque()\n-Constructor.\n-Definition: reserveddeque.hh:72\n-Dune::Functions::ReservedDeque::empty\n-bool empty() const\n-Returns true if vector has no elements.\n-Definition: reserveddeque.hh:208\n-Dune::Functions::ReservedDeque::back\n+Definition: overflowarray.hh:83\n+Dune::Functions::OverflowArray::end\n+iterator end()\n+Returns an iterator pointing to the end of the OverflowArray.\n+Definition: overflowarray.hh:140\n+Dune::Functions::OverflowArray::size_type\n+std::size_t size_type\n+Definition: overflowarray.hh:56\n+Dune::Functions::OverflowArray::resize\n+void resize(size_type n)\n+Specifies a new size for the OverflowArray.\n+Definition: overflowarray.hh:93\n+Dune::Functions::OverflowArray::pointer\n+value_type * pointer\n+Definition: overflowarray.hh:54\n+Dune::Functions::OverflowArray::const_iterator\n+Dune::GenericIterator< const OverflowArray, const value_type > const_iterator\n+Definition: overflowarray.hh:58\n+Dune::Functions::OverflowArray::back\n const_reference back() const\n-Returns const reference to last element of vector.\n-Definition: reserveddeque.hh:191\n-Dune::Functions::ReservedDeque::operator<<\n-friend std::ostream & operator<<(std::ostream &s, const ReservedDeque &v)\n-Send ReservedDeque to an output stream.\n-Definition: reserveddeque.hh:228\n-Dune::Functions::ReservedDeque::push_front\n-void push_front(const T &t)\n-Prepends an element to the begin of a deque if size &l)\n+Definition: overflowarray.hh:67\n+Dune::Functions::OverflowArray::back\n+reference back()\n+Returns reference to last element of OverflowArray.\n+Definition: overflowarray.hh:184\n+Dune::Functions::OverflowArray::push_front\n+void push_front(const value_type &t)\n+Inserts an element to the begin of the OverflowArray,.\n+Definition: overflowarray.hh:122\n+Dune::Functions::OverflowArray::front\n+reference front()\n+Returns reference to first element of OverflowArray.\n+Definition: overflowarray.hh:172\n+Dune::Functions::OverflowArray::operator[]\n reference operator[](size_type i)\n Returns reference to the i'th element.\n-Definition: reserveddeque.hh:156\n-Dune::Functions::ReservedDeque::front\n-reference front()\n-Returns reference to first element of vector.\n-Definition: reserveddeque.hh:170\n-Dune::Functions::ReservedDeque::pointer\n-T * pointer\n-Pointer to T.\n-Definition: reserveddeque.hh:53\n-Dune::Functions::ReservedDeque::front\n-const_reference front() const\n-Returns const reference to first element of vector.\n-Definition: reserveddeque.hh:177\n-Dune::Functions::ReservedDeque::end\n-iterator end()\n-Returns an iterator pointing to the end of the vector.\n-Definition: reserveddeque.hh:146\n-Dune::Functions::ReservedDeque::back\n-reference back()\n-Returns reference to last element of vector.\n-Definition: reserveddeque.hh:184\n-Dune::Functions::ReservedDeque::pop_back\n-void pop_back()\n-Erases the last element of the vector, O(1) time.\n-Definition: reserveddeque.hh:119\n-Dune::Functions::ReservedDeque::const_reference\n-const T & const_reference\n-Const reference to T.\n-Definition: reserveddeque.hh:57\n-Dune::Functions::ReservedDeque::max_size\n-static constexpr size_type max_size()\n-Returns the maximum length of the vector.\n-Definition: reserveddeque.hh:220\n-Dune::Functions::ReservedDeque::difference_type\n-std::ptrdiff_t difference_type\n-A signed integral type.\n-Definition: reserveddeque.hh:61\n-Dune::Functions::ReservedDeque::reference\n-T & reference\n-Reference to T.\n-Definition: reserveddeque.hh:55\n-Dune::Functions::ReservedDeque::const_iterator\n-Dune::GenericIterator< const ReservedDeque, const value_type > const_iterator\n-Const iterator used to iterate through a vector.\n-Definition: reserveddeque.hh:65\n-Dune::Functions::ReservedDeque::size\n-size_type size() const\n-Returns number of elements in the vector.\n-Definition: reserveddeque.hh:202\n-Dune::Functions::ReservedDeque::end\n-const_iterator end() const\n-Returns a const_iterator pointing to the end of the vector.\n-Definition: reserveddeque.hh:151\n-Dune::Functions::ReservedDeque::resize\n-void resize(size_t s)\n-Specifies a new size for the vector.\n-Definition: reserveddeque.hh:96\n-Dune::Functions::ReservedDeque::begin\n-iterator begin()\n-Returns a iterator pointing to the beginning of the vector.\n-Definition: reserveddeque.hh:136\n-Dune::Functions::ReservedDeque::begin\n-const_iterator begin() const\n-Returns a const_iterator pointing to the beginning of the vector.\n-Definition: reserveddeque.hh:141\n-Dune::Functions::ReservedDeque::ReservedDeque\n-ReservedDeque(std::initializer_list< T > const &l)\n-Definition: reserveddeque.hh:77\n-Dune::Functions::ReservedDeque::size_type\n-size_t size_type\n-An unsigned integral type.\n-Definition: reserveddeque.hh:59\n-Dune::Functions::ReservedDeque::push_back\n-void push_back(const T &t)\n-Appends an element to the end of a vector, up to the maximum size n, O(1) time.\n-Definition: reserveddeque.hh:103\n+Definition: overflowarray.hh:150\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00068.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00068.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: trigonometricfunction.hh File Reference\n+dune-functions: defaultnodetorangemap.hh File Reference\n \n \n \n \n \n \n \n@@ -58,48 +58,55 @@\n \n \n \n \n \n
    \n \n-
    trigonometricfunction.hh File Reference
    \n+
    defaultnodetorangemap.hh File Reference
    \n
    \n
    \n-
    #include <cmath>
    \n+
    #include <dune/common/concept.hh>
    \n+#include <dune/functions/functionspacebases/concepts.hh>
    \n+#include <dune/typetree/traversal.hh>
    \n+#include <dune/typetree/visitor.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n+\n+\n+\n+\n \n

    \n Classes

    class  Dune::Functions::TrigonometricFunction< K, sinFactor, cosFactor >
     A linear combination of trigonomic functions. More...
    struct  Dune::Functions::DefaultNodeToRangeMap< Tree >
     A simple node to range map using lexicographic ordering. More...
     
    struct  Dune::Functions::DefaultNodeToRangeMap< Tree >::Visitor
     
    \n \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n \n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n

    \n 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. More...
     
    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)))
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,32 +4,40 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * analyticfunctions\n+ * functionspacebases\n Classes | Namespaces | Functions\n-trigonometricfunction.hh File Reference\n-#include \n+defaultnodetorangemap.hh File Reference\n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::TrigonometricFunction<_K,_sinFactor,_cosFactor_>\n-\u00a0 A linear combination of trigonomic functions. More...\n+struct \u00a0Dune::Functions::DefaultNodeToRangeMap<_Tree_>\n+\u00a0 A simple node to range map using lexicographic ordering. More...\n+\u00a0\n+struct \u00a0Dune::Functions::DefaultNodeToRangeMap<_Tree_>::Visitor\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n Functions\n-template\n-TrigonometricFunction< K, -cosFactor, Dune::Functions::derivative (const\n- sinFactor >\u00a0TrigonometricFunction< K, sinFactor,\n- cosFactor > &f)\n-\u00a0 Obtain derivative of\n- TrigonometricFunction function. More...\n+template\n+DefaultNodeToRangeMap< Tree >\u00a0Dune::Functions::makeDefaultNodeToRangeMap\n+ (const Tree &tree)\n+\u00a0\n+template\n+ auto\u00a0Dune::Functions::makeDefaultNodeToRangeMap\n+ (const Basis &basis, TreePath &&treePath) -\n+ > decltype(makeDefaultNodeToRangeMap(TypeTree::\n+ child(basis.localView().tree(), treePath)))\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00068_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00068_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: trigonometricfunction.hh Source File\n+dune-functions: defaultnodetorangemap.hh Source File\n \n \n \n \n \n \n \n@@ -58,61 +58,131 @@\n \n
    \n \n \n \n
    \n-
    trigonometricfunction.hh
    \n+
    defaultnodetorangemap.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
    \n-
    4#define DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH
    \n
    5
    \n-
    6#include <cmath>
    \n-
    7
    \n-
    8namespace Dune {
    \n-
    9namespace Functions {
    \n+
    6
    \n+
    7#include <dune/common/concept.hh>
    \n+
    8
    \n+\n
    10
    \n-
    11
    \n-
    12
    \n-
    25template<class K, int sinFactor, int cosFactor>
    \n-\n-
    27{
    \n-
    28public:
    \n-
    30 K operator () (const K& x) const
    \n-
    31 {
    \n-
    32 return sinFactor * std::sin(x) + cosFactor * std::cos(x);
    \n-
    33 }
    \n-
    34};
    \n-
    35
    \n-
    36
    \n-
    38template<class K, int sinFactor, int cosFactor>
    \n-\n-
    40{
    \n-
    41 return TrigonometricFunction<K, -cosFactor, sinFactor>();
    \n-
    42}
    \n-
    43
    \n-
    44
    \n-
    45
    \n-
    46}} // namespace Dune::Functions
    \n-
    47
    \n-
    48
    \n-
    49
    \n-
    50#endif // DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
    \n-
    TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
    Obtain derivative of TrigonometricFunction function.
    Definition: trigonometricfunction.hh:39
    \n+
    11#include <dune/typetree/traversal.hh>
    \n+
    12#include <dune/typetree/visitor.hh>
    \n+
    13
    \n+
    14
    \n+
    15namespace Dune {
    \n+
    16namespace Functions {
    \n+
    17
    \n+
    18
    \n+
    19
    \n+
    37template<class Tree>
    \n+\n+
    39{
    \n+
    40
    \n+
    41 // A simple visitor for computing lexicographic
    \n+
    42 // subtree indices. To identify a leaf node
    \n+
    43 // we use its treeIndex() which is unique
    \n+
    44 // wrt the whole tree and store the computed
    \n+
    45 // index in a vector indexed by the tree indices.
    \n+
    46 struct Visitor
    \n+
    47 : public TypeTree::TreeVisitor
    \n+
    48 , public TypeTree::DynamicTraversal
    \n+
    49 {
    \n+
    50 Visitor(std::vector<std::size_t>& indices) :
    \n+
    51 indices_(indices),
    \n+
    52 counter_(0)
    \n+
    53 {}
    \n+
    54
    \n+
    55 template<typename Node, typename TreePath>
    \n+
    56 void leaf(Node& node, TreePath treePath)
    \n+
    57 {
    \n+
    58 if (indices_.size() < node.treeIndex()+1)
    \n+
    59 indices_.resize(node.treeIndex()+1);
    \n+
    60 indices_[node.treeIndex()] = counter_;
    \n+
    61 ++counter_;
    \n+
    62 }
    \n+
    63
    \n+
    64 std::vector<std::size_t>& indices_;
    \n+
    65 std::size_t counter_;
    \n+
    66 };
    \n+
    67
    \n+
    78 DefaultNodeToRangeMap(const Tree& tree)
    \n+
    79 {
    \n+
    80 TypeTree::applyToTree(tree, Visitor(indices_));
    \n+
    81 }
    \n+
    82
    \n+
    83 template<class Node, class TreePath, class Range,
    \n+
    84 std::enable_if_t<models<Concept::HasIndexAccess, Range, decltype(std::declval<Node>().treeIndex())>() and not Tree::isLeaf, int> = 0>
    \n+
    85 decltype(auto) operator()(const Node& node, const TreePath& treePath, Range&& y) const
    \n+
    86 {
    \n+
    87 return y[indices_[node.treeIndex()]];
    \n+
    88 }
    \n+
    89
    \n+
    90 template<class Node, class TreePath, class Range,
    \n+
    91 std::enable_if_t< not models<Concept::HasIndexAccess, Range, decltype(std::declval<Node>().treeIndex())>() or Tree::isLeaf, int> = 0>
    \n+
    92 decltype(auto) operator()(const Node& node, const TreePath& treePath, Range&& y) const
    \n+
    93 {
    \n+
    94 return std::forward<Range>(y);
    \n+
    95 }
    \n+
    96
    \n+
    97 std::vector<std::size_t> indices_;
    \n+
    98};
    \n+
    99
    \n+
    100
    \n+
    101
    \n+
    102template<class Tree>
    \n+\n+
    104{
    \n+
    105 return DefaultNodeToRangeMap<Tree>(tree);
    \n+
    106}
    \n+
    107
    \n+
    108
    \n+
    109
    \n+
    110template<class Basis, class TreePath>
    \n+
    111auto makeDefaultNodeToRangeMap(const Basis& basis, TreePath&& treePath)
    \n+
    112 -> decltype(makeDefaultNodeToRangeMap(TypeTree::child(basis.localView().tree(),treePath)))
    \n+
    113{
    \n+
    114 auto&& localView = basis.localView();
    \n+
    115 localView.bind(*basis.gridView().template begin<0>());
    \n+
    116 auto&& tree = TypeTree::child(localView.tree(),treePath);
    \n+
    117 return makeDefaultNodeToRangeMap(tree);
    \n+
    118}
    \n+
    119
    \n+
    120
    \n+
    121
    \n+
    122} // namespace Dune::Functions
    \n+
    123} // namespace Dune
    \n+
    124
    \n+
    125
    \n+
    126#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH
    \n
    Definition: polynomial.hh:10
    \n-
    A linear combination of trigonomic functions.
    Definition: trigonometricfunction.hh:27
    \n-
    K operator()(const K &x) const
    Evaluate function.
    Definition: trigonometricfunction.hh:30
    \n+
    DefaultNodeToRangeMap< Tree > makeDefaultNodeToRangeMap(const Tree &tree)
    Definition: defaultnodetorangemap.hh:103
    \n+
    A simple node to range map using lexicographic ordering.
    Definition: defaultnodetorangemap.hh:39
    \n+
    std::vector< std::size_t > indices_
    Definition: defaultnodetorangemap.hh:97
    \n+
    DefaultNodeToRangeMap(const Tree &tree)
    Construct DefaultNodeToRangeMap.
    Definition: defaultnodetorangemap.hh:78
    \n+
    Definition: defaultnodetorangemap.hh:49
    \n+
    Visitor(std::vector< std::size_t > &indices)
    Definition: defaultnodetorangemap.hh:50
    \n+
    void leaf(Node &node, TreePath treePath)
    Definition: defaultnodetorangemap.hh:56
    \n+
    std::size_t counter_
    Definition: defaultnodetorangemap.hh:65
    \n+
    std::vector< std::size_t > & indices_
    Definition: defaultnodetorangemap.hh:64
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,64 +4,147 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * analyticfunctions\n-trigonometricfunction.hh\n+ * functionspacebases\n+defaultnodetorangemap.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH\n- 4#define DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH\n 5\n- 6#include \n- 7\n- 8namespace Dune {\n- 9namespace Functions {\n+ 6\n+ 7#include \n+ 8\n+ 9#include \n 10\n- 11\n- 12\n- 25template\n-26class TrigonometricFunction\n- 27{\n- 28public:\n-30 K operator_()(const K& x) const\n- 31 {\n- 32 return sinFactor * std::sin(x) + cosFactor * std::cos(x);\n- 33 }\n- 34};\n- 35\n- 36\n- 38template\n-39TrigonometricFunction derivative(const\n-TrigonometricFunction& f)\n- 40{\n- 41 return TrigonometricFunction();\n- 42}\n- 43\n- 44\n- 45\n- 46}} // namespace Dune::Functions\n- 47\n- 48\n- 49\n- 50#endif // DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH\n-Dune::Functions::derivative\n-TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const\n-TrigonometricFunction< K, sinFactor, cosFactor > &f)\n-Obtain derivative of TrigonometricFunction function.\n-Definition: trigonometricfunction.hh:39\n+ 11#include \n+ 12#include \n+ 13\n+ 14\n+ 15namespace Dune {\n+ 16namespace Functions {\n+ 17\n+ 18\n+ 19\n+ 37template\n+38struct DefaultNodeToRangeMap\n+ 39{\n+ 40\n+ 41 // A simple visitor for computing lexicographic\n+ 42 // subtree indices. To identify a leaf node\n+ 43 // we use its treeIndex() which is unique\n+ 44 // wrt the whole tree and store the computed\n+ 45 // index in a vector indexed by the tree indices.\n+46 struct Visitor\n+ 47 : public TypeTree::TreeVisitor\n+ 48 , public TypeTree::DynamicTraversal\n+ 49 {\n+50 Visitor(std::vector& indices) :\n+ 51 indices_(indices),\n+ 52 counter_(0)\n+ 53 {}\n+ 54\n+ 55 template\n+56 void leaf(Node& node, TreePath treePath)\n+ 57 {\n+ 58 if (indices_.size() < node.treeIndex()+1)\n+ 59 indices_.resize(node.treeIndex()+1);\n+ 60 indices_[node.treeIndex()] = counter_;\n+ 61 ++counter_;\n+ 62 }\n+ 63\n+64 std::vector& indices_;\n+65 std::size_t counter_;\n+ 66 };\n+ 67\n+78 DefaultNodeToRangeMap(const Tree& tree)\n+ 79 {\n+ 80 TypeTree::applyToTree(tree, Visitor(indices_));\n+ 81 }\n+ 82\n+ 83 template().treeIndex())>() and not Tree::isLeaf, int> = 0>\n+85 decltype(auto) operator()(const Node& node, const TreePath& treePath,\n+Range&& y) const\n+ 86 {\n+ 87 return y[indices_[node.treeIndex()]];\n+ 88 }\n+ 89\n+ 90 template().treeIndex())>() or Tree::isLeaf, int> = 0>\n+92 decltype(auto) operator()(const Node& node, const TreePath& treePath,\n+Range&& y) const\n+ 93 {\n+ 94 return std::forward(y);\n+ 95 }\n+ 96\n+97 std::vector indices_;\n+ 98};\n+ 99\n+ 100\n+ 101\n+ 102template\n+103DefaultNodeToRangeMap makeDefaultNodeToRangeMap(const Tree& tree)\n+ 104{\n+ 105 return DefaultNodeToRangeMap(tree);\n+ 106}\n+ 107\n+ 108\n+ 109\n+ 110template\n+111auto makeDefaultNodeToRangeMap(const Basis& basis, TreePath&& treePath)\n+ 112 -> decltype(makeDefaultNodeToRangeMap(TypeTree::child(basis.localView\n+().tree(),treePath)))\n+ 113{\n+ 114 auto&& localView = basis.localView();\n+ 115 localView.bind(*basis.gridView().template begin<0>());\n+ 116 auto&& tree = TypeTree::child(localView.tree(),treePath);\n+ 117 return makeDefaultNodeToRangeMap(tree);\n+ 118}\n+ 119\n+ 120\n+ 121\n+ 122} // namespace Dune::Functions\n+ 123} // namespace Dune\n+ 124\n+ 125\n+ 126#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::TrigonometricFunction\n-A linear combination of trigonomic functions.\n-Definition: trigonometricfunction.hh:27\n-Dune::Functions::TrigonometricFunction::operator()\n-K operator()(const K &x) const\n-Evaluate function.\n-Definition: trigonometricfunction.hh:30\n+Dune::Functions::makeDefaultNodeToRangeMap\n+DefaultNodeToRangeMap< Tree > makeDefaultNodeToRangeMap(const Tree &tree)\n+Definition: defaultnodetorangemap.hh:103\n+Dune::Functions::DefaultNodeToRangeMap\n+A simple node to range map using lexicographic ordering.\n+Definition: defaultnodetorangemap.hh:39\n+Dune::Functions::DefaultNodeToRangeMap::indices_\n+std::vector< std::size_t > indices_\n+Definition: defaultnodetorangemap.hh:97\n+Dune::Functions::DefaultNodeToRangeMap::DefaultNodeToRangeMap\n+DefaultNodeToRangeMap(const Tree &tree)\n+Construct DefaultNodeToRangeMap.\n+Definition: defaultnodetorangemap.hh:78\n+Dune::Functions::DefaultNodeToRangeMap::Visitor\n+Definition: defaultnodetorangemap.hh:49\n+Dune::Functions::DefaultNodeToRangeMap::Visitor::Visitor\n+Visitor(std::vector< std::size_t > &indices)\n+Definition: defaultnodetorangemap.hh:50\n+Dune::Functions::DefaultNodeToRangeMap::Visitor::leaf\n+void leaf(Node &node, TreePath treePath)\n+Definition: defaultnodetorangemap.hh:56\n+Dune::Functions::DefaultNodeToRangeMap::Visitor::counter_\n+std::size_t counter_\n+Definition: defaultnodetorangemap.hh:65\n+Dune::Functions::DefaultNodeToRangeMap::Visitor::indices_\n+std::vector< std::size_t > & indices_\n+Definition: defaultnodetorangemap.hh:64\n+concepts.hh\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00074.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00074.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: istlvectorbackend.hh File Reference\n+dune-functions: boundarydofs.hh File Reference\n \n \n \n \n \n \n \n@@ -58,61 +58,42 @@\n \n \n \n \n \n
    \n \n-
    istlvectorbackend.hh File Reference
    \n+
    boundarydofs.hh File Reference
    \n
    \n
    \n-
    #include <cstddef>
    \n-#include <utility>
    \n-#include <type_traits>
    \n-#include <dune/common/std/type_traits.hh>
    \n-#include <dune/common/indices.hh>
    \n-#include <dune/common/hybridutilities.hh>
    \n-#include <dune/common/concept.hh>
    \n-#include <dune/functions/common/indexaccess.hh>
    \n-#include <dune/functions/functionspacebases/concepts.hh>
    \n+
    #include <utility>
    \n+#include <dune/functions/functionspacebases/subentitydofs.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n

    \n Functions

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

    Go to the source code of this file.

    \n \n-\n-\n-\n-\n-

    \n-Classes

    class  Dune::Functions::GridViewEntitySet< GV, cd >
     An entity set for all entities of given codim in a grid view. More...
     
    \n \n \n \n \n \n+

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n

    \n+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. More...
     
    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. More...
     
    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. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,24 +4,48 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * gridfunctions\n-Classes | Namespaces\n-gridviewentityset.hh File Reference\n+ * functionspacebases\n+Namespaces | Functions\n+interpolate.hh File Reference\n #include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n- Classes\n-class \u00a0Dune::Functions::GridViewEntitySet<_GV,_cd_>\n-\u00a0 An entity set for all entities of given codim in a grid view. More...\n-\u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n+ Functions\n+template\n+void\u00a0Dune::Functions::interpolate (const B &basis, C &&coeff, const F &f,\n+ const BV &bv, const NTRE &nodeToRangeEntry)\n+\u00a0 Interpolate given function in discrete function space. More...\n+\u00a0\n+template\n+void\u00a0Dune::Functions::interpolate (const B &basis, C &&coeff, const F &f,\n+ const BV &bitVector)\n+\u00a0 Interpolate given function in discrete function space. More...\n+\u00a0\n+template\n+void\u00a0Dune::Functions::interpolate (const B &basis, C &&coeff, const F &f)\n+\u00a0 Interpolate given function in discrete function space. More...\n+\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00080_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00080_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: gridviewentityset.hh Source File\n+dune-functions: interpolate.hh Source File\n \n \n \n \n \n \n \n@@ -58,109 +58,290 @@\n \n \n \n \n \n
    \n-
    gridviewentityset.hh
    \n+
    interpolate.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH
    \n-
    4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH
    \n
    5
    \n
    6#include <memory>
    \n-
    7
    \n+
    7#include <vector>
    \n
    8
    \n-
    9namespace Dune {
    \n-
    10
    \n-
    11namespace Functions {
    \n-
    12
    \n+
    9#include <dune/common/exceptions.hh>
    \n+
    10#include <dune/common/bitsetvector.hh>
    \n+
    11
    \n+
    12#include <dune/typetree/childextraction.hh>
    \n
    13
    \n-
    21template<class GV, int cd>
    \n-\n-
    23{
    \n-
    24public:
    \n+\n+\n+
    16
    \n+\n+\n+\n+\n+\n+
    22
    \n+
    23#include <dune/typetree/traversal.hh>
    \n+
    24#include <dune/typetree/visitor.hh>
    \n
    25
    \n-
    26 typedef GV GridView;
    \n-
    27 enum {
    \n-
    28 codim = cd
    \n-
    29 };
    \n+
    26namespace Dune {
    \n+
    27namespace Functions {
    \n+
    28
    \n+
    29namespace Imp {
    \n
    30
    \n-
    32 typedef typename GridView::template Codim<codim>::Entity Element;
    \n-
    33
    \n-
    35 typedef typename Element::Geometry::LocalCoordinate LocalCoordinate;
    \n-
    36 typedef typename Element::Geometry::GlobalCoordinate GlobalCoordinate;
    \n+
    31struct AllTrueBitSetVector
    \n+
    32{
    \n+
    33 struct AllTrueBitSet
    \n+
    34 {
    \n+
    35 bool test(int) const { return true; }
    \n+
    36 } allTrue_;
    \n
    37
    \n-\n-
    39
    \n-
    41 typedef typename GridView::template Codim<codim>::Iterator const_iterator;
    \n+
    38 operator bool() const
    \n+
    39 {
    \n+
    40 return true;
    \n+
    41 }
    \n
    42
    \n-\n-
    45
    \n-\n-
    48 gv_(gv)
    \n-
    49 {}
    \n-
    50
    \n-
    52 bool contains(const Element& e) const
    \n-
    53 {
    \n-
    54 return gv_.contains(e);
    \n-
    55 }
    \n+
    43 template<class I>
    \n+
    44 const AllTrueBitSetVector& operator[](const I&) const
    \n+
    45 {
    \n+
    46 return *this;
    \n+
    47 }
    \n+
    48
    \n+
    49 template<class SP>
    \n+
    50 void resize(const SP&) const
    \n+
    51 {}
    \n+
    52
    \n+
    53};
    \n+
    54
    \n+
    55
    \n
    56
    \n-
    58 size_t size() const
    \n-
    59 {
    \n-
    60 return gv_.size(codim);
    \n-
    61 }
    \n+
    57template <class B, class T, class NTRE, class HV, class LF, class HBV>
    \n+
    58class LocalInterpolateVisitor
    \n+
    59 : public TypeTree::TreeVisitor
    \n+
    60 , public TypeTree::DynamicTraversal
    \n+
    61{
    \n
    62
    \n-\n-
    65 {
    \n-
    66 return gv_.template begin<codim>();
    \n-
    67 }
    \n+
    63public:
    \n+
    64
    \n+
    65 using Basis = B;
    \n+
    66 using LocalView = typename B::LocalView;
    \n+
    67 using MultiIndex = typename LocalView::MultiIndex;
    \n
    68
    \n-\n-
    71 {
    \n-
    72 return gv_.template end<codim>();
    \n-
    73 }
    \n-
    74
    \n-
    76 const GridView& gridView() const
    \n-
    77 {
    \n-
    78 return gv_;
    \n-
    79 }
    \n+
    69 using LocalFunction = LF;
    \n+
    70
    \n+
    71 using Tree = T;
    \n+
    72
    \n+
    73 using VectorBackend = HV;
    \n+
    74 using BitVectorBackend = HBV;
    \n+
    75
    \n+
    76 using NodeToRangeEntry = NTRE;
    \n+
    77
    \n+
    78 using GridView = typename Basis::GridView;
    \n+
    79 using Element = typename GridView::template Codim<0>::Entity;
    \n
    80
    \n-
    81private:
    \n-
    82 GridView gv_;
    \n-
    83};
    \n+
    81 using LocalDomain = typename Element::Geometry::LocalCoordinate;
    \n+
    82
    \n+
    83 using GlobalDomain = typename Element::Geometry::GlobalCoordinate;
    \n
    84
    \n-
    85
    \n-
    86} // end of namespace Dune::Functions
    \n-
    87} // end of namespace Dune
    \n-
    88
    \n-
    89#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH
    \n+
    85 LocalInterpolateVisitor(const B& /*basis*/, HV& coeff, const HBV& bitVector, const LF& localF, const LocalView& localView, const NodeToRangeEntry& nodeToRangeEntry) :
    \n+
    86 vector_(coeff),
    \n+
    87 localF_(localF),
    \n+
    88 bitVector_(bitVector),
    \n+
    89 localView_(localView),
    \n+
    90 nodeToRangeEntry_(nodeToRangeEntry)
    \n+
    91 {
    \n+
    92 static_assert(Dune::Functions::Concept::isCallable<LocalFunction, LocalDomain>(), "Function passed to LocalInterpolateVisitor does not model the Callable<LocalCoordinate> concept");
    \n+
    93 }
    \n+
    94
    \n+
    95 template<typename Node, typename TreePath>
    \n+
    96 void pre(Node&, TreePath)
    \n+
    97 {}
    \n+
    98
    \n+
    99 template<typename Node, typename TreePath>
    \n+
    100 void post(Node&, TreePath)
    \n+
    101 {}
    \n+
    102
    \n+
    103 template<typename Node, typename TreePath>
    \n+
    104 void leaf(Node& node, TreePath treePath)
    \n+
    105 {
    \n+
    106 using FiniteElement = typename Node::FiniteElement;
    \n+
    107 using FiniteElementRange = typename FiniteElement::Traits::LocalBasisType::Traits::RangeType;
    \n+
    108 using FiniteElementRangeField = typename FiniteElement::Traits::LocalBasisType::Traits::RangeFieldType;
    \n+
    109
    \n+
    110 auto interpolationCoefficients = std::vector<FiniteElementRangeField>();
    \n+
    111 auto&& fe = node.finiteElement();
    \n+
    112
    \n+
    113 // backward compatibility: for scalar basis functions and possibly vector valued coefficients
    \n+
    114 // (like used in dune-fufem for power bases) loop over the components
    \n+
    115 // of the coefficients
    \n+
    116 if constexpr ( FiniteElement::Traits::LocalBasisType::Traits::dimRange == 1 )
    \n+
    117 {
    \n+
    118 // Note that we capture j by reference. Hence we can switch
    \n+
    119 // the selected component later on by modifying j. Maybe we
    \n+
    120 // should avoid this naughty statefull lambda hack in favor
    \n+
    121 // of a separate helper class.
    \n+
    122 std::size_t j=0;
    \n+
    123 auto localFj = [&](const LocalDomain& x){
    \n+
    124 const auto& y = localF_(x);
    \n+
    125 return FiniteElementRange(flatVectorView(nodeToRangeEntry_(node, treePath, y))[j]);
    \n+
    126 };
    \n+
    127
    \n+
    128 // We loop over j defined above and thus over the components of the
    \n+
    129 // range type of localF_.
    \n+
    130
    \n+
    131 auto blockSize = flatVectorView(vector_[localView_.index(0)]).size();
    \n+
    132
    \n+
    133 for(j=0; j<blockSize; ++j)
    \n+
    134 {
    \n+
    135 fe.localInterpolation().interpolate(localFj, interpolationCoefficients);
    \n+
    136 for (size_t i=0; i<fe.localBasis().size(); ++i)
    \n+
    137 {
    \n+
    138 auto multiIndex = localView_.index(node.localIndex(i));
    \n+
    139 auto bitVectorBlock = flatVectorView(bitVector_[multiIndex]);
    \n+
    140 if (bitVectorBlock[j])
    \n+
    141 {
    \n+
    142 auto vectorBlock = flatVectorView(vector_[multiIndex]);
    \n+
    143 vectorBlock[j] = interpolationCoefficients[i];
    \n+
    144 }
    \n+
    145 }
    \n+
    146 }
    \n+
    147 }
    \n+
    148 else // ( FiniteElement::Traits::LocalBasisType::Traits::dimRange != 1 )
    \n+
    149 {
    \n+
    150 // for all other finite elements: use the FiniteElementRange directly for the interpolation
    \n+
    151 auto localF = [&](const LocalDomain& x){
    \n+
    152 const auto& y = localF_(x);
    \n+
    153 return FiniteElementRange(nodeToRangeEntry_(node, treePath, y));
    \n+
    154 };
    \n+
    155
    \n+
    156 fe.localInterpolation().interpolate(localF, interpolationCoefficients);
    \n+
    157 for (size_t i=0; i<fe.localBasis().size(); ++i)
    \n+
    158 {
    \n+
    159 auto multiIndex = localView_.index(node.localIndex(i));
    \n+
    160 if ( bitVector_[multiIndex] )
    \n+
    161 {
    \n+
    162 vector_[multiIndex] = interpolationCoefficients[i];
    \n+
    163 }
    \n+
    164 }
    \n+
    165 }
    \n+
    166 }
    \n+
    167
    \n+
    168
    \n+
    169protected:
    \n+
    170
    \n+
    171 VectorBackend& vector_;
    \n+
    172 const LocalFunction& localF_;
    \n+
    173 const BitVectorBackend& bitVector_;
    \n+
    174 const LocalView& localView_;
    \n+
    175 const NodeToRangeEntry& nodeToRangeEntry_;
    \n+
    176};
    \n+
    177
    \n+
    178
    \n+
    179} // namespace Imp
    \n+
    180
    \n+
    181
    \n+
    182
    \n+
    183
    \n+
    201template <class B, class C, class F, class BV, class NTRE>
    \n+
    202void interpolate(const B& basis, C&& coeff, const F& f, const BV& bv, const NTRE& nodeToRangeEntry)
    \n+
    203{
    \n+
    204 using GridView = typename B::GridView;
    \n+
    205 using Element = typename GridView::template Codim<0>::Entity;
    \n+
    206
    \n+
    207 using Tree = typename B::LocalView::Tree;
    \n+
    208
    \n+
    209 using GlobalDomain = typename Element::Geometry::GlobalCoordinate;
    \n+
    210
    \n+
    211 static_assert(Dune::Functions::Concept::isCallable<F, GlobalDomain>(), "Function passed to interpolate does not model the Callable<GlobalCoordinate> concept");
    \n+
    212
    \n+
    213 auto&& gridView = basis.gridView();
    \n+
    214
    \n+
    215 // Small helper functions to wrap vectors using istlVectorBackend
    \n+
    216 // if they do not already satisfy the VectorBackend interface.
    \n+
    217 auto toVectorBackend = [&](auto& v) -> decltype(auto) {
    \n+
    218 if constexpr (models<Concept::VectorBackend<B>, decltype(v)>()) {
    \n+
    219 return v;
    \n+
    220 } else {
    \n+
    221 return istlVectorBackend(v);
    \n+
    222 }
    \n+
    223 };
    \n+
    224
    \n+
    225 auto toConstVectorBackend = [&](auto& v) -> decltype(auto) {
    \n+
    226 if constexpr (models<Concept::ConstVectorBackend<B>, decltype(v)>()) {
    \n+
    227 return v;
    \n+
    228 } else {
    \n+
    229 return istlVectorBackend(v);
    \n+
    230 }
    \n+
    231 };
    \n+
    232
    \n+
    233 auto&& bitVector = toConstVectorBackend(bv);
    \n+
    234 auto&& vector = toVectorBackend(coeff);
    \n+
    235 vector.resize(sizeInfo(basis));
    \n+
    236
    \n+
    237
    \n+
    238
    \n+
    239 // Make a grid function supporting local evaluation out of f
    \n+
    240 auto gf = makeGridViewFunction(f, gridView);
    \n+
    241
    \n+
    242 // Obtain a local view of f
    \n+
    243 auto localF = localFunction(gf);
    \n+
    244
    \n+
    245 auto localView = basis.localView();
    \n+
    246
    \n+
    247 for (const auto& e : elements(gridView))
    \n+
    248 {
    \n+
    249 localView.bind(e);
    \n+
    250 localF.bind(e);
    \n+
    251
    \n+
    252 Imp::LocalInterpolateVisitor<B, Tree, NTRE, decltype(vector), decltype(localF), decltype(bitVector)> localInterpolateVisitor(basis, vector, bitVector, localF, localView, nodeToRangeEntry);
    \n+
    253 TypeTree::applyToTree(localView.tree(),localInterpolateVisitor);
    \n+
    254 }
    \n+
    255}
    \n+
    256
    \n+
    273template <class B, class C, class F, class BV>
    \n+
    274void interpolate(const B& basis, C&& coeff, const F& f, const BV& bitVector)
    \n+
    275{
    \n+
    276 interpolate(basis, coeff, f, bitVector, HierarchicNodeToRangeMap());
    \n+
    277}
    \n+
    278
    \n+
    293template <class B, class C, class F>
    \n+
    294void interpolate(const B& basis, C&& coeff, const F& f)
    \n+
    295{
    \n+
    296 interpolate (basis, coeff, f, Imp::AllTrueBitSetVector(), HierarchicNodeToRangeMap());
    \n+
    297}
    \n+
    298
    \n+
    299} // namespace Functions
    \n+
    300} // namespace Dune
    \n+
    301
    \n+
    302#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH
    \n+\n+\n+\n+\n+\n+\n+
    auto istlVectorBackend(Vector &v)
    Return a vector backend wrapping non-const ISTL like containers.
    Definition: istlvectorbackend.hh:346
    \n
    Definition: polynomial.hh:10
    \n-
    An entity set for all entities of given codim in a grid view.
    Definition: gridviewentityset.hh:23
    \n-
    GridViewEntitySet(const GridView &gv)
    Construct GridViewEntitySet for a GridView.
    Definition: gridviewentityset.hh:47
    \n-
    GV GridView
    Definition: gridviewentityset.hh:26
    \n-
    GridView::template Codim< codim >::Entity Element
    Type of Elements contained in this EntitySet.
    Definition: gridviewentityset.hh:32
    \n-
    const_iterator end() const
    Create an end iterator.
    Definition: gridviewentityset.hh:70
    \n-
    const GridView & gridView() const
    Return the associated GridView.
    Definition: gridviewentityset.hh:76
    \n-
    Element value_type
    Definition: gridviewentityset.hh:38
    \n-
    const_iterator begin() const
    Create a begin iterator.
    Definition: gridviewentityset.hh:64
    \n-
    GridView::template Codim< codim >::Iterator const_iterator
    A forward iterator.
    Definition: gridviewentityset.hh:41
    \n-
    Element::Geometry::LocalCoordinate LocalCoordinate
    Type of local coordinates with respect to the Element.
    Definition: gridviewentityset.hh:35
    \n-
    size_t size() const
    Return number of Elements visited by an iterator.
    Definition: gridviewentityset.hh:58
    \n-
    Element::Geometry::GlobalCoordinate GlobalCoordinate
    Definition: gridviewentityset.hh:36
    \n-
    @ codim
    Definition: gridviewentityset.hh:28
    \n-
    bool contains(const Element &e) const
    Return true if e is contained in the EntitySet.
    Definition: gridviewentityset.hh:52
    \n-
    const_iterator iterator
    Same as const_iterator.
    Definition: gridviewentityset.hh:44
    \n+
    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
    \n+
    std::decay< F >::type makeGridViewFunction(F &&f, const GridView &gridView)
    Construct a function modeling GridViewFunction from function and grid view.
    Definition: gridviewfunction.hh:68
    \n+
    SizeInfo< Basis > sizeInfo(const Basis &basis)
    Definition: sizeinfo.hh:69
    \n+
    auto flatVectorView(T &t)
    Create flat vector view of passed mutable container.
    Definition: flatvectorview.hh:179
    \n+
    A simple node to range map using the nested tree indices.
    Definition: hierarchicnodetorangemap.hh:30
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,142 +4,316 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * gridfunctions\n-gridviewentityset.hh\n+ * functionspacebases\n+interpolate.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH\n- 4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH\n 5\n 6#include \n- 7\n+ 7#include \n 8\n- 9namespace Dune {\n- 10\n- 11namespace Functions {\n- 12\n+ 9#include \n+ 10#include \n+ 11\n+ 12#include \n 13\n- 21template\n-22class GridViewEntitySet\n- 23{\n- 24public:\n+ 14#include \n+ 15#include \n+ 16\n+ 17#include \n+ 18#include \n+ 19#include \n+ 20#include \n+ 21#include \n+ 22\n+ 23#include \n+ 24#include \n 25\n-26 typedef GV GridView;\n- 27 enum {\n- 28 codim = cd\n-29 };\n+ 26namespace Dune {\n+ 27namespace Functions {\n+ 28\n+ 29namespace Imp {\n 30\n-32 typedef typename GridView::template Codim::Entity Element;\n- 33\n-35 typedef typename Element::Geometry::LocalCoordinate LocalCoordinate;\n-36 typedef typename Element::Geometry::GlobalCoordinate GlobalCoordinate;\n+ 31struct AllTrueBitSetVector\n+ 32{\n+ 33 struct AllTrueBitSet\n+ 34 {\n+ 35 bool test(int) const { return true; }\n+ 36 } allTrue_;\n 37\n-38 typedef Element value_type;\n- 39\n-41 typedef typename GridView::template Codim::Iterator const_iterator;\n+ 38 operator bool() const\n+ 39 {\n+ 40 return true;\n+ 41 }\n 42\n-44 typedef const_iterator iterator;\n- 45\n-47 GridViewEntitySet(const GridView& gv) :\n- 48 gv_(gv)\n- 49 {}\n- 50\n-52 bool contains(const Element& e) const\n- 53 {\n- 54 return gv_.contains(e);\n- 55 }\n+ 43 template\n+ 44 const AllTrueBitSetVector& operator[](const I&) const\n+ 45 {\n+ 46 return *this;\n+ 47 }\n+ 48\n+ 49 template\n+ 50 void resize(const SP&) const\n+ 51 {}\n+ 52\n+ 53};\n+ 54\n+ 55\n 56\n-58 size_t size() const\n- 59 {\n- 60 return gv_.size(codim);\n- 61 }\n+ 57template \n+ 58class LocalInterpolateVisitor\n+ 59 : public TypeTree::TreeVisitor\n+ 60 , public TypeTree::DynamicTraversal\n+ 61{\n 62\n-64 const_iterator begin() const\n- 65 {\n- 66 return gv_.template begin();\n- 67 }\n+ 63public:\n+ 64\n+ 65 using Basis = B;\n+ 66 using LocalView = typename B::LocalView;\n+ 67 using MultiIndex = typename LocalView::MultiIndex;\n 68\n-70 const_iterator end() const\n- 71 {\n- 72 return gv_.template end();\n- 73 }\n- 74\n-76 const GridView& gridView() const\n- 77 {\n- 78 return gv_;\n- 79 }\n+ 69 using LocalFunction = LF;\n+ 70\n+ 71 using Tree = T;\n+ 72\n+ 73 using VectorBackend = HV;\n+ 74 using BitVectorBackend = HBV;\n+ 75\n+ 76 using NodeToRangeEntry = NTRE;\n+ 77\n+ 78 using GridView = typename Basis::GridView;\n+ 79 using Element = typename GridView::template Codim<0>::Entity;\n 80\n- 81private:\n- 82 GridView gv_;\n- 83};\n+ 81 using LocalDomain = typename Element::Geometry::LocalCoordinate;\n+ 82\n+ 83 using GlobalDomain = typename Element::Geometry::GlobalCoordinate;\n 84\n- 85\n- 86} // end of namespace Dune::Functions\n- 87} // end of namespace Dune\n- 88\n- 89#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH\n+ 85 LocalInterpolateVisitor(const B& /*basis*/, HV& coeff, const HBV&\n+bitVector, const LF& localF, const LocalView& localView, const\n+NodeToRangeEntry& nodeToRangeEntry) :\n+ 86 vector_(coeff),\n+ 87 localF_(localF),\n+ 88 bitVector_(bitVector),\n+ 89 localView_(localView),\n+ 90 nodeToRangeEntry_(nodeToRangeEntry)\n+ 91 {\n+ 92 static_assert(Dune::Functions::Concept::isCallable(), \"Function passed to LocalInterpolateVisitor does not model the\n+Callable concept\");\n+ 93 }\n+ 94\n+ 95 template\n+ 96 void pre(Node&, TreePath)\n+ 97 {}\n+ 98\n+ 99 template\n+ 100 void post(Node&, TreePath)\n+ 101 {}\n+ 102\n+ 103 template\n+ 104 void leaf(Node& node, TreePath treePath)\n+ 105 {\n+ 106 using FiniteElement = typename Node::FiniteElement;\n+ 107 using FiniteElementRange = typename FiniteElement::Traits::\n+LocalBasisType::Traits::RangeType;\n+ 108 using FiniteElementRangeField = typename FiniteElement::Traits::\n+LocalBasisType::Traits::RangeFieldType;\n+ 109\n+ 110 auto interpolationCoefficients = std::vector();\n+ 111 auto&& fe = node.finiteElement();\n+ 112\n+ 113 // backward compatibility: for scalar basis functions and possibly vector\n+valued coefficients\n+ 114 // (like used in dune-fufem for power bases) loop over the components\n+ 115 // of the coefficients\n+ 116 if constexpr ( FiniteElement::Traits::LocalBasisType::Traits::dimRange ==\n+1 )\n+ 117 {\n+ 118 // Note that we capture j by reference. Hence we can switch\n+ 119 // the selected component later on by modifying j. Maybe we\n+ 120 // should avoid this naughty statefull lambda hack in favor\n+ 121 // of a separate helper class.\n+ 122 std::size_t j=0;\n+ 123 auto localFj = [&](const LocalDomain& x){\n+ 124 const auto& y = localF_(x);\n+ 125 return FiniteElementRange(flatVectorView(nodeToRangeEntry_(node, treePath,\n+y))[j]);\n+ 126 };\n+ 127\n+ 128 // We loop over j defined above and thus over the components of the\n+ 129 // range type of localF_.\n+ 130\n+ 131 auto blockSize = flatVectorView(vector_[localView_.index(0)]).size();\n+ 132\n+ 133 for(j=0; j\n+202void interpolate(const B& basis, C&& coeff, const F& f, const BV& bv, const\n+NTRE& nodeToRangeEntry)\n+ 203{\n+ 204 using GridView = typename B::GridView;\n+ 205 using Element = typename GridView::template Codim<0>::Entity;\n+ 206\n+ 207 using Tree = typename B::LocalView::Tree;\n+ 208\n+ 209 using GlobalDomain = typename Element::Geometry::GlobalCoordinate;\n+ 210\n+ 211 static_assert(Dune::Functions::Concept::isCallable(),\n+\"Function passed to interpolate does not model the Callable\n+concept\");\n+ 212\n+ 213 auto&& gridView = basis.gridView();\n+ 214\n+ 215 // Small helper functions to wrap vectors using istlVectorBackend\n+ 216 // if they do not already satisfy the VectorBackend interface.\n+ 217 auto toVectorBackend = [&](auto& v) -> decltype(auto) {\n+ 218 if constexpr (models, decltype(v)>()) {\n+ 219 return v;\n+ 220 } else {\n+ 221 return istlVectorBackend(v);\n+ 222 }\n+ 223 };\n+ 224\n+ 225 auto toConstVectorBackend = [&](auto& v) -> decltype(auto) {\n+ 226 if constexpr (models, decltype(v)>()) {\n+ 227 return v;\n+ 228 } else {\n+ 229 return istlVectorBackend(v);\n+ 230 }\n+ 231 };\n+ 232\n+ 233 auto&& bitVector = toConstVectorBackend(bv);\n+ 234 auto&& vector = toVectorBackend(coeff);\n+ 235 vector.resize(sizeInfo(basis));\n+ 236\n+ 237\n+ 238\n+ 239 // Make a grid function supporting local evaluation out of f\n+ 240 auto gf = makeGridViewFunction(f, gridView);\n+ 241\n+ 242 // Obtain a local view of f\n+ 243 auto localF = localFunction(gf);\n+ 244\n+ 245 auto localView = basis.localView();\n+ 246\n+ 247 for (const auto& e : elements(gridView))\n+ 248 {\n+ 249 localView.bind(e);\n+ 250 localF.bind(e);\n+ 251\n+ 252 Imp::LocalInterpolateVisitor localInterpolateVisitor(basis, vector,\n+bitVector, localF, localView, nodeToRangeEntry);\n+ 253 TypeTree::applyToTree(localView.tree(),localInterpolateVisitor);\n+ 254 }\n+ 255}\n+ 256\n+ 273template \n+274void interpolate(const B& basis, C&& coeff, const F& f, const BV& bitVector)\n+ 275{\n+ 276 interpolate(basis, coeff, f, bitVector, HierarchicNodeToRangeMap());\n+ 277}\n+ 278\n+ 293template \n+294void interpolate(const B& basis, C&& coeff, const F& f)\n+ 295{\n+ 296 interpolate (basis, coeff, f, Imp::AllTrueBitSetVector(),\n+HierarchicNodeToRangeMap());\n+ 297}\n+ 298\n+ 299} // namespace Functions\n+ 300} // namespace Dune\n+ 301\n+ 302#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH\n+functionconcepts.hh\n+flatvectorview.hh\n+sizeinfo.hh\n+hierarchicnodetorangemap.hh\n+istlvectorbackend.hh\n+gridviewfunction.hh\n+Dune::Functions::istlVectorBackend\n+auto istlVectorBackend(Vector &v)\n+Return a vector backend wrapping non-const ISTL like containers.\n+Definition: istlvectorbackend.hh:346\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::GridViewEntitySet\n-An entity set for all entities of given codim in a grid view.\n-Definition: gridviewentityset.hh:23\n-Dune::Functions::GridViewEntitySet::GridViewEntitySet\n-GridViewEntitySet(const GridView &gv)\n-Construct GridViewEntitySet for a GridView.\n-Definition: gridviewentityset.hh:47\n-Dune::Functions::GridViewEntitySet::GridView\n-GV GridView\n-Definition: gridviewentityset.hh:26\n-Dune::Functions::GridViewEntitySet::Element\n-GridView::template Codim< codim >::Entity Element\n-Type of Elements contained in this EntitySet.\n-Definition: gridviewentityset.hh:32\n-Dune::Functions::GridViewEntitySet::end\n-const_iterator end() const\n-Create an end iterator.\n-Definition: gridviewentityset.hh:70\n-Dune::Functions::GridViewEntitySet::gridView\n-const GridView & gridView() const\n-Return the associated GridView.\n-Definition: gridviewentityset.hh:76\n-Dune::Functions::GridViewEntitySet::value_type\n-Element value_type\n-Definition: gridviewentityset.hh:38\n-Dune::Functions::GridViewEntitySet::begin\n-const_iterator begin() const\n-Create a begin iterator.\n-Definition: gridviewentityset.hh:64\n-Dune::Functions::GridViewEntitySet::const_iterator\n-GridView::template Codim< codim >::Iterator const_iterator\n-A forward iterator.\n-Definition: gridviewentityset.hh:41\n-Dune::Functions::GridViewEntitySet::LocalCoordinate\n-Element::Geometry::LocalCoordinate LocalCoordinate\n-Type of local coordinates with respect to the Element.\n-Definition: gridviewentityset.hh:35\n-Dune::Functions::GridViewEntitySet::size\n-size_t size() const\n-Return number of Elements visited by an iterator.\n-Definition: gridviewentityset.hh:58\n-Dune::Functions::GridViewEntitySet::GlobalCoordinate\n-Element::Geometry::GlobalCoordinate GlobalCoordinate\n-Definition: gridviewentityset.hh:36\n-Dune::Functions::GridViewEntitySet::codim\n-@ codim\n-Definition: gridviewentityset.hh:28\n-Dune::Functions::GridViewEntitySet::contains\n-bool contains(const Element &e) const\n-Return true if e is contained in the EntitySet.\n-Definition: gridviewentityset.hh:52\n-Dune::Functions::GridViewEntitySet::iterator\n-const_iterator iterator\n-Same as const_iterator.\n-Definition: gridviewentityset.hh:44\n+Dune::Functions::interpolate\n+void interpolate(const B &basis, C &&coeff, const F &f, const BV &bv, const\n+NTRE &nodeToRangeEntry)\n+Interpolate given function in discrete function space.\n+Definition: interpolate.hh:202\n+Dune::Functions::makeGridViewFunction\n+std::decay< F >::type makeGridViewFunction(F &&f, const GridView &gridView)\n+Construct a function modeling GridViewFunction from function and grid view.\n+Definition: gridviewfunction.hh:68\n+Dune::Functions::sizeInfo\n+SizeInfo< Basis > sizeInfo(const Basis &basis)\n+Definition: sizeinfo.hh:69\n+Dune::Functions::flatVectorView\n+auto flatVectorView(T &t)\n+Create flat vector view of passed mutable container.\n+Definition: flatvectorview.hh:179\n+Dune::Functions::HierarchicNodeToRangeMap\n+A simple node to range map using the nested tree indices.\n+Definition: hierarchicnodetorangemap.hh:30\n+concepts.hh\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00083.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00083.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: gridfunction_imp.hh File Reference\n+dune-functions: bsplinebasis.hh File Reference\n \n \n \n \n \n \n \n@@ -58,36 +58,86 @@\n \n \n \n \n \n
    \n \n-
    gridfunction_imp.hh File Reference
    \n+Classes |\n+Namespaces |\n+Typedefs |\n+Functions
    \n+
    bsplinebasis.hh File Reference
    \n \n
    \n-
    #include <dune/functions/common/type_traits.hh>
    \n-#include <dune/functions/common/interfaces.hh>
    \n-#include <dune/functions/common/differentiablefunction_imp.hh>
    \n+\n+

    The B-spline global function space basis. \n+More...

    \n+
    #include <array>
    \n+#include <numeric>
    \n+#include <dune/common/dynmatrix.hh>
    \n+#include <dune/localfunctions/common/localbasis.hh>
    \n+#include <dune/common/diagonalmatrix.hh>
    \n+#include <dune/localfunctions/common/localkey.hh>
    \n+#include <dune/localfunctions/common/localfiniteelementtraits.hh>
    \n+#include <dune/geometry/type.hh>
    \n+#include <dune/functions/functionspacebases/nodes.hh>
    \n+#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+

    \n+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 >
     
    \n \n \n \n \n \n+\n+\n+

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    namespace  Dune::Functions::BasisFactory
     
    \n+\n+\n+\n+\n+\n+

    \n+Typedefs

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

    \n+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. More...
     
    \n-
    \n+

    Detailed Description

    \n+

    The B-spline global function space basis.

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

    Go to the source code of this file.

    \n \n \n-\n-\n+\n+\n \n

    \n Classes

    class  Dune::Functions::FaceNormalGridFunction< GV >
     Grid function implementing the piecewise element face normal. More...
    class  Dune::Functions::PowerPreBasis< IMS, SPB, C >
     A pre-basis for power bases. More...
     
    \n \n \n \n \n \n+\n+\n+\n+\n+

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    namespace  Dune::Functions::BasisFactory
     
    namespace  Dune::Functions::BasisBuilder
     
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n

    \n+Functions

    template<std::size_t k, class ChildPreBasisFactory , class IndexMergingStrategy >
    auto Dune::Functions::BasisFactory::power (ChildPreBasisFactory &&childPreBasisFactory, const IndexMergingStrategy &)
     Create a pre-basis factory that can build a PowerPreBasis. More...
     
    template<std::size_t k, class ChildPreBasisFactory >
    auto Dune::Functions::BasisFactory::power (ChildPreBasisFactory &&childPreBasisFactory)
     Create a factory builder that can build a PowerPreBasis. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,31 +4,48 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * gridfunctions\n-Classes | Namespaces\n-facenormalgridfunction.hh File Reference\n-#include \n-#include \n-#include \n+ * functionspacebases\n+Classes | Namespaces | Functions\n+powerbasis.hh File Reference\n+#include \n #include \n-#include \n-#include \n-#include \n-#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::FaceNormalGridFunction<_GV_>\n-\u00a0 Grid function implementing the piecewise element face normal. More...\n+class \u00a0Dune::Functions::PowerPreBasis<_IMS,_SPB,_C_>\n+\u00a0 A pre-basis for power bases. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n+namespace \u00a0Dune::Functions::BasisFactory\n+\u00a0\n+namespace \u00a0Dune::Functions::BasisBuilder\n+\u00a0\n+ Functions\n+template\n+auto\u00a0Dune::Functions::BasisFactory::power (ChildPreBasisFactory\n+ &&childPreBasisFactory, const IndexMergingStrategy &)\n+\u00a0 Create a pre-basis factory that can build a PowerPreBasis. More...\n+\u00a0\n+template\n+auto\u00a0Dune::Functions::BasisFactory::power (ChildPreBasisFactory\n+ &&childPreBasisFactory)\n+\u00a0 Create a factory builder that can build a PowerPreBasis. More...\n+\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00086_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00086_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: facenormalgridfunction.hh Source File\n+dune-functions: powerbasis.hh Source File\n \n \n \n \n \n \n \n@@ -58,195 +58,410 @@\n \n
    \n \n \n \n
    \n-
    facenormalgridfunction.hh
    \n+
    powerbasis.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH
    \n-
    4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH
    \n
    5
    \n-
    6#include <type_traits>
    \n-
    7#include <optional>
    \n-
    8
    \n-
    9#include <dune/common/exceptions.hh>
    \n-
    10#include <dune/common/typeutilities.hh>
    \n-
    11#include <dune/common/rangeutilities.hh>
    \n-
    12#include <dune/geometry/referenceelements.hh>
    \n-
    13
    \n-\n-\n+
    6#include <dune/common/reservedvector.hh>
    \n+
    7#include <dune/common/typeutilities.hh>
    \n+
    8#include <dune/common/indices.hh>
    \n+
    9
    \n+\n+\n+\n+\n+\n+\n
    16
    \n
    17
    \n-
    18namespace Dune::Functions {
    \n-
    19
    \n-
    20namespace Impl {
    \n+
    18
    \n+
    19namespace Dune {
    \n+
    20namespace Functions {
    \n
    21
    \n-
    22// Compute closest face to point
    \n-
    23template<class ReferenceElement, class Coordinate>
    \n-
    24auto closestFaceIndex(const ReferenceElement& re, const Coordinate& x)
    \n-
    25{
    \n-
    26 auto closestFaceIndex = decltype(re.subEntity(0,1,0,1)){};
    \n-
    27 double closestFaceDistance = std::numeric_limits<double>::max();
    \n-
    28 for(auto&& faceIndex : Dune::range(re.size(1)))
    \n-
    29 {
    \n-
    30 // For a face unit outer normal consider the orthogonal projection
    \n-
    31 // Px = x + <c-x,n>*n into the face. Then the distance to the face
    \n-
    32 // is given by |x-Px| = |<c-x,n>||n| = <c-x,n>.
    \n-
    33 auto normal = re.integrationOuterNormal(faceIndex);
    \n-
    34 normal /= normal.two_norm();
    \n-
    35 auto c = re.position(faceIndex,1);
    \n-
    36 c -= x;
    \n-
    37 auto faceDistance = (c*normal);
    \n-
    38 if (faceDistance<closestFaceDistance)
    \n-
    39 {
    \n-
    40 closestFaceDistance = faceDistance;
    \n-
    41 closestFaceIndex = faceIndex;
    \n-
    42 }
    \n-
    43 }
    \n-
    44 return closestFaceIndex;
    \n-
    45}
    \n-
    46
    \n-
    47} // end namespace Impl
    \n+
    22
    \n+
    23// *****************************************************************************
    \n+
    24// This is the reusable part of the power bases. It contains
    \n+
    25//
    \n+
    26// PowerPreBasis
    \n+
    27//
    \n+
    28// The pre-basis allows to create the others and is the owner of possible shared
    \n+
    29// state. These components do _not_ depend on the global basis and local view
    \n+
    30// and can be used without a global basis.
    \n+
    31// *****************************************************************************
    \n+
    32
    \n+
    43template<class IMS, class SPB, std::size_t C>
    \n+\n+
    45{
    \n+
    46 static const std::size_t children = C;
    \n+
    47 static const bool isBlocked = std::is_same_v<IMS,BasisFactory::BlockedLexicographic> or std::is_same_v<IMS,BasisFactory::BlockedInterleaved>;
    \n
    48
    \n-
    49
    \n+
    49public:
    \n
    50
    \n-
    51
    \n-
    64template<class GV>
    \n-\n-
    66{
    \n-
    67public:
    \n-
    68 using GridView = GV;
    \n-\n-
    70 using Element = typename EntitySet::Element;
    \n+
    52 using SubPreBasis = SPB;
    \n+
    53
    \n+
    55 using GridView = typename SPB::GridView;
    \n+
    56
    \n+
    58 using size_type = std::size_t;
    \n+
    59
    \n+\n+
    62
    \n+
    63 using SubNode = typename SubPreBasis::Node;
    \n+
    64
    \n+\n+
    67
    \n+
    68 static constexpr size_type maxMultiIndexSize = SubPreBasis::maxMultiIndexSize + isBlocked;
    \n+
    69 static constexpr size_type minMultiIndexSize = SubPreBasis::minMultiIndexSize + isBlocked;
    \n+
    70 static constexpr size_type multiIndexBufferSize = SubPreBasis::multiIndexBufferSize + isBlocked;
    \n
    71
    \n-\n-\n-\n-
    75
    \n-
    76private:
    \n-
    77
    \n-
    78 using Traits = Imp::GridFunctionTraits<Range(Domain), EntitySet, DefaultDerivativeTraits, 16>;
    \n-
    79
    \n-
    80 class LocalFunction
    \n-
    81 {
    \n-
    82 using Geometry = typename Element::Geometry;
    \n-
    83 static const int dimension = GV::dimension;
    \n-
    84 public:
    \n+
    77 template<class... SFArgs,
    \n+
    78 disableCopyMove<PowerPreBasis, SFArgs...> = 0,
    \n+
    79 enableIfConstructible<SubPreBasis, SFArgs...> = 0>
    \n+
    80 PowerPreBasis(SFArgs&&... sfArgs) :
    \n+
    81 subPreBasis_(std::forward<SFArgs>(sfArgs)...)
    \n+
    82 {
    \n+
    83 static_assert(models<Concept::PreBasis<GridView>, SubPreBasis>(), "Subprebasis passed to PowerPreBasis does not model the PreBasis concept.");
    \n+
    84 }
    \n
    85
    \n-
    97 void bind(const Element& element)
    \n-
    98 {
    \n-
    99 element_ = element;
    \n-
    100 geometry_.emplace(element_.geometry());
    \n-
    101 }
    \n-
    102
    \n-
    103 void unbind()
    \n-
    104 {
    \n-
    105 geometry_.reset();
    \n-
    106 }
    \n-
    107
    \n-
    110 bool bound() const
    \n-
    111 {
    \n-
    112 return static_cast<bool>(geometry_);
    \n-
    113 }
    \n+\n+
    88 {
    \n+
    89 subPreBasis_.initializeIndices();
    \n+
    90 }
    \n+
    91
    \n+
    93 const GridView& gridView() const
    \n+
    94 {
    \n+
    95 return subPreBasis_.gridView();
    \n+
    96 }
    \n+
    97
    \n+
    99 void update(const GridView& gv)
    \n+
    100 {
    \n+
    101 subPreBasis_.update(gv);
    \n+
    102 }
    \n+
    103
    \n+\n+
    108 {
    \n+
    109 auto node = Node{};
    \n+
    110 for (std::size_t i=0; i<children; ++i)
    \n+
    111 node.setChild(i, subPreBasis_.makeNode());
    \n+
    112 return node;
    \n+
    113 }
    \n
    114
    \n-
    124 Range operator()(const LocalDomain& x) const
    \n-
    125 {
    \n-
    126 auto&& re = Dune::referenceElement(*geometry_);
    \n-
    127 // Compute reference normal of closest face to given point
    \n-
    128 auto face = Impl::closestFaceIndex(re, x);
    \n-
    129 auto localNormal = re.integrationOuterNormal(face);
    \n+\n+
    117 {
    \n+
    118 return size(Dune::ReservedVector<size_type, multiIndexBufferSize>{});
    \n+
    119 }
    \n+
    120
    \n+
    122
    \n+
    123 template<class SizePrefix>
    \n+
    124 size_type size(const SizePrefix& prefix) const
    \n+
    125 {
    \n+
    126 return size(prefix, IndexMergingStrategy{});
    \n+
    127 }
    \n+
    128
    \n+
    129private:
    \n
    130
    \n-
    131 // Transform reference normal into global unit outer normal using
    \n-
    132 // covariant Piola transformation
    \n-
    133 auto normal = Range{};
    \n-
    134 geometry_->jacobianInverseTransposed(x).mv(localNormal, normal);
    \n-
    135 normal /= normal.two_norm();
    \n-
    136 return normal;
    \n-
    137 }
    \n-
    138
    \n-
    140 const Element& localContext() const
    \n-
    141 {
    \n-
    142 return element_;
    \n-
    143 }
    \n-
    144
    \n-
    146 friend typename Traits::LocalFunctionTraits::DerivativeInterface derivative(const LocalFunction& t)
    \n-
    147 {
    \n-
    148 DUNE_THROW(NotImplemented,"not implemented");
    \n-
    149 }
    \n-
    150
    \n-
    151 private:
    \n-
    152 std::optional<Geometry> geometry_;
    \n-
    153 Element element_;
    \n-
    154 };
    \n-
    155
    \n-
    156public:
    \n-\n-
    159 entitySet_(gridView)
    \n-
    160 {}
    \n-
    161
    \n-
    163 Range operator()(const Domain& x) const
    \n-
    164 {
    \n-
    165 DUNE_THROW(NotImplemented,"not implemented");
    \n-
    166 }
    \n-
    167
    \n-\n-
    170 {
    \n-
    171 DUNE_THROW(NotImplemented,"not implemented");
    \n-
    172 }
    \n-
    173
    \n-
    175 friend LocalFunction localFunction(const FaceNormalGridFunction& t)
    \n-
    176 {
    \n-
    177 return LocalFunction{};
    \n-
    178 }
    \n-
    179
    \n-
    181 const EntitySet& entitySet() const
    \n-
    182 {
    \n-
    183 return entitySet_;
    \n-
    184 }
    \n-
    185
    \n-
    186private:
    \n-
    187 EntitySet entitySet_;
    \n-
    188};
    \n+
    131 template<class SizePrefix>
    \n+
    132 size_type size(const SizePrefix& prefix, BasisFactory::FlatInterleaved) const
    \n+
    133 {
    \n+
    134 // The root index size is the root index size of a single subnode
    \n+
    135 // multiplied by the number of subnodes because we enumerate all
    \n+
    136 // child indices in a row.
    \n+
    137 if (prefix.size() == 0)
    \n+
    138 return children*subPreBasis_.size();
    \n+
    139
    \n+
    140 // The first prefix entry refers to one of the (root index size)
    \n+
    141 // subindex trees. Hence we have to first compute the corresponding
    \n+
    142 // prefix entry for a single subnode subnode. The we can append
    \n+
    143 // the other prefix entries unmodified, because the index tree
    \n+
    144 // looks the same after the first level.
    \n+
    145 SizePrefix subPrefix;
    \n+
    146 subPrefix.push_back(prefix[0] / children);
    \n+
    147 for(std::size_t i=1; i<prefix.size(); ++i)
    \n+
    148 subPrefix.push_back(prefix[i]);
    \n+
    149 return subPreBasis_.size(subPrefix);
    \n+
    150 }
    \n+
    151
    \n+
    152 template<class SizePrefix>
    \n+
    153 size_type size(const SizePrefix& prefix, BasisFactory::FlatLexicographic) const
    \n+
    154 {
    \n+
    155 // The size at the index tree root is the size of at the index tree
    \n+
    156 // root of a single subnode multiplied by the number of subnodes
    \n+
    157 // because we enumerate all child indices in a row.
    \n+
    158 if (prefix.size() == 0)
    \n+
    159 return children*subPreBasis_.size();
    \n+
    160
    \n+
    161 // The first prefix entry refers to one of the (root index size)
    \n+
    162 // subindex trees. Hence we have to first compute the corresponding
    \n+
    163 // prefix entry for a single subnode subnode. The we can append
    \n+
    164 // the other prefix entries unmodified, because the index tree
    \n+
    165 // looks the same after the first level.
    \n+
    166 SizePrefix subPrefix;
    \n+
    167 subPrefix.push_back(prefix[0] % children);
    \n+
    168 for(std::size_t i=1; i<prefix.size(); ++i)
    \n+
    169 subPrefix.push_back(prefix[i]);
    \n+
    170 return subPreBasis_.size(subPrefix);
    \n+
    171 }
    \n+
    172
    \n+
    173 template<class SizePrefix>
    \n+
    174 size_type size(const SizePrefix& prefix, BasisFactory::BlockedLexicographic) const
    \n+
    175 {
    \n+
    176 if (prefix.size() == 0)
    \n+
    177 return children;
    \n+
    178 SizePrefix subPrefix;
    \n+
    179 for(std::size_t i=1; i<prefix.size(); ++i)
    \n+
    180 subPrefix.push_back(prefix[i]);
    \n+
    181 return subPreBasis_.size(subPrefix);
    \n+
    182 }
    \n+
    183
    \n+
    184 template<class SizePrefix>
    \n+
    185 size_type size(const SizePrefix& prefix, BasisFactory::BlockedInterleaved) const
    \n+
    186 {
    \n+
    187 if (prefix.size() == 0)
    \n+
    188 return subPreBasis_.size();
    \n
    189
    \n-
    190
    \n-
    191
    \n-
    192} // namespace Dune::Functions
    \n+
    190 SizePrefix subPrefix;
    \n+
    191 for(std::size_t i=0; i<prefix.size()-1; ++i)
    \n+
    192 subPrefix.push_back(prefix[i]);
    \n
    193
    \n-
    194#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH
    \n-\n-\n-
    Definition: polynomial.hh:11
    \n-
    Default implementation for derivative traits.
    Definition: defaultderivativetraits.hh:37
    \n-
    Grid function implementing the piecewise element face normal.
    Definition: facenormalgridfunction.hh:66
    \n-
    GridViewEntitySet< GridView, 0 > EntitySet
    Definition: facenormalgridfunction.hh:69
    \n-
    typename EntitySet::LocalCoordinate LocalDomain
    Definition: facenormalgridfunction.hh:72
    \n-
    typename EntitySet::GlobalCoordinate Domain
    Definition: facenormalgridfunction.hh:73
    \n-
    typename EntitySet::GlobalCoordinate Range
    Definition: facenormalgridfunction.hh:74
    \n-
    const EntitySet & entitySet() const
    Return the stored GridViewEntitySet.
    Definition: facenormalgridfunction.hh:181
    \n-
    friend Traits::DerivativeInterface derivative(const FaceNormalGridFunction &t)
    Not implemented.
    Definition: facenormalgridfunction.hh:169
    \n-
    GV GridView
    Definition: facenormalgridfunction.hh:68
    \n-
    friend LocalFunction localFunction(const FaceNormalGridFunction &t)
    Return a local-function associated to FaceNormalGridFunction.
    Definition: facenormalgridfunction.hh:175
    \n-
    FaceNormalGridFunction(const GridView &gridView)
    Construct the FaceNormalGridFunction.
    Definition: facenormalgridfunction.hh:158
    \n-
    typename EntitySet::Element Element
    Definition: facenormalgridfunction.hh:70
    \n-
    Range operator()(const Domain &x) const
    Not implemented.
    Definition: facenormalgridfunction.hh:163
    \n-
    Definition: gridfunction.hh:32
    \n-\n-
    GridView::template Codim< codim >::Entity Element
    Type of Elements contained in this EntitySet.
    Definition: gridviewentityset.hh:32
    \n-
    Element::Geometry::LocalCoordinate LocalCoordinate
    Type of local coordinates with respect to the Element.
    Definition: gridviewentityset.hh:35
    \n-
    Element::Geometry::GlobalCoordinate GlobalCoordinate
    Definition: gridviewentityset.hh:36
    \n+
    194 size_type r = subPreBasis_.size(subPrefix);
    \n+
    195 if (r==0)
    \n+
    196 return 0;
    \n+
    197 subPrefix.push_back(prefix.back());
    \n+
    198 r = subPreBasis_.size(subPrefix);
    \n+
    199 if (r==0)
    \n+
    200 return children;
    \n+
    201 return r;
    \n+
    202 }
    \n+
    203
    \n+
    204public:
    \n+
    205
    \n+\n+
    208 {
    \n+
    209 return subPreBasis_.dimension() * children;
    \n+
    210 }
    \n+
    211
    \n+\n+
    214 {
    \n+
    215 return subPreBasis_.maxNodeSize() * children;
    \n+
    216 }
    \n+
    217
    \n+\n+
    220 {
    \n+
    221 return subPreBasis_;
    \n+
    222 }
    \n+
    223
    \n+\n+
    226 {
    \n+
    227 return subPreBasis_;
    \n+
    228 }
    \n+
    229
    \n+
    231 template<typename It>
    \n+
    232 It indices(const Node& node, It it) const
    \n+
    233 {
    \n+
    234 return indices(node, it, IndexMergingStrategy{});
    \n+
    235 }
    \n+
    236
    \n+
    237private:
    \n+
    238
    \n+
    239 template<typename It>
    \n+
    240 It indices(const Node& node, It multiIndices, BasisFactory::FlatInterleaved) const
    \n+
    241 {
    \n+
    242 using namespace Dune::Indices;
    \n+
    243 size_type subTreeSize = node.child(_0).size();
    \n+
    244 // Fill indices for first child at the beginning.
    \n+
    245 auto next = subPreBasis().indices(node.child(_0), multiIndices);
    \n+
    246 // Multiply first component of all indices for first child by
    \n+
    247 // number of children to stretch the index range for interleaving.
    \n+
    248 for (std::size_t i = 0; i<subTreeSize; ++i)
    \n+
    249 multiIndices[i][0] *= children;
    \n+
    250 for (std::size_t child = 1; child<children; ++child)
    \n+
    251 {
    \n+
    252 for (std::size_t i = 0; i<subTreeSize; ++i)
    \n+
    253 {
    \n+
    254 // Copy indices from first child for all other children
    \n+
    255 // and shift them by child index to interleave indices.
    \n+
    256 // multiIndices[child*subTreeSize+i] = multiIndices[i];
    \n+
    257 // multiIndices[child*subTreeSize+i][0] = multiIndices[i][0]+child;
    \n+
    258 (*next) = multiIndices[i];
    \n+
    259 (*next)[0] = multiIndices[i][0]+child;
    \n+
    260 ++next;
    \n+
    261 }
    \n+
    262 }
    \n+
    263 return next;
    \n+
    264 }
    \n+
    265
    \n+
    266 template<typename It>
    \n+
    267 It indices(const Node& node, It multiIndices, BasisFactory::FlatLexicographic) const
    \n+
    268 {
    \n+
    269 using namespace Dune::Indices;
    \n+
    270 size_type subTreeSize = node.child(_0).size();
    \n+
    271 size_type firstIndexEntrySize = subPreBasis().size();
    \n+
    272 // Fill indices for first child at the beginning.
    \n+
    273 auto next = subPreBasis().indices(node.child(_0), multiIndices);
    \n+
    274 for (std::size_t child = 1; child<children; ++child)
    \n+
    275 {
    \n+
    276 for (std::size_t i = 0; i<subTreeSize; ++i)
    \n+
    277 {
    \n+
    278 // Copy indices from first child for all other children
    \n+
    279 // and shift them by suitable offset to get lexicographic indices.
    \n+
    280 // multiIndices[child*subTreeSize+i] = multiIndices[i];
    \n+
    281 // multiIndices[child*subTreeSize+i][0] += child*firstIndexEntrySize;
    \n+
    282 (*next) = multiIndices[i];
    \n+
    283 (*next)[0] += child*firstIndexEntrySize;
    \n+
    284 ++next;
    \n+
    285 }
    \n+
    286 }
    \n+
    287 return next;
    \n+
    288 }
    \n+
    289
    \n+
    290 template<class MultiIndex>
    \n+
    291 static void multiIndexPushFront(MultiIndex& M, size_type M0)
    \n+
    292 {
    \n+
    293 M.resize(M.size()+1);
    \n+
    294 for(std::size_t i=M.size()-1; i>0; --i)
    \n+
    295 M[i] = M[i-1];
    \n+
    296 M[0] = M0;
    \n+
    297 }
    \n+
    298
    \n+
    299 template<typename It>
    \n+
    300 It indices(const Node& node, It multiIndices, BasisFactory::BlockedLexicographic) const
    \n+
    301 {
    \n+
    302 using namespace Dune::Indices;
    \n+
    303 size_type subTreeSize = node.child(_0).size();
    \n+
    304 // Fill indices for first child at the beginning.
    \n+
    305 auto next = subPreBasis().indices(node.child(_0), multiIndices);
    \n+
    306 // Insert 0 before first component of all indices for first child.
    \n+
    307 for (std::size_t i = 0; i<subTreeSize; ++i)
    \n+
    308 multiIndexPushFront(multiIndices[i], 0);
    \n+
    309 for (std::size_t child = 1; child<children; ++child)
    \n+
    310 {
    \n+
    311 for (std::size_t i = 0; i<subTreeSize; ++i)
    \n+
    312 {
    \n+
    313 // Copy indices from first child for all other children and overwrite
    \n+
    314 // zero in first component as inserted above by child index.
    \n+
    315 // multiIndices[child*subTreeSize+i] = multiIndices[i];
    \n+
    316 // multiIndices[child*subTreeSize+i][0] = child;
    \n+
    317 (*next) = multiIndices[i];
    \n+
    318 (*next)[0] = child;
    \n+
    319 ++next;
    \n+
    320 }
    \n+
    321 }
    \n+
    322 return next;
    \n+
    323 }
    \n+
    324
    \n+
    325 template<typename It>
    \n+
    326 It indices(const Node& node, It multiIndices, BasisFactory::BlockedInterleaved) const
    \n+
    327 {
    \n+
    328 using namespace Dune::Indices;
    \n+
    329 size_type subTreeSize = node.child(_0).size();
    \n+
    330 // Fill indices for first child at the beginning.
    \n+
    331 auto next = subPreBasis().indices(node.child(_0), multiIndices);
    \n+
    332 // Append 0 after last component of all indices for first child.
    \n+
    333 for (std::size_t i = 0; i<subTreeSize; ++i)
    \n+
    334 multiIndices[i].push_back(0);
    \n+
    335 for (std::size_t child = 1; child<children; ++child)
    \n+
    336 {
    \n+
    337 for (std::size_t i = 0; i<subTreeSize; ++i)
    \n+
    338 {
    \n+
    339 // Copy indices from first child for all other children and overwrite
    \n+
    340 // zero in last component as appended above by child index.
    \n+
    341 (*next) = multiIndices[i];
    \n+
    342 (*next).back() = child;
    \n+
    343 ++next;
    \n+
    344 }
    \n+
    345 }
    \n+
    346 return next;
    \n+
    347 }
    \n+
    348
    \n+
    349 SubPreBasis subPreBasis_;
    \n+
    350};
    \n+
    351
    \n+
    352
    \n+
    353
    \n+
    354namespace BasisFactory {
    \n+
    355
    \n+
    368template<std::size_t k, class ChildPreBasisFactory, class IndexMergingStrategy>
    \n+
    369auto power(ChildPreBasisFactory&& childPreBasisFactory, const IndexMergingStrategy&)
    \n+
    370{
    \n+
    371 return [childPreBasisFactory](const auto& gridView) {
    \n+
    372 auto childPreBasis = childPreBasisFactory(gridView);
    \n+\n+
    374 };
    \n+
    375}
    \n+
    376
    \n+
    387template<std::size_t k, class ChildPreBasisFactory>
    \n+
    388auto power(ChildPreBasisFactory&& childPreBasisFactory)
    \n+
    389{
    \n+
    390 return [childPreBasisFactory](const auto& gridView) {
    \n+
    391 auto childPreBasis = childPreBasisFactory(gridView);
    \n+\n+
    393 };
    \n+
    394}
    \n+
    395
    \n+
    396} // end namespace BasisFactory
    \n+
    397
    \n+
    398// Backward compatibility
    \n+
    399namespace BasisBuilder {
    \n+
    400
    \n+
    401 using namespace BasisFactory;
    \n+
    402
    \n+
    403}
    \n+
    404
    \n+
    405
    \n+
    406} // end namespace Functions
    \n+
    407} // end namespace Dune
    \n+
    408
    \n+
    409
    \n+
    410#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH
    \n+\n+\n+\n+\n+\n+
    auto power(ChildPreBasisFactory &&childPreBasisFactory)
    Create a factory builder that can build a PowerPreBasis.
    Definition: powerbasis.hh:388
    \n+
    typename std::enable_if< std::is_constructible< T, Args... >::value, int >::type enableIfConstructible
    Helper to constrain forwarding constructors.
    Definition: type_traits.hh:26
    \n+
    Definition: polynomial.hh:10
    \n+
    Base class for index merging strategies to simplify detection.
    Definition: basistags.hh:44
    \n+
    Interleaved merging of direct children without blocking.
    Definition: basistags.hh:114
    \n+
    Definition: nodes.hh:193
    \n+
    A pre-basis for power bases.
    Definition: powerbasis.hh:45
    \n+
    size_type dimension() const
    Get the total dimension of the space spanned by this basis.
    Definition: powerbasis.hh:207
    \n+
    std::size_t size_type
    Type used for indices and size information.
    Definition: powerbasis.hh:58
    \n+
    IMS IndexMergingStrategy
    Strategy used to merge the global indices of the child factories.
    Definition: powerbasis.hh:61
    \n+
    PowerBasisNode< SubNode, children > Node
    Template mapping root tree path to type of created tree node.
    Definition: powerbasis.hh:66
    \n+
    typename SPB::GridView GridView
    The grid view that the FE basis is defined on.
    Definition: powerbasis.hh:55
    \n+
    static constexpr size_type multiIndexBufferSize
    Definition: powerbasis.hh:70
    \n+
    SPB SubPreBasis
    The child pre-basis.
    Definition: powerbasis.hh:52
    \n+
    typename SubPreBasis::Node SubNode
    Definition: powerbasis.hh:63
    \n+
    void initializeIndices()
    Initialize the global indices.
    Definition: powerbasis.hh:87
    \n+
    void update(const GridView &gv)
    Update the stored grid view, to be called if the grid has changed.
    Definition: powerbasis.hh:99
    \n+
    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
    \n+
    PowerPreBasis(SFArgs &&... sfArgs)
    Constructor for given child pre-basis objects.
    Definition: powerbasis.hh:80
    \n+
    size_type size() const
    Same as size(prefix) with empty prefix.
    Definition: powerbasis.hh:116
    \n+
    SubPreBasis & subPreBasis()
    Mutable access to the stored prebasis of the factor in the power space.
    Definition: powerbasis.hh:225
    \n+
    Node makeNode() const
    Create tree node.
    Definition: powerbasis.hh:107
    \n+
    static constexpr size_type maxMultiIndexSize
    Definition: powerbasis.hh:68
    \n+
    static constexpr size_type minMultiIndexSize
    Definition: powerbasis.hh:69
    \n+
    size_type maxNodeSize() const
    Get the maximal number of DOFs associated to node for any element.
    Definition: powerbasis.hh:213
    \n+
    const GridView & gridView() const
    Obtain the grid view that the basis is defined on.
    Definition: powerbasis.hh:93
    \n+
    size_type size(const SizePrefix &prefix) const
    Return number of possible values for next position in multi index.
    Definition: powerbasis.hh:124
    \n+
    const SubPreBasis & subPreBasis() const
    Const access to the stored prebasis of the factor in the power space.
    Definition: powerbasis.hh:219
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,231 +4,498 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * gridfunctions\n-facenormalgridfunction.hh\n+ * functionspacebases\n+powerbasis.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH\n- 4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH\n 5\n- 6#include \n- 7#include \n- 8\n- 9#include \n- 10#include \n- 11#include \n- 12#include \n- 13\n- 14#include \n- 15#include \n+ 6#include \n+ 7#include \n+ 8#include \n+ 9\n+ 10#include \n+ 11#include \n+ 12#include \n+ 13#include \n+ 14#include \n+ 15#include \n 16\n 17\n- 18namespace Dune::Functions {\n- 19\n- 20namespace Impl {\n+ 18\n+ 19namespace Dune {\n+ 20namespace Functions {\n 21\n- 22// Compute closest face to point\n- 23template\n- 24auto closestFaceIndex(const ReferenceElement& re, const Coordinate& x)\n- 25{\n- 26 auto closestFaceIndex = decltype(re.subEntity(0,1,0,1)){};\n- 27 double closestFaceDistance = std::numeric_limits::max();\n- 28 for(auto&& faceIndex : Dune::range(re.size(1)))\n- 29 {\n- 30 // For a face unit outer normal consider the orthogonal projection\n- 31 // Px = x + *n into the face. Then the distance to the face\n- 32 // is given by |x-Px| = |||n| = .\n- 33 auto normal = re.integrationOuterNormal(faceIndex);\n- 34 normal /= normal.two_norm();\n- 35 auto c = re.position(faceIndex,1);\n- 36 c -= x;\n- 37 auto faceDistance = (c*normal);\n- 38 if (faceDistance\n+44class PowerPreBasis\n+ 45{\n+ 46 static const std::size_t children = C;\n+ 47 static const bool isBlocked = std::is_same_v or std::is_same_v;\n 48\n- 49\n+ 49public:\n 50\n- 51\n- 64template\n-65class FaceNormalGridFunction\n- 66{\n- 67public:\n-68 using GridView = GV;\n-69 using EntitySet = GridViewEntitySet;\n-70 using Element = typename EntitySet::Element;\n+52 using SubPreBasis = SPB;\n+ 53\n+55 using GridView = typename SPB::GridView;\n+ 56\n+58 using size_type = std::size_t;\n+ 59\n+61 using IndexMergingStrategy = IMS;\n+ 62\n+63 using SubNode = typename SubPreBasis::Node;\n+ 64\n+66 using Node = PowerBasisNode;\n+ 67\n+68 static constexpr size_type maxMultiIndexSize = SubPreBasis::\n+maxMultiIndexSize + isBlocked;\n+69 static constexpr size_type minMultiIndexSize = SubPreBasis::\n+minMultiIndexSize + isBlocked;\n+70 static constexpr size_type multiIndexBufferSize = SubPreBasis::\n+multiIndexBufferSize + isBlocked;\n 71\n-72 using LocalDomain = typename EntitySet::LocalCoordinate;\n-73 using Domain = typename EntitySet::GlobalCoordinate;\n-74 using Range = typename EntitySet::GlobalCoordinate;\n- 75\n- 76private:\n- 77\n- 78 using Traits = Imp::GridFunctionTraits;\n- 79\n- 80 class LocalFunction\n- 81 {\n- 82 using Geometry = typename Element::Geometry;\n- 83 static const int dimension = GV::dimension;\n- 84 public:\n+ 77 template = 0,\n+ 79 enableIfConstructible = 0>\n+80 PowerPreBasis(SFArgs&&... sfArgs) :\n+ 81 subPreBasis_(std::forward(sfArgs)...)\n+ 82 {\n+ 83 static_assert(models, SubPreBasis>(),\n+\"Subprebasis passed to PowerPreBasis does not model the PreBasis concept.\");\n+ 84 }\n 85\n- 97 void bind(const Element& element)\n- 98 {\n- 99 element_ = element;\n- 100 geometry_.emplace(element_.geometry());\n- 101 }\n- 102\n- 103 void unbind()\n- 104 {\n- 105 geometry_.reset();\n- 106 }\n- 107\n- 110 bool bound() const\n- 111 {\n- 112 return static_cast(geometry_);\n+87 void initializeIndices()\n+ 88 {\n+ 89 subPreBasis_.initializeIndices();\n+ 90 }\n+ 91\n+93 const GridView& gridView() const\n+ 94 {\n+ 95 return subPreBasis_.gridView();\n+ 96 }\n+ 97\n+99 void update(const GridView& gv)\n+ 100 {\n+ 101 subPreBasis_.update(gv);\n+ 102 }\n+ 103\n+107 Node makeNode() const\n+ 108 {\n+ 109 auto node = Node{};\n+ 110 for (std::size_t i=0; i{});\n+ 119 }\n+ 120\n+ 122\n+ 123 template\n+124 size_type size(const SizePrefix& prefix) const\n 125 {\n- 126 auto&& re = Dune::referenceElement(*geometry_);\n- 127 // Compute reference normal of closest face to given point\n- 128 auto face = Impl::closestFaceIndex(re, x);\n- 129 auto localNormal = re.integrationOuterNormal(face);\n+ 126 return size(prefix, IndexMergingStrategy{});\n+ 127 }\n+ 128\n+ 129private:\n 130\n- 131 // Transform reference normal into global unit outer normal using\n- 132 // covariant Piola transformation\n- 133 auto normal = Range{};\n- 134 geometry_->jacobianInverseTransposed(x).mv(localNormal, normal);\n- 135 normal /= normal.two_norm();\n- 136 return normal;\n- 137 }\n- 138\n- 140 const Element& localContext() const\n- 141 {\n- 142 return element_;\n- 143 }\n- 144\n- 146 friend typename Traits::LocalFunctionTraits::DerivativeInterface\n-derivative(const LocalFunction& t)\n- 147 {\n- 148 DUNE_THROW(NotImplemented,\"not implemented\");\n- 149 }\n- 150\n- 151 private:\n- 152 std::optional geometry_;\n- 153 Element element_;\n- 154 };\n- 155\n- 156public:\n-158 FaceNormalGridFunction(const GridView& gridView) :\n- 159 entitySet_(gridView)\n- 160 {}\n- 161\n-163 Range operator()(const Domain& x) const\n- 164 {\n- 165 DUNE_THROW(NotImplemented,\"not implemented\");\n- 166 }\n- 167\n-169 friend typename Traits::DerivativeInterface derivative(const\n-FaceNormalGridFunction& t)\n- 170 {\n- 171 DUNE_THROW(NotImplemented,\"not implemented\");\n- 172 }\n- 173\n-175 friend LocalFunction localFunction(const FaceNormalGridFunction& t)\n- 176 {\n- 177 return LocalFunction{};\n- 178 }\n- 179\n-181 const EntitySet& entitySet() const\n- 182 {\n- 183 return entitySet_;\n- 184 }\n- 185\n- 186private:\n- 187 EntitySet entitySet_;\n- 188};\n+ 131 template\n+ 132 size_type size(const SizePrefix& prefix, BasisFactory::FlatInterleaved)\n+const\n+ 133 {\n+ 134 // The root index size is the root index size of a single subnode\n+ 135 // multiplied by the number of subnodes because we enumerate all\n+ 136 // child indices in a row.\n+ 137 if (prefix.size() == 0)\n+ 138 return children*subPreBasis_.size();\n+ 139\n+ 140 // The first prefix entry refers to one of the (root index size)\n+ 141 // subindex trees. Hence we have to first compute the corresponding\n+ 142 // prefix entry for a single subnode subnode. The we can append\n+ 143 // the other prefix entries unmodified, because the index tree\n+ 144 // looks the same after the first level.\n+ 145 SizePrefix subPrefix;\n+ 146 subPrefix.push_back(prefix[0] / children);\n+ 147 for(std::size_t i=1; i\n+ 153 size_type size(const SizePrefix& prefix, BasisFactory::FlatLexicographic)\n+const\n+ 154 {\n+ 155 // The size at the index tree root is the size of at the index tree\n+ 156 // root of a single subnode multiplied by the number of subnodes\n+ 157 // because we enumerate all child indices in a row.\n+ 158 if (prefix.size() == 0)\n+ 159 return children*subPreBasis_.size();\n+ 160\n+ 161 // The first prefix entry refers to one of the (root index size)\n+ 162 // subindex trees. Hence we have to first compute the corresponding\n+ 163 // prefix entry for a single subnode subnode. The we can append\n+ 164 // the other prefix entries unmodified, because the index tree\n+ 165 // looks the same after the first level.\n+ 166 SizePrefix subPrefix;\n+ 167 subPrefix.push_back(prefix[0] % children);\n+ 168 for(std::size_t i=1; i\n+ 174 size_type size(const SizePrefix& prefix, BasisFactory::\n+BlockedLexicographic) const\n+ 175 {\n+ 176 if (prefix.size() == 0)\n+ 177 return children;\n+ 178 SizePrefix subPrefix;\n+ 179 for(std::size_t i=1; i\n+ 185 size_type size(const SizePrefix& prefix, BasisFactory::BlockedInterleaved)\n+const\n+ 186 {\n+ 187 if (prefix.size() == 0)\n+ 188 return subPreBasis_.size();\n 189\n- 190\n- 191\n- 192} // namespace Dune::Functions\n+ 190 SizePrefix subPrefix;\n+ 191 for(std::size_t i=0; i EntitySet\n-Definition: facenormalgridfunction.hh:69\n-Dune::Functions::FaceNormalGridFunction::LocalDomain\n-typename EntitySet::LocalCoordinate LocalDomain\n-Definition: facenormalgridfunction.hh:72\n-Dune::Functions::FaceNormalGridFunction::Domain\n-typename EntitySet::GlobalCoordinate Domain\n-Definition: facenormalgridfunction.hh:73\n-Dune::Functions::FaceNormalGridFunction::Range\n-typename EntitySet::GlobalCoordinate Range\n-Definition: facenormalgridfunction.hh:74\n-Dune::Functions::FaceNormalGridFunction::entitySet\n-const EntitySet & entitySet() const\n-Return the stored GridViewEntitySet.\n-Definition: facenormalgridfunction.hh:181\n-Dune::Functions::FaceNormalGridFunction::derivative\n-friend Traits::DerivativeInterface derivative(const FaceNormalGridFunction &t)\n-Not implemented.\n-Definition: facenormalgridfunction.hh:169\n-Dune::Functions::FaceNormalGridFunction::GridView\n-GV GridView\n-Definition: facenormalgridfunction.hh:68\n-Dune::Functions::FaceNormalGridFunction::localFunction\n-friend LocalFunction localFunction(const FaceNormalGridFunction &t)\n-Return a local-function associated to FaceNormalGridFunction.\n-Definition: facenormalgridfunction.hh:175\n-Dune::Functions::FaceNormalGridFunction::FaceNormalGridFunction\n-FaceNormalGridFunction(const GridView &gridView)\n-Construct the FaceNormalGridFunction.\n-Definition: facenormalgridfunction.hh:158\n-Dune::Functions::FaceNormalGridFunction::Element\n-typename EntitySet::Element Element\n-Definition: facenormalgridfunction.hh:70\n-Dune::Functions::FaceNormalGridFunction::operator()\n-Range operator()(const Domain &x) const\n-Not implemented.\n-Definition: facenormalgridfunction.hh:163\n-Dune::Functions::GridFunction\n-Definition: gridfunction.hh:32\n-Dune::Functions::GridViewEntitySet<_GridView,_0_>\n-Dune::Functions::GridViewEntitySet<_GridView,_0_>::Element\n-GridView::template Codim< codim >::Entity Element\n-Type of Elements contained in this EntitySet.\n-Definition: gridviewentityset.hh:32\n-Dune::Functions::GridViewEntitySet<_GridView,_0_>::LocalCoordinate\n-Element::Geometry::LocalCoordinate LocalCoordinate\n-Type of local coordinates with respect to the Element.\n-Definition: gridviewentityset.hh:35\n-Dune::Functions::GridViewEntitySet<_GridView,_0_>::GlobalCoordinate\n-Element::Geometry::GlobalCoordinate GlobalCoordinate\n-Definition: gridviewentityset.hh:36\n+ 194 size_type r = subPreBasis_.size(subPrefix);\n+ 195 if (r==0)\n+ 196 return 0;\n+ 197 subPrefix.push_back(prefix.back());\n+ 198 r = subPreBasis_.size(subPrefix);\n+ 199 if (r==0)\n+ 200 return children;\n+ 201 return r;\n+ 202 }\n+ 203\n+ 204public:\n+ 205\n+207 size_type dimension() const\n+ 208 {\n+ 209 return subPreBasis_.dimension() * children;\n+ 210 }\n+ 211\n+213 size_type maxNodeSize() const\n+ 214 {\n+ 215 return subPreBasis_.maxNodeSize() * children;\n+ 216 }\n+ 217\n+219 const SubPreBasis& subPreBasis() const\n+ 220 {\n+ 221 return subPreBasis_;\n+ 222 }\n+ 223\n+225 SubPreBasis& subPreBasis()\n+ 226 {\n+ 227 return subPreBasis_;\n+ 228 }\n+ 229\n+ 231 template\n+232 It indices(const Node& node, It it) const\n+ 233 {\n+ 234 return indices(node, it, IndexMergingStrategy{});\n+ 235 }\n+ 236\n+ 237private:\n+ 238\n+ 239 template\n+ 240 It indices(const Node& node, It multiIndices, BasisFactory::\n+FlatInterleaved) const\n+ 241 {\n+ 242 using namespace Dune::Indices;\n+ 243 size_type subTreeSize = node.child(_0).size();\n+ 244 // Fill indices for first child at the beginning.\n+ 245 auto next = subPreBasis().indices(node.child(_0), multiIndices);\n+ 246 // Multiply first component of all indices for first child by\n+ 247 // number of children to stretch the index range for interleaving.\n+ 248 for (std::size_t i = 0; i\n+ 267 It indices(const Node& node, It multiIndices, BasisFactory::\n+FlatLexicographic) const\n+ 268 {\n+ 269 using namespace Dune::Indices;\n+ 270 size_type subTreeSize = node.child(_0).size();\n+ 271 size_type firstIndexEntrySize = subPreBasis().size();\n+ 272 // Fill indices for first child at the beginning.\n+ 273 auto next = subPreBasis().indices(node.child(_0), multiIndices);\n+ 274 for (std::size_t child = 1; child\n+ 291 static void multiIndexPushFront(MultiIndex& M, size_type M0)\n+ 292 {\n+ 293 M.resize(M.size()+1);\n+ 294 for(std::size_t i=M.size()-1; i>0; --i)\n+ 295 M[i] = M[i-1];\n+ 296 M[0] = M0;\n+ 297 }\n+ 298\n+ 299 template\n+ 300 It indices(const Node& node, It multiIndices, BasisFactory::\n+BlockedLexicographic) const\n+ 301 {\n+ 302 using namespace Dune::Indices;\n+ 303 size_type subTreeSize = node.child(_0).size();\n+ 304 // Fill indices for first child at the beginning.\n+ 305 auto next = subPreBasis().indices(node.child(_0), multiIndices);\n+ 306 // Insert 0 before first component of all indices for first child.\n+ 307 for (std::size_t i = 0; i\n+ 326 It indices(const Node& node, It multiIndices, BasisFactory::\n+BlockedInterleaved) const\n+ 327 {\n+ 328 using namespace Dune::Indices;\n+ 329 size_type subTreeSize = node.child(_0).size();\n+ 330 // Fill indices for first child at the beginning.\n+ 331 auto next = subPreBasis().indices(node.child(_0), multiIndices);\n+ 332 // Append 0 after last component of all indices for first child.\n+ 333 for (std::size_t i = 0; i\n+369auto power(ChildPreBasisFactory&& childPreBasisFactory, const\n+IndexMergingStrategy&)\n+ 370{\n+ 371 return [childPreBasisFactory](const auto& gridView) {\n+ 372 auto childPreBasis = childPreBasisFactory(gridView);\n+ 373 return PowerPreBasis\n+(std::move(childPreBasis));\n+ 374 };\n+ 375}\n+ 376\n+ 387template\n+388auto power(ChildPreBasisFactory&& childPreBasisFactory)\n+ 389{\n+ 390 return [childPreBasisFactory](const auto& gridView) {\n+ 391 auto childPreBasis = childPreBasisFactory(gridView);\n+ 392 return PowerPreBasis(std::\n+move(childPreBasis));\n+ 393 };\n+ 394}\n+ 395\n+ 396} // end namespace BasisFactory\n+ 397\n+ 398// Backward compatibility\n+ 399namespace BasisBuilder {\n+ 400\n+ 401 using namespace BasisFactory;\n+ 402\n+ 403}\n+ 404\n+ 405\n+ 406} // end namespace Functions\n+ 407} // end namespace Dune\n+ 408\n+ 409\n+ 410#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH\n+type_traits.hh\n+utility.hh\n+basistags.hh\n+nodes.hh\n+defaultglobalbasis.hh\n+Dune::Functions::BasisFactory::power\n+auto power(ChildPreBasisFactory &&childPreBasisFactory)\n+Create a factory builder that can build a PowerPreBasis.\n+Definition: powerbasis.hh:388\n+Dune::Functions::enableIfConstructible\n+typename std::enable_if< std::is_constructible< T, Args... >::value, int >::\n+type enableIfConstructible\n+Helper to constrain forwarding constructors.\n+Definition: type_traits.hh:26\n+Dune\n+Definition: polynomial.hh:10\n+Dune::Functions::BasisFactory::IndexMergingStrategy\n+Base class for index merging strategies to simplify detection.\n+Definition: basistags.hh:44\n+Dune::Functions::BasisFactory::FlatInterleaved\n+Interleaved merging of direct children without blocking.\n+Definition: basistags.hh:114\n+Dune::Functions::PowerBasisNode\n+Definition: nodes.hh:193\n+Dune::Functions::PowerPreBasis\n+A pre-basis for power bases.\n+Definition: powerbasis.hh:45\n+Dune::Functions::PowerPreBasis::dimension\n+size_type dimension() const\n+Get the total dimension of the space spanned by this basis.\n+Definition: powerbasis.hh:207\n+Dune::Functions::PowerPreBasis::size_type\n+std::size_t size_type\n+Type used for indices and size information.\n+Definition: powerbasis.hh:58\n+Dune::Functions::PowerPreBasis::IndexMergingStrategy\n+IMS IndexMergingStrategy\n+Strategy used to merge the global indices of the child factories.\n+Definition: powerbasis.hh:61\n+Dune::Functions::PowerPreBasis::Node\n+PowerBasisNode< SubNode, children > Node\n+Template mapping root tree path to type of created tree node.\n+Definition: powerbasis.hh:66\n+Dune::Functions::PowerPreBasis::GridView\n+typename SPB::GridView GridView\n+The grid view that the FE basis is defined on.\n+Definition: powerbasis.hh:55\n+Dune::Functions::PowerPreBasis::multiIndexBufferSize\n+static constexpr size_type multiIndexBufferSize\n+Definition: powerbasis.hh:70\n+Dune::Functions::PowerPreBasis::SubPreBasis\n+SPB SubPreBasis\n+The child pre-basis.\n+Definition: powerbasis.hh:52\n+Dune::Functions::PowerPreBasis::SubNode\n+typename SubPreBasis::Node SubNode\n+Definition: powerbasis.hh:63\n+Dune::Functions::PowerPreBasis::initializeIndices\n+void initializeIndices()\n+Initialize the global indices.\n+Definition: powerbasis.hh:87\n+Dune::Functions::PowerPreBasis::update\n+void update(const GridView &gv)\n+Update the stored grid view, to be called if the grid has changed.\n+Definition: powerbasis.hh:99\n+Dune::Functions::PowerPreBasis::indices\n+It indices(const Node &node, It it) const\n+Maps from subtree index set [0..size-1] to a globally unique multi index in\n+global basis.\n+Definition: powerbasis.hh:232\n+Dune::Functions::PowerPreBasis::PowerPreBasis\n+PowerPreBasis(SFArgs &&... sfArgs)\n+Constructor for given child pre-basis objects.\n+Definition: powerbasis.hh:80\n+Dune::Functions::PowerPreBasis::size\n+size_type size() const\n+Same as size(prefix) with empty prefix.\n+Definition: powerbasis.hh:116\n+Dune::Functions::PowerPreBasis::subPreBasis\n+SubPreBasis & subPreBasis()\n+Mutable access to the stored prebasis of the factor in the power space.\n+Definition: powerbasis.hh:225\n+Dune::Functions::PowerPreBasis::makeNode\n+Node makeNode() const\n+Create tree node.\n+Definition: powerbasis.hh:107\n+Dune::Functions::PowerPreBasis::maxMultiIndexSize\n+static constexpr size_type maxMultiIndexSize\n+Definition: powerbasis.hh:68\n+Dune::Functions::PowerPreBasis::minMultiIndexSize\n+static constexpr size_type minMultiIndexSize\n+Definition: powerbasis.hh:69\n+Dune::Functions::PowerPreBasis::maxNodeSize\n+size_type maxNodeSize() const\n+Get the maximal number of DOFs associated to node for any element.\n+Definition: powerbasis.hh:213\n+Dune::Functions::PowerPreBasis::gridView\n+const GridView & gridView() const\n+Obtain the grid view that the basis is defined on.\n+Definition: powerbasis.hh:93\n+Dune::Functions::PowerPreBasis::size\n+size_type size(const SizePrefix &prefix) const\n+Return number of possible values for next position in multi index.\n+Definition: powerbasis.hh:124\n+Dune::Functions::PowerPreBasis::subPreBasis\n+const SubPreBasis & subPreBasis() const\n+Const access to the stored prebasis of the factor in the power space.\n+Definition: powerbasis.hh:219\n+concepts.hh\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00089.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00089.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: composedgridfunction.hh File Reference\n+dune-functions: subentitydofs.hh File Reference\n \n \n \n \n \n \n \n@@ -58,54 +58,58 @@\n \n \n \n \n \n
    \n \n-
    composedgridfunction.hh File Reference
    \n+
    subentitydofs.hh File Reference
    \n
    \n
    \n-
    #include <type_traits>
    \n-#include <tuple>
    \n-#include <dune/common/referencehelper.hh>
    \n-#include <dune/common/typeutilities.hh>
    \n-#include <dune/functions/common/defaultderivativetraits.hh>
    \n-#include <dune/functions/common/differentiablefunction.hh>
    \n-#include <dune/functions/gridfunctions/gridfunction.hh>
    \n+
    #include <vector>
    \n+#include <dune/geometry/referenceelements.hh>
    \n+#include <dune/typetree/traversal.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n+\n+\n \n

    \n Classes

    class  Dune::Functions::ComposedGridFunction< OF, IF >
     Composition of grid functions with another function. More...
    class  Dune::Functions::SubEntityDOFs< GridView >
     Range of DOFs associated to sub-entity. More...
     
    \n \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n \n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n

    \n Functions

    template<class OF , class... IF>
    auto Dune::Functions::makeComposedGridFunction (OF &&outerFunction, IF &&... innerFunction)
     Create a ComposedGridFunction that composes grid-functions with another function. More...
     
    template<class T >
    auto Dune::Functions::subEntityDOFs (const T &)
     Create SubEntityDOFs object. More...
     
    template<class LocalView >
    auto Dune::Functions::subEntityDOFs (const LocalView &localView, std::size_t subEntityIndex, std::size_t subEntityCodim)
     Create bound SubEntityDOFs object. More...
     
    template<class LocalView , class Intersection >
    auto Dune::Functions::subEntityDOFs (const LocalView &localView, const Intersection &intersection)
     Create bound SubEntityDOFs object. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,37 +4,41 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * gridfunctions\n+ * functionspacebases\n Classes | Namespaces | Functions\n-composedgridfunction.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+subentitydofs.hh File Reference\n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::ComposedGridFunction<_OF,_IF_>\n-\u00a0 Composition of grid functions with another function. More...\n+class \u00a0Dune::Functions::SubEntityDOFs<_GridView_>\n+\u00a0 Range of DOFs associated to sub-entity. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n Functions\n-template\n-auto\u00a0Dune::Functions::makeComposedGridFunction (OF &&outerFunction, IF &&...\n- innerFunction)\n-\u00a0 Create a ComposedGridFunction that composes grid-functions with another\n- function. More...\n+template\n+auto\u00a0Dune::Functions::subEntityDOFs (const T &)\n+\u00a0 Create SubEntityDOFs object. More...\n+\u00a0\n+template\n+auto\u00a0Dune::Functions::subEntityDOFs (const LocalView &localView, std::size_t\n+ subEntityIndex, std::size_t subEntityCodim)\n+\u00a0 Create bound SubEntityDOFs object. More...\n+\u00a0\n+template\n+auto\u00a0Dune::Functions::subEntityDOFs (const LocalView &localView, const\n+ Intersection &intersection)\n+\u00a0 Create bound SubEntityDOFs object. More...\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00089_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00089_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: composedgridfunction.hh Source File\n+dune-functions: subentitydofs.hh Source File\n \n \n \n \n \n \n \n@@ -58,199 +58,152 @@\n \n
    \n \n \n \n
    \n-
    composedgridfunction.hh
    \n+
    subentitydofs.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH
    \n-
    4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH
    \n
    5
    \n-
    6#include <type_traits>
    \n-
    7#include <tuple>
    \n-
    8
    \n-
    9#include <dune/common/referencehelper.hh>
    \n-
    10#include <dune/common/typeutilities.hh>
    \n+
    6#include <vector>
    \n+
    7
    \n+
    8#include <dune/geometry/referenceelements.hh>
    \n+
    9#include <dune/typetree/traversal.hh>
    \n+
    10
    \n
    11
    \n-\n-\n-\n+
    12
    \n+
    13namespace Dune {
    \n+
    14namespace Functions {
    \n
    15
    \n
    16
    \n-
    17namespace Dune {
    \n-
    18namespace Functions {
    \n-
    19
    \n-
    20
    \n-
    21
    \n-
    40template<class OF, class... IF>
    \n-\n+
    17
    \n+
    40template<class GridView>
    \n+\n
    42{
    \n-
    43 using InnerFunctions = std::tuple<IF...>;
    \n-
    44 using InnerLocalFunctions = std::tuple<decltype(localFunction(resolveRef(std::declval<const IF&>())))...>;
    \n-
    45
    \n-
    46 template<std::size_t i>
    \n-
    47 using InnerFunction = std::decay_t<ResolveRef_t<std::tuple_element_t<i, InnerFunctions>>>;
    \n-
    48
    \n-
    49 using OuterFunction = OF;
    \n-
    50
    \n-
    51public:
    \n-
    52
    \n-
    53 using EntitySet = typename InnerFunction<0>::EntitySet;
    \n-
    54 using Element = typename EntitySet::Element;
    \n-
    55
    \n-
    56 using Domain = typename EntitySet::GlobalCoordinate;
    \n-
    57 using LocalDomain = typename EntitySet::LocalCoordinate;
    \n-
    58
    \n-
    59 using Range = decltype(std::declval<OF>()(std::declval<IF>()(std::declval<Domain>())...));
    \n-
    60
    \n-
    61private:
    \n-
    62
    \n-
    63 using Traits = Imp::GridFunctionTraits<Range(Domain), EntitySet, DefaultDerivativeTraits, 16>;
    \n-
    64
    \n-
    65 class LocalFunction
    \n-
    66 {
    \n-
    67 public:
    \n-
    74 LocalFunction(const ComposedGridFunction& globalFunction) :
    \n-
    75 globalFunction_(globalFunction),
    \n-
    76 innerLocalFunctions_(globalFunction.innerLocalFunctions())
    \n-
    77 {}
    \n-
    78
    \n-
    88 void bind(const Element& element)
    \n-
    89 {
    \n-
    90 std::apply([&](auto&... innerFunction) {
    \n-
    91 (innerFunction.bind(element),...);
    \n-
    92 }, innerLocalFunctions_);
    \n-
    93 }
    \n-
    94
    \n-
    96 void unbind()
    \n-
    97 {
    \n-
    98 std::apply([&](auto&... innerFunction) {
    \n-
    99 (innerFunction.unbind(),...);
    \n-
    100 }, innerLocalFunctions_);
    \n-
    101 }
    \n-
    102
    \n-
    105 bool bound() const
    \n-
    106 {
    \n-
    107 return std::apply([](const auto&... innerFunction) {
    \n-
    108 return (innerFunction.bound() && ...);
    \n-
    109 }, innerLocalFunctions_);
    \n-
    110 }
    \n-
    111
    \n-
    121 Range operator()(const LocalDomain& x) const
    \n-
    122 {
    \n-
    123 return std::apply([&](const auto&... innerFunction) {
    \n-
    124 return globalFunction_.outerFunction_(innerFunction(x)...);
    \n-
    125 }, innerLocalFunctions_);
    \n-
    126 }
    \n-
    127
    \n-
    137 const Element& localContext() const
    \n-
    138 {
    \n-
    139 return std::get<0>(innerLocalFunctions_).localContext();
    \n-
    140 }
    \n-
    141
    \n-
    143 friend typename Traits::LocalFunctionTraits::DerivativeInterface derivative(const LocalFunction& t)
    \n-
    144 {
    \n-
    145 DUNE_THROW(NotImplemented,"not implemented");
    \n-
    146 }
    \n-
    147
    \n-
    148 private:
    \n-
    149 const ComposedGridFunction& globalFunction_;
    \n-
    150 InnerLocalFunctions innerLocalFunctions_;
    \n-
    151 };
    \n-
    152
    \n-
    153public:
    \n-
    154
    \n-
    164 template<class OFT, class... IFT,
    \n-
    165 disableCopyMove<ComposedGridFunction, OFT> = 0,
    \n-
    166 std::enable_if_t<(sizeof...(IFT) > 0), int> = 0>
    \n-
    167 ComposedGridFunction(OFT&& outerFunction, IFT&&... innerFunctions) :
    \n-
    168 outerFunction_(std::forward<OFT>(outerFunction)),
    \n-
    169 innerFunctions_(std::forward<IFT>(innerFunctions)...)
    \n-
    170 {}
    \n-
    171
    \n-
    173 Range operator()(const Domain& x) const
    \n-
    174 {
    \n-
    175 DUNE_THROW(NotImplemented,"not implemented");
    \n-
    176 }
    \n-
    177
    \n-\n-
    180 {
    \n-
    181 DUNE_THROW(NotImplemented,"not implemented");
    \n-
    182 }
    \n-
    183
    \n-
    190 friend LocalFunction localFunction(const ComposedGridFunction& cgf)
    \n-
    191 {
    \n-
    192 return LocalFunction(cgf);
    \n-
    193 }
    \n+
    43 static const int dim = GridView::dimension;
    \n+
    44
    \n+
    45public:
    \n+
    46
    \n+
    63 template<class LocalView>
    \n+
    64 SubEntityDOFs& bind(const LocalView& localView, std::size_t subEntityIndex, std::size_t subEntityCodim)
    \n+
    65 {
    \n+
    66 // fill vector with local indices of all DOFs contained in subentity
    \n+
    67 containedDOFs_.clear();
    \n+
    68 dofIsContained_.assign(localView.size(), false);
    \n+
    69
    \n+
    70 auto re = Dune::referenceElement<double,dim>(localView.element().type());
    \n+
    71
    \n+
    72 Dune::TypeTree::forEachLeafNode(localView.tree(), [&](auto&& node, auto&& /*treePath*/) {
    \n+
    73 const auto& localCoefficients = node.finiteElement().localCoefficients();
    \n+
    74 std::size_t localSize = localCoefficients.size();
    \n+
    75 for(std::size_t i=0; i<localSize; ++i)
    \n+
    76 {
    \n+
    77 auto localKey = localCoefficients.localKey(i);
    \n+
    78 if (re.subEntities(subEntityIndex, subEntityCodim, localKey.codim()).contains(localKey.subEntity()))
    \n+
    79 {
    \n+
    80 containedDOFs_.push_back(node.localIndex(i));
    \n+
    81 dofIsContained_[node.localIndex(i)] = true;
    \n+
    82 }
    \n+
    83 }
    \n+
    84 });
    \n+
    85 return *this;
    \n+
    86 }
    \n+
    87
    \n+
    103 template<class LocalView, class Intersection>
    \n+
    104 SubEntityDOFs& bind(const LocalView& localView, const Intersection& intersection)
    \n+
    105 {
    \n+
    106 return bind(localView, intersection.indexInInside(), 1);
    \n+
    107 }
    \n+
    108
    \n+
    110 auto begin() const
    \n+
    111 {
    \n+
    112 return containedDOFs_.cbegin();
    \n+
    113 }
    \n+
    114
    \n+
    116 auto end() const
    \n+
    117 {
    \n+
    118 return containedDOFs_.cend();
    \n+
    119 }
    \n+
    120
    \n+
    122 auto size() const
    \n+
    123 {
    \n+
    124 return containedDOFs_.size();
    \n+
    125 }
    \n+
    126
    \n+
    128 decltype(auto) operator[](std::size_t i) const
    \n+
    129 {
    \n+
    130 return containedDOFs_[i];
    \n+
    131 }
    \n+
    132
    \n+
    134 bool contains(std::size_t localIndex) const
    \n+
    135 {
    \n+
    136 return dofIsContained_[localIndex];
    \n+
    137 }
    \n+
    138
    \n+
    139private:
    \n+
    140
    \n+
    141 std::vector<std::size_t> containedDOFs_;
    \n+
    142 std::vector<bool> dofIsContained_;
    \n+
    143};
    \n+
    144
    \n+
    145
    \n+
    146
    \n+
    159template<class T>
    \n+
    160auto subEntityDOFs(const T&)
    \n+
    161{
    \n+\n+
    163}
    \n+
    164
    \n+
    165
    \n+
    166
    \n+
    186template<class LocalView>
    \n+
    187auto subEntityDOFs(const LocalView& localView, std::size_t subEntityIndex, std::size_t subEntityCodim)
    \n+
    188{
    \n+
    189 using GridView = typename LocalView::GridView;
    \n+\n+
    191 subEntityDOFs.bind(localView, subEntityIndex, subEntityCodim);
    \n+
    192 return subEntityDOFs;
    \n+
    193}
    \n
    194
    \n-
    205 const EntitySet& entitySet() const
    \n-
    206 {
    \n-
    207 return resolveRef(std::get<0>(innerFunctions_)).entitySet();
    \n-
    208 }
    \n-
    209
    \n-
    210protected:
    \n-
    211
    \n-
    212 InnerLocalFunctions innerLocalFunctions() const
    \n-
    213 {
    \n-
    214 return std::apply([&](const auto&... innerFunction) {
    \n-
    215 return std::make_tuple(localFunction(resolveRef(innerFunction))...);
    \n-
    216 }, innerFunctions_);
    \n-
    217 }
    \n-
    218
    \n-
    219 OuterFunction outerFunction_;
    \n-
    220 InnerFunctions innerFunctions_;
    \n-
    221};
    \n-
    222
    \n+
    195
    \n+
    196
    \n+
    215template<class LocalView, class Intersection>
    \n+
    216auto subEntityDOFs(const LocalView& localView, const Intersection& intersection)
    \n+
    217{
    \n+
    218 using GridView = typename LocalView::GridView;
    \n+\n+
    220 subEntityDOFs.bind(localView, intersection);
    \n+
    221 return subEntityDOFs;
    \n+
    222}
    \n
    223
    \n
    224
    \n-
    247template<class OF, class... IF>
    \n-
    248auto makeComposedGridFunction(OF&& outerFunction, IF&&... innerFunction)
    \n-
    249{
    \n-
    250 using ComposedGridFunctionType = ComposedGridFunction<std::decay_t<OF>, std::decay_t<IF>...>;
    \n-
    251 return ComposedGridFunctionType(std::forward<OF>(outerFunction), std::forward<IF>(innerFunction)...);
    \n-
    252}
    \n-
    253
    \n-
    254
    \n-
    255
    \n-
    256}} // namespace Dune::Functions
    \n-
    257
    \n-
    258
    \n-
    259
    \n-
    260#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH
    \n-\n-\n-\n-
    auto makeComposedGridFunction(OF &&outerFunction, IF &&... innerFunction)
    Create a ComposedGridFunction that composes grid-functions with another function.
    Definition: composedgridfunction.hh:248
    \n+
    225
    \n+
    226} // namespace Functions
    \n+
    227} // namespace Dune
    \n+
    228
    \n+
    229#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH
    \n+
    auto subEntityDOFs(const LocalView &localView, const Intersection &intersection)
    Create bound SubEntityDOFs object.
    Definition: subentitydofs.hh:216
    \n
    Definition: polynomial.hh:10
    \n-
    decltype(auto) resolveRef(T &&t)
    This is an alias for Dune::resolveRef.
    Definition: referencehelper.hh:37
    \n-
    Default implementation for derivative traits.
    Definition: defaultderivativetraits.hh:37
    \n-
    Composition of grid functions with another function.
    Definition: composedgridfunction.hh:42
    \n-
    OuterFunction outerFunction_
    Definition: composedgridfunction.hh:219
    \n-
    InnerFunctions innerFunctions_
    Definition: composedgridfunction.hh:220
    \n-
    ComposedGridFunction(OFT &&outerFunction, IFT &&... innerFunctions)
    Create ComposedGridFunction.
    Definition: composedgridfunction.hh:167
    \n-
    const EntitySet & entitySet() const
    Return the EntitySet associated to this composed grid-function.
    Definition: composedgridfunction.hh:205
    \n-
    typename InnerFunction< 0 >::EntitySet EntitySet
    Definition: composedgridfunction.hh:53
    \n-
    typename EntitySet::LocalCoordinate LocalDomain
    Definition: composedgridfunction.hh:57
    \n-
    typename EntitySet::Element Element
    Definition: composedgridfunction.hh:54
    \n-
    InnerLocalFunctions innerLocalFunctions() const
    Definition: composedgridfunction.hh:212
    \n-
    friend LocalFunction localFunction(const ComposedGridFunction &cgf)
    Create a local-function of this composed grid-function.
    Definition: composedgridfunction.hh:190
    \n-
    decltype(std::declval< OF >()(std::declval< IF >()(std::declval< Domain >())...)) Range
    Definition: composedgridfunction.hh:59
    \n-
    typename EntitySet::GlobalCoordinate Domain
    Definition: composedgridfunction.hh:56
    \n-
    Range operator()(const Domain &x) const
    Evaluation of the composed grid function in coordinates x
    Definition: composedgridfunction.hh:173
    \n-
    friend Traits::DerivativeInterface derivative(const ComposedGridFunction &t)
    Not implemented.
    Definition: composedgridfunction.hh:179
    \n-
    Definition: gridfunction.hh:32
    \n+
    Range of DOFs associated to sub-entity.
    Definition: subentitydofs.hh:42
    \n+
    auto begin() const
    Create begin iterator for access to range of contained local indices.
    Definition: subentitydofs.hh:110
    \n+
    auto size() const
    Return number of contained DOFs.
    Definition: subentitydofs.hh:122
    \n+
    SubEntityDOFs & bind(const LocalView &localView, const Intersection &intersection)
    Bind SubEntityDOFs object to LocalView and sub-entity.
    Definition: subentitydofs.hh:104
    \n+
    bool contains(std::size_t localIndex) const
    Check if given local index is contained in this range of DOFs.
    Definition: subentitydofs.hh:134
    \n+
    auto end() const
    Create end iterator for access to range of contained local indices.
    Definition: subentitydofs.hh:116
    \n+
    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
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,244 +4,177 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * gridfunctions\n-composedgridfunction.hh\n+ * functionspacebases\n+subentitydofs.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH\n- 4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH\n 5\n- 6#include \n- 7#include \n- 8\n- 9#include \n- 10#include \n+ 6#include \n+ 7\n+ 8#include \n+ 9#include \n+ 10\n 11\n- 12#include \n- 13#include \n- 14#include \n+ 12\n+ 13namespace Dune {\n+ 14namespace Functions {\n 15\n 16\n- 17namespace Dune {\n- 18namespace Functions {\n- 19\n- 20\n- 21\n- 40template\n-41class ComposedGridFunction\n+ 17\n+ 40template\n+41class SubEntityDOFs\n 42{\n- 43 using InnerFunctions = std::tuple;\n- 44 using InnerLocalFunctions = std::tuple())))...>;\n- 45\n- 46 template\n- 47 using InnerFunction = std::decay_t>>;\n- 48\n- 49 using OuterFunction = OF;\n- 50\n- 51public:\n- 52\n-53 using EntitySet = typename InnerFunction<0>::EntitySet;\n-54 using Element = typename EntitySet::Element;\n- 55\n-56 using Domain = typename EntitySet::GlobalCoordinate;\n-57 using LocalDomain = typename EntitySet::LocalCoordinate;\n- 58\n-59 using Range = decltype(std::declval()(std::declval()(std::\n-declval())...));\n- 60\n- 61private:\n- 62\n- 63 using Traits = Imp::GridFunctionTraits;\n- 64\n- 65 class LocalFunction\n- 66 {\n- 67 public:\n- 74 LocalFunction(const ComposedGridFunction& globalFunction) :\n- 75 globalFunction_(globalFunction),\n- 76 innerLocalFunctions_(globalFunction.innerLocalFunctions())\n- 77 {}\n- 78\n- 88 void bind(const Element& element)\n- 89 {\n- 90 std::apply([&](auto&... innerFunction) {\n- 91 (innerFunction.bind(element),...);\n- 92 }, innerLocalFunctions_);\n- 93 }\n- 94\n- 96 void unbind()\n- 97 {\n- 98 std::apply([&](auto&... innerFunction) {\n- 99 (innerFunction.unbind(),...);\n- 100 }, innerLocalFunctions_);\n- 101 }\n- 102\n- 105 bool bound() const\n- 106 {\n- 107 return std::apply([](const auto&... innerFunction) {\n- 108 return (innerFunction.bound() && ...);\n- 109 }, innerLocalFunctions_);\n- 110 }\n- 111\n- 121 Range operator()(const LocalDomain& x) const\n- 122 {\n- 123 return std::apply([&](const auto&... innerFunction) {\n- 124 return globalFunction_.outerFunction_(innerFunction(x)...);\n- 125 }, innerLocalFunctions_);\n- 126 }\n- 127\n- 137 const Element& localContext() const\n- 138 {\n- 139 return std::get<0>(innerLocalFunctions_).localContext();\n- 140 }\n- 141\n- 143 friend typename Traits::LocalFunctionTraits::DerivativeInterface\n-derivative(const LocalFunction& t)\n- 144 {\n- 145 DUNE_THROW(NotImplemented,\"not implemented\");\n- 146 }\n- 147\n- 148 private:\n- 149 const ComposedGridFunction& globalFunction_;\n- 150 InnerLocalFunctions innerLocalFunctions_;\n- 151 };\n- 152\n- 153public:\n- 154\n- 164 template = 0,\n- 166 std::enable_if_t<(sizeof...(IFT) > 0), int> = 0>\n-167 ComposedGridFunction(OFT&& outerFunction, IFT&&... innerFunctions) :\n- 168 outerFunction_(std::forward(outerFunction)),\n- 169 innerFunctions_(std::forward(innerFunctions)...)\n- 170 {}\n- 171\n-173 Range operator()(const Domain& x) const\n- 174 {\n- 175 DUNE_THROW(NotImplemented,\"not implemented\");\n- 176 }\n- 177\n-179 friend typename Traits::DerivativeInterface derivative(const\n-ComposedGridFunction& t)\n- 180 {\n- 181 DUNE_THROW(NotImplemented,\"not implemented\");\n- 182 }\n- 183\n-190 friend LocalFunction localFunction(const ComposedGridFunction& cgf)\n- 191 {\n- 192 return LocalFunction(cgf);\n- 193 }\n+ 43 static const int dim = GridView::dimension;\n+ 44\n+ 45public:\n+ 46\n+ 63 template\n+64 SubEntityDOFs& bind(const LocalView& localView, std::size_t subEntityIndex,\n+std::size_t subEntityCodim)\n+ 65 {\n+ 66 // fill vector with local indices of all DOFs contained in subentity\n+ 67 containedDOFs_.clear();\n+ 68 dofIsContained_.assign(localView.size(), false);\n+ 69\n+ 70 auto re = Dune::referenceElement(localView.element().type());\n+ 71\n+ 72 Dune::TypeTree::forEachLeafNode(localView.tree(), [&](auto&& node, auto&& /\n+*treePath*/) {\n+ 73 const auto& localCoefficients = node.finiteElement().localCoefficients();\n+ 74 std::size_t localSize = localCoefficients.size();\n+ 75 for(std::size_t i=0; i\n+104 SubEntityDOFs& bind(const LocalView& localView, const Intersection&\n+intersection)\n+ 105 {\n+ 106 return bind(localView, intersection.indexInInside(), 1);\n+ 107 }\n+ 108\n+110 auto begin() const\n+ 111 {\n+ 112 return containedDOFs_.cbegin();\n+ 113 }\n+ 114\n+116 auto end() const\n+ 117 {\n+ 118 return containedDOFs_.cend();\n+ 119 }\n+ 120\n+122 auto size() const\n+ 123 {\n+ 124 return containedDOFs_.size();\n+ 125 }\n+ 126\n+128 decltype(auto) operator[](std::size_t i) const\n+ 129 {\n+ 130 return containedDOFs_[i];\n+ 131 }\n+ 132\n+134 bool contains(std::size_t localIndex) const\n+ 135 {\n+ 136 return dofIsContained_[localIndex];\n+ 137 }\n+ 138\n+ 139private:\n+ 140\n+ 141 std::vector containedDOFs_;\n+ 142 std::vector dofIsContained_;\n+ 143};\n+ 144\n+ 145\n+ 146\n+ 159template\n+160auto subEntityDOFs(const T&)\n+ 161{\n+ 162 return SubEntityDOFs{};\n+ 163}\n+ 164\n+ 165\n+ 166\n+ 186template\n+187auto subEntityDOFs(const LocalView& localView, std::size_t subEntityIndex,\n+std::size_t subEntityCodim)\n+ 188{\n+ 189 using GridView = typename LocalView::GridView;\n+ 190 SubEntityDOFs subEntityDOFs;\n+ 191 subEntityDOFs.bind(localView, subEntityIndex, subEntityCodim);\n+ 192 return subEntityDOFs;\n+ 193}\n 194\n-205 const EntitySet& entitySet() const\n- 206 {\n- 207 return resolveRef(std::get<0>(innerFunctions_)).entitySet();\n- 208 }\n- 209\n- 210protected:\n- 211\n-212 InnerLocalFunctions innerLocalFunctions() const\n- 213 {\n- 214 return std::apply([&](const auto&... innerFunction) {\n- 215 return std::make_tuple(localFunction(resolveRef(innerFunction))...);\n- 216 }, innerFunctions_);\n- 217 }\n- 218\n-219 OuterFunction outerFunction_;\n-220 InnerFunctions innerFunctions_;\n- 221};\n- 222\n+ 195\n+ 196\n+ 215template\n+216auto subEntityDOFs(const LocalView& localView, const Intersection&\n+intersection)\n+ 217{\n+ 218 using GridView = typename LocalView::GridView;\n+ 219 SubEntityDOFs subEntityDOFs;\n+ 220 subEntityDOFs.bind(localView, intersection);\n+ 221 return subEntityDOFs;\n+ 222}\n 223\n 224\n- 247template\n-248auto makeComposedGridFunction(OF&& outerFunction, IF&&... innerFunction)\n- 249{\n- 250 using ComposedGridFunctionType = ComposedGridFunction,\n-std::decay_t...>;\n- 251 return ComposedGridFunctionType(std::forward(outerFunction), std::\n-forward(innerFunction)...);\n- 252}\n- 253\n- 254\n- 255\n- 256}} // namespace Dune::Functions\n- 257\n- 258\n- 259\n- 260#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_COMPOSEDGRIDFUNCTION_HH\n-defaultderivativetraits.hh\n-differentiablefunction.hh\n-gridfunction.hh\n-Dune::Functions::ComposedGridFunction::makeComposedGridFunction\n-auto makeComposedGridFunction(OF &&outerFunction, IF &&... innerFunction)\n-Create a ComposedGridFunction that composes grid-functions with another\n-function.\n-Definition: composedgridfunction.hh:248\n+ 225\n+ 226} // namespace Functions\n+ 227} // namespace Dune\n+ 228\n+ 229#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH\n+Dune::Functions::subEntityDOFs\n+auto subEntityDOFs(const LocalView &localView, const Intersection\n+&intersection)\n+Create bound SubEntityDOFs object.\n+Definition: subentitydofs.hh:216\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::resolveRef\n-decltype(auto) resolveRef(T &&t)\n-This is an alias for Dune::resolveRef.\n-Definition: referencehelper.hh:37\n-Dune::Functions::DefaultDerivativeTraits\n-Default implementation for derivative traits.\n-Definition: defaultderivativetraits.hh:37\n-Dune::Functions::ComposedGridFunction\n-Composition of grid functions with another function.\n-Definition: composedgridfunction.hh:42\n-Dune::Functions::ComposedGridFunction::outerFunction_\n-OuterFunction outerFunction_\n-Definition: composedgridfunction.hh:219\n-Dune::Functions::ComposedGridFunction::innerFunctions_\n-InnerFunctions innerFunctions_\n-Definition: composedgridfunction.hh:220\n-Dune::Functions::ComposedGridFunction::ComposedGridFunction\n-ComposedGridFunction(OFT &&outerFunction, IFT &&... innerFunctions)\n-Create ComposedGridFunction.\n-Definition: composedgridfunction.hh:167\n-Dune::Functions::ComposedGridFunction::entitySet\n-const EntitySet & entitySet() const\n-Return the EntitySet associated to this composed grid-function.\n-Definition: composedgridfunction.hh:205\n-Dune::Functions::ComposedGridFunction::EntitySet\n-typename InnerFunction< 0 >::EntitySet EntitySet\n-Definition: composedgridfunction.hh:53\n-Dune::Functions::ComposedGridFunction::LocalDomain\n-typename EntitySet::LocalCoordinate LocalDomain\n-Definition: composedgridfunction.hh:57\n-Dune::Functions::ComposedGridFunction::Element\n-typename EntitySet::Element Element\n-Definition: composedgridfunction.hh:54\n-Dune::Functions::ComposedGridFunction::innerLocalFunctions\n-InnerLocalFunctions innerLocalFunctions() const\n-Definition: composedgridfunction.hh:212\n-Dune::Functions::ComposedGridFunction::localFunction\n-friend LocalFunction localFunction(const ComposedGridFunction &cgf)\n-Create a local-function of this composed grid-function.\n-Definition: composedgridfunction.hh:190\n-Dune::Functions::ComposedGridFunction::Range\n-decltype(std::declval< OF >()(std::declval< IF >()(std::declval< Domain >\n-())...)) Range\n-Definition: composedgridfunction.hh:59\n-Dune::Functions::ComposedGridFunction::Domain\n-typename EntitySet::GlobalCoordinate Domain\n-Definition: composedgridfunction.hh:56\n-Dune::Functions::ComposedGridFunction::operator()\n-Range operator()(const Domain &x) const\n-Evaluation of the composed grid function in coordinates x\n-Definition: composedgridfunction.hh:173\n-Dune::Functions::ComposedGridFunction::derivative\n-friend Traits::DerivativeInterface derivative(const ComposedGridFunction &t)\n-Not implemented.\n-Definition: composedgridfunction.hh:179\n-Dune::Functions::GridFunction\n-Definition: gridfunction.hh:32\n+Dune::Functions::SubEntityDOFs\n+Range of DOFs associated to sub-entity.\n+Definition: subentitydofs.hh:42\n+Dune::Functions::SubEntityDOFs::begin\n+auto begin() const\n+Create begin iterator for access to range of contained local indices.\n+Definition: subentitydofs.hh:110\n+Dune::Functions::SubEntityDOFs::size\n+auto size() const\n+Return number of contained DOFs.\n+Definition: subentitydofs.hh:122\n+Dune::Functions::SubEntityDOFs::bind\n+SubEntityDOFs & bind(const LocalView &localView, const Intersection\n+&intersection)\n+Bind SubEntityDOFs object to LocalView and sub-entity.\n+Definition: subentitydofs.hh:104\n+Dune::Functions::SubEntityDOFs::contains\n+bool contains(std::size_t localIndex) const\n+Check if given local index is contained in this range of DOFs.\n+Definition: subentitydofs.hh:134\n+Dune::Functions::SubEntityDOFs::end\n+auto end() const\n+Create end iterator for access to range of contained local indices.\n+Definition: subentitydofs.hh:116\n+Dune::Functions::SubEntityDOFs::bind\n+SubEntityDOFs & bind(const LocalView &localView, std::size_t subEntityIndex,\n+std::size_t subEntityCodim)\n+Bind SubEntityDOFs object to LocalView and sub-entity.\n+Definition: subentitydofs.hh:64\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00092.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00092.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: analyticgridviewfunction.hh File Reference\n+dune-functions: basistags.hh File Reference\n \n \n \n \n \n \n \n@@ -58,56 +58,85 @@\n \n \n \n \n \n
    \n \n-
    analyticgridviewfunction.hh File Reference
    \n+
    basistags.hh File Reference
    \n
    \n
    \n
    #include <type_traits>
    \n-#include <optional>
    \n-#include <dune/common/typeutilities.hh>
    \n-#include <dune/functions/common/signature.hh>
    \n-#include <dune/functions/common/defaultderivativetraits.hh>
    \n-#include <dune/functions/common/differentiablefunction_imp.hh>
    \n-#include <dune/functions/common/differentiablefunction.hh>
    \n-#include <dune/functions/gridfunctions/gridviewentityset.hh>
    \n-#include <dune/functions/gridfunctions/localderivativetraits.hh>
    \n+#include <dune/common/concept.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n

    \n Classes

    class  Dune::Functions::AnalyticGridViewFunction< Range(Domain), GV, F, DerivativeTraits >
     Class wrapping any differentiable function as grid function. 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...
     
    \n \n \n \n \n \n+\n+\n+\n+\n+\n+\n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    namespace  Dune::Functions::Concept
     
    namespace  Dune::Functions::BasisFactory
     
    namespace  Dune::Functions::BasisBuilder
     
    \n \n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n

    \n 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. More...
     
    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. More...
     
    constexpr FlatInterleaved Dune::Functions::BasisFactory::flatInterleaved ()
     Creates an interleaved merging of direct children without blocking. More...
     
    constexpr BlockedLexicographic Dune::Functions::BasisFactory::blockedLexicographic ()
     Creates a lexicographic merging of direct children with blocking (i.e. creating one block per direct child). More...
     
    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). More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,46 +4,83 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * gridfunctions\n+ * functionspacebases\n Classes | Namespaces | Functions\n-analyticgridviewfunction.hh File Reference\n+basistags.hh File Reference\n #include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n- DerivativeTraits_>\n-\u00a0 Class wrapping any differentiable function as grid function. More...\n+struct \u00a0Dune::Functions::Concept::IndexMergingStrategy\n+\u00a0\n+struct \u00a0Dune::Functions::BasisFactory::IndexMergingStrategy\n+\u00a0 Base class for index merging strategies to simplify detection. More...\n+\u00a0\n+struct \u00a0Dune::Functions::BasisFactory::FlatLexicographic\n+\u00a0 Lexicographic merging of direct children without blocking. More...\n+\u00a0\n+struct \u00a0Dune::Functions::BasisFactory::FlatInterleaved\n+\u00a0 Interleaved merging of direct children without blocking. More...\n+\u00a0\n+struct \u00a0Dune::Functions::BasisFactory::BlockedLexicographic\n+\u00a0 Lexicographic merging of direct children with blocking (i.e. creating\n+ one block per direct child). More...\n+\u00a0\n+struct \u00a0Dune::Functions::BasisFactory::BlockedInterleaved\n+\u00a0 Interleaved merging of direct children with blocking (i.e. creating\n+ blocks at the leaves containing one leaf per child each). More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n+namespace \u00a0Dune::Functions::Concept\n+\u00a0\n+namespace \u00a0Dune::Functions::BasisFactory\n+\u00a0\n+namespace \u00a0Dune::Functions::BasisBuilder\n+\u00a0\n Functions\n-template\n- AnalyticGridViewFunction< typename\n- std::invoke_result< F, typename\n- GridView::template Codim< 0 >::\n- Geometry::GlobalCoordinate >::type\n-(typename GridView::template Codim< 0\n- >::Geometry::GlobalCoordinate), Dune::Functions::\n- GridView, typename std::decay< F >:: makeAnalyticGridViewFunction (F &&f,\n- type >\u00a0const GridView &gridView)\n-\u00a0 Create an AnalyticGridViewFunction from\n- a function and a grid view. More...\n+template\n+ static constexpr bool\u00a0Dune::Functions::Concept::\n+ isIndexMergingStrategy ()\n+\u00a0\n+template\n+ static constexpr bool\u00a0Dune::Functions::Concept::\n+ isIndexMergingStrategy (T &&t)\n+\u00a0\n+ void\u00a0Dune::Functions::BasisFactory::\n+ registerIndexMergingStrategy\n+ (IndexMergingStrategy)\n+\u00a0\n+ constexpr FlatLexicographic\u00a0Dune::Functions::BasisFactory::\n+ flatLexicographic ()\n+\u00a0 Creates a lexicographic merging of direct\n+ children without blocking. More...\n+\u00a0\n+ constexpr FlatInterleaved\u00a0Dune::Functions::BasisFactory::flatInterleaved\n+ ()\n+\u00a0 Creates an interleaved merging of direct\n+ children without blocking. More...\n+\u00a0\n+constexpr BlockedLexicographic\u00a0Dune::Functions::BasisFactory::\n+ blockedLexicographic ()\n+ Creates a lexicographic merging of direct\n+\u00a0 children with blocking (i.e. creating one block\n+ per direct child). More...\n+\u00a0\n+ constexpr BlockedInterleaved\u00a0Dune::Functions::BasisFactory::\n+ blockedInterleaved ()\n+ Creates an interleaved merging of direct\n+\u00a0 children with blocking (i.e. creating blocks at\n+ the leaves containing one leaf per child each).\n+ More...\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00092_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00092_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: analyticgridviewfunction.hh Source File\n+dune-functions: basistags.hh Source File\n \n \n \n \n \n \n \n@@ -58,239 +58,126 @@\n \n \n \n \n \n
    \n-
    analyticgridviewfunction.hh
    \n+
    basistags.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH
    \n-
    4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH
    \n
    5
    \n
    6#include <type_traits>
    \n-
    7#include <optional>
    \n+
    7#include <dune/common/concept.hh>
    \n
    8
    \n-
    9#include <dune/common/typeutilities.hh>
    \n-
    10
    \n-\n-\n-\n-\n-\n-\n-
    17
    \n-
    18
    \n-
    19namespace Dune {
    \n-
    20namespace Functions {
    \n+
    9namespace Dune {
    \n+
    10namespace Functions {
    \n+
    11
    \n+
    12 namespace Concept {
    \n+
    13
    \n+\n+
    15 {
    \n+
    16 template<typename T>
    \n+
    17 auto require(T&& t) -> decltype(
    \n+\n+
    19 );
    \n+
    20 };
    \n
    21
    \n-
    22namespace Imp {
    \n-
    23
    \n-
    24template<class Signature, class GV, class FLocal, template<class> class DerivativeTraits=DefaultDerivativeTraits>
    \n-
    25class LocalAnalyticGridViewFunction;
    \n-
    26
    \n-
    27template<class Range, class LocalDomain, class GV, class F, template<class> class DerivativeTraits>
    \n-
    28class LocalAnalyticGridViewFunction<Range(LocalDomain), GV, F, DerivativeTraits>
    \n-
    29{
    \n-
    30public:
    \n-
    31 using Signature = Range(LocalDomain);
    \n-
    32 using RawSignature = typename SignatureTraits<Signature>::RawSignature;
    \n-
    33 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(LocalDomain);
    \n-
    34
    \n-
    35 using GridView = GV;
    \n-
    36 using EntitySet = GridViewEntitySet<GridView, 0>;
    \n-
    37 using Element = typename EntitySet::Element;
    \n-
    38// using Geometry = typename Element::Geometry;
    \n-
    39 using Geometry = typename std::decay<typename Element::Geometry>::type;
    \n-
    40
    \n-
    41 // Use the indirection via derivativeIfImplemented to also support
    \n-
    42 // function types F that do not implement derivative. In this case
    \n-
    43 // the interface type DifferentiableFunction is using a dummy for
    \n-
    44 // the derivative type
    \n-
    45 using DerivativeDummy = DifferentiableFunction<DerivativeSignature>;
    \n-
    46 using GlobalRawDerivative = decltype(Imp::derivativeIfImplemented<DerivativeDummy, F>(std::declval<F>()));
    \n-
    47 using LocalDerivative = LocalAnalyticGridViewFunction<DerivativeSignature, GridView, GlobalRawDerivative, DerivativeTraits>;
    \n-
    48
    \n-
    50 template<class FT, disableCopyMove<LocalAnalyticGridViewFunction, FT> = 0>
    \n-
    51 LocalAnalyticGridViewFunction(FT&& f) :
    \n-
    52 f_(std::forward<FT>(f))
    \n-
    53 {}
    \n-
    54
    \n-
    56 template<class FT>
    \n-
    57 LocalAnalyticGridViewFunction(FT&& f, const Element& element, const std::optional<Geometry>& geometry) :
    \n-
    58 f_(std::forward<FT>(f)),
    \n-
    59 element_(element),
    \n-
    60 geometry_(geometry)
    \n-
    61 {}
    \n-
    62
    \n-
    63
    \n-
    72 void bind(const Element& element)
    \n-
    73 {
    \n-
    74 element_ = element;
    \n-
    75 geometry_.emplace(element_.geometry());
    \n-
    76 }
    \n-
    77
    \n-
    79 void unbind()
    \n-
    80 {
    \n-
    81 geometry_.reset();
    \n-
    82 }
    \n-
    83
    \n-
    86 bool bound() const
    \n-
    87 {
    \n-
    88 return static_cast<bool>(geometry_);
    \n-
    89 }
    \n-
    90
    \n-
    100 Range operator()(const LocalDomain& x) const
    \n-
    101 {
    \n-
    102 assert(!!geometry_);
    \n-
    103 return f_(geometry_->global(x));
    \n-
    104 }
    \n-
    105
    \n-
    107 const Element& localContext() const
    \n-
    108 {
    \n-
    109 assert(!!geometry_);
    \n-
    110 return element_;
    \n-
    111 }
    \n-
    112
    \n-
    121 friend LocalDerivative derivative(const LocalAnalyticGridViewFunction& t)
    \n-
    122 {
    \n-
    123 return LocalDerivative(Imp::derivativeIfImplemented<DerivativeDummy, F>(t.f_), t.element_, t.geometry_);
    \n-
    124 }
    \n-
    125
    \n-
    126private:
    \n-
    127 F f_;
    \n-
    128 Element element_;
    \n-
    129 std::optional<Geometry> geometry_ = std::nullopt;
    \n-
    130};
    \n-
    131
    \n-
    132} // end namespace Imp
    \n-
    133
    \n-
    134
    \n-
    135
    \n-
    136
    \n-
    137template<class Signature, class GV, class F, template<class> class DerivativeTraits=DefaultDerivativeTraits>
    \n-\n-
    139
    \n-
    140
    \n-
    146template<class Range, class Domain, class GV, class F, template<class> class DerivativeTraits>
    \n-
    147class AnalyticGridViewFunction<Range(Domain), GV, F, DerivativeTraits>
    \n-
    148{
    \n-
    149public:
    \n-
    150 using Signature = Range(Domain);
    \n-\n-
    152 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(Domain);
    \n-
    153
    \n-
    154 using GridView = GV;
    \n-\n-
    156 using Element = typename EntitySet::Element;
    \n-
    157 using Geometry = typename Element::Geometry;
    \n-
    158
    \n-
    159 // Use the indirection via derivativeIfImplemented to also support
    \n-
    160 // function types F that do not implement derivative. In this case
    \n-
    161 // the interface type DifferentiableFunction is used a dummy for
    \n-
    162 // the derivative type
    \n-\n-
    164 using GlobalRawDerivative = decltype(Imp::derivativeIfImplemented<DerivativeDummy, F>(std::declval<F>()));
    \n-\n-
    166
    \n-\n-
    168 using LocalFunction = typename Imp::LocalAnalyticGridViewFunction<Range(LocalDomain), GridView, F, LocalDerivativeTraits<EntitySet, DerivativeTraits>::template Traits>;
    \n-
    169
    \n-
    171 template<class FT>
    \n-
    172 AnalyticGridViewFunction(FT&& f, const GridView& gridView) :
    \n-
    173 f_(std::forward<FT>(f)),
    \n-
    174 entitySet_(gridView)
    \n-
    175 {}
    \n-
    176
    \n-
    178 Range operator()(const Domain& x) const
    \n-
    179 {
    \n-
    180 return f_(x);
    \n-
    181 }
    \n+
    22 template<typename T>
    \n+
    23 static constexpr bool isIndexMergingStrategy()
    \n+
    24 {
    \n+
    25 return models<Concept::IndexMergingStrategy,T>();
    \n+
    26 }
    \n+
    27
    \n+
    28 template<typename T>
    \n+
    29 static constexpr bool isIndexMergingStrategy(T&& t)
    \n+
    30 {
    \n+
    31 return models<Concept::IndexMergingStrategy,std::decay_t<T>>();
    \n+
    32 }
    \n+
    33
    \n+
    34 } // namespace Concept
    \n+
    35
    \n+
    36
    \n+
    37namespace BasisFactory {
    \n+
    38
    \n+\n+
    45
    \n+\n+
    47
    \n+\n+\n+
    80 {};
    \n+
    81
    \n+\n+
    113 : public IndexMergingStrategy
    \n+
    114 {};
    \n+
    115
    \n+\n+
    147 : public IndexMergingStrategy
    \n+
    148 {};
    \n+
    149
    \n+\n+
    181
    \n
    182
    \n-\n-
    185 {
    \n-
    186 return Derivative(Imp::derivativeIfImplemented<DerivativeDummy, F>(t.f_), t.entitySet_.gridView());
    \n-
    187 }
    \n-
    188
    \n-\n-
    191 {
    \n-
    192 return LocalFunction(t.f_);
    \n-
    193 }
    \n-
    194
    \n-
    196 const EntitySet& entitySet() const
    \n-
    197 {
    \n-
    198 return entitySet_;
    \n-
    199 }
    \n-
    200
    \n-
    201private:
    \n-
    202 F f_;
    \n-
    203 EntitySet entitySet_;
    \n-
    204};
    \n-
    205
    \n-
    206
    \n-
    207
    \n-
    224template<class F, class GridView>
    \n-
    225AnalyticGridViewFunction<
    \n-
    226 typename std::invoke_result<F, typename GridView::template Codim<0>::Geometry::GlobalCoordinate>::type // Range
    \n-
    227 (typename GridView::template Codim<0>::Geometry::GlobalCoordinate), // Domain
    \n-
    228 GridView,
    \n-
    229 typename std::decay<F>::type > // Raw type of F (without & or &&)
    \n-
    230 makeAnalyticGridViewFunction(F&& f, const GridView& gridView)
    \n-
    231{
    \n-
    232 using Domain = typename GridView::template Codim<0>::Geometry::GlobalCoordinate;
    \n-
    233 using Range = typename std::invoke_result<F, Domain>::type;
    \n-
    234 using FRaw = typename std::decay<F>::type;
    \n+\n+
    189 {
    \n+
    190 return {};
    \n+
    191 }
    \n+
    192
    \n+\n+
    199 {
    \n+
    200 return {};
    \n+
    201 }
    \n+
    202
    \n+\n+
    209 {
    \n+
    210 return {};
    \n+
    211 }
    \n+
    212
    \n+\n+
    219 {
    \n+
    220 return {};
    \n+
    221 }
    \n+
    222
    \n+
    223} // end namespace BasisFactory
    \n+
    224
    \n+
    225// Backward compatibility
    \n+
    226namespace BasisBuilder {
    \n+
    227
    \n+
    228 using namespace BasisFactory;
    \n+
    229
    \n+
    230}
    \n+
    231
    \n+
    232} // end namespace Functions
    \n+
    233} // end namespace Dune
    \n+
    234
    \n
    235
    \n-
    236 return AnalyticGridViewFunction<Range(Domain), GridView, FRaw>(std::forward<F>(f), gridView);
    \n-
    237}
    \n-
    238
    \n-
    239
    \n-
    240
    \n-
    241}} // namespace Dune::Functions
    \n-
    242
    \n-
    243
    \n-
    244
    \n-
    245#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH
    \n-\n-\n-\n-\n-\n-\n-
    TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
    Obtain derivative of TrigonometricFunction function.
    Definition: trigonometricfunction.hh:39
    \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.
    Definition: analyticgridviewfunction.hh:230
    \n+
    236#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH
    \n+
    constexpr FlatLexicographic flatLexicographic()
    Creates a lexicographic merging of direct children without blocking.
    Definition: basistags.hh:188
    \n+
    constexpr BlockedInterleaved blockedInterleaved()
    Creates an interleaved merging of direct children with blocking (i.e. creating blocks at the leaves c...
    Definition: basistags.hh:218
    \n+
    constexpr FlatInterleaved flatInterleaved()
    Creates an interleaved merging of direct children without blocking.
    Definition: basistags.hh:198
    \n+
    constexpr BlockedLexicographic blockedLexicographic()
    Creates a lexicographic merging of direct children with blocking (i.e. creating one block per direct ...
    Definition: basistags.hh:208
    \n
    Definition: polynomial.hh:10
    \n-
    Definition: differentiablefunction.hh:29
    \n-
    Helper class to deduce the signature of a callable.
    Definition: signature.hh:56
    \n-
    Definition: analyticgridviewfunction.hh:138
    \n-
    Range operator()(const Domain &x) const
    Evaluate the wrapped function f directly in global coordinates x.
    Definition: analyticgridviewfunction.hh:178
    \n-
    typename EntitySet::LocalCoordinate LocalDomain
    Definition: analyticgridviewfunction.hh:167
    \n-
    friend Derivative derivative(const AnalyticGridViewFunction &t)
    Create a derivative grid-function by wrapping the derivative of f.
    Definition: analyticgridviewfunction.hh:184
    \n-
    typename Element::Geometry Geometry
    Definition: analyticgridviewfunction.hh:157
    \n-
    typename EntitySet::Element Element
    Definition: analyticgridviewfunction.hh:156
    \n-\n-
    decltype(Imp::derivativeIfImplemented< DerivativeDummy, F >(std::declval< F >())) GlobalRawDerivative
    Definition: analyticgridviewfunction.hh:164
    \n-
    Range(Domain) Signature
    Definition: analyticgridviewfunction.hh:150
    \n-
    AnalyticGridViewFunction(FT &&f, const GridView &gridView)
    Create the grid-function by wrapping a function f and create a GridViewEntitySet.
    Definition: analyticgridviewfunction.hh:172
    \n-
    friend LocalFunction localFunction(const AnalyticGridViewFunction &t)
    Construct the associated local-function.
    Definition: analyticgridviewfunction.hh:190
    \n-
    typename Imp::LocalAnalyticGridViewFunction< Range(LocalDomain), GridView, F, LocalDerivativeTraits< EntitySet, DerivativeTraits >::template Traits > LocalFunction
    Definition: analyticgridviewfunction.hh:168
    \n-
    typename SignatureTraits< Signature >::RawSignature RawSignature
    Definition: analyticgridviewfunction.hh:151
    \n-
    const EntitySet & entitySet() const
    Return the set of entities this local-function can be bound to.
    Definition: analyticgridviewfunction.hh:196
    \n-
    typename DerivativeTraits< RawSignature >::Range(Domain) DerivativeSignature
    Definition: analyticgridviewfunction.hh:152
    \n-\n-
    GridView::template Codim< codim >::Entity Element
    Type of Elements contained in this EntitySet.
    Definition: gridviewentityset.hh:32
    \n-
    Element::Geometry::LocalCoordinate LocalCoordinate
    Type of local coordinates with respect to the Element.
    Definition: gridviewentityset.hh:35
    \n-
    Derivative traits for local functions.
    Definition: localderivativetraits.hh:28
    \n+
    static constexpr bool isIndexMergingStrategy()
    Definition: basistags.hh:23
    \n+
    void registerIndexMergingStrategy(IndexMergingStrategy)
    \n+\n+
    auto require(T &&t) -> decltype(registerIndexMergingStrategy(t))
    \n+
    Base class for index merging strategies to simplify detection.
    Definition: basistags.hh:44
    \n+
    Lexicographic merging of direct children without blocking.
    Definition: basistags.hh:80
    \n+
    Interleaved merging of direct children without blocking.
    Definition: basistags.hh:114
    \n+
    Lexicographic merging of direct children with blocking (i.e. creating one block per direct child).
    Definition: basistags.hh:148
    \n+
    Interleaved merging of direct children with blocking (i.e. creating blocks at the leaves containing o...
    Definition: basistags.hh:180
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,326 +4,150 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * gridfunctions\n-analyticgridviewfunction.hh\n+ * functionspacebases\n+basistags.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH\n- 4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH\n 5\n 6#include \n- 7#include \n+ 7#include \n 8\n- 9#include \n- 10\n- 11#include \n- 12#include \n- 13#include \n- 14#include \n- 15#include \n- 16#include \n- 17\n- 18\n- 19namespace Dune {\n- 20namespace Functions {\n+ 9namespace Dune {\n+ 10namespace Functions {\n+ 11\n+ 12 namespace Concept {\n+ 13\n+14 struct IndexMergingStrategy\n+ 15 {\n+ 16 template\n+17 auto require(T&& t) -> decltype(\n+ 18 registerIndexMergingStrategy(t)\n+ 19 );\n+ 20 };\n 21\n- 22namespace Imp {\n- 23\n- 24template class\n-DerivativeTraits=DefaultDerivativeTraits>\n- 25class LocalAnalyticGridViewFunction;\n- 26\n- 27template\n-class DerivativeTraits>\n- 28class LocalAnalyticGridViewFunction\n- 29{\n- 30public:\n- 31 using Signature = Range(LocalDomain);\n- 32 using RawSignature = typename SignatureTraits::RawSignature;\n- 33 using DerivativeSignature = typename DerivativeTraits::Range\n-(LocalDomain);\n- 34\n- 35 using GridView = GV;\n- 36 using EntitySet = GridViewEntitySet;\n- 37 using Element = typename EntitySet::Element;\n- 38// using Geometry = typename Element::Geometry;\n- 39 using Geometry = typename std::decay::type;\n- 40\n- 41 // Use the indirection via derivativeIfImplemented to also support\n- 42 // function types F that do not implement derivative. In this case\n- 43 // the interface type DifferentiableFunction is using a dummy for\n- 44 // the derivative type\n- 45 using DerivativeDummy = DifferentiableFunction;\n- 46 using GlobalRawDerivative = decltype(Imp::\n-derivativeIfImplemented(std::declval()));\n- 47 using LocalDerivative = LocalAnalyticGridViewFunction;\n- 48\n- 50 template = 0>\n- 51 LocalAnalyticGridViewFunction(FT&& f) :\n- 52 f_(std::forward(f))\n- 53 {}\n- 54\n- 56 template\n- 57 LocalAnalyticGridViewFunction(FT&& f, const Element& element, const std::\n-optional& geometry) :\n- 58 f_(std::forward(f)),\n- 59 element_(element),\n- 60 geometry_(geometry)\n- 61 {}\n- 62\n- 63\n- 72 void bind(const Element& element)\n- 73 {\n- 74 element_ = element;\n- 75 geometry_.emplace(element_.geometry());\n- 76 }\n- 77\n- 79 void unbind()\n- 80 {\n- 81 geometry_.reset();\n- 82 }\n- 83\n- 86 bool bound() const\n- 87 {\n- 88 return static_cast(geometry_);\n- 89 }\n- 90\n- 100 Range operator()(const LocalDomain& x) const\n- 101 {\n- 102 assert(!!geometry_);\n- 103 return f_(geometry_->global(x));\n- 104 }\n- 105\n- 107 const Element& localContext() const\n- 108 {\n- 109 assert(!!geometry_);\n- 110 return element_;\n- 111 }\n- 112\n- 121 friend LocalDerivative derivative(const LocalAnalyticGridViewFunction& t)\n- 122 {\n- 123 return LocalDerivative(Imp::derivativeIfImplemented\n-(t.f_), t.element_, t.geometry_);\n- 124 }\n- 125\n- 126private:\n- 127 F f_;\n- 128 Element element_;\n- 129 std::optional geometry_ = std::nullopt;\n- 130};\n- 131\n- 132} // end namespace Imp\n- 133\n- 134\n- 135\n- 136\n- 137template class\n-DerivativeTraits=DefaultDerivativeTraits>\n-138class AnalyticGridViewFunction;\n- 139\n- 140\n- 146template\n-class DerivativeTraits>\n-147class AnalyticGridViewFunction\n- 148{\n- 149public:\n-150 using Signature = Range(Domain);\n-151 using RawSignature = typename SignatureTraits::RawSignature;\n-152 using DerivativeSignature = typename DerivativeTraits::Range\n-(Domain);\n- 153\n-154 using GridView = GV;\n-155 using EntitySet = GridViewEntitySet;\n-156 using Element = typename EntitySet::Element;\n-157 using Geometry = typename Element::Geometry;\n- 158\n- 159 // Use the indirection via derivativeIfImplemented to also support\n- 160 // function types F that do not implement derivative. In this case\n- 161 // the interface type DifferentiableFunction is used a dummy for\n- 162 // the derivative type\n-163 using DerivativeDummy = DifferentiableFunction;\n-164 using GlobalRawDerivative = decltype(Imp::\n-derivativeIfImplemented(std::declval()));\n-165 using Derivative = AnalyticGridViewFunction;\n- 166\n-167 using LocalDomain = typename EntitySet::LocalCoordinate;\n-168 using LocalFunction = typename Imp::LocalAnalyticGridViewFunction::template Traits>;\n- 169\n- 171 template\n-172 AnalyticGridViewFunction(FT&& f, const GridView& gridView) :\n- 173 f_(std::forward(f)),\n- 174 entitySet_(gridView)\n- 175 {}\n- 176\n-178 Range operator()(const Domain& x) const\n- 179 {\n- 180 return f_(x);\n- 181 }\n+ 22 template\n+23 static constexpr bool isIndexMergingStrategy()\n+ 24 {\n+ 25 return models();\n+ 26 }\n+ 27\n+ 28 template\n+29 static constexpr bool isIndexMergingStrategy(T&& t)\n+ 30 {\n+ 31 return models>();\n+ 32 }\n+ 33\n+ 34 } // namespace Concept\n+ 35\n+ 36\n+37namespace BasisFactory {\n+ 38\n+44 struct IndexMergingStrategy {};\n+ 45\n+46 void registerIndexMergingStrategy(IndexMergingStrategy);\n+ 47\n+78 struct FlatLexicographic\n+ 79 : public IndexMergingStrategy\n+ 80 {};\n+ 81\n+112 struct FlatInterleaved\n+ 113 : public IndexMergingStrategy\n+ 114 {};\n+ 115\n+146 struct BlockedLexicographic\n+ 147 : public IndexMergingStrategy\n+ 148 {};\n+ 149\n+180 struct BlockedInterleaved : public IndexMergingStrategy {};\n+ 181\n 182\n-184 friend Derivative derivative(const AnalyticGridViewFunction& t)\n- 185 {\n- 186 return Derivative(Imp::derivativeIfImplemented(t.f_),\n-t.entitySet_.gridView());\n- 187 }\n- 188\n-190 friend LocalFunction localFunction(const AnalyticGridViewFunction& t)\n- 191 {\n- 192 return LocalFunction(t.f_);\n- 193 }\n- 194\n-196 const EntitySet& entitySet() const\n- 197 {\n- 198 return entitySet_;\n- 199 }\n- 200\n- 201private:\n- 202 F f_;\n- 203 EntitySet entitySet_;\n- 204};\n- 205\n- 206\n- 207\n- 224template\n- 225AnalyticGridViewFunction<\n- 226 typename std::invoke_result::\n-Geometry::GlobalCoordinate>::type // Range\n- 227 (typename GridView::template Codim<0>::Geometry::GlobalCoordinate), /\n-/ Domain\n- 228 GridView,\n- 229 typename std::decay::type > // Raw type of F (without & or &&)\n-230 makeAnalyticGridViewFunction(F&& f, const GridView& gridView)\n- 231{\n- 232 using Domain = typename GridView::template Codim<0>::Geometry::\n-GlobalCoordinate;\n- 233 using Range = typename std::invoke_result::type;\n- 234 using FRaw = typename std::decay::type;\n+188 constexpr FlatLexicographic flatLexicographic()\n+ 189 {\n+ 190 return {};\n+ 191 }\n+ 192\n+198 constexpr FlatInterleaved flatInterleaved()\n+ 199 {\n+ 200 return {};\n+ 201 }\n+ 202\n+208 constexpr BlockedLexicographic blockedLexicographic()\n+ 209 {\n+ 210 return {};\n+ 211 }\n+ 212\n+218 constexpr BlockedInterleaved blockedInterleaved()\n+ 219 {\n+ 220 return {};\n+ 221 }\n+ 222\n+ 223} // end namespace BasisFactory\n+ 224\n+ 225// Backward compatibility\n+226namespace BasisBuilder {\n+ 227\n+ 228 using namespace BasisFactory;\n+ 229\n+ 230}\n+ 231\n+ 232} // end namespace Functions\n+ 233} // end namespace Dune\n+ 234\n 235\n- 236 return AnalyticGridViewFunction(std::\n-forward(f), gridView);\n- 237}\n- 238\n- 239\n- 240\n- 241}} // namespace Dune::Functions\n- 242\n- 243\n- 244\n- 245#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH\n-differentiablefunction_imp.hh\n-signature.hh\n-defaultderivativetraits.hh\n-differentiablefunction.hh\n-gridviewentityset.hh\n-localderivativetraits.hh\n-Dune::Functions::derivative\n-TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const\n-TrigonometricFunction< K, sinFactor, cosFactor > &f)\n-Obtain derivative of TrigonometricFunction function.\n-Definition: trigonometricfunction.hh:39\n-Dune::Functions::AnalyticGridViewFunction::makeAnalyticGridViewFunction\n-AnalyticGridViewFunction< typename std::invoke_result< F, typename GridView::\n-template Codim< 0 >::Geometry::GlobalCoordinate >::type(typename GridView::\n-template Codim< 0 >::Geometry::GlobalCoordinate), GridView, typename std::\n-decay< F >::type > makeAnalyticGridViewFunction(F &&f, const GridView\n-&gridView)\n-Create an AnalyticGridViewFunction from a function and a grid view.\n-Definition: analyticgridviewfunction.hh:230\n+ 236#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH\n+Dune::Functions::BasisFactory::flatLexicographic\n+constexpr FlatLexicographic flatLexicographic()\n+Creates a lexicographic merging of direct children without blocking.\n+Definition: basistags.hh:188\n+Dune::Functions::BasisFactory::blockedInterleaved\n+constexpr BlockedInterleaved blockedInterleaved()\n+Creates an interleaved merging of direct children with blocking (i.e. creating\n+blocks at the leaves c...\n+Definition: basistags.hh:218\n+Dune::Functions::BasisFactory::flatInterleaved\n+constexpr FlatInterleaved flatInterleaved()\n+Creates an interleaved merging of direct children without blocking.\n+Definition: basistags.hh:198\n+Dune::Functions::BasisFactory::blockedLexicographic\n+constexpr BlockedLexicographic blockedLexicographic()\n+Creates a lexicographic merging of direct children with blocking (i.e. creating\n+one block per direct ...\n+Definition: basistags.hh:208\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::DifferentiableFunction\n-Definition: differentiablefunction.hh:29\n-Dune::Functions::SignatureTraits\n-Helper class to deduce the signature of a callable.\n-Definition: signature.hh:56\n-Dune::Functions::AnalyticGridViewFunction\n-Definition: analyticgridviewfunction.hh:138\n-Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n-DerivativeTraits_>::operator()\n-Range operator()(const Domain &x) const\n-Evaluate the wrapped function f directly in global coordinates x.\n-Definition: analyticgridviewfunction.hh:178\n-Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n-DerivativeTraits_>::LocalDomain\n-typename EntitySet::LocalCoordinate LocalDomain\n-Definition: analyticgridviewfunction.hh:167\n-Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n-DerivativeTraits_>::derivative\n-friend Derivative derivative(const AnalyticGridViewFunction &t)\n-Create a derivative grid-function by wrapping the derivative of f.\n-Definition: analyticgridviewfunction.hh:184\n-Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n-DerivativeTraits_>::Geometry\n-typename Element::Geometry Geometry\n-Definition: analyticgridviewfunction.hh:157\n-Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n-DerivativeTraits_>::Element\n-typename EntitySet::Element Element\n-Definition: analyticgridviewfunction.hh:156\n-Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n-DerivativeTraits_>::GridView\n-GV GridView\n-Definition: analyticgridviewfunction.hh:154\n-Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n-DerivativeTraits_>::GlobalRawDerivative\n-decltype(Imp::derivativeIfImplemented< DerivativeDummy, F >(std::declval< F >\n-())) GlobalRawDerivative\n-Definition: analyticgridviewfunction.hh:164\n-Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n-DerivativeTraits_>::Signature\n-Range(Domain) Signature\n-Definition: analyticgridviewfunction.hh:150\n-Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n-DerivativeTraits_>::AnalyticGridViewFunction\n-AnalyticGridViewFunction(FT &&f, const GridView &gridView)\n-Create the grid-function by wrapping a function f and create a\n-GridViewEntitySet.\n-Definition: analyticgridviewfunction.hh:172\n-Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n-DerivativeTraits_>::localFunction\n-friend LocalFunction localFunction(const AnalyticGridViewFunction &t)\n-Construct the associated local-function.\n-Definition: analyticgridviewfunction.hh:190\n-Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n-DerivativeTraits_>::LocalFunction\n-typename Imp::LocalAnalyticGridViewFunction< Range(LocalDomain), GridView, F,\n-LocalDerivativeTraits< EntitySet, DerivativeTraits >::template Traits >\n-LocalFunction\n-Definition: analyticgridviewfunction.hh:168\n-Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n-DerivativeTraits_>::RawSignature\n-typename SignatureTraits< Signature >::RawSignature RawSignature\n-Definition: analyticgridviewfunction.hh:151\n-Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n-DerivativeTraits_>::entitySet\n-const EntitySet & entitySet() const\n-Return the set of entities this local-function can be bound to.\n-Definition: analyticgridviewfunction.hh:196\n-Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n-DerivativeTraits_>::DerivativeSignature\n-typename DerivativeTraits< RawSignature >::Range(Domain) DerivativeSignature\n-Definition: analyticgridviewfunction.hh:152\n-Dune::Functions::GridViewEntitySet<_GridView,_0_>\n-Dune::Functions::GridViewEntitySet<_GridView,_0_>::Element\n-GridView::template Codim< codim >::Entity Element\n-Type of Elements contained in this EntitySet.\n-Definition: gridviewentityset.hh:32\n-Dune::Functions::GridViewEntitySet<_GridView,_0_>::LocalCoordinate\n-Element::Geometry::LocalCoordinate LocalCoordinate\n-Type of local coordinates with respect to the Element.\n-Definition: gridviewentityset.hh:35\n-Dune::Functions::LocalDerivativeTraits\n-Derivative traits for local functions.\n-Definition: localderivativetraits.hh:28\n+Dune::Functions::Concept::isIndexMergingStrategy\n+static constexpr bool isIndexMergingStrategy()\n+Definition: basistags.hh:23\n+Dune::Functions::BasisFactory::registerIndexMergingStrategy\n+void registerIndexMergingStrategy(IndexMergingStrategy)\n+Dune::Functions::Concept::IndexMergingStrategy\n+Definition: basistags.hh:15\n+Dune::Functions::Concept::IndexMergingStrategy::require\n+auto require(T &&t) -> decltype(registerIndexMergingStrategy(t))\n+Dune::Functions::BasisFactory::IndexMergingStrategy\n+Base class for index merging strategies to simplify detection.\n+Definition: basistags.hh:44\n+Dune::Functions::BasisFactory::FlatLexicographic\n+Lexicographic merging of direct children without blocking.\n+Definition: basistags.hh:80\n+Dune::Functions::BasisFactory::FlatInterleaved\n+Interleaved merging of direct children without blocking.\n+Definition: basistags.hh:114\n+Dune::Functions::BasisFactory::BlockedLexicographic\n+Lexicographic merging of direct children with blocking (i.e. creating one block\n+per direct child).\n+Definition: basistags.hh:148\n+Dune::Functions::BasisFactory::BlockedInterleaved\n+Interleaved merging of direct children with blocking (i.e. creating blocks at\n+the leaves containing o...\n+Definition: basistags.hh:180\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00095.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00095.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: gridviewfunction.hh File Reference\n+dune-functions: flatvectorview.hh File Reference\n \n \n \n \n \n \n \n@@ -58,58 +58,53 @@\n \n \n \n \n \n
    \n \n-
    gridviewfunction.hh File Reference
    \n+
    flatvectorview.hh File Reference
    \n
    \n
    \n-
    #include <memory>
    \n+
    #include <array>
    \n #include <dune/common/concept.hh>
    \n-#include <dune/functions/gridfunctions/gridfunction.hh>
    \n-#include <dune/functions/gridfunctions/gridviewentityset.hh>
    \n-#include <dune/functions/gridfunctions/analyticgridviewfunction.hh>
    \n+#include <dune/common/hybridutilities.hh>
    \n+#include <dune/common/indices.hh>
    \n+#include <dune/functions/functionspacebases/concepts.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n-\n-\n-\n-\n-\n-\n-

    \n-Classes

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n \n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n

    \n 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. More...
     
    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. More...
     
    template<class T >
    auto Dune::Functions::flatVectorView (T &t)
     Create flat vector view of passed mutable container. More...
     
    template<class T >
    auto Dune::Functions::flatVectorView (const T &t)
     Create flat vector view of passed const container. More...
     
    template<class T >
    auto Dune::Functions::flatVectorView (T &&t)
     Create flat vector view of passed container temporary. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,49 +4,37 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * gridfunctions\n-Classes | Namespaces | Functions\n-gridviewfunction.hh File Reference\n-#include \n+ * functionspacebases\n+Namespaces | Functions\n+flatvectorview.hh File Reference\n+#include \n #include \n-#include \n-#include \n-#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n- Classes\n-class \u00a0Dune::Functions::GridViewFunction<_Signature,_GridView,\n- DerivativeTraits,_bufferSize_>\n-\u00a0\n-class \u00a0Dune::Functions::GridViewFunction<_Range(Domain),_GV,_DerivativeTraits,\n- bufferSize_>\n-\u00a0 Wrapper class for functions defined on a GridView. More...\n-\u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n Functions\n-template(), int >::type = 0>\n-std::decay< F >::type\u00a0Dune::Functions::makeGridViewFunction (F &&f, const\n- GridView &gridView)\n-\u00a0 Construct a function modeling GridViewFunction from\n- function and grid view. More...\n-\u00a0\n-template()), int >::type = 0>\n- auto\u00a0Dune::Functions::makeGridViewFunction (F &&f, const\n- GridView &gridView) -> decltype\n- (makeAnalyticGridViewFunction(std::forward< F >(f),\n- gridView))\n-\u00a0 Construct a function modeling GridViewFunction from\n- function and grid view. More...\n+template\n+auto\u00a0Dune::Functions::flatVectorView (T &t)\n+\u00a0 Create flat vector view of passed mutable container. More...\n+\u00a0\n+template\n+auto\u00a0Dune::Functions::flatVectorView (const T &t)\n+\u00a0 Create flat vector view of passed const container. More...\n+\u00a0\n+template\n+auto\u00a0Dune::Functions::flatVectorView (T &&t)\n+\u00a0 Create flat vector view of passed container temporary. More...\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00095_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00095_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: gridviewfunction.hh Source File\n+dune-functions: flatvectorview.hh Source File\n \n \n \n \n \n \n \n@@ -58,95 +58,213 @@\n \n
    \n \n \n \n
    \n-
    gridviewfunction.hh
    \n+
    flatvectorview.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
    \n-
    4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH
    \n
    5
    \n-
    6#include <memory>
    \n-
    7
    \n-
    8#include <dune/common/concept.hh>
    \n-
    9
    \n-\n-\n-\n-
    13
    \n+
    6
    \n+
    7#include <array>
    \n+
    8
    \n+
    9#include <dune/common/concept.hh>
    \n+
    10#include <dune/common/hybridutilities.hh>
    \n+
    11#include <dune/common/indices.hh>
    \n+
    12
    \n+\n
    14
    \n-
    15namespace Dune {
    \n-
    16namespace Functions {
    \n+
    15
    \n+
    16
    \n
    17
    \n-
    18
    \n-
    19
    \n-
    20template<class Signature, class GridView, template<class> class DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>
    \n-\n-
    22{};
    \n-
    23
    \n-
    24
    \n-
    25
    \n-
    40template<class Range, class Domain, class GV, template<class> class DerivativeTraits, size_t bufferSize>
    \n-
    41class GridViewFunction<Range(Domain), GV, DerivativeTraits, bufferSize> :
    \n-
    42 public GridFunction<Range(Domain), GridViewEntitySet<GV, 0>, DerivativeTraits, bufferSize>
    \n-
    43{
    \n-
    44 using Base = GridFunction<Range(Domain), GridViewEntitySet<GV, 0>, DerivativeTraits, bufferSize>;
    \n-
    45public:
    \n-
    46 using GridView = GV;
    \n+
    18namespace Dune {
    \n+
    19namespace Functions {
    \n+
    20namespace Impl {
    \n+
    21
    \n+
    22
    \n+
    23template<class V>
    \n+
    24struct FlatVectorBackend
    \n+
    25{
    \n+
    26
    \n+
    27 template<class VV, class Index,
    \n+
    28 typename std::enable_if< models<Concept::HasIndexAccess, VV, Index>(), int>::type = 0>
    \n+
    29 static decltype(auto) getEntry(VV&& v, const Index& i)
    \n+
    30 {
    \n+
    31 return v[i];
    \n+
    32 }
    \n+
    33
    \n+
    34 template<class VV, class Index,
    \n+
    35 typename std::enable_if< not models<Concept::HasIndexAccess, VV, Index>(), int>::type = 0>
    \n+
    36 static decltype(auto) getEntry(VV&& v, const Index&)
    \n+
    37 {
    \n+
    38 return std::forward<VV>(v);
    \n+
    39 }
    \n+
    40
    \n+
    41 template<class VV,
    \n+
    42 typename std::enable_if< models<Concept::HasSizeMethod, VV>(), int>::type = 0>
    \n+
    43 static auto size(VV&& v)
    \n+
    44 {
    \n+
    45 return Dune::Hybrid::size(v);
    \n+
    46 }
    \n
    47
    \n-
    48 using Base::Base;
    \n-
    49};
    \n-
    50
    \n-
    51
    \n-
    52
    \n-
    64template<class F, class GridView,
    \n-
    65 typename std::enable_if<
    \n-
    66 models< Imp::HasFreeLocalFunction, F>() , int>::type = 0>
    \n-
    67typename std::decay<F>::type
    \n-
    68 makeGridViewFunction(F&& f, const GridView& gridView)
    \n-
    69{
    \n-
    70 return std::forward<F>(f);
    \n-
    71}
    \n-
    72
    \n-
    73
    \n-
    74
    \n-
    90template<class F, class GridView,
    \n-
    91 typename std::enable_if<
    \n-
    92 not(models< Imp::HasFreeLocalFunction, F>()) , int>::type = 0>
    \n-
    93auto makeGridViewFunction(F&& f, const GridView& gridView)
    \n-
    94 -> decltype(makeAnalyticGridViewFunction(std::forward<F>(f), gridView))
    \n-
    95{
    \n-
    96 return makeAnalyticGridViewFunction(std::forward<F>(f), gridView);
    \n-
    97}
    \n+
    48 template<class VV,
    \n+
    49 typename std::enable_if< not models<Concept::HasSizeMethod, VV>(), int>::type = 0>
    \n+
    50 static auto size(VV&&)
    \n+
    51 {
    \n+
    52 return Dune::index_constant<1>{};
    \n+
    53 }
    \n+
    54};
    \n+
    55
    \n+
    56
    \n+
    57
    \n+
    58
    \n+
    59template<class K, int n, int m>
    \n+
    60struct FlatVectorBackend<typename Dune::FieldMatrix<K, n, m> >
    \n+
    61{
    \n+
    62
    \n+
    63 template<class VV, class Index>
    \n+
    64 static decltype(auto) getEntry(VV&& v, const Index& i)
    \n+
    65 {
    \n+
    66 return v[i/m][i%m];
    \n+
    67 }
    \n+
    68
    \n+
    69 template<class VV>
    \n+
    70 static auto size(VV&& v)
    \n+
    71 {
    \n+
    72 return Dune::index_constant<n*m>{};
    \n+
    73 }
    \n+
    74};
    \n+
    75
    \n+
    76
    \n+
    77
    \n+
    78template<class K, std::size_t n>
    \n+
    79struct FlatVectorBackend< std::array<K, n> >
    \n+
    80{
    \n+
    81
    \n+
    82 template<class VV, class Index>
    \n+
    83 static decltype(auto) getEntry(VV&& v, const Index& i)
    \n+
    84 {
    \n+
    85 const auto innerSize = decltype(FlatVectorBackend<K>::size(v[0]))::value;
    \n+
    86 return FlatVectorBackend<K>::getEntry(v[i/innerSize], i%innerSize);
    \n+
    87 }
    \n+
    88
    \n+
    89 template<class VV>
    \n+
    90 static auto size(VV&& v)
    \n+
    91 {
    \n+
    92 const auto innerSize = decltype(FlatVectorBackend<K>::size(v[0]))::value;
    \n+
    93 return Dune::index_constant<n*innerSize>{};
    \n+
    94 }
    \n+
    95
    \n+
    96};
    \n+
    97
    \n
    98
    \n
    99
    \n
    100
    \n-
    101} // end of namespace Dune::Functions
    \n-
    102} // end of namespace Dune
    \n-
    103
    \n-
    104#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
    \n-\n-\n-\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.
    Definition: analyticgridviewfunction.hh:230
    \n+
    101template<class T>
    \n+
    102class FlatVectorView
    \n+
    103{
    \n+
    104 using Backend = FlatVectorBackend<std::decay_t<T>>;
    \n+
    105public:
    \n+
    106 FlatVectorView(T& t) :
    \n+
    107 t_(&t)
    \n+
    108 {}
    \n+
    109
    \n+
    110 auto size() const
    \n+
    111 {
    \n+
    112 return Backend::size(*t_);
    \n+
    113 }
    \n+
    114
    \n+
    115 template<class Index>
    \n+
    116 decltype(auto) operator[](const Index& i) const
    \n+
    117 {
    \n+
    118 return Backend::getEntry(*t_, i);
    \n+
    119 }
    \n+
    120
    \n+
    121 template<class Index>
    \n+
    122 decltype(auto) operator[](const Index& i)
    \n+
    123 {
    \n+
    124 return Backend::getEntry(*t_, i);
    \n+
    125 }
    \n+
    126
    \n+
    127private:
    \n+
    128 T* t_;
    \n+
    129};
    \n+
    130
    \n+
    131
    \n+
    132template<class T>
    \n+
    133class FlatVectorView<T&&>
    \n+
    134{
    \n+
    135 using Backend = FlatVectorBackend<std::decay_t<T>>;
    \n+
    136public:
    \n+
    137 FlatVectorView(T&& t) :
    \n+
    138 t_(std::move(t))
    \n+
    139 {}
    \n+
    140
    \n+
    141 auto size() const
    \n+
    142 {
    \n+
    143 return Backend::size(t_);
    \n+
    144 }
    \n+
    145
    \n+
    146 template<class Index>
    \n+
    147 decltype(auto) operator[](const Index& i) const
    \n+
    148 {
    \n+
    149 return Backend::getEntry(t_, i);
    \n+
    150 }
    \n+
    151
    \n+
    152 template<class Index>
    \n+
    153 decltype(auto) operator[](const Index& i)
    \n+
    154 {
    \n+
    155 return Backend::getEntry(t_, i);
    \n+
    156 }
    \n+
    157
    \n+
    158private:
    \n+
    159 T t_;
    \n+
    160};
    \n+
    161
    \n+
    162} // namespace Impl
    \n+
    163
    \n+
    164
    \n+
    165
    \n+
    178template<class T>
    \n+\n+
    180{
    \n+
    181 return Impl::FlatVectorView<T>(t);
    \n+
    182}
    \n+
    183
    \n+
    196template<class T>
    \n+
    197auto flatVectorView(const T& t)
    \n+
    198{
    \n+
    199 return Impl::FlatVectorView<const T>(t);
    \n+
    200}
    \n+
    201
    \n+
    214template<class T>
    \n+
    215auto flatVectorView(T&& t)
    \n+
    216{
    \n+
    217 return Impl::FlatVectorView<T&&>(std::move(t));
    \n+
    218}
    \n+
    219
    \n+
    220
    \n+
    221} // namespace Dune::Functions
    \n+
    222} // namespace Dune
    \n+
    223
    \n+
    224
    \n+
    225#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH
    \n
    Definition: polynomial.hh:10
    \n-
    std::decay< F >::type makeGridViewFunction(F &&f, const GridView &gridView)
    Construct a function modeling GridViewFunction from function and grid view.
    Definition: gridviewfunction.hh:68
    \n-
    Definition: gridfunction.hh:32
    \n-
    An entity set for all entities of given codim in a grid view.
    Definition: gridviewentityset.hh:23
    \n-
    Definition: gridviewfunction.hh:22
    \n-\n+
    auto flatVectorView(T &t)
    Create flat vector view of passed mutable container.
    Definition: flatvectorview.hh:179
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,109 +4,213 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * gridfunctions\n-gridviewfunction.hh\n+ * functionspacebases\n+flatvectorview.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH\n- 4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH\n 5\n- 6#include \n- 7\n- 8#include \n- 9\n- 10#include \n- 11#include \n- 12#include \n- 13\n+ 6\n+ 7#include \n+ 8\n+ 9#include \n+ 10#include \n+ 11#include \n+ 12\n+ 13#include \n 14\n- 15namespace Dune {\n- 16namespace Functions {\n+ 15\n+ 16\n 17\n- 18\n- 19\n- 20template class\n-DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>\n-21class GridViewFunction\n- 22{};\n- 23\n- 24\n- 25\n- 40template class\n-DerivativeTraits, size_t bufferSize>\n-41class GridViewFunction :\n- 42 public GridFunction,\n-DerivativeTraits, bufferSize>\n- 43{\n- 44 using Base = GridFunction,\n-DerivativeTraits, bufferSize>;\n- 45public:\n-46 using GridView = GV;\n+ 18namespace Dune {\n+ 19namespace Functions {\n+ 20namespace Impl {\n+ 21\n+ 22\n+ 23template\n+ 24struct FlatVectorBackend\n+ 25{\n+ 26\n+ 27 template(),\n+int>::type = 0>\n+ 29 static decltype(auto) getEntry(VV&& v, const Index& i)\n+ 30 {\n+ 31 return v[i];\n+ 32 }\n+ 33\n+ 34 template(),\n+int>::type = 0>\n+ 36 static decltype(auto) getEntry(VV&& v, const Index&)\n+ 37 {\n+ 38 return std::forward(v);\n+ 39 }\n+ 40\n+ 41 template(), int>::type =\n+0>\n+ 43 static auto size(VV&& v)\n+ 44 {\n+ 45 return Dune::Hybrid::size(v);\n+ 46 }\n 47\n- 48 using Base::Base;\n- 49};\n- 50\n- 51\n- 52\n- 64template() , int>::type = 0>\n- 67typename std::decay::type\n-68 makeGridViewFunction(F&& f, const GridView& gridView)\n- 69{\n- 70 return std::forward(f);\n- 71}\n- 72\n- 73\n- 74\n- 90template()) , int>::type = 0>\n-93auto makeGridViewFunction(F&& f, const GridView& gridView)\n- 94 -> decltype(makeAnalyticGridViewFunction(std::forward(f), gridView))\n- 95{\n- 96 return makeAnalyticGridViewFunction(std::forward(f), gridView);\n- 97}\n+ 48 template(), int>::\n+type = 0>\n+ 50 static auto size(VV&&)\n+ 51 {\n+ 52 return Dune::index_constant<1>{};\n+ 53 }\n+ 54};\n+ 55\n+ 56\n+ 57\n+ 58\n+ 59template\n+ 60struct FlatVectorBackend >\n+ 61{\n+ 62\n+ 63 template\n+ 64 static decltype(auto) getEntry(VV&& v, const Index& i)\n+ 65 {\n+ 66 return v[i/m][i%m];\n+ 67 }\n+ 68\n+ 69 template\n+ 70 static auto size(VV&& v)\n+ 71 {\n+ 72 return Dune::index_constant{};\n+ 73 }\n+ 74};\n+ 75\n+ 76\n+ 77\n+ 78template\n+ 79struct FlatVectorBackend< std::array >\n+ 80{\n+ 81\n+ 82 template\n+ 83 static decltype(auto) getEntry(VV&& v, const Index& i)\n+ 84 {\n+ 85 const auto innerSize = decltype(FlatVectorBackend::size(v[0]))::value;\n+ 86 return FlatVectorBackend::getEntry(v[i/innerSize], i%innerSize);\n+ 87 }\n+ 88\n+ 89 template\n+ 90 static auto size(VV&& v)\n+ 91 {\n+ 92 const auto innerSize = decltype(FlatVectorBackend::size(v[0]))::value;\n+ 93 return Dune::index_constant{};\n+ 94 }\n+ 95\n+ 96};\n+ 97\n 98\n 99\n 100\n- 101} // end of namespace Dune::Functions\n- 102} // end of namespace Dune\n- 103\n- 104#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH\n-gridviewentityset.hh\n-analyticgridviewfunction.hh\n-gridfunction.hh\n-Dune::Functions::makeAnalyticGridViewFunction\n-AnalyticGridViewFunction< typename std::invoke_result< F, typename GridView::\n-template Codim< 0 >::Geometry::GlobalCoordinate >::type(typename GridView::\n-template Codim< 0 >::Geometry::GlobalCoordinate), GridView, typename std::\n-decay< F >::type > makeAnalyticGridViewFunction(F &&f, const GridView\n-&gridView)\n-Create an AnalyticGridViewFunction from a function and a grid view.\n-Definition: analyticgridviewfunction.hh:230\n+ 101template\n+ 102class FlatVectorView\n+ 103{\n+ 104 using Backend = FlatVectorBackend>;\n+ 105public:\n+ 106 FlatVectorView(T& t) :\n+ 107 t_(&t)\n+ 108 {}\n+ 109\n+ 110 auto size() const\n+ 111 {\n+ 112 return Backend::size(*t_);\n+ 113 }\n+ 114\n+ 115 template\n+ 116 decltype(auto) operator[](const Index& i) const\n+ 117 {\n+ 118 return Backend::getEntry(*t_, i);\n+ 119 }\n+ 120\n+ 121 template\n+ 122 decltype(auto) operator[](const Index& i)\n+ 123 {\n+ 124 return Backend::getEntry(*t_, i);\n+ 125 }\n+ 126\n+ 127private:\n+ 128 T* t_;\n+ 129};\n+ 130\n+ 131\n+ 132template\n+ 133class FlatVectorView\n+ 134{\n+ 135 using Backend = FlatVectorBackend>;\n+ 136public:\n+ 137 FlatVectorView(T&& t) :\n+ 138 t_(std::move(t))\n+ 139 {}\n+ 140\n+ 141 auto size() const\n+ 142 {\n+ 143 return Backend::size(t_);\n+ 144 }\n+ 145\n+ 146 template\n+ 147 decltype(auto) operator[](const Index& i) const\n+ 148 {\n+ 149 return Backend::getEntry(t_, i);\n+ 150 }\n+ 151\n+ 152 template\n+ 153 decltype(auto) operator[](const Index& i)\n+ 154 {\n+ 155 return Backend::getEntry(t_, i);\n+ 156 }\n+ 157\n+ 158private:\n+ 159 T t_;\n+ 160};\n+ 161\n+ 162} // namespace Impl\n+ 163\n+ 164\n+ 165\n+ 178template\n+179auto flatVectorView(T& t)\n+ 180{\n+ 181 return Impl::FlatVectorView(t);\n+ 182}\n+ 183\n+ 196template\n+197auto flatVectorView(const T& t)\n+ 198{\n+ 199 return Impl::FlatVectorView(t);\n+ 200}\n+ 201\n+ 214template\n+215auto flatVectorView(T&& t)\n+ 216{\n+ 217 return Impl::FlatVectorView(std::move(t));\n+ 218}\n+ 219\n+ 220\n+ 221} // namespace Dune::Functions\n+ 222} // namespace Dune\n+ 223\n+ 224\n+ 225#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::makeGridViewFunction\n-std::decay< F >::type makeGridViewFunction(F &&f, const GridView &gridView)\n-Construct a function modeling GridViewFunction from function and grid view.\n-Definition: gridviewfunction.hh:68\n-Dune::Functions::GridFunction\n-Definition: gridfunction.hh:32\n-Dune::Functions::GridViewEntitySet\n-An entity set for all entities of given codim in a grid view.\n-Definition: gridviewentityset.hh:23\n-Dune::Functions::GridViewFunction\n-Definition: gridviewfunction.hh:22\n-Dune::Functions::GridViewFunction<_Range(Domain),_GV,_DerivativeTraits,\n-bufferSize_>::GridView\n-GV GridView\n-Definition: gridviewfunction.hh:46\n+Dune::Functions::flatVectorView\n+auto flatVectorView(T &t)\n+Create flat vector view of passed mutable container.\n+Definition: flatvectorview.hh:179\n+concepts.hh\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00098.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00098.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: gridfunction.hh File Reference\n+dune-functions: brezzidouglasmarinibasis.hh File Reference\n \n \n \n \n \n \n \n@@ -58,50 +58,71 @@\n \n \n \n \n \n
    \n \n-
    gridfunction.hh File Reference
    \n+Namespaces |\n+Typedefs |\n+Functions
    \n+
    brezzidouglasmarinibasis.hh File Reference
    \n \n
    \n-
    #include <type_traits>
    \n-#include <dune/common/typeutilities.hh>
    \n-#include <dune/functions/common/typeerasure.hh>
    \n-#include <dune/functions/common/defaultderivativetraits.hh>
    \n-#include <dune/functions/common/differentiablefunction.hh>
    \n-#include <dune/functions/common/localfunction.hh>
    \n-#include <dune/functions/common/functionconcepts.hh>
    \n-#include <dune/functions/gridfunctions/localderivativetraits.hh>
    \n-#include <dune/functions/gridfunctions/gridfunction_imp.hh>
    \n+
    #include <array>
    \n+#include <dune/common/exceptions.hh>
    \n+#include <dune/geometry/referenceelements.hh>
    \n+#include <dune/localfunctions/common/virtualinterface.hh>
    \n+#include <dune/localfunctions/common/virtualwrappers.hh>
    \n+#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1cube2d.hh>
    \n+#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1cube3d.hh>
    \n+#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1simplex2d.hh>
    \n+#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini2cube2d.hh>
    \n+#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini2simplex2d.hh>
    \n+#include <dune/functions/functionspacebases/globalvaluedlocalfiniteelement.hh>
    \n+#include <dune/functions/functionspacebases/nodes.hh>
    \n+#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n+\n \n-\n-\n+\n \n

    \n Classes

    class  Dune::Functions::GridFunction< Signature, EntitySet, DerivativeTraits, bufferSize >
    class  Dune::Functions::BrezziDouglasMariniPreBasis< GV, k >
     
    class  Dune::Functions::GridFunction< Range(Domain), ES, DerivativeTraits, bufferSize >
     Wrapper class for functions defined on a Grid. More...
    class  Dune::Functions::BrezziDouglasMariniNode< GV, k >
     
    \n \n \n \n \n \n+\n+\n+

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    namespace  Dune::Functions::BasisFactory
     
    \n+\n+\n+\n+\n+\n+

    \n+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. More...
     
    \n+\n+\n+\n+\n+\n

    \n+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. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,36 +4,57 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * gridfunctions\n-Classes | Namespaces\n-gridfunction.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+ * functionspacebases\n+Classes | Namespaces | Typedefs | Functions\n+brezzidouglasmarinibasis.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::GridFunction<_Signature,_EntitySet,_DerivativeTraits,\n- bufferSize_>\n+class \u00a0Dune::Functions::BrezziDouglasMariniPreBasis<_GV,_k_>\n \u00a0\n-class \u00a0Dune::Functions::GridFunction<_Range(Domain),_ES,_DerivativeTraits,\n- bufferSize_>\n-\u00a0 Wrapper class for functions defined on a Grid. More...\n+class \u00a0Dune::Functions::BrezziDouglasMariniNode<_GV,_k_>\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n+namespace \u00a0Dune::Functions::BasisFactory\n+\u00a0\n+ Typedefs\n+template\n+using\u00a0Dune::Functions::BrezziDouglasMariniBasis = DefaultGlobalBasis<\n+ BrezziDouglasMariniPreBasis< GV, k > >\n+\u00a0 Basis of a scalar k-th-order BDM finite element space on simplex and\n+ cube grids. More...\n+\u00a0\n+ Functions\n+template\n+auto\u00a0Dune::Functions::BasisFactory::brezziDouglasMarini ()\n+\u00a0 Create a pre-basis factory that can create a Brezzi-Douglas-Marini pre-\n+ basis. More...\n+\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00098_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00098_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: gridfunction.hh Source File\n+dune-functions: brezzidouglasmarinibasis.hh Source File\n \n \n \n \n \n \n \n@@ -58,165 +58,393 @@\n \n
    \n \n \n \n
    \n-
    gridfunction.hh
    \n+
    brezzidouglasmarinibasis.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH
    \n-
    4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_HH
    \n
    5
    \n-
    6#include <type_traits>
    \n-
    7
    \n-
    8#include <dune/common/typeutilities.hh>
    \n+
    6#include <array>
    \n+
    7#include <dune/common/exceptions.hh>
    \n+
    8#include <dune/geometry/referenceelements.hh>
    \n
    9
    \n-\n-\n-\n-\n-\n-\n-\n-
    17
    \n+
    10#include <dune/localfunctions/common/virtualinterface.hh>
    \n+
    11#include <dune/localfunctions/common/virtualwrappers.hh>
    \n+
    12
    \n+
    13#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1cube2d.hh>
    \n+
    14#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1cube3d.hh>
    \n+
    15#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1simplex2d.hh>
    \n+
    16#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini2cube2d.hh>
    \n+
    17#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini2simplex2d.hh>
    \n
    18
    \n-
    19
    \n-
    20namespace Dune {
    \n-
    21namespace Functions {
    \n+\n+\n+\n
    22
    \n-
    23
    \n-
    24
    \n-
    25/*
    \n-
    26 * Default implementation is empty
    \n-
    27 * The actual implementation is only given if Signature is an type
    \n-
    28 * describing a function signature as Range(Domain).
    \n-
    29 */
    \n-
    30template<class Signature, class EntitySet, template<class> class DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>
    \n-\n-
    32{};
    \n+
    23namespace Dune {
    \n+
    24namespace Functions {
    \n+
    25
    \n+
    26namespace Impl {
    \n+
    27
    \n+
    28 template<int dim, typename D, typename R, std::size_t k>
    \n+
    29 struct BDMSimplexLocalInfo
    \n+
    30 {
    \n+
    31 static_assert((AlwaysFalse<D>::value),"The requested type of BDM element is not implemented, sorry!");
    \n+
    32 };
    \n
    33
    \n-
    34
    \n-
    35
    \n-
    36namespace Imp
    \n-
    37{
    \n-
    38
    \n-
    40 template<class S, class ES, template<class> class DerivativeTraits, size_t bufferSize>
    \n-
    41 struct GridFunctionTraits :
    \n-
    42 DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>
    \n+
    34 template<typename D, typename R>
    \n+
    35 struct BDMSimplexLocalInfo<2,D,R,1>
    \n+
    36 {
    \n+
    37 using FiniteElement = BDM1Simplex2DLocalFiniteElement<D,R>;
    \n+
    38 static const std::size_t Variants = 8;
    \n+
    39 };
    \n+
    40
    \n+
    41 template<typename D, typename R>
    \n+
    42 struct BDMSimplexLocalInfo<2,D,R,2>
    \n
    43 {
    \n-
    44 protected:
    \n-
    45 using Base=DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>;
    \n-
    46
    \n-
    47 public:
    \n-
    49 using EntitySet = ES;
    \n-
    50
    \n-
    52 using Element = typename EntitySet::Element;
    \n+
    44 using FiniteElement = BDM2Simplex2DLocalFiniteElement<D,R>;
    \n+
    45 static const std::size_t Variants = 8;
    \n+
    46 };
    \n+
    47
    \n+
    48 template<int dim, typename D, typename R, std::size_t k>
    \n+
    49 struct BDMCubeLocalInfo
    \n+
    50 {
    \n+
    51 static_assert((AlwaysFalse<D>::value),"The requested type of BDM element is not implemented, sorry!");
    \n+
    52 };
    \n
    53
    \n-
    55 using DerivativeSignature = typename Base::DerivativeSignature;
    \n-
    56
    \n-\n-
    59
    \n-
    61 using LocalSignature = typename Base::Range(typename EntitySet::LocalCoordinate);
    \n-
    62
    \n-
    64 template<class R>
    \n-\n-
    66
    \n-
    68 using LocalFunctionTraits = typename Dune::Functions::Imp::LocalFunctionTraits<LocalSignature, Element, LocalDerivativeTraits, bufferSize>;
    \n-
    69
    \n-\n-
    72
    \n-
    74 using Concept = GridFunctionWrapperInterface<S, DerivativeInterface, LocalFunctionInterface, ES>;
    \n-
    75
    \n-
    77 template<class B>
    \n-
    78 using Model = GridFunctionWrapperImplementation<S, DerivativeInterface, LocalFunctionInterface, ES, B>;
    \n-
    79 };
    \n-
    80}
    \n+
    54 template<typename D, typename R>
    \n+
    55 struct BDMCubeLocalInfo<2,D,R,1>
    \n+
    56 {
    \n+
    57 using FiniteElement = BDM1Cube2DLocalFiniteElement<D,R>;
    \n+
    58 static const std::size_t Variants = 16;
    \n+
    59 };
    \n+
    60
    \n+
    61 template<typename D, typename R>
    \n+
    62 struct BDMCubeLocalInfo<2,D,R,2>
    \n+
    63 {
    \n+
    64 using FiniteElement = BDM2Cube2DLocalFiniteElement<D,R>;
    \n+
    65 static const std::size_t Variants = 16;
    \n+
    66 };
    \n+
    67
    \n+
    68 template<typename D, typename R>
    \n+
    69 struct BDMCubeLocalInfo<3,D,R,1>
    \n+
    70 {
    \n+
    71 using FiniteElement = BDM1Cube3DLocalFiniteElement<D,R>;
    \n+
    72 static const std::size_t Variants = 64;
    \n+
    73 };
    \n+
    74
    \n+
    75 template<typename GV, int dim, typename R, std::size_t k>
    \n+
    76 class BDMLocalFiniteElementMap
    \n+
    77 {
    \n+
    78 using D = typename GV::ctype;
    \n+
    79 using CubeFiniteElement = typename BDMCubeLocalInfo<dim, D, R, k>::FiniteElement;
    \n+
    80 using SimplexFiniteElement = typename BDMSimplexLocalInfo<dim, D, R, k>::FiniteElement;
    \n
    81
    \n-
    82
    \n+
    82 public:
    \n
    83
    \n-
    95template<class Range, class Domain, class ES, template<class> class DerivativeTraits, size_t bufferSize>
    \n-
    96class GridFunction<Range(Domain), ES, DerivativeTraits, bufferSize> :
    \n-
    97 public TypeErasureBase<
    \n-
    98 typename Imp::GridFunctionTraits<Range(Domain), ES, DerivativeTraits, bufferSize>::Concept,
    \n-
    99 Imp::GridFunctionTraits<Range(Domain), ES, DerivativeTraits, bufferSize>::template Model>
    \n-
    100{
    \n-
    101 using Traits = Imp::GridFunctionTraits<Range(Domain), ES, DerivativeTraits, bufferSize>;
    \n-
    102
    \n-\n-
    104
    \n-
    105 using DerivativeInterface = typename Traits::DerivativeInterface;
    \n+
    84 using T = LocalBasisTraits<D, dim, FieldVector<D,dim>, R, dim, FieldVector<R,dim>, FieldMatrix<D,dim,dim> >;
    \n+
    85 using FiniteElement = LocalFiniteElementVirtualInterface<T>;
    \n+
    86
    \n+
    87 BDMLocalFiniteElementMap(const GV& gv)
    \n+
    88 : is_(&(gv.indexSet())), orient_(gv.size(0))
    \n+
    89 {
    \n+
    90 cubeVariant_.resize(BDMCubeLocalInfo<dim, D, R, k>::Variants);
    \n+
    91 simplexVariant_.resize(BDMSimplexLocalInfo<dim, D, R, k>::Variants);
    \n+
    92
    \n+
    93 // create all variants
    \n+
    94 for (size_t i = 0; i < cubeVariant_.size(); i++)
    \n+
    95 cubeVariant_[i] = std::make_unique<LocalFiniteElementVirtualImp<CubeFiniteElement> >(CubeFiniteElement(i));
    \n+
    96
    \n+
    97 for (size_t i = 0; i < simplexVariant_.size(); i++)
    \n+
    98 simplexVariant_[i] = std::make_unique<LocalFiniteElementVirtualImp<SimplexFiniteElement> >(SimplexFiniteElement(i));
    \n+
    99
    \n+
    100 // compute orientation for all elements
    \n+
    101 // loop once over the grid
    \n+
    102 for(const auto& cell : elements(gv))
    \n+
    103 {
    \n+
    104 unsigned int myId = is_->index(cell);
    \n+
    105 orient_[myId] = 0;
    \n
    106
    \n-
    107 using LocalFunctionInterface = typename Traits::LocalFunctionInterface;
    \n-
    108
    \n-
    109 using EntitySet = typename Traits::EntitySet;
    \n-
    110
    \n-
    111public:
    \n-
    112
    \n-
    124 template<class F, disableCopyMove<GridFunction, F> = 0 >
    \n-\n-
    126 Base(std::forward<F>(f))
    \n-
    127 {
    \n-
    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");
    \n-
    129 }
    \n-
    130
    \n-
    131 GridFunction() = default;
    \n+
    107 for (const auto& intersection : intersections(gv,cell))
    \n+
    108 {
    \n+
    109 if (intersection.neighbor() && (is_->index(intersection.outside()) > myId))
    \n+
    110 orient_[myId] |= (1 << intersection.indexInInside());
    \n+
    111 }
    \n+
    112 }
    \n+
    113 }
    \n+
    114
    \n+
    116 template<class EntityType>
    \n+
    117 const FiniteElement& find(const EntityType& e) const
    \n+
    118 {
    \n+
    119 if (e.type().isCube())
    \n+
    120 return *cubeVariant_[orient_[is_->index(e)]];
    \n+
    121 else
    \n+
    122 return *simplexVariant_[orient_[is_->index(e)]];
    \n+
    123 }
    \n+
    124
    \n+
    125 private:
    \n+
    126 std::vector<std::unique_ptr<LocalFiniteElementVirtualImp<CubeFiniteElement> > > cubeVariant_;
    \n+
    127 std::vector<std::unique_ptr<LocalFiniteElementVirtualImp<SimplexFiniteElement> > > simplexVariant_;
    \n+
    128 const typename GV::IndexSet* is_;
    \n+
    129 std::vector<unsigned char> orient_;
    \n+
    130 };
    \n+
    131
    \n
    132
    \n-
    138 Range operator() (const Domain& x) const
    \n-
    139 {
    \n-
    140 return this->asInterface().operator()(x);
    \n-
    141 }
    \n-
    142
    \n-
    151 friend DerivativeInterface derivative(const GridFunction& t)
    \n-
    152 {
    \n-
    153 return t.asInterface().derivative();
    \n-
    154 }
    \n+
    133} // namespace Impl
    \n+
    134
    \n+
    135
    \n+
    136// *****************************************************************************
    \n+
    137// This is the reusable part of the basis. It contains
    \n+
    138//
    \n+
    139// BrezziDouglasMariniPreBasis
    \n+
    140// BrezziDouglasMariniNode
    \n+
    141//
    \n+
    142// The pre-basis allows to create the others and is the owner of possible shared
    \n+
    143// state. These components do _not_ depend on the global basis and local view
    \n+
    144// and can be used without a global basis.
    \n+
    145// *****************************************************************************
    \n+
    146
    \n+
    147template<typename GV, int k>
    \n+
    148class BrezziDouglasMariniNode;
    \n+
    149
    \n+
    150template<typename GV, int k>
    \n+\n+
    152{
    \n+
    153 static const int dim = GV::dimension;
    \n+
    154 using FiniteElementMap = typename Impl::BDMLocalFiniteElementMap<GV, dim, double, k>;
    \n
    155
    \n-
    165 friend LocalFunctionInterface localFunction(const GridFunction& t)
    \n-
    166 {
    \n-
    167 return t.asInterface().wrappedLocalFunction();
    \n-
    168 }
    \n-
    169
    \n-
    176 const EntitySet& entitySet() const
    \n-
    177 {
    \n-
    178 return this->asInterface().wrappedEntitySet();
    \n-
    179 }
    \n-
    180};
    \n-
    181
    \n-
    182
    \n-
    183
    \n-
    184}} // namespace Dune::Functions
    \n+
    156public:
    \n+
    157
    \n+
    159 using GridView = GV;
    \n+
    160 using size_type = std::size_t;
    \n+
    161
    \n+\n+
    163
    \n+
    164 static constexpr size_type maxMultiIndexSize = 1;
    \n+
    165 static constexpr size_type minMultiIndexSize = 1;
    \n+
    166 static constexpr size_type multiIndexBufferSize = 1;
    \n+
    167
    \n+\n+
    170 gridView_(gv),
    \n+\n+
    172 {
    \n+
    173 // There is no inherent reason why the basis shouldn't work for grids with more than one
    \n+
    174 // element types. Somebody simply has to sit down and implement the missing bits.
    \n+
    175 if (gv.indexSet().types(0).size() > 1)
    \n+
    176 DUNE_THROW(Dune::NotImplemented, "Brezzi-Douglas-Marini basis is only implemented for grids with a single element type");
    \n+
    177 }
    \n+
    178
    \n+\n+
    180 {
    \n+
    181 codimOffset_[0] = 0;
    \n+
    182 codimOffset_[1] = codimOffset_[0] + dofsPerCodim_[0] * gridView_.size(0);
    \n+
    183 //if (dim==3) codimOffset_[2] = codimOffset_[1] + dofsPerCodim[1] * gridView_.size(1);
    \n+
    184 }
    \n
    185
    \n-
    186
    \n-
    187
    \n-
    188#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH
    \n-\n-\n-\n-\n-\n-\n-\n+
    188 const GridView& gridView() const
    \n+
    189 {
    \n+
    190 return gridView_;
    \n+
    191 }
    \n+
    192
    \n+
    193 /* \\brief Update the stored grid view, to be called if the grid has changed */
    \n+
    194 void update (const GridView& gv)
    \n+
    195 {
    \n+
    196 gridView_ = gv;
    \n+
    197 }
    \n+
    198
    \n+\n+
    203 {
    \n+
    204 return Node{&finiteElementMap_};
    \n+
    205 }
    \n+
    206
    \n+\n+
    208 {
    \n+
    209 return dofsPerCodim_[0] * gridView_.size(0) + dofsPerCodim_[1] * gridView_.size(1); // only 2d
    \n+
    210 }
    \n+
    211
    \n+
    213 template<class SizePrefix>
    \n+
    214 size_type size(const SizePrefix prefix) const
    \n+
    215 {
    \n+
    216 assert(prefix.size() == 0 || prefix.size() == 1);
    \n+
    217 return (prefix.size() == 0) ? size() : 0;
    \n+
    218 }
    \n+
    219
    \n+\n+
    222 {
    \n+
    223 return size();
    \n+
    224 }
    \n+
    225
    \n+\n+
    227 {
    \n+
    228 // The implementation currently only supports grids with a single element type.
    \n+
    229 // We can therefore return the actual number of dofs here.
    \n+
    230 GeometryType elementType = *(gridView_.indexSet().types(0).begin());
    \n+
    231 size_t numFaces = ReferenceElements<double,dim>::general(elementType).size(1);
    \n+
    232 return dofsPerCodim_[0] + dofsPerCodim_[1] * numFaces;
    \n+
    233 }
    \n+
    234
    \n+
    240 template<typename It>
    \n+
    241 It indices(const Node& node, It it) const
    \n+
    242 {
    \n+
    243 const auto& gridIndexSet = gridView().indexSet();
    \n+
    244 const auto& element = node.element();
    \n+
    245
    \n+
    246 // throw if element is not of predefined type
    \n+
    247 if (not(element.type().isCube()) and not(element.type().isSimplex()))
    \n+
    248 DUNE_THROW(Dune::NotImplemented, "BrezziDouglasMariniBasis only implemented for cube and simplex elements.");
    \n+
    249
    \n+
    250 for(std::size_t i=0, end=node.size(); i<end; ++i, ++it)
    \n+
    251 {
    \n+
    252 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
    \n+
    253
    \n+
    254 // The dimension of the entity that the current dof is related to
    \n+
    255 size_t subentity = localKey.subEntity();
    \n+
    256 size_t codim = localKey.codim();
    \n+
    257
    \n+
    258 *it = { codimOffset_[codim] +
    \n+
    259 dofsPerCodim_[codim] * gridIndexSet.subIndex(element, subentity, codim) + localKey.index() };
    \n+
    260 }
    \n+
    261
    \n+
    262 return it;
    \n+
    263 }
    \n+
    264
    \n+
    265protected:
    \n+\n+
    267 std::array<size_t,dim+1> codimOffset_;
    \n+
    268 FiniteElementMap finiteElementMap_;
    \n+
    269 // Number of dofs per entity type depending on the entity's codimension and type
    \n+
    270 std::array<int,2> dofsPerCodim_ {{dim*(k-1)*3, dim+(k-1)}};
    \n+
    271};
    \n+
    272
    \n+
    273
    \n+
    274
    \n+
    275template<typename GV, int k>
    \n+\n+
    277 public LeafBasisNode
    \n+
    278{
    \n+
    279 static const int dim = GV::dimension;
    \n+
    280
    \n+
    281public:
    \n+
    282
    \n+
    283 using size_type = std::size_t;
    \n+
    284 using Element = typename GV::template Codim<0>::Entity;
    \n+
    285 using FiniteElementMap = typename Impl::BDMLocalFiniteElementMap<GV, dim, double, k>;
    \n+
    286 using FiniteElement = Impl::GlobalValuedLocalFiniteElement<Impl::ContravariantPiolaTransformator,
    \n+
    287 typename FiniteElementMap::FiniteElement,
    \n+
    288 Element>;
    \n+
    289
    \n+
    290 BrezziDouglasMariniNode(const FiniteElementMap* finiteElementMap) :
    \n+
    291 element_(nullptr),
    \n+
    292 finiteElementMap_(finiteElementMap)
    \n+
    293 {}
    \n+
    294
    \n+
    296 const Element& element() const
    \n+
    297 {
    \n+
    298 return *element_;
    \n+
    299 }
    \n+
    300
    \n+\n+
    306 {
    \n+
    307 return finiteElement_;
    \n+
    308 }
    \n+
    309
    \n+
    311 void bind(const Element& e)
    \n+
    312 {
    \n+
    313 element_ = &e;
    \n+
    314 finiteElement_.bind((finiteElementMap_->find(*element_)), e);
    \n+
    315 this->setSize(finiteElement_.size());
    \n+
    316 }
    \n+
    317
    \n+
    318protected:
    \n+
    319
    \n+\n+\n+\n+
    323};
    \n+
    324
    \n+
    325
    \n+
    326
    \n+
    327namespace BasisFactory {
    \n+
    328
    \n+
    336template<std::size_t k>
    \n+\n+
    338{
    \n+
    339 return [](const auto& gridView) {
    \n+
    340 return BrezziDouglasMariniPreBasis<std::decay_t<decltype(gridView)>, k>(gridView);
    \n+
    341 };
    \n+
    342}
    \n+
    343
    \n+
    344} // end namespace BasisFactory
    \n+
    345
    \n+
    346
    \n+
    347
    \n+
    348// *****************************************************************************
    \n+
    349// This is the actual global basis implementation based on the reusable parts.
    \n+
    350// *****************************************************************************
    \n+
    351
    \n+
    359template<typename GV, int k>
    \n+\n+
    361
    \n+
    362} // end namespace Functions
    \n+
    363} // end namespace Dune
    \n+
    364
    \n+
    365
    \n+
    366#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_HH
    \n+\n+\n+\n+
    auto brezziDouglasMarini()
    Create a pre-basis factory that can create a Brezzi-Douglas-Marini pre-basis.
    Definition: brezzidouglasmarinibasis.hh:337
    \n
    Definition: polynomial.hh:10
    \n-
    Definition: localfunction.hh:30
    \n-
    Base class for type-erased interface wrapper.
    Definition: typeerasure.hh:165
    \n-
    Definition: gridfunction.hh:32
    \n-
    friend DerivativeInterface derivative(const GridFunction &t)
    Get derivative of wrapped function.
    Definition: gridfunction.hh:151
    \n-\n-
    const EntitySet & entitySet() const
    Get associated EntitySet.
    Definition: gridfunction.hh:176
    \n-
    GridFunction(F &&f)
    Construct from function.
    Definition: gridfunction.hh:125
    \n-
    friend LocalFunctionInterface localFunction(const GridFunction &t)
    Get local function of wrapped function.
    Definition: gridfunction.hh:165
    \n-
    Derivative traits for local functions.
    Definition: localderivativetraits.hh:28
    \n+
    Definition: brezzidouglasmarinibasis.hh:278
    \n+
    const FiniteElement & finiteElement() const
    Return the LocalFiniteElement for the element we are bound to.
    Definition: brezzidouglasmarinibasis.hh:305
    \n+
    typename GV::template Codim< 0 >::Entity Element
    Definition: brezzidouglasmarinibasis.hh:284
    \n+
    const FiniteElementMap * finiteElementMap_
    Definition: brezzidouglasmarinibasis.hh:322
    \n+
    std::size_t size_type
    Definition: brezzidouglasmarinibasis.hh:283
    \n+
    FiniteElement finiteElement_
    Definition: brezzidouglasmarinibasis.hh:320
    \n+
    typename Impl::BDMLocalFiniteElementMap< GV, dim, double, k > FiniteElementMap
    Definition: brezzidouglasmarinibasis.hh:285
    \n+
    const Element * element_
    Definition: brezzidouglasmarinibasis.hh:321
    \n+
    Impl::GlobalValuedLocalFiniteElement< Impl::ContravariantPiolaTransformator, typename FiniteElementMap::FiniteElement, Element > FiniteElement
    Definition: brezzidouglasmarinibasis.hh:288
    \n+
    void bind(const Element &e)
    Bind to element.
    Definition: brezzidouglasmarinibasis.hh:311
    \n+
    BrezziDouglasMariniNode(const FiniteElementMap *finiteElementMap)
    Definition: brezzidouglasmarinibasis.hh:290
    \n+
    const Element & element() const
    Return current element, throw if unbound.
    Definition: brezzidouglasmarinibasis.hh:296
    \n+
    Definition: brezzidouglasmarinibasis.hh:152
    \n+
    std::size_t size_type
    Definition: brezzidouglasmarinibasis.hh:160
    \n+
    std::array< int, 2 > dofsPerCodim_
    Definition: brezzidouglasmarinibasis.hh:270
    \n+
    size_type dimension() const
    Definition: brezzidouglasmarinibasis.hh:221
    \n+
    static constexpr size_type minMultiIndexSize
    Definition: brezzidouglasmarinibasis.hh:165
    \n+
    static constexpr size_type maxMultiIndexSize
    Definition: brezzidouglasmarinibasis.hh:164
    \n+
    std::array< size_t, dim+1 > codimOffset_
    Definition: brezzidouglasmarinibasis.hh:267
    \n+
    size_type size(const SizePrefix prefix) const
    Return number possible values for next position in multi index.
    Definition: brezzidouglasmarinibasis.hh:214
    \n+
    Node makeNode() const
    Create tree node.
    Definition: brezzidouglasmarinibasis.hh:202
    \n+
    GV GridView
    The grid view that the FE space is defined on.
    Definition: brezzidouglasmarinibasis.hh:159
    \n+
    BrezziDouglasMariniPreBasis(const GridView &gv)
    Constructor for a given grid view object.
    Definition: brezzidouglasmarinibasis.hh:169
    \n+
    FiniteElementMap finiteElementMap_
    Definition: brezzidouglasmarinibasis.hh:268
    \n+
    void update(const GridView &gv)
    Definition: brezzidouglasmarinibasis.hh:194
    \n+
    void initializeIndices()
    Definition: brezzidouglasmarinibasis.hh:179
    \n+
    const GridView & gridView() const
    Obtain the grid view that the basis is defined on.
    Definition: brezzidouglasmarinibasis.hh:188
    \n+
    size_type size() const
    Definition: brezzidouglasmarinibasis.hh:207
    \n+
    static constexpr size_type multiIndexBufferSize
    Definition: brezzidouglasmarinibasis.hh:166
    \n+
    size_type maxNodeSize() const
    Definition: brezzidouglasmarinibasis.hh:226
    \n+
    GridView gridView_
    Definition: brezzidouglasmarinibasis.hh:266
    \n+
    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
    \n+
    Global basis for given pre-basis.
    Definition: defaultglobalbasis.hh:46
    \n+
    size_type size() const
    Definition: nodes.hh:142
    \n+
    void setSize(const size_type size)
    Definition: nodes.hh:164
    \n+
    Definition: nodes.hh:186
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,199 +4,512 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * gridfunctions\n-gridfunction.hh\n+ * functionspacebases\n+brezzidouglasmarinibasis.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH\n- 4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_HH\n 5\n- 6#include \n- 7\n- 8#include \n+ 6#include \n+ 7#include \n+ 8#include \n 9\n- 10#include \n- 11#include \n- 12#include \n- 13#include \n- 14#include \n- 15#include \n- 16#include \n- 17\n+ 10#include \n+ 11#include \n+ 12\n+ 13#include \n+ 14#include \n+ 15#include \n+ 16#include \n+ 17#include \n 18\n- 19\n- 20namespace Dune {\n- 21namespace Functions {\n+ 19#include \n+ 20#include \n+ 21#include \n 22\n- 23\n- 24\n- 25/*\n- 26 * Default implementation is empty\n- 27 * The actual implementation is only given if Signature is an type\n- 28 * describing a function signature as Range(Domain).\n- 29 */\n- 30template class\n-DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>\n-31class GridFunction\n- 32{};\n+ 23namespace Dune {\n+ 24namespace Functions {\n+ 25\n+ 26namespace Impl {\n+ 27\n+ 28 template\n+ 29 struct BDMSimplexLocalInfo\n+ 30 {\n+ 31 static_assert((AlwaysFalse::value),\"The requested type of BDM element is\n+not implemented, sorry!\");\n+ 32 };\n 33\n- 34\n- 35\n- 36namespace Imp\n- 37{\n- 38\n- 40 template class DerivativeTraits, size_t\n-bufferSize>\n- 41 struct GridFunctionTraits :\n- 42 DifferentiableFunctionTraits\n+ 34 template\n+ 35 struct BDMSimplexLocalInfo<2,D,R,1>\n+ 36 {\n+ 37 using FiniteElement = BDM1Simplex2DLocalFiniteElement;\n+ 38 static const std::size_t Variants = 8;\n+ 39 };\n+ 40\n+ 41 template\n+ 42 struct BDMSimplexLocalInfo<2,D,R,2>\n 43 {\n- 44 protected:\n- 45 using Base=DifferentiableFunctionTraits;\n- 46\n- 47 public:\n- 49 using EntitySet = ES;\n- 50\n- 52 using Element = typename EntitySet::Element;\n+ 44 using FiniteElement = BDM2Simplex2DLocalFiniteElement;\n+ 45 static const std::size_t Variants = 8;\n+ 46 };\n+ 47\n+ 48 template\n+ 49 struct BDMCubeLocalInfo\n+ 50 {\n+ 51 static_assert((AlwaysFalse::value),\"The requested type of BDM element is\n+not implemented, sorry!\");\n+ 52 };\n 53\n- 55 using DerivativeSignature = typename Base::DerivativeSignature;\n- 56\n- 58 using DerivativeInterface = GridFunction;\n- 59\n- 61 using LocalSignature = typename Base::Range(typename EntitySet::\n-LocalCoordinate);\n- 62\n- 64 template\n- 65 using LocalDerivativeTraits = typename Dune::Functions::\n-LocalDerivativeTraits::template Traits;\n- 66\n- 68 using LocalFunctionTraits = typename Dune::Functions::Imp::\n-LocalFunctionTraits;\n- 69\n- 71 using LocalFunctionInterface = LocalFunction;\n- 72\n- 74 using Concept = GridFunctionWrapperInterface;\n- 75\n- 77 template\n- 78 using Model = GridFunctionWrapperImplementation;\n- 79 };\n- 80}\n+ 54 template\n+ 55 struct BDMCubeLocalInfo<2,D,R,1>\n+ 56 {\n+ 57 using FiniteElement = BDM1Cube2DLocalFiniteElement;\n+ 58 static const std::size_t Variants = 16;\n+ 59 };\n+ 60\n+ 61 template\n+ 62 struct BDMCubeLocalInfo<2,D,R,2>\n+ 63 {\n+ 64 using FiniteElement = BDM2Cube2DLocalFiniteElement;\n+ 65 static const std::size_t Variants = 16;\n+ 66 };\n+ 67\n+ 68 template\n+ 69 struct BDMCubeLocalInfo<3,D,R,1>\n+ 70 {\n+ 71 using FiniteElement = BDM1Cube3DLocalFiniteElement;\n+ 72 static const std::size_t Variants = 64;\n+ 73 };\n+ 74\n+ 75 template\n+ 76 class BDMLocalFiniteElementMap\n+ 77 {\n+ 78 using D = typename GV::ctype;\n+ 79 using CubeFiniteElement = typename BDMCubeLocalInfo::\n+FiniteElement;\n+ 80 using SimplexFiniteElement = typename BDMSimplexLocalInfo::\n+FiniteElement;\n 81\n- 82\n+ 82 public:\n 83\n- 95template class\n-DerivativeTraits, size_t bufferSize>\n-96class GridFunction :\n- 97 public TypeErasureBase<\n- 98 typename Imp::GridFunctionTraits::Concept,\n- 99 Imp::GridFunctionTraits::\n-template Model>\n- 100{\n- 101 using Traits = Imp::GridFunctionTraits;\n- 102\n- 103 using Base = TypeErasureBase;\n- 104\n- 105 using DerivativeInterface = typename Traits::DerivativeInterface;\n+ 84 using T = LocalBasisTraits, R, dim,\n+FieldVector, FieldMatrix >;\n+ 85 using FiniteElement = LocalFiniteElementVirtualInterface;\n+ 86\n+ 87 BDMLocalFiniteElementMap(const GV& gv)\n+ 88 : is_(&(gv.indexSet())), orient_(gv.size(0))\n+ 89 {\n+ 90 cubeVariant_.resize(BDMCubeLocalInfo::Variants);\n+ 91 simplexVariant_.resize(BDMSimplexLocalInfo::Variants);\n+ 92\n+ 93 // create all variants\n+ 94 for (size_t i = 0; i < cubeVariant_.size(); i++)\n+ 95 cubeVariant_[i] = std::\n+make_unique >(CubeFiniteElement\n+(i));\n+ 96\n+ 97 for (size_t i = 0; i < simplexVariant_.size(); i++)\n+ 98 simplexVariant_[i] = std::\n+make_unique >\n+(SimplexFiniteElement(i));\n+ 99\n+ 100 // compute orientation for all elements\n+ 101 // loop once over the grid\n+ 102 for(const auto& cell : elements(gv))\n+ 103 {\n+ 104 unsigned int myId = is_->index(cell);\n+ 105 orient_[myId] = 0;\n 106\n- 107 using LocalFunctionInterface = typename Traits::LocalFunctionInterface;\n- 108\n- 109 using EntitySet = typename Traits::EntitySet;\n- 110\n- 111public:\n- 112\n- 124 template = 0 >\n-125 GridFunction(F&& f) :\n- 126 Base(std::forward(f))\n- 127 {\n- 128 static_assert(Dune::Functions::Concept::isGridFunction(), \"Trying to construct a GridFunction from type that does not model\n-the GridFunction concept\");\n- 129 }\n- 130\n-131 GridFunction() = default;\n+ 107 for (const auto& intersection : intersections(gv,cell))\n+ 108 {\n+ 109 if (intersection.neighbor() && (is_->index(intersection.outside()) >\n+myId))\n+ 110 orient_[myId] |= (1 << intersection.indexInInside());\n+ 111 }\n+ 112 }\n+ 113 }\n+ 114\n+ 116 template\n+ 117 const FiniteElement& find(const EntityType& e) const\n+ 118 {\n+ 119 if (e.type().isCube())\n+ 120 return *cubeVariant_[orient_[is_->index(e)]];\n+ 121 else\n+ 122 return *simplexVariant_[orient_[is_->index(e)]];\n+ 123 }\n+ 124\n+ 125 private:\n+ 126 std::vector > > cubeVariant_;\n+ 127 std::vector > >\n+simplexVariant_;\n+ 128 const typename GV::IndexSet* is_;\n+ 129 std::vector orient_;\n+ 130 };\n+ 131\n 132\n-138 Range operator() (const Domain& x) const\n- 139 {\n- 140 return this->asInterface().operator()(x);\n- 141 }\n- 142\n-151 friend DerivativeInterface derivative(const GridFunction& t)\n- 152 {\n- 153 return t.asInterface().derivative();\n- 154 }\n+ 133} // namespace Impl\n+ 134\n+ 135\n+ 136/\n+/ *****************************************************************************\n+ 137// This is the reusable part of the basis. It contains\n+ 138//\n+ 139// BrezziDouglasMariniPreBasis\n+ 140// BrezziDouglasMariniNode\n+ 141//\n+ 142// The pre-basis allows to create the others and is the owner of possible\n+shared\n+ 143// state. These components do _not_ depend on the global basis and local\n+view\n+ 144// and can be used without a global basis.\n+ 145/\n+/ *****************************************************************************\n+ 146\n+ 147template\n+ 148class BrezziDouglasMariniNode;\n+ 149\n+ 150template\n+151class BrezziDouglasMariniPreBasis\n+ 152{\n+ 153 static const int dim = GV::dimension;\n+ 154 using FiniteElementMap = typename Impl::BDMLocalFiniteElementMap;\n 155\n-165 friend LocalFunctionInterface localFunction(const GridFunction& t)\n- 166 {\n- 167 return t.asInterface().wrappedLocalFunction();\n- 168 }\n- 169\n-176 const EntitySet& entitySet() const\n- 177 {\n- 178 return this->asInterface().wrappedEntitySet();\n- 179 }\n- 180};\n- 181\n- 182\n- 183\n- 184}} // namespace Dune::Functions\n+ 156public:\n+ 157\n+159 using GridView = GV;\n+160 using size_type = std::size_t;\n+ 161\n+162 using Node = BrezziDouglasMariniNode;\n+ 163\n+164 static constexpr size_type maxMultiIndexSize = 1;\n+165 static constexpr size_type minMultiIndexSize = 1;\n+166 static constexpr size_type multiIndexBufferSize = 1;\n+ 167\n+169 BrezziDouglasMariniPreBasis(const GridView& gv) :\n+ 170 gridView_(gv),\n+ 171 finiteElementMap_(gv)\n+ 172 {\n+ 173 // There is no inherent reason why the basis shouldn't work for grids with\n+more than one\n+ 174 // element types. Somebody simply has to sit down and implement the\n+missing bits.\n+ 175 if (gv.indexSet().types(0).size() > 1)\n+ 176 DUNE_THROW(Dune::NotImplemented, \"Brezzi-Douglas-Marini basis is only\n+implemented for grids with a single element type\");\n+ 177 }\n+ 178\n+179 void initializeIndices()\n+ 180 {\n+ 181 codimOffset_[0] = 0;\n+ 182 codimOffset_[1] = codimOffset_[0] + dofsPerCodim_[0] * gridView_.size(0);\n+ 183 //if (dim==3) codimOffset_[2] = codimOffset_[1] + dofsPerCodim[1] *\n+gridView_.size(1);\n+ 184 }\n 185\n- 186\n- 187\n- 188#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH\n-typeerasure.hh\n-functionconcepts.hh\n-defaultderivativetraits.hh\n-differentiablefunction.hh\n-localfunction.hh\n-gridfunction_imp.hh\n-localderivativetraits.hh\n+188 const GridView& gridView() const\n+ 189 {\n+ 190 return gridView_;\n+ 191 }\n+ 192\n+ 193 /* \\brief Update the stored grid view, to be called if the grid has\n+changed */\n+194 void update (const GridView& gv)\n+ 195 {\n+ 196 gridView_ = gv;\n+ 197 }\n+ 198\n+202 Node makeNode() const\n+ 203 {\n+ 204 return Node{&finiteElementMap_};\n+ 205 }\n+ 206\n+207 size_type size() const\n+ 208 {\n+ 209 return dofsPerCodim_[0] * gridView_.size(0) + dofsPerCodim_[1] *\n+gridView_.size(1); // only 2d\n+ 210 }\n+ 211\n+ 213 template\n+214 size_type size(const SizePrefix prefix) const\n+ 215 {\n+ 216 assert(prefix.size() == 0 || prefix.size() == 1);\n+ 217 return (prefix.size() == 0) ? size() : 0;\n+ 218 }\n+ 219\n+221 size_type dimension() const\n+ 222 {\n+ 223 return size();\n+ 224 }\n+ 225\n+226 size_type maxNodeSize() const\n+ 227 {\n+ 228 // The implementation currently only supports grids with a single element\n+type.\n+ 229 // We can therefore return the actual number of dofs here.\n+ 230 GeometryType elementType = *(gridView_.indexSet().types(0).begin());\n+ 231 size_t numFaces = ReferenceElements::general(elementType).size\n+(1);\n+ 232 return dofsPerCodim_[0] + dofsPerCodim_[1] * numFaces;\n+ 233 }\n+ 234\n+ 240 template\n+241 It indices(const Node& node, It it) const\n+ 242 {\n+ 243 const auto& gridIndexSet = gridView().indexSet();\n+ 244 const auto& element = node.element();\n+ 245\n+ 246 // throw if element is not of predefined type\n+ 247 if (not(element.type().isCube()) and not(element.type().isSimplex()))\n+ 248 DUNE_THROW(Dune::NotImplemented, \"BrezziDouglasMariniBasis only\n+implemented for cube and simplex elements.\");\n+ 249\n+ 250 for(std::size_t i=0, end=node.size(); i codimOffset_;\n+268 FiniteElementMap finiteElementMap_;\n+ 269 // Number of dofs per entity type depending on the entity's codimension\n+and type\n+270 std::array dofsPerCodim_ {{dim*(k-1)*3, dim+(k-1)}};\n+ 271};\n+ 272\n+ 273\n+ 274\n+ 275template\n+276class BrezziDouglasMariniNode :\n+ 277 public LeafBasisNode\n+ 278{\n+ 279 static const int dim = GV::dimension;\n+ 280\n+ 281public:\n+ 282\n+283 using size_type = std::size_t;\n+284 using Element = typename GV::template Codim<0>::Entity;\n+285 using FiniteElementMap = typename Impl::BDMLocalFiniteElementMap;\n+286 using FiniteElement = Impl::GlobalValuedLocalFiniteElement;\n+ 289\n+290 BrezziDouglasMariniNode(const FiniteElementMap* finiteElementMap) :\n+ 291 element_(nullptr),\n+ 292 finiteElementMap_(finiteElementMap)\n+ 293 {}\n+ 294\n+296 const Element& element() const\n+ 297 {\n+ 298 return *element_;\n+ 299 }\n+ 300\n+305 const FiniteElement& finiteElement() const\n+ 306 {\n+ 307 return finiteElement_;\n+ 308 }\n+ 309\n+311 void bind(const Element& e)\n+ 312 {\n+ 313 element_ = &e;\n+ 314 finiteElement_.bind((finiteElementMap_->find(*element_)), e);\n+ 315 this->setSize(finiteElement_.size());\n+ 316 }\n+ 317\n+ 318protected:\n+ 319\n+320 FiniteElement finiteElement_;\n+321 const Element* element_;\n+322 const FiniteElementMap* finiteElementMap_;\n+ 323};\n+ 324\n+ 325\n+ 326\n+ 327namespace BasisFactory {\n+ 328\n+ 336template\n+337auto brezziDouglasMarini()\n+ 338{\n+ 339 return [](const auto& gridView) {\n+ 340 return BrezziDouglasMariniPreBasis, k>\n+(gridView);\n+ 341 };\n+ 342}\n+ 343\n+ 344} // end namespace BasisFactory\n+ 345\n+ 346\n+ 347\n+ 348/\n+/ *****************************************************************************\n+ 349// This is the actual global basis implementation based on the reusable\n+parts.\n+ 350/\n+/ *****************************************************************************\n+ 351\n+ 359template\n+360using BrezziDouglasMariniBasis =\n+DefaultGlobalBasis >;\n+ 361\n+ 362} // end namespace Functions\n+ 363} // end namespace Dune\n+ 364\n+ 365\n+ 366#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_HH\n+nodes.hh\n+defaultglobalbasis.hh\n+globalvaluedlocalfiniteelement.hh\n+Dune::Functions::BasisFactory::brezziDouglasMarini\n+auto brezziDouglasMarini()\n+Create a pre-basis factory that can create a Brezzi-Douglas-Marini pre-basis.\n+Definition: brezzidouglasmarinibasis.hh:337\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::LocalFunction\n-Definition: localfunction.hh:30\n-Dune::Functions::TypeErasureBase\n-Base class for type-erased interface wrapper.\n-Definition: typeerasure.hh:165\n-Dune::Functions::GridFunction\n-Definition: gridfunction.hh:32\n-Dune::Functions::GridFunction<_Range(Domain),_ES,_DerivativeTraits,_bufferSize\n->::derivative\n-friend DerivativeInterface derivative(const GridFunction &t)\n-Get derivative of wrapped function.\n-Definition: gridfunction.hh:151\n-Dune::Functions::GridFunction<_Range(Domain),_ES,_DerivativeTraits,_bufferSize\n->::GridFunction\n-GridFunction()=default\n-Dune::Functions::GridFunction<_Range(Domain),_ES,_DerivativeTraits,_bufferSize\n->::entitySet\n-const EntitySet & entitySet() const\n-Get associated EntitySet.\n-Definition: gridfunction.hh:176\n-Dune::Functions::GridFunction<_Range(Domain),_ES,_DerivativeTraits,_bufferSize\n->::GridFunction\n-GridFunction(F &&f)\n-Construct from function.\n-Definition: gridfunction.hh:125\n-Dune::Functions::GridFunction<_Range(Domain),_ES,_DerivativeTraits,_bufferSize\n->::localFunction\n-friend LocalFunctionInterface localFunction(const GridFunction &t)\n-Get local function of wrapped function.\n-Definition: gridfunction.hh:165\n-Dune::Functions::LocalDerivativeTraits\n-Derivative traits for local functions.\n-Definition: localderivativetraits.hh:28\n+Dune::Functions::BrezziDouglasMariniNode\n+Definition: brezzidouglasmarinibasis.hh:278\n+Dune::Functions::BrezziDouglasMariniNode::finiteElement\n+const FiniteElement & finiteElement() const\n+Return the LocalFiniteElement for the element we are bound to.\n+Definition: brezzidouglasmarinibasis.hh:305\n+Dune::Functions::BrezziDouglasMariniNode::Element\n+typename GV::template Codim< 0 >::Entity Element\n+Definition: brezzidouglasmarinibasis.hh:284\n+Dune::Functions::BrezziDouglasMariniNode::finiteElementMap_\n+const FiniteElementMap * finiteElementMap_\n+Definition: brezzidouglasmarinibasis.hh:322\n+Dune::Functions::BrezziDouglasMariniNode::size_type\n+std::size_t size_type\n+Definition: brezzidouglasmarinibasis.hh:283\n+Dune::Functions::BrezziDouglasMariniNode::finiteElement_\n+FiniteElement finiteElement_\n+Definition: brezzidouglasmarinibasis.hh:320\n+Dune::Functions::BrezziDouglasMariniNode::FiniteElementMap\n+typename Impl::BDMLocalFiniteElementMap< GV, dim, double, k > FiniteElementMap\n+Definition: brezzidouglasmarinibasis.hh:285\n+Dune::Functions::BrezziDouglasMariniNode::element_\n+const Element * element_\n+Definition: brezzidouglasmarinibasis.hh:321\n+Dune::Functions::BrezziDouglasMariniNode::FiniteElement\n+Impl::GlobalValuedLocalFiniteElement< Impl::ContravariantPiolaTransformator,\n+typename FiniteElementMap::FiniteElement, Element > FiniteElement\n+Definition: brezzidouglasmarinibasis.hh:288\n+Dune::Functions::BrezziDouglasMariniNode::bind\n+void bind(const Element &e)\n+Bind to element.\n+Definition: brezzidouglasmarinibasis.hh:311\n+Dune::Functions::BrezziDouglasMariniNode::BrezziDouglasMariniNode\n+BrezziDouglasMariniNode(const FiniteElementMap *finiteElementMap)\n+Definition: brezzidouglasmarinibasis.hh:290\n+Dune::Functions::BrezziDouglasMariniNode::element\n+const Element & element() const\n+Return current element, throw if unbound.\n+Definition: brezzidouglasmarinibasis.hh:296\n+Dune::Functions::BrezziDouglasMariniPreBasis\n+Definition: brezzidouglasmarinibasis.hh:152\n+Dune::Functions::BrezziDouglasMariniPreBasis::size_type\n+std::size_t size_type\n+Definition: brezzidouglasmarinibasis.hh:160\n+Dune::Functions::BrezziDouglasMariniPreBasis::dofsPerCodim_\n+std::array< int, 2 > dofsPerCodim_\n+Definition: brezzidouglasmarinibasis.hh:270\n+Dune::Functions::BrezziDouglasMariniPreBasis::dimension\n+size_type dimension() const\n+Definition: brezzidouglasmarinibasis.hh:221\n+Dune::Functions::BrezziDouglasMariniPreBasis::minMultiIndexSize\n+static constexpr size_type minMultiIndexSize\n+Definition: brezzidouglasmarinibasis.hh:165\n+Dune::Functions::BrezziDouglasMariniPreBasis::maxMultiIndexSize\n+static constexpr size_type maxMultiIndexSize\n+Definition: brezzidouglasmarinibasis.hh:164\n+Dune::Functions::BrezziDouglasMariniPreBasis::codimOffset_\n+std::array< size_t, dim+1 > codimOffset_\n+Definition: brezzidouglasmarinibasis.hh:267\n+Dune::Functions::BrezziDouglasMariniPreBasis::size\n+size_type size(const SizePrefix prefix) const\n+Return number possible values for next position in multi index.\n+Definition: brezzidouglasmarinibasis.hh:214\n+Dune::Functions::BrezziDouglasMariniPreBasis::makeNode\n+Node makeNode() const\n+Create tree node.\n+Definition: brezzidouglasmarinibasis.hh:202\n+Dune::Functions::BrezziDouglasMariniPreBasis::GridView\n+GV GridView\n+The grid view that the FE space is defined on.\n+Definition: brezzidouglasmarinibasis.hh:159\n+Dune::Functions::BrezziDouglasMariniPreBasis::BrezziDouglasMariniPreBasis\n+BrezziDouglasMariniPreBasis(const GridView &gv)\n+Constructor for a given grid view object.\n+Definition: brezzidouglasmarinibasis.hh:169\n+Dune::Functions::BrezziDouglasMariniPreBasis::finiteElementMap_\n+FiniteElementMap finiteElementMap_\n+Definition: brezzidouglasmarinibasis.hh:268\n+Dune::Functions::BrezziDouglasMariniPreBasis::update\n+void update(const GridView &gv)\n+Definition: brezzidouglasmarinibasis.hh:194\n+Dune::Functions::BrezziDouglasMariniPreBasis::initializeIndices\n+void initializeIndices()\n+Definition: brezzidouglasmarinibasis.hh:179\n+Dune::Functions::BrezziDouglasMariniPreBasis::gridView\n+const GridView & gridView() const\n+Obtain the grid view that the basis is defined on.\n+Definition: brezzidouglasmarinibasis.hh:188\n+Dune::Functions::BrezziDouglasMariniPreBasis::size\n+size_type size() const\n+Definition: brezzidouglasmarinibasis.hh:207\n+Dune::Functions::BrezziDouglasMariniPreBasis::multiIndexBufferSize\n+static constexpr size_type multiIndexBufferSize\n+Definition: brezzidouglasmarinibasis.hh:166\n+Dune::Functions::BrezziDouglasMariniPreBasis::maxNodeSize\n+size_type maxNodeSize() const\n+Definition: brezzidouglasmarinibasis.hh:226\n+Dune::Functions::BrezziDouglasMariniPreBasis::gridView_\n+GridView gridView_\n+Definition: brezzidouglasmarinibasis.hh:266\n+Dune::Functions::BrezziDouglasMariniPreBasis::indices\n+It indices(const Node &node, It it) const\n+Maps from subtree index set [0..size-1] to a globally unique multi index in\n+global basis.\n+Definition: brezzidouglasmarinibasis.hh:241\n+Dune::Functions::DefaultGlobalBasis\n+Global basis for given pre-basis.\n+Definition: defaultglobalbasis.hh:46\n+Dune::Functions::BasisNodeMixin::size\n+size_type size() const\n+Definition: nodes.hh:142\n+Dune::Functions::BasisNodeMixin::setSize\n+void setSize(const size_type size)\n+Definition: nodes.hh:164\n+Dune::Functions::LeafBasisNode\n+Definition: nodes.hh:186\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00101.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00101.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: discreteglobalbasisfunction.hh File Reference\n+dune-functions: subspacelocalview.hh File Reference\n \n \n \n \n \n \n \n@@ -58,73 +58,43 @@\n \n \n \n \n \n
    \n \n-
    discreteglobalbasisfunction.hh File Reference
    \n+Namespaces
    \n+
    subspacelocalview.hh File Reference
    \n \n
    \n-
    #include <memory>
    \n-#include <optional>
    \n-#include <dune/common/typetraits.hh>
    \n-#include <dune/typetree/treecontainer.hh>
    \n-#include <dune/functions/functionspacebases/hierarchicnodetorangemap.hh>
    \n-#include <dune/functions/functionspacebases/flatvectorview.hh>
    \n-#include <dune/functions/gridfunctions/gridviewentityset.hh>
    \n-#include <dune/functions/gridfunctions/gridfunction.hh>
    \n-#include <dune/functions/backends/concepts.hh>
    \n-#include <dune/functions/backends/istlvectorbackend.hh>
    \n+
    #include <tuple>
    \n+#include <dune/common/concept.hh>
    \n+#include <dune/typetree/childextraction.hh>
    \n+#include <dune/functions/functionspacebases/concepts.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n \n

    \n 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::SubspaceLocalView< RLV, PP >
     The restriction of a finite element basis to a single element. More...
     
    \n \n \n \n \n \n-\n-\n-

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    namespace  Dune::Functions::ImplDoc
     
    \n-\n-\n-\n-\n-\n

    \n-Functions

    template<typename R , typename B , typename V >
    auto Dune::Functions::makeDiscreteGlobalBasisFunction (B &&basis, V &&vector)
     Generate a DiscreteGlobalBasisFunction. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,61 +4,27 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * gridfunctions\n-Classes | Namespaces | Functions\n-discreteglobalbasisfunction.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+ * functionspacebases\n+Classes | Namespaces\n+subspacelocalview.hh File Reference\n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n- class \u00a0Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase<_B,_V,_NTRE\n- >\n-\u00a0\n-struct \u00a0Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase<_B,_V,_NTRE\n- >::Data\n-\u00a0\n- class \u00a0Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase<_B,_V,_NTRE\n- >::LocalFunctionBase\n-\u00a0\n- class \u00a0Dune::Functions::DiscreteGlobalBasisFunction<_B,_V,_NTRE,_R_>\n-\u00a0 A grid function induced by a global basis and a coefficient vector.\n- More...\n-\u00a0\n- class \u00a0Dune::Functions::DiscreteGlobalBasisFunction<_B,_V,_NTRE,_R_>::\n- LocalFunction\n-\u00a0\n- class \u00a0Dune::Functions::DiscreteGlobalBasisFunctionDerivative<_DGBF_>\n-\u00a0 Derivative of a DiscreteGlobalBasisFunction More...\n-\u00a0\n- class \u00a0Dune::Functions::DiscreteGlobalBasisFunctionDerivative<_DGBF_>::\n- LocalFunction\n-\u00a0 local function evaluating the derivative in reference coordinates\n- More...\n+class \u00a0Dune::Functions::SubspaceLocalView<_RLV,_PP_>\n+\u00a0 The restriction of a finite element basis to a single element. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n-namespace \u00a0Dune::Functions::ImplDoc\n-\u00a0\n- Functions\n-template\n-auto\u00a0Dune::Functions::makeDiscreteGlobalBasisFunction (B &&basis, V &&vector)\n-\u00a0 Generate a DiscreteGlobalBasisFunction. More...\n-\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00101_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00101_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: discreteglobalbasisfunction.hh Source File\n+dune-functions: subspacelocalview.hh Source File\n \n \n \n \n \n \n \n@@ -58,597 +58,167 @@\n \n
    \n \n \n \n
    \n-
    discreteglobalbasisfunction.hh
    \n+
    subspacelocalview.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH
    \n-
    4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH
    \n
    5
    \n-
    6#include <memory>
    \n-
    7#include <optional>
    \n+
    6
    \n+
    7#include <tuple>
    \n
    8
    \n-
    9#include <dune/common/typetraits.hh>
    \n+
    9#include <dune/common/concept.hh>
    \n
    10
    \n-
    11#include <dune/typetree/treecontainer.hh>
    \n+
    11#include <dune/typetree/childextraction.hh>
    \n
    12
    \n-\n-\n-\n-\n-\n-\n+\n+
    14
    \n+
    15
    \n+
    16
    \n+
    17namespace Dune {
    \n+
    18namespace Functions {
    \n
    19
    \n-
    20namespace Dune {
    \n-
    21namespace Functions {
    \n-
    22
    \n-
    23
    \n-
    24namespace ImplDoc {
    \n+
    20
    \n+
    21
    \n+
    22template<class RB, class PP>
    \n+
    23class SubspaceBasis;
    \n+
    24
    \n
    25
    \n-
    26template<typename B, typename V, typename NTRE>
    \n-\n-
    28{
    \n-
    29public:
    \n-
    30 using Basis = B;
    \n-
    31 using Vector = V;
    \n+
    26
    \n+
    28template<class RLV, class PP>
    \n+\n+
    30{
    \n+
    31 using PrefixPath = PP;
    \n
    32
    \n-
    33 // In order to make the cache work for proxy-references
    \n-
    34 // we have to use AutonomousValue<T> instead of std::decay_t<T>
    \n-
    35 using Coefficient = Dune::AutonomousValue<decltype(std::declval<Vector>()[std::declval<typename Basis::MultiIndex>()])>;
    \n+
    33public:
    \n+
    34
    \n+
    35 using RootLocalView = RLV;
    \n
    36
    \n-
    37 using GridView = typename Basis::GridView;
    \n-\n-
    39 using Tree = typename Basis::LocalView::Tree;
    \n-
    40 using NodeToRangeEntry = NTRE;
    \n-
    41
    \n-\n-
    43
    \n-\n-
    45 using Element = typename EntitySet::Element;
    \n-
    46
    \n-
    47protected:
    \n+\n+
    39
    \n+\n+
    42
    \n+
    44 using Element = typename GridView::template Codim<0>::Entity;
    \n+
    45
    \n+
    47 using size_type = std::size_t;
    \n
    48
    \n-
    49 // This collects all data that is shared by all related
    \n-
    50 // global and local functions. This way we don't need to
    \n-
    51 // keep track of it individually.
    \n-
    52 struct Data
    \n-
    53 {
    \n-\n-
    55 std::shared_ptr<const Basis> basis;
    \n-
    56 std::shared_ptr<const Vector> coefficients;
    \n-
    57 std::shared_ptr<const NodeToRangeEntry> nodeToRangeEntry;
    \n-
    58 };
    \n-
    59
    \n-
    60public:
    \n-\n+
    50 using RootTree = typename RootLocalView::Tree;
    \n+
    51
    \n+
    53 using Tree = typename TypeTree::ChildForTreePath<RootTree, PrefixPath>;
    \n+
    54
    \n+
    56 using MultiIndex = typename RootLocalView::MultiIndex;
    \n+
    57
    \n+
    59 SubspaceLocalView(const GlobalBasis& globalBasis, const PrefixPath& /*prefixPath*/) :
    \n+\n+
    61 rootLocalView_(globalBasis.rootBasis().localView())
    \n
    62 {
    \n-
    63 using LocalView = typename Basis::LocalView;
    \n-
    64 using size_type = typename Tree::size_type;
    \n+
    63// static_assert(models<Concept::BasisTree<GridView>, Tree>(), "Tree type passed to SubspaceLocalView does not model the BasisNode concept.");
    \n+
    64 }
    \n
    65
    \n-
    66 public:
    \n-\n-
    68 using Element = typename EntitySet::Element;
    \n-
    69
    \n-
    70 protected:
    \n-
    71 LocalFunctionBase(const std::shared_ptr<const Data>& data)
    \n-
    72 : data_(data)
    \n-
    73 , localView_(data_->basis->localView())
    \n-
    74 {
    \n-
    75 localDoFs_.reserve(localView_.maxSize());
    \n-
    76 }
    \n-
    77
    \n-\n-
    85 : data_(other.data_)
    \n-
    86 , localView_(other.localView_)
    \n-
    87 {
    \n-
    88 localDoFs_.reserve(localView_.maxSize());
    \n-
    89 if (bound())
    \n-
    90 localDoFs_ = other.localDoFs_;
    \n-
    91 }
    \n-
    92
    \n-\n-
    101 {
    \n-
    102 data_ = other.data_;
    \n-
    103 localView_ = other.localView_;
    \n-
    104 if (bound())
    \n-
    105 localDoFs_ = other.localDoFs_;
    \n-
    106 return *this;
    \n-
    107 }
    \n-
    108
    \n-
    109 public:
    \n-
    116 void bind(const Element& element)
    \n-
    117 {
    \n-
    118 localView_.bind(element);
    \n-
    119 // Use cache of full local view size. For a subspace basis,
    \n-
    120 // this may be larger than the number of local DOFs in the
    \n-
    121 // tree. In this case only cache entries associated to local
    \n-
    122 // DOFs in the subspace are filled. Cache entries associated
    \n-
    123 // to local DOFs which are not contained in the subspace will
    \n-
    124 // not be touched.
    \n-
    125 //
    \n-
    126 // Alternatively one could use a cache that exactly fits
    \n-
    127 // the size of the tree. However, this would require to
    \n-
    128 // subtract an offset from localIndex(i) on each cache
    \n-
    129 // access in operator().
    \n-
    130 localDoFs_.resize(localView_.size());
    \n-
    131 const auto& dofs = *data_->coefficients;
    \n-
    132 for (size_type i = 0; i < localView_.tree().size(); ++i)
    \n-
    133 {
    \n-
    134 // For a subspace basis the index-within-tree i
    \n-
    135 // is not the same as the localIndex within the
    \n-
    136 // full local view.
    \n-
    137 size_t localIndex = localView_.tree().localIndex(i);
    \n-
    138 localDoFs_[localIndex] = dofs[localView_.index(localIndex)];
    \n-
    139 }
    \n-
    140 }
    \n-
    141
    \n-
    143 void unbind()
    \n-
    144 {
    \n-
    145 localView_.unbind();
    \n-
    146 }
    \n-
    147
    \n-
    149 bool bound() const
    \n-
    150 {
    \n-
    151 return localView_.bound();
    \n-
    152 }
    \n-
    153
    \n-
    155 const Element& localContext() const
    \n-
    156 {
    \n-
    157 return localView_.element();
    \n-
    158 }
    \n-
    159
    \n-
    160 protected:
    \n-
    161
    \n-
    162 template<class To, class From>
    \n-
    163 void assignWith(To& to, const From& from) const
    \n-
    164 {
    \n-
    165 auto from_flat = flatVectorView(from);
    \n-
    166 auto to_flat = flatVectorView(to);
    \n-
    167 assert(from_flat.size() == to_flat.size());
    \n-
    168 for (size_type i = 0; i < to_flat.size(); ++i)
    \n-
    169 to_flat[i] = from_flat[i];
    \n-
    170 }
    \n-
    171
    \n-
    172 template<class Node, class TreePath, class Range>
    \n-
    173 decltype(auto) nodeToRangeEntry(const Node& node, const TreePath& treePath, Range& y) const
    \n-
    174 {
    \n-
    175 return (*data_->nodeToRangeEntry)(node, treePath, y);
    \n-
    176 }
    \n-
    177
    \n-
    178 std::shared_ptr<const Data> data_;
    \n-
    179 LocalView localView_;
    \n-
    180 std::vector<Coefficient> localDoFs_;
    \n-
    181 };
    \n-
    182
    \n-
    183protected:
    \n-
    184 DiscreteGlobalBasisFunctionBase(const std::shared_ptr<const Data>& data)
    \n-
    185 : data_(data)
    \n-
    186 {
    \n-
    187 /* Nothing. */
    \n-
    188 }
    \n-
    189
    \n-
    190public:
    \n-
    191
    \n-
    193 const Basis& basis() const
    \n-
    194 {
    \n-
    195 return *data_->basis;
    \n-
    196 }
    \n-
    197
    \n-
    199 const Vector& dofs() const
    \n-
    200 {
    \n-
    201 return *data_->coefficients;
    \n-
    202 }
    \n-
    203
    \n-\n-
    206 {
    \n-
    207 return *data_->nodeToRangeEntry;
    \n-
    208 }
    \n-
    209
    \n-
    211 const EntitySet& entitySet() const
    \n-
    212 {
    \n-
    213 return data_->entitySet;
    \n-
    214 }
    \n-
    215
    \n-
    216protected:
    \n-
    217 std::shared_ptr<const Data> data_;
    \n-
    218};
    \n-
    219
    \n-
    220} // namespace ImplDoc
    \n-
    221
    \n-
    222
    \n-
    223
    \n-
    224template<typename DGBF>
    \n-\n-
    226
    \n-
    264template<typename B, typename V,
    \n-
    265 typename NTRE = HierarchicNodeToRangeMap,
    \n-
    266 typename R = typename V::value_type>
    \n-\n-\n-
    269{
    \n-\n-
    271 using Data = typename Base::Data;
    \n-
    272
    \n-
    273public:
    \n-
    274 using Basis = typename Base::Basis;
    \n-
    275 using Vector = typename Base::Vector;
    \n-
    276
    \n-
    277 using Domain = typename Base::Domain;
    \n-
    278 using Range = R;
    \n-
    279
    \n-
    280 using Traits = Imp::GridFunctionTraits<Range(Domain), typename Base::EntitySet, DefaultDerivativeTraits, 16>;
    \n-
    281
    \n-
    282private:
    \n-
    283
    \n-
    284 template<class Node>
    \n-
    285 using LocalBasisRange = typename Node::FiniteElement::Traits::LocalBasisType::Traits::RangeType;
    \n-
    286 template<class Node>
    \n-
    287 using NodeData = typename std::vector<LocalBasisRange<Node>>;
    \n-
    288 using PerNodeEvaluationBuffer = typename TypeTree::TreeContainer<NodeData, typename Base::Tree>;
    \n-
    289
    \n-
    290public:
    \n-\n-\n-
    293 {
    \n-
    294 using LocalBase = typename Base::LocalFunctionBase;
    \n-
    295 using size_type = typename Base::Tree::size_type;
    \n-
    296 using LocalBase::nodeToRangeEntry;
    \n-
    297
    \n-
    298 public:
    \n-
    299
    \n-\n-
    301 using Domain = typename LocalBase::Domain;
    \n-\n-
    303 using Element = typename LocalBase::Element;
    \n-
    304
    \n-\n-
    307 : LocalBase(globalFunction.data_)
    \n-
    308 , evaluationBuffer_(this->localView_.tree())
    \n-
    309 {
    \n-
    310 /* Nothing. */
    \n-
    311 }
    \n-
    312
    \n-
    322 Range operator()(const Domain& x) const
    \n-
    323 {
    \n-
    324 Range y;
    \n-
    325 istlVectorBackend(y) = 0;
    \n-
    326
    \n-
    327 TypeTree::forEachLeafNode(this->localView_.tree(), [&](auto&& node, auto&& treePath) {
    \n-
    328 const auto& fe = node.finiteElement();
    \n-
    329 const auto& localBasis = fe.localBasis();
    \n-
    330 auto& shapeFunctionValues = evaluationBuffer_[treePath];
    \n-
    331
    \n-
    332 localBasis.evaluateFunction(x, shapeFunctionValues);
    \n-
    333
    \n-
    334 // Compute linear combinations of basis function jacobian.
    \n-
    335 // Non-scalar coefficients of dimension coeffDim are handled by
    \n-
    336 // processing the coeffDim linear combinations independently
    \n-
    337 // and storing them as entries of an array.
    \n-
    338 using Value = LocalBasisRange< std::decay_t<decltype(node)> >;
    \n-
    339 static constexpr auto coeffDim = decltype(flatVectorView(this->localDoFs_[node.localIndex(0)]).size())::value;
    \n-
    340 auto values = std::array<Value, coeffDim>{};
    \n-
    341 istlVectorBackend(values) = 0;
    \n-
    342 for (size_type i = 0; i < localBasis.size(); ++i)
    \n-
    343 {
    \n-
    344 auto c = flatVectorView(this->localDoFs_[node.localIndex(i)]);
    \n-
    345 for (std::size_t j = 0; j < coeffDim; ++j)
    \n-
    346 values[j].axpy(c[j], shapeFunctionValues[i]);
    \n-
    347 }
    \n-
    348
    \n-
    349 // Assign computed values to node entry of range.
    \n-
    350 // Types are matched using the lexicographic ordering provided by flatVectorView.
    \n-
    351 LocalBase::assignWith(nodeToRangeEntry(node, treePath, y), values);
    \n-
    352 });
    \n-
    353
    \n-
    354 return y;
    \n-
    355 }
    \n-
    356
    \n-\n-
    359 {
    \n-\n-
    361 if (lf.bound())
    \n-
    362 dlf.bind(lf.localContext());
    \n-
    363 return dlf;
    \n-
    364 }
    \n-
    365
    \n-
    366 private:
    \n-
    367 mutable PerNodeEvaluationBuffer evaluationBuffer_;
    \n-
    368 };
    \n-
    369
    \n-
    371 template<class B_T, class V_T, class NTRE_T>
    \n-
    372 DiscreteGlobalBasisFunction(B_T && basis, V_T && coefficients, NTRE_T&& nodeToRangeEntry)
    \n-
    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))}))
    \n-
    374 {}
    \n-
    375
    \n-
    377 DiscreteGlobalBasisFunction(std::shared_ptr<const Basis> basis, std::shared_ptr<const V> coefficients, std::shared_ptr<const typename Base::NodeToRangeEntry> nodeToRangeEntry)
    \n-
    378 : Base(std::make_shared<Data>(Data{{basis->gridView()}, basis, coefficients, nodeToRangeEntry}))
    \n-
    379 {}
    \n-
    380
    \n-
    382 Range operator() (const Domain& x) const
    \n-
    383 {
    \n-
    384 // TODO: Implement this using hierarchic search
    \n-
    385 DUNE_THROW(NotImplemented,"not implemented");
    \n-
    386 }
    \n-
    387
    \n-\n-
    390 {
    \n-\n-
    392 }
    \n-
    393
    \n-\n-
    403 {
    \n-
    404 return LocalFunction(t);
    \n-
    405 }
    \n-
    406};
    \n-
    407
    \n-
    408
    \n-
    431template<typename R, typename B, typename V>
    \n-
    432auto makeDiscreteGlobalBasisFunction(B&& basis, V&& vector)
    \n-
    433{
    \n-
    434 using Basis = std::decay_t<B>;
    \n-
    435 using NTREM = HierarchicNodeToRangeMap;
    \n-
    436
    \n-
    437 // Small helper functions to wrap vectors using istlVectorBackend
    \n-
    438 // if they do not already satisfy the VectorBackend interface.
    \n-
    439 auto toConstVectorBackend = [&](auto&& v) -> decltype(auto) {
    \n-
    440 if constexpr (models<Concept::ConstVectorBackend<Basis>, decltype(v)>()) {
    \n-
    441 return std::forward<decltype(v)>(v);
    \n-
    442 } else {
    \n-
    443 return istlVectorBackend(v);
    \n-
    444 }
    \n-
    445 };
    \n-
    446
    \n-
    447 using Vector = std::decay_t<decltype(toConstVectorBackend(std::forward<V>(vector)))>;
    \n-\n-
    449 std::forward<B>(basis),
    \n-
    450 toConstVectorBackend(std::forward<V>(vector)),
    \n-\n-
    452}
    \n-
    453
    \n-
    454
    \n-
    469template<typename DGBF>
    \n-\n-
    471 : public ImplDoc::DiscreteGlobalBasisFunctionBase<typename DGBF::Basis, typename DGBF::Vector, typename DGBF::NodeToRangeEntry>
    \n-
    472{
    \n-\n-
    474 using Data = typename Base::Data;
    \n-
    475
    \n-
    476public:
    \n-\n-
    478
    \n-
    479 using Basis = typename Base::Basis;
    \n-
    480 using Vector = typename Base::Vector;
    \n-
    481
    \n-
    482 using Domain = typename Base::Domain;
    \n-\n-
    484
    \n-
    485 using Traits = Imp::GridFunctionTraits<Range(Domain), typename Base::EntitySet, DefaultDerivativeTraits, 16>;
    \n-
    486
    \n-
    487private:
    \n-
    488
    \n-
    489 template<class Node>
    \n-
    490 using LocalBasisRange = typename Node::FiniteElement::Traits::LocalBasisType::Traits::JacobianType;
    \n-
    491 template<class Node>
    \n-
    492 using NodeData = typename std::vector< LocalBasisRange<Node> >;
    \n-
    493 using PerNodeEvaluationBuffer = typename TypeTree::TreeContainer<NodeData, typename Base::Tree>;
    \n-
    494
    \n-
    495public:
    \n-
    496
    \n-\n-\n-
    506 {
    \n-
    507 using LocalBase = typename Base::LocalFunctionBase;
    \n-
    508 using size_type = typename Base::Tree::size_type;
    \n-
    509 using LocalBase::nodeToRangeEntry;
    \n-
    510
    \n-
    511 public:
    \n-\n-
    513 using Domain = typename LocalBase::Domain;
    \n-\n-
    515 using Element = typename LocalBase::Element;
    \n-
    516
    \n-
    518 LocalFunction(const GlobalFunction& globalFunction)
    \n-
    519 : LocalBase(globalFunction.data_)
    \n-
    520 , evaluationBuffer_(this->localView_.tree())
    \n-
    521 {
    \n-
    522 /* Nothing. */
    \n-
    523 }
    \n-
    524
    \n-
    531 void bind(const Element& element)
    \n-
    532 {
    \n-
    533 LocalBase::bind(element);
    \n-
    534 geometry_.emplace(element.geometry());
    \n-
    535 }
    \n-
    536
    \n-
    538 void unbind()
    \n-
    539 {
    \n-
    540 geometry_.reset();
    \n-
    541 LocalBase::unbind();
    \n-
    542 }
    \n-
    543
    \n-
    557 Range operator()(const Domain& x) const
    \n-
    558 {
    \n-
    559 Range y;
    \n-
    560 istlVectorBackend(y) = 0;
    \n-
    561
    \n-
    562 const auto& jacobianInverse = geometry_->jacobianInverse(x);
    \n-
    563
    \n-
    564 TypeTree::forEachLeafNode(this->localView_.tree(), [&](auto&& node, auto&& treePath) {
    \n-
    565 const auto& fe = node.finiteElement();
    \n-
    566 const auto& localBasis = fe.localBasis();
    \n-
    567 auto& shapeFunctionJacobians = evaluationBuffer_[treePath];
    \n-
    568
    \n-
    569 localBasis.evaluateJacobian(x, shapeFunctionJacobians);
    \n-
    570
    \n-
    571 // Compute linear combinations of basis function jacobian.
    \n-
    572 // Non-scalar coefficients of dimension coeffDim are handled by
    \n-
    573 // processing the coeffDim linear combinations independently
    \n-
    574 // and storing them as entries of an array.
    \n-
    575 using RefJacobian = LocalBasisRange< std::decay_t<decltype(node)> >;
    \n-
    576 static constexpr auto coeffDim = decltype(flatVectorView(this->localDoFs_[node.localIndex(0)]).size())::value;
    \n-
    577 auto refJacobians = std::array<RefJacobian, coeffDim>{};
    \n-
    578 istlVectorBackend(refJacobians) = 0;
    \n-
    579 for (size_type i = 0; i < localBasis.size(); ++i)
    \n-
    580 {
    \n-
    581 auto c = flatVectorView(this->localDoFs_[node.localIndex(i)]);
    \n-
    582 for (std::size_t j = 0; j < coeffDim; ++j)
    \n-
    583 refJacobians[j].axpy(c[j], shapeFunctionJacobians[i]);
    \n-
    584 }
    \n-
    585
    \n-
    586 // Transform Jacobians form local to global coordinates.
    \n-
    587 using Jacobian = decltype(refJacobians[0] * jacobianInverse);
    \n-
    588 auto jacobians = std::array<Jacobian, coeffDim>{};
    \n-
    589 std::transform(
    \n-
    590 refJacobians.begin(), refJacobians.end(), jacobians.begin(),
    \n-
    591 [&](const auto& refJacobian) { return refJacobian * jacobianInverse; });
    \n-
    592
    \n-
    593 // Assign computed Jacobians to node entry of range.
    \n-
    594 // Types are matched using the lexicographic ordering provided by flatVectorView.
    \n-
    595 LocalBase::assignWith(nodeToRangeEntry(node, treePath, y), jacobians);
    \n-
    596 });
    \n-
    597
    \n-
    598 return y;
    \n-
    599 }
    \n-
    600
    \n-\n-
    603 {
    \n-
    604 DUNE_THROW(NotImplemented, "derivative of derivative is not implemented");
    \n-
    605 }
    \n-
    606
    \n-
    607 private:
    \n-
    608 mutable PerNodeEvaluationBuffer evaluationBuffer_;
    \n-
    609 std::optional<typename Element::Geometry> geometry_;
    \n-
    610 };
    \n-
    611
    \n-
    618 DiscreteGlobalBasisFunctionDerivative(const std::shared_ptr<const Data>& data)
    \n-
    619 : Base(data)
    \n-
    620 {
    \n-
    621 /* Nothing. */
    \n-
    622 }
    \n-
    623
    \n-
    625 Range operator()(const Domain& x) const
    \n-
    626 {
    \n-
    627 // TODO: Implement this using hierarchic search
    \n-
    628 DUNE_THROW(NotImplemented,"not implemented");
    \n-
    629 }
    \n-
    630
    \n-\n-
    632 {
    \n-
    633 DUNE_THROW(NotImplemented, "derivative of derivative is not implemented");
    \n-
    634 }
    \n-
    635
    \n-\n-
    638 {
    \n-
    639 return LocalFunction(f);
    \n-
    640 }
    \n-
    641};
    \n-
    642
    \n-
    643
    \n-
    644} // namespace Functions
    \n-
    645} // namespace Dune
    \n-
    646
    \n-
    647#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH
    \n-\n-\n-\n-\n-\n-
    auto makeDiscreteGlobalBasisFunction(B &&basis, V &&vector)
    Generate a DiscreteGlobalBasisFunction.
    Definition: discreteglobalbasisfunction.hh:432
    \n-
    auto istlVectorBackend(Vector &v)
    Return a vector backend wrapping non-const ISTL like containers.
    Definition: istlvectorbackend.hh:346
    \n+
    71 void bind(const Element& e)
    \n+
    72 {
    \n+
    73 rootLocalView_.bind(e);
    \n+
    74 }
    \n+
    75
    \n+
    80 const Element& element() const
    \n+
    81 {
    \n+
    82 return rootLocalView_.element();
    \n+
    83 }
    \n+
    84
    \n+
    89 void unbind()
    \n+
    90 {
    \n+
    91 rootLocalView_.unbind();
    \n+
    92 }
    \n+
    93
    \n+
    96 bool bound() const
    \n+
    97 {
    \n+
    98 return rootLocalView_.bound();
    \n+
    99 }
    \n+
    100
    \n+
    105 const Tree& tree() const
    \n+
    106 {
    \n+
    107 return TypeTree::child(rootLocalView_.tree(), globalBasis_->prefixPath());
    \n+
    108 }
    \n+
    109
    \n+\n+
    113 {
    \n+
    114 return rootLocalView_.size();
    \n+
    115 }
    \n+
    116
    \n+\n+
    124 {
    \n+
    125 return rootLocalView_.maxSize();
    \n+
    126 }
    \n+
    127
    \n+\n+
    130 {
    \n+
    131 return rootLocalView_.index(i);
    \n+
    132 }
    \n+
    133
    \n+\n+
    137 {
    \n+
    138 return *globalBasis_;
    \n+
    139 }
    \n+
    140
    \n+\n+
    142 {
    \n+
    143 return rootLocalView_;
    \n+
    144 }
    \n+
    145
    \n+
    146protected:
    \n+\n+\n+
    149};
    \n+
    150
    \n+
    151
    \n+
    152
    \n+
    153} // end namespace Functions
    \n+
    154} // end namespace Dune
    \n+
    155
    \n+
    156
    \n+
    157
    \n+
    158#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH
    \n
    Definition: polynomial.hh:10
    \n-
    auto flatVectorView(T &t)
    Create flat vector view of passed mutable container.
    Definition: flatvectorview.hh:179
    \n-
    Default implementation for derivative traits.
    Definition: defaultderivativetraits.hh:37
    \n-
    Helper class to deduce the signature of a callable.
    Definition: signature.hh:56
    \n-
    A simple node to range map using the nested tree indices.
    Definition: hierarchicnodetorangemap.hh:30
    \n-
    Definition: discreteglobalbasisfunction.hh:28
    \n-
    std::shared_ptr< const Data > data_
    Definition: discreteglobalbasisfunction.hh:217
    \n-
    const Vector & dofs() const
    Return the coefficients of this discrete function by reference.
    Definition: discreteglobalbasisfunction.hh:199
    \n-
    B Basis
    Definition: discreteglobalbasisfunction.hh:30
    \n-
    typename Basis::LocalView::Tree Tree
    Definition: discreteglobalbasisfunction.hh:39
    \n-
    V Vector
    Definition: discreteglobalbasisfunction.hh:31
    \n-
    typename EntitySet::Element Element
    Definition: discreteglobalbasisfunction.hh:45
    \n-
    typename EntitySet::LocalCoordinate LocalDomain
    Definition: discreteglobalbasisfunction.hh:44
    \n-
    const NodeToRangeEntry & nodeToRangeEntry() const
    Return the stored node-to-range map.
    Definition: discreteglobalbasisfunction.hh:205
    \n-
    NTRE NodeToRangeEntry
    Definition: discreteglobalbasisfunction.hh:40
    \n-
    DiscreteGlobalBasisFunctionBase(const std::shared_ptr< const Data > &data)
    Definition: discreteglobalbasisfunction.hh:184
    \n-
    typename Basis::GridView GridView
    Definition: discreteglobalbasisfunction.hh:37
    \n-
    const Basis & basis() const
    Return a const reference to the stored basis.
    Definition: discreteglobalbasisfunction.hh:193
    \n-
    GridViewEntitySet< GridView, 0 > EntitySet
    Definition: discreteglobalbasisfunction.hh:38
    \n-
    const EntitySet & entitySet() const
    Get associated set of entities the local-function can be bound to.
    Definition: discreteglobalbasisfunction.hh:211
    \n-
    typename EntitySet::GlobalCoordinate Domain
    Definition: discreteglobalbasisfunction.hh:42
    \n-
    Dune::AutonomousValue< decltype(std::declval< Vector >()[std::declval< typename Basis::MultiIndex >()])> Coefficient
    Definition: discreteglobalbasisfunction.hh:35
    \n-
    Definition: discreteglobalbasisfunction.hh:53
    \n-
    EntitySet entitySet
    Definition: discreteglobalbasisfunction.hh:54
    \n-
    std::shared_ptr< const NodeToRangeEntry > nodeToRangeEntry
    Definition: discreteglobalbasisfunction.hh:57
    \n-
    std::shared_ptr< const Basis > basis
    Definition: discreteglobalbasisfunction.hh:55
    \n-
    std::shared_ptr< const Vector > coefficients
    Definition: discreteglobalbasisfunction.hh:56
    \n-\n-
    LocalFunctionBase & operator=(const LocalFunctionBase &other)
    Copy-assignment of the local-function.
    Definition: discreteglobalbasisfunction.hh:100
    \n-
    bool bound() const
    Check if LocalFunction is already bound to an element.
    Definition: discreteglobalbasisfunction.hh:149
    \n-
    void bind(const Element &element)
    Bind LocalFunction to grid element.
    Definition: discreteglobalbasisfunction.hh:116
    \n-
    typename EntitySet::Element Element
    Definition: discreteglobalbasisfunction.hh:68
    \n-
    const Element & localContext() const
    Return the element the local-function is bound to.
    Definition: discreteglobalbasisfunction.hh:155
    \n-
    LocalFunctionBase(const LocalFunctionBase &other)
    Copy-construct the local-function.
    Definition: discreteglobalbasisfunction.hh:84
    \n-
    std::vector< Coefficient > localDoFs_
    Definition: discreteglobalbasisfunction.hh:180
    \n-
    void assignWith(To &to, const From &from) const
    Definition: discreteglobalbasisfunction.hh:163
    \n-
    std::shared_ptr< const Data > data_
    Definition: discreteglobalbasisfunction.hh:178
    \n-
    decltype(auto) nodeToRangeEntry(const Node &node, const TreePath &treePath, Range &y) const
    Definition: discreteglobalbasisfunction.hh:173
    \n-
    LocalView localView_
    Definition: discreteglobalbasisfunction.hh:179
    \n-
    void unbind()
    Unbind the local-function.
    Definition: discreteglobalbasisfunction.hh:143
    \n-
    LocalDomain Domain
    Definition: discreteglobalbasisfunction.hh:67
    \n-
    LocalFunctionBase(const std::shared_ptr< const Data > &data)
    Definition: discreteglobalbasisfunction.hh:71
    \n-
    Derivative of a DiscreteGlobalBasisFunction
    Definition: discreteglobalbasisfunction.hh:472
    \n-
    typename Base::Basis Basis
    Definition: discreteglobalbasisfunction.hh:479
    \n-
    friend Traits::DerivativeInterface derivative(const DiscreteGlobalBasisFunctionDerivative &f)
    Definition: discreteglobalbasisfunction.hh:631
    \n-
    Range operator()(const Domain &x) const
    Not implemented.
    Definition: discreteglobalbasisfunction.hh:625
    \n-
    typename SignatureTraits< typename DiscreteGlobalBasisFunction::Traits::DerivativeInterface >::Range Range
    Definition: discreteglobalbasisfunction.hh:483
    \n-
    friend LocalFunction localFunction(const DiscreteGlobalBasisFunctionDerivative &f)
    Construct local function from a DiscreteGlobalBasisFunctionDerivative
    Definition: discreteglobalbasisfunction.hh:637
    \n-
    DiscreteGlobalBasisFunctionDerivative(const std::shared_ptr< const Data > &data)
    create object from DiscreateGlobalBasisFunction data
    Definition: discreteglobalbasisfunction.hh:618
    \n-
    DGBF DiscreteGlobalBasisFunction
    Definition: discreteglobalbasisfunction.hh:477
    \n-
    typename Base::Vector Vector
    Definition: discreteglobalbasisfunction.hh:480
    \n-
    Imp::GridFunctionTraits< Range(Domain), typename Base::EntitySet, DefaultDerivativeTraits, 16 > Traits
    Definition: discreteglobalbasisfunction.hh:485
    \n-
    typename Base::Domain Domain
    Definition: discreteglobalbasisfunction.hh:482
    \n-
    A grid function induced by a global basis and a coefficient vector.
    Definition: discreteglobalbasisfunction.hh:269
    \n-
    friend DiscreteGlobalBasisFunctionDerivative< DiscreteGlobalBasisFunction > derivative(const DiscreteGlobalBasisFunction &f)
    Derivative of the DiscreteGlobalBasisFunction
    Definition: discreteglobalbasisfunction.hh:389
    \n-
    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
    \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.
    Definition: discreteglobalbasisfunction.hh:377
    \n-
    friend LocalFunction localFunction(const DiscreteGlobalBasisFunction &t)
    Construct local function from a DiscreteGlobalBasisFunction.
    Definition: discreteglobalbasisfunction.hh:402
    \n-
    typename Base::Basis Basis
    Definition: discreteglobalbasisfunction.hh:274
    \n-
    Imp::GridFunctionTraits< Range(Domain), typename Base::EntitySet, DefaultDerivativeTraits, 16 > Traits
    Definition: discreteglobalbasisfunction.hh:280
    \n-
    R Range
    Definition: discreteglobalbasisfunction.hh:278
    \n-
    typename Base::Vector Vector
    Definition: discreteglobalbasisfunction.hh:275
    \n-
    typename Base::Domain Domain
    Definition: discreteglobalbasisfunction.hh:277
    \n-
    Definition: discreteglobalbasisfunction.hh:293
    \n-
    GlobalFunction::Range Range
    Definition: discreteglobalbasisfunction.hh:302
    \n-
    LocalFunction(const DiscreteGlobalBasisFunction &globalFunction)
    Create a local-function from the associated grid-function.
    Definition: discreteglobalbasisfunction.hh:306
    \n-
    friend DiscreteGlobalBasisFunctionDerivative< DiscreteGlobalBasisFunction >::LocalFunction derivative(const LocalFunction &lf)
    Local function of the derivative.
    Definition: discreteglobalbasisfunction.hh:358
    \n-
    Range operator()(const Domain &x) const
    Evaluate this local-function in coordinates x in the bound element.
    Definition: discreteglobalbasisfunction.hh:322
    \n-
    local function evaluating the derivative in reference coordinates
    Definition: discreteglobalbasisfunction.hh:506
    \n-
    Range operator()(const Domain &x) const
    Evaluate this local-function in coordinates x in the bound element.
    Definition: discreteglobalbasisfunction.hh:557
    \n-
    friend Traits::LocalFunctionTraits::DerivativeInterface derivative(const LocalFunction &)
    Not implemented.
    Definition: discreteglobalbasisfunction.hh:602
    \n-
    GlobalFunction::Range Range
    Definition: discreteglobalbasisfunction.hh:514
    \n-
    void unbind()
    Unbind the local-function.
    Definition: discreteglobalbasisfunction.hh:538
    \n-
    LocalFunction(const GlobalFunction &globalFunction)
    Create a local function from the associated grid function.
    Definition: discreteglobalbasisfunction.hh:518
    \n-
    void bind(const Element &element)
    Bind LocalFunction to grid element.
    Definition: discreteglobalbasisfunction.hh:531
    \n-
    Definition: gridfunction.hh:32
    \n-\n-
    GridView::template Codim< codim >::Entity Element
    Type of Elements contained in this EntitySet.
    Definition: gridviewentityset.hh:32
    \n-
    Element::Geometry::LocalCoordinate LocalCoordinate
    Type of local coordinates with respect to the Element.
    Definition: gridviewentityset.hh:35
    \n-
    Element::Geometry::GlobalCoordinate GlobalCoordinate
    Definition: gridviewentityset.hh:36
    \n-\n+
    SubspaceBasis(const RB &, const TP) -> SubspaceBasis< RB, TP >
    \n+
    Definition: subspacebasis.hh:38
    \n+
    typename RootBasis::GridView GridView
    The grid view that the FE space is defined on.
    Definition: subspacebasis.hh:48
    \n+
    const PrefixPath & prefixPath() const
    Definition: subspacebasis.hh:118
    \n+
    The restriction of a finite element basis to a single element.
    Definition: subspacelocalview.hh:30
    \n+
    typename TypeTree::ChildForTreePath< RootTree, PrefixPath > Tree
    Tree of local finite elements / local shape function sets.
    Definition: subspacelocalview.hh:53
    \n+
    void unbind()
    Unbind from the current element.
    Definition: subspacelocalview.hh:89
    \n+
    const Element & element() const
    Return the grid element that the view is bound to.
    Definition: subspacelocalview.hh:80
    \n+
    const GlobalBasis * globalBasis_
    Definition: subspacelocalview.hh:147
    \n+
    bool bound() const
    Return if the view is bound to a grid element.
    Definition: subspacelocalview.hh:96
    \n+
    typename RootLocalView::MultiIndex MultiIndex
    Type used for global numbering of the basis vectors.
    Definition: subspacelocalview.hh:56
    \n+
    size_type size() const
    Total number of degrees of freedom on this element.
    Definition: subspacelocalview.hh:112
    \n+
    RootLocalView rootLocalView_
    Definition: subspacelocalview.hh:148
    \n+
    void bind(const Element &e)
    Bind the view to a grid element.
    Definition: subspacelocalview.hh:71
    \n+
    typename GlobalBasis::GridView GridView
    The grid view the global FE basis lives on.
    Definition: subspacelocalview.hh:41
    \n+
    SubspaceLocalView(const GlobalBasis &globalBasis, const PrefixPath &)
    Construct local view for a given global finite element basis.
    Definition: subspacelocalview.hh:59
    \n+
    RLV RootLocalView
    Definition: subspacelocalview.hh:35
    \n+
    const RootLocalView & rootLocalView() const
    Definition: subspacelocalview.hh:141
    \n+
    std::size_t size_type
    The type used for sizes.
    Definition: subspacelocalview.hh:47
    \n+
    typename GridView::template Codim< 0 >::Entity Element
    Type of the grid element we are bound to.
    Definition: subspacelocalview.hh:44
    \n+
    const GlobalBasis & globalBasis() const
    Return the global basis that we are a view on.
    Definition: subspacelocalview.hh:136
    \n+
    size_type maxSize() const
    Maximum local size for any element on the GridView.
    Definition: subspacelocalview.hh:123
    \n+
    const Tree & tree() const
    Return the local ansatz tree associated to the bound entity.
    Definition: subspacelocalview.hh:105
    \n+
    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
    \n+
    typename RootLocalView::Tree RootTree
    Tree of local finite elements / local shape function sets.
    Definition: subspacelocalview.hh:50
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,843 +4,229 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * gridfunctions\n-discreteglobalbasisfunction.hh\n+ * functionspacebases\n+subspacelocalview.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH\n- 4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH\n 5\n- 6#include \n- 7#include \n+ 6\n+ 7#include \n 8\n- 9#include \n+ 9#include \n 10\n- 11#include \n+ 11#include \n 12\n- 13#include \n- 14#include \n- 15#include \n- 16#include \n- 17#include \n- 18#include \n+ 13#include \n+ 14\n+ 15\n+ 16\n+ 17namespace Dune {\n+ 18namespace Functions {\n 19\n- 20namespace Dune {\n- 21namespace Functions {\n- 22\n- 23\n-24namespace ImplDoc {\n+ 20\n+ 21\n+ 22template\n+ 23class SubspaceBasis;\n+ 24\n 25\n- 26template\n-27class DiscreteGlobalBasisFunctionBase\n- 28{\n- 29public:\n-30 using Basis = B;\n-31 using Vector = V;\n+ 26\n+ 28template\n+29class SubspaceLocalView\n+ 30{\n+ 31 using PrefixPath = PP;\n 32\n- 33 // In order to make the cache work for proxy-references\n- 34 // we have to use AutonomousValue instead of std::decay_t\n-35 using Coefficient = Dune::AutonomousValue()\n-[std::declval()])>;\n+ 33public:\n+ 34\n+35 using RootLocalView = RLV;\n 36\n-37 using GridView = typename Basis::GridView;\n-38 using EntitySet = GridViewEntitySet;\n-39 using Tree = typename Basis::LocalView::Tree;\n-40 using NodeToRangeEntry = NTRE;\n- 41\n-42 using Domain = typename EntitySet::GlobalCoordinate;\n- 43\n-44 using LocalDomain = typename EntitySet::LocalCoordinate;\n-45 using Element = typename EntitySet::Element;\n- 46\n- 47protected:\n+38 using GlobalBasis = SubspaceBasis;\n+ 39\n+41 using GridView = typename GlobalBasis::GridView;\n+ 42\n+44 using Element = typename GridView::template Codim<0>::Entity;\n+ 45\n+47 using size_type = std::size_t;\n 48\n- 49 // This collects all data that is shared by all related\n- 50 // global and local functions. This way we don't need to\n- 51 // keep track of it individually.\n-52 struct Data\n- 53 {\n-54 EntitySet entitySet;\n-55 std::shared_ptr basis;\n-56 std::shared_ptr coefficients;\n-57 std::shared_ptr nodeToRangeEntry;\n- 58 };\n- 59\n- 60public:\n-61 class LocalFunctionBase\n+50 using RootTree = typename RootLocalView::Tree;\n+ 51\n+53 using Tree = typename TypeTree::ChildForTreePath;\n+ 54\n+56 using MultiIndex = typename RootLocalView::MultiIndex;\n+ 57\n+59 SubspaceLocalView(const GlobalBasis& globalBasis, const PrefixPath& /\n+*prefixPath*/) :\n+ 60 globalBasis_(&globalBasis),\n+ 61 rootLocalView_(globalBasis.rootBasis().localView())\n 62 {\n- 63 using LocalView = typename Basis::LocalView;\n- 64 using size_type = typename Tree::size_type;\n+ 63// static_assert(models, Tree>(), \"Tree type\n+passed to SubspaceLocalView does not model the BasisNode concept.\");\n+ 64 }\n 65\n- 66 public:\n-67 using Domain = LocalDomain;\n-68 using Element = typename EntitySet::Element;\n- 69\n- 70 protected:\n-71 LocalFunctionBase(const std::shared_ptr& data)\n- 72 : data_(data)\n- 73 , localView_(data_->basis->localView())\n- 74 {\n- 75 localDoFs_.reserve(localView_.maxSize());\n- 76 }\n- 77\n-84 LocalFunctionBase(const LocalFunctionBase& other)\n- 85 : data_(other.data_)\n- 86 , localView_(other.localView_)\n- 87 {\n- 88 localDoFs_.reserve(localView_.maxSize());\n- 89 if (bound())\n- 90 localDoFs_ = other.localDoFs_;\n- 91 }\n- 92\n-100 LocalFunctionBase& operator=(const LocalFunctionBase& other)\n- 101 {\n- 102 data_ = other.data_;\n- 103 localView_ = other.localView_;\n- 104 if (bound())\n- 105 localDoFs_ = other.localDoFs_;\n- 106 return *this;\n- 107 }\n- 108\n- 109 public:\n-116 void bind(const Element& element)\n- 117 {\n- 118 localView_.bind(element);\n- 119 // Use cache of full local view size. For a subspace basis,\n- 120 // this may be larger than the number of local DOFs in the\n- 121 // tree. In this case only cache entries associated to local\n- 122 // DOFs in the subspace are filled. Cache entries associated\n- 123 // to local DOFs which are not contained in the subspace will\n- 124 // not be touched.\n- 125 //\n- 126 // Alternatively one could use a cache that exactly fits\n- 127 // the size of the tree. However, this would require to\n- 128 // subtract an offset from localIndex(i) on each cache\n- 129 // access in operator().\n- 130 localDoFs_.resize(localView_.size());\n- 131 const auto& dofs = *data_->coefficients;\n- 132 for (size_type i = 0; i < localView_.tree().size(); ++i)\n- 133 {\n- 134 // For a subspace basis the index-within-tree i\n- 135 // is not the same as the localIndex within the\n- 136 // full local view.\n- 137 size_t localIndex = localView_.tree().localIndex(i);\n- 138 localDoFs_[localIndex] = dofs[localView_.index(localIndex)];\n+71 void bind(const Element& e)\n+ 72 {\n+ 73 rootLocalView_.bind(e);\n+ 74 }\n+ 75\n+80 const Element& element() const\n+ 81 {\n+ 82 return rootLocalView_.element();\n+ 83 }\n+ 84\n+89 void unbind()\n+ 90 {\n+ 91 rootLocalView_.unbind();\n+ 92 }\n+ 93\n+96 bool bound() const\n+ 97 {\n+ 98 return rootLocalView_.bound();\n+ 99 }\n+ 100\n+105 const Tree& tree() const\n+ 106 {\n+ 107 return TypeTree::child(rootLocalView_.tree(), globalBasis_->prefixPath());\n+ 108 }\n+ 109\n+112 size_type size() const\n+ 113 {\n+ 114 return rootLocalView_.size();\n+ 115 }\n+ 116\n+123 size_type maxSize() const\n+ 124 {\n+ 125 return rootLocalView_.maxSize();\n+ 126 }\n+ 127\n+129 MultiIndex index(size_type i) const\n+ 130 {\n+ 131 return rootLocalView_.index(i);\n+ 132 }\n+ 133\n+136 const GlobalBasis& globalBasis() const\n+ 137 {\n+ 138 return *globalBasis_;\n 139 }\n- 140 }\n- 141\n-143 void unbind()\n- 144 {\n- 145 localView_.unbind();\n- 146 }\n- 147\n-149 bool bound() const\n- 150 {\n- 151 return localView_.bound();\n- 152 }\n- 153\n-155 const Element& localContext() const\n- 156 {\n- 157 return localView_.element();\n- 158 }\n- 159\n- 160 protected:\n- 161\n- 162 template\n-163 void assignWith(To& to, const From& from) const\n- 164 {\n- 165 auto from_flat = flatVectorView(from);\n- 166 auto to_flat = flatVectorView(to);\n- 167 assert(from_flat.size() == to_flat.size());\n- 168 for (size_type i = 0; i < to_flat.size(); ++i)\n- 169 to_flat[i] = from_flat[i];\n- 170 }\n- 171\n- 172 template\n-173 decltype(auto) nodeToRangeEntry(const Node& node, const TreePath& treePath,\n-Range& y) const\n- 174 {\n- 175 return (*data_->nodeToRangeEntry)(node, treePath, y);\n- 176 }\n- 177\n-178 std::shared_ptr data_;\n-179 LocalView localView_;\n-180 std::vector localDoFs_;\n- 181 };\n- 182\n- 183protected:\n-184 DiscreteGlobalBasisFunctionBase(const std::shared_ptr& data)\n- 185 : data_(data)\n- 186 {\n- 187 /* Nothing. */\n- 188 }\n- 189\n- 190public:\n- 191\n-193 const Basis& basis() const\n- 194 {\n- 195 return *data_->basis;\n- 196 }\n- 197\n-199 const Vector& dofs() const\n- 200 {\n- 201 return *data_->coefficients;\n- 202 }\n- 203\n-205 const NodeToRangeEntry& nodeToRangeEntry() const\n- 206 {\n- 207 return *data_->nodeToRangeEntry;\n- 208 }\n- 209\n-211 const EntitySet& entitySet() const\n- 212 {\n- 213 return data_->entitySet;\n- 214 }\n- 215\n- 216protected:\n-217 std::shared_ptr data_;\n- 218};\n- 219\n- 220} // namespace ImplDoc\n- 221\n- 222\n- 223\n- 224template\n- 225class DiscreteGlobalBasisFunctionDerivative;\n- 226\n- 264template\n-267class DiscreteGlobalBasisFunction\n- 268 : public ImplDoc::DiscreteGlobalBasisFunctionBase\n- 269{\n- 270 using Base = ImplDoc::DiscreteGlobalBasisFunctionBase;\n- 271 using Data = typename Base::Data;\n- 272\n- 273public:\n-274 using Basis = typename Base::Basis;\n-275 using Vector = typename Base::Vector;\n- 276\n-277 using Domain = typename Base::Domain;\n-278 using Range = R;\n- 279\n-280 using Traits = Imp::GridFunctionTraits;\n- 281\n- 282private:\n- 283\n- 284 template\n- 285 using LocalBasisRange = typename Node::FiniteElement::Traits::\n-LocalBasisType::Traits::RangeType;\n- 286 template\n- 287 using NodeData = typename std::vector>;\n- 288 using PerNodeEvaluationBuffer = typename TypeTree::TreeContainer;\n- 289\n- 290public:\n-291 class LocalFunction\n- 292 : public Base::LocalFunctionBase\n- 293 {\n- 294 using LocalBase = typename Base::LocalFunctionBase;\n- 295 using size_type = typename Base::Tree::size_type;\n- 296 using LocalBase::nodeToRangeEntry;\n- 297\n- 298 public:\n- 299\n-300 using GlobalFunction = DiscreteGlobalBasisFunction;\n-301 using Domain = typename LocalBase::Domain;\n-302 using Range = GlobalFunction::Range;\n-303 using Element = typename LocalBase::Element;\n- 304\n-306 LocalFunction(const DiscreteGlobalBasisFunction& globalFunction)\n- 307 : LocalBase(globalFunction.data_)\n- 308 , evaluationBuffer_(this->localView_.tree())\n- 309 {\n- 310 /* Nothing. */\n- 311 }\n- 312\n-322 Range operator()(const Domain& x) const\n- 323 {\n- 324 Range y;\n- 325 istlVectorBackend(y) = 0;\n- 326\n- 327 TypeTree::forEachLeafNode(this->localView_.tree(), [&](auto&& node, auto&&\n-treePath) {\n- 328 const auto& fe = node.finiteElement();\n- 329 const auto& localBasis = fe.localBasis();\n- 330 auto& shapeFunctionValues = evaluationBuffer_[treePath];\n- 331\n- 332 localBasis.evaluateFunction(x, shapeFunctionValues);\n- 333\n- 334 // Compute linear combinations of basis function jacobian.\n- 335 // Non-scalar coefficients of dimension coeffDim are handled by\n- 336 // processing the coeffDim linear combinations independently\n- 337 // and storing them as entries of an array.\n- 338 using Value = LocalBasisRange< std::decay_t >;\n- 339 static constexpr auto coeffDim = decltype(flatVectorView(this->localDoFs_\n-[node.localIndex(0)]).size())::value;\n- 340 auto values = std::array{};\n- 341 istlVectorBackend(values) = 0;\n- 342 for (size_type i = 0; i < localBasis.size(); ++i)\n- 343 {\n- 344 auto c = flatVectorView(this->localDoFs_[node.localIndex(i)]);\n- 345 for (std::size_t j = 0; j < coeffDim; ++j)\n- 346 values[j].axpy(c[j], shapeFunctionValues[i]);\n- 347 }\n- 348\n- 349 // Assign computed values to node entry of range.\n- 350 // Types are matched using the lexicographic ordering provided by\n-flatVectorView.\n- 351 LocalBase::assignWith(nodeToRangeEntry(node, treePath, y), values);\n- 352 });\n- 353\n- 354 return y;\n- 355 }\n- 356\n-358 friend typename\n-DiscreteGlobalBasisFunctionDerivative::\n-LocalFunction derivative(const LocalFunction& lf)\n- 359 {\n- 360 auto dlf = localFunction\n-(DiscreteGlobalBasisFunctionDerivative(lf.data_));\n- 361 if (lf.bound())\n- 362 dlf.bind(lf.localContext());\n- 363 return dlf;\n- 364 }\n- 365\n- 366 private:\n- 367 mutable PerNodeEvaluationBuffer evaluationBuffer_;\n- 368 };\n- 369\n- 371 template\n-372 DiscreteGlobalBasisFunction(B_T && basis, V_T && coefficients, NTRE_T&&\n-nodeToRangeEntry)\n- 373 : Base(std::make_shared(Data{{basis.gridView()}, wrap_or_move(std::\n-forward(basis)), wrap_or_move(std::forward(coefficients)),\n-wrap_or_move(std::forward(nodeToRangeEntry))}))\n- 374 {}\n- 375\n-377 DiscreteGlobalBasisFunction(std::shared_ptr basis, std::\n-shared_ptr coefficients, std::shared_ptr nodeToRangeEntry)\n- 378 : Base(std::make_shared(Data{{basis->gridView()}, basis,\n-coefficients, nodeToRangeEntry}))\n- 379 {}\n- 380\n-382 Range operator() (const Domain& x) const\n- 383 {\n- 384 // TODO: Implement this using hierarchic search\n- 385 DUNE_THROW(NotImplemented,\"not implemented\");\n- 386 }\n- 387\n-389 friend DiscreteGlobalBasisFunctionDerivative\n-derivative(const DiscreteGlobalBasisFunction& f)\n- 390 {\n- 391 return DiscreteGlobalBasisFunctionDerivative\n-(f.data_);\n- 392 }\n- 393\n-402 friend LocalFunction localFunction(const DiscreteGlobalBasisFunction& t)\n- 403 {\n- 404 return LocalFunction(t);\n- 405 }\n- 406};\n- 407\n- 408\n- 431template\n-432auto makeDiscreteGlobalBasisFunction(B&& basis, V&& vector)\n- 433{\n- 434 using Basis = std::decay_t;\n- 435 using NTREM = HierarchicNodeToRangeMap;\n- 436\n- 437 // Small helper functions to wrap vectors using istlVectorBackend\n- 438 // if they do not already satisfy the VectorBackend interface.\n- 439 auto toConstVectorBackend = [&](auto&& v) -> decltype(auto) {\n- 440 if constexpr (models, decltype(v)>()) {\n- 441 return std::forward(v);\n- 442 } else {\n- 443 return istlVectorBackend(v);\n- 444 }\n- 445 };\n- 446\n- 447 using Vector = std::decay_t\n-(vector)))>;\n- 448 return DiscreteGlobalBasisFunction(\n- 449 std::forward(basis),\n- 450 toConstVectorBackend(std::forward(vector)),\n- 451 HierarchicNodeToRangeMap());\n- 452}\n- 453\n- 454\n- 469template\n-470class DiscreteGlobalBasisFunctionDerivative\n- 471 : public ImplDoc::DiscreteGlobalBasisFunctionBase\n- 472{\n- 473 using Base = ImplDoc::DiscreteGlobalBasisFunctionBase;\n- 474 using Data = typename Base::Data;\n- 475\n- 476public:\n-477 using DiscreteGlobalBasisFunction = DGBF;\n- 478\n-479 using Basis = typename Base::Basis;\n-480 using Vector = typename Base::Vector;\n- 481\n-482 using Domain = typename Base::Domain;\n-483 using Range = typename SignatureTraits::Range;\n- 484\n-485 using Traits = Imp::GridFunctionTraits;\n- 486\n- 487private:\n- 488\n- 489 template\n- 490 using LocalBasisRange = typename Node::FiniteElement::Traits::\n-LocalBasisType::Traits::JacobianType;\n- 491 template\n- 492 using NodeData = typename std::vector< LocalBasisRange >;\n- 493 using PerNodeEvaluationBuffer = typename TypeTree::TreeContainer;\n- 494\n- 495public:\n- 496\n-504 class LocalFunction\n- 505 : public Base::LocalFunctionBase\n- 506 {\n- 507 using LocalBase = typename Base::LocalFunctionBase;\n- 508 using size_type = typename Base::Tree::size_type;\n- 509 using LocalBase::nodeToRangeEntry;\n- 510\n- 511 public:\n-512 using GlobalFunction = DiscreteGlobalBasisFunctionDerivative;\n-513 using Domain = typename LocalBase::Domain;\n-514 using Range = GlobalFunction::Range;\n-515 using Element = typename LocalBase::Element;\n- 516\n-518 LocalFunction(const GlobalFunction& globalFunction)\n- 519 : LocalBase(globalFunction.data_)\n- 520 , evaluationBuffer_(this->localView_.tree())\n- 521 {\n- 522 /* Nothing. */\n- 523 }\n- 524\n-531 void bind(const Element& element)\n- 532 {\n- 533 LocalBase::bind(element);\n- 534 geometry_.emplace(element.geometry());\n- 535 }\n- 536\n-538 void unbind()\n- 539 {\n- 540 geometry_.reset();\n- 541 LocalBase::unbind();\n- 542 }\n- 543\n-557 Range operator()(const Domain& x) const\n- 558 {\n- 559 Range y;\n- 560 istlVectorBackend(y) = 0;\n- 561\n- 562 const auto& jacobianInverse = geometry_->jacobianInverse(x);\n- 563\n- 564 TypeTree::forEachLeafNode(this->localView_.tree(), [&](auto&& node, auto&&\n-treePath) {\n- 565 const auto& fe = node.finiteElement();\n- 566 const auto& localBasis = fe.localBasis();\n- 567 auto& shapeFunctionJacobians = evaluationBuffer_[treePath];\n- 568\n- 569 localBasis.evaluateJacobian(x, shapeFunctionJacobians);\n- 570\n- 571 // Compute linear combinations of basis function jacobian.\n- 572 // Non-scalar coefficients of dimension coeffDim are handled by\n- 573 // processing the coeffDim linear combinations independently\n- 574 // and storing them as entries of an array.\n- 575 using RefJacobian = LocalBasisRange< std::decay_t >;\n- 576 static constexpr auto coeffDim = decltype(flatVectorView(this->localDoFs_\n-[node.localIndex(0)]).size())::value;\n- 577 auto refJacobians = std::array{};\n- 578 istlVectorBackend(refJacobians) = 0;\n- 579 for (size_type i = 0; i < localBasis.size(); ++i)\n- 580 {\n- 581 auto c = flatVectorView(this->localDoFs_[node.localIndex(i)]);\n- 582 for (std::size_t j = 0; j < coeffDim; ++j)\n- 583 refJacobians[j].axpy(c[j], shapeFunctionJacobians[i]);\n- 584 }\n- 585\n- 586 // Transform Jacobians form local to global coordinates.\n- 587 using Jacobian = decltype(refJacobians[0] * jacobianInverse);\n- 588 auto jacobians = std::array{};\n- 589 std::transform(\n- 590 refJacobians.begin(), refJacobians.end(), jacobians.begin(),\n- 591 [&](const auto& refJacobian) { return refJacobian * jacobianInverse; });\n- 592\n- 593 // Assign computed Jacobians to node entry of range.\n- 594 // Types are matched using the lexicographic ordering provided by\n-flatVectorView.\n- 595 LocalBase::assignWith(nodeToRangeEntry(node, treePath, y), jacobians);\n- 596 });\n- 597\n- 598 return y;\n- 599 }\n- 600\n-602 friend typename Traits::LocalFunctionTraits::DerivativeInterface derivative\n-(const LocalFunction&)\n- 603 {\n- 604 DUNE_THROW(NotImplemented, \"derivative of derivative is not implemented\");\n- 605 }\n- 606\n- 607 private:\n- 608 mutable PerNodeEvaluationBuffer evaluationBuffer_;\n- 609 std::optional geometry_;\n- 610 };\n- 611\n-618 DiscreteGlobalBasisFunctionDerivative(const std::shared_ptr&\n-data)\n- 619 : Base(data)\n- 620 {\n- 621 /* Nothing. */\n- 622 }\n- 623\n-625 Range operator()(const Domain& x) const\n- 626 {\n- 627 // TODO: Implement this using hierarchic search\n- 628 DUNE_THROW(NotImplemented,\"not implemented\");\n- 629 }\n- 630\n-631 friend typename Traits::DerivativeInterface derivative(const\n-DiscreteGlobalBasisFunctionDerivative& f)\n- 632 {\n- 633 DUNE_THROW(NotImplemented, \"derivative of derivative is not implemented\");\n- 634 }\n- 635\n-637 friend LocalFunction localFunction(const\n-DiscreteGlobalBasisFunctionDerivative& f)\n- 638 {\n- 639 return LocalFunction(f);\n- 640 }\n- 641};\n- 642\n- 643\n- 644} // namespace Functions\n- 645} // namespace Dune\n- 646\n- 647#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_DISCRETEGLOBALBASISFUNCTIONS_HH\n-istlvectorbackend.hh\n-gridviewentityset.hh\n-gridfunction.hh\n-flatvectorview.hh\n-hierarchicnodetorangemap.hh\n-Dune::Functions::DiscreteGlobalBasisFunction::makeDiscreteGlobalBasisFunction\n-auto makeDiscreteGlobalBasisFunction(B &&basis, V &&vector)\n-Generate a DiscreteGlobalBasisFunction.\n-Definition: discreteglobalbasisfunction.hh:432\n-Dune::Functions::istlVectorBackend\n-auto istlVectorBackend(Vector &v)\n-Return a vector backend wrapping non-const ISTL like containers.\n-Definition: istlvectorbackend.hh:346\n+ 140\n+141 const RootLocalView& rootLocalView() const\n+ 142 {\n+ 143 return rootLocalView_;\n+ 144 }\n+ 145\n+ 146protected:\n+147 const GlobalBasis* globalBasis_;\n+148 RootLocalView rootLocalView_;\n+ 149};\n+ 150\n+ 151\n+ 152\n+ 153} // end namespace Functions\n+ 154} // end namespace Dune\n+ 155\n+ 156\n+ 157\n+ 158#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::flatVectorView\n-auto flatVectorView(T &t)\n-Create flat vector view of passed mutable container.\n-Definition: flatvectorview.hh:179\n-Dune::Functions::DefaultDerivativeTraits\n-Default implementation for derivative traits.\n-Definition: defaultderivativetraits.hh:37\n-Dune::Functions::SignatureTraits\n-Helper class to deduce the signature of a callable.\n-Definition: signature.hh:56\n-Dune::Functions::HierarchicNodeToRangeMap\n-A simple node to range map using the nested tree indices.\n-Definition: hierarchicnodetorangemap.hh:30\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase\n-Definition: discreteglobalbasisfunction.hh:28\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::data_\n-std::shared_ptr< const Data > data_\n-Definition: discreteglobalbasisfunction.hh:217\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::dofs\n-const Vector & dofs() const\n-Return the coefficients of this discrete function by reference.\n-Definition: discreteglobalbasisfunction.hh:199\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::Basis\n-B Basis\n-Definition: discreteglobalbasisfunction.hh:30\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::Tree\n-typename Basis::LocalView::Tree Tree\n-Definition: discreteglobalbasisfunction.hh:39\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::Vector\n-V Vector\n-Definition: discreteglobalbasisfunction.hh:31\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::Element\n-typename EntitySet::Element Element\n-Definition: discreteglobalbasisfunction.hh:45\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalDomain\n-typename EntitySet::LocalCoordinate LocalDomain\n-Definition: discreteglobalbasisfunction.hh:44\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::nodeToRangeEntry\n-const NodeToRangeEntry & nodeToRangeEntry() const\n-Return the stored node-to-range map.\n-Definition: discreteglobalbasisfunction.hh:205\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::NodeToRangeEntry\n-NTRE NodeToRangeEntry\n-Definition: discreteglobalbasisfunction.hh:40\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::\n-DiscreteGlobalBasisFunctionBase\n-DiscreteGlobalBasisFunctionBase(const std::shared_ptr< const Data > &data)\n-Definition: discreteglobalbasisfunction.hh:184\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::GridView\n-typename Basis::GridView GridView\n-Definition: discreteglobalbasisfunction.hh:37\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::basis\n-const Basis & basis() const\n-Return a const reference to the stored basis.\n-Definition: discreteglobalbasisfunction.hh:193\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::EntitySet\n-GridViewEntitySet< GridView, 0 > EntitySet\n-Definition: discreteglobalbasisfunction.hh:38\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::entitySet\n-const EntitySet & entitySet() const\n-Get associated set of entities the local-function can be bound to.\n-Definition: discreteglobalbasisfunction.hh:211\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::Domain\n-typename EntitySet::GlobalCoordinate Domain\n-Definition: discreteglobalbasisfunction.hh:42\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::Coefficient\n-Dune::AutonomousValue< decltype(std::declval< Vector >()[std::declval< typename\n-Basis::MultiIndex >()])> Coefficient\n-Definition: discreteglobalbasisfunction.hh:35\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::Data\n-Definition: discreteglobalbasisfunction.hh:53\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::Data::entitySet\n-EntitySet entitySet\n-Definition: discreteglobalbasisfunction.hh:54\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::Data::\n-nodeToRangeEntry\n-std::shared_ptr< const NodeToRangeEntry > nodeToRangeEntry\n-Definition: discreteglobalbasisfunction.hh:57\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::Data::basis\n-std::shared_ptr< const Basis > basis\n-Definition: discreteglobalbasisfunction.hh:55\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::Data::coefficients\n-std::shared_ptr< const Vector > coefficients\n-Definition: discreteglobalbasisfunction.hh:56\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase\n-Definition: discreteglobalbasisfunction.hh:62\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::\n-operator=\n-LocalFunctionBase & operator=(const LocalFunctionBase &other)\n-Copy-assignment of the local-function.\n-Definition: discreteglobalbasisfunction.hh:100\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::\n-bound\n-bool bound() const\n-Check if LocalFunction is already bound to an element.\n-Definition: discreteglobalbasisfunction.hh:149\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::\n-bind\n-void bind(const Element &element)\n-Bind LocalFunction to grid element.\n-Definition: discreteglobalbasisfunction.hh:116\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::\n-Element\n-typename EntitySet::Element Element\n-Definition: discreteglobalbasisfunction.hh:68\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::\n-localContext\n-const Element & localContext() const\n-Return the element the local-function is bound to.\n-Definition: discreteglobalbasisfunction.hh:155\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::\n-LocalFunctionBase\n-LocalFunctionBase(const LocalFunctionBase &other)\n-Copy-construct the local-function.\n-Definition: discreteglobalbasisfunction.hh:84\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::\n-localDoFs_\n-std::vector< Coefficient > localDoFs_\n-Definition: discreteglobalbasisfunction.hh:180\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::\n-assignWith\n-void assignWith(To &to, const From &from) const\n-Definition: discreteglobalbasisfunction.hh:163\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::\n-data_\n-std::shared_ptr< const Data > data_\n-Definition: discreteglobalbasisfunction.hh:178\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::\n-nodeToRangeEntry\n-decltype(auto) nodeToRangeEntry(const Node &node, const TreePath &treePath,\n-Range &y) const\n-Definition: discreteglobalbasisfunction.hh:173\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::\n-localView_\n-LocalView localView_\n-Definition: discreteglobalbasisfunction.hh:179\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::\n-unbind\n-void unbind()\n-Unbind the local-function.\n-Definition: discreteglobalbasisfunction.hh:143\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::\n-Domain\n-LocalDomain Domain\n-Definition: discreteglobalbasisfunction.hh:67\n-Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase::\n-LocalFunctionBase\n-LocalFunctionBase(const std::shared_ptr< const Data > &data)\n-Definition: discreteglobalbasisfunction.hh:71\n-Dune::Functions::DiscreteGlobalBasisFunctionDerivative\n-Derivative of a DiscreteGlobalBasisFunction\n-Definition: discreteglobalbasisfunction.hh:472\n-Dune::Functions::DiscreteGlobalBasisFunctionDerivative::Basis\n-typename Base::Basis Basis\n-Definition: discreteglobalbasisfunction.hh:479\n-Dune::Functions::DiscreteGlobalBasisFunctionDerivative::derivative\n-friend Traits::DerivativeInterface derivative(const\n-DiscreteGlobalBasisFunctionDerivative &f)\n-Definition: discreteglobalbasisfunction.hh:631\n-Dune::Functions::DiscreteGlobalBasisFunctionDerivative::operator()\n-Range operator()(const Domain &x) const\n-Not implemented.\n-Definition: discreteglobalbasisfunction.hh:625\n-Dune::Functions::DiscreteGlobalBasisFunctionDerivative::Range\n-typename SignatureTraits< typename DiscreteGlobalBasisFunction::Traits::\n-DerivativeInterface >::Range Range\n-Definition: discreteglobalbasisfunction.hh:483\n-Dune::Functions::DiscreteGlobalBasisFunctionDerivative::localFunction\n-friend LocalFunction localFunction(const DiscreteGlobalBasisFunctionDerivative\n-&f)\n-Construct local function from a DiscreteGlobalBasisFunctionDerivative\n-Definition: discreteglobalbasisfunction.hh:637\n-Dune::Functions::DiscreteGlobalBasisFunctionDerivative::\n-DiscreteGlobalBasisFunctionDerivative\n-DiscreteGlobalBasisFunctionDerivative(const std::shared_ptr< const Data >\n-&data)\n-create object from DiscreateGlobalBasisFunction data\n-Definition: discreteglobalbasisfunction.hh:618\n-Dune::Functions::DiscreteGlobalBasisFunctionDerivative::\n-DiscreteGlobalBasisFunction\n-DGBF DiscreteGlobalBasisFunction\n-Definition: discreteglobalbasisfunction.hh:477\n-Dune::Functions::DiscreteGlobalBasisFunctionDerivative::Vector\n-typename Base::Vector Vector\n-Definition: discreteglobalbasisfunction.hh:480\n-Dune::Functions::DiscreteGlobalBasisFunctionDerivative::Traits\n-Imp::GridFunctionTraits< Range(Domain), typename Base::EntitySet,\n-DefaultDerivativeTraits, 16 > Traits\n-Definition: discreteglobalbasisfunction.hh:485\n-Dune::Functions::DiscreteGlobalBasisFunctionDerivative::Domain\n-typename Base::Domain Domain\n-Definition: discreteglobalbasisfunction.hh:482\n-Dune::Functions::DiscreteGlobalBasisFunction\n-A grid function induced by a global basis and a coefficient vector.\n-Definition: discreteglobalbasisfunction.hh:269\n-Dune::Functions::DiscreteGlobalBasisFunction::derivative\n-friend DiscreteGlobalBasisFunctionDerivative< DiscreteGlobalBasisFunction >\n-derivative(const DiscreteGlobalBasisFunction &f)\n-Derivative of the DiscreteGlobalBasisFunction\n-Definition: discreteglobalbasisfunction.hh:389\n-Dune::Functions::DiscreteGlobalBasisFunction::DiscreteGlobalBasisFunction\n-DiscreteGlobalBasisFunction(B_T &&basis, V_T &&coefficients, NTRE_T\n-&&nodeToRangeEntry)\n-Create a grid-function, by wrapping the arguments in std::shared_ptr.\n-Definition: discreteglobalbasisfunction.hh:372\n-Dune::Functions::DiscreteGlobalBasisFunction::DiscreteGlobalBasisFunction\n-DiscreteGlobalBasisFunction(std::shared_ptr< const Basis > basis, std::\n-shared_ptr< const V > coefficients, std::shared_ptr< const typename Base::\n-NodeToRangeEntry > nodeToRangeEntry)\n-Create a grid-function, by moving the arguments in std::shared_ptr.\n-Definition: discreteglobalbasisfunction.hh:377\n-Dune::Functions::DiscreteGlobalBasisFunction::localFunction\n-friend LocalFunction localFunction(const DiscreteGlobalBasisFunction &t)\n-Construct local function from a DiscreteGlobalBasisFunction.\n-Definition: discreteglobalbasisfunction.hh:402\n-Dune::Functions::DiscreteGlobalBasisFunction::Basis\n-typename Base::Basis Basis\n-Definition: discreteglobalbasisfunction.hh:274\n-Dune::Functions::DiscreteGlobalBasisFunction::Traits\n-Imp::GridFunctionTraits< Range(Domain), typename Base::EntitySet,\n-DefaultDerivativeTraits, 16 > Traits\n-Definition: discreteglobalbasisfunction.hh:280\n-Dune::Functions::DiscreteGlobalBasisFunction::Range\n-R Range\n-Definition: discreteglobalbasisfunction.hh:278\n-Dune::Functions::DiscreteGlobalBasisFunction::Vector\n-typename Base::Vector Vector\n-Definition: discreteglobalbasisfunction.hh:275\n-Dune::Functions::DiscreteGlobalBasisFunction::Domain\n-typename Base::Domain Domain\n-Definition: discreteglobalbasisfunction.hh:277\n-Dune::Functions::DiscreteGlobalBasisFunction::LocalFunction\n-Definition: discreteglobalbasisfunction.hh:293\n-Dune::Functions::DiscreteGlobalBasisFunction::LocalFunction::Range\n-GlobalFunction::Range Range\n-Definition: discreteglobalbasisfunction.hh:302\n-Dune::Functions::DiscreteGlobalBasisFunction::LocalFunction::LocalFunction\n-LocalFunction(const DiscreteGlobalBasisFunction &globalFunction)\n-Create a local-function from the associated grid-function.\n-Definition: discreteglobalbasisfunction.hh:306\n-Dune::Functions::DiscreteGlobalBasisFunction::LocalFunction::derivative\n-friend DiscreteGlobalBasisFunctionDerivative< DiscreteGlobalBasisFunction >::\n-LocalFunction derivative(const LocalFunction &lf)\n-Local function of the derivative.\n-Definition: discreteglobalbasisfunction.hh:358\n-Dune::Functions::DiscreteGlobalBasisFunction::LocalFunction::operator()\n-Range operator()(const Domain &x) const\n-Evaluate this local-function in coordinates x in the bound element.\n-Definition: discreteglobalbasisfunction.hh:322\n-Dune::Functions::DiscreteGlobalBasisFunctionDerivative::LocalFunction\n-local function evaluating the derivative in reference coordinates\n-Definition: discreteglobalbasisfunction.hh:506\n-Dune::Functions::DiscreteGlobalBasisFunctionDerivative::LocalFunction::operator\n-()\n-Range operator()(const Domain &x) const\n-Evaluate this local-function in coordinates x in the bound element.\n-Definition: discreteglobalbasisfunction.hh:557\n-Dune::Functions::DiscreteGlobalBasisFunctionDerivative::LocalFunction::\n-derivative\n-friend Traits::LocalFunctionTraits::DerivativeInterface derivative(const\n-LocalFunction &)\n-Not implemented.\n-Definition: discreteglobalbasisfunction.hh:602\n-Dune::Functions::DiscreteGlobalBasisFunctionDerivative::LocalFunction::Range\n-GlobalFunction::Range Range\n-Definition: discreteglobalbasisfunction.hh:514\n-Dune::Functions::DiscreteGlobalBasisFunctionDerivative::LocalFunction::unbind\n+Dune::Functions::SubspaceBasis\n+SubspaceBasis(const RB &, const TP) -> SubspaceBasis< RB, TP >\n+Dune::Functions::SubspaceBasis\n+Definition: subspacebasis.hh:38\n+Dune::Functions::SubspaceBasis::GridView\n+typename RootBasis::GridView GridView\n+The grid view that the FE space is defined on.\n+Definition: subspacebasis.hh:48\n+Dune::Functions::SubspaceBasis::prefixPath\n+const PrefixPath & prefixPath() const\n+Definition: subspacebasis.hh:118\n+Dune::Functions::SubspaceLocalView\n+The restriction of a finite element basis to a single element.\n+Definition: subspacelocalview.hh:30\n+Dune::Functions::SubspaceLocalView::Tree\n+typename TypeTree::ChildForTreePath< RootTree, PrefixPath > Tree\n+Tree of local finite elements / local shape function sets.\n+Definition: subspacelocalview.hh:53\n+Dune::Functions::SubspaceLocalView::unbind\n void unbind()\n-Unbind the local-function.\n-Definition: discreteglobalbasisfunction.hh:538\n-Dune::Functions::DiscreteGlobalBasisFunctionDerivative::LocalFunction::\n-LocalFunction\n-LocalFunction(const GlobalFunction &globalFunction)\n-Create a local function from the associated grid function.\n-Definition: discreteglobalbasisfunction.hh:518\n-Dune::Functions::DiscreteGlobalBasisFunctionDerivative::LocalFunction::bind\n-void bind(const Element &element)\n-Bind LocalFunction to grid element.\n-Definition: discreteglobalbasisfunction.hh:531\n-Dune::Functions::GridFunction\n-Definition: gridfunction.hh:32\n-Dune::Functions::GridViewEntitySet<_GridView,_0_>\n-Dune::Functions::GridViewEntitySet<_GridView,_0_>::Element\n-GridView::template Codim< codim >::Entity Element\n-Type of Elements contained in this EntitySet.\n-Definition: gridviewentityset.hh:32\n-Dune::Functions::GridViewEntitySet<_GridView,_0_>::LocalCoordinate\n-Element::Geometry::LocalCoordinate LocalCoordinate\n-Type of local coordinates with respect to the Element.\n-Definition: gridviewentityset.hh:35\n-Dune::Functions::GridViewEntitySet<_GridView,_0_>::GlobalCoordinate\n-Element::Geometry::GlobalCoordinate GlobalCoordinate\n-Definition: gridviewentityset.hh:36\n+Unbind from the current element.\n+Definition: subspacelocalview.hh:89\n+Dune::Functions::SubspaceLocalView::element\n+const Element & element() const\n+Return the grid element that the view is bound to.\n+Definition: subspacelocalview.hh:80\n+Dune::Functions::SubspaceLocalView::globalBasis_\n+const GlobalBasis * globalBasis_\n+Definition: subspacelocalview.hh:147\n+Dune::Functions::SubspaceLocalView::bound\n+bool bound() const\n+Return if the view is bound to a grid element.\n+Definition: subspacelocalview.hh:96\n+Dune::Functions::SubspaceLocalView::MultiIndex\n+typename RootLocalView::MultiIndex MultiIndex\n+Type used for global numbering of the basis vectors.\n+Definition: subspacelocalview.hh:56\n+Dune::Functions::SubspaceLocalView::size\n+size_type size() const\n+Total number of degrees of freedom on this element.\n+Definition: subspacelocalview.hh:112\n+Dune::Functions::SubspaceLocalView::rootLocalView_\n+RootLocalView rootLocalView_\n+Definition: subspacelocalview.hh:148\n+Dune::Functions::SubspaceLocalView::bind\n+void bind(const Element &e)\n+Bind the view to a grid element.\n+Definition: subspacelocalview.hh:71\n+Dune::Functions::SubspaceLocalView::GridView\n+typename GlobalBasis::GridView GridView\n+The grid view the global FE basis lives on.\n+Definition: subspacelocalview.hh:41\n+Dune::Functions::SubspaceLocalView::SubspaceLocalView\n+SubspaceLocalView(const GlobalBasis &globalBasis, const PrefixPath &)\n+Construct local view for a given global finite element basis.\n+Definition: subspacelocalview.hh:59\n+Dune::Functions::SubspaceLocalView::RootLocalView\n+RLV RootLocalView\n+Definition: subspacelocalview.hh:35\n+Dune::Functions::SubspaceLocalView::rootLocalView\n+const RootLocalView & rootLocalView() const\n+Definition: subspacelocalview.hh:141\n+Dune::Functions::SubspaceLocalView::size_type\n+std::size_t size_type\n+The type used for sizes.\n+Definition: subspacelocalview.hh:47\n+Dune::Functions::SubspaceLocalView::Element\n+typename GridView::template Codim< 0 >::Entity Element\n+Type of the grid element we are bound to.\n+Definition: subspacelocalview.hh:44\n+Dune::Functions::SubspaceLocalView::globalBasis\n+const GlobalBasis & globalBasis() const\n+Return the global basis that we are a view on.\n+Definition: subspacelocalview.hh:136\n+Dune::Functions::SubspaceLocalView::maxSize\n+size_type maxSize() const\n+Maximum local size for any element on the GridView.\n+Definition: subspacelocalview.hh:123\n+Dune::Functions::SubspaceLocalView::tree\n+const Tree & tree() const\n+Return the local ansatz tree associated to the bound entity.\n+Definition: subspacelocalview.hh:105\n+Dune::Functions::SubspaceLocalView::index\n+MultiIndex index(size_type i) const\n+Maps from subtree index set [0..size-1] to a globally unique multi index in\n+global basis.\n+Definition: subspacelocalview.hh:129\n+Dune::Functions::SubspaceLocalView::RootTree\n+typename RootLocalView::Tree RootTree\n+Tree of local finite elements / local shape function sets.\n+Definition: subspacelocalview.hh:50\n concepts.hh\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00104.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00104.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: localderivativetraits.hh File Reference\n+dune-functions: subspacebasis.hh File Reference\n \n \n \n \n \n \n \n@@ -58,44 +58,61 @@\n \n \n \n \n \n
    \n \n-
    localderivativetraits.hh File Reference
    \n+Namespaces |\n+Functions
    \n+
    subspacebasis.hh File Reference
    \n \n
    \n-
    #include <dune/functions/common/defaultderivativetraits.hh>
    \n+
    #include <dune/common/reservedvector.hh>
    \n+#include <dune/common/typeutilities.hh>
    \n+#include <dune/common/concept.hh>
    \n+#include <dune/functions/common/type_traits.hh>
    \n+#include <dune/functions/functionspacebases/subspacelocalview.hh>
    \n+#include <dune/functions/functionspacebases/concepts.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n-\n-\n-\n-\n+\n \n

    \n 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::SubspaceBasis< RB, TP >
     
    \n \n \n \n \n \n+

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n

    \n+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. More...
     
    template<class RootBasis , class... PrefixTreeIndices>
    auto Dune::Functions::subspaceBasis (const RootBasis &rootBasis, const PrefixTreeIndices &... prefixTreeIndices)
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,30 +4,48 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * gridfunctions\n-Classes | Namespaces\n-localderivativetraits.hh File Reference\n-#include \n+ * functionspacebases\n+Classes | Namespaces | Functions\n+subspacebasis.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0Dune::Functions::LocalDerivativeTraits<_EntitySet,_DerivativeTraits_>\n-\u00a0 Derivative traits for local functions. More...\n-\u00a0\n-struct \u00a0Dune::Functions::LocalDerivativeTraits<_EntitySet,_DerivativeTraits\n- >::Traits<_Signature_>\n-\u00a0\n-struct \u00a0Dune::Functions::LocalDerivativeTraits<_EntitySet,_DerivativeTraits\n- >::Traits<_R(LocalDomain)>\n+class \u00a0Dune::Functions::SubspaceBasis<_RB,_TP_>\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n+ Functions\n+template\n+ \u00a0Dune::Functions::SubspaceBasis (const RB &, const TP) -> SubspaceBasis<\n+ RB, TP >\n+\u00a0\n+template\n+ \u00a0Dune::Functions::SubspaceBasis (const SubspaceBasis< RootRootBasis,\n+ InnerTP > &rootBasis, const OuterTP &prefixPath) -> SubspaceBasis< std::\n+ decay_t< decltype(rootBasis.rootBasis())>, Impl::JoinTreePath_t< InnerTP,\n+ OuterTP > >\n+\u00a0\n+template\n+auto\u00a0Dune::Functions::subspaceBasis (const RootBasis &rootBasis, const\n+ TypeTree::HybridTreePath< PrefixTreeIndices... > &prefixPath)\n+\u00a0 Create SubspaceBasis from a root basis and a prefixPath. More...\n+\u00a0\n+template\n+auto\u00a0Dune::Functions::subspaceBasis (const RootBasis &rootBasis, const\n+ PrefixTreeIndices &... prefixTreeIndices)\n+\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00104_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00104_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: localderivativetraits.hh Source File\n+dune-functions: subspacebasis.hh Source File\n \n \n \n \n \n \n \n@@ -58,66 +58,188 @@\n \n
    \n \n \n \n
    \n-
    localderivativetraits.hh
    \n+
    subspacebasis.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH
    \n-
    4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACEBASIS_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACEBASIS_HH
    \n
    5
    \n-
    6
    \n-\n-
    8
    \n+
    6#include <dune/common/reservedvector.hh>
    \n+
    7#include <dune/common/typeutilities.hh>
    \n+
    8#include <dune/common/concept.hh>
    \n
    9
    \n-
    10namespace Dune {
    \n-
    11namespace Functions {
    \n-
    12
    \n+\n+\n+\n
    13
    \n-
    26template<class EntitySet, template<class> class DerivativeTraits=DefaultDerivativeTraits>
    \n-\n-
    28{
    \n-
    29 using LocalDomain = typename EntitySet::LocalCoordinate;
    \n-
    30 using Domain = typename EntitySet::GlobalCoordinate;
    \n+
    14
    \n+
    15
    \n+
    16namespace Dune {
    \n+
    17namespace Functions {
    \n+
    18
    \n+
    19
    \n+
    20
    \n+
    21namespace Impl {
    \n+
    22
    \n+
    23 template<class... Inner, class... Outer>
    \n+
    24 auto joinTreePaths(const TypeTree::HybridTreePath<Inner...>& inner, const TypeTree::HybridTreePath<Outer...> outer)
    \n+
    25 {
    \n+
    26 return TypeTree::HybridTreePath<Inner..., Outer...>(std::tuple_cat(inner._data, outer._data));
    \n+
    27 }
    \n+
    28
    \n+
    29 template<class InnerTP, class OuterTP>
    \n+
    30 using JoinTreePath_t = std::decay_t<decltype(joinTreePaths(std::declval<InnerTP>(), std::declval<OuterTP>()))>;
    \n
    31
    \n-
    32 template<class Signature>
    \n-
    33 struct Traits
    \n-
    34 {
    \n-\n-
    36 };
    \n-
    37
    \n-
    38 template<class R>
    \n-\n-
    40 {
    \n-
    41 using Range = typename DerivativeTraits<R(Domain)>::Range;
    \n-
    42 };
    \n-
    43};
    \n+
    32}
    \n+
    33
    \n+
    34
    \n+
    35
    \n+
    36template<class RB, class TP>
    \n+\n+
    38{
    \n+
    39public:
    \n+
    40
    \n+
    41 using RootBasis = RB;
    \n+
    42
    \n+
    43 using RootLocalView = typename RootBasis::LocalView;
    \n
    44
    \n-
    45
    \n-
    46}} // namespace Dune::Functions
    \n-
    47
    \n-
    48#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH
    \n-\n+
    45 using PrefixPath = TP;
    \n+
    46
    \n+
    48 using GridView = typename RootBasis::GridView;
    \n+
    49
    \n+
    51 using MultiIndex = typename RootBasis::MultiIndex;
    \n+
    52
    \n+
    53 using size_type = std::size_t;
    \n+
    54
    \n+\n+
    57
    \n+
    58 using SizePrefix = typename RootBasis::SizePrefix;
    \n+
    59
    \n+
    60
    \n+\n+\n+\n+
    65 {}
    \n+
    66
    \n+
    72 template<class RootRootBasis, class InnerTP, class OuterTP>
    \n+\n+\n+
    75 {}
    \n+
    76
    \n+
    77
    \n+
    80 const GridView& gridView() const
    \n+
    81 {
    \n+
    82 return rootBasis_->gridView();
    \n+
    83 }
    \n+
    84
    \n+\n+
    89 {
    \n+
    90 return rootBasis_->dimension();
    \n+
    91 }
    \n+
    92
    \n+\n+
    95 {
    \n+
    96 return rootBasis_->size();
    \n+
    97 }
    \n+
    98
    \n+
    100 size_type size(const SizePrefix& prefix) const
    \n+
    101 {
    \n+
    102 return rootBasis_->size(prefix);
    \n+
    103 }
    \n+
    104
    \n+\n+
    109 {
    \n+
    110 return LocalView(*this, prefixPath_);
    \n+
    111 }
    \n+
    112
    \n+
    113 const RootBasis& rootBasis() const
    \n+
    114 {
    \n+
    115 return *rootBasis_;
    \n+
    116 }
    \n+
    117
    \n+
    118 const PrefixPath& prefixPath() const
    \n+
    119 {
    \n+
    120 return prefixPath_;
    \n+
    121 }
    \n+
    122
    \n+
    123protected:
    \n+\n+\n+
    126};
    \n+
    127
    \n+
    128
    \n+
    129// CTAD guide for a non-SubspaceBasis root basis
    \n+
    130template<class RB, class TP>
    \n+
    131SubspaceBasis(const RB&, const TP) -> SubspaceBasis<RB, TP>;
    \n+
    132
    \n+
    133// CTAD guide for a SubspaceBasis root basis
    \n+
    134template<class RootRootBasis, class InnerTP, class OuterTP>
    \n+
    135SubspaceBasis(const SubspaceBasis<RootRootBasis, InnerTP>& rootBasis, const OuterTP& prefixPath)
    \n+
    136 -> SubspaceBasis<std::decay_t<decltype(rootBasis.rootBasis())>, Impl::JoinTreePath_t<InnerTP, OuterTP>>;
    \n+
    137
    \n+
    138
    \n+
    139
    \n+
    150template<class RootBasis, class... PrefixTreeIndices>
    \n+
    151auto subspaceBasis(const RootBasis& rootBasis, const TypeTree::HybridTreePath<PrefixTreeIndices...>& prefixPath)
    \n+
    152{
    \n+
    153 return SubspaceBasis(rootBasis, prefixPath);
    \n+
    154}
    \n+
    155
    \n+
    156template<class RootBasis, class... PrefixTreeIndices>
    \n+
    157auto subspaceBasis(const RootBasis& rootBasis, const PrefixTreeIndices&... prefixTreeIndices)
    \n+
    158{
    \n+
    159 return subspaceBasis(rootBasis, TypeTree::hybridTreePath(prefixTreeIndices...));
    \n+
    160}
    \n+
    161
    \n+
    162
    \n+
    163
    \n+
    164} // end namespace Functions
    \n+
    165} // end namespace Dune
    \n+
    166
    \n+
    167
    \n+
    168
    \n+
    169#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH
    \n+\n+\n
    Definition: polynomial.hh:10
    \n-
    Dummy range class to be used if no proper type is available.
    Definition: defaultderivativetraits.hh:23
    \n-
    Derivative traits for local functions.
    Definition: localderivativetraits.hh:28
    \n-
    typename EntitySet::GlobalCoordinate Domain
    Definition: localderivativetraits.hh:30
    \n-
    typename EntitySet::LocalCoordinate LocalDomain
    Definition: localderivativetraits.hh:29
    \n-
    Definition: localderivativetraits.hh:34
    \n-
    InvalidRange Range
    Definition: localderivativetraits.hh:35
    \n-
    typename DerivativeTraits< R(Domain)>::Range Range
    Definition: localderivativetraits.hh:41
    \n+
    SubspaceBasis(const RB &, const TP) -> SubspaceBasis< RB, TP >
    \n+
    auto subspaceBasis(const RootBasis &rootBasis, const TypeTree::HybridTreePath< PrefixTreeIndices... > &prefixPath)
    Create SubspaceBasis from a root basis and a prefixPath.
    Definition: subspacebasis.hh:151
    \n+
    Definition: subspacebasis.hh:38
    \n+
    typename RootBasis::LocalView RootLocalView
    Definition: subspacebasis.hh:43
    \n+
    LocalView localView() const
    Return local view for basis.
    Definition: subspacebasis.hh:108
    \n+
    const RootBasis * rootBasis_
    Definition: subspacebasis.hh:124
    \n+
    typename RootBasis::SizePrefix SizePrefix
    Definition: subspacebasis.hh:58
    \n+
    TP PrefixPath
    Definition: subspacebasis.hh:45
    \n+
    SubspaceLocalView< RootLocalView, PrefixPath > LocalView
    Type of the local view on the restriction of the basis to a single element.
    Definition: subspacebasis.hh:56
    \n+
    size_type size(const SizePrefix &prefix) const
    Return number possible values for next position in multi index.
    Definition: subspacebasis.hh:100
    \n+
    typename RootBasis::GridView GridView
    The grid view that the FE space is defined on.
    Definition: subspacebasis.hh:48
    \n+
    const PrefixPath & prefixPath() const
    Definition: subspacebasis.hh:118
    \n+
    SubspaceBasis(const SubspaceBasis< RootRootBasis, InnerTP > &rootBasis, const OuterTP &prefixPath)
    Constructor from another SubspaceBasis.
    Definition: subspacebasis.hh:73
    \n+
    const GridView & gridView() const
    Obtain the grid view that the basis is defined on.
    Definition: subspacebasis.hh:80
    \n+
    RB RootBasis
    Definition: subspacebasis.hh:41
    \n+
    PrefixPath prefixPath_
    Definition: subspacebasis.hh:125
    \n+
    size_type size() const
    Return number of possible values for next position in empty multi index.
    Definition: subspacebasis.hh:94
    \n+
    const RootBasis & rootBasis() const
    Definition: subspacebasis.hh:113
    \n+
    typename RootBasis::MultiIndex MultiIndex
    Type used for global numbering of the basis vectors.
    Definition: subspacebasis.hh:51
    \n+
    size_type dimension() const
    Definition: subspacebasis.hh:88
    \n+
    std::size_t size_type
    Definition: subspacebasis.hh:53
    \n+
    SubspaceBasis(const RootBasis &rootBasis, const PrefixPath &prefixPath)
    Constructor for a given grid view object.
    Definition: subspacebasis.hh:62
    \n+
    The restriction of a finite element basis to a single element.
    Definition: subspacelocalview.hh:30
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,73 +4,247 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * gridfunctions\n-localderivativetraits.hh\n+ * functionspacebases\n+subspacebasis.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH\n- 4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACEBASIS_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACEBASIS_HH\n 5\n- 6\n- 7#include \n- 8\n+ 6#include \n+ 7#include \n+ 8#include \n 9\n- 10namespace Dune {\n- 11namespace Functions {\n- 12\n+ 10#include \n+ 11#include \n+ 12#include \n 13\n- 26template class\n-DerivativeTraits=DefaultDerivativeTraits>\n-27struct LocalDerivativeTraits\n- 28{\n-29 using LocalDomain = typename EntitySet::LocalCoordinate;\n-30 using Domain = typename EntitySet::GlobalCoordinate;\n+ 14\n+ 15\n+ 16namespace Dune {\n+ 17namespace Functions {\n+ 18\n+ 19\n+ 20\n+ 21namespace Impl {\n+ 22\n+ 23 template\n+ 24 auto joinTreePaths(const TypeTree::HybridTreePath& inner, const\n+TypeTree::HybridTreePath outer)\n+ 25 {\n+ 26 return TypeTree::HybridTreePath(std::tuple_cat\n+(inner._data, outer._data));\n+ 27 }\n+ 28\n+ 29 template\n+ 30 using JoinTreePath_t = std::decay_t(), std::declval()))>;\n 31\n- 32 template\n-33 struct Traits\n- 34 {\n-35 typedef InvalidRange Range;\n- 36 };\n- 37\n- 38 template\n-39 struct Traits\n- 40 {\n-41 using Range = typename DerivativeTraits::Range;\n- 42 };\n- 43};\n+ 32}\n+ 33\n+ 34\n+ 35\n+ 36template\n+37class SubspaceBasis\n+ 38{\n+ 39public:\n+ 40\n+41 using RootBasis = RB;\n+ 42\n+43 using RootLocalView = typename RootBasis::LocalView;\n 44\n- 45\n- 46}} // namespace Dune::Functions\n- 47\n- 48#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH\n-defaultderivativetraits.hh\n+45 using PrefixPath = TP;\n+ 46\n+48 using GridView = typename RootBasis::GridView;\n+ 49\n+51 using MultiIndex = typename RootBasis::MultiIndex;\n+ 52\n+53 using size_type = std::size_t;\n+ 54\n+56 using LocalView = SubspaceLocalView;\n+ 57\n+58 using SizePrefix = typename RootBasis::SizePrefix;\n+ 59\n+ 60\n+62 SubspaceBasis(const RootBasis& rootBasis, const PrefixPath& prefixPath) :\n+ 63 rootBasis_(&rootBasis),\n+ 64 prefixPath_(prefixPath)\n+ 65 {}\n+ 66\n+ 72 template\n+73 SubspaceBasis(const SubspaceBasis& rootBasis, const\n+OuterTP& prefixPath) :\n+ 74 SubspaceBasis(rootBasis.rootBasis(), Impl::joinTreePaths\n+(rootBasis.prefixPath(), prefixPath))\n+ 75 {}\n+ 76\n+ 77\n+80 const GridView& gridView() const\n+ 81 {\n+ 82 return rootBasis_->gridView();\n+ 83 }\n+ 84\n+88 size_type dimension() const\n+ 89 {\n+ 90 return rootBasis_->dimension();\n+ 91 }\n+ 92\n+94 size_type size() const\n+ 95 {\n+ 96 return rootBasis_->size();\n+ 97 }\n+ 98\n+100 size_type size(const SizePrefix& prefix) const\n+ 101 {\n+ 102 return rootBasis_->size(prefix);\n+ 103 }\n+ 104\n+108 LocalView localView() const\n+ 109 {\n+ 110 return LocalView(*this, prefixPath_);\n+ 111 }\n+ 112\n+113 const RootBasis& rootBasis() const\n+ 114 {\n+ 115 return *rootBasis_;\n+ 116 }\n+ 117\n+118 const PrefixPath& prefixPath() const\n+ 119 {\n+ 120 return prefixPath_;\n+ 121 }\n+ 122\n+ 123protected:\n+124 const RootBasis* rootBasis_;\n+125 PrefixPath prefixPath_;\n+ 126};\n+ 127\n+ 128\n+ 129// CTAD guide for a non-SubspaceBasis root basis\n+ 130template\n+131SubspaceBasis(const RB&, const TP) -> SubspaceBasis;\n+ 132\n+ 133// CTAD guide for a SubspaceBasis root basis\n+ 134template\n+135SubspaceBasis(const SubspaceBasis& rootBasis, const\n+OuterTP& prefixPath)\n+ 136 -> SubspaceBasis, Impl::\n+JoinTreePath_t>;\n+ 137\n+ 138\n+ 139\n+ 150template\n+151auto subspaceBasis(const RootBasis& rootBasis, const TypeTree::\n+HybridTreePath& prefixPath)\n+ 152{\n+ 153 return SubspaceBasis(rootBasis, prefixPath);\n+ 154}\n+ 155\n+ 156template\n+157auto subspaceBasis(const RootBasis& rootBasis, const PrefixTreeIndices&...\n+prefixTreeIndices)\n+ 158{\n+ 159 return subspaceBasis(rootBasis, TypeTree::hybridTreePath\n+(prefixTreeIndices...));\n+ 160}\n+ 161\n+ 162\n+ 163\n+ 164} // end namespace Functions\n+ 165} // end namespace Dune\n+ 166\n+ 167\n+ 168\n+ 169#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH\n+type_traits.hh\n+subspacelocalview.hh\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::InvalidRange\n-Dummy range class to be used if no proper type is available.\n-Definition: defaultderivativetraits.hh:23\n-Dune::Functions::LocalDerivativeTraits\n-Derivative traits for local functions.\n-Definition: localderivativetraits.hh:28\n-Dune::Functions::LocalDerivativeTraits::Domain\n-typename EntitySet::GlobalCoordinate Domain\n-Definition: localderivativetraits.hh:30\n-Dune::Functions::LocalDerivativeTraits::LocalDomain\n-typename EntitySet::LocalCoordinate LocalDomain\n-Definition: localderivativetraits.hh:29\n-Dune::Functions::LocalDerivativeTraits::Traits\n-Definition: localderivativetraits.hh:34\n-Dune::Functions::LocalDerivativeTraits::Traits::Range\n-InvalidRange Range\n-Definition: localderivativetraits.hh:35\n-Dune::Functions::LocalDerivativeTraits::Traits<_R(LocalDomain)>::Range\n-typename DerivativeTraits< R(Domain)>::Range Range\n-Definition: localderivativetraits.hh:41\n+Dune::Functions::SubspaceBasis\n+SubspaceBasis(const RB &, const TP) -> SubspaceBasis< RB, TP >\n+Dune::Functions::subspaceBasis\n+auto subspaceBasis(const RootBasis &rootBasis, const TypeTree::HybridTreePath<\n+PrefixTreeIndices... > &prefixPath)\n+Create SubspaceBasis from a root basis and a prefixPath.\n+Definition: subspacebasis.hh:151\n+Dune::Functions::SubspaceBasis\n+Definition: subspacebasis.hh:38\n+Dune::Functions::SubspaceBasis::RootLocalView\n+typename RootBasis::LocalView RootLocalView\n+Definition: subspacebasis.hh:43\n+Dune::Functions::SubspaceBasis::localView\n+LocalView localView() const\n+Return local view for basis.\n+Definition: subspacebasis.hh:108\n+Dune::Functions::SubspaceBasis::rootBasis_\n+const RootBasis * rootBasis_\n+Definition: subspacebasis.hh:124\n+Dune::Functions::SubspaceBasis::SizePrefix\n+typename RootBasis::SizePrefix SizePrefix\n+Definition: subspacebasis.hh:58\n+Dune::Functions::SubspaceBasis::PrefixPath\n+TP PrefixPath\n+Definition: subspacebasis.hh:45\n+Dune::Functions::SubspaceBasis::LocalView\n+SubspaceLocalView< RootLocalView, PrefixPath > LocalView\n+Type of the local view on the restriction of the basis to a single element.\n+Definition: subspacebasis.hh:56\n+Dune::Functions::SubspaceBasis::size\n+size_type size(const SizePrefix &prefix) const\n+Return number possible values for next position in multi index.\n+Definition: subspacebasis.hh:100\n+Dune::Functions::SubspaceBasis::GridView\n+typename RootBasis::GridView GridView\n+The grid view that the FE space is defined on.\n+Definition: subspacebasis.hh:48\n+Dune::Functions::SubspaceBasis::prefixPath\n+const PrefixPath & prefixPath() const\n+Definition: subspacebasis.hh:118\n+Dune::Functions::SubspaceBasis::SubspaceBasis\n+SubspaceBasis(const SubspaceBasis< RootRootBasis, InnerTP > &rootBasis, const\n+OuterTP &prefixPath)\n+Constructor from another SubspaceBasis.\n+Definition: subspacebasis.hh:73\n+Dune::Functions::SubspaceBasis::gridView\n+const GridView & gridView() const\n+Obtain the grid view that the basis is defined on.\n+Definition: subspacebasis.hh:80\n+Dune::Functions::SubspaceBasis::RootBasis\n+RB RootBasis\n+Definition: subspacebasis.hh:41\n+Dune::Functions::SubspaceBasis::prefixPath_\n+PrefixPath prefixPath_\n+Definition: subspacebasis.hh:125\n+Dune::Functions::SubspaceBasis::size\n+size_type size() const\n+Return number of possible values for next position in empty multi index.\n+Definition: subspacebasis.hh:94\n+Dune::Functions::SubspaceBasis::rootBasis\n+const RootBasis & rootBasis() const\n+Definition: subspacebasis.hh:113\n+Dune::Functions::SubspaceBasis::MultiIndex\n+typename RootBasis::MultiIndex MultiIndex\n+Type used for global numbering of the basis vectors.\n+Definition: subspacebasis.hh:51\n+Dune::Functions::SubspaceBasis::dimension\n+size_type dimension() const\n+Definition: subspacebasis.hh:88\n+Dune::Functions::SubspaceBasis::size_type\n+std::size_t size_type\n+Definition: subspacebasis.hh:53\n+Dune::Functions::SubspaceBasis::SubspaceBasis\n+SubspaceBasis(const RootBasis &rootBasis, const PrefixPath &prefixPath)\n+Constructor for a given grid view object.\n+Definition: subspacebasis.hh:62\n+Dune::Functions::SubspaceLocalView\n+The restriction of a finite element basis to a single element.\n+Definition: subspacelocalview.hh:30\n+concepts.hh\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00107.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00107.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: compositebasis.hh File Reference\n+dune-functions: periodicbasis.hh File Reference\n \n \n \n \n \n \n \n@@ -66,58 +66,50 @@\n \n \n
    \n \n-
    compositebasis.hh File Reference
    \n+
    periodicbasis.hh File Reference
    \n
    \n
    \n-
    #include <tuple>
    \n-#include <utility>
    \n-#include <dune/common/std/apply.hh>
    \n-#include <dune/common/hybridutilities.hh>
    \n-#include <dune/common/reservedvector.hh>
    \n-#include <dune/common/typeutilities.hh>
    \n-#include <dune/common/tupleutility.hh>
    \n-#include <dune/common/tuplevector.hh>
    \n-#include <dune/functions/common/staticforloop.hh>
    \n-#include <dune/functions/common/type_traits.hh>
    \n-#include <dune/functions/common/utility.hh>
    \n-#include <dune/functions/functionspacebases/basistags.hh>
    \n-#include <dune/functions/functionspacebases/nodes.hh>
    \n+
    #include <utility>
    \n+#include <type_traits>
    \n+#include <limits>
    \n+#include <set>
    \n+#include <vector>
    \n #include <dune/functions/functionspacebases/concepts.hh>
    \n-#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
    \n+#include <dune/functions/functionspacebases/transformedindexbasis.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n+\n+\n \n

    \n Classes

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    namespace  Dune::Functions::BasisFactory
     
    namespace  Dune::Functions::BasisBuilder
    namespace  Dune::Functions::BasisFactory::Experimental
     
    \n \n-\n-\n-\n-\n+\n+\n+\n+\n

    \n Functions

    template<typename... Args, std::enable_if_t< Concept::isIndexMergingStrategy< typename LastType< Args... >::type >(), int > = 0>
    auto Dune::Functions::BasisFactory::composite (Args &&... args)
     Create a factory builder that can build a CompositePreBasis. More...
     
    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. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,46 +6,38 @@\n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n Classes | Namespaces | Functions\n-compositebasis.hh File Reference\n-#include \n+periodicbasis.hh File Reference\n #include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+#include \n+#include \n+#include \n+#include \n #include \n-#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::CompositePreBasis<_IMS,_SPB_>\n-\u00a0 A pre-basis for composite bases. More...\n+class \u00a0Dune::Functions::BasisFactory::Experimental::PeriodicIndexSet\n+\u00a0 Container storing identified indices for a periodic basis. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n namespace \u00a0Dune::Functions::BasisFactory\n \u00a0\n-namespace \u00a0Dune::Functions::BasisBuilder\n+namespace \u00a0Dune::Functions::BasisFactory::Experimental\n \u00a0\n Functions\n-template::type >(), int > = 0>\n-auto\u00a0Dune::Functions::BasisFactory::composite (Args &&... args)\n-\u00a0 Create a factory builder that can build a CompositePreBasis. More...\n+template\n+auto\u00a0Dune::Functions::BasisFactory::Experimental::periodic\n+ (RawPreBasisIndicator &&rawPreBasisIndicator, PIS &&periodicIndexSet)\n+\u00a0 Create a pre-basis factory that can create a periodic pre-basis. More...\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00107_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00107_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: compositebasis.hh Source File\n+dune-functions: periodicbasis.hh Source File\n \n \n \n \n \n \n \n@@ -62,422 +62,203 @@\n \n \n
    \n
    \n-
    compositebasis.hh
    \n+
    periodicbasis.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_PERIODICBASIS_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_PERIODICBASIS_HH
    \n
    5
    \n-
    6#include <tuple>
    \n-
    7#include <utility>
    \n-
    8
    \n-
    9#include <dune/common/std/apply.hh>
    \n-
    10#include <dune/common/hybridutilities.hh>
    \n-
    11#include <dune/common/reservedvector.hh>
    \n-
    12#include <dune/common/typeutilities.hh>
    \n-
    13#include <dune/common/hybridutilities.hh>
    \n-
    14#include <dune/common/tupleutility.hh>
    \n-
    15#include <dune/common/tuplevector.hh>
    \n-
    16
    \n-\n-\n-\n-\n-\n-\n-\n-
    24
    \n+
    6#include <utility>
    \n+
    7#include <type_traits>
    \n+
    8#include <limits>
    \n+
    9#include <set>
    \n+
    10#include <vector>
    \n+
    11
    \n+\n+\n+
    14
    \n+
    15
    \n+
    16namespace Dune::Functions {
    \n+
    17
    \n+
    18namespace BasisFactory {
    \n+
    19
    \n+
    20// The PeriodicBasis class is in the Experimental namespace because we are
    \n+
    21// not completely sure yet whether we like it. We reserve the right to
    \n+
    22// modify it without advance warning. Use at your own risk!
    \n+
    23
    \n+
    24namespace Experimental {
    \n
    25
    \n-
    26namespace Dune {
    \n-
    27namespace Functions {
    \n-
    28
    \n-
    29// *****************************************************************************
    \n-
    30// This is the reusable part of the composite bases. It contains
    \n-
    31//
    \n-
    32// CompositePreBasis
    \n-
    33//
    \n-
    34// The pre-basis allows to create the others and is the owner of possible shared
    \n-
    35// state. These components do _not_ depend on the global basis and local view
    \n-
    36// and can be used without a global basis.
    \n-
    37// *****************************************************************************
    \n-
    38
    \n+
    26
    \n+\n+
    36{
    \n+
    37 using IndexPairSet = std::set<std::pair<std::size_t,std::size_t>>;
    \n+
    38public:
    \n
    39
    \n-
    51template<class IMS, class... SPB>
    \n-\n-
    53{
    \n-
    54 static const bool isBlocked = std::is_same_v<IMS,BasisFactory::BlockedLexicographic> or std::is_same_v<IMS,BasisFactory::BlockedInterleaved>;
    \n-
    55public:
    \n-
    56
    \n-
    58 using SubPreBases = std::tuple<SPB...>;
    \n-
    59
    \n-
    61 template<std::size_t i>
    \n-
    62 using SubPreBasis = std::tuple_element_t<i, SubPreBases>;
    \n-
    63
    \n-
    65 using GridView = typename std::tuple_element_t<0, SubPreBases>::GridView;
    \n+
    47 void unifyIndexPair(std::size_t a, std::size_t b)
    \n+
    48 {
    \n+
    49 if (a>b)
    \n+
    50 std::swap(a,b);
    \n+
    51 if (a==b)
    \n+
    52 return;
    \n+
    53 indexPairSet_.insert(std::make_pair(a,b));
    \n+
    54 }
    \n+
    55
    \n+
    56 const auto& indexPairSet() const
    \n+
    57 {
    \n+
    58 return indexPairSet_;
    \n+
    59 }
    \n+
    60
    \n+
    61private:
    \n+
    62 IndexPairSet indexPairSet_;
    \n+
    63};
    \n+
    64
    \n+
    65
    \n
    66
    \n-
    68 using size_type = std::size_t;
    \n-
    69
    \n-\n-
    72
    \n-
    73protected:
    \n-
    74 static const std::size_t children = sizeof...(SPB);
    \n+
    67namespace Impl {
    \n+
    68
    \n+
    69// An index transformation for a TransformedIndexPreBasis
    \n+
    70// implementing periodic functions by merging indices.
    \n+
    71// Currently only flat indices are supported.
    \n+
    72class PeriodicIndexingTransformation
    \n+
    73{
    \n+
    74public:
    \n
    75
    \n-
    76 using ChildIndices = std::make_index_sequence<children>;
    \n-
    77
    \n-
    78public:
    \n-
    79
    \n-
    81 using Node = CompositeBasisNode<typename SPB::Node...>;
    \n-
    82
    \n-
    83 static constexpr size_type maxMultiIndexSize = std::max({SPB::maxMultiIndexSize...}) + isBlocked;
    \n-
    84 static constexpr size_type minMultiIndexSize = std::min({SPB::minMultiIndexSize...}) + isBlocked;
    \n-
    85 static constexpr size_type multiIndexBufferSize = std::max({SPB::multiIndexBufferSize...}) + isBlocked;
    \n-
    86
    \n-
    92 template<class... SFArgs,
    \n-
    93 disableCopyMove<CompositePreBasis, SFArgs...> = 0,
    \n-
    94 enableIfConstructible<std::tuple<SPB...>, SFArgs...> = 0>
    \n-
    95 CompositePreBasis(SFArgs&&... sfArgs) :
    \n-
    96 subPreBases_(std::forward<SFArgs>(sfArgs)...)
    \n-
    97 {
    \n-
    98 Hybrid::forEach(subPreBases_, [&](const auto& subPreBasis){
    \n-
    99 static_assert(models<Concept::PreBasis<GridView>, std::decay_t<decltype(subPreBasis)>>(), "Subprebases passed to CompositePreBasis does not model the PreBasis concept.");
    \n-
    100 });
    \n-
    101 }
    \n-
    102
    \n-
    109 template<class GV,
    \n-
    110 std::enable_if_t<std::conjunction_v<
    \n-
    111 std::bool_constant<(children > 1)>, // Avoid ambiguous constructor if there's only one child
    \n-
    112 std::is_same<GV, GridView>,
    \n-
    113 std::is_constructible<SPB, GridView>...
    \n-
    114 >, int> = 0>
    \n-
    115 CompositePreBasis(const GV& gv) :
    \n-
    116 subPreBases_(SPB(gv)...)
    \n-
    117 {
    \n-
    118 Hybrid::forEach(subPreBases_, [&](const auto& subPreBasis){
    \n-
    119 static_assert(models<Concept::PreBasis<GridView>, std::decay_t<decltype(subPreBasis)>>(), "Subprebases passed to CompositePreBasis does not model the PreBasis concept.");
    \n-
    120 });
    \n-
    121 }
    \n-
    122
    \n-\n-
    125 {
    \n-
    126 Hybrid::forEach(ChildIndices(), [&](auto i) {
    \n-
    127 this->subPreBasis(i).initializeIndices();
    \n-
    128 });
    \n-
    129 }
    \n-
    130
    \n-
    132 const GridView& gridView() const
    \n-
    133 {
    \n-
    134 return std::get<0>(subPreBases_).gridView();
    \n-
    135 }
    \n-
    136
    \n-
    138 void update(const GridView& gv)
    \n-
    139 {
    \n-
    140 Hybrid::forEach(ChildIndices(), [&](auto i) {
    \n-
    141 this->subPreBasis(i).update(gv);
    \n-
    142 });
    \n-
    143 }
    \n-
    144
    \n-\n-
    149 {
    \n-
    150 auto node = Node{};
    \n-
    151 Hybrid::forEach(ChildIndices(), [&](auto i) {
    \n-
    152 node.setChild(this->subPreBasis(i).makeNode(), i);
    \n-
    153 });
    \n-
    154 return node;
    \n+
    76 static constexpr std::size_t minIndexSize = 1;
    \n+
    77 static constexpr std::size_t maxIndexSize = 1;
    \n+
    78
    \n+
    79 template<class RawPreBasis, class IndexPairSet>
    \n+
    80 PeriodicIndexingTransformation(const RawPreBasis& rawPreBasis, const IndexPairSet& indexPairSet)
    \n+
    81 {
    \n+
    82 static_assert(RawPreBasis::maxMultiIndexSize==1, "PeriodicIndexingTransformation is only implemented for flat multi-indices");
    \n+
    83 std::size_t invalid = {std::numeric_limits<std::size_t>::max()};
    \n+
    84 mappedIdx_.resize(rawPreBasis.size(), invalid);
    \n+
    85 numIndices_ = 0;
    \n+
    86 std::size_t i = 0;
    \n+
    87 for(const auto& [a, b] : indexPairSet)
    \n+
    88 {
    \n+
    89 for(; i<=a; ++i)
    \n+
    90 if (mappedIdx_[i] == invalid)
    \n+
    91 mappedIdx_[i] = numIndices_++;
    \n+
    92 mappedIdx_[b] = mappedIdx_[a];
    \n+
    93 }
    \n+
    94 for(; i<rawPreBasis.size(); ++i)
    \n+
    95 if (mappedIdx_[i] == invalid)
    \n+
    96 mappedIdx_[i] = numIndices_++;
    \n+
    97 }
    \n+
    98
    \n+
    99 template<class MultiIndex, class PreBasis>
    \n+
    100 void transformIndex(MultiIndex& multiIndex, const PreBasis& preBasis) const
    \n+
    101 {
    \n+
    102 multiIndex = {{ mappedIdx_[multiIndex[0]] }};
    \n+
    103 }
    \n+
    104
    \n+
    105 template<class Prefix, class PreBasis>
    \n+
    106 std::size_t size(const Prefix& prefix, const PreBasis& preBasis) const
    \n+
    107 {
    \n+
    108 if (prefix.size() == 1)
    \n+
    109 return 0;
    \n+
    110 return numIndices_;
    \n+
    111 }
    \n+
    112
    \n+
    113 template<class PreBasis>
    \n+
    114 auto dimension(const PreBasis& preBasis) const
    \n+
    115 {
    \n+
    116 return numIndices_;
    \n+
    117 }
    \n+
    118
    \n+
    119private:
    \n+
    120 std::vector<std::size_t> mappedIdx_;
    \n+
    121 std::size_t numIndices_;
    \n+
    122};
    \n+
    123
    \n+
    124
    \n+
    125
    \n+
    126template<class RawPreBasisIndicator>
    \n+
    127class PeriodicPreBasisFactory
    \n+
    128{
    \n+
    129public:
    \n+
    130 PeriodicPreBasisFactory()
    \n+
    131 {}
    \n+
    132
    \n+
    133 template<class RPBI, class PIS>
    \n+
    134 PeriodicPreBasisFactory(RPBI&& rawPreBasisIndicator, PIS&& periodicIndexSet) :
    \n+
    135 rawPreBasisIndicator_(std::forward<RPBI>(rawPreBasisIndicator)),
    \n+
    136 periodicIndexSet_(std::forward<PIS>(periodicIndexSet))
    \n+
    137 {}
    \n+
    138
    \n+
    139 template<class GridView,
    \n+
    140 std::enable_if_t<models<Concept::GlobalBasis<GridView>,RawPreBasisIndicator>(), int> = 0>
    \n+
    141 auto operator()(const GridView& gridView) const
    \n+
    142 {
    \n+
    143 const auto& rawPreBasis = rawPreBasisIndicator_.preBasis();
    \n+
    144 auto transformation = PeriodicIndexingTransformation(rawPreBasis, periodicIndexSet_.indexPairSet());
    \n+
    145 return Dune::Functions::Experimental::TransformedIndexPreBasis(std::move(rawPreBasis), std::move(transformation));
    \n+
    146 }
    \n+
    147
    \n+
    148 template<class GridView,
    \n+
    149 std::enable_if_t<models<Concept::PreBasis<GridView>,RawPreBasisIndicator>(), int> = 0>
    \n+
    150 auto operator()(const GridView& gridView) const
    \n+
    151 {
    \n+
    152 const auto& rawPreBasis = rawPreBasisIndicator_;
    \n+
    153 auto transformation = PeriodicIndexingTransformation(rawPreBasis, periodicIndexSet_.indexPairSet());
    \n+
    154 return Dune::Functions::Experimental::TransformedIndexPreBasis(std::move(rawPreBasis), std::move(transformation));
    \n
    155 }
    \n
    156
    \n-\n-
    159 {
    \n-
    160 return size(Dune::ReservedVector<size_type, multiIndexBufferSize>{});
    \n-
    161 }
    \n-
    162
    \n-
    164 template<class SizePrefix>
    \n-
    165 size_type size(const SizePrefix& prefix) const
    \n-
    166 {
    \n-
    167 return size(prefix, IndexMergingStrategy{});
    \n-
    168 }
    \n-
    169
    \n-
    170private:
    \n-
    171
    \n-
    172 template<class SizePrefix>
    \n-
    173 size_type size(const SizePrefix& prefix, BasisFactory::BlockedLexicographic) const
    \n-
    174 {
    \n-
    175 if (prefix.size() == 0)
    \n-
    176 return children;
    \n-
    177
    \n-
    178 return Hybrid::switchCases(ChildIndices(), prefix[0], [&] (auto i) {
    \n-
    179 SizePrefix subPrefix;
    \n-
    180 for(std::size_t i=1; i<prefix.size(); ++i)
    \n-
    181 subPrefix.push_back(prefix[i]);
    \n-
    182 return this->subPreBasis(i).size(subPrefix);
    \n-
    183 }, []() {
    \n-
    184 return size_type(0);
    \n-
    185 });
    \n-
    186 }
    \n-
    187
    \n-
    188 template<class SizePrefix>
    \n-
    189 size_type size(const SizePrefix& prefix, BasisFactory::FlatLexicographic) const
    \n-
    190 {
    \n-
    191 size_type result = 0;
    \n-
    192 if (prefix.size() == 0)
    \n-
    193 Hybrid::forEach(ChildIndices(), [&](auto i) {
    \n-
    194 result += this->subPreBasis(i).size();
    \n-
    195 });
    \n-
    196 else {
    \n-
    197 size_type shiftedFirstDigit = prefix[0];
    \n-
    198 staticFindInRange<0, children>([&](auto i) {
    \n-
    199 auto firstDigitSize = this->subPreBasis(i).size();
    \n-
    200 if (shiftedFirstDigit < firstDigitSize)
    \n-
    201 {
    \n-
    202 SizePrefix subPrefix;
    \n-
    203 subPrefix.push_back(shiftedFirstDigit);
    \n-
    204 for(std::size_t i=1; i<prefix.size(); ++i)
    \n-
    205 subPrefix.push_back(prefix[i]);
    \n-
    206 result = this->subPreBasis(i).size(subPrefix);
    \n-
    207 return true;
    \n-
    208 }
    \n-
    209 shiftedFirstDigit -= firstDigitSize;
    \n-
    210 return false;
    \n-
    211 });
    \n-
    212 }
    \n-
    213 return result;
    \n-
    214 }
    \n-
    215
    \n-
    216public:
    \n-
    217
    \n-\n-
    220 {
    \n-
    221 size_type r=0;
    \n-
    222 // Accumulate dimension() for all subprebases
    \n-
    223 Hybrid::forEach(ChildIndices(), [&](auto i) {
    \n-
    224 r += this->subPreBasis(i).dimension();
    \n-
    225 });
    \n-
    226 return r;
    \n-
    227 }
    \n-
    228
    \n-\n-
    231 {
    \n-
    232 size_type r=0;
    \n-
    233 // Accumulate maxNodeSize() for all subprebases
    \n-
    234 Hybrid::forEach(ChildIndices(), [&](auto i) {
    \n-
    235 r += this->subPreBasis(i).maxNodeSize();
    \n-
    236 });
    \n-
    237 return r;
    \n-
    238 }
    \n-
    239
    \n-
    241 template<std::size_t i>
    \n-
    242 const SubPreBasis<i>& subPreBasis(Dune::index_constant<i> = {}) const
    \n-
    243 {
    \n-
    244 return std::get<i>(subPreBases_);
    \n-
    245 }
    \n-
    246
    \n-
    248 template<std::size_t i>
    \n-
    249 SubPreBasis<i>& subPreBasis(Dune::index_constant<i> = {})
    \n-
    250 {
    \n-
    251 return std::get<i>(subPreBases_);
    \n-
    252 }
    \n-
    253
    \n-
    255 template<typename It>
    \n-
    256 It indices(const Node& node, It it) const
    \n-
    257 {
    \n-
    258 return indices(node, it, IndexMergingStrategy{});
    \n-
    259 }
    \n-
    260
    \n-
    261private:
    \n-
    262
    \n-
    263 template<typename It>
    \n-
    264 It indices(const Node& node, It multiIndices, BasisFactory::FlatLexicographic) const
    \n-
    265 {
    \n-
    266 size_type firstComponentOffset = 0;
    \n-
    267 // Loop over all children
    \n-
    268 Hybrid::forEach(ChildIndices(), [&](auto child){
    \n-
    269 size_type subTreeSize = node.child(child).size();
    \n-
    270 // Fill indices for current child into index buffer starting from current
    \n-
    271 // buffer position and shift first index component of any index for current
    \n-
    272 // child by suitable offset to get lexicographic indices.
    \n-
    273 subPreBasis(child).indices(node.child(child), multiIndices);
    \n-
    274 for (std::size_t i = 0; i<subTreeSize; ++i)
    \n-
    275 multiIndices[i][0] += firstComponentOffset;
    \n-
    276 // Increment offset by the size for first index component of the current child
    \n-
    277 firstComponentOffset += subPreBasis(child).size();
    \n-
    278 // Increment buffer iterator by the number of indices processed for current child
    \n-
    279 multiIndices += subTreeSize;
    \n-
    280 });
    \n-
    281 return multiIndices;
    \n-
    282 }
    \n-
    283
    \n-
    284 template<class MultiIndex>
    \n-
    285 static void multiIndexPushFront(MultiIndex& M, size_type M0)
    \n-
    286 {
    \n-
    287 M.resize(M.size()+1);
    \n-
    288 for(std::size_t i=M.size()-1; i>0; --i)
    \n-
    289 M[i] = M[i-1];
    \n-
    290 M[0] = M0;
    \n-
    291 }
    \n-
    292
    \n-
    293 template<typename It>
    \n-
    294 It indices(const Node& node, It multiIndices, BasisFactory::BlockedLexicographic) const
    \n-
    295 {
    \n-
    296 // Loop over all children
    \n-
    297 Hybrid::forEach(ChildIndices(), [&](auto child){
    \n-
    298 size_type subTreeSize = node.child(child).size();
    \n-
    299 // Fill indices for current child into index buffer starting from current position
    \n-
    300 subPreBasis(child).indices(node.child(child), multiIndices);
    \n-
    301 // Insert child index before first component of all indices of current child.
    \n-
    302 for (std::size_t i = 0; i<subTreeSize; ++i)
    \n-
    303 this->multiIndexPushFront(multiIndices[i], child);
    \n-
    304 // Increment buffer iterator by the number of indices processed for current child
    \n-
    305 multiIndices += subTreeSize;
    \n-
    306 });
    \n-
    307 return multiIndices;
    \n-
    308 }
    \n-
    309
    \n-
    310 std::tuple<SPB...> subPreBases_;
    \n-
    311};
    \n-
    312
    \n-
    313
    \n-
    314
    \n-
    315namespace BasisFactory {
    \n-
    316
    \n-
    317namespace Imp {
    \n-
    318
    \n-
    319template<class IndexMergingStrategy, class... ChildPreBasisFactory>
    \n-
    320class CompositePreBasisFactory
    \n-
    321{
    \n-
    322
    \n-
    323 template<class GridView, class... ChildPreBasis>
    \n-
    324 auto makePreBasisFromChildPreBases(const GridView&, ChildPreBasis&&... childPreBasis) const
    \n-
    325 {
    \n-
    326 return CompositePreBasis<IndexMergingStrategy, std::decay_t<ChildPreBasis>...>(std::forward<ChildPreBasis>(childPreBasis)...);
    \n-
    327 }
    \n-
    328
    \n-
    329public:
    \n-
    330
    \n-
    331 CompositePreBasisFactory(const ChildPreBasisFactory&... childPreBasisFactory) :
    \n-
    332 childPreBasisFactories_(childPreBasisFactory...)
    \n-
    333 {}
    \n-
    334
    \n-
    335 CompositePreBasisFactory(ChildPreBasisFactory&&... childPreBasisFactory) :
    \n-
    336 childPreBasisFactories_(std::move(childPreBasisFactory)...)
    \n-
    337 {}
    \n-
    338
    \n-
    339 template<class GridView>
    \n-
    340 auto operator()(const GridView& gridView) const
    \n-
    341 {
    \n-
    342 // Use std::apply to unpack the tuple childPreBasisFactories_
    \n-
    343 return std::apply([&](const auto&... childPreBasisFactory) {
    \n-
    344 return this->makePreBasisFromChildPreBases(gridView, childPreBasisFactory(gridView)...);
    \n-
    345 }, childPreBasisFactories_);
    \n-
    346 }
    \n-
    347
    \n-
    348private:
    \n-
    349 std::tuple<ChildPreBasisFactory...> childPreBasisFactories_;
    \n-
    350};
    \n-
    351
    \n-
    352} // end namespace BasisFactory::Imp
    \n-
    353
    \n-
    354
    \n-
    355
    \n-
    366template<
    \n-
    367 typename... Args,
    \n-
    368 std::enable_if_t<Concept::isIndexMergingStrategy<typename LastType<Args...>::type>(),int> = 0>
    \n-
    369auto composite(Args&&... args)
    \n-
    370{
    \n-
    371 // We have to separate the last entry which is the IndexMergingStrategy
    \n-
    372 // and the preceding ones, which are the ChildPreBasisFactories
    \n-
    373
    \n-
    374 using ArgTuple = std::tuple<std::decay_t<Args>...>;
    \n-
    375
    \n-
    376 // Compute number of children and index of the IndexMergingStrategy argument
    \n-
    377 constexpr std::size_t children = Dune::SizeOf<Args...>::value-1;
    \n-
    378
    \n-
    379 // Use last type as IndexMergingStrategy
    \n-
    380 using IndexMergingStrategy = std::tuple_element_t<children, ArgTuple>;
    \n-
    381
    \n-
    382 // Index sequence for all but the last entry for partial tuple unpacking
    \n-
    383 auto childIndices = std::make_index_sequence<children>{};
    \n-
    384
    \n-
    385 // Unpack tuple only for those entries related to children
    \n-
    386 return applyPartial([](auto&&... childPreBasisFactory){
    \n-
    387 return Imp::CompositePreBasisFactory<IndexMergingStrategy, std::decay_t<decltype(childPreBasisFactory)>...>(std::forward<decltype(childPreBasisFactory)>(childPreBasisFactory)...);
    \n-
    388 },
    \n-
    389 std::forward_as_tuple(std::forward<Args>(args)...),
    \n-
    390 childIndices);
    \n-
    391}
    \n-
    392
    \n-
    404template<
    \n-
    405 typename... Args,
    \n-
    406 std::enable_if_t<not Concept::isIndexMergingStrategy<typename LastType<Args...>::type>(),int> = 0>
    \n-
    407auto composite(Args&&... args)
    \n-
    408{
    \n-
    409 return Imp::CompositePreBasisFactory<BasisFactory::BlockedLexicographic, std::decay_t<Args>...>(std::forward<Args>(args)...);
    \n-
    410}
    \n-
    411
    \n-
    412} // end namespace BasisFactory
    \n-
    413
    \n-
    414// Backward compatibility
    \n-
    415namespace BasisBuilder {
    \n-
    416
    \n-
    417 using namespace BasisFactory;
    \n-
    418
    \n-
    419}
    \n-
    420
    \n-
    421
    \n-
    422
    \n-
    423} // end namespace Functions
    \n-
    424} // end namespace Dune
    \n-
    425
    \n-
    426
    \n-
    427#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH
    \n-\n-\n-\n-\n-\n-\n-
    auto composite(Args &&... args)
    Create a factory builder that can build a CompositePreBasis.
    Definition: compositebasis.hh:369
    \n-
    typename std::enable_if< std::is_constructible< T, Args... >::value, int >::type enableIfConstructible
    Helper to constrain forwarding constructors.
    Definition: type_traits.hh:26
    \n-
    Definition: polynomial.hh:10
    \n-
    static constexpr bool isIndexMergingStrategy()
    Definition: basistags.hh:23
    \n-
    Get last entry of type list.
    Definition: utility.hh:222
    \n-
    Base class for index merging strategies to simplify detection.
    Definition: basistags.hh:44
    \n-
    Lexicographic merging of direct children without blocking.
    Definition: basistags.hh:80
    \n-
    Lexicographic merging of direct children with blocking (i.e. creating one block per direct child).
    Definition: basistags.hh:148
    \n-
    A pre-basis for composite bases.
    Definition: compositebasis.hh:53
    \n-
    SubPreBasis< i > & subPreBasis(Dune::index_constant< i >={})
    Mutable access to the stored prebasis of the factor in the power space.
    Definition: compositebasis.hh:249
    \n-
    IMS IndexMergingStrategy
    Strategy used to merge the global indices of the child pre-bases.
    Definition: compositebasis.hh:71
    \n-
    size_type maxNodeSize() const
    Get the maximal number of DOFs associated to node for any element.
    Definition: compositebasis.hh:230
    \n-
    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
    \n-
    std::size_t size_type
    Type used for indices and size information.
    Definition: compositebasis.hh:68
    \n-
    CompositeBasisNode< typename SPB::Node... > Node
    Template mapping root tree path to type of created tree node.
    Definition: compositebasis.hh:81
    \n-
    size_type size(const SizePrefix &prefix) const
    Return number of possible values for next position in multi index.
    Definition: compositebasis.hh:165
    \n-
    CompositePreBasis(SFArgs &&... sfArgs)
    Constructor for given child pre-basis objects.
    Definition: compositebasis.hh:95
    \n-
    size_type dimension() const
    Get the total dimension of the space spanned by this basis.
    Definition: compositebasis.hh:219
    \n-
    CompositePreBasis(const GV &gv)
    Constructor for given GridView.
    Definition: compositebasis.hh:115
    \n-
    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
    \n-
    size_type size() const
    Same as size(prefix) with empty prefix.
    Definition: compositebasis.hh:158
    \n-
    typename std::tuple_element_t< 0, SubPreBases >::GridView GridView
    The grid view that the FE basis is defined on.
    Definition: compositebasis.hh:65
    \n-
    static const std::size_t children
    Definition: compositebasis.hh:74
    \n-
    std::tuple< SPB... > SubPreBases
    Tuple of child pre-bases.
    Definition: compositebasis.hh:58
    \n-
    Node makeNode() const
    Create tree node.
    Definition: compositebasis.hh:148
    \n-
    void initializeIndices()
    Initialize the global indices.
    Definition: compositebasis.hh:124
    \n-
    std::tuple_element_t< i, SubPreBases > SubPreBasis
    Export individual child pre-bases by index.
    Definition: compositebasis.hh:62
    \n-
    std::make_index_sequence< children > ChildIndices
    Definition: compositebasis.hh:76
    \n-
    void update(const GridView &gv)
    Update the stored grid view, to be called if the grid has changed.
    Definition: compositebasis.hh:138
    \n-
    static constexpr size_type multiIndexBufferSize
    Definition: compositebasis.hh:85
    \n-
    const GridView & gridView() const
    Obtain the grid view that the basis is defined on.
    Definition: compositebasis.hh:132
    \n-
    static constexpr size_type minMultiIndexSize
    Definition: compositebasis.hh:84
    \n-
    static constexpr size_type maxMultiIndexSize
    Definition: compositebasis.hh:83
    \n-
    Definition: nodes.hh:219
    \n+
    157 template<class GridView,
    \n+
    158 std::enable_if_t<not models<Concept::GlobalBasis<GridView>,RawPreBasisIndicator>(), int> = 0,
    \n+
    159 std::enable_if_t<not models<Concept::PreBasis<GridView>,RawPreBasisIndicator>(), int> = 0>
    \n+
    160 auto operator()(const GridView& gridView) const
    \n+
    161 {
    \n+
    162 auto rawPreBasis = rawPreBasisIndicator_(gridView);
    \n+
    163 rawPreBasis.initializeIndices();
    \n+
    164 auto transformation = PeriodicIndexingTransformation(rawPreBasis, periodicIndexSet_.indexPairSet());
    \n+
    165 return Dune::Functions::Experimental::TransformedIndexPreBasis(std::move(rawPreBasis), std::move(transformation));
    \n+
    166 }
    \n+
    167
    \n+
    168private:
    \n+
    169 RawPreBasisIndicator rawPreBasisIndicator_;
    \n+
    170 PeriodicIndexSet periodicIndexSet_;
    \n+
    171};
    \n+
    172
    \n+
    173} // end namespace BasisFactory::Impl
    \n+
    174
    \n+
    175
    \n+
    176
    \n+
    190template<class RawPreBasisIndicator, class PIS>
    \n+\n+
    192 RawPreBasisIndicator&& rawPreBasisIndicator,
    \n+
    193 PIS&& periodicIndexSet
    \n+
    194 )
    \n+
    195{
    \n+
    196 return Impl::PeriodicPreBasisFactory<std::decay_t<RawPreBasisIndicator>>(
    \n+
    197 std::forward<RawPreBasisIndicator>(rawPreBasisIndicator),
    \n+
    198 std::forward<PIS>(periodicIndexSet));
    \n+
    199}
    \n+
    200
    \n+
    201} // end namespace Experimental
    \n+
    202
    \n+
    203} // end namespace BasisFactory
    \n+
    204
    \n+
    205} // end namespace Dune::Functions
    \n+
    206
    \n+
    207#endif // DUNE_FUFEM_PERIODICBASIS_HH
    \n+\n+
    auto periodic(RawPreBasisIndicator &&rawPreBasisIndicator, PIS &&periodicIndexSet)
    Create a pre-basis factory that can create a periodic pre-basis.
    Definition: periodicbasis.hh:191
    \n+
    Definition: polynomial.hh:11
    \n+
    TransformedIndexPreBasis(RPB &&, T &&) -> TransformedIndexPreBasis< std::decay_t< RPB >, std::decay_t< T > >
    \n+
    Container storing identified indices for a periodic basis.
    Definition: periodicbasis.hh:36
    \n+
    void unifyIndexPair(std::size_t a, std::size_t b)
    Insert a pair of indices.
    Definition: periodicbasis.hh:47
    \n+
    const auto & indexPairSet() const
    Definition: periodicbasis.hh:56
    \n \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,541 +5,227 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-compositebasis.hh\n+periodicbasis.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_PERIODICBASIS_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_PERIODICBASIS_HH\n 5\n- 6#include \n- 7#include \n- 8\n- 9#include \n- 10#include \n- 11#include \n- 12#include \n- 13#include \n- 14#include \n- 15#include \n- 16\n- 17#include \n- 18#include \n- 19#include \n- 20#include \n- 21#include \n- 22#include \n- 23#include \n- 24\n+ 6#include \n+ 7#include \n+ 8#include \n+ 9#include \n+ 10#include \n+ 11\n+ 12#include \n+ 13#include \n+ 14\n+ 15\n+ 16namespace Dune::Functions {\n+ 17\n+ 18namespace BasisFactory {\n+ 19\n+ 20// The PeriodicBasis class is in the Experimental namespace because we are\n+ 21// not completely sure yet whether we like it. We reserve the right to\n+ 22// modify it without advance warning. Use at your own risk!\n+ 23\n+24namespace Experimental {\n 25\n- 26namespace Dune {\n- 27namespace Functions {\n- 28\n- 29/\n-/ *****************************************************************************\n- 30// This is the reusable part of the composite bases. It contains\n- 31//\n- 32// CompositePreBasis\n- 33//\n- 34// The pre-basis allows to create the others and is the owner of possible\n-shared\n- 35// state. These components do _not_ depend on the global basis and local\n-view\n- 36// and can be used without a global basis.\n- 37/\n-/ *****************************************************************************\n- 38\n+ 26\n+35class PeriodicIndexSet\n+ 36{\n+ 37 using IndexPairSet = std::set>;\n+ 38public:\n 39\n- 51template\n-52class CompositePreBasis\n- 53{\n- 54 static const bool isBlocked = std::is_same_v or std::is_same_v;\n- 55public:\n- 56\n-58 using SubPreBases = std::tuple;\n- 59\n- 61 template\n-62 using SubPreBasis = std::tuple_element_t;\n- 63\n-65 using GridView = typename std::tuple_element_t<0, SubPreBases>::GridView;\n+47 void unifyIndexPair(std::size_t a, std::size_t b)\n+ 48 {\n+ 49 if (a>b)\n+ 50 std::swap(a,b);\n+ 51 if (a==b)\n+ 52 return;\n+ 53 indexPairSet_.insert(std::make_pair(a,b));\n+ 54 }\n+ 55\n+56 const auto& indexPairSet() const\n+ 57 {\n+ 58 return indexPairSet_;\n+ 59 }\n+ 60\n+ 61private:\n+ 62 IndexPairSet indexPairSet_;\n+ 63};\n+ 64\n+ 65\n 66\n-68 using size_type = std::size_t;\n- 69\n-71 using IndexMergingStrategy = IMS;\n- 72\n- 73protected:\n-74 static const std::size_t children = sizeof...(SPB);\n+ 67namespace Impl {\n+ 68\n+ 69// An index transformation for a TransformedIndexPreBasis\n+ 70// implementing periodic functions by merging indices.\n+ 71// Currently only flat indices are supported.\n+ 72class PeriodicIndexingTransformation\n+ 73{\n+ 74public:\n 75\n-76 using ChildIndices = std::make_index_sequence;\n- 77\n- 78public:\n- 79\n-81 using Node = CompositeBasisNode;\n- 82\n-83 static constexpr size_type maxMultiIndexSize = std::max({SPB::\n-maxMultiIndexSize...}) + isBlocked;\n-84 static constexpr size_type minMultiIndexSize = std::min({SPB::\n-minMultiIndexSize...}) + isBlocked;\n-85 static constexpr size_type multiIndexBufferSize = std::max({SPB::\n-multiIndexBufferSize...}) + isBlocked;\n- 86\n- 92 template = 0,\n- 94 enableIfConstructible, SFArgs...> = 0>\n-95 CompositePreBasis(SFArgs&&... sfArgs) :\n- 96 subPreBases_(std::forward(sfArgs)...)\n- 97 {\n- 98 Hybrid::forEach(subPreBases_, [&](const auto& subPreBasis){\n- 99 static_assert(models, std::decay_t>(), \"Subprebases passed to CompositePreBasis does not model the\n-PreBasis concept.\");\n- 100 });\n- 101 }\n- 102\n- 109 template 1)>, // Avoid ambiguous constructor if\n-there's only one child\n- 112 std::is_same,\n- 113 std::is_constructible...\n- 114 >, int> = 0>\n-115 CompositePreBasis(const GV& gv) :\n- 116 subPreBases_(SPB(gv)...)\n- 117 {\n- 118 Hybrid::forEach(subPreBases_, [&](const auto& subPreBasis){\n- 119 static_assert(models, std::decay_t>(), \"Subprebases passed to CompositePreBasis does not model the\n-PreBasis concept.\");\n- 120 });\n- 121 }\n- 122\n-124 void initializeIndices()\n- 125 {\n- 126 Hybrid::forEach(ChildIndices(), [&](auto i) {\n- 127 this->subPreBasis(i).initializeIndices();\n- 128 });\n- 129 }\n- 130\n-132 const GridView& gridView() const\n- 133 {\n- 134 return std::get<0>(subPreBases_).gridView();\n- 135 }\n- 136\n-138 void update(const GridView& gv)\n- 139 {\n- 140 Hybrid::forEach(ChildIndices(), [&](auto i) {\n- 141 this->subPreBasis(i).update(gv);\n- 142 });\n- 143 }\n- 144\n-148 Node makeNode() const\n- 149 {\n- 150 auto node = Node{};\n- 151 Hybrid::forEach(ChildIndices(), [&](auto i) {\n- 152 node.setChild(this->subPreBasis(i).makeNode(), i);\n- 153 });\n- 154 return node;\n+ 76 static constexpr std::size_t minIndexSize = 1;\n+ 77 static constexpr std::size_t maxIndexSize = 1;\n+ 78\n+ 79 template\n+ 80 PeriodicIndexingTransformation(const RawPreBasis& rawPreBasis, const\n+IndexPairSet& indexPairSet)\n+ 81 {\n+ 82 static_assert(RawPreBasis::maxMultiIndexSize==1,\n+\"PeriodicIndexingTransformation is only implemented for flat multi-indices\");\n+ 83 std::size_t invalid = {std::numeric_limits::max()};\n+ 84 mappedIdx_.resize(rawPreBasis.size(), invalid);\n+ 85 numIndices_ = 0;\n+ 86 std::size_t i = 0;\n+ 87 for(const auto& [a, b] : indexPairSet)\n+ 88 {\n+ 89 for(; i<=a; ++i)\n+ 90 if (mappedIdx_[i] == invalid)\n+ 91 mappedIdx_[i] = numIndices_++;\n+ 92 mappedIdx_[b] = mappedIdx_[a];\n+ 93 }\n+ 94 for(; i\n+ 100 void transformIndex(MultiIndex& multiIndex, const PreBasis& preBasis)\n+const\n+ 101 {\n+ 102 multiIndex = {{ mappedIdx_[multiIndex[0]] }};\n+ 103 }\n+ 104\n+ 105 template\n+ 106 std::size_t size(const Prefix& prefix, const PreBasis& preBasis) const\n+ 107 {\n+ 108 if (prefix.size() == 1)\n+ 109 return 0;\n+ 110 return numIndices_;\n+ 111 }\n+ 112\n+ 113 template\n+ 114 auto dimension(const PreBasis& preBasis) const\n+ 115 {\n+ 116 return numIndices_;\n+ 117 }\n+ 118\n+ 119private:\n+ 120 std::vector mappedIdx_;\n+ 121 std::size_t numIndices_;\n+ 122};\n+ 123\n+ 124\n+ 125\n+ 126template\n+ 127class PeriodicPreBasisFactory\n+ 128{\n+ 129public:\n+ 130 PeriodicPreBasisFactory()\n+ 131 {}\n+ 132\n+ 133 template\n+ 134 PeriodicPreBasisFactory(RPBI&& rawPreBasisIndicator, PIS&&\n+periodicIndexSet) :\n+ 135 rawPreBasisIndicator_(std::forward(rawPreBasisIndicator)),\n+ 136 periodicIndexSet_(std::forward(periodicIndexSet))\n+ 137 {}\n+ 138\n+ 139 template,RawPreBasisIndicator>(), int> = 0>\n+ 141 auto operator()(const GridView& gridView) const\n+ 142 {\n+ 143 const auto& rawPreBasis = rawPreBasisIndicator_.preBasis();\n+ 144 auto transformation = PeriodicIndexingTransformation(rawPreBasis,\n+periodicIndexSet_.indexPairSet());\n+ 145 return Dune::Functions::Experimental::TransformedIndexPreBasis(std::move\n+(rawPreBasis), std::move(transformation));\n+ 146 }\n+ 147\n+ 148 template,RawPreBasisIndicator>\n+(), int> = 0>\n+ 150 auto operator()(const GridView& gridView) const\n+ 151 {\n+ 152 const auto& rawPreBasis = rawPreBasisIndicator_;\n+ 153 auto transformation = PeriodicIndexingTransformation(rawPreBasis,\n+periodicIndexSet_.indexPairSet());\n+ 154 return Dune::Functions::Experimental::TransformedIndexPreBasis(std::move\n+(rawPreBasis), std::move(transformation));\n 155 }\n 156\n-158 size_type size() const\n- 159 {\n- 160 return size(Dune::ReservedVector{});\n- 161 }\n- 162\n- 164 template\n-165 size_type size(const SizePrefix& prefix) const\n- 166 {\n- 167 return size(prefix, IndexMergingStrategy{});\n- 168 }\n- 169\n- 170private:\n- 171\n- 172 template\n- 173 size_type size(const SizePrefix& prefix, BasisFactory::\n-BlockedLexicographic) const\n- 174 {\n- 175 if (prefix.size() == 0)\n- 176 return children;\n- 177\n- 178 return Hybrid::switchCases(ChildIndices(), prefix[0], [&] (auto i) {\n- 179 SizePrefix subPrefix;\n- 180 for(std::size_t i=1; isubPreBasis(i).size(subPrefix);\n- 183 }, []() {\n- 184 return size_type(0);\n- 185 });\n- 186 }\n- 187\n- 188 template\n- 189 size_type size(const SizePrefix& prefix, BasisFactory::FlatLexicographic)\n-const\n- 190 {\n- 191 size_type result = 0;\n- 192 if (prefix.size() == 0)\n- 193 Hybrid::forEach(ChildIndices(), [&](auto i) {\n- 194 result += this->subPreBasis(i).size();\n- 195 });\n- 196 else {\n- 197 size_type shiftedFirstDigit = prefix[0];\n- 198 staticFindInRange<0, children>([&](auto i) {\n- 199 auto firstDigitSize = this->subPreBasis(i).size();\n- 200 if (shiftedFirstDigit < firstDigitSize)\n- 201 {\n- 202 SizePrefix subPrefix;\n- 203 subPrefix.push_back(shiftedFirstDigit);\n- 204 for(std::size_t i=1; isubPreBasis(i).size(subPrefix);\n- 207 return true;\n- 208 }\n- 209 shiftedFirstDigit -= firstDigitSize;\n- 210 return false;\n- 211 });\n- 212 }\n- 213 return result;\n- 214 }\n- 215\n- 216public:\n- 217\n-219 size_type dimension() const\n- 220 {\n- 221 size_type r=0;\n- 222 // Accumulate dimension() for all subprebases\n- 223 Hybrid::forEach(ChildIndices(), [&](auto i) {\n- 224 r += this->subPreBasis(i).dimension();\n- 225 });\n- 226 return r;\n- 227 }\n- 228\n-230 size_type maxNodeSize() const\n- 231 {\n- 232 size_type r=0;\n- 233 // Accumulate maxNodeSize() for all subprebases\n- 234 Hybrid::forEach(ChildIndices(), [&](auto i) {\n- 235 r += this->subPreBasis(i).maxNodeSize();\n- 236 });\n- 237 return r;\n- 238 }\n- 239\n- 241 template\n-242 const SubPreBasis& subPreBasis(Dune::index_constant = {}) const\n- 243 {\n- 244 return std::get(subPreBases_);\n- 245 }\n- 246\n- 248 template\n-249 SubPreBasis& subPreBasis(Dune::index_constant = {})\n- 250 {\n- 251 return std::get(subPreBases_);\n- 252 }\n- 253\n- 255 template\n-256 It indices(const Node& node, It it) const\n- 257 {\n- 258 return indices(node, it, IndexMergingStrategy{});\n- 259 }\n- 260\n- 261private:\n- 262\n- 263 template\n- 264 It indices(const Node& node, It multiIndices, BasisFactory::\n-FlatLexicographic) const\n- 265 {\n- 266 size_type firstComponentOffset = 0;\n- 267 // Loop over all children\n- 268 Hybrid::forEach(ChildIndices(), [&](auto child){\n- 269 size_type subTreeSize = node.child(child).size();\n- 270 // Fill indices for current child into index buffer starting from current\n- 271 // buffer position and shift first index component of any index for\n-current\n- 272 // child by suitable offset to get lexicographic indices.\n- 273 subPreBasis(child).indices(node.child(child), multiIndices);\n- 274 for (std::size_t i = 0; i\n- 285 static void multiIndexPushFront(MultiIndex& M, size_type M0)\n- 286 {\n- 287 M.resize(M.size()+1);\n- 288 for(std::size_t i=M.size()-1; i>0; --i)\n- 289 M[i] = M[i-1];\n- 290 M[0] = M0;\n- 291 }\n- 292\n- 293 template\n- 294 It indices(const Node& node, It multiIndices, BasisFactory::\n-BlockedLexicographic) const\n- 295 {\n- 296 // Loop over all children\n- 297 Hybrid::forEach(ChildIndices(), [&](auto child){\n- 298 size_type subTreeSize = node.child(child).size();\n- 299 // Fill indices for current child into index buffer starting from current\n-position\n- 300 subPreBasis(child).indices(node.child(child), multiIndices);\n- 301 // Insert child index before first component of all indices of current\n-child.\n- 302 for (std::size_t i = 0; imultiIndexPushFront(multiIndices[i], child);\n- 304 // Increment buffer iterator by the number of indices processed for\n-current child\n- 305 multiIndices += subTreeSize;\n- 306 });\n- 307 return multiIndices;\n- 308 }\n- 309\n- 310 std::tuple subPreBases_;\n- 311};\n- 312\n- 313\n- 314\n- 315namespace BasisFactory {\n- 316\n- 317namespace Imp {\n- 318\n- 319template\n- 320class CompositePreBasisFactory\n- 321{\n- 322\n- 323 template\n- 324 auto makePreBasisFromChildPreBases(const GridView&, ChildPreBasis&&...\n-childPreBasis) const\n- 325 {\n- 326 return CompositePreBasis...>(std::forward(childPreBasis)...);\n- 327 }\n- 328\n- 329public:\n- 330\n- 331 CompositePreBasisFactory(const ChildPreBasisFactory&...\n-childPreBasisFactory) :\n- 332 childPreBasisFactories_(childPreBasisFactory...)\n- 333 {}\n- 334\n- 335 CompositePreBasisFactory(ChildPreBasisFactory&&... childPreBasisFactory) :\n- 336 childPreBasisFactories_(std::move(childPreBasisFactory)...)\n- 337 {}\n- 338\n- 339 template\n- 340 auto operator()(const GridView& gridView) const\n- 341 {\n- 342 // Use std::apply to unpack the tuple childPreBasisFactories_\n- 343 return std::apply([&](const auto&... childPreBasisFactory) {\n- 344 return this->makePreBasisFromChildPreBases(gridView, childPreBasisFactory\n-(gridView)...);\n- 345 }, childPreBasisFactories_);\n- 346 }\n- 347\n- 348private:\n- 349 std::tuple childPreBasisFactories_;\n- 350};\n- 351\n- 352} // end namespace BasisFactory::Imp\n- 353\n- 354\n- 355\n- 366template<\n- 367 typename... Args,\n- 368 std::enable_if_t::type>(),int> = 0>\n-369auto composite(Args&&... args)\n- 370{\n- 371 // We have to separate the last entry which is the IndexMergingStrategy\n- 372 // and the preceding ones, which are the ChildPreBasisFactories\n- 373\n- 374 using ArgTuple = std::tuple...>;\n- 375\n- 376 // Compute number of children and index of the IndexMergingStrategy\n-argument\n- 377 constexpr std::size_t children = Dune::SizeOf::value-1;\n- 378\n- 379 // Use last type as IndexMergingStrategy\n- 380 using IndexMergingStrategy = std::tuple_element_t;\n- 381\n- 382 // Index sequence for all but the last entry for partial tuple unpacking\n- 383 auto childIndices = std::make_index_sequence{};\n- 384\n- 385 // Unpack tuple only for those entries related to children\n- 386 return applyPartial([](auto&&... childPreBasisFactory){\n- 387 return Imp::CompositePreBasisFactory...>(std::forward(childPreBasisFactory)...);\n- 388 },\n- 389 std::forward_as_tuple(std::forward(args)...),\n- 390 childIndices);\n- 391}\n- 392\n- 404template<\n- 405 typename... Args,\n- 406 std::enable_if_t::type>(),int> = 0>\n- 407auto composite(Args&&... args)\n- 408{\n- 409 return Imp::CompositePreBasisFactory...>(std::forward(args)...);\n- 410}\n- 411\n- 412} // end namespace BasisFactory\n- 413\n- 414// Backward compatibility\n- 415namespace BasisBuilder {\n- 416\n- 417 using namespace BasisFactory;\n- 418\n- 419}\n- 420\n- 421\n- 422\n- 423} // end namespace Functions\n- 424} // end namespace Dune\n- 425\n- 426\n- 427#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH\n-type_traits.hh\n-staticforloop.hh\n-utility.hh\n-nodes.hh\n-defaultglobalbasis.hh\n-basistags.hh\n-Dune::Functions::BasisFactory::composite\n-auto composite(Args &&... args)\n-Create a factory builder that can build a CompositePreBasis.\n-Definition: compositebasis.hh:369\n-Dune::Functions::enableIfConstructible\n-typename std::enable_if< std::is_constructible< T, Args... >::value, int >::\n-type enableIfConstructible\n-Helper to constrain forwarding constructors.\n-Definition: type_traits.hh:26\n-Dune\n-Definition: polynomial.hh:10\n-Dune::Functions::Concept::isIndexMergingStrategy\n-static constexpr bool isIndexMergingStrategy()\n-Definition: basistags.hh:23\n-Dune::Functions::LastType\n-Get last entry of type list.\n-Definition: utility.hh:222\n-Dune::Functions::BasisFactory::IndexMergingStrategy\n-Base class for index merging strategies to simplify detection.\n-Definition: basistags.hh:44\n-Dune::Functions::BasisFactory::FlatLexicographic\n-Lexicographic merging of direct children without blocking.\n-Definition: basistags.hh:80\n-Dune::Functions::BasisFactory::BlockedLexicographic\n-Lexicographic merging of direct children with blocking (i.e. creating one block\n-per direct child).\n-Definition: basistags.hh:148\n-Dune::Functions::CompositePreBasis\n-A pre-basis for composite bases.\n-Definition: compositebasis.hh:53\n-Dune::Functions::CompositePreBasis::subPreBasis\n-SubPreBasis< i > & subPreBasis(Dune::index_constant< i >={})\n-Mutable access to the stored prebasis of the factor in the power space.\n-Definition: compositebasis.hh:249\n-Dune::Functions::CompositePreBasis::IndexMergingStrategy\n-IMS IndexMergingStrategy\n-Strategy used to merge the global indices of the child pre-bases.\n-Definition: compositebasis.hh:71\n-Dune::Functions::CompositePreBasis::maxNodeSize\n-size_type maxNodeSize() const\n-Get the maximal number of DOFs associated to node for any element.\n-Definition: compositebasis.hh:230\n-Dune::Functions::CompositePreBasis::subPreBasis\n-const SubPreBasis< i > & subPreBasis(Dune::index_constant< i >={}) const\n-Const access to the stored prebasis of the factor in the power space.\n-Definition: compositebasis.hh:242\n-Dune::Functions::CompositePreBasis::size_type\n-std::size_t size_type\n-Type used for indices and size information.\n-Definition: compositebasis.hh:68\n-Dune::Functions::CompositePreBasis::Node\n-CompositeBasisNode< typename SPB::Node... > Node\n-Template mapping root tree path to type of created tree node.\n-Definition: compositebasis.hh:81\n-Dune::Functions::CompositePreBasis::size\n-size_type size(const SizePrefix &prefix) const\n-Return number of possible values for next position in multi index.\n-Definition: compositebasis.hh:165\n-Dune::Functions::CompositePreBasis::CompositePreBasis\n-CompositePreBasis(SFArgs &&... sfArgs)\n-Constructor for given child pre-basis objects.\n-Definition: compositebasis.hh:95\n-Dune::Functions::CompositePreBasis::dimension\n-size_type dimension() const\n-Get the total dimension of the space spanned by this basis.\n-Definition: compositebasis.hh:219\n-Dune::Functions::CompositePreBasis::CompositePreBasis\n-CompositePreBasis(const GV &gv)\n-Constructor for given GridView.\n-Definition: compositebasis.hh:115\n-Dune::Functions::CompositePreBasis::indices\n-It indices(const Node &node, It it) const\n-Maps from subtree index set [0..size-1] to a globally unique multi index in\n-global basis.\n-Definition: compositebasis.hh:256\n-Dune::Functions::CompositePreBasis::size\n-size_type size() const\n-Same as size(prefix) with empty prefix.\n-Definition: compositebasis.hh:158\n-Dune::Functions::CompositePreBasis::GridView\n-typename std::tuple_element_t< 0, SubPreBases >::GridView GridView\n-The grid view that the FE basis is defined on.\n-Definition: compositebasis.hh:65\n-Dune::Functions::CompositePreBasis::children\n-static const std::size_t children\n-Definition: compositebasis.hh:74\n-Dune::Functions::CompositePreBasis::SubPreBases\n-std::tuple< SPB... > SubPreBases\n-Tuple of child pre-bases.\n-Definition: compositebasis.hh:58\n-Dune::Functions::CompositePreBasis::makeNode\n-Node makeNode() const\n-Create tree node.\n-Definition: compositebasis.hh:148\n-Dune::Functions::CompositePreBasis::initializeIndices\n-void initializeIndices()\n-Initialize the global indices.\n-Definition: compositebasis.hh:124\n-Dune::Functions::CompositePreBasis::SubPreBasis\n-std::tuple_element_t< i, SubPreBases > SubPreBasis\n-Export individual child pre-bases by index.\n-Definition: compositebasis.hh:62\n-Dune::Functions::CompositePreBasis::ChildIndices\n-std::make_index_sequence< children > ChildIndices\n-Definition: compositebasis.hh:76\n-Dune::Functions::CompositePreBasis::update\n-void update(const GridView &gv)\n-Update the stored grid view, to be called if the grid has changed.\n-Definition: compositebasis.hh:138\n-Dune::Functions::CompositePreBasis::multiIndexBufferSize\n-static constexpr size_type multiIndexBufferSize\n-Definition: compositebasis.hh:85\n-Dune::Functions::CompositePreBasis::gridView\n-const GridView & gridView() const\n-Obtain the grid view that the basis is defined on.\n-Definition: compositebasis.hh:132\n-Dune::Functions::CompositePreBasis::minMultiIndexSize\n-static constexpr size_type minMultiIndexSize\n-Definition: compositebasis.hh:84\n-Dune::Functions::CompositePreBasis::maxMultiIndexSize\n-static constexpr size_type maxMultiIndexSize\n-Definition: compositebasis.hh:83\n-Dune::Functions::CompositeBasisNode\n-Definition: nodes.hh:219\n+ 157 template,RawPreBasisIndicator>(), int> = 0,\n+ 159 std::enable_if_t,RawPreBasisIndicator>(), int> = 0>\n+ 160 auto operator()(const GridView& gridView) const\n+ 161 {\n+ 162 auto rawPreBasis = rawPreBasisIndicator_(gridView);\n+ 163 rawPreBasis.initializeIndices();\n+ 164 auto transformation = PeriodicIndexingTransformation(rawPreBasis,\n+periodicIndexSet_.indexPairSet());\n+ 165 return Dune::Functions::Experimental::TransformedIndexPreBasis(std::move\n+(rawPreBasis), std::move(transformation));\n+ 166 }\n+ 167\n+ 168private:\n+ 169 RawPreBasisIndicator rawPreBasisIndicator_;\n+ 170 PeriodicIndexSet periodicIndexSet_;\n+ 171};\n+ 172\n+ 173} // end namespace BasisFactory::Impl\n+ 174\n+ 175\n+ 176\n+ 190template\n+191auto periodic(\n+ 192 RawPreBasisIndicator&& rawPreBasisIndicator,\n+ 193 PIS&& periodicIndexSet\n+ 194 )\n+ 195{\n+ 196 return Impl::PeriodicPreBasisFactory>(\n+ 197 std::forward(rawPreBasisIndicator),\n+ 198 std::forward(periodicIndexSet));\n+ 199}\n+ 200\n+ 201} // end namespace Experimental\n+ 202\n+ 203} // end namespace BasisFactory\n+ 204\n+ 205} // end namespace Dune::Functions\n+ 206\n+ 207#endif // DUNE_FUFEM_PERIODICBASIS_HH\n+transformedindexbasis.hh\n+Dune::Functions::BasisFactory::Experimental::periodic\n+auto periodic(RawPreBasisIndicator &&rawPreBasisIndicator, PIS\n+&&periodicIndexSet)\n+Create a pre-basis factory that can create a periodic pre-basis.\n+Definition: periodicbasis.hh:191\n+Dune::Functions\n+Definition: polynomial.hh:11\n+Dune::Functions::Experimental::TransformedIndexPreBasis\n+TransformedIndexPreBasis(RPB &&, T &&) -> TransformedIndexPreBasis< std::\n+decay_t< RPB >, std::decay_t< T > >\n+Dune::Functions::BasisFactory::Experimental::PeriodicIndexSet\n+Container storing identified indices for a periodic basis.\n+Definition: periodicbasis.hh:36\n+Dune::Functions::BasisFactory::Experimental::PeriodicIndexSet::unifyIndexPair\n+void unifyIndexPair(std::size_t a, std::size_t b)\n+Insert a pair of indices.\n+Definition: periodicbasis.hh:47\n+Dune::Functions::BasisFactory::Experimental::PeriodicIndexSet::indexPairSet\n+const auto & indexPairSet() const\n+Definition: periodicbasis.hh:56\n concepts.hh\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00110.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00110.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: nodes.hh File Reference\n+dune-functions: sizeinfo.hh File Reference\n \n \n \n \n \n \n \n@@ -66,57 +66,39 @@\n \n \n
    \n \n-
    nodes.hh File Reference
    \n+
    sizeinfo.hh File Reference
    \n
    \n
    \n-
    #include <cassert>
    \n-#include <memory>
    \n-#include <dune/common/indices.hh>
    \n-#include <dune/typetree/leafnode.hh>
    \n-#include <dune/typetree/powernode.hh>
    \n-#include <dune/typetree/compositenode.hh>
    \n-#include <dune/typetree/traversal.hh>
    \n-#include <dune/typetree/visitor.hh>
    \n+
    #include <array>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n-\n-\n-\n-\n-\n+\n+\n \n

    \n Classes

    class  Dune::Functions::BasisNodeMixin
     
    class  Dune::Functions::LeafBasisNode
     
    class  Dune::Functions::PowerBasisNode< T, n >
     
    class  Dune::Functions::CompositeBasisNode< T >
    class  Dune::Functions::SizeInfo< B >
     A class encapsulating size information. More...
     
    \n \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n

    \n 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)
     
    template<class Basis >
    SizeInfo< Basis > Dune::Functions::sizeInfo (const Basis &basis)
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,46 +6,26 @@\n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n Classes | Namespaces | Functions\n-nodes.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+sizeinfo.hh File Reference\n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::BasisNodeMixin\n-\u00a0\n-class \u00a0Dune::Functions::LeafBasisNode\n-\u00a0\n-class \u00a0Dune::Functions::PowerBasisNode<_T,_n_>\n-\u00a0\n-class \u00a0Dune::Functions::CompositeBasisNode<_T_>\n+class \u00a0Dune::Functions::SizeInfo<_B_>\n+\u00a0 A class encapsulating size information. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n Functions\n-template\n-void\u00a0Dune::Functions::clearSize (Tree &tree, std::size_t offset)\n-\u00a0\n-template\n-void\u00a0Dune::Functions::bindTree (Tree &tree, const Entity &entity, std::size_t\n- offset=0)\n-\u00a0\n-template\n-void\u00a0Dune::Functions::initializeTree (Tree &tree, std::size_t\n- treeIndexOffset=0)\n+template\n+SizeInfo< Basis >\u00a0Dune::Functions::sizeInfo (const Basis &basis)\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00110_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00110_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: nodes.hh Source File\n+dune-functions: sizeinfo.hh Source File\n \n \n \n \n \n \n \n@@ -62,314 +62,84 @@\n \n \n
    \n
    \n-
    nodes.hh
    \n+
    sizeinfo.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH
    \n
    5
    \n-
    6#include <cassert>
    \n-
    7#include <memory>
    \n-
    8
    \n-
    9#include <dune/common/indices.hh>
    \n+
    6#include <array>
    \n+
    7
    \n+
    8namespace Dune {
    \n+
    9namespace Functions {
    \n
    10
    \n-
    11#include <dune/typetree/leafnode.hh>
    \n-
    12#include <dune/typetree/powernode.hh>
    \n-
    13#include <dune/typetree/compositenode.hh>
    \n-
    14#include <dune/typetree/traversal.hh>
    \n-
    15#include <dune/typetree/visitor.hh>
    \n-
    16
    \n-
    17namespace Dune {
    \n-
    18 namespace Functions {
    \n-
    19
    \n-
    20
    \n-
    21 namespace Impl {
    \n-
    22
    \n-
    23
    \n-
    24 struct ClearSizeVisitor
    \n-
    25 : public TypeTree::TreeVisitor
    \n-
    26 , public TypeTree::DynamicTraversal
    \n-
    27 {
    \n-
    28
    \n-
    29 template<typename Node, typename TreePath>
    \n-
    30 void pre(Node& node, TreePath treePath)
    \n-
    31 {
    \n-
    32 leaf(node,treePath);
    \n-
    33 node.setSize(0);
    \n-
    34 }
    \n-
    35
    \n-
    36 template<typename Node, typename TreePath>
    \n-
    37 void leaf(Node& node, TreePath treePath)
    \n-
    38 {
    \n-
    39 node.setOffset(offset_);
    \n-
    40 }
    \n-
    41
    \n-
    42 ClearSizeVisitor(std::size_t offset)
    \n-
    43 : offset_(offset)
    \n-
    44 {}
    \n+
    11
    \n+
    12
    \n+
    23template<class B>
    \n+\n+
    25{
    \n+
    26public:
    \n+
    27 using Basis = B;
    \n+
    28 using size_type = typename Basis::size_type;
    \n+
    29 using SizePrefix = typename Basis::SizePrefix;
    \n+
    30
    \n+
    34 SizeInfo(const Basis& basis) :
    \n+
    35 basis_(&basis)
    \n+
    36 {}
    \n+
    37
    \n+
    41 size_type operator()(const SizePrefix& prefix) const
    \n+
    42 {
    \n+
    43 return basis_->size(prefix);
    \n+
    44 }
    \n
    45
    \n-
    46 const std::size_t offset_;
    \n-
    47
    \n-
    48 };
    \n-
    49
    \n-
    50
    \n-
    51 template<typename Entity>
    \n-
    52 struct BindVisitor
    \n-
    53 : public TypeTree::TreeVisitor
    \n-
    54 , public TypeTree::DynamicTraversal
    \n-
    55 {
    \n+
    52 size_type size(const SizePrefix& prefix) const
    \n+
    53 {
    \n+
    54 return basis_->size(prefix);
    \n+
    55 }
    \n
    56
    \n-
    57 template<typename Node, typename TreePath>
    \n-
    58 void pre(Node& node, TreePath)
    \n-
    59 {
    \n-
    60 node.setOffset(offset_);
    \n-
    61 }
    \n-
    62
    \n-
    63 template<typename Node, typename TreePath>
    \n-
    64 void post(Node& node, TreePath)
    \n-
    65 {
    \n-
    66 node.setSize(offset_ - node.offset());
    \n-
    67 }
    \n-
    68
    \n-
    69 template<typename Node, typename TreePath>
    \n-
    70 void leaf(Node& node, TreePath)
    \n-
    71 {
    \n-
    72 node.setOffset(offset_);
    \n-
    73 node.bind(entity_);
    \n-
    74 offset_ += node.size();
    \n-
    75 }
    \n-
    76
    \n-
    77 BindVisitor(const Entity& entity, std::size_t offset = 0)
    \n-
    78 : entity_(entity)
    \n-
    79 , offset_(offset)
    \n-
    80 {}
    \n-
    81
    \n-
    82 const Entity& entity_;
    \n-
    83 std::size_t offset_;
    \n-
    84
    \n-
    85 };
    \n-
    86
    \n-
    87
    \n-
    88 struct InitializeTreeVisitor :
    \n-
    89 public TypeTree::TreeVisitor,
    \n-
    90 public TypeTree::DynamicTraversal
    \n-
    91 {
    \n-
    92 template<typename Node, typename TreePath>
    \n-
    93 void pre(Node& node, TreePath)
    \n-
    94 {
    \n-
    95 node.setTreeIndex(treeIndex_);
    \n-
    96 ++treeIndex_;
    \n-
    97 }
    \n-
    98
    \n-
    99 template<typename Node, typename TreePath>
    \n-
    100 void leaf(Node& node, TreePath)
    \n-
    101 {
    \n-
    102 node.setTreeIndex(treeIndex_);
    \n-
    103 ++treeIndex_;
    \n-
    104 }
    \n-
    105
    \n-
    106 InitializeTreeVisitor(std::size_t treeIndexOffset = 0) :
    \n-
    107 treeIndex_(treeIndexOffset)
    \n-
    108 {}
    \n-
    109
    \n-
    110 std::size_t treeIndex_;
    \n-
    111 };
    \n-
    112
    \n-
    113 } // end namespace Impl
    \n-
    114
    \n-
    115
    \n-\n-
    117 {
    \n-
    118
    \n-
    119 friend struct Impl::ClearSizeVisitor;
    \n-
    120
    \n-
    121 template<typename>
    \n-
    122 friend struct Impl::BindVisitor;
    \n-
    123
    \n-
    124 friend struct Impl::InitializeTreeVisitor;
    \n-
    125
    \n-
    126 public:
    \n-
    127
    \n-
    128 using size_type = std::size_t;
    \n-
    129
    \n-\n-
    131 offset_(0),
    \n-
    132 size_(0),
    \n-
    133 treeIndex_(0)
    \n-
    134 {}
    \n-
    135
    \n-\n-
    137 {
    \n-
    138 assert(i < size_);
    \n-
    139 return offset_ + i;
    \n-
    140 }
    \n-
    141
    \n-\n-
    143 {
    \n-
    144 return size_;
    \n-
    145 }
    \n-
    146
    \n-\n-
    148 {
    \n-
    149 return treeIndex_;
    \n-
    150 }
    \n-
    151
    \n-
    152 protected:
    \n-
    153
    \n-\n-
    155 {
    \n-
    156 return offset_;
    \n-
    157 }
    \n-
    158
    \n-\n-
    160 {
    \n-
    161 offset_ = offset;
    \n-
    162 }
    \n-
    163
    \n-\n-
    165 {
    \n-
    166 size_ = size;
    \n-
    167 }
    \n-
    168
    \n-\n-
    170 {
    \n-
    171 treeIndex_ = treeIndex;
    \n-
    172 }
    \n-
    173
    \n-
    174 private:
    \n-
    175
    \n-
    176 size_type offset_;
    \n-
    177 size_type size_;
    \n-
    178 size_type treeIndex_;
    \n-
    179
    \n-
    180 };
    \n-
    181
    \n-
    182
    \n-\n-
    184 public BasisNodeMixin,
    \n-
    185 public TypeTree::LeafNode
    \n-
    186 {};
    \n-
    187
    \n-
    188
    \n-
    189 template<typename T, std::size_t n>
    \n-\n-
    191 public BasisNodeMixin,
    \n-
    192 public TypeTree::PowerNode<T,n>
    \n-
    193 {
    \n-
    194
    \n-
    195 using Node = TypeTree::PowerNode<T,n>;
    \n-
    196
    \n-
    197 public:
    \n-
    198
    \n-
    199 using Element = typename T::Element;
    \n-
    200
    \n-
    201 PowerBasisNode() = default;
    \n-
    202
    \n-
    203 PowerBasisNode(const typename Node::NodeStorage& children) :
    \n-
    204 Node(children)
    \n-
    205 {}
    \n-
    206
    \n-
    207 const Element& element() const
    \n-
    208 {
    \n-
    209 return this->child(Dune::Indices::_0).element();
    \n-
    210 }
    \n-
    211
    \n-
    212 };
    \n-
    213
    \n-
    214
    \n-
    215 template<typename... T>
    \n-\n-
    217 public BasisNodeMixin,
    \n-
    218 public TypeTree::CompositeNode<T...>
    \n-
    219 {
    \n-
    220
    \n-
    221 using Node = TypeTree::CompositeNode<T...>;
    \n-
    222
    \n-
    223 public:
    \n-
    224
    \n-
    225 using Element = typename Node::template Child<0>::Type::Element;
    \n-
    226
    \n-\n-
    228
    \n-
    229 CompositeBasisNode(const typename Node::NodeStorage& children) :
    \n-
    230 Node(children)
    \n-
    231 {}
    \n-
    232
    \n-
    233 template<typename... Children>
    \n-
    234 CompositeBasisNode(const std::shared_ptr<Children>&... children) :
    \n-
    235 Node(children...)
    \n-
    236 {}
    \n-
    237
    \n-
    238 const Element& element() const
    \n-
    239 {
    \n-
    240 return this->child(Dune::Indices::_0).element();
    \n-
    241 }
    \n-
    242
    \n-
    243 };
    \n-
    244
    \n-
    245
    \n-
    246 template<typename Tree>
    \n-
    247 void clearSize(Tree& tree, std::size_t offset)
    \n-
    248 {
    \n-
    249 TypeTree::applyToTree(tree,Impl::ClearSizeVisitor(offset));
    \n-
    250 }
    \n-
    251
    \n-
    252 template<typename Tree, typename Entity>
    \n-
    253 void bindTree(Tree& tree, const Entity& entity, std::size_t offset = 0)
    \n-
    254 {
    \n-
    255 Impl::BindVisitor<Entity> visitor(entity,offset);
    \n-
    256 TypeTree::applyToTree(tree,visitor);
    \n-
    257 }
    \n-
    258
    \n-
    259 template<typename Tree>
    \n-
    260 void initializeTree(Tree& tree, std::size_t treeIndexOffset = 0)
    \n-
    261 {
    \n-
    262 Impl::InitializeTreeVisitor visitor(treeIndexOffset);
    \n-
    263 TypeTree::applyToTree(tree,visitor);
    \n-
    264 }
    \n-
    265
    \n-
    266
    \n-
    267 } // namespace Functions
    \n-
    268
    \n-
    269} // namespace Dune
    \n-
    270
    \n-
    271#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH
    \n+
    57 operator size_type () const
    \n+
    58 {
    \n+
    59 return basis_->dimension();
    \n+
    60 }
    \n+
    61
    \n+
    62protected:
    \n+
    63
    \n+
    64 const Basis* basis_;
    \n+
    65};
    \n+
    66
    \n+
    67
    \n+
    68template<class Basis>
    \n+
    69SizeInfo<Basis> sizeInfo(const Basis& basis)
    \n+
    70{
    \n+
    71 return SizeInfo<Basis>(basis);
    \n+
    72}
    \n+
    73
    \n+
    74
    \n+
    75
    \n+
    76} // end namespace Functions
    \n+
    77} // end namespace Dune
    \n+
    78
    \n+
    79#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH
    \n
    Definition: polynomial.hh:10
    \n-
    void clearSize(Tree &tree, std::size_t offset)
    Definition: nodes.hh:247
    \n-
    void bindTree(Tree &tree, const Entity &entity, std::size_t offset=0)
    Definition: nodes.hh:253
    \n-
    void initializeTree(Tree &tree, std::size_t treeIndexOffset=0)
    Definition: nodes.hh:260
    \n-
    Definition: nodes.hh:117
    \n-
    size_type treeIndex() const
    Definition: nodes.hh:147
    \n-
    size_type localIndex(size_type i) const
    Definition: nodes.hh:136
    \n-
    size_type offset() const
    Definition: nodes.hh:154
    \n-
    size_type size() const
    Definition: nodes.hh:142
    \n-
    void setOffset(const size_type offset)
    Definition: nodes.hh:159
    \n-
    std::size_t size_type
    Definition: nodes.hh:128
    \n-
    BasisNodeMixin()
    Definition: nodes.hh:130
    \n-
    void setSize(const size_type size)
    Definition: nodes.hh:164
    \n-
    void setTreeIndex(size_type treeIndex)
    Definition: nodes.hh:169
    \n-
    Definition: nodes.hh:186
    \n-
    Definition: nodes.hh:193
    \n-
    const Element & element() const
    Definition: nodes.hh:207
    \n-
    typename T::Element Element
    Definition: nodes.hh:199
    \n-
    PowerBasisNode(const typename Node::NodeStorage &children)
    Definition: nodes.hh:203
    \n-\n-
    Definition: nodes.hh:219
    \n-\n-
    CompositeBasisNode(const typename Node::NodeStorage &children)
    Definition: nodes.hh:229
    \n-
    const Element & element() const
    Definition: nodes.hh:238
    \n-
    typename Node::template Child< 0 >::Type::Element Element
    Definition: nodes.hh:225
    \n-
    CompositeBasisNode(const std::shared_ptr< Children > &... children)
    Definition: nodes.hh:234
    \n+
    SizeInfo< Basis > sizeInfo(const Basis &basis)
    Definition: sizeinfo.hh:69
    \n+
    A class encapsulating size information.
    Definition: sizeinfo.hh:25
    \n+
    typename Basis::SizePrefix SizePrefix
    Definition: sizeinfo.hh:29
    \n+
    size_type size(const SizePrefix &prefix) const
    Return number possible values for next position in multi index.
    Definition: sizeinfo.hh:52
    \n+
    size_type operator()(const SizePrefix &prefix) const
    Return number possible values for next position in multi index.
    Definition: sizeinfo.hh:41
    \n+
    typename Basis::size_type size_type
    Definition: sizeinfo.hh:28
    \n+
    B Basis
    Definition: sizeinfo.hh:27
    \n+
    SizeInfo(const Basis &basis)
    Construct from basis.
    Definition: sizeinfo.hh:34
    \n+
    const Basis * basis_
    Definition: sizeinfo.hh:64
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,354 +5,101 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-nodes.hh\n+sizeinfo.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH\n 5\n- 6#include \n- 7#include \n- 8\n- 9#include \n+ 6#include \n+ 7\n+ 8namespace Dune {\n+ 9namespace Functions {\n 10\n- 11#include \n- 12#include \n- 13#include \n- 14#include \n- 15#include \n- 16\n- 17namespace Dune {\n- 18 namespace Functions {\n- 19\n- 20\n- 21 namespace Impl {\n- 22\n- 23\n- 24 struct ClearSizeVisitor\n- 25 : public TypeTree::TreeVisitor\n- 26 , public TypeTree::DynamicTraversal\n- 27 {\n- 28\n- 29 template\n- 30 void pre(Node& node, TreePath treePath)\n- 31 {\n- 32 leaf(node,treePath);\n- 33 node.setSize(0);\n- 34 }\n- 35\n- 36 template\n- 37 void leaf(Node& node, TreePath treePath)\n- 38 {\n- 39 node.setOffset(offset_);\n- 40 }\n- 41\n- 42 ClearSizeVisitor(std::size_t offset)\n- 43 : offset_(offset)\n- 44 {}\n+ 11\n+ 12\n+ 23template\n+24class SizeInfo\n+ 25{\n+ 26public:\n+27 using Basis = B;\n+28 using size_type = typename Basis::size_type;\n+29 using SizePrefix = typename Basis::SizePrefix;\n+ 30\n+34 SizeInfo(const Basis& basis) :\n+ 35 basis_(&basis)\n+ 36 {}\n+ 37\n+41 size_type operator()(const SizePrefix& prefix) const\n+ 42 {\n+ 43 return basis_->size(prefix);\n+ 44 }\n 45\n- 46 const std::size_t offset_;\n- 47\n- 48 };\n- 49\n- 50\n- 51 template\n- 52 struct BindVisitor\n- 53 : public TypeTree::TreeVisitor\n- 54 , public TypeTree::DynamicTraversal\n- 55 {\n+52 size_type size(const SizePrefix& prefix) const\n+ 53 {\n+ 54 return basis_->size(prefix);\n+ 55 }\n 56\n- 57 template\n- 58 void pre(Node& node, TreePath)\n- 59 {\n- 60 node.setOffset(offset_);\n- 61 }\n- 62\n- 63 template\n- 64 void post(Node& node, TreePath)\n- 65 {\n- 66 node.setSize(offset_ - node.offset());\n- 67 }\n- 68\n- 69 template\n- 70 void leaf(Node& node, TreePath)\n- 71 {\n- 72 node.setOffset(offset_);\n- 73 node.bind(entity_);\n- 74 offset_ += node.size();\n- 75 }\n- 76\n- 77 BindVisitor(const Entity& entity, std::size_t offset = 0)\n- 78 : entity_(entity)\n- 79 , offset_(offset)\n- 80 {}\n- 81\n- 82 const Entity& entity_;\n- 83 std::size_t offset_;\n- 84\n- 85 };\n- 86\n- 87\n- 88 struct InitializeTreeVisitor :\n- 89 public TypeTree::TreeVisitor,\n- 90 public TypeTree::DynamicTraversal\n- 91 {\n- 92 template\n- 93 void pre(Node& node, TreePath)\n- 94 {\n- 95 node.setTreeIndex(treeIndex_);\n- 96 ++treeIndex_;\n- 97 }\n- 98\n- 99 template\n- 100 void leaf(Node& node, TreePath)\n- 101 {\n- 102 node.setTreeIndex(treeIndex_);\n- 103 ++treeIndex_;\n- 104 }\n- 105\n- 106 InitializeTreeVisitor(std::size_t treeIndexOffset = 0) :\n- 107 treeIndex_(treeIndexOffset)\n- 108 {}\n- 109\n- 110 std::size_t treeIndex_;\n- 111 };\n- 112\n- 113 } // end namespace Impl\n- 114\n- 115\n-116 class BasisNodeMixin\n- 117 {\n- 118\n- 119 friend struct Impl::ClearSizeVisitor;\n- 120\n- 121 template\n- 122 friend struct Impl::BindVisitor;\n- 123\n- 124 friend struct Impl::InitializeTreeVisitor;\n- 125\n- 126 public:\n- 127\n-128 using size_type = std::size_t;\n- 129\n-130 BasisNodeMixin() :\n- 131 offset_(0),\n- 132 size_(0),\n- 133 treeIndex_(0)\n- 134 {}\n- 135\n-136 size_type localIndex(size_type i) const\n- 137 {\n- 138 assert(i < size_);\n- 139 return offset_ + i;\n- 140 }\n- 141\n-142 size_type size() const\n- 143 {\n- 144 return size_;\n- 145 }\n- 146\n-147 size_type treeIndex() const\n- 148 {\n- 149 return treeIndex_;\n- 150 }\n- 151\n- 152 protected:\n- 153\n-154 size_type offset() const\n- 155 {\n- 156 return offset_;\n- 157 }\n- 158\n-159 void setOffset(const size_type offset)\n- 160 {\n- 161 offset_ = offset;\n- 162 }\n- 163\n-164 void setSize(const size_type size)\n- 165 {\n- 166 size_ = size;\n- 167 }\n- 168\n-169 void setTreeIndex(size_type treeIndex)\n- 170 {\n- 171 treeIndex_ = treeIndex;\n- 172 }\n- 173\n- 174 private:\n- 175\n- 176 size_type offset_;\n- 177 size_type size_;\n- 178 size_type treeIndex_;\n- 179\n- 180 };\n- 181\n- 182\n-183 class LeafBasisNode :\n- 184 public BasisNodeMixin,\n- 185 public TypeTree::LeafNode\n- 186 {};\n- 187\n- 188\n- 189 template\n-190 class PowerBasisNode :\n- 191 public BasisNodeMixin,\n- 192 public TypeTree::PowerNode\n- 193 {\n- 194\n- 195 using Node = TypeTree::PowerNode;\n- 196\n- 197 public:\n- 198\n-199 using Element = typename T::Element;\n- 200\n-201 PowerBasisNode() = default;\n- 202\n-203 PowerBasisNode(const typename Node::NodeStorage& children) :\n- 204 Node(children)\n- 205 {}\n- 206\n-207 const Element& element() const\n- 208 {\n- 209 return this->child(Dune::Indices::_0).element();\n- 210 }\n- 211\n- 212 };\n- 213\n- 214\n- 215 template\n-216 class CompositeBasisNode :\n- 217 public BasisNodeMixin,\n- 218 public TypeTree::CompositeNode\n- 219 {\n- 220\n- 221 using Node = TypeTree::CompositeNode;\n- 222\n- 223 public:\n- 224\n-225 using Element = typename Node::template Child<0>::Type::Element;\n- 226\n-227 CompositeBasisNode() = default;\n- 228\n-229 CompositeBasisNode(const typename Node::NodeStorage& children) :\n- 230 Node(children)\n- 231 {}\n- 232\n- 233 template\n-234 CompositeBasisNode(const std::shared_ptr&... children) :\n- 235 Node(children...)\n- 236 {}\n- 237\n-238 const Element& element() const\n- 239 {\n- 240 return this->child(Dune::Indices::_0).element();\n- 241 }\n- 242\n- 243 };\n- 244\n- 245\n- 246 template\n-247 void clearSize(Tree& tree, std::size_t offset)\n- 248 {\n- 249 TypeTree::applyToTree(tree,Impl::ClearSizeVisitor(offset));\n- 250 }\n- 251\n- 252 template\n-253 void bindTree(Tree& tree, const Entity& entity, std::size_t offset = 0)\n- 254 {\n- 255 Impl::BindVisitor visitor(entity,offset);\n- 256 TypeTree::applyToTree(tree,visitor);\n- 257 }\n- 258\n- 259 template\n-260 void initializeTree(Tree& tree, std::size_t treeIndexOffset = 0)\n- 261 {\n- 262 Impl::InitializeTreeVisitor visitor(treeIndexOffset);\n- 263 TypeTree::applyToTree(tree,visitor);\n- 264 }\n- 265\n- 266\n- 267 } // namespace Functions\n- 268\n- 269} // namespace Dune\n- 270\n- 271#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH\n+57 operator size_type () const\n+ 58 {\n+ 59 return basis_->dimension();\n+ 60 }\n+ 61\n+ 62protected:\n+ 63\n+64 const Basis* basis_;\n+ 65};\n+ 66\n+ 67\n+ 68template\n+69SizeInfo sizeInfo(const Basis& basis)\n+ 70{\n+ 71 return SizeInfo(basis);\n+ 72}\n+ 73\n+ 74\n+ 75\n+ 76} // end namespace Functions\n+ 77} // end namespace Dune\n+ 78\n+ 79#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::clearSize\n-void clearSize(Tree &tree, std::size_t offset)\n-Definition: nodes.hh:247\n-Dune::Functions::bindTree\n-void bindTree(Tree &tree, const Entity &entity, std::size_t offset=0)\n-Definition: nodes.hh:253\n-Dune::Functions::initializeTree\n-void initializeTree(Tree &tree, std::size_t treeIndexOffset=0)\n-Definition: nodes.hh:260\n-Dune::Functions::BasisNodeMixin\n-Definition: nodes.hh:117\n-Dune::Functions::BasisNodeMixin::treeIndex\n-size_type treeIndex() const\n-Definition: nodes.hh:147\n-Dune::Functions::BasisNodeMixin::localIndex\n-size_type localIndex(size_type i) const\n-Definition: nodes.hh:136\n-Dune::Functions::BasisNodeMixin::offset\n-size_type offset() const\n-Definition: nodes.hh:154\n-Dune::Functions::BasisNodeMixin::size\n-size_type size() const\n-Definition: nodes.hh:142\n-Dune::Functions::BasisNodeMixin::setOffset\n-void setOffset(const size_type offset)\n-Definition: nodes.hh:159\n-Dune::Functions::BasisNodeMixin::size_type\n-std::size_t size_type\n-Definition: nodes.hh:128\n-Dune::Functions::BasisNodeMixin::BasisNodeMixin\n-BasisNodeMixin()\n-Definition: nodes.hh:130\n-Dune::Functions::BasisNodeMixin::setSize\n-void setSize(const size_type size)\n-Definition: nodes.hh:164\n-Dune::Functions::BasisNodeMixin::setTreeIndex\n-void setTreeIndex(size_type treeIndex)\n-Definition: nodes.hh:169\n-Dune::Functions::LeafBasisNode\n-Definition: nodes.hh:186\n-Dune::Functions::PowerBasisNode\n-Definition: nodes.hh:193\n-Dune::Functions::PowerBasisNode::element\n-const Element & element() const\n-Definition: nodes.hh:207\n-Dune::Functions::PowerBasisNode::Element\n-typename T::Element Element\n-Definition: nodes.hh:199\n-Dune::Functions::PowerBasisNode::PowerBasisNode\n-PowerBasisNode(const typename Node::NodeStorage &children)\n-Definition: nodes.hh:203\n-Dune::Functions::PowerBasisNode::PowerBasisNode\n-PowerBasisNode()=default\n-Dune::Functions::CompositeBasisNode\n-Definition: nodes.hh:219\n-Dune::Functions::CompositeBasisNode::CompositeBasisNode\n-CompositeBasisNode()=default\n-Dune::Functions::CompositeBasisNode::CompositeBasisNode\n-CompositeBasisNode(const typename Node::NodeStorage &children)\n-Definition: nodes.hh:229\n-Dune::Functions::CompositeBasisNode::element\n-const Element & element() const\n-Definition: nodes.hh:238\n-Dune::Functions::CompositeBasisNode::Element\n-typename Node::template Child< 0 >::Type::Element Element\n-Definition: nodes.hh:225\n-Dune::Functions::CompositeBasisNode::CompositeBasisNode\n-CompositeBasisNode(const std::shared_ptr< Children > &... children)\n-Definition: nodes.hh:234\n+Dune::Functions::sizeInfo\n+SizeInfo< Basis > sizeInfo(const Basis &basis)\n+Definition: sizeinfo.hh:69\n+Dune::Functions::SizeInfo\n+A class encapsulating size information.\n+Definition: sizeinfo.hh:25\n+Dune::Functions::SizeInfo::SizePrefix\n+typename Basis::SizePrefix SizePrefix\n+Definition: sizeinfo.hh:29\n+Dune::Functions::SizeInfo::size\n+size_type size(const SizePrefix &prefix) const\n+Return number possible values for next position in multi index.\n+Definition: sizeinfo.hh:52\n+Dune::Functions::SizeInfo::operator()\n+size_type operator()(const SizePrefix &prefix) const\n+Return number possible values for next position in multi index.\n+Definition: sizeinfo.hh:41\n+Dune::Functions::SizeInfo::size_type\n+typename Basis::size_type size_type\n+Definition: sizeinfo.hh:28\n+Dune::Functions::SizeInfo::Basis\n+B Basis\n+Definition: sizeinfo.hh:27\n+Dune::Functions::SizeInfo::SizeInfo\n+SizeInfo(const Basis &basis)\n+Construct from basis.\n+Definition: sizeinfo.hh:34\n+Dune::Functions::SizeInfo::basis_\n+const Basis * basis_\n+Definition: sizeinfo.hh:64\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00113.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00113.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: flatmultiindex.hh File Reference\n+dune-functions: rannacherturekbasis.hh File Reference\n \n \n \n \n \n \n \n@@ -63,37 +63,61 @@\n \n \n
    \n \n-
    flatmultiindex.hh File Reference
    \n+Typedefs |\n+Functions
    \n+
    rannacherturekbasis.hh File Reference
    \n \n
    \n-
    #include <array>
    \n-#include <dune/functions/common/multiindex.hh>
    \n+
    #include <dune/common/exceptions.hh>
    \n+#include <dune/grid/common/capabilities.hh>
    \n+#include <dune/localfunctions/common/localfiniteelementvariant.hh>
    \n+#include <dune/localfunctions/rannacherturek.hh>
    \n+#include <dune/localfunctions/crouzeixraviart.hh>
    \n+#include <dune/functions/functionspacebases/nodes.hh>
    \n+#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n+\n+\n+\n+\n+\n+\n+

    \n+Classes

    class  Dune::Functions::RannacherTurekPreBasis< GV >
     Pre-basis for a Rannacher-Turek basis. More...
     
    class  Dune::Functions::RannacherTurekNode< GV >
     
    \n \n \n \n \n \n+\n+\n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    namespace  Dune::Functions::BasisFactory
     
    \n \n-\n-\n-\n-\n+\n+\n+\n+\n+

    \n Typedefs

    template<class size_type >
    using Dune::Functions::FlatMultiIndex = StaticMultiIndex< size_type, 1 >
     A multi-index class with only one level. More...
     
    template<typename GV >
    using Dune::Functions::RannacherTurekBasis = DefaultGlobalBasis< RannacherTurekPreBasis< GV > >
     Rannacher-Turek basis. More...
     
    \n+\n+\n+\n+\n+\n

    \n+Functions

    template<class Dummy = void>
    auto Dune::Functions::BasisFactory::rannacherTurek ()
     Create a pre-basis factory that can create a Rannacher-Turek pre-basis. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,25 +5,45 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-Namespaces | Typedefs\n-flatmultiindex.hh File Reference\n-#include \n-#include \n+Classes | Namespaces | Typedefs | Functions\n+rannacherturekbasis.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n+ Classes\n+class \u00a0Dune::Functions::RannacherTurekPreBasis<_GV_>\n+\u00a0 Pre-basis for a Rannacher-Turek basis. More...\n+\u00a0\n+class \u00a0Dune::Functions::RannacherTurekNode<_GV_>\n+\u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n+namespace \u00a0Dune::Functions::BasisFactory\n+\u00a0\n Typedefs\n-template\n-using\u00a0Dune::Functions::FlatMultiIndex = StaticMultiIndex< size_type, 1 >\n-\u00a0 A multi-index class with only one level. More...\n+template\n+using\u00a0Dune::Functions::RannacherTurekBasis = DefaultGlobalBasis<\n+ RannacherTurekPreBasis< GV > >\n+\u00a0 Rannacher-Turek basis. More...\n+\u00a0\n+ Functions\n+template\n+auto\u00a0Dune::Functions::BasisFactory::rannacherTurek ()\n+\u00a0 Create a pre-basis factory that can create a Rannacher-Turek pre-basis.\n+ More...\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00113_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00113_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: flatmultiindex.hh Source File\n+dune-functions: rannacherturekbasis.hh Source File\n \n \n \n \n \n \n \n@@ -62,43 +62,251 @@\n \n \n
    \n
    \n-
    flatmultiindex.hh
    \n+
    rannacherturekbasis.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH
    \n
    5
    \n-
    6#include <array>
    \n+
    6#include <dune/common/exceptions.hh>
    \n
    7
    \n-\n+
    8#include <dune/grid/common/capabilities.hh>
    \n
    9
    \n-
    10namespace Dune {
    \n-
    11namespace Functions {
    \n-
    12
    \n+
    10#include <dune/localfunctions/common/localfiniteelementvariant.hh>
    \n+
    11#include <dune/localfunctions/rannacherturek.hh>
    \n+
    12#include <dune/localfunctions/crouzeixraviart.hh>
    \n
    13
    \n-
    14
    \n-
    30template<class size_type>
    \n-\n-
    32
    \n-
    33
    \n+\n+\n+
    16
    \n+
    17
    \n+
    18namespace Dune {
    \n+
    19namespace Functions {
    \n+
    20
    \n+
    21// *****************************************************************************
    \n+
    22// This is the reusable part of the basis. It contains
    \n+
    23//
    \n+
    24// RannacherTurekPreBasis
    \n+
    25// RannacherTurekNode
    \n+
    26//
    \n+
    27// The pre-basis allows to create the others and is the owner of possible shared
    \n+
    28// state. These components do _not_ depend on the global basis and local view
    \n+
    29// and can be used without a global basis.
    \n+
    30// *****************************************************************************
    \n+
    31
    \n+
    32template<typename GV>
    \n+
    33class RannacherTurekNode;
    \n
    34
    \n-
    35} // end namespace Functions
    \n-
    36} // end namespace Dune
    \n+
    35template<typename GV>
    \n+
    36class RannacherTurekPreBasis;
    \n
    37
    \n-
    38#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH
    \n-\n+
    50template<typename GV>
    \n+\n+
    52{
    \n+
    53 static const int dim = GV::dimension;
    \n+
    54
    \n+
    55public:
    \n+
    56
    \n+
    58 using GridView = GV;
    \n+
    59
    \n+
    61 using size_type = std::size_t;
    \n+
    62
    \n+\n+
    65
    \n+
    66 static constexpr size_type maxMultiIndexSize = 1;
    \n+
    67 static constexpr size_type minMultiIndexSize = 1;
    \n+
    68 static constexpr size_type multiIndexBufferSize = 1;
    \n+
    69
    \n+\n+
    72 gridView_(gv)
    \n+
    73 {
    \n+
    74 for(auto type : gv.indexSet().types(0))
    \n+
    75 if (!type.isSimplex() && !type.isCube())
    \n+
    76 DUNE_THROW(Dune::NotImplemented, "Rannacher-Turek or Crouzeix-Raviart elements are only implemented for grids with simplex or cube elements.");
    \n+
    77 }
    \n+
    78
    \n+\n+
    81 {}
    \n+
    82
    \n+
    84 const GridView& gridView() const
    \n+
    85 {
    \n+
    86 return gridView_;
    \n+
    87 }
    \n+
    88
    \n+
    90 void update (const GridView& gv)
    \n+
    91 {
    \n+
    92 gridView_ = gv;
    \n+
    93 }
    \n+
    94
    \n+
    98 Node makeNode() const
    \n+
    99 {
    \n+
    100 return Node{};
    \n+
    101 }
    \n+
    102
    \n+\n+
    105 {
    \n+
    106 return (size_type)(gridView_.size(1));
    \n+
    107 }
    \n+
    108
    \n+
    110 template<class SizePrefix>
    \n+
    111 size_type size(const SizePrefix prefix) const
    \n+
    112 {
    \n+
    113 assert(prefix.size() == 0 || prefix.size() == 1);
    \n+
    114 return (prefix.size() == 0) ? size() : 0;
    \n+
    115 }
    \n+
    116
    \n+\n+
    119 {
    \n+
    120 return size();
    \n+
    121 }
    \n+
    122
    \n+\n+
    125 {
    \n+
    126 return 2*GV::dimension;
    \n+
    127 }
    \n+
    128
    \n+
    129 template<typename It>
    \n+
    130 It indices(const Node& node, It it) const
    \n+
    131 {
    \n+
    132 for (size_type i = 0, end = node.size() ; i < end ; ++i, ++it)
    \n+
    133 {
    \n+
    134 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
    \n+
    135 const auto& gridIndexSet = gridView().indexSet();
    \n+
    136 const auto& element = node.element();
    \n+
    137
    \n+
    138 *it = {{ (size_type)(gridIndexSet.subIndex(element,localKey.subEntity(),1)) }};
    \n+
    139 }
    \n+
    140 return it;
    \n+
    141 }
    \n+
    142
    \n+
    143protected:
    \n+\n+
    145};
    \n+
    146
    \n+
    147
    \n+
    148
    \n+
    149template<typename GV>
    \n+\n+
    151 public LeafBasisNode
    \n+
    152{
    \n+
    153 static const int dim = GV::dimension;
    \n+
    154 static const int maxSize = 2*dim;
    \n+
    155
    \n+
    156 constexpr static bool hasFixedElementType = Capabilities::hasSingleGeometryType<typename GV::Grid>::v;
    \n+
    157
    \n+
    158 using CubeFiniteElement = RannacherTurekLocalFiniteElement<typename GV::ctype,double,dim>;
    \n+
    159 using SimplexFiniteElement = CrouzeixRaviartLocalFiniteElement<typename GV::ctype,double,dim>;
    \n+
    160
    \n+
    161 constexpr static unsigned int topologyId = Capabilities::hasSingleGeometryType<typename GV::Grid>::topologyId; // meaningless if hasFixedElementType is false
    \n+
    162 constexpr static GeometryType type = GeometryType(topologyId, GV::dimension);
    \n+
    163
    \n+
    164public:
    \n+
    165
    \n+
    166 using size_type = std::size_t;
    \n+
    167 using Element = typename GV::template Codim<0>::Entity;
    \n+
    168 using FiniteElement = std::conditional_t<hasFixedElementType,
    \n+
    169 std::conditional_t<type.isCube(),CubeFiniteElement,SimplexFiniteElement>,
    \n+
    170 LocalFiniteElementVariant<CubeFiniteElement, SimplexFiniteElement> >;
    \n+
    171
    \n+\n+\n+
    174 element_(nullptr)
    \n+
    175 {}
    \n+
    176
    \n+
    178 const Element& element() const
    \n+
    179 {
    \n+
    180 return *element_;
    \n+
    181 }
    \n+
    182
    \n+\n+
    188 {
    \n+
    189 return finiteElement_;
    \n+
    190 }
    \n+
    191
    \n+
    193 void bind(const Element& e)
    \n+
    194 {
    \n+
    195 element_ = &e;
    \n+
    196 if constexpr (!hasFixedElementType)
    \n+
    197 finiteElement_ = e.type().isCube() ? static_cast<FiniteElement>(CubeFiniteElement())
    \n+
    198 : static_cast<FiniteElement>(SimplexFiniteElement()) ;
    \n+
    199 this->setSize(finiteElement_.size());
    \n+
    200 }
    \n+
    201
    \n+
    202protected:
    \n+
    203
    \n+\n+\n+
    206};
    \n+
    207
    \n+
    208
    \n+
    209
    \n+
    210namespace BasisFactory {
    \n+
    211
    \n+
    217template<class Dummy=void>
    \n+\n+
    219{
    \n+
    220 return [](const auto& gridView) {
    \n+
    221 return RannacherTurekPreBasis<std::decay_t<decltype(gridView)>>(gridView);
    \n+
    222 };
    \n+
    223}
    \n+
    224
    \n+
    225} // end namespace BasisFactory
    \n+
    226
    \n+
    227
    \n+
    228
    \n+
    229
    \n+
    241template<typename GV>
    \n+\n+
    243
    \n+
    244} // end namespace Functions
    \n+
    245} // end namespace Dune
    \n+
    246
    \n+
    247#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH
    \n+\n+\n+
    auto rannacherTurek()
    Create a pre-basis factory that can create a Rannacher-Turek pre-basis.
    Definition: rannacherturekbasis.hh:218
    \n
    Definition: polynomial.hh:10
    \n-
    A statically sized MultiIndex type.
    Definition: multiindex.hh:49
    \n+
    Global basis for given pre-basis.
    Definition: defaultglobalbasis.hh:46
    \n+
    size_type size() const
    Definition: nodes.hh:142
    \n+
    std::size_t size_type
    Definition: nodes.hh:128
    \n+
    void setSize(const size_type size)
    Definition: nodes.hh:164
    \n+
    Definition: nodes.hh:186
    \n+
    Definition: rannacherturekbasis.hh:152
    \n+
    std::conditional_t< hasFixedElementType, std::conditional_t< type.isCube(), CubeFiniteElement, SimplexFiniteElement >, LocalFiniteElementVariant< CubeFiniteElement, SimplexFiniteElement > > FiniteElement
    Definition: rannacherturekbasis.hh:170
    \n+
    void bind(const Element &e)
    Bind to element.
    Definition: rannacherturekbasis.hh:193
    \n+
    FiniteElement finiteElement_
    Definition: rannacherturekbasis.hh:204
    \n+
    typename GV::template Codim< 0 >::Entity Element
    Definition: rannacherturekbasis.hh:167
    \n+
    RannacherTurekNode()
    Definition: rannacherturekbasis.hh:172
    \n+
    const Element * element_
    Definition: rannacherturekbasis.hh:205
    \n+
    const FiniteElement & finiteElement() const
    Return the LocalFiniteElement for the element we are bound to.
    Definition: rannacherturekbasis.hh:187
    \n+
    const Element & element() const
    Return current element, throw if unbound.
    Definition: rannacherturekbasis.hh:178
    \n+
    Pre-basis for a Rannacher-Turek basis.
    Definition: rannacherturekbasis.hh:52
    \n+
    static constexpr size_type multiIndexBufferSize
    Definition: rannacherturekbasis.hh:68
    \n+
    void initializeIndices()
    Initialize the global indices.
    Definition: rannacherturekbasis.hh:80
    \n+
    static constexpr size_type maxMultiIndexSize
    Definition: rannacherturekbasis.hh:66
    \n+
    static constexpr size_type minMultiIndexSize
    Definition: rannacherturekbasis.hh:67
    \n+
    size_type size(const SizePrefix prefix) const
    Return number of possible values for next position in multi index.
    Definition: rannacherturekbasis.hh:111
    \n+
    std::size_t size_type
    Type used for indices and size information.
    Definition: rannacherturekbasis.hh:61
    \n+
    Node makeNode() const
    Create tree node.
    Definition: rannacherturekbasis.hh:98
    \n+
    void update(const GridView &gv)
    Update the stored grid view, to be called if the grid has changed.
    Definition: rannacherturekbasis.hh:90
    \n+
    It indices(const Node &node, It it) const
    Definition: rannacherturekbasis.hh:130
    \n+
    GV GridView
    The grid view that the FE basis is defined on.
    Definition: rannacherturekbasis.hh:58
    \n+
    size_type dimension() const
    Get the total dimension of the space spanned by this basis.
    Definition: rannacherturekbasis.hh:118
    \n+
    RannacherTurekPreBasis(const GridView &gv)
    Constructor for a given grid view object.
    Definition: rannacherturekbasis.hh:71
    \n+
    size_type size() const
    Same as size(prefix) with empty prefix.
    Definition: rannacherturekbasis.hh:104
    \n+
    const GridView & gridView() const
    Obtain the grid view that the basis is defined on.
    Definition: rannacherturekbasis.hh:84
    \n+
    size_type maxNodeSize() const
    Get the maximal number of DOFs associated to node for any element.
    Definition: rannacherturekbasis.hh:124
    \n+
    GridView gridView_
    Definition: rannacherturekbasis.hh:144
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,41 +5,340 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-flatmultiindex.hh\n+rannacherturekbasis.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH\n 5\n- 6#include \n+ 6#include \n 7\n- 8#include \n+ 8#include \n 9\n- 10namespace Dune {\n- 11namespace Functions {\n- 12\n+ 10#include \n+ 11#include \n+ 12#include \n 13\n- 14\n- 30template\n-31using FlatMultiIndex = StaticMultiIndex;\n- 32\n- 33\n+ 14#include \n+ 15#include \n+ 16\n+ 17\n+ 18namespace Dune {\n+ 19namespace Functions {\n+ 20\n+ 21/\n+/ *****************************************************************************\n+ 22// This is the reusable part of the basis. It contains\n+ 23//\n+ 24// RannacherTurekPreBasis\n+ 25// RannacherTurekNode\n+ 26//\n+ 27// The pre-basis allows to create the others and is the owner of possible\n+shared\n+ 28// state. These components do _not_ depend on the global basis and local\n+view\n+ 29// and can be used without a global basis.\n+ 30/\n+/ *****************************************************************************\n+ 31\n+ 32template\n+ 33class RannacherTurekNode;\n 34\n- 35} // end namespace Functions\n- 36} // end namespace Dune\n+ 35template\n+ 36class RannacherTurekPreBasis;\n 37\n- 38#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH\n-multiindex.hh\n+ 50template\n+51class RannacherTurekPreBasis\n+ 52{\n+ 53 static const int dim = GV::dimension;\n+ 54\n+ 55public:\n+ 56\n+58 using GridView = GV;\n+ 59\n+61 using size_type = std::size_t;\n+ 62\n+64 using Node = RannacherTurekNode;\n+ 65\n+66 static constexpr size_type maxMultiIndexSize = 1;\n+67 static constexpr size_type minMultiIndexSize = 1;\n+68 static constexpr size_type multiIndexBufferSize = 1;\n+ 69\n+71 RannacherTurekPreBasis(const GridView& gv) :\n+ 72 gridView_(gv)\n+ 73 {\n+ 74 for(auto type : gv.indexSet().types(0))\n+ 75 if (!type.isSimplex() && !type.isCube())\n+ 76 DUNE_THROW(Dune::NotImplemented, \"Rannacher-Turek or Crouzeix-Raviart\n+elements are only implemented for grids with simplex or cube elements.\");\n+ 77 }\n+ 78\n+80 void initializeIndices()\n+ 81 {}\n+ 82\n+84 const GridView& gridView() const\n+ 85 {\n+ 86 return gridView_;\n+ 87 }\n+ 88\n+90 void update (const GridView& gv)\n+ 91 {\n+ 92 gridView_ = gv;\n+ 93 }\n+ 94\n+98 Node makeNode() const\n+ 99 {\n+ 100 return Node{};\n+ 101 }\n+ 102\n+104 size_type size() const\n+ 105 {\n+ 106 return (size_type)(gridView_.size(1));\n+ 107 }\n+ 108\n+ 110 template\n+111 size_type size(const SizePrefix prefix) const\n+ 112 {\n+ 113 assert(prefix.size() == 0 || prefix.size() == 1);\n+ 114 return (prefix.size() == 0) ? size() : 0;\n+ 115 }\n+ 116\n+118 size_type dimension() const\n+ 119 {\n+ 120 return size();\n+ 121 }\n+ 122\n+124 size_type maxNodeSize() const\n+ 125 {\n+ 126 return 2*GV::dimension;\n+ 127 }\n+ 128\n+ 129 template\n+130 It indices(const Node& node, It it) const\n+ 131 {\n+ 132 for (size_type i = 0, end = node.size() ; i < end ; ++i, ++it)\n+ 133 {\n+ 134 Dune::LocalKey localKey = node.finiteElement().localCoefficients\n+().localKey(i);\n+ 135 const auto& gridIndexSet = gridView().indexSet();\n+ 136 const auto& element = node.element();\n+ 137\n+ 138 *it = {{ (size_type)(gridIndexSet.subIndex(element,localKey.subEntity\n+(),1)) }};\n+ 139 }\n+ 140 return it;\n+ 141 }\n+ 142\n+ 143protected:\n+144 GridView gridView_;\n+ 145};\n+ 146\n+ 147\n+ 148\n+ 149template\n+150class RannacherTurekNode :\n+ 151 public LeafBasisNode\n+ 152{\n+ 153 static const int dim = GV::dimension;\n+ 154 static const int maxSize = 2*dim;\n+ 155\n+ 156 constexpr static bool hasFixedElementType = Capabilities::\n+hasSingleGeometryType::v;\n+ 157\n+ 158 using CubeFiniteElement = RannacherTurekLocalFiniteElement;\n+ 159 using SimplexFiniteElement = CrouzeixRaviartLocalFiniteElement;\n+ 160\n+ 161 constexpr static unsigned int topologyId = Capabilities::\n+hasSingleGeometryType::topologyId; // meaningless if\n+hasFixedElementType is false\n+ 162 constexpr static GeometryType type = GeometryType(topologyId, GV::\n+dimension);\n+ 163\n+ 164public:\n+ 165\n+166 using size_type = std::size_t;\n+167 using Element = typename GV::template Codim<0>::Entity;\n+168 using FiniteElement = std::conditional_t,\n+ 170 LocalFiniteElementVariant >;\n+ 171\n+172 RannacherTurekNode() :\n+ 173 finiteElement_(),\n+ 174 element_(nullptr)\n+ 175 {}\n+ 176\n+178 const Element& element() const\n+ 179 {\n+ 180 return *element_;\n+ 181 }\n+ 182\n+187 const FiniteElement& finiteElement() const\n+ 188 {\n+ 189 return finiteElement_;\n+ 190 }\n+ 191\n+193 void bind(const Element& e)\n+ 194 {\n+ 195 element_ = &e;\n+ 196 if constexpr (!hasFixedElementType)\n+ 197 finiteElement_ = e.type().isCube() ? static_cast\n+(CubeFiniteElement())\n+ 198 : static_cast(SimplexFiniteElement()) ;\n+ 199 this->setSize(finiteElement_.size());\n+ 200 }\n+ 201\n+ 202protected:\n+ 203\n+204 FiniteElement finiteElement_;\n+205 const Element* element_;\n+ 206};\n+ 207\n+ 208\n+ 209\n+ 210namespace BasisFactory {\n+ 211\n+ 217template\n+218auto rannacherTurek()\n+ 219{\n+ 220 return [](const auto& gridView) {\n+ 221 return RannacherTurekPreBasis>(gridView);\n+ 222 };\n+ 223}\n+ 224\n+ 225} // end namespace BasisFactory\n+ 226\n+ 227\n+ 228\n+ 229\n+ 241template\n+242using RannacherTurekBasis = DefaultGlobalBasis >;\n+ 243\n+ 244} // end namespace Functions\n+ 245} // end namespace Dune\n+ 246\n+ 247#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH\n+nodes.hh\n+defaultglobalbasis.hh\n+Dune::Functions::BasisFactory::rannacherTurek\n+auto rannacherTurek()\n+Create a pre-basis factory that can create a Rannacher-Turek pre-basis.\n+Definition: rannacherturekbasis.hh:218\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::StaticMultiIndex<_size_type,_1_>\n-A statically sized MultiIndex type.\n-Definition: multiindex.hh:49\n+Dune::Functions::DefaultGlobalBasis\n+Global basis for given pre-basis.\n+Definition: defaultglobalbasis.hh:46\n+Dune::Functions::BasisNodeMixin::size\n+size_type size() const\n+Definition: nodes.hh:142\n+Dune::Functions::BasisNodeMixin::size_type\n+std::size_t size_type\n+Definition: nodes.hh:128\n+Dune::Functions::BasisNodeMixin::setSize\n+void setSize(const size_type size)\n+Definition: nodes.hh:164\n+Dune::Functions::LeafBasisNode\n+Definition: nodes.hh:186\n+Dune::Functions::RannacherTurekNode\n+Definition: rannacherturekbasis.hh:152\n+Dune::Functions::RannacherTurekNode::FiniteElement\n+std::conditional_t< hasFixedElementType, std::conditional_t< type.isCube(),\n+CubeFiniteElement, SimplexFiniteElement >, LocalFiniteElementVariant<\n+CubeFiniteElement, SimplexFiniteElement > > FiniteElement\n+Definition: rannacherturekbasis.hh:170\n+Dune::Functions::RannacherTurekNode::bind\n+void bind(const Element &e)\n+Bind to element.\n+Definition: rannacherturekbasis.hh:193\n+Dune::Functions::RannacherTurekNode::finiteElement_\n+FiniteElement finiteElement_\n+Definition: rannacherturekbasis.hh:204\n+Dune::Functions::RannacherTurekNode::Element\n+typename GV::template Codim< 0 >::Entity Element\n+Definition: rannacherturekbasis.hh:167\n+Dune::Functions::RannacherTurekNode::RannacherTurekNode\n+RannacherTurekNode()\n+Definition: rannacherturekbasis.hh:172\n+Dune::Functions::RannacherTurekNode::element_\n+const Element * element_\n+Definition: rannacherturekbasis.hh:205\n+Dune::Functions::RannacherTurekNode::finiteElement\n+const FiniteElement & finiteElement() const\n+Return the LocalFiniteElement for the element we are bound to.\n+Definition: rannacherturekbasis.hh:187\n+Dune::Functions::RannacherTurekNode::element\n+const Element & element() const\n+Return current element, throw if unbound.\n+Definition: rannacherturekbasis.hh:178\n+Dune::Functions::RannacherTurekPreBasis\n+Pre-basis for a Rannacher-Turek basis.\n+Definition: rannacherturekbasis.hh:52\n+Dune::Functions::RannacherTurekPreBasis::multiIndexBufferSize\n+static constexpr size_type multiIndexBufferSize\n+Definition: rannacherturekbasis.hh:68\n+Dune::Functions::RannacherTurekPreBasis::initializeIndices\n+void initializeIndices()\n+Initialize the global indices.\n+Definition: rannacherturekbasis.hh:80\n+Dune::Functions::RannacherTurekPreBasis::maxMultiIndexSize\n+static constexpr size_type maxMultiIndexSize\n+Definition: rannacherturekbasis.hh:66\n+Dune::Functions::RannacherTurekPreBasis::minMultiIndexSize\n+static constexpr size_type minMultiIndexSize\n+Definition: rannacherturekbasis.hh:67\n+Dune::Functions::RannacherTurekPreBasis::size\n+size_type size(const SizePrefix prefix) const\n+Return number of possible values for next position in multi index.\n+Definition: rannacherturekbasis.hh:111\n+Dune::Functions::RannacherTurekPreBasis::size_type\n+std::size_t size_type\n+Type used for indices and size information.\n+Definition: rannacherturekbasis.hh:61\n+Dune::Functions::RannacherTurekPreBasis::makeNode\n+Node makeNode() const\n+Create tree node.\n+Definition: rannacherturekbasis.hh:98\n+Dune::Functions::RannacherTurekPreBasis::update\n+void update(const GridView &gv)\n+Update the stored grid view, to be called if the grid has changed.\n+Definition: rannacherturekbasis.hh:90\n+Dune::Functions::RannacherTurekPreBasis::indices\n+It indices(const Node &node, It it) const\n+Definition: rannacherturekbasis.hh:130\n+Dune::Functions::RannacherTurekPreBasis::GridView\n+GV GridView\n+The grid view that the FE basis is defined on.\n+Definition: rannacherturekbasis.hh:58\n+Dune::Functions::RannacherTurekPreBasis::dimension\n+size_type dimension() const\n+Get the total dimension of the space spanned by this basis.\n+Definition: rannacherturekbasis.hh:118\n+Dune::Functions::RannacherTurekPreBasis::RannacherTurekPreBasis\n+RannacherTurekPreBasis(const GridView &gv)\n+Constructor for a given grid view object.\n+Definition: rannacherturekbasis.hh:71\n+Dune::Functions::RannacherTurekPreBasis::size\n+size_type size() const\n+Same as size(prefix) with empty prefix.\n+Definition: rannacherturekbasis.hh:104\n+Dune::Functions::RannacherTurekPreBasis::gridView\n+const GridView & gridView() const\n+Obtain the grid view that the basis is defined on.\n+Definition: rannacherturekbasis.hh:84\n+Dune::Functions::RannacherTurekPreBasis::maxNodeSize\n+size_type maxNodeSize() const\n+Get the maximal number of DOFs associated to node for any element.\n+Definition: rannacherturekbasis.hh:124\n+Dune::Functions::RannacherTurekPreBasis::gridView_\n+GridView gridView_\n+Definition: rannacherturekbasis.hh:144\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00116.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00116.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: boundarydofs.hh File Reference\n+dune-functions: nodes.hh File Reference\n \n \n \n \n \n \n \n@@ -63,37 +63,60 @@\n \n \n
    \n \n-
    boundarydofs.hh File Reference
    \n+
    nodes.hh File Reference
    \n
    \n
    \n-
    #include <utility>
    \n-#include <dune/functions/functionspacebases/subentitydofs.hh>
    \n+
    #include <cassert>
    \n+#include <memory>
    \n+#include <dune/common/indices.hh>
    \n+#include <dune/typetree/leafnode.hh>
    \n+#include <dune/typetree/powernode.hh>
    \n+#include <dune/typetree/compositenode.hh>
    \n+#include <dune/typetree/traversal.hh>
    \n+#include <dune/typetree/visitor.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+

    \n+Classes

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n \n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n

    \n 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. More...
     
    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)
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,27 +5,47 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-Namespaces | Functions\n-boundarydofs.hh File Reference\n-#include \n-#include \n+Classes | Namespaces | Functions\n+nodes.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n+ Classes\n+class \u00a0Dune::Functions::BasisNodeMixin\n+\u00a0\n+class \u00a0Dune::Functions::LeafBasisNode\n+\u00a0\n+class \u00a0Dune::Functions::PowerBasisNode<_T,_n_>\n+\u00a0\n+class \u00a0Dune::Functions::CompositeBasisNode<_T_>\n+\u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n Functions\n-template >()\n-(0, std::declval< typename Basis::LocalView >(), std::declval< typename\n-Basis::GridView::Intersection >()), 0) = 0>\n-void\u00a0Dune::Functions::forEachBoundaryDOF (const Basis &basis, F &&f)\n-\u00a0 Loop over all DOFs on the boundary. More...\n+template\n+void\u00a0Dune::Functions::clearSize (Tree &tree, std::size_t offset)\n+\u00a0\n+template\n+void\u00a0Dune::Functions::bindTree (Tree &tree, const Entity &entity, std::size_t\n+ offset=0)\n+\u00a0\n+template\n+void\u00a0Dune::Functions::initializeTree (Tree &tree, std::size_t\n+ treeIndexOffset=0)\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00116_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00116_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: boundarydofs.hh Source File\n+dune-functions: nodes.hh Source File\n \n \n \n \n \n \n \n@@ -62,99 +62,314 @@\n \n \n
    \n
    \n-
    boundarydofs.hh
    \n+
    nodes.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH
    \n
    5
    \n-
    6#include <utility>
    \n-
    7
    \n-\n-
    9
    \n-
    10namespace Dune {
    \n-
    11namespace Functions {
    \n-
    12
    \n-
    13
    \n-
    14
    \n-
    34template<class Basis, class F,
    \n-
    35 decltype(std::declval<std::decay_t<F>>()(0, std::declval<typename Basis::LocalView>(),std::declval<typename Basis::GridView::Intersection>()), 0) = 0>
    \n-
    36void forEachBoundaryDOF(const Basis& basis, F&& f)
    \n-
    37{
    \n-
    38 auto localView = basis.localView();
    \n-
    39 auto seDOFs = subEntityDOFs(basis);
    \n-
    40 const auto& gridView = basis.gridView();
    \n-
    41 for(auto&& element : elements(gridView))
    \n-
    42 if (element.hasBoundaryIntersections())
    \n-
    43 {
    \n-
    44 localView.bind(element);
    \n-
    45 for(const auto& intersection: intersections(gridView, element))
    \n-
    46 if (intersection.boundary())
    \n-
    47 for(auto localIndex: seDOFs.bind(localView,intersection))
    \n-
    48 f(localIndex, localView, intersection);
    \n-
    49 }
    \n-
    50}
    \n-
    51
    \n-
    52
    \n-
    53
    \n-
    71template<class Basis, class F,
    \n-
    72 decltype(std::declval<std::decay_t<F>>()(0, std::declval<typename Basis::LocalView>()),0) = 0>
    \n-
    73void forEachBoundaryDOF(const Basis& basis, F&& f)
    \n-
    74{
    \n-
    75 auto localView = basis.localView();
    \n-
    76 auto seDOFs = subEntityDOFs(basis);
    \n-
    77 const auto& gridView = basis.gridView();
    \n-
    78 for(auto&& element : elements(gridView))
    \n-
    79 if (element.hasBoundaryIntersections())
    \n-
    80 {
    \n-
    81 localView.bind(element);
    \n-
    82 for(const auto& intersection: intersections(gridView, element))
    \n-
    83 if (intersection.boundary())
    \n-
    84 for(auto localIndex: seDOFs.bind(localView,intersection))
    \n-
    85 f(localIndex, localView);
    \n-
    86 }
    \n-
    87}
    \n-
    88
    \n-
    89
    \n-
    90
    \n-
    107template<class Basis, class F,
    \n-
    108 decltype(std::declval<std::decay_t<F>>()(std::declval<typename Basis::MultiIndex>()),0) = 0>
    \n-
    109void forEachBoundaryDOF(const Basis& basis, F&& f)
    \n-
    110{
    \n-
    111 auto localView = basis.localView();
    \n-
    112 auto seDOFs = subEntityDOFs(basis);
    \n-
    113 const auto& gridView = basis.gridView();
    \n-
    114 for(auto&& element : elements(gridView))
    \n-
    115 if (element.hasBoundaryIntersections())
    \n-
    116 {
    \n-
    117 localView.bind(element);
    \n-
    118 for(const auto& intersection: intersections(gridView, element))
    \n-
    119 if (intersection.boundary())
    \n-
    120 for(auto localIndex: seDOFs.bind(localView,intersection))
    \n-
    121 f(localView.index(localIndex));
    \n-
    122 }
    \n-
    123}
    \n-
    124
    \n+
    6#include <cassert>
    \n+
    7#include <memory>
    \n+
    8
    \n+
    9#include <dune/common/indices.hh>
    \n+
    10
    \n+
    11#include <dune/typetree/leafnode.hh>
    \n+
    12#include <dune/typetree/powernode.hh>
    \n+
    13#include <dune/typetree/compositenode.hh>
    \n+
    14#include <dune/typetree/traversal.hh>
    \n+
    15#include <dune/typetree/visitor.hh>
    \n+
    16
    \n+
    17namespace Dune {
    \n+
    18 namespace Functions {
    \n+
    19
    \n+
    20
    \n+
    21 namespace Impl {
    \n+
    22
    \n+
    23
    \n+
    24 struct ClearSizeVisitor
    \n+
    25 : public TypeTree::TreeVisitor
    \n+
    26 , public TypeTree::DynamicTraversal
    \n+
    27 {
    \n+
    28
    \n+
    29 template<typename Node, typename TreePath>
    \n+
    30 void pre(Node& node, TreePath treePath)
    \n+
    31 {
    \n+
    32 leaf(node,treePath);
    \n+
    33 node.setSize(0);
    \n+
    34 }
    \n+
    35
    \n+
    36 template<typename Node, typename TreePath>
    \n+
    37 void leaf(Node& node, TreePath treePath)
    \n+
    38 {
    \n+
    39 node.setOffset(offset_);
    \n+
    40 }
    \n+
    41
    \n+
    42 ClearSizeVisitor(std::size_t offset)
    \n+
    43 : offset_(offset)
    \n+
    44 {}
    \n+
    45
    \n+
    46 const std::size_t offset_;
    \n+
    47
    \n+
    48 };
    \n+
    49
    \n+
    50
    \n+
    51 template<typename Entity>
    \n+
    52 struct BindVisitor
    \n+
    53 : public TypeTree::TreeVisitor
    \n+
    54 , public TypeTree::DynamicTraversal
    \n+
    55 {
    \n+
    56
    \n+
    57 template<typename Node, typename TreePath>
    \n+
    58 void pre(Node& node, TreePath)
    \n+
    59 {
    \n+
    60 node.setOffset(offset_);
    \n+
    61 }
    \n+
    62
    \n+
    63 template<typename Node, typename TreePath>
    \n+
    64 void post(Node& node, TreePath)
    \n+
    65 {
    \n+
    66 node.setSize(offset_ - node.offset());
    \n+
    67 }
    \n+
    68
    \n+
    69 template<typename Node, typename TreePath>
    \n+
    70 void leaf(Node& node, TreePath)
    \n+
    71 {
    \n+
    72 node.setOffset(offset_);
    \n+
    73 node.bind(entity_);
    \n+
    74 offset_ += node.size();
    \n+
    75 }
    \n+
    76
    \n+
    77 BindVisitor(const Entity& entity, std::size_t offset = 0)
    \n+
    78 : entity_(entity)
    \n+
    79 , offset_(offset)
    \n+
    80 {}
    \n+
    81
    \n+
    82 const Entity& entity_;
    \n+
    83 std::size_t offset_;
    \n+
    84
    \n+
    85 };
    \n+
    86
    \n+
    87
    \n+
    88 struct InitializeTreeVisitor :
    \n+
    89 public TypeTree::TreeVisitor,
    \n+
    90 public TypeTree::DynamicTraversal
    \n+
    91 {
    \n+
    92 template<typename Node, typename TreePath>
    \n+
    93 void pre(Node& node, TreePath)
    \n+
    94 {
    \n+
    95 node.setTreeIndex(treeIndex_);
    \n+
    96 ++treeIndex_;
    \n+
    97 }
    \n+
    98
    \n+
    99 template<typename Node, typename TreePath>
    \n+
    100 void leaf(Node& node, TreePath)
    \n+
    101 {
    \n+
    102 node.setTreeIndex(treeIndex_);
    \n+
    103 ++treeIndex_;
    \n+
    104 }
    \n+
    105
    \n+
    106 InitializeTreeVisitor(std::size_t treeIndexOffset = 0) :
    \n+
    107 treeIndex_(treeIndexOffset)
    \n+
    108 {}
    \n+
    109
    \n+
    110 std::size_t treeIndex_;
    \n+
    111 };
    \n+
    112
    \n+
    113 } // end namespace Impl
    \n+
    114
    \n+
    115
    \n+\n+
    117 {
    \n+
    118
    \n+
    119 friend struct Impl::ClearSizeVisitor;
    \n+
    120
    \n+
    121 template<typename>
    \n+
    122 friend struct Impl::BindVisitor;
    \n+
    123
    \n+
    124 friend struct Impl::InitializeTreeVisitor;
    \n
    125
    \n-
    126
    \n-
    127} // namespace Functions
    \n-
    128} // namespace Dune
    \n+
    126 public:
    \n+
    127
    \n+
    128 using size_type = std::size_t;
    \n
    129
    \n-
    130#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH
    \n-\n-
    auto subEntityDOFs(const T &)
    Create SubEntityDOFs object.
    Definition: subentitydofs.hh:160
    \n-
    void forEachBoundaryDOF(const Basis &basis, F &&f)
    Loop over all DOFs on the boundary.
    Definition: boundarydofs.hh:36
    \n+\n+
    131 offset_(0),
    \n+
    132 size_(0),
    \n+
    133 treeIndex_(0)
    \n+
    134 {}
    \n+
    135
    \n+\n+
    137 {
    \n+
    138 assert(i < size_);
    \n+
    139 return offset_ + i;
    \n+
    140 }
    \n+
    141
    \n+\n+
    143 {
    \n+
    144 return size_;
    \n+
    145 }
    \n+
    146
    \n+\n+
    148 {
    \n+
    149 return treeIndex_;
    \n+
    150 }
    \n+
    151
    \n+
    152 protected:
    \n+
    153
    \n+\n+
    155 {
    \n+
    156 return offset_;
    \n+
    157 }
    \n+
    158
    \n+\n+
    160 {
    \n+
    161 offset_ = offset;
    \n+
    162 }
    \n+
    163
    \n+\n+
    165 {
    \n+
    166 size_ = size;
    \n+
    167 }
    \n+
    168
    \n+\n+
    170 {
    \n+
    171 treeIndex_ = treeIndex;
    \n+
    172 }
    \n+
    173
    \n+
    174 private:
    \n+
    175
    \n+
    176 size_type offset_;
    \n+
    177 size_type size_;
    \n+
    178 size_type treeIndex_;
    \n+
    179
    \n+
    180 };
    \n+
    181
    \n+
    182
    \n+\n+
    184 public BasisNodeMixin,
    \n+
    185 public TypeTree::LeafNode
    \n+
    186 {};
    \n+
    187
    \n+
    188
    \n+
    189 template<typename T, std::size_t n>
    \n+\n+
    191 public BasisNodeMixin,
    \n+
    192 public TypeTree::PowerNode<T,n>
    \n+
    193 {
    \n+
    194
    \n+
    195 using Node = TypeTree::PowerNode<T,n>;
    \n+
    196
    \n+
    197 public:
    \n+
    198
    \n+
    199 using Element = typename T::Element;
    \n+
    200
    \n+
    201 PowerBasisNode() = default;
    \n+
    202
    \n+
    203 PowerBasisNode(const typename Node::NodeStorage& children) :
    \n+
    204 Node(children)
    \n+
    205 {}
    \n+
    206
    \n+
    207 const Element& element() const
    \n+
    208 {
    \n+
    209 return this->child(Dune::Indices::_0).element();
    \n+
    210 }
    \n+
    211
    \n+
    212 };
    \n+
    213
    \n+
    214
    \n+
    215 template<typename... T>
    \n+\n+
    217 public BasisNodeMixin,
    \n+
    218 public TypeTree::CompositeNode<T...>
    \n+
    219 {
    \n+
    220
    \n+
    221 using Node = TypeTree::CompositeNode<T...>;
    \n+
    222
    \n+
    223 public:
    \n+
    224
    \n+
    225 using Element = typename Node::template Child<0>::Type::Element;
    \n+
    226
    \n+\n+
    228
    \n+
    229 CompositeBasisNode(const typename Node::NodeStorage& children) :
    \n+
    230 Node(children)
    \n+
    231 {}
    \n+
    232
    \n+
    233 template<typename... Children>
    \n+
    234 CompositeBasisNode(const std::shared_ptr<Children>&... children) :
    \n+
    235 Node(children...)
    \n+
    236 {}
    \n+
    237
    \n+
    238 const Element& element() const
    \n+
    239 {
    \n+
    240 return this->child(Dune::Indices::_0).element();
    \n+
    241 }
    \n+
    242
    \n+
    243 };
    \n+
    244
    \n+
    245
    \n+
    246 template<typename Tree>
    \n+
    247 void clearSize(Tree& tree, std::size_t offset)
    \n+
    248 {
    \n+
    249 TypeTree::applyToTree(tree,Impl::ClearSizeVisitor(offset));
    \n+
    250 }
    \n+
    251
    \n+
    252 template<typename Tree, typename Entity>
    \n+
    253 void bindTree(Tree& tree, const Entity& entity, std::size_t offset = 0)
    \n+
    254 {
    \n+
    255 Impl::BindVisitor<Entity> visitor(entity,offset);
    \n+
    256 TypeTree::applyToTree(tree,visitor);
    \n+
    257 }
    \n+
    258
    \n+
    259 template<typename Tree>
    \n+
    260 void initializeTree(Tree& tree, std::size_t treeIndexOffset = 0)
    \n+
    261 {
    \n+
    262 Impl::InitializeTreeVisitor visitor(treeIndexOffset);
    \n+
    263 TypeTree::applyToTree(tree,visitor);
    \n+
    264 }
    \n+
    265
    \n+
    266
    \n+
    267 } // namespace Functions
    \n+
    268
    \n+
    269} // namespace Dune
    \n+
    270
    \n+
    271#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH
    \n
    Definition: polynomial.hh:10
    \n+
    void clearSize(Tree &tree, std::size_t offset)
    Definition: nodes.hh:247
    \n+
    void bindTree(Tree &tree, const Entity &entity, std::size_t offset=0)
    Definition: nodes.hh:253
    \n+
    void initializeTree(Tree &tree, std::size_t treeIndexOffset=0)
    Definition: nodes.hh:260
    \n+
    Definition: nodes.hh:117
    \n+
    size_type treeIndex() const
    Definition: nodes.hh:147
    \n+
    size_type localIndex(size_type i) const
    Definition: nodes.hh:136
    \n+
    size_type offset() const
    Definition: nodes.hh:154
    \n+
    size_type size() const
    Definition: nodes.hh:142
    \n+
    void setOffset(const size_type offset)
    Definition: nodes.hh:159
    \n+
    std::size_t size_type
    Definition: nodes.hh:128
    \n+
    BasisNodeMixin()
    Definition: nodes.hh:130
    \n+
    void setSize(const size_type size)
    Definition: nodes.hh:164
    \n+
    void setTreeIndex(size_type treeIndex)
    Definition: nodes.hh:169
    \n+
    Definition: nodes.hh:186
    \n+
    Definition: nodes.hh:193
    \n+
    const Element & element() const
    Definition: nodes.hh:207
    \n+
    typename T::Element Element
    Definition: nodes.hh:199
    \n+
    PowerBasisNode(const typename Node::NodeStorage &children)
    Definition: nodes.hh:203
    \n+\n+
    Definition: nodes.hh:219
    \n+\n+
    CompositeBasisNode(const typename Node::NodeStorage &children)
    Definition: nodes.hh:229
    \n+
    const Element & element() const
    Definition: nodes.hh:238
    \n+
    typename Node::template Child< 0 >::Type::Element Element
    Definition: nodes.hh:225
    \n+
    CompositeBasisNode(const std::shared_ptr< Children > &... children)
    Definition: nodes.hh:234
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,104 +5,354 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-boundarydofs.hh\n+nodes.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH\n 5\n- 6#include \n- 7\n- 8#include \n- 9\n- 10namespace Dune {\n- 11namespace Functions {\n- 12\n- 13\n- 14\n- 34template>()(0, std::declval(),std::declval()), 0) = 0>\n-36void forEachBoundaryDOF(const Basis& basis, F&& f)\n- 37{\n- 38 auto localView = basis.localView();\n- 39 auto seDOFs = subEntityDOFs(basis);\n- 40 const auto& gridView = basis.gridView();\n- 41 for(auto&& element : elements(gridView))\n- 42 if (element.hasBoundaryIntersections())\n- 43 {\n- 44 localView.bind(element);\n- 45 for(const auto& intersection: intersections(gridView, element))\n- 46 if (intersection.boundary())\n- 47 for(auto localIndex: seDOFs.bind(localView,intersection))\n- 48 f(localIndex, localView, intersection);\n- 49 }\n- 50}\n- 51\n- 52\n- 53\n- 71template>()(0, std::declval()),0) = 0>\n- 73void forEachBoundaryDOF(const Basis& basis, F&& f)\n- 74{\n- 75 auto localView = basis.localView();\n- 76 auto seDOFs = subEntityDOFs(basis);\n- 77 const auto& gridView = basis.gridView();\n- 78 for(auto&& element : elements(gridView))\n- 79 if (element.hasBoundaryIntersections())\n- 80 {\n- 81 localView.bind(element);\n- 82 for(const auto& intersection: intersections(gridView, element))\n- 83 if (intersection.boundary())\n- 84 for(auto localIndex: seDOFs.bind(localView,intersection))\n- 85 f(localIndex, localView);\n- 86 }\n- 87}\n- 88\n- 89\n- 90\n- 107template>()(std::declval()),0) = 0>\n- 109void forEachBoundaryDOF(const Basis& basis, F&& f)\n- 110{\n- 111 auto localView = basis.localView();\n- 112 auto seDOFs = subEntityDOFs(basis);\n- 113 const auto& gridView = basis.gridView();\n- 114 for(auto&& element : elements(gridView))\n- 115 if (element.hasBoundaryIntersections())\n- 116 {\n- 117 localView.bind(element);\n- 118 for(const auto& intersection: intersections(gridView, element))\n- 119 if (intersection.boundary())\n- 120 for(auto localIndex: seDOFs.bind(localView,intersection))\n- 121 f(localView.index(localIndex));\n- 122 }\n- 123}\n- 124\n+ 6#include \n+ 7#include \n+ 8\n+ 9#include \n+ 10\n+ 11#include \n+ 12#include \n+ 13#include \n+ 14#include \n+ 15#include \n+ 16\n+ 17namespace Dune {\n+ 18 namespace Functions {\n+ 19\n+ 20\n+ 21 namespace Impl {\n+ 22\n+ 23\n+ 24 struct ClearSizeVisitor\n+ 25 : public TypeTree::TreeVisitor\n+ 26 , public TypeTree::DynamicTraversal\n+ 27 {\n+ 28\n+ 29 template\n+ 30 void pre(Node& node, TreePath treePath)\n+ 31 {\n+ 32 leaf(node,treePath);\n+ 33 node.setSize(0);\n+ 34 }\n+ 35\n+ 36 template\n+ 37 void leaf(Node& node, TreePath treePath)\n+ 38 {\n+ 39 node.setOffset(offset_);\n+ 40 }\n+ 41\n+ 42 ClearSizeVisitor(std::size_t offset)\n+ 43 : offset_(offset)\n+ 44 {}\n+ 45\n+ 46 const std::size_t offset_;\n+ 47\n+ 48 };\n+ 49\n+ 50\n+ 51 template\n+ 52 struct BindVisitor\n+ 53 : public TypeTree::TreeVisitor\n+ 54 , public TypeTree::DynamicTraversal\n+ 55 {\n+ 56\n+ 57 template\n+ 58 void pre(Node& node, TreePath)\n+ 59 {\n+ 60 node.setOffset(offset_);\n+ 61 }\n+ 62\n+ 63 template\n+ 64 void post(Node& node, TreePath)\n+ 65 {\n+ 66 node.setSize(offset_ - node.offset());\n+ 67 }\n+ 68\n+ 69 template\n+ 70 void leaf(Node& node, TreePath)\n+ 71 {\n+ 72 node.setOffset(offset_);\n+ 73 node.bind(entity_);\n+ 74 offset_ += node.size();\n+ 75 }\n+ 76\n+ 77 BindVisitor(const Entity& entity, std::size_t offset = 0)\n+ 78 : entity_(entity)\n+ 79 , offset_(offset)\n+ 80 {}\n+ 81\n+ 82 const Entity& entity_;\n+ 83 std::size_t offset_;\n+ 84\n+ 85 };\n+ 86\n+ 87\n+ 88 struct InitializeTreeVisitor :\n+ 89 public TypeTree::TreeVisitor,\n+ 90 public TypeTree::DynamicTraversal\n+ 91 {\n+ 92 template\n+ 93 void pre(Node& node, TreePath)\n+ 94 {\n+ 95 node.setTreeIndex(treeIndex_);\n+ 96 ++treeIndex_;\n+ 97 }\n+ 98\n+ 99 template\n+ 100 void leaf(Node& node, TreePath)\n+ 101 {\n+ 102 node.setTreeIndex(treeIndex_);\n+ 103 ++treeIndex_;\n+ 104 }\n+ 105\n+ 106 InitializeTreeVisitor(std::size_t treeIndexOffset = 0) :\n+ 107 treeIndex_(treeIndexOffset)\n+ 108 {}\n+ 109\n+ 110 std::size_t treeIndex_;\n+ 111 };\n+ 112\n+ 113 } // end namespace Impl\n+ 114\n+ 115\n+116 class BasisNodeMixin\n+ 117 {\n+ 118\n+ 119 friend struct Impl::ClearSizeVisitor;\n+ 120\n+ 121 template\n+ 122 friend struct Impl::BindVisitor;\n+ 123\n+ 124 friend struct Impl::InitializeTreeVisitor;\n 125\n- 126\n- 127} // namespace Functions\n- 128} // namespace Dune\n+ 126 public:\n+ 127\n+128 using size_type = std::size_t;\n 129\n- 130#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BOUNDARYDOFS_HH\n-subentitydofs.hh\n-Dune::Functions::subEntityDOFs\n-auto subEntityDOFs(const T &)\n-Create SubEntityDOFs object.\n-Definition: subentitydofs.hh:160\n-Dune::Functions::forEachBoundaryDOF\n-void forEachBoundaryDOF(const Basis &basis, F &&f)\n-Loop over all DOFs on the boundary.\n-Definition: boundarydofs.hh:36\n+130 BasisNodeMixin() :\n+ 131 offset_(0),\n+ 132 size_(0),\n+ 133 treeIndex_(0)\n+ 134 {}\n+ 135\n+136 size_type localIndex(size_type i) const\n+ 137 {\n+ 138 assert(i < size_);\n+ 139 return offset_ + i;\n+ 140 }\n+ 141\n+142 size_type size() const\n+ 143 {\n+ 144 return size_;\n+ 145 }\n+ 146\n+147 size_type treeIndex() const\n+ 148 {\n+ 149 return treeIndex_;\n+ 150 }\n+ 151\n+ 152 protected:\n+ 153\n+154 size_type offset() const\n+ 155 {\n+ 156 return offset_;\n+ 157 }\n+ 158\n+159 void setOffset(const size_type offset)\n+ 160 {\n+ 161 offset_ = offset;\n+ 162 }\n+ 163\n+164 void setSize(const size_type size)\n+ 165 {\n+ 166 size_ = size;\n+ 167 }\n+ 168\n+169 void setTreeIndex(size_type treeIndex)\n+ 170 {\n+ 171 treeIndex_ = treeIndex;\n+ 172 }\n+ 173\n+ 174 private:\n+ 175\n+ 176 size_type offset_;\n+ 177 size_type size_;\n+ 178 size_type treeIndex_;\n+ 179\n+ 180 };\n+ 181\n+ 182\n+183 class LeafBasisNode :\n+ 184 public BasisNodeMixin,\n+ 185 public TypeTree::LeafNode\n+ 186 {};\n+ 187\n+ 188\n+ 189 template\n+190 class PowerBasisNode :\n+ 191 public BasisNodeMixin,\n+ 192 public TypeTree::PowerNode\n+ 193 {\n+ 194\n+ 195 using Node = TypeTree::PowerNode;\n+ 196\n+ 197 public:\n+ 198\n+199 using Element = typename T::Element;\n+ 200\n+201 PowerBasisNode() = default;\n+ 202\n+203 PowerBasisNode(const typename Node::NodeStorage& children) :\n+ 204 Node(children)\n+ 205 {}\n+ 206\n+207 const Element& element() const\n+ 208 {\n+ 209 return this->child(Dune::Indices::_0).element();\n+ 210 }\n+ 211\n+ 212 };\n+ 213\n+ 214\n+ 215 template\n+216 class CompositeBasisNode :\n+ 217 public BasisNodeMixin,\n+ 218 public TypeTree::CompositeNode\n+ 219 {\n+ 220\n+ 221 using Node = TypeTree::CompositeNode;\n+ 222\n+ 223 public:\n+ 224\n+225 using Element = typename Node::template Child<0>::Type::Element;\n+ 226\n+227 CompositeBasisNode() = default;\n+ 228\n+229 CompositeBasisNode(const typename Node::NodeStorage& children) :\n+ 230 Node(children)\n+ 231 {}\n+ 232\n+ 233 template\n+234 CompositeBasisNode(const std::shared_ptr&... children) :\n+ 235 Node(children...)\n+ 236 {}\n+ 237\n+238 const Element& element() const\n+ 239 {\n+ 240 return this->child(Dune::Indices::_0).element();\n+ 241 }\n+ 242\n+ 243 };\n+ 244\n+ 245\n+ 246 template\n+247 void clearSize(Tree& tree, std::size_t offset)\n+ 248 {\n+ 249 TypeTree::applyToTree(tree,Impl::ClearSizeVisitor(offset));\n+ 250 }\n+ 251\n+ 252 template\n+253 void bindTree(Tree& tree, const Entity& entity, std::size_t offset = 0)\n+ 254 {\n+ 255 Impl::BindVisitor visitor(entity,offset);\n+ 256 TypeTree::applyToTree(tree,visitor);\n+ 257 }\n+ 258\n+ 259 template\n+260 void initializeTree(Tree& tree, std::size_t treeIndexOffset = 0)\n+ 261 {\n+ 262 Impl::InitializeTreeVisitor visitor(treeIndexOffset);\n+ 263 TypeTree::applyToTree(tree,visitor);\n+ 264 }\n+ 265\n+ 266\n+ 267 } // namespace Functions\n+ 268\n+ 269} // namespace Dune\n+ 270\n+ 271#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NODES_HH\n Dune\n Definition: polynomial.hh:10\n+Dune::Functions::clearSize\n+void clearSize(Tree &tree, std::size_t offset)\n+Definition: nodes.hh:247\n+Dune::Functions::bindTree\n+void bindTree(Tree &tree, const Entity &entity, std::size_t offset=0)\n+Definition: nodes.hh:253\n+Dune::Functions::initializeTree\n+void initializeTree(Tree &tree, std::size_t treeIndexOffset=0)\n+Definition: nodes.hh:260\n+Dune::Functions::BasisNodeMixin\n+Definition: nodes.hh:117\n+Dune::Functions::BasisNodeMixin::treeIndex\n+size_type treeIndex() const\n+Definition: nodes.hh:147\n+Dune::Functions::BasisNodeMixin::localIndex\n+size_type localIndex(size_type i) const\n+Definition: nodes.hh:136\n+Dune::Functions::BasisNodeMixin::offset\n+size_type offset() const\n+Definition: nodes.hh:154\n+Dune::Functions::BasisNodeMixin::size\n+size_type size() const\n+Definition: nodes.hh:142\n+Dune::Functions::BasisNodeMixin::setOffset\n+void setOffset(const size_type offset)\n+Definition: nodes.hh:159\n+Dune::Functions::BasisNodeMixin::size_type\n+std::size_t size_type\n+Definition: nodes.hh:128\n+Dune::Functions::BasisNodeMixin::BasisNodeMixin\n+BasisNodeMixin()\n+Definition: nodes.hh:130\n+Dune::Functions::BasisNodeMixin::setSize\n+void setSize(const size_type size)\n+Definition: nodes.hh:164\n+Dune::Functions::BasisNodeMixin::setTreeIndex\n+void setTreeIndex(size_type treeIndex)\n+Definition: nodes.hh:169\n+Dune::Functions::LeafBasisNode\n+Definition: nodes.hh:186\n+Dune::Functions::PowerBasisNode\n+Definition: nodes.hh:193\n+Dune::Functions::PowerBasisNode::element\n+const Element & element() const\n+Definition: nodes.hh:207\n+Dune::Functions::PowerBasisNode::Element\n+typename T::Element Element\n+Definition: nodes.hh:199\n+Dune::Functions::PowerBasisNode::PowerBasisNode\n+PowerBasisNode(const typename Node::NodeStorage &children)\n+Definition: nodes.hh:203\n+Dune::Functions::PowerBasisNode::PowerBasisNode\n+PowerBasisNode()=default\n+Dune::Functions::CompositeBasisNode\n+Definition: nodes.hh:219\n+Dune::Functions::CompositeBasisNode::CompositeBasisNode\n+CompositeBasisNode()=default\n+Dune::Functions::CompositeBasisNode::CompositeBasisNode\n+CompositeBasisNode(const typename Node::NodeStorage &children)\n+Definition: nodes.hh:229\n+Dune::Functions::CompositeBasisNode::element\n+const Element & element() const\n+Definition: nodes.hh:238\n+Dune::Functions::CompositeBasisNode::Element\n+typename Node::template Child< 0 >::Type::Element Element\n+Definition: nodes.hh:225\n+Dune::Functions::CompositeBasisNode::CompositeBasisNode\n+CompositeBasisNode(const std::shared_ptr< Children > &... children)\n+Definition: nodes.hh:234\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00119.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00119.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: hierarchicallagrangebasis.hh File Reference\n+dune-functions: lagrangebasis.hh File Reference\n \n \n \n \n \n \n \n@@ -67,55 +67,61 @@\n \n
    \n \n-
    hierarchicallagrangebasis.hh File Reference
    \n+
    lagrangebasis.hh File Reference
    \n
    \n
    \n-
    #include <dune/common/exceptions.hh>
    \n-#include <dune/localfunctions/hierarchical/hierarchicalp2.hh>
    \n-#include <dune/functions/functionspacebases/nodes.hh>
    \n-#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
    \n-#include <dune/grid/common/mcmgmapper.hh>
    \n+
    #include <type_traits>
    \n+#include <dune/common/exceptions.hh>
    \n+#include <dune/localfunctions/lagrange.hh>
    \n+#include <dune/localfunctions/lagrange/equidistantpoints.hh>
    \n+#include <dune/localfunctions/lagrange/pqkfactory.hh>
    \n+#include <dune/functions/functionspacebases/nodes.hh>
    \n+#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n+\n+\n \n-\n+\n \n

    \n Classes

    class  Dune::Functions::HierarchicalLagrangePreBasis< GV, k, R >
     A pre-basis for a hierarchical basis. More...
    class  Dune::Functions::LagrangePreBasis< GV, k, R >
     A pre-basis for a PQ-lagrange bases with given order. More...
     
    class  Dune::Functions::HierarchicalLagrangeNode< GV, k, R >
    class  Dune::Functions::LagrangeNode< GV, k, R >
     
    \n \n \n \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    namespace  Dune::Functions::BasisFactory
     
    \n \n-\n-\n-\n-\n+\n+\n+\n+\n

    \n 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. More...
     
    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. More...
     
    \n \n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n

    \n 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. More...
     
    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. More...
     
    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. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,42 +6,49 @@\n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n Classes | Namespaces | Typedefs | Functions\n-hierarchicallagrangebasis.hh File Reference\n+lagrangebasis.hh File Reference\n+#include \n #include \n-#include \n+#include \n+#include \n+#include \n #include \n #include \n-#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::HierarchicalLagrangePreBasis<_GV,_k,_R_>\n-\u00a0 A pre-basis for a hierarchical basis. More...\n+class \u00a0Dune::Functions::LagrangePreBasis<_GV,_k,_R_>\n+\u00a0 A pre-basis for a PQ-lagrange bases with given order. More...\n \u00a0\n-class \u00a0Dune::Functions::HierarchicalLagrangeNode<_GV,_k,_R_>\n+class \u00a0Dune::Functions::LagrangeNode<_GV,_k,_R_>\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n namespace \u00a0Dune::Functions::BasisFactory\n \u00a0\n Typedefs\n-template\n-using\u00a0Dune::Functions::HierarchicalLagrangeBasis = DefaultGlobalBasis<\n- HierarchicalLagrangePreBasis< GV, k, R > >\n-\u00a0 Basis of a scalar Hierarchical Lagrange finite element space. More...\n+template\n+using\u00a0Dune::Functions::LagrangeBasis = DefaultGlobalBasis< LagrangePreBasis<\n+ GV, k, R > >\n+\u00a0 Nodal basis of a scalar k-th-order Lagrangean finite element space.\n+ More...\n \u00a0\n Functions\n template\n-auto\u00a0Dune::Functions::BasisFactory::hierarchicalLagrange ()\n-\u00a0 Create a pre-basis factory that can create a HierarchicalLagrange pre-\n- basis. More...\n+auto\u00a0Dune::Functions::BasisFactory::lagrange ()\n+\u00a0 Create a pre-basis factory that can create a Lagrange pre-basis. More...\n+\u00a0\n+template\n+auto\u00a0Dune::Functions::BasisFactory::lagrange (int order)\n+\u00a0 Create a pre-basis factory that can create a Lagrange pre-basis with a\n+ run-time order. More...\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00119_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00119_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: hierarchicallagrangebasis.hh Source File\n+dune-functions: lagrangebasis.hh Source File\n \n \n \n \n \n \n \n@@ -62,263 +62,546 @@\n \n \n
    \n
    \n-
    hierarchicallagrangebasis.hh
    \n+
    lagrangebasis.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH
    \n
    5
    \n-
    6#include <dune/common/exceptions.hh>
    \n-
    7#include <dune/localfunctions/hierarchical/hierarchicalp2.hh>
    \n+
    6#include <type_traits>
    \n+
    7#include <dune/common/exceptions.hh>
    \n
    8
    \n-\n-\n-
    11#include <dune/grid/common/mcmgmapper.hh>
    \n+
    9#include <dune/localfunctions/lagrange.hh>
    \n+
    10#include <dune/localfunctions/lagrange/equidistantpoints.hh>
    \n+
    11#include <dune/localfunctions/lagrange/pqkfactory.hh>
    \n
    12
    \n-
    13namespace Dune {
    \n-
    14 namespace Functions {
    \n+\n+\n
    15
    \n-
    16 // *****************************************************************************
    \n-
    17 // Implementation for Hierarchical Lagrange Basis
    \n-
    18 //
    \n-
    19 // -- only order k=2 is implemented up to now --
    \n-
    20 // -- currently only supports simplex grids --
    \n-
    21 //
    \n-
    22 // This is the reusable part of the HierarchicalLagrangeBasis. It contains
    \n-
    23 //
    \n-
    24 // HierarchicalLagrangePreBasis
    \n-
    25 // HierarchicalLagrangeNode
    \n-
    26 //
    \n-
    27 // The pre-basis allows to create the others and is the owner of possible shared
    \n-
    28 // state. These components do _not_ depend on the global basis and can be
    \n-
    29 // used without a global basis.
    \n-
    30 // *****************************************************************************
    \n-
    31
    \n-
    32 template<typename GV, int k, typename R=double>
    \n-
    33 class HierarchicalLagrangeNode;
    \n-
    34
    \n-
    35 template<typename GV, int k, typename R=double>
    \n-
    36 class HierarchicalLagrangePreBasis;
    \n+
    16
    \n+
    17namespace Dune {
    \n+
    18namespace Functions {
    \n+
    19
    \n+
    20// *****************************************************************************
    \n+
    21// This is the reusable part of the LagrangeBasis. It contains
    \n+
    22//
    \n+
    23// LagrangePreBasis
    \n+
    24// LagrangeNode
    \n+
    25//
    \n+
    26// The pre-basis allows to create the others and is the owner of possible shared
    \n+
    27// state. These components do _not_ depend on the global basis and local view
    \n+
    28// and can be used without a global basis.
    \n+
    29// *****************************************************************************
    \n+
    30
    \n+
    31template<typename GV, int k, typename R=double>
    \n+
    32class LagrangeNode;
    \n+
    33
    \n+
    34template<typename GV, int k, typename R=double>
    \n+
    35class LagrangePreBasis;
    \n+
    36
    \n
    37
    \n-
    47 template<typename GV, int k, typename R>
    \n-\n-
    49 {
    \n-
    50 static const int dim = GV::dimension;
    \n-
    51
    \n-
    52 public:
    \n-
    53
    \n-
    55 using GridView = GV;
    \n-
    56
    \n-
    58 using size_type = std::size_t;
    \n-
    59
    \n-\n-
    62
    \n-
    63 static constexpr size_type maxMultiIndexSize = 1;
    \n-
    64 static constexpr size_type minMultiIndexSize = 1;
    \n-
    65 static constexpr size_type multiIndexBufferSize = 1;
    \n+
    38
    \n+
    53template<typename GV, int k, typename R>
    \n+\n+
    55{
    \n+
    56 static const int dim = GV::dimension;
    \n+
    57 static const bool useDynamicOrder = (k<0);
    \n+
    58
    \n+
    59public:
    \n+
    60
    \n+
    62 using GridView = GV;
    \n+
    63
    \n+
    65 using size_type = std::size_t;
    \n
    66
    \n-\n-
    72 {}
    \n+\n+
    69
    \n+
    70 static constexpr size_type maxMultiIndexSize = 1;
    \n+
    71 static constexpr size_type minMultiIndexSize = 1;
    \n+
    72 static constexpr size_type multiIndexBufferSize = 1;
    \n
    73
    \n-\n-
    76 {}
    \n-
    77
    \n-
    79 const GridView& gridView() const
    \n-
    80 {
    \n-
    81 return gridView_;
    \n-
    82 }
    \n-
    83
    \n-
    85 void update (const GridView& gv)
    \n-
    86 {
    \n-
    87 gridView_ = gv;
    \n-
    88 mcmgMapper_.update(gv);
    \n-
    89 }
    \n-
    90
    \n-
    94 Node makeNode() const
    \n-
    95 {
    \n-
    96 return Node{};
    \n-
    97 }
    \n-
    98
    \n-\n-
    101 {
    \n-
    102 return mcmgMapper_.size();
    \n-
    103 }
    \n+\n+
    76 : LagrangePreBasis(gv, std::numeric_limits<unsigned int>::max())
    \n+
    77 {}
    \n+
    78
    \n+
    80 LagrangePreBasis(const GridView& gv, unsigned int order) :
    \n+\n+
    82 {
    \n+
    83 if (!useDynamicOrder && order!=std::numeric_limits<unsigned int>::max())
    \n+
    84 DUNE_THROW(RangeError, "Template argument k has to be -1 when supplying a run-time order!");
    \n+
    85
    \n+
    86 for (int i=0; i<=dim; i++)
    \n+
    87 {
    \n+\n+\n+
    90 }
    \n+\n+\n+
    93 }
    \n+
    94
    \n+\n+
    97 {
    \n+
    98 vertexOffset_ = 0;
    \n+\n+
    100
    \n+
    101 if (dim>=2)
    \n+
    102 {
    \n+\n
    104
    \n-
    106 template<class SizePrefix>
    \n-
    107 size_type size(const SizePrefix prefix) const
    \n-
    108 {
    \n-
    109 assert(prefix.size() == 0 || prefix.size() == 1);
    \n-
    110 return (prefix.size() == 0) ? size() : 0;
    \n-
    111 }
    \n+
    105 quadrilateralOffset_ = triangleOffset_ + dofsPerSimplex(2) * ((size_type)gridView_.size(Dune::GeometryTypes::triangle));
    \n+
    106 }
    \n+
    107
    \n+
    108 if (dim==3) {
    \n+
    109 tetrahedronOffset_ = quadrilateralOffset_ + dofsPerCube(2) * ((size_type)gridView_.size(Dune::GeometryTypes::quadrilateral));
    \n+
    110
    \n+
    111 prismOffset_ = tetrahedronOffset_ + dofsPerSimplex(3) * ((size_type)gridView_.size(Dune::GeometryTypes::tetrahedron));
    \n
    112
    \n-\n-
    115 {
    \n-
    116 return size();
    \n-
    117 }
    \n+
    113 hexahedronOffset_ = prismOffset_ + dofsPerPrism() * ((size_type)gridView_.size(Dune::GeometryTypes::prism));
    \n+
    114
    \n+
    115 pyramidOffset_ = hexahedronOffset_ + dofsPerCube(3) * ((size_type)gridView_.size(Dune::GeometryTypes::hexahedron));
    \n+
    116 }
    \n+
    117 }
    \n
    118
    \n-\n-
    124 {
    \n-
    125 // That cast to unsigned int is necessary because GV::dimension is an enum
    \n-
    126 return Dune::binomial(std::size_t(order() + (unsigned int)GV::dimension),std::size_t(order()));
    \n-
    127 }
    \n-
    128
    \n-
    129 template<typename It>
    \n-
    130 It indices(const Node& node, It it) const
    \n-
    131 {
    \n-
    132 for (size_type i = 0, end = node.finiteElement().size() ; i < end ; ++it, ++i)
    \n-
    133 {
    \n-
    134 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
    \n-
    135 const auto& element = node.element();
    \n-
    136
    \n-
    137 *it = {{ (size_type)(mcmgMapper_.subIndex(element,localKey.subEntity(),localKey.codim())) }};
    \n-
    138 }
    \n-
    139 return it;
    \n-
    140 }
    \n-
    141
    \n-
    142 protected:
    \n-\n-
    144
    \n-
    145 unsigned int order() const
    \n-
    146 {
    \n-
    147 return 2;
    \n-
    148 }
    \n-
    149
    \n-
    150 MultipleCodimMultipleGeomTypeMapper<GridView> mcmgMapper_;
    \n-
    151
    \n-
    152 private:
    \n-
    157 static auto p2Layout()
    \n-
    158 {
    \n-
    159 return [](Dune::GeometryType type, int gridDim)
    \n-
    160 {
    \n-
    161 if (type.isVertex())
    \n-
    162 return 1;
    \n-
    163 if (type.isLine())
    \n-
    164 return 1;
    \n-
    165 if (type.isTriangle())
    \n-
    166 return 0;
    \n-
    167 assert(type.isTetrahedron());
    \n-
    168 return 0;
    \n-
    169 };
    \n-
    170 }
    \n-
    171 };
    \n-
    172
    \n-
    173
    \n-
    174
    \n-
    175 template<typename GV, int k, typename R>
    \n-\n-
    177 public LeafBasisNode
    \n-
    178 {
    \n-
    179 static const int dim = GV::dimension;
    \n-
    180
    \n-
    181 public:
    \n+
    120 const GridView& gridView() const
    \n+
    121 {
    \n+
    122 return gridView_;
    \n+
    123 }
    \n+
    124
    \n+
    126 void update (const GridView& gv)
    \n+
    127 {
    \n+
    128 gridView_ = gv;
    \n+
    129 }
    \n+
    130
    \n+\n+
    135 {
    \n+
    136 return Node{order_};
    \n+
    137 }
    \n+
    138
    \n+\n+
    141 {
    \n+
    142 switch (dim)
    \n+
    143 {
    \n+
    144 case 1:
    \n+
    145 return dofsPerCube(0) * ((size_type)gridView_.size(dim))
    \n+
    146 + dofsPerCube(1) * ((size_type)gridView_.size(dim-1));
    \n+
    147 case 2:
    \n+
    148 {
    \n+
    149 return dofsPerCube(0) * ((size_type)gridView_.size(dim))
    \n+
    150 + dofsPerCube(1) * ((size_type)gridView_.size(dim-1))
    \n+
    151 + dofsPerSimplex(2) * ((size_type)gridView_.size(Dune::GeometryTypes::triangle))
    \n+
    152 + dofsPerCube(2) * ((size_type)gridView_.size(Dune::GeometryTypes::quadrilateral));
    \n+
    153 }
    \n+
    154 case 3:
    \n+
    155 {
    \n+
    156 return dofsPerCube(0) * ((size_type)gridView_.size(dim))
    \n+
    157 + dofsPerCube(1) * ((size_type)gridView_.size(dim-1))
    \n+
    158 + dofsPerSimplex(2) * ((size_type)gridView_.size(Dune::GeometryTypes::triangle))
    \n+
    159 + dofsPerCube(2) * ((size_type)gridView_.size(Dune::GeometryTypes::quadrilateral))
    \n+
    160 + dofsPerSimplex(3) * ((size_type)gridView_.size(Dune::GeometryTypes::tetrahedron))
    \n+
    161 + dofsPerPyramid() * ((size_type)gridView_.size(Dune::GeometryTypes::pyramid))
    \n+
    162 + dofsPerPrism() * ((size_type)gridView_.size(Dune::GeometryTypes::prism))
    \n+
    163 + dofsPerCube(3) * ((size_type)gridView_.size(Dune::GeometryTypes::hexahedron));
    \n+
    164 }
    \n+
    165 }
    \n+
    166 DUNE_THROW(Dune::NotImplemented, "No size method for " << dim << "d grids available yet!");
    \n+
    167 }
    \n+
    168
    \n+
    170 template<class SizePrefix>
    \n+
    171 size_type size(const SizePrefix& prefix) const
    \n+
    172 {
    \n+
    173 assert(prefix.size() == 0 || prefix.size() == 1);
    \n+
    174 return (prefix.size() == 0) ? size() : 0;
    \n+
    175 }
    \n+
    176
    \n+\n+
    179 {
    \n+
    180 return size();
    \n+
    181 }
    \n
    182
    \n-
    183 using size_type = std::size_t;
    \n-
    184 using Element = typename GV::template Codim<0>::Entity;
    \n-
    185 using FiniteElement = HierarchicalP2LocalFiniteElement<typename GV::ctype,R,dim>;
    \n-
    186
    \n-\n-\n-
    189 element_(nullptr)
    \n-
    190 {}
    \n-
    191
    \n-
    193 const Element& element() const
    \n-
    194 {
    \n-
    195 return *element_;
    \n-
    196 }
    \n-
    197
    \n-\n-
    203 {
    \n-
    204 return finiteElement_;
    \n-
    205 }
    \n-
    206
    \n-
    208 void bind(const Element& e)
    \n-
    209 {
    \n-
    210 element_ = &e;
    \n-
    211
    \n-
    212 if (e.type() != finiteElement_.type())
    \n-
    213 DUNE_THROW(Dune::Exception,
    \n-
    214 "HierarchicalLagrange-elements do not exist for elements of type " << e.type());
    \n-
    215
    \n-
    216 this->setSize(finiteElement_.size());
    \n-
    217 }
    \n-
    218
    \n-
    219 protected:
    \n-
    220
    \n-
    221 unsigned int order() const
    \n-
    222 {
    \n-
    223 return 2;
    \n-
    224 }
    \n-
    225
    \n-\n-\n-
    228 };
    \n-
    229
    \n-
    230
    \n-
    231
    \n-
    232 namespace BasisFactory {
    \n-
    233
    \n-
    242 template<std::size_t k, typename R=double>
    \n-\n-
    244 {
    \n-
    245 return [](const auto& gridView) {
    \n-
    246 return HierarchicalLagrangePreBasis<std::decay_t<decltype(gridView)>, k, R>(gridView);
    \n-
    247 };
    \n-
    248 }
    \n-
    249
    \n-
    250 } // end namespace BasisFactory
    \n-
    251
    \n-
    262 template<typename GV, int k, typename R=double>
    \n-\n-
    264
    \n-
    265 } // end namespace Functions
    \n-
    266} // end namespace Dune
    \n-
    267
    \n-
    268#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH
    \n-\n-\n-
    auto hierarchicalLagrange()
    Create a pre-basis factory that can create a HierarchicalLagrange pre-basis.
    Definition: hierarchicallagrangebasis.hh:243
    \n+\n+
    185 {
    \n+
    186 // That cast to unsigned int is necessary because GV::dimension is an enum,
    \n+
    187 // which is not recognized by the power method as an integer type...
    \n+
    188 return power(order()+1, (unsigned int)GV::dimension);
    \n+
    189 }
    \n+
    190
    \n+
    191 template<typename It>
    \n+
    192 It indices(const Node& node, It it) const
    \n+
    193 {
    \n+
    194 for (size_type i = 0, end = node.finiteElement().size() ; i < end ; ++it, ++i)
    \n+
    195 {
    \n+
    196 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
    \n+
    197 const auto& gridIndexSet = gridView().indexSet();
    \n+
    198 const auto& element = node.element();
    \n+
    199
    \n+
    200 // The dimension of the entity that the current dof is related to
    \n+
    201 auto dofDim = dim - localKey.codim();
    \n+
    202
    \n+
    203 // Test for a vertex dof
    \n+
    204 // The test for k==1 is redundant, but having it here allows the compiler to conclude
    \n+
    205 // at compile-time that the dofDim==0 case is the only one that will ever happen.
    \n+
    206 // This leads to measurable speed-up: see
    \n+
    207 // https://gitlab.dune-project.org/staging/dune-functions/issues/30
    \n+
    208 if (k==1 || dofDim==0) {
    \n+
    209 *it = {{ (size_type)(gridIndexSet.subIndex(element,localKey.subEntity(),dim)) }};
    \n+
    210 continue;
    \n+
    211 }
    \n+
    212
    \n+
    213 if (dofDim==1)
    \n+
    214 { // edge dof
    \n+
    215 if (dim==1) // element dof -- any local numbering is fine
    \n+
    216 {
    \n+
    217 *it = {{ edgeOffset_
    \n+
    218 + dofsPerCube(1) * ((size_type)gridIndexSet.subIndex(element,0,0))
    \n+
    219 + localKey.index() }};
    \n+
    220 continue;
    \n+
    221 }
    \n+
    222 else
    \n+
    223 {
    \n+
    224 const auto refElement
    \n+
    225 = Dune::referenceElement<double,dim>(element.type());
    \n+
    226
    \n+
    227 // We have to reverse the numbering if the local element edge is
    \n+
    228 // not aligned with the global edge.
    \n+
    229 auto v0 = (size_type)gridIndexSet.subIndex(element,refElement.subEntity(localKey.subEntity(),localKey.codim(),0,dim),dim);
    \n+
    230 auto v1 = (size_type)gridIndexSet.subIndex(element,refElement.subEntity(localKey.subEntity(),localKey.codim(),1,dim),dim);
    \n+
    231 bool flip = (v0 > v1);
    \n+
    232 *it = {{ (flip)
    \n+\n+
    234 + dofsPerCube(1)*((size_type)gridIndexSet.subIndex(element,localKey.subEntity(),localKey.codim()))
    \n+
    235 + (dofsPerCube(1)-1)-localKey.index()
    \n+\n+
    237 + dofsPerCube(1)*((size_type)gridIndexSet.subIndex(element,localKey.subEntity(),localKey.codim()))
    \n+
    238 + localKey.index() }};
    \n+
    239 continue;
    \n+
    240 }
    \n+
    241 }
    \n+
    242
    \n+
    243 if (dofDim==2)
    \n+
    244 {
    \n+
    245 if (dim==2) // element dof -- any local numbering is fine
    \n+
    246 {
    \n+
    247 if (element.type().isTriangle())
    \n+
    248 {
    \n+
    249 *it = {{ triangleOffset_ + dofsPerSimplex(2)*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
    \n+
    250 continue;
    \n+
    251 }
    \n+
    252 else if (element.type().isQuadrilateral())
    \n+
    253 {
    \n+
    254 *it = {{ quadrilateralOffset_ + dofsPerCube(2)*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
    \n+
    255 continue;
    \n+
    256 }
    \n+
    257 else
    \n+
    258 DUNE_THROW(Dune::NotImplemented, "2d elements have to be triangles or quadrilaterals");
    \n+
    259 } else
    \n+
    260 {
    \n+
    261 const auto refElement
    \n+
    262 = Dune::referenceElement<double,dim>(element.type());
    \n+
    263
    \n+
    264 if (order()>3)
    \n+
    265 DUNE_THROW(Dune::NotImplemented, "LagrangeBasis for 3D grids is only implemented if k<=3");
    \n+
    266
    \n+
    267 if (order()==3 and !refElement.type(localKey.subEntity(), localKey.codim()).isTriangle())
    \n+
    268 DUNE_THROW(Dune::NotImplemented, "LagrangeBasis for 3D grids with k==3 is only implemented if the grid is a simplex grid");
    \n+
    269
    \n+
    270 *it = {{ triangleOffset_ + ((size_type)gridIndexSet.subIndex(element,localKey.subEntity(),localKey.codim())) }};
    \n+
    271 continue;
    \n+
    272 }
    \n+
    273 }
    \n+
    274
    \n+
    275 if (dofDim==3)
    \n+
    276 {
    \n+
    277 if (dim==3) // element dof -- any local numbering is fine
    \n+
    278 {
    \n+
    279 if (element.type().isTetrahedron())
    \n+
    280 {
    \n+
    281 *it = {{ tetrahedronOffset_ + dofsPerSimplex(3)*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
    \n+
    282 continue;
    \n+
    283 }
    \n+
    284 else if (element.type().isHexahedron())
    \n+
    285 {
    \n+
    286 *it = {{ hexahedronOffset_ + dofsPerCube(3)*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
    \n+
    287 continue;
    \n+
    288 }
    \n+
    289 else if (element.type().isPrism())
    \n+
    290 {
    \n+
    291 *it = {{ prismOffset_ + dofsPerPrism()*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
    \n+
    292 continue;
    \n+
    293 }
    \n+
    294 else if (element.type().isPyramid())
    \n+
    295 {
    \n+
    296 *it = {{ pyramidOffset_ + dofsPerPyramid()*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
    \n+
    297 continue;
    \n+
    298 }
    \n+
    299 else
    \n+
    300 DUNE_THROW(Dune::NotImplemented, "3d elements have to be tetrahedra, hexahedra, prisms, or pyramids");
    \n+
    301 } else
    \n+
    302 DUNE_THROW(Dune::NotImplemented, "Grids of dimension larger than 3 are no supported");
    \n+
    303 }
    \n+
    304 DUNE_THROW(Dune::NotImplemented, "Grid contains elements not supported for the LagrangeBasis");
    \n+
    305 }
    \n+
    306 return it;
    \n+
    307 }
    \n+
    308
    \n+
    310 unsigned int order() const
    \n+
    311 {
    \n+
    312 return (useDynamicOrder) ? order_ : k;
    \n+
    313 }
    \n+
    314
    \n+
    315protected:
    \n+\n+
    317
    \n+
    318 // Run-time order, only valid if k<0
    \n+
    319 const unsigned int order_;
    \n+
    320
    \n+
    322 size_type dofsPerSimplex(std::size_t simplexDim) const
    \n+
    323 {
    \n+
    324 return useDynamicOrder ? dofsPerSimplex_[simplexDim] : computeDofsPerSimplex(simplexDim);
    \n+
    325 }
    \n+
    326
    \n+
    328 size_type dofsPerCube(std::size_t cubeDim) const
    \n+
    329 {
    \n+
    330 return useDynamicOrder ? dofsPerCube_[cubeDim] : computeDofsPerCube(cubeDim);
    \n+
    331 }
    \n+
    332
    \n+\n+
    334 {
    \n+
    335 return useDynamicOrder ? dofsPerPrism_ : computeDofsPerPrism();
    \n+
    336 }
    \n+
    337
    \n+\n+
    339 {
    \n+
    340 return useDynamicOrder ? dofsPerPyramid_ : computeDofsPerPyramid();
    \n+
    341 }
    \n+
    342
    \n+
    344 size_type computeDofsPerSimplex(std::size_t simplexDim) const
    \n+
    345 {
    \n+
    346 return order() == 0 ? (dim == simplexDim ? 1 : 0) : Dune::binomial(std::size_t(order()-1),simplexDim);
    \n+
    347 }
    \n+
    348
    \n+
    350 size_type computeDofsPerCube(std::size_t cubeDim) const
    \n+
    351 {
    \n+
    352 return order() == 0 ? (dim == cubeDim ? 1 : 0) : Dune::power(order()-1, cubeDim);
    \n+
    353 }
    \n+
    354
    \n+\n+
    356 {
    \n+
    357 return order() == 0 ? (dim == 3 ? 1 : 0) : (order()-1)*(order()-1)*(order()-2)/2;
    \n+
    358 }
    \n+
    359
    \n+\n+
    361 {
    \n+
    362 return order() == 0 ? (dim == 3 ? 1 : 0) : (order()-2)*(order()-1)*(2*order()-3)/6;
    \n+
    363 }
    \n+
    364
    \n+
    365 // When the order is given at run-time, the following numbers are pre-computed:
    \n+
    366 std::array<size_type,dim+1> dofsPerSimplex_;
    \n+
    367 std::array<size_type,dim+1> dofsPerCube_;
    \n+\n+\n+
    370
    \n+\n+\n+\n+\n+\n+\n+\n+\n+
    379
    \n+
    380};
    \n+
    381
    \n+
    382
    \n+
    383
    \n+
    384template<typename GV, int k, typename R>
    \n+\n+
    386 public LeafBasisNode
    \n+
    387{
    \n+
    388 // Stores LocalFiniteElement implementations with run-time order as a function of GeometryType
    \n+
    389 template<typename Domain, typename Range, int dim>
    \n+
    390 class LagrangeRunTimeLFECache
    \n+
    391 {
    \n+
    392 public:
    \n+
    393 using FiniteElementType = LagrangeLocalFiniteElement<EquidistantPointSet,dim,Domain,Range>;
    \n+
    394
    \n+
    395 const FiniteElementType& get(GeometryType type)
    \n+
    396 {
    \n+
    397 auto i = data_.find(type);
    \n+
    398 if (i==data_.end())
    \n+
    399 i = data_.emplace(type,FiniteElementType(type,order_)).first;
    \n+
    400 return (*i).second;
    \n+
    401 }
    \n+
    402
    \n+
    403 std::map<GeometryType, FiniteElementType> data_;
    \n+
    404 unsigned int order_;
    \n+
    405 };
    \n+
    406
    \n+
    407 static constexpr int dim = GV::dimension;
    \n+
    408 static constexpr bool useDynamicOrder = (k<0);
    \n+
    409
    \n+
    410 using FiniteElementCache = typename std::conditional<(useDynamicOrder),
    \n+
    411 LagrangeRunTimeLFECache<typename GV::ctype, R, dim>,
    \n+
    412 PQkLocalFiniteElementCache<typename GV::ctype, R, dim, k>
    \n+
    413 >::type;
    \n+
    414
    \n+
    415public:
    \n+
    416
    \n+
    417 using size_type = std::size_t;
    \n+
    418 using Element = typename GV::template Codim<0>::Entity;
    \n+
    419 using FiniteElement = typename FiniteElementCache::FiniteElementType;
    \n+
    420
    \n+\n+
    423 finiteElement_(nullptr),
    \n+
    424 element_(nullptr)
    \n+
    425 {}
    \n+
    426
    \n+
    428 LagrangeNode(unsigned int order) :
    \n+
    429 order_(order),
    \n+
    430 finiteElement_(nullptr),
    \n+
    431 element_(nullptr)
    \n+
    432 {
    \n+
    433 // Only the cache for the run-time-order case (i.e., k<0), has the 'order_' member
    \n+
    434 if constexpr (useDynamicOrder)
    \n+
    435 cache_.order_ = order;
    \n+
    436 }
    \n+
    437
    \n+
    439 const Element& element() const
    \n+
    440 {
    \n+
    441 return *element_;
    \n+
    442 }
    \n+
    443
    \n+\n+
    449 {
    \n+
    450 return *finiteElement_;
    \n+
    451 }
    \n+
    452
    \n+
    454 void bind(const Element& e)
    \n+
    455 {
    \n+
    456 element_ = &e;
    \n+
    457 finiteElement_ = &(cache_.get(element_->type()));
    \n+
    458 this->setSize(finiteElement_->size());
    \n+
    459 }
    \n+
    460
    \n+
    461protected:
    \n+
    462
    \n+
    463 unsigned int order() const
    \n+
    464 {
    \n+
    465 return (useDynamicOrder) ? order_ : k;
    \n+
    466 }
    \n+
    467
    \n+
    468 // Run-time order, only valid if k<0
    \n+
    469 unsigned int order_;
    \n+
    470
    \n+
    471 FiniteElementCache cache_;
    \n+\n+\n+
    474};
    \n+
    475
    \n+
    476
    \n+
    477
    \n+
    478namespace BasisFactory {
    \n+
    479
    \n+
    488template<std::size_t k, typename R=double>
    \n+\n+
    490{
    \n+
    491 return [](const auto& gridView) {
    \n+
    492 return LagrangePreBasis<std::decay_t<decltype(gridView)>, k, R>(gridView);
    \n+
    493 };
    \n+
    494}
    \n+
    495
    \n+
    503template<typename R=double>
    \n+
    504auto lagrange(int order)
    \n+
    505{
    \n+
    506 return [=](const auto& gridView) {
    \n+
    507 return LagrangePreBasis<std::decay_t<decltype(gridView)>, -1, R>(gridView, order);
    \n+
    508 };
    \n+
    509}
    \n+
    510
    \n+
    511} // end namespace BasisFactory
    \n+
    512
    \n+
    513
    \n+
    514
    \n+
    538template<typename GV, int k=-1, typename R=double>
    \n+\n+
    540
    \n+
    541
    \n+
    542
    \n+
    543
    \n+
    544
    \n+
    545} // end namespace Functions
    \n+
    546} // end namespace Dune
    \n+
    547
    \n+
    548
    \n+
    549#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH
    \n+\n+\n+
    auto power(ChildPreBasisFactory &&childPreBasisFactory, const IndexMergingStrategy &)
    Create a pre-basis factory that can build a PowerPreBasis.
    Definition: powerbasis.hh:369
    \n+
    auto lagrange()
    Create a pre-basis factory that can create a Lagrange pre-basis.
    Definition: lagrangebasis.hh:489
    \n
    Definition: polynomial.hh:10
    \n
    Global basis for given pre-basis.
    Definition: defaultglobalbasis.hh:46
    \n-
    Definition: hierarchicallagrangebasis.hh:178
    \n-
    HierarchicalP2LocalFiniteElement< typename GV::ctype, R, dim > FiniteElement
    Definition: hierarchicallagrangebasis.hh:185
    \n-
    const Element & element() const
    Return current element, throw if unbound.
    Definition: hierarchicallagrangebasis.hh:193
    \n-
    void bind(const Element &e)
    Bind to element.
    Definition: hierarchicallagrangebasis.hh:208
    \n-
    const FiniteElement & finiteElement() const
    Return the LocalFiniteElement for the element we are bound to.
    Definition: hierarchicallagrangebasis.hh:202
    \n-
    const Element * element_
    Definition: hierarchicallagrangebasis.hh:227
    \n-
    const FiniteElement finiteElement_
    Definition: hierarchicallagrangebasis.hh:226
    \n-
    unsigned int order() const
    Definition: hierarchicallagrangebasis.hh:221
    \n-
    HierarchicalLagrangeNode()
    Definition: hierarchicallagrangebasis.hh:187
    \n-
    std::size_t size_type
    Definition: hierarchicallagrangebasis.hh:183
    \n-
    typename GV::template Codim< 0 >::Entity Element
    Definition: hierarchicallagrangebasis.hh:184
    \n-
    A pre-basis for a hierarchical basis.
    Definition: hierarchicallagrangebasis.hh:49
    \n-
    std::size_t size_type
    Type used for indices and size information.
    Definition: hierarchicallagrangebasis.hh:58
    \n-
    unsigned int order() const
    Definition: hierarchicallagrangebasis.hh:145
    \n-
    Node makeNode() const
    Create tree node.
    Definition: hierarchicallagrangebasis.hh:94
    \n-
    size_type maxNodeSize() const
    Get the maximal number of DOFs associated to node for any element.
    Definition: hierarchicallagrangebasis.hh:123
    \n-
    static constexpr size_type multiIndexBufferSize
    Definition: hierarchicallagrangebasis.hh:65
    \n-
    void update(const GridView &gv)
    Update the stored grid view & MultipleCodimMultipleGeomTypeMapper, to be called if the grid has chang...
    Definition: hierarchicallagrangebasis.hh:85
    \n-
    MultipleCodimMultipleGeomTypeMapper< GridView > mcmgMapper_
    Definition: hierarchicallagrangebasis.hh:150
    \n-
    size_type dimension() const
    Get the total dimension of the space spanned by this basis.
    Definition: hierarchicallagrangebasis.hh:114
    \n-
    GV GridView
    The grid view that the FE basis is defined on.
    Definition: hierarchicallagrangebasis.hh:55
    \n-
    HierarchicalLagrangePreBasis(const GridView &gv)
    Constructor for a given grid view object with layout for second order.
    Definition: hierarchicallagrangebasis.hh:71
    \n-
    static constexpr size_type maxMultiIndexSize
    Definition: hierarchicallagrangebasis.hh:63
    \n-
    size_type size(const SizePrefix prefix) const
    Return number of possible values for next position in multi index.
    Definition: hierarchicallagrangebasis.hh:107
    \n-
    const GridView & gridView() const
    Obtain the grid view that the basis is defined on.
    Definition: hierarchicallagrangebasis.hh:79
    \n-
    GridView gridView_
    Definition: hierarchicallagrangebasis.hh:143
    \n-
    size_type size() const
    Same as size(prefix) with empty prefix.
    Definition: hierarchicallagrangebasis.hh:100
    \n-
    void initializeIndices()
    Initialize the global indices.
    Definition: hierarchicallagrangebasis.hh:75
    \n-
    It indices(const Node &node, It it) const
    Definition: hierarchicallagrangebasis.hh:130
    \n-
    static constexpr size_type minMultiIndexSize
    Definition: hierarchicallagrangebasis.hh:64
    \n+
    Definition: lagrangebasis.hh:387
    \n+
    LagrangeNode(unsigned int order)
    Constructor with a run-time order.
    Definition: lagrangebasis.hh:428
    \n+
    unsigned int order() const
    Definition: lagrangebasis.hh:463
    \n+
    const FiniteElement & finiteElement() const
    Return the LocalFiniteElement for the element we are bound to.
    Definition: lagrangebasis.hh:448
    \n+
    const Element * element_
    Definition: lagrangebasis.hh:473
    \n+
    const Element & element() const
    Return current element, throw if unbound.
    Definition: lagrangebasis.hh:439
    \n+
    FiniteElementCache cache_
    Definition: lagrangebasis.hh:471
    \n+
    typename FiniteElementCache::FiniteElementType FiniteElement
    Definition: lagrangebasis.hh:419
    \n+
    void bind(const Element &e)
    Bind to element.
    Definition: lagrangebasis.hh:454
    \n+
    typename GV::template Codim< 0 >::Entity Element
    Definition: lagrangebasis.hh:418
    \n+
    const FiniteElement * finiteElement_
    Definition: lagrangebasis.hh:472
    \n+
    unsigned int order_
    Definition: lagrangebasis.hh:469
    \n+
    std::size_t size_type
    Definition: lagrangebasis.hh:417
    \n+
    LagrangeNode()
    Constructor without order (uses the compile-time value)
    Definition: lagrangebasis.hh:422
    \n+
    A pre-basis for a PQ-lagrange bases with given order.
    Definition: lagrangebasis.hh:55
    \n+
    size_type dofsPerPrism() const
    Definition: lagrangebasis.hh:333
    \n+
    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
    \n+
    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
    \n+
    static constexpr size_type maxMultiIndexSize
    Definition: lagrangebasis.hh:70
    \n+
    size_type computeDofsPerPrism() const
    Definition: lagrangebasis.hh:355
    \n+
    size_type edgeOffset_
    Definition: lagrangebasis.hh:372
    \n+
    std::array< size_type, dim+1 > dofsPerSimplex_
    Definition: lagrangebasis.hh:366
    \n+
    It indices(const Node &node, It it) const
    Definition: lagrangebasis.hh:192
    \n+
    size_type vertexOffset_
    Definition: lagrangebasis.hh:371
    \n+
    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
    \n+
    std::size_t size_type
    Type used for indices and size information.
    Definition: lagrangebasis.hh:65
    \n+
    size_type pyramidOffset_
    Definition: lagrangebasis.hh:376
    \n+
    size_type prismOffset_
    Definition: lagrangebasis.hh:377
    \n+
    size_type tetrahedronOffset_
    Definition: lagrangebasis.hh:375
    \n+
    void initializeIndices()
    Initialize the global indices.
    Definition: lagrangebasis.hh:96
    \n+
    size_type computeDofsPerPyramid() const
    Definition: lagrangebasis.hh:360
    \n+
    LagrangePreBasis(const GridView &gv, unsigned int order)
    Constructor for a given grid view object and run-time order.
    Definition: lagrangebasis.hh:80
    \n+
    size_type dofsPerPyramid_
    Definition: lagrangebasis.hh:369
    \n+
    size_type dimension() const
    Get the total dimension of the space spanned by this basis.
    Definition: lagrangebasis.hh:178
    \n+
    LagrangePreBasis(const GridView &gv)
    Constructor for a given grid view object with compile-time order.
    Definition: lagrangebasis.hh:75
    \n+
    void update(const GridView &gv)
    Update the stored grid view, to be called if the grid has changed.
    Definition: lagrangebasis.hh:126
    \n+
    size_type size(const SizePrefix &prefix) const
    Return number of possible values for next position in multi index.
    Definition: lagrangebasis.hh:171
    \n+
    static constexpr size_type multiIndexBufferSize
    Definition: lagrangebasis.hh:72
    \n+
    GV GridView
    The grid view that the FE basis is defined on.
    Definition: lagrangebasis.hh:62
    \n+
    size_type quadrilateralOffset_
    Definition: lagrangebasis.hh:374
    \n+
    const GridView & gridView() const
    Obtain the grid view that the basis is defined on.
    Definition: lagrangebasis.hh:120
    \n+
    GridView gridView_
    Definition: lagrangebasis.hh:316
    \n+
    Node makeNode() const
    Create tree node.
    Definition: lagrangebasis.hh:134
    \n+
    unsigned int order() const
    Polynomial order used in the local Lagrange finite-elements.
    Definition: lagrangebasis.hh:310
    \n+
    const unsigned int order_
    Definition: lagrangebasis.hh:319
    \n+
    std::array< size_type, dim+1 > dofsPerCube_
    Definition: lagrangebasis.hh:367
    \n+
    size_type maxNodeSize() const
    Get the maximal number of DOFs associated to node for any element.
    Definition: lagrangebasis.hh:184
    \n+
    size_type size() const
    Same as size(prefix) with empty prefix.
    Definition: lagrangebasis.hh:140
    \n+
    size_type dofsPerPrism_
    Definition: lagrangebasis.hh:368
    \n+
    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
    \n+
    size_type triangleOffset_
    Definition: lagrangebasis.hh:373
    \n+
    size_type hexahedronOffset_
    Definition: lagrangebasis.hh:378
    \n+
    static constexpr size_type minMultiIndexSize
    Definition: lagrangebasis.hh:71
    \n+
    size_type dofsPerPyramid() const
    Definition: lagrangebasis.hh:338
    \n
    void setSize(const size_type size)
    Definition: nodes.hh:164
    \n
    Definition: nodes.hh:186
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,354 +5,743 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-hierarchicallagrangebasis.hh\n+lagrangebasis.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH\n 5\n- 6#include \n- 7#include \n+ 6#include \n+ 7#include \n 8\n- 9#include \n- 10#include \n- 11#include \n+ 9#include \n+ 10#include \n+ 11#include \n 12\n- 13namespace Dune {\n- 14 namespace Functions {\n+ 13#include \n+ 14#include \n 15\n- 16 /\n+ 16\n+ 17namespace Dune {\n+ 18namespace Functions {\n+ 19\n+ 20/\n / *****************************************************************************\n- 17 // Implementation for Hierarchical Lagrange Basis\n- 18 //\n- 19 // -- only order k=2 is implemented up to now --\n- 20 // -- currently only supports simplex grids --\n- 21 //\n- 22 // This is the reusable part of the HierarchicalLagrangeBasis. It contains\n- 23 //\n- 24 // HierarchicalLagrangePreBasis\n- 25 // HierarchicalLagrangeNode\n- 26 //\n- 27 // The pre-basis allows to create the others and is the owner of possible\n+ 21// This is the reusable part of the LagrangeBasis. It contains\n+ 22//\n+ 23// LagrangePreBasis\n+ 24// LagrangeNode\n+ 25//\n+ 26// The pre-basis allows to create the others and is the owner of possible\n shared\n- 28 // state. These components do _not_ depend on the global basis and can be\n- 29 // used without a global basis.\n- 30 /\n+ 27// state. These components do _not_ depend on the global basis and local\n+view\n+ 28// and can be used without a global basis.\n+ 29/\n / *****************************************************************************\n- 31\n- 32 template\n- 33 class HierarchicalLagrangeNode;\n- 34\n- 35 template\n- 36 class HierarchicalLagrangePreBasis;\n+ 30\n+ 31template\n+ 32class LagrangeNode;\n+ 33\n+ 34template\n+ 35class LagrangePreBasis;\n+ 36\n 37\n- 47 template\n-48 class HierarchicalLagrangePreBasis\n- 49 {\n- 50 static const int dim = GV::dimension;\n- 51\n- 52 public:\n- 53\n-55 using GridView = GV;\n- 56\n-58 using size_type = std::size_t;\n- 59\n-61 using Node = HierarchicalLagrangeNode;\n- 62\n-63 static constexpr size_type maxMultiIndexSize = 1;\n-64 static constexpr size_type minMultiIndexSize = 1;\n-65 static constexpr size_type multiIndexBufferSize = 1;\n+ 38\n+ 53template\n+54class LagrangePreBasis\n+ 55{\n+ 56 static const int dim = GV::dimension;\n+ 57 static const bool useDynamicOrder = (k<0);\n+ 58\n+ 59public:\n+ 60\n+62 using GridView = GV;\n+ 63\n+65 using size_type = std::size_t;\n 66\n-71 HierarchicalLagrangePreBasis(const GridView& gv) : gridView_(gv) ,\n-mcmgMapper_(gv,p2Layout())\n- 72 {}\n+68 using Node = LagrangeNode;\n+ 69\n+70 static constexpr size_type maxMultiIndexSize = 1;\n+71 static constexpr size_type minMultiIndexSize = 1;\n+72 static constexpr size_type multiIndexBufferSize = 1;\n 73\n-75 void initializeIndices()\n- 76 {}\n- 77\n-79 const GridView& gridView() const\n- 80 {\n- 81 return gridView_;\n- 82 }\n- 83\n-85 void update (const GridView& gv)\n- 86 {\n- 87 gridView_ = gv;\n- 88 mcmgMapper_.update(gv);\n- 89 }\n- 90\n-94 Node makeNode() const\n- 95 {\n- 96 return Node{};\n- 97 }\n- 98\n-100 size_type size() const\n- 101 {\n- 102 return mcmgMapper_.size();\n- 103 }\n+75 LagrangePreBasis(const GridView& gv)\n+ 76 : LagrangePreBasis(gv, std::numeric_limits::max())\n+ 77 {}\n+ 78\n+80 LagrangePreBasis(const GridView& gv, unsigned int order) :\n+ 81 gridView_(gv), order_(order)\n+ 82 {\n+ 83 if (!useDynamicOrder && order!=std::numeric_limits::max())\n+ 84 DUNE_THROW(RangeError, \"Template argument k has to be -1 when supplying a\n+run-time order!\");\n+ 85\n+ 86 for (int i=0; i<=dim; i++)\n+ 87 {\n+ 88 dofsPerCube_[i] = computeDofsPerCube(i);\n+ 89 dofsPerSimplex_[i] = computeDofsPerSimplex(i);\n+ 90 }\n+ 91 dofsPerPrism_ = computeDofsPerPrism();\n+ 92 dofsPerPyramid_ = computeDofsPerPyramid();\n+ 93 }\n+ 94\n+96 void initializeIndices()\n+ 97 {\n+ 98 vertexOffset_ = 0;\n+ 99 edgeOffset_ = vertexOffset_ + dofsPerCube(0) * ((size_type)gridView_.size\n+(dim));\n+ 100\n+ 101 if (dim>=2)\n+ 102 {\n+ 103 triangleOffset_ = edgeOffset_ + dofsPerCube(1) * ((size_type)\n+gridView_.size(dim-1));\n 104\n- 106 template\n-107 size_type size(const SizePrefix prefix) const\n- 108 {\n- 109 assert(prefix.size() == 0 || prefix.size() == 1);\n- 110 return (prefix.size() == 0) ? size() : 0;\n- 111 }\n+ 105 quadrilateralOffset_ = triangleOffset_ + dofsPerSimplex(2) * (\n+(size_type)gridView_.size(Dune::GeometryTypes::triangle));\n+ 106 }\n+ 107\n+ 108 if (dim==3) {\n+ 109 tetrahedronOffset_ = quadrilateralOffset_ + dofsPerCube(2) * (\n+(size_type)gridView_.size(Dune::GeometryTypes::quadrilateral));\n+ 110\n+ 111 prismOffset_ = tetrahedronOffset_ + dofsPerSimplex(3) * (\n+(size_type)gridView_.size(Dune::GeometryTypes::tetrahedron));\n 112\n-114 size_type dimension() const\n- 115 {\n- 116 return size();\n+ 113 hexahedronOffset_ = prismOffset_ + dofsPerPrism() * (\n+(size_type)gridView_.size(Dune::GeometryTypes::prism));\n+ 114\n+ 115 pyramidOffset_ = hexahedronOffset_ + dofsPerCube(3) * (\n+(size_type)gridView_.size(Dune::GeometryTypes::hexahedron));\n+ 116 }\n 117 }\n 118\n-123 size_type maxNodeSize() const\n- 124 {\n- 125 // That cast to unsigned int is necessary because GV::dimension is an enum\n- 126 return Dune::binomial(std::size_t(order() + (unsigned int)GV::\n-dimension),std::size_t(order()));\n- 127 }\n- 128\n- 129 template\n-130 It indices(const Node& node, It it) const\n- 131 {\n- 132 for (size_type i = 0, end = node.finiteElement().size() ; i < end ; ++it,\n+120 const GridView& gridView() const\n+ 121 {\n+ 122 return gridView_;\n+ 123 }\n+ 124\n+126 void update (const GridView& gv)\n+ 127 {\n+ 128 gridView_ = gv;\n+ 129 }\n+ 130\n+134 Node makeNode() const\n+ 135 {\n+ 136 return Node{order_};\n+ 137 }\n+ 138\n+140 size_type size() const\n+ 141 {\n+ 142 switch (dim)\n+ 143 {\n+ 144 case 1:\n+ 145 return dofsPerCube(0) * ((size_type)gridView_.size(dim))\n+ 146 + dofsPerCube(1) * ((size_type)gridView_.size(dim-1));\n+ 147 case 2:\n+ 148 {\n+ 149 return dofsPerCube(0) * ((size_type)gridView_.size(dim))\n+ 150 + dofsPerCube(1) * ((size_type)gridView_.size(dim-1))\n+ 151 + dofsPerSimplex(2) * ((size_type)gridView_.size(Dune::GeometryTypes::\n+triangle))\n+ 152 + dofsPerCube(2) * ((size_type)gridView_.size(Dune::GeometryTypes::\n+quadrilateral));\n+ 153 }\n+ 154 case 3:\n+ 155 {\n+ 156 return dofsPerCube(0) * ((size_type)gridView_.size(dim))\n+ 157 + dofsPerCube(1) * ((size_type)gridView_.size(dim-1))\n+ 158 + dofsPerSimplex(2) * ((size_type)gridView_.size(Dune::GeometryTypes::\n+triangle))\n+ 159 + dofsPerCube(2) * ((size_type)gridView_.size(Dune::GeometryTypes::\n+quadrilateral))\n+ 160 + dofsPerSimplex(3) * ((size_type)gridView_.size(Dune::GeometryTypes::\n+tetrahedron))\n+ 161 + dofsPerPyramid() * ((size_type)gridView_.size(Dune::GeometryTypes::\n+pyramid))\n+ 162 + dofsPerPrism() * ((size_type)gridView_.size(Dune::GeometryTypes::prism))\n+ 163 + dofsPerCube(3) * ((size_type)gridView_.size(Dune::GeometryTypes::\n+hexahedron));\n+ 164 }\n+ 165 }\n+ 166 DUNE_THROW(Dune::NotImplemented, \"No size method for \" << dim << \"d grids\n+available yet!\");\n+ 167 }\n+ 168\n+ 170 template\n+171 size_type size(const SizePrefix& prefix) const\n+ 172 {\n+ 173 assert(prefix.size() == 0 || prefix.size() == 1);\n+ 174 return (prefix.size() == 0) ? size() : 0;\n+ 175 }\n+ 176\n+178 size_type dimension() const\n+ 179 {\n+ 180 return size();\n+ 181 }\n+ 182\n+184 size_type maxNodeSize() const\n+ 185 {\n+ 186 // That cast to unsigned int is necessary because GV::dimension is an\n+enum,\n+ 187 // which is not recognized by the power method as an integer type...\n+ 188 return power(order()+1, (unsigned int)GV::dimension);\n+ 189 }\n+ 190\n+ 191 template\n+192 It indices(const Node& node, It it) const\n+ 193 {\n+ 194 for (size_type i = 0, end = node.finiteElement().size() ; i < end ; ++it,\n ++i)\n- 133 {\n- 134 Dune::LocalKey localKey = node.finiteElement().localCoefficients\n+ 195 {\n+ 196 Dune::LocalKey localKey = node.finiteElement().localCoefficients\n ().localKey(i);\n- 135 const auto& element = node.element();\n- 136\n- 137 *it = {{ (size_type)(mcmgMapper_.subIndex(element,localKey.subEntity\n-(),localKey.codim())) }};\n- 138 }\n- 139 return it;\n- 140 }\n- 141\n- 142 protected:\n-143 GridView gridView_;\n- 144\n-145 unsigned int order() const\n- 146 {\n- 147 return 2;\n- 148 }\n- 149\n-150 MultipleCodimMultipleGeomTypeMapper mcmgMapper_;\n- 151\n- 152 private:\n- 157 static auto p2Layout()\n- 158 {\n- 159 return [](Dune::GeometryType type, int gridDim)\n- 160 {\n- 161 if (type.isVertex())\n- 162 return 1;\n- 163 if (type.isLine())\n- 164 return 1;\n- 165 if (type.isTriangle())\n- 166 return 0;\n- 167 assert(type.isTetrahedron());\n- 168 return 0;\n- 169 };\n- 170 }\n- 171 };\n- 172\n- 173\n- 174\n- 175 template\n-176 class HierarchicalLagrangeNode :\n- 177 public LeafBasisNode\n- 178 {\n- 179 static const int dim = GV::dimension;\n- 180\n- 181 public:\n- 182\n-183 using size_type = std::size_t;\n-184 using Element = typename GV::template Codim<0>::Entity;\n-185 using FiniteElement = HierarchicalP2LocalFiniteElement;\n- 186\n-187 HierarchicalLagrangeNode() :\n- 188 finiteElement_(),\n- 189 element_(nullptr)\n- 190 {}\n- 191\n-193 const Element& element() const\n- 194 {\n- 195 return *element_;\n- 196 }\n- 197\n-202 const FiniteElement& finiteElement() const\n- 203 {\n- 204 return finiteElement_;\n- 205 }\n- 206\n-208 void bind(const Element& e)\n- 209 {\n- 210 element_ = &e;\n- 211\n- 212 if (e.type() != finiteElement_.type())\n- 213 DUNE_THROW(Dune::Exception,\n- 214 \"HierarchicalLagrange-elements do not exist for elements of type \" <<\n-e.type());\n- 215\n- 216 this->setSize(finiteElement_.size());\n- 217 }\n- 218\n- 219 protected:\n- 220\n-221 unsigned int order() const\n- 222 {\n- 223 return 2;\n- 224 }\n- 225\n-226 const FiniteElement finiteElement_;\n-227 const Element* element_;\n- 228 };\n- 229\n- 230\n- 231\n- 232 namespace BasisFactory {\n- 233\n- 242 template\n-243 auto hierarchicalLagrange()\n+ 197 const auto& gridIndexSet = gridView().indexSet();\n+ 198 const auto& element = node.element();\n+ 199\n+ 200 // The dimension of the entity that the current dof is related to\n+ 201 auto dofDim = dim - localKey.codim();\n+ 202\n+ 203 // Test for a vertex dof\n+ 204 // The test for k==1 is redundant, but having it here allows the compiler\n+to conclude\n+ 205 // at compile-time that the dofDim==0 case is the only one that will ever\n+happen.\n+ 206 // This leads to measurable speed-up: see\n+ 207 // https://gitlab.dune-project.org/staging/dune-functions/issues/30\n+ 208 if (k==1 || dofDim==0) {\n+ 209 *it = {{ (size_type)(gridIndexSet.subIndex(element,localKey.subEntity\n+(),dim)) }};\n+ 210 continue;\n+ 211 }\n+ 212\n+ 213 if (dofDim==1)\n+ 214 { // edge dof\n+ 215 if (dim==1) // element dof -- any local numbering is fine\n+ 216 {\n+ 217 *it = {{ edgeOffset_\n+ 218 + dofsPerCube(1) * ((size_type)gridIndexSet.subIndex(element,0,0))\n+ 219 + localKey.index() }};\n+ 220 continue;\n+ 221 }\n+ 222 else\n+ 223 {\n+ 224 const auto refElement\n+ 225 = Dune::referenceElement(element.type());\n+ 226\n+ 227 // We have to reverse the numbering if the local element edge is\n+ 228 // not aligned with the global edge.\n+ 229 auto v0 = (size_type)gridIndexSet.subIndex(element,refElement.subEntity\n+(localKey.subEntity(),localKey.codim(),0,dim),dim);\n+ 230 auto v1 = (size_type)gridIndexSet.subIndex(element,refElement.subEntity\n+(localKey.subEntity(),localKey.codim(),1,dim),dim);\n+ 231 bool flip = (v0 > v1);\n+ 232 *it = {{ (flip)\n+ 233 ? edgeOffset_\n+ 234 + dofsPerCube(1)*((size_type)gridIndexSet.subIndex\n+(element,localKey.subEntity(),localKey.codim()))\n+ 235 + (dofsPerCube(1)-1)-localKey.index()\n+ 236 : edgeOffset_\n+ 237 + dofsPerCube(1)*((size_type)gridIndexSet.subIndex\n+(element,localKey.subEntity(),localKey.codim()))\n+ 238 + localKey.index() }};\n+ 239 continue;\n+ 240 }\n+ 241 }\n+ 242\n+ 243 if (dofDim==2)\n 244 {\n- 245 return [](const auto& gridView) {\n- 246 return HierarchicalLagrangePreBasis, k,\n-R>(gridView);\n- 247 };\n- 248 }\n- 249\n- 250 } // end namespace BasisFactory\n- 251\n- 262 template\n-263 using HierarchicalLagrangeBasis =\n-DefaultGlobalBasis >;\n- 264\n- 265 } // end namespace Functions\n- 266} // end namespace Dune\n- 267\n- 268#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH\n+ 245 if (dim==2) // element dof -- any local numbering is fine\n+ 246 {\n+ 247 if (element.type().isTriangle())\n+ 248 {\n+ 249 *it = {{ triangleOffset_ + dofsPerSimplex(2)*(\n+(size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};\n+ 250 continue;\n+ 251 }\n+ 252 else if (element.type().isQuadrilateral())\n+ 253 {\n+ 254 *it = {{ quadrilateralOffset_ + dofsPerCube(2)*(\n+(size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};\n+ 255 continue;\n+ 256 }\n+ 257 else\n+ 258 DUNE_THROW(Dune::NotImplemented, \"2d elements have to be triangles or\n+quadrilaterals\");\n+ 259 } else\n+ 260 {\n+ 261 const auto refElement\n+ 262 = Dune::referenceElement(element.type());\n+ 263\n+ 264 if (order()>3)\n+ 265 DUNE_THROW(Dune::NotImplemented, \"LagrangeBasis for 3D grids is only\n+implemented if k<=3\");\n+ 266\n+ 267 if (order()==3 and !refElement.type(localKey.subEntity(), localKey.codim\n+()).isTriangle())\n+ 268 DUNE_THROW(Dune::NotImplemented, \"LagrangeBasis for 3D grids with k==3 is\n+only implemented if the grid is a simplex grid\");\n+ 269\n+ 270 *it = {{ triangleOffset_ + ((size_type)gridIndexSet.subIndex\n+(element,localKey.subEntity(),localKey.codim())) }};\n+ 271 continue;\n+ 272 }\n+ 273 }\n+ 274\n+ 275 if (dofDim==3)\n+ 276 {\n+ 277 if (dim==3) // element dof -- any local numbering is fine\n+ 278 {\n+ 279 if (element.type().isTetrahedron())\n+ 280 {\n+ 281 *it = {{ tetrahedronOffset_ + dofsPerSimplex(3)*(\n+(size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};\n+ 282 continue;\n+ 283 }\n+ 284 else if (element.type().isHexahedron())\n+ 285 {\n+ 286 *it = {{ hexahedronOffset_ + dofsPerCube(3)*(\n+(size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};\n+ 287 continue;\n+ 288 }\n+ 289 else if (element.type().isPrism())\n+ 290 {\n+ 291 *it = {{ prismOffset_ + dofsPerPrism()*((size_type)gridIndexSet.subIndex\n+(element,0,0)) + localKey.index() }};\n+ 292 continue;\n+ 293 }\n+ 294 else if (element.type().isPyramid())\n+ 295 {\n+ 296 *it = {{ pyramidOffset_ + dofsPerPyramid()*(\n+(size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};\n+ 297 continue;\n+ 298 }\n+ 299 else\n+ 300 DUNE_THROW(Dune::NotImplemented, \"3d elements have to be tetrahedra,\n+hexahedra, prisms, or pyramids\");\n+ 301 } else\n+ 302 DUNE_THROW(Dune::NotImplemented, \"Grids of dimension larger than 3 are no\n+supported\");\n+ 303 }\n+ 304 DUNE_THROW(Dune::NotImplemented, \"Grid contains elements not supported for\n+the LagrangeBasis\");\n+ 305 }\n+ 306 return it;\n+ 307 }\n+ 308\n+310 unsigned int order() const\n+ 311 {\n+ 312 return (useDynamicOrder) ? order_ : k;\n+ 313 }\n+ 314\n+ 315protected:\n+316 GridView gridView_;\n+ 317\n+ 318 // Run-time order, only valid if k<0\n+319 const unsigned int order_;\n+ 320\n+322 size_type dofsPerSimplex(std::size_t simplexDim) const\n+ 323 {\n+ 324 return useDynamicOrder ? dofsPerSimplex_[simplexDim] :\n+computeDofsPerSimplex(simplexDim);\n+ 325 }\n+ 326\n+328 size_type dofsPerCube(std::size_t cubeDim) const\n+ 329 {\n+ 330 return useDynamicOrder ? dofsPerCube_[cubeDim] : computeDofsPerCube\n+(cubeDim);\n+ 331 }\n+ 332\n+333 size_type dofsPerPrism() const\n+ 334 {\n+ 335 return useDynamicOrder ? dofsPerPrism_ : computeDofsPerPrism();\n+ 336 }\n+ 337\n+338 size_type dofsPerPyramid() const\n+ 339 {\n+ 340 return useDynamicOrder ? dofsPerPyramid_ : computeDofsPerPyramid();\n+ 341 }\n+ 342\n+344 size_type computeDofsPerSimplex(std::size_t simplexDim) const\n+ 345 {\n+ 346 return order() == 0 ? (dim == simplexDim ? 1 : 0) : Dune::binomial(std::\n+size_t(order()-1),simplexDim);\n+ 347 }\n+ 348\n+350 size_type computeDofsPerCube(std::size_t cubeDim) const\n+ 351 {\n+ 352 return order() == 0 ? (dim == cubeDim ? 1 : 0) : Dune::power(order()-1,\n+cubeDim);\n+ 353 }\n+ 354\n+355 size_type computeDofsPerPrism() const\n+ 356 {\n+ 357 return order() == 0 ? (dim == 3 ? 1 : 0) : (order()-1)*(order()-1)*(order\n+()-2)/2;\n+ 358 }\n+ 359\n+360 size_type computeDofsPerPyramid() const\n+ 361 {\n+ 362 return order() == 0 ? (dim == 3 ? 1 : 0) : (order()-2)*(order()-1)*\n+(2*order()-3)/6;\n+ 363 }\n+ 364\n+ 365 // When the order is given at run-time, the following numbers are pre-\n+computed:\n+366 std::array dofsPerSimplex_;\n+367 std::array dofsPerCube_;\n+368 size_type dofsPerPrism_;\n+369 size_type dofsPerPyramid_;\n+ 370\n+371 size_type vertexOffset_;\n+372 size_type edgeOffset_;\n+373 size_type triangleOffset_;\n+374 size_type quadrilateralOffset_;\n+375 size_type tetrahedronOffset_;\n+376 size_type pyramidOffset_;\n+377 size_type prismOffset_;\n+378 size_type hexahedronOffset_;\n+ 379\n+ 380};\n+ 381\n+ 382\n+ 383\n+ 384template\n+385class LagrangeNode :\n+ 386 public LeafBasisNode\n+ 387{\n+ 388 // Stores LocalFiniteElement implementations with run-time order as a\n+function of GeometryType\n+ 389 template\n+ 390 class LagrangeRunTimeLFECache\n+ 391 {\n+ 392 public:\n+ 393 using FiniteElementType =\n+LagrangeLocalFiniteElement;\n+ 394\n+ 395 const FiniteElementType& get(GeometryType type)\n+ 396 {\n+ 397 auto i = data_.find(type);\n+ 398 if (i==data_.end())\n+ 399 i = data_.emplace(type,FiniteElementType(type,order_)).first;\n+ 400 return (*i).second;\n+ 401 }\n+ 402\n+ 403 std::map data_;\n+ 404 unsigned int order_;\n+ 405 };\n+ 406\n+ 407 static constexpr int dim = GV::dimension;\n+ 408 static constexpr bool useDynamicOrder = (k<0);\n+ 409\n+ 410 using FiniteElementCache = typename std::conditional<(useDynamicOrder),\n+ 411 LagrangeRunTimeLFECache,\n+ 412 PQkLocalFiniteElementCache\n+ 413 >::type;\n+ 414\n+ 415public:\n+ 416\n+417 using size_type = std::size_t;\n+418 using Element = typename GV::template Codim<0>::Entity;\n+419 using FiniteElement = typename FiniteElementCache::FiniteElementType;\n+ 420\n+422 LagrangeNode() :\n+ 423 finiteElement_(nullptr),\n+ 424 element_(nullptr)\n+ 425 {}\n+ 426\n+428 LagrangeNode(unsigned int order) :\n+ 429 order_(order),\n+ 430 finiteElement_(nullptr),\n+ 431 element_(nullptr)\n+ 432 {\n+ 433 // Only the cache for the run-time-order case (i.e., k<0), has the\n+'order_' member\n+ 434 if constexpr (useDynamicOrder)\n+ 435 cache_.order_ = order;\n+ 436 }\n+ 437\n+439 const Element& element() const\n+ 440 {\n+ 441 return *element_;\n+ 442 }\n+ 443\n+448 const FiniteElement& finiteElement() const\n+ 449 {\n+ 450 return *finiteElement_;\n+ 451 }\n+ 452\n+454 void bind(const Element& e)\n+ 455 {\n+ 456 element_ = &e;\n+ 457 finiteElement_ = &(cache_.get(element_->type()));\n+ 458 this->setSize(finiteElement_->size());\n+ 459 }\n+ 460\n+ 461protected:\n+ 462\n+463 unsigned int order() const\n+ 464 {\n+ 465 return (useDynamicOrder) ? order_ : k;\n+ 466 }\n+ 467\n+ 468 // Run-time order, only valid if k<0\n+469 unsigned int order_;\n+ 470\n+471 FiniteElementCache cache_;\n+472 const FiniteElement* finiteElement_;\n+473 const Element* element_;\n+ 474};\n+ 475\n+ 476\n+ 477\n+ 478namespace BasisFactory {\n+ 479\n+ 488template\n+489auto lagrange()\n+ 490{\n+ 491 return [](const auto& gridView) {\n+ 492 return LagrangePreBasis, k, R>(gridView);\n+ 493 };\n+ 494}\n+ 495\n+ 503template\n+504auto lagrange(int order)\n+ 505{\n+ 506 return [=](const auto& gridView) {\n+ 507 return LagrangePreBasis, -1, R>(gridView,\n+order);\n+ 508 };\n+ 509}\n+ 510\n+ 511} // end namespace BasisFactory\n+ 512\n+ 513\n+ 514\n+ 538template\n+539using LagrangeBasis = DefaultGlobalBasis >;\n+ 540\n+ 541\n+ 542\n+ 543\n+ 544\n+ 545} // end namespace Functions\n+ 546} // end namespace Dune\n+ 547\n+ 548\n+ 549#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH\n nodes.hh\n defaultglobalbasis.hh\n-Dune::Functions::BasisFactory::hierarchicalLagrange\n-auto hierarchicalLagrange()\n-Create a pre-basis factory that can create a HierarchicalLagrange pre-basis.\n-Definition: hierarchicallagrangebasis.hh:243\n+Dune::Functions::BasisFactory::power\n+auto power(ChildPreBasisFactory &&childPreBasisFactory, const\n+IndexMergingStrategy &)\n+Create a pre-basis factory that can build a PowerPreBasis.\n+Definition: powerbasis.hh:369\n+Dune::Functions::BasisFactory::lagrange\n+auto lagrange()\n+Create a pre-basis factory that can create a Lagrange pre-basis.\n+Definition: lagrangebasis.hh:489\n Dune\n Definition: polynomial.hh:10\n Dune::Functions::DefaultGlobalBasis\n Global basis for given pre-basis.\n Definition: defaultglobalbasis.hh:46\n-Dune::Functions::HierarchicalLagrangeNode\n-Definition: hierarchicallagrangebasis.hh:178\n-Dune::Functions::HierarchicalLagrangeNode::FiniteElement\n-HierarchicalP2LocalFiniteElement< typename GV::ctype, R, dim > FiniteElement\n-Definition: hierarchicallagrangebasis.hh:185\n-Dune::Functions::HierarchicalLagrangeNode::element\n+Dune::Functions::LagrangeNode\n+Definition: lagrangebasis.hh:387\n+Dune::Functions::LagrangeNode::LagrangeNode\n+LagrangeNode(unsigned int order)\n+Constructor with a run-time order.\n+Definition: lagrangebasis.hh:428\n+Dune::Functions::LagrangeNode::order\n+unsigned int order() const\n+Definition: lagrangebasis.hh:463\n+Dune::Functions::LagrangeNode::finiteElement\n+const FiniteElement & finiteElement() const\n+Return the LocalFiniteElement for the element we are bound to.\n+Definition: lagrangebasis.hh:448\n+Dune::Functions::LagrangeNode::element_\n+const Element * element_\n+Definition: lagrangebasis.hh:473\n+Dune::Functions::LagrangeNode::element\n const Element & element() const\n Return current element, throw if unbound.\n-Definition: hierarchicallagrangebasis.hh:193\n-Dune::Functions::HierarchicalLagrangeNode::bind\n+Definition: lagrangebasis.hh:439\n+Dune::Functions::LagrangeNode::cache_\n+FiniteElementCache cache_\n+Definition: lagrangebasis.hh:471\n+Dune::Functions::LagrangeNode::FiniteElement\n+typename FiniteElementCache::FiniteElementType FiniteElement\n+Definition: lagrangebasis.hh:419\n+Dune::Functions::LagrangeNode::bind\n void bind(const Element &e)\n Bind to element.\n-Definition: hierarchicallagrangebasis.hh:208\n-Dune::Functions::HierarchicalLagrangeNode::finiteElement\n-const FiniteElement & finiteElement() const\n-Return the LocalFiniteElement for the element we are bound to.\n-Definition: hierarchicallagrangebasis.hh:202\n-Dune::Functions::HierarchicalLagrangeNode::element_\n-const Element * element_\n-Definition: hierarchicallagrangebasis.hh:227\n-Dune::Functions::HierarchicalLagrangeNode::finiteElement_\n-const FiniteElement finiteElement_\n-Definition: hierarchicallagrangebasis.hh:226\n-Dune::Functions::HierarchicalLagrangeNode::order\n-unsigned int order() const\n-Definition: hierarchicallagrangebasis.hh:221\n-Dune::Functions::HierarchicalLagrangeNode::HierarchicalLagrangeNode\n-HierarchicalLagrangeNode()\n-Definition: hierarchicallagrangebasis.hh:187\n-Dune::Functions::HierarchicalLagrangeNode::size_type\n-std::size_t size_type\n-Definition: hierarchicallagrangebasis.hh:183\n-Dune::Functions::HierarchicalLagrangeNode::Element\n+Definition: lagrangebasis.hh:454\n+Dune::Functions::LagrangeNode::Element\n typename GV::template Codim< 0 >::Entity Element\n-Definition: hierarchicallagrangebasis.hh:184\n-Dune::Functions::HierarchicalLagrangePreBasis\n-A pre-basis for a hierarchical basis.\n-Definition: hierarchicallagrangebasis.hh:49\n-Dune::Functions::HierarchicalLagrangePreBasis::size_type\n+Definition: lagrangebasis.hh:418\n+Dune::Functions::LagrangeNode::finiteElement_\n+const FiniteElement * finiteElement_\n+Definition: lagrangebasis.hh:472\n+Dune::Functions::LagrangeNode::order_\n+unsigned int order_\n+Definition: lagrangebasis.hh:469\n+Dune::Functions::LagrangeNode::size_type\n+std::size_t size_type\n+Definition: lagrangebasis.hh:417\n+Dune::Functions::LagrangeNode::LagrangeNode\n+LagrangeNode()\n+Constructor without order (uses the compile-time value)\n+Definition: lagrangebasis.hh:422\n+Dune::Functions::LagrangePreBasis\n+A pre-basis for a PQ-lagrange bases with given order.\n+Definition: lagrangebasis.hh:55\n+Dune::Functions::LagrangePreBasis::dofsPerPrism\n+size_type dofsPerPrism() const\n+Definition: lagrangebasis.hh:333\n+Dune::Functions::LagrangePreBasis::computeDofsPerCube\n+size_type computeDofsPerCube(std::size_t cubeDim) const\n+Number of degrees of freedom assigned to a cube (without the ones assigned to\n+its faces!...\n+Definition: lagrangebasis.hh:350\n+Dune::Functions::LagrangePreBasis::computeDofsPerSimplex\n+size_type computeDofsPerSimplex(std::size_t simplexDim) const\n+Number of degrees of freedom assigned to a simplex (without the ones assigned\n+to its faces!...\n+Definition: lagrangebasis.hh:344\n+Dune::Functions::LagrangePreBasis::maxMultiIndexSize\n+static constexpr size_type maxMultiIndexSize\n+Definition: lagrangebasis.hh:70\n+Dune::Functions::LagrangePreBasis::computeDofsPerPrism\n+size_type computeDofsPerPrism() const\n+Definition: lagrangebasis.hh:355\n+Dune::Functions::LagrangePreBasis::edgeOffset_\n+size_type edgeOffset_\n+Definition: lagrangebasis.hh:372\n+Dune::Functions::LagrangePreBasis::dofsPerSimplex_\n+std::array< size_type, dim+1 > dofsPerSimplex_\n+Definition: lagrangebasis.hh:366\n+Dune::Functions::LagrangePreBasis::indices\n+It indices(const Node &node, It it) const\n+Definition: lagrangebasis.hh:192\n+Dune::Functions::LagrangePreBasis::vertexOffset_\n+size_type vertexOffset_\n+Definition: lagrangebasis.hh:371\n+Dune::Functions::LagrangePreBasis::dofsPerSimplex\n+size_type dofsPerSimplex(std::size_t simplexDim) const\n+Number of degrees of freedom assigned to a simplex (without the ones assigned\n+to its faces!...\n+Definition: lagrangebasis.hh:322\n+Dune::Functions::LagrangePreBasis::size_type\n std::size_t size_type\n Type used for indices and size information.\n-Definition: hierarchicallagrangebasis.hh:58\n-Dune::Functions::HierarchicalLagrangePreBasis::order\n-unsigned int order() const\n-Definition: hierarchicallagrangebasis.hh:145\n-Dune::Functions::HierarchicalLagrangePreBasis::makeNode\n-Node makeNode() const\n-Create tree node.\n-Definition: hierarchicallagrangebasis.hh:94\n-Dune::Functions::HierarchicalLagrangePreBasis::maxNodeSize\n-size_type maxNodeSize() const\n-Get the maximal number of DOFs associated to node for any element.\n-Definition: hierarchicallagrangebasis.hh:123\n-Dune::Functions::HierarchicalLagrangePreBasis::multiIndexBufferSize\n-static constexpr size_type multiIndexBufferSize\n-Definition: hierarchicallagrangebasis.hh:65\n-Dune::Functions::HierarchicalLagrangePreBasis::update\n-void update(const GridView &gv)\n-Update the stored grid view & MultipleCodimMultipleGeomTypeMapper, to be called\n-if the grid has chang...\n-Definition: hierarchicallagrangebasis.hh:85\n-Dune::Functions::HierarchicalLagrangePreBasis::mcmgMapper_\n-MultipleCodimMultipleGeomTypeMapper< GridView > mcmgMapper_\n-Definition: hierarchicallagrangebasis.hh:150\n-Dune::Functions::HierarchicalLagrangePreBasis::dimension\n+Definition: lagrangebasis.hh:65\n+Dune::Functions::LagrangePreBasis::pyramidOffset_\n+size_type pyramidOffset_\n+Definition: lagrangebasis.hh:376\n+Dune::Functions::LagrangePreBasis::prismOffset_\n+size_type prismOffset_\n+Definition: lagrangebasis.hh:377\n+Dune::Functions::LagrangePreBasis::tetrahedronOffset_\n+size_type tetrahedronOffset_\n+Definition: lagrangebasis.hh:375\n+Dune::Functions::LagrangePreBasis::initializeIndices\n+void initializeIndices()\n+Initialize the global indices.\n+Definition: lagrangebasis.hh:96\n+Dune::Functions::LagrangePreBasis::computeDofsPerPyramid\n+size_type computeDofsPerPyramid() const\n+Definition: lagrangebasis.hh:360\n+Dune::Functions::LagrangePreBasis::LagrangePreBasis\n+LagrangePreBasis(const GridView &gv, unsigned int order)\n+Constructor for a given grid view object and run-time order.\n+Definition: lagrangebasis.hh:80\n+Dune::Functions::LagrangePreBasis::dofsPerPyramid_\n+size_type dofsPerPyramid_\n+Definition: lagrangebasis.hh:369\n+Dune::Functions::LagrangePreBasis::dimension\n size_type dimension() const\n Get the total dimension of the space spanned by this basis.\n-Definition: hierarchicallagrangebasis.hh:114\n-Dune::Functions::HierarchicalLagrangePreBasis::GridView\n+Definition: lagrangebasis.hh:178\n+Dune::Functions::LagrangePreBasis::LagrangePreBasis\n+LagrangePreBasis(const GridView &gv)\n+Constructor for a given grid view object with compile-time order.\n+Definition: lagrangebasis.hh:75\n+Dune::Functions::LagrangePreBasis::update\n+void update(const GridView &gv)\n+Update the stored grid view, to be called if the grid has changed.\n+Definition: lagrangebasis.hh:126\n+Dune::Functions::LagrangePreBasis::size\n+size_type size(const SizePrefix &prefix) const\n+Return number of possible values for next position in multi index.\n+Definition: lagrangebasis.hh:171\n+Dune::Functions::LagrangePreBasis::multiIndexBufferSize\n+static constexpr size_type multiIndexBufferSize\n+Definition: lagrangebasis.hh:72\n+Dune::Functions::LagrangePreBasis::GridView\n GV GridView\n The grid view that the FE basis is defined on.\n-Definition: hierarchicallagrangebasis.hh:55\n-Dune::Functions::HierarchicalLagrangePreBasis::HierarchicalLagrangePreBasis\n-HierarchicalLagrangePreBasis(const GridView &gv)\n-Constructor for a given grid view object with layout for second order.\n-Definition: hierarchicallagrangebasis.hh:71\n-Dune::Functions::HierarchicalLagrangePreBasis::maxMultiIndexSize\n-static constexpr size_type maxMultiIndexSize\n-Definition: hierarchicallagrangebasis.hh:63\n-Dune::Functions::HierarchicalLagrangePreBasis::size\n-size_type size(const SizePrefix prefix) const\n-Return number of possible values for next position in multi index.\n-Definition: hierarchicallagrangebasis.hh:107\n-Dune::Functions::HierarchicalLagrangePreBasis::gridView\n+Definition: lagrangebasis.hh:62\n+Dune::Functions::LagrangePreBasis::quadrilateralOffset_\n+size_type quadrilateralOffset_\n+Definition: lagrangebasis.hh:374\n+Dune::Functions::LagrangePreBasis::gridView\n const GridView & gridView() const\n Obtain the grid view that the basis is defined on.\n-Definition: hierarchicallagrangebasis.hh:79\n-Dune::Functions::HierarchicalLagrangePreBasis::gridView_\n+Definition: lagrangebasis.hh:120\n+Dune::Functions::LagrangePreBasis::gridView_\n GridView gridView_\n-Definition: hierarchicallagrangebasis.hh:143\n-Dune::Functions::HierarchicalLagrangePreBasis::size\n+Definition: lagrangebasis.hh:316\n+Dune::Functions::LagrangePreBasis::makeNode\n+Node makeNode() const\n+Create tree node.\n+Definition: lagrangebasis.hh:134\n+Dune::Functions::LagrangePreBasis::order\n+unsigned int order() const\n+Polynomial order used in the local Lagrange finite-elements.\n+Definition: lagrangebasis.hh:310\n+Dune::Functions::LagrangePreBasis::order_\n+const unsigned int order_\n+Definition: lagrangebasis.hh:319\n+Dune::Functions::LagrangePreBasis::dofsPerCube_\n+std::array< size_type, dim+1 > dofsPerCube_\n+Definition: lagrangebasis.hh:367\n+Dune::Functions::LagrangePreBasis::maxNodeSize\n+size_type maxNodeSize() const\n+Get the maximal number of DOFs associated to node for any element.\n+Definition: lagrangebasis.hh:184\n+Dune::Functions::LagrangePreBasis::size\n size_type size() const\n Same as size(prefix) with empty prefix.\n-Definition: hierarchicallagrangebasis.hh:100\n-Dune::Functions::HierarchicalLagrangePreBasis::initializeIndices\n-void initializeIndices()\n-Initialize the global indices.\n-Definition: hierarchicallagrangebasis.hh:75\n-Dune::Functions::HierarchicalLagrangePreBasis::indices\n-It indices(const Node &node, It it) const\n-Definition: hierarchicallagrangebasis.hh:130\n-Dune::Functions::HierarchicalLagrangePreBasis::minMultiIndexSize\n+Definition: lagrangebasis.hh:140\n+Dune::Functions::LagrangePreBasis::dofsPerPrism_\n+size_type dofsPerPrism_\n+Definition: lagrangebasis.hh:368\n+Dune::Functions::LagrangePreBasis::dofsPerCube\n+size_type dofsPerCube(std::size_t cubeDim) const\n+Number of degrees of freedom assigned to a cube (without the ones assigned to\n+its faces!...\n+Definition: lagrangebasis.hh:328\n+Dune::Functions::LagrangePreBasis::triangleOffset_\n+size_type triangleOffset_\n+Definition: lagrangebasis.hh:373\n+Dune::Functions::LagrangePreBasis::hexahedronOffset_\n+size_type hexahedronOffset_\n+Definition: lagrangebasis.hh:378\n+Dune::Functions::LagrangePreBasis::minMultiIndexSize\n static constexpr size_type minMultiIndexSize\n-Definition: hierarchicallagrangebasis.hh:64\n+Definition: lagrangebasis.hh:71\n+Dune::Functions::LagrangePreBasis::dofsPerPyramid\n+size_type dofsPerPyramid() const\n+Definition: lagrangebasis.hh:338\n Dune::Functions::BasisNodeMixin::setSize\n void setSize(const size_type size)\n Definition: nodes.hh:164\n Dune::Functions::LeafBasisNode\n Definition: nodes.hh:186\n \n ===============================================================================\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00122.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00122.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: subspacelocalview.hh File Reference\n+dune-functions: flatmultiindex.hh File Reference\n \n \n \n \n \n \n \n@@ -63,38 +63,37 @@\n \n \n
    \n \n-
    subspacelocalview.hh File Reference
    \n+Namespaces |\n+Typedefs
    \n+
    flatmultiindex.hh File Reference
    \n \n
    \n-
    #include <tuple>
    \n-#include <dune/common/concept.hh>
    \n-#include <dune/typetree/childextraction.hh>
    \n-#include <dune/functions/functionspacebases/concepts.hh>
    \n+
    #include <array>
    \n+#include <dune/functions/common/multiindex.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n-\n-\n-\n-\n-

    \n-Classes

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n+\n+\n+\n+\n+\n

    \n+Typedefs

    template<class size_type >
    using Dune::Functions::FlatMultiIndex = StaticMultiIndex< size_type, 1 >
     A multi-index class with only one level. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,26 +5,25 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-Classes | Namespaces\n-subspacelocalview.hh File Reference\n-#include \n-#include \n-#include \n-#include \n+Namespaces | Typedefs\n+flatmultiindex.hh File Reference\n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n- Classes\n-class \u00a0Dune::Functions::SubspaceLocalView<_RLV,_PP_>\n-\u00a0 The restriction of a finite element basis to a single element. More...\n-\u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n+ Typedefs\n+template\n+using\u00a0Dune::Functions::FlatMultiIndex = StaticMultiIndex< size_type, 1 >\n+\u00a0 A multi-index class with only one level. More...\n+\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00122_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00122_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: subspacelocalview.hh Source File\n+dune-functions: flatmultiindex.hh Source File\n \n \n \n \n \n \n \n@@ -62,163 +62,43 @@\n \n \n
    \n
    \n-
    subspacelocalview.hh
    \n+
    flatmultiindex.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH
    \n
    5
    \n-
    6
    \n-
    7#include <tuple>
    \n-
    8
    \n-
    9#include <dune/common/concept.hh>
    \n-
    10
    \n-
    11#include <dune/typetree/childextraction.hh>
    \n+
    6#include <array>
    \n+
    7
    \n+\n+
    9
    \n+
    10namespace Dune {
    \n+
    11namespace Functions {
    \n
    12
    \n-\n+
    13
    \n
    14
    \n-
    15
    \n-
    16
    \n-
    17namespace Dune {
    \n-
    18namespace Functions {
    \n-
    19
    \n-
    20
    \n-
    21
    \n-
    22template<class RB, class PP>
    \n-
    23class SubspaceBasis;
    \n-
    24
    \n-
    25
    \n-
    26
    \n-
    28template<class RLV, class PP>
    \n-\n-
    30{
    \n-
    31 using PrefixPath = PP;
    \n+
    30template<class size_type>
    \n+\n
    32
    \n-
    33public:
    \n+
    33
    \n
    34
    \n-
    35 using RootLocalView = RLV;
    \n-
    36
    \n-\n-
    39
    \n-\n-
    42
    \n-
    44 using Element = typename GridView::template Codim<0>::Entity;
    \n-
    45
    \n-
    47 using size_type = std::size_t;
    \n-
    48
    \n-
    50 using RootTree = typename RootLocalView::Tree;
    \n-
    51
    \n-
    53 using Tree = typename TypeTree::ChildForTreePath<RootTree, PrefixPath>;
    \n-
    54
    \n-
    56 using MultiIndex = typename RootLocalView::MultiIndex;
    \n-
    57
    \n-
    59 SubspaceLocalView(const GlobalBasis& globalBasis, const PrefixPath& /*prefixPath*/) :
    \n-\n-
    61 rootLocalView_(globalBasis.rootBasis().localView())
    \n-
    62 {
    \n-
    63// static_assert(models<Concept::BasisTree<GridView>, Tree>(), "Tree type passed to SubspaceLocalView does not model the BasisNode concept.");
    \n-
    64 }
    \n-
    65
    \n-
    71 void bind(const Element& e)
    \n-
    72 {
    \n-
    73 rootLocalView_.bind(e);
    \n-
    74 }
    \n-
    75
    \n-
    80 const Element& element() const
    \n-
    81 {
    \n-
    82 return rootLocalView_.element();
    \n-
    83 }
    \n-
    84
    \n-
    89 void unbind()
    \n-
    90 {
    \n-
    91 rootLocalView_.unbind();
    \n-
    92 }
    \n-
    93
    \n-
    96 bool bound() const
    \n-
    97 {
    \n-
    98 return rootLocalView_.bound();
    \n-
    99 }
    \n-
    100
    \n-
    105 const Tree& tree() const
    \n-
    106 {
    \n-
    107 return TypeTree::child(rootLocalView_.tree(), globalBasis_->prefixPath());
    \n-
    108 }
    \n-
    109
    \n-\n-
    113 {
    \n-
    114 return rootLocalView_.size();
    \n-
    115 }
    \n-
    116
    \n-\n-
    124 {
    \n-
    125 return rootLocalView_.maxSize();
    \n-
    126 }
    \n-
    127
    \n-\n-
    130 {
    \n-
    131 return rootLocalView_.index(i);
    \n-
    132 }
    \n-
    133
    \n-\n-
    137 {
    \n-
    138 return *globalBasis_;
    \n-
    139 }
    \n-
    140
    \n-\n-
    142 {
    \n-
    143 return rootLocalView_;
    \n-
    144 }
    \n-
    145
    \n-
    146protected:
    \n-\n-\n-
    149};
    \n-
    150
    \n-
    151
    \n-
    152
    \n-
    153} // end namespace Functions
    \n-
    154} // end namespace Dune
    \n-
    155
    \n-
    156
    \n-
    157
    \n-
    158#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH
    \n+
    35} // end namespace Functions
    \n+
    36} // end namespace Dune
    \n+
    37
    \n+
    38#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH
    \n+\n
    Definition: polynomial.hh:10
    \n-
    SubspaceBasis(const RB &, const TP) -> SubspaceBasis< RB, TP >
    \n-
    Definition: subspacebasis.hh:38
    \n-
    typename RootBasis::GridView GridView
    The grid view that the FE space is defined on.
    Definition: subspacebasis.hh:48
    \n-
    const PrefixPath & prefixPath() const
    Definition: subspacebasis.hh:118
    \n-
    The restriction of a finite element basis to a single element.
    Definition: subspacelocalview.hh:30
    \n-
    typename TypeTree::ChildForTreePath< RootTree, PrefixPath > Tree
    Tree of local finite elements / local shape function sets.
    Definition: subspacelocalview.hh:53
    \n-
    void unbind()
    Unbind from the current element.
    Definition: subspacelocalview.hh:89
    \n-
    const Element & element() const
    Return the grid element that the view is bound to.
    Definition: subspacelocalview.hh:80
    \n-
    const GlobalBasis * globalBasis_
    Definition: subspacelocalview.hh:147
    \n-
    bool bound() const
    Return if the view is bound to a grid element.
    Definition: subspacelocalview.hh:96
    \n-
    typename RootLocalView::MultiIndex MultiIndex
    Type used for global numbering of the basis vectors.
    Definition: subspacelocalview.hh:56
    \n-
    size_type size() const
    Total number of degrees of freedom on this element.
    Definition: subspacelocalview.hh:112
    \n-
    RootLocalView rootLocalView_
    Definition: subspacelocalview.hh:148
    \n-
    void bind(const Element &e)
    Bind the view to a grid element.
    Definition: subspacelocalview.hh:71
    \n-
    typename GlobalBasis::GridView GridView
    The grid view the global FE basis lives on.
    Definition: subspacelocalview.hh:41
    \n-
    SubspaceLocalView(const GlobalBasis &globalBasis, const PrefixPath &)
    Construct local view for a given global finite element basis.
    Definition: subspacelocalview.hh:59
    \n-
    RLV RootLocalView
    Definition: subspacelocalview.hh:35
    \n-
    const RootLocalView & rootLocalView() const
    Definition: subspacelocalview.hh:141
    \n-
    std::size_t size_type
    The type used for sizes.
    Definition: subspacelocalview.hh:47
    \n-
    typename GridView::template Codim< 0 >::Entity Element
    Type of the grid element we are bound to.
    Definition: subspacelocalview.hh:44
    \n-
    const GlobalBasis & globalBasis() const
    Return the global basis that we are a view on.
    Definition: subspacelocalview.hh:136
    \n-
    size_type maxSize() const
    Maximum local size for any element on the GridView.
    Definition: subspacelocalview.hh:123
    \n-
    const Tree & tree() const
    Return the local ansatz tree associated to the bound entity.
    Definition: subspacelocalview.hh:105
    \n-
    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
    \n-
    typename RootLocalView::Tree RootTree
    Tree of local finite elements / local shape function sets.
    Definition: subspacelocalview.hh:50
    \n-\n+
    A statically sized MultiIndex type.
    Definition: multiindex.hh:49
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,228 +5,41 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-subspacelocalview.hh\n+flatmultiindex.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH\n 5\n- 6\n- 7#include \n- 8\n- 9#include \n- 10\n- 11#include \n+ 6#include \n+ 7\n+ 8#include \n+ 9\n+ 10namespace Dune {\n+ 11namespace Functions {\n 12\n- 13#include \n+ 13\n 14\n- 15\n- 16\n- 17namespace Dune {\n- 18namespace Functions {\n- 19\n- 20\n- 21\n- 22template\n- 23class SubspaceBasis;\n- 24\n- 25\n- 26\n- 28template\n-29class SubspaceLocalView\n- 30{\n- 31 using PrefixPath = PP;\n+ 30template\n+31using FlatMultiIndex = StaticMultiIndex;\n 32\n- 33public:\n+ 33\n 34\n-35 using RootLocalView = RLV;\n- 36\n-38 using GlobalBasis = SubspaceBasis;\n- 39\n-41 using GridView = typename GlobalBasis::GridView;\n- 42\n-44 using Element = typename GridView::template Codim<0>::Entity;\n- 45\n-47 using size_type = std::size_t;\n- 48\n-50 using RootTree = typename RootLocalView::Tree;\n- 51\n-53 using Tree = typename TypeTree::ChildForTreePath;\n- 54\n-56 using MultiIndex = typename RootLocalView::MultiIndex;\n- 57\n-59 SubspaceLocalView(const GlobalBasis& globalBasis, const PrefixPath& /\n-*prefixPath*/) :\n- 60 globalBasis_(&globalBasis),\n- 61 rootLocalView_(globalBasis.rootBasis().localView())\n- 62 {\n- 63// static_assert(models, Tree>(), \"Tree type\n-passed to SubspaceLocalView does not model the BasisNode concept.\");\n- 64 }\n- 65\n-71 void bind(const Element& e)\n- 72 {\n- 73 rootLocalView_.bind(e);\n- 74 }\n- 75\n-80 const Element& element() const\n- 81 {\n- 82 return rootLocalView_.element();\n- 83 }\n- 84\n-89 void unbind()\n- 90 {\n- 91 rootLocalView_.unbind();\n- 92 }\n- 93\n-96 bool bound() const\n- 97 {\n- 98 return rootLocalView_.bound();\n- 99 }\n- 100\n-105 const Tree& tree() const\n- 106 {\n- 107 return TypeTree::child(rootLocalView_.tree(), globalBasis_->prefixPath());\n- 108 }\n- 109\n-112 size_type size() const\n- 113 {\n- 114 return rootLocalView_.size();\n- 115 }\n- 116\n-123 size_type maxSize() const\n- 124 {\n- 125 return rootLocalView_.maxSize();\n- 126 }\n- 127\n-129 MultiIndex index(size_type i) const\n- 130 {\n- 131 return rootLocalView_.index(i);\n- 132 }\n- 133\n-136 const GlobalBasis& globalBasis() const\n- 137 {\n- 138 return *globalBasis_;\n- 139 }\n- 140\n-141 const RootLocalView& rootLocalView() const\n- 142 {\n- 143 return rootLocalView_;\n- 144 }\n- 145\n- 146protected:\n-147 const GlobalBasis* globalBasis_;\n-148 RootLocalView rootLocalView_;\n- 149};\n- 150\n- 151\n- 152\n- 153} // end namespace Functions\n- 154} // end namespace Dune\n- 155\n- 156\n- 157\n- 158#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACELOCALVIEW_HH\n+ 35} // end namespace Functions\n+ 36} // end namespace Dune\n+ 37\n+ 38#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATMULTIINDEX_HH\n+multiindex.hh\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::SubspaceBasis\n-SubspaceBasis(const RB &, const TP) -> SubspaceBasis< RB, TP >\n-Dune::Functions::SubspaceBasis\n-Definition: subspacebasis.hh:38\n-Dune::Functions::SubspaceBasis::GridView\n-typename RootBasis::GridView GridView\n-The grid view that the FE space is defined on.\n-Definition: subspacebasis.hh:48\n-Dune::Functions::SubspaceBasis::prefixPath\n-const PrefixPath & prefixPath() const\n-Definition: subspacebasis.hh:118\n-Dune::Functions::SubspaceLocalView\n-The restriction of a finite element basis to a single element.\n-Definition: subspacelocalview.hh:30\n-Dune::Functions::SubspaceLocalView::Tree\n-typename TypeTree::ChildForTreePath< RootTree, PrefixPath > Tree\n-Tree of local finite elements / local shape function sets.\n-Definition: subspacelocalview.hh:53\n-Dune::Functions::SubspaceLocalView::unbind\n-void unbind()\n-Unbind from the current element.\n-Definition: subspacelocalview.hh:89\n-Dune::Functions::SubspaceLocalView::element\n-const Element & element() const\n-Return the grid element that the view is bound to.\n-Definition: subspacelocalview.hh:80\n-Dune::Functions::SubspaceLocalView::globalBasis_\n-const GlobalBasis * globalBasis_\n-Definition: subspacelocalview.hh:147\n-Dune::Functions::SubspaceLocalView::bound\n-bool bound() const\n-Return if the view is bound to a grid element.\n-Definition: subspacelocalview.hh:96\n-Dune::Functions::SubspaceLocalView::MultiIndex\n-typename RootLocalView::MultiIndex MultiIndex\n-Type used for global numbering of the basis vectors.\n-Definition: subspacelocalview.hh:56\n-Dune::Functions::SubspaceLocalView::size\n-size_type size() const\n-Total number of degrees of freedom on this element.\n-Definition: subspacelocalview.hh:112\n-Dune::Functions::SubspaceLocalView::rootLocalView_\n-RootLocalView rootLocalView_\n-Definition: subspacelocalview.hh:148\n-Dune::Functions::SubspaceLocalView::bind\n-void bind(const Element &e)\n-Bind the view to a grid element.\n-Definition: subspacelocalview.hh:71\n-Dune::Functions::SubspaceLocalView::GridView\n-typename GlobalBasis::GridView GridView\n-The grid view the global FE basis lives on.\n-Definition: subspacelocalview.hh:41\n-Dune::Functions::SubspaceLocalView::SubspaceLocalView\n-SubspaceLocalView(const GlobalBasis &globalBasis, const PrefixPath &)\n-Construct local view for a given global finite element basis.\n-Definition: subspacelocalview.hh:59\n-Dune::Functions::SubspaceLocalView::RootLocalView\n-RLV RootLocalView\n-Definition: subspacelocalview.hh:35\n-Dune::Functions::SubspaceLocalView::rootLocalView\n-const RootLocalView & rootLocalView() const\n-Definition: subspacelocalview.hh:141\n-Dune::Functions::SubspaceLocalView::size_type\n-std::size_t size_type\n-The type used for sizes.\n-Definition: subspacelocalview.hh:47\n-Dune::Functions::SubspaceLocalView::Element\n-typename GridView::template Codim< 0 >::Entity Element\n-Type of the grid element we are bound to.\n-Definition: subspacelocalview.hh:44\n-Dune::Functions::SubspaceLocalView::globalBasis\n-const GlobalBasis & globalBasis() const\n-Return the global basis that we are a view on.\n-Definition: subspacelocalview.hh:136\n-Dune::Functions::SubspaceLocalView::maxSize\n-size_type maxSize() const\n-Maximum local size for any element on the GridView.\n-Definition: subspacelocalview.hh:123\n-Dune::Functions::SubspaceLocalView::tree\n-const Tree & tree() const\n-Return the local ansatz tree associated to the bound entity.\n-Definition: subspacelocalview.hh:105\n-Dune::Functions::SubspaceLocalView::index\n-MultiIndex index(size_type i) const\n-Maps from subtree index set [0..size-1] to a globally unique multi index in\n-global basis.\n-Definition: subspacelocalview.hh:129\n-Dune::Functions::SubspaceLocalView::RootTree\n-typename RootLocalView::Tree RootTree\n-Tree of local finite elements / local shape function sets.\n-Definition: subspacelocalview.hh:50\n-concepts.hh\n+Dune::Functions::StaticMultiIndex<_size_type,_1_>\n+A statically sized MultiIndex type.\n+Definition: multiindex.hh:49\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00125.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00125.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: taylorhoodbasis.hh File Reference\n+dune-functions: compositebasis.hh File Reference\n \n \n \n \n \n \n \n@@ -65,61 +65,59 @@\n
  • dune
  • functions
  • functionspacebases
  • \n \n \n
    \n \n-
    taylorhoodbasis.hh File Reference
    \n+
    compositebasis.hh File Reference
    \n
    \n
    \n-
    #include <dune/common/exceptions.hh>
    \n+
    #include <tuple>
    \n+#include <utility>
    \n+#include <dune/common/std/apply.hh>
    \n+#include <dune/common/hybridutilities.hh>
    \n #include <dune/common/reservedvector.hh>
    \n-#include <dune/common/indices.hh>
    \n-#include <dune/typetree/powernode.hh>
    \n-#include <dune/typetree/compositenode.hh>
    \n-#include <dune/functions/functionspacebases/nodes.hh>
    \n-#include <dune/functions/functionspacebases/lagrangebasis.hh>
    \n-#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
    \n+#include <dune/common/typeutilities.hh>
    \n+#include <dune/common/tupleutility.hh>
    \n+#include <dune/common/tuplevector.hh>
    \n+#include <dune/functions/common/staticforloop.hh>
    \n+#include <dune/functions/common/type_traits.hh>
    \n+#include <dune/functions/common/utility.hh>
    \n+#include <dune/functions/functionspacebases/basistags.hh>
    \n+#include <dune/functions/functionspacebases/nodes.hh>
    \n+#include <dune/functions/functionspacebases/concepts.hh>
    \n+#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n-\n-\n-\n-\n+\n+\n \n

    \n 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::CompositePreBasis< IMS, SPB >
     A pre-basis for composite bases. More...
     
    \n \n \n \n \n \n \n \n-

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    namespace  Dune::Functions::BasisFactory
     
    \n-\n-\n-\n-\n-\n+\n+\n

    \n-Typedefs

    template<typename GV >
    using Dune::Functions::TaylorHoodBasis = DefaultGlobalBasis< TaylorHoodPreBasis< GV > >
     Nodal basis for a lowest order Taylor-Hood Lagrangean finite element space. More...
     
    namespace  Dune::Functions::BasisBuilder
     
    \n \n-\n-\n-\n+\n+\n+\n+\n

    \n Functions

    auto Dune::Functions::BasisFactory::taylorHood ()
     Create a pre-basis factory that can create a Taylor-Hood pre-basis. More...
     
    template<typename... Args, std::enable_if_t< Concept::isIndexMergingStrategy< typename LastType< Args... >::type >(), int > = 0>
    auto Dune::Functions::BasisFactory::composite (Args &&... args)
     Create a factory builder that can build a CompositePreBasis. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,48 +5,47 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-Classes | Namespaces | Typedefs | Functions\n-taylorhoodbasis.hh File Reference\n-#include \n+Classes | Namespaces | Functions\n+compositebasis.hh File Reference\n+#include \n+#include \n+#include \n+#include \n #include \n-#include \n-#include \n-#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n #include \n-#include \n+#include \n #include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::TaylorHoodPreBasis<_GV,_HI_>\n-\u00a0 Pre-basis for lowest order Taylor-Hood basis. More...\n-\u00a0\n-class \u00a0Dune::Functions::TaylorHoodVelocityTree<_GV_>\n-\u00a0\n-class \u00a0Dune::Functions::TaylorHoodBasisTree<_GV_>\n+class \u00a0Dune::Functions::CompositePreBasis<_IMS,_SPB_>\n+\u00a0 A pre-basis for composite bases. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n namespace \u00a0Dune::Functions::BasisFactory\n \u00a0\n- Typedefs\n-template\n-using\u00a0Dune::Functions::TaylorHoodBasis = DefaultGlobalBasis<\n- TaylorHoodPreBasis< GV > >\n-\u00a0 Nodal basis for a lowest order Taylor-Hood Lagrangean finite element\n- space. More...\n+namespace \u00a0Dune::Functions::BasisBuilder\n \u00a0\n Functions\n-auto\u00a0Dune::Functions::BasisFactory::taylorHood ()\n-\u00a0 Create a pre-basis factory that can create a Taylor-Hood pre-basis.\n- More...\n+template::type >(), int > = 0>\n+auto\u00a0Dune::Functions::BasisFactory::composite (Args &&... args)\n+\u00a0 Create a factory builder that can build a CompositePreBasis. More...\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00125_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00125_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: taylorhoodbasis.hh Source File\n+dune-functions: compositebasis.hh Source File\n \n \n \n \n \n \n \n@@ -62,352 +62,423 @@\n \n \n
    \n
    \n-
    taylorhoodbasis.hh
    \n+
    compositebasis.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH
    \n
    5
    \n-
    6#include <dune/common/exceptions.hh>
    \n-
    7#include <dune/common/reservedvector.hh>
    \n-
    8#include <dune/common/indices.hh>
    \n-
    9
    \n-
    10#include <dune/typetree/powernode.hh>
    \n-
    11#include <dune/typetree/compositenode.hh>
    \n-
    12
    \n-\n-
    14
    \n-\n-\n-
    17
    \n-
    18namespace Dune {
    \n-
    19namespace Functions {
    \n-
    20
    \n-
    21
    \n-
    22// *****************************************************************************
    \n-
    23// This is the reusable part of the basis. It contains
    \n-
    24//
    \n-
    25// TaylorHoodPreBasis
    \n-
    26// TaylorHoodBasisTree
    \n-
    27// TaylorHoodVelocityTree
    \n-
    28//
    \n-
    29// The pre-basis allows to create the others and is the owner of possible shared
    \n-
    30// state. These components do _not_ depend on the global basis and local view
    \n-
    31// and can be used without a global basis.
    \n-
    32// *****************************************************************************
    \n-
    33
    \n-
    34template<typename GV>
    \n-
    35class TaylorHoodVelocityTree;
    \n-
    36
    \n-
    37template<typename GV>
    \n-
    38class TaylorHoodBasisTree;
    \n+
    6#include <tuple>
    \n+
    7#include <utility>
    \n+
    8
    \n+
    9#include <dune/common/std/apply.hh>
    \n+
    10#include <dune/common/hybridutilities.hh>
    \n+
    11#include <dune/common/reservedvector.hh>
    \n+
    12#include <dune/common/typeutilities.hh>
    \n+
    13#include <dune/common/hybridutilities.hh>
    \n+
    14#include <dune/common/tupleutility.hh>
    \n+
    15#include <dune/common/tuplevector.hh>
    \n+
    16
    \n+\n+\n+\n+\n+\n+\n+\n+
    24
    \n+
    25
    \n+
    26namespace Dune {
    \n+
    27namespace Functions {
    \n+
    28
    \n+
    29// *****************************************************************************
    \n+
    30// This is the reusable part of the composite bases. It contains
    \n+
    31//
    \n+
    32// CompositePreBasis
    \n+
    33//
    \n+
    34// The pre-basis allows to create the others and is the owner of possible shared
    \n+
    35// state. These components do _not_ depend on the global basis and local view
    \n+
    36// and can be used without a global basis.
    \n+
    37// *****************************************************************************
    \n+
    38
    \n
    39
    \n-
    59template<typename GV, bool HI=false>
    \n-\n-
    61{
    \n-
    62 static const bool useHybridIndices = HI;
    \n+
    51template<class IMS, class... SPB>
    \n+\n+
    53{
    \n+
    54 static const bool isBlocked = std::is_same_v<IMS,BasisFactory::BlockedLexicographic> or std::is_same_v<IMS,BasisFactory::BlockedInterleaved>;
    \n+
    55public:
    \n+
    56
    \n+
    58 using SubPreBases = std::tuple<SPB...>;
    \n+
    59
    \n+
    61 template<std::size_t i>
    \n+
    62 using SubPreBasis = std::tuple_element_t<i, SubPreBases>;
    \n
    63
    \n-
    64 static const int dim = GV::dimension;
    \n-
    65
    \n-
    66public:
    \n-
    67
    \n-
    69 using GridView = GV;
    \n-
    70
    \n-
    72 using size_type = std::size_t;
    \n-
    73
    \n-\n-
    76
    \n-
    77 static constexpr size_type maxMultiIndexSize = useHybridIndices ? 3 : 2;
    \n-
    78 static constexpr size_type minMultiIndexSize = 2;
    \n-\n-
    80
    \n-
    81private:
    \n+
    65 using GridView = typename std::tuple_element_t<0, SubPreBases>::GridView;
    \n+
    66
    \n+
    68 using size_type = std::size_t;
    \n+
    69
    \n+\n+
    72
    \n+
    73protected:
    \n+
    74 static const std::size_t children = sizeof...(SPB);
    \n+
    75
    \n+
    76 using ChildIndices = std::make_index_sequence<children>;
    \n+
    77
    \n+
    78public:
    \n+
    79
    \n+
    81 using Node = CompositeBasisNode<typename SPB::Node...>;
    \n
    82
    \n-\n-\n-
    85
    \n-
    86public:
    \n-
    87
    \n-\n-
    90 gridView_(gv),
    \n-
    91 pq1PreBasis_(gv),
    \n-
    92 pq2PreBasis_(gv)
    \n-
    93 {}
    \n-
    94
    \n-\n+
    83 static constexpr size_type maxMultiIndexSize = std::max({SPB::maxMultiIndexSize...}) + isBlocked;
    \n+
    84 static constexpr size_type minMultiIndexSize = std::min({SPB::minMultiIndexSize...}) + isBlocked;
    \n+
    85 static constexpr size_type multiIndexBufferSize = std::max({SPB::multiIndexBufferSize...}) + isBlocked;
    \n+
    86
    \n+
    92 template<class... SFArgs,
    \n+
    93 disableCopyMove<CompositePreBasis, SFArgs...> = 0,
    \n+
    94 enableIfConstructible<std::tuple<SPB...>, SFArgs...> = 0>
    \n+
    95 CompositePreBasis(SFArgs&&... sfArgs) :
    \n+
    96 subPreBases_(std::forward<SFArgs>(sfArgs)...)
    \n
    97 {
    \n-\n-\n-
    100 }
    \n-
    101
    \n-
    103 const GridView& gridView() const
    \n-
    104 {
    \n-
    105 return gridView_;
    \n-
    106 }
    \n-
    107
    \n-
    109 void update (const GridView& gv)
    \n-
    110 {
    \n-\n-\n-
    113 }
    \n-
    114
    \n-\n-
    119 {
    \n-
    120 return Node{};
    \n+
    98 Hybrid::forEach(subPreBases_, [&](const auto& subPreBasis){
    \n+
    99 static_assert(models<Concept::PreBasis<GridView>, std::decay_t<decltype(subPreBasis)>>(), "Subprebases passed to CompositePreBasis does not model the PreBasis concept.");
    \n+
    100 });
    \n+
    101 }
    \n+
    102
    \n+
    109 template<class GV,
    \n+
    110 std::enable_if_t<std::conjunction_v<
    \n+
    111 std::bool_constant<(children > 1)>, // Avoid ambiguous constructor if there's only one child
    \n+
    112 std::is_same<GV, GridView>,
    \n+
    113 std::is_constructible<SPB, GridView>...
    \n+
    114 >, int> = 0>
    \n+
    115 CompositePreBasis(const GV& gv) :
    \n+
    116 subPreBases_(SPB(gv)...)
    \n+
    117 {
    \n+
    118 Hybrid::forEach(subPreBases_, [&](const auto& subPreBasis){
    \n+
    119 static_assert(models<Concept::PreBasis<GridView>, std::decay_t<decltype(subPreBasis)>>(), "Subprebases passed to CompositePreBasis does not model the PreBasis concept.");
    \n+
    120 });
    \n
    121 }
    \n
    122
    \n-\n-
    125 {
    \n-
    126 return 2;
    \n-
    127 }
    \n-
    128
    \n-
    130 template<class SizePrefix>
    \n-
    131 size_type size(const SizePrefix& prefix) const
    \n-
    132 {
    \n-
    133 return sizeImp<useHybridIndices>(prefix);
    \n-
    134 }
    \n-
    135
    \n-
    136private:
    \n-
    137
    \n-
    138 template<bool hi, class SizePrefix,
    \n-
    139 typename std::enable_if<not hi,int>::type = 0>
    \n-
    140 size_type sizeImp(const SizePrefix& prefix) const
    \n-
    141 {
    \n-
    142 if (prefix.size() == 0)
    \n-
    143 return 2;
    \n-
    144 if (prefix.size() == 1)
    \n-
    145 {
    \n-
    146 if (prefix[0] == 0)
    \n-
    147 return dim * pq2PreBasis_.size();
    \n-
    148 if (prefix[0] == 1)
    \n-
    149 return pq1PreBasis_.size();
    \n-
    150 }
    \n-
    151 assert(prefix.size() == 2);
    \n-
    152 return 0;
    \n-
    153 }
    \n-
    154
    \n-
    155 template<bool hi, class SizePrefix,
    \n-
    156 typename std::enable_if<hi,int>::type = 0>
    \n-
    157 size_type sizeImp(const SizePrefix& prefix) const
    \n-
    158 {
    \n-
    159 if (prefix.size() == 0)
    \n-
    160 return 2;
    \n-
    161 if (prefix.size() == 1)
    \n-
    162 {
    \n-
    163 if (prefix[0] == 0)
    \n-
    164 return pq2PreBasis_.size();
    \n-
    165 if (prefix[0] == 1)
    \n-
    166 return pq1PreBasis_.size();
    \n-
    167 }
    \n-
    168 if (prefix.size() == 2)
    \n-
    169 {
    \n-
    170 if (prefix[0] == 0)
    \n-
    171 return dim;
    \n-
    172 if (prefix[0] == 1)
    \n-
    173 return 0;
    \n-
    174 }
    \n-
    175 assert(prefix.size() == 3);
    \n-
    176 return 0;
    \n-
    177 }
    \n-
    178
    \n-
    179public:
    \n-
    180
    \n-\n-
    183 {
    \n-
    184 return dim * pq2PreBasis_.size() + pq1PreBasis_.size();
    \n-
    185 }
    \n-
    186
    \n-\n-
    189 {
    \n-\n-
    191 }
    \n-
    192
    \n-
    193 template<typename It>
    \n-
    194 It indices(const Node& node, It it) const
    \n-
    195 {
    \n-
    196 return indicesImp<useHybridIndices>(node, it);
    \n-
    197 }
    \n-
    198
    \n-
    199protected:
    \n-
    200
    \n-
    201 template<class MultiIndex>
    \n-
    202 static const void multiIndexPushFront(MultiIndex& M, size_type M0)
    \n-
    203 {
    \n-
    204 M.resize(M.size()+1);
    \n-
    205 for(std::size_t i=M.size()-1; i>0; --i)
    \n-
    206 M[i] = M[i-1];
    \n-
    207 M[0] = M0;
    \n-
    208 }
    \n-
    209
    \n-
    210 template<bool hi, class It,
    \n-
    211 typename std::enable_if<not hi,int>::type = 0>
    \n-
    212 It indicesImp(const Node& node, It multiIndices) const
    \n-
    213 {
    \n-
    214 using namespace Dune::Indices;
    \n-
    215 for(std::size_t child=0; child<dim; ++child)
    \n-
    216 {
    \n-
    217 size_type subTreeSize = node.child(_0, 0).size();
    \n-
    218 pq2PreBasis_.indices(node.child(_0, 0), multiIndices);
    \n-
    219 for (std::size_t i = 0; i<subTreeSize; ++i)
    \n-
    220 {
    \n-
    221 multiIndexPushFront(multiIndices[i], 0);
    \n-
    222 multiIndices[i][1] = multiIndices[i][1]*dim + child;
    \n-
    223 }
    \n-
    224 multiIndices += subTreeSize;
    \n-
    225 }
    \n-
    226 size_type subTreeSize = node.child(_1).size();
    \n-
    227 pq1PreBasis_.indices(node.child(_1), multiIndices);
    \n-
    228 for (std::size_t i = 0; i<subTreeSize; ++i)
    \n-
    229 multiIndexPushFront(multiIndices[i], 1);
    \n-
    230 multiIndices += subTreeSize;
    \n-
    231 return multiIndices;
    \n-
    232 }
    \n-
    233
    \n-
    234 template<bool hi, class It,
    \n-
    235 typename std::enable_if<hi,int>::type = 0>
    \n-
    236 It indicesImp(const Node& node, It multiIndices) const
    \n-
    237 {
    \n-
    238 using namespace Dune::Indices;
    \n-
    239 for(std::size_t child=0; child<dim; ++child)
    \n-
    240 {
    \n-
    241 size_type subTreeSize = node.child(_0, 0).size();
    \n-
    242 pq2PreBasis_.indices(node.child(_0, 0), multiIndices);
    \n-
    243 for (std::size_t i = 0; i<subTreeSize; ++i)
    \n-
    244 {
    \n-
    245 multiIndexPushFront(multiIndices[i], 0);
    \n-
    246 multiIndices[i].push_back(i);
    \n-
    247 }
    \n-
    248 multiIndices += subTreeSize;
    \n-
    249 }
    \n-
    250 size_type subTreeSize = node.child(_1).size();
    \n-
    251 pq1PreBasis_.indices(node.child(_1), multiIndices);
    \n-
    252 for (std::size_t i = 0; i<subTreeSize; ++i)
    \n-
    253 multiIndexPushFront(multiIndices[i], 1);
    \n-
    254 multiIndices += subTreeSize;
    \n-
    255 return multiIndices;
    \n-
    256 }
    \n-
    257
    \n-\n-
    259
    \n-\n-\n-
    262};
    \n-
    263
    \n-
    264
    \n-
    265
    \n-
    266template<typename GV>
    \n-\n-
    268 public PowerBasisNode<LagrangeNode<GV,2>, GV::dimension>
    \n-
    269{
    \n-\n-\n-
    272
    \n-
    273public:
    \n-\n-
    275 {
    \n-
    276 for(int i=0; i<GV::dimension; ++i)
    \n-
    277 this->setChild(i, std::make_shared<PQ2Node>());
    \n-
    278 }
    \n-
    279};
    \n-
    280
    \n-
    281template<typename GV>
    \n-\n-
    283 public CompositeBasisNode<
    \n-
    284 TaylorHoodVelocityTree<GV>,
    \n-
    285 LagrangeNode<GV,1>
    \n-
    286 >
    \n-
    287{
    \n-\n-\n-
    290
    \n-\n+\n+
    125 {
    \n+
    126 Hybrid::forEach(ChildIndices(), [&](auto i) {
    \n+
    127 this->subPreBasis(i).initializeIndices();
    \n+
    128 });
    \n+
    129 }
    \n+
    130
    \n+
    132 const GridView& gridView() const
    \n+
    133 {
    \n+
    134 return std::get<0>(subPreBases_).gridView();
    \n+
    135 }
    \n+
    136
    \n+
    138 void update(const GridView& gv)
    \n+
    139 {
    \n+
    140 Hybrid::forEach(ChildIndices(), [&](auto i) {
    \n+
    141 this->subPreBasis(i).update(gv);
    \n+
    142 });
    \n+
    143 }
    \n+
    144
    \n+\n+
    149 {
    \n+
    150 auto node = Node{};
    \n+
    151 Hybrid::forEach(ChildIndices(), [&](auto i) {
    \n+
    152 node.setChild(this->subPreBasis(i).makeNode(), i);
    \n+
    153 });
    \n+
    154 return node;
    \n+
    155 }
    \n+
    156
    \n+\n+
    159 {
    \n+
    160 return size(Dune::ReservedVector<size_type, multiIndexBufferSize>{});
    \n+
    161 }
    \n+
    162
    \n+
    164 template<class SizePrefix>
    \n+
    165 size_type size(const SizePrefix& prefix) const
    \n+
    166 {
    \n+
    167 return size(prefix, IndexMergingStrategy{});
    \n+
    168 }
    \n+
    169
    \n+
    170private:
    \n+
    171
    \n+
    172 template<class SizePrefix>
    \n+
    173 size_type size(const SizePrefix& prefix, BasisFactory::BlockedLexicographic) const
    \n+
    174 {
    \n+
    175 if (prefix.size() == 0)
    \n+
    176 return children;
    \n+
    177
    \n+
    178 return Hybrid::switchCases(ChildIndices(), prefix[0], [&] (auto i) {
    \n+
    179 SizePrefix subPrefix;
    \n+
    180 for(std::size_t i=1; i<prefix.size(); ++i)
    \n+
    181 subPrefix.push_back(prefix[i]);
    \n+
    182 return this->subPreBasis(i).size(subPrefix);
    \n+
    183 }, []() {
    \n+
    184 return size_type(0);
    \n+
    185 });
    \n+
    186 }
    \n+
    187
    \n+
    188 template<class SizePrefix>
    \n+
    189 size_type size(const SizePrefix& prefix, BasisFactory::FlatLexicographic) const
    \n+
    190 {
    \n+
    191 size_type result = 0;
    \n+
    192 if (prefix.size() == 0)
    \n+
    193 Hybrid::forEach(ChildIndices(), [&](auto i) {
    \n+
    194 result += this->subPreBasis(i).size();
    \n+
    195 });
    \n+
    196 else {
    \n+
    197 size_type shiftedFirstDigit = prefix[0];
    \n+
    198 staticFindInRange<0, children>([&](auto i) {
    \n+
    199 auto firstDigitSize = this->subPreBasis(i).size();
    \n+
    200 if (shiftedFirstDigit < firstDigitSize)
    \n+
    201 {
    \n+
    202 SizePrefix subPrefix;
    \n+
    203 subPrefix.push_back(shiftedFirstDigit);
    \n+
    204 for(std::size_t i=1; i<prefix.size(); ++i)
    \n+
    205 subPrefix.push_back(prefix[i]);
    \n+
    206 result = this->subPreBasis(i).size(subPrefix);
    \n+
    207 return true;
    \n+
    208 }
    \n+
    209 shiftedFirstDigit -= firstDigitSize;
    \n+
    210 return false;
    \n+
    211 });
    \n+
    212 }
    \n+
    213 return result;
    \n+
    214 }
    \n+
    215
    \n+
    216public:
    \n+
    217
    \n+\n+
    220 {
    \n+
    221 size_type r=0;
    \n+
    222 // Accumulate dimension() for all subprebases
    \n+
    223 Hybrid::forEach(ChildIndices(), [&](auto i) {
    \n+
    224 r += this->subPreBasis(i).dimension();
    \n+
    225 });
    \n+
    226 return r;
    \n+
    227 }
    \n+
    228
    \n+\n+
    231 {
    \n+
    232 size_type r=0;
    \n+
    233 // Accumulate maxNodeSize() for all subprebases
    \n+
    234 Hybrid::forEach(ChildIndices(), [&](auto i) {
    \n+
    235 r += this->subPreBasis(i).maxNodeSize();
    \n+
    236 });
    \n+
    237 return r;
    \n+
    238 }
    \n+
    239
    \n+
    241 template<std::size_t i>
    \n+
    242 const SubPreBasis<i>& subPreBasis(Dune::index_constant<i> = {}) const
    \n+
    243 {
    \n+
    244 return std::get<i>(subPreBases_);
    \n+
    245 }
    \n+
    246
    \n+
    248 template<std::size_t i>
    \n+
    249 SubPreBasis<i>& subPreBasis(Dune::index_constant<i> = {})
    \n+
    250 {
    \n+
    251 return std::get<i>(subPreBases_);
    \n+
    252 }
    \n+
    253
    \n+
    255 template<typename It>
    \n+
    256 It indices(const Node& node, It it) const
    \n+
    257 {
    \n+
    258 return indices(node, it, IndexMergingStrategy{});
    \n+
    259 }
    \n+
    260
    \n+
    261private:
    \n+
    262
    \n+
    263 template<typename It>
    \n+
    264 It indices(const Node& node, It multiIndices, BasisFactory::FlatLexicographic) const
    \n+
    265 {
    \n+
    266 size_type firstComponentOffset = 0;
    \n+
    267 // Loop over all children
    \n+
    268 Hybrid::forEach(ChildIndices(), [&](auto child){
    \n+
    269 size_type subTreeSize = node.child(child).size();
    \n+
    270 // Fill indices for current child into index buffer starting from current
    \n+
    271 // buffer position and shift first index component of any index for current
    \n+
    272 // child by suitable offset to get lexicographic indices.
    \n+
    273 subPreBasis(child).indices(node.child(child), multiIndices);
    \n+
    274 for (std::size_t i = 0; i<subTreeSize; ++i)
    \n+
    275 multiIndices[i][0] += firstComponentOffset;
    \n+
    276 // Increment offset by the size for first index component of the current child
    \n+
    277 firstComponentOffset += subPreBasis(child).size();
    \n+
    278 // Increment buffer iterator by the number of indices processed for current child
    \n+
    279 multiIndices += subTreeSize;
    \n+
    280 });
    \n+
    281 return multiIndices;
    \n+
    282 }
    \n+
    283
    \n+
    284 template<class MultiIndex>
    \n+
    285 static void multiIndexPushFront(MultiIndex& M, size_type M0)
    \n+
    286 {
    \n+
    287 M.resize(M.size()+1);
    \n+
    288 for(std::size_t i=M.size()-1; i>0; --i)
    \n+
    289 M[i] = M[i-1];
    \n+
    290 M[0] = M0;
    \n+
    291 }
    \n
    292
    \n-
    293public:
    \n-\n-
    295 {
    \n-
    296 this->template setChild<0>(std::make_shared<VelocityNode>());
    \n-
    297 this->template setChild<1>(std::make_shared<PressureNode>());
    \n-
    298 }
    \n-
    299};
    \n-
    300
    \n-
    301
    \n-
    302
    \n-
    303namespace BasisFactory {
    \n-
    304
    \n-
    311inline auto taylorHood()
    \n-
    312{
    \n-
    313 return [](const auto& gridView) {
    \n-
    314 return TaylorHoodPreBasis<std::decay_t<decltype(gridView)>>(gridView);
    \n-
    315 };
    \n-
    316}
    \n-
    317
    \n-
    318} // end namespace BasisFactory
    \n-
    319
    \n-
    320// *****************************************************************************
    \n-
    321// This is the actual global basis implementation based on the reusable parts.
    \n-
    322// *****************************************************************************
    \n-
    323
    \n-
    345template<typename GV>
    \n-\n+
    293 template<typename It>
    \n+
    294 It indices(const Node& node, It multiIndices, BasisFactory::BlockedLexicographic) const
    \n+
    295 {
    \n+
    296 // Loop over all children
    \n+
    297 Hybrid::forEach(ChildIndices(), [&](auto child){
    \n+
    298 size_type subTreeSize = node.child(child).size();
    \n+
    299 // Fill indices for current child into index buffer starting from current position
    \n+
    300 subPreBasis(child).indices(node.child(child), multiIndices);
    \n+
    301 // Insert child index before first component of all indices of current child.
    \n+
    302 for (std::size_t i = 0; i<subTreeSize; ++i)
    \n+
    303 this->multiIndexPushFront(multiIndices[i], child);
    \n+
    304 // Increment buffer iterator by the number of indices processed for current child
    \n+
    305 multiIndices += subTreeSize;
    \n+
    306 });
    \n+
    307 return multiIndices;
    \n+
    308 }
    \n+
    309
    \n+
    310 std::tuple<SPB...> subPreBases_;
    \n+
    311};
    \n+
    312
    \n+
    313
    \n+
    314
    \n+
    315namespace BasisFactory {
    \n+
    316
    \n+
    317namespace Imp {
    \n+
    318
    \n+
    319template<class IndexMergingStrategy, class... ChildPreBasisFactory>
    \n+
    320class CompositePreBasisFactory
    \n+
    321{
    \n+
    322
    \n+
    323 template<class GridView, class... ChildPreBasis>
    \n+
    324 auto makePreBasisFromChildPreBases(const GridView&, ChildPreBasis&&... childPreBasis) const
    \n+
    325 {
    \n+
    326 return CompositePreBasis<IndexMergingStrategy, std::decay_t<ChildPreBasis>...>(std::forward<ChildPreBasis>(childPreBasis)...);
    \n+
    327 }
    \n+
    328
    \n+
    329public:
    \n+
    330
    \n+
    331 CompositePreBasisFactory(const ChildPreBasisFactory&... childPreBasisFactory) :
    \n+
    332 childPreBasisFactories_(childPreBasisFactory...)
    \n+
    333 {}
    \n+
    334
    \n+
    335 CompositePreBasisFactory(ChildPreBasisFactory&&... childPreBasisFactory) :
    \n+
    336 childPreBasisFactories_(std::move(childPreBasisFactory)...)
    \n+
    337 {}
    \n+
    338
    \n+
    339 template<class GridView>
    \n+
    340 auto operator()(const GridView& gridView) const
    \n+
    341 {
    \n+
    342 // Use std::apply to unpack the tuple childPreBasisFactories_
    \n+
    343 return std::apply([&](const auto&... childPreBasisFactory) {
    \n+
    344 return this->makePreBasisFromChildPreBases(gridView, childPreBasisFactory(gridView)...);
    \n+
    345 }, childPreBasisFactories_);
    \n+
    346 }
    \n
    347
    \n-
    348
    \n-
    349
    \n-
    350} // end namespace Functions
    \n-
    351} // end namespace Dune
    \n-
    352
    \n+
    348private:
    \n+
    349 std::tuple<ChildPreBasisFactory...> childPreBasisFactories_;
    \n+
    350};
    \n+
    351
    \n+
    352} // end namespace BasisFactory::Imp
    \n
    353
    \n-
    354#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH
    \n-\n-\n-\n-
    auto taylorHood()
    Create a pre-basis factory that can create a Taylor-Hood pre-basis.
    Definition: taylorhoodbasis.hh:311
    \n+
    354
    \n+
    355
    \n+
    366template<
    \n+
    367 typename... Args,
    \n+
    368 std::enable_if_t<Concept::isIndexMergingStrategy<typename LastType<Args...>::type>(),int> = 0>
    \n+
    369auto composite(Args&&... args)
    \n+
    370{
    \n+
    371 // We have to separate the last entry which is the IndexMergingStrategy
    \n+
    372 // and the preceding ones, which are the ChildPreBasisFactories
    \n+
    373
    \n+
    374 using ArgTuple = std::tuple<std::decay_t<Args>...>;
    \n+
    375
    \n+
    376 // Compute number of children and index of the IndexMergingStrategy argument
    \n+
    377 constexpr std::size_t children = Dune::SizeOf<Args...>::value-1;
    \n+
    378
    \n+
    379 // Use last type as IndexMergingStrategy
    \n+
    380 using IndexMergingStrategy = std::tuple_element_t<children, ArgTuple>;
    \n+
    381
    \n+
    382 // Index sequence for all but the last entry for partial tuple unpacking
    \n+
    383 auto childIndices = std::make_index_sequence<children>{};
    \n+
    384
    \n+
    385 // Unpack tuple only for those entries related to children
    \n+
    386 return applyPartial([](auto&&... childPreBasisFactory){
    \n+
    387 return Imp::CompositePreBasisFactory<IndexMergingStrategy, std::decay_t<decltype(childPreBasisFactory)>...>(std::forward<decltype(childPreBasisFactory)>(childPreBasisFactory)...);
    \n+
    388 },
    \n+
    389 std::forward_as_tuple(std::forward<Args>(args)...),
    \n+
    390 childIndices);
    \n+
    391}
    \n+
    392
    \n+
    404template<
    \n+
    405 typename... Args,
    \n+
    406 std::enable_if_t<not Concept::isIndexMergingStrategy<typename LastType<Args...>::type>(),int> = 0>
    \n+
    407auto composite(Args&&... args)
    \n+
    408{
    \n+
    409 return Imp::CompositePreBasisFactory<BasisFactory::BlockedLexicographic, std::decay_t<Args>...>(std::forward<Args>(args)...);
    \n+
    410}
    \n+
    411
    \n+
    412} // end namespace BasisFactory
    \n+
    413
    \n+
    414// Backward compatibility
    \n+
    415namespace BasisBuilder {
    \n+
    416
    \n+
    417 using namespace BasisFactory;
    \n+
    418
    \n+
    419}
    \n+
    420
    \n+
    421
    \n+
    422
    \n+
    423} // end namespace Functions
    \n+
    424} // end namespace Dune
    \n+
    425
    \n+
    426
    \n+
    427#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH
    \n+\n+\n+\n+\n+\n+\n+
    auto composite(Args &&... args)
    Create a factory builder that can build a CompositePreBasis.
    Definition: compositebasis.hh:369
    \n+
    typename std::enable_if< std::is_constructible< T, Args... >::value, int >::type enableIfConstructible
    Helper to constrain forwarding constructors.
    Definition: type_traits.hh:26
    \n
    Definition: polynomial.hh:10
    \n-
    Global basis for given pre-basis.
    Definition: defaultglobalbasis.hh:46
    \n-
    Definition: lagrangebasis.hh:387
    \n-\n-
    It indices(const Node &node, It it) const
    Definition: lagrangebasis.hh:192
    \n-
    void initializeIndices()
    Initialize the global indices.
    Definition: lagrangebasis.hh:96
    \n-
    void update(const GridView &gv)
    Update the stored grid view, to be called if the grid has changed.
    Definition: lagrangebasis.hh:126
    \n-
    size_type maxNodeSize() const
    Get the maximal number of DOFs associated to node for any element.
    Definition: lagrangebasis.hh:184
    \n-
    size_type size() const
    Same as size(prefix) with empty prefix.
    Definition: lagrangebasis.hh:140
    \n-
    size_type size() const
    Definition: nodes.hh:142
    \n-
    Definition: nodes.hh:193
    \n+
    static constexpr bool isIndexMergingStrategy()
    Definition: basistags.hh:23
    \n+
    Get last entry of type list.
    Definition: utility.hh:222
    \n+
    Base class for index merging strategies to simplify detection.
    Definition: basistags.hh:44
    \n+
    Lexicographic merging of direct children without blocking.
    Definition: basistags.hh:80
    \n+
    Lexicographic merging of direct children with blocking (i.e. creating one block per direct child).
    Definition: basistags.hh:148
    \n+
    A pre-basis for composite bases.
    Definition: compositebasis.hh:53
    \n+
    SubPreBasis< i > & subPreBasis(Dune::index_constant< i >={})
    Mutable access to the stored prebasis of the factor in the power space.
    Definition: compositebasis.hh:249
    \n+
    IMS IndexMergingStrategy
    Strategy used to merge the global indices of the child pre-bases.
    Definition: compositebasis.hh:71
    \n+
    size_type maxNodeSize() const
    Get the maximal number of DOFs associated to node for any element.
    Definition: compositebasis.hh:230
    \n+
    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
    \n+
    std::size_t size_type
    Type used for indices and size information.
    Definition: compositebasis.hh:68
    \n+
    CompositeBasisNode< typename SPB::Node... > Node
    Template mapping root tree path to type of created tree node.
    Definition: compositebasis.hh:81
    \n+
    size_type size(const SizePrefix &prefix) const
    Return number of possible values for next position in multi index.
    Definition: compositebasis.hh:165
    \n+
    CompositePreBasis(SFArgs &&... sfArgs)
    Constructor for given child pre-basis objects.
    Definition: compositebasis.hh:95
    \n+
    size_type dimension() const
    Get the total dimension of the space spanned by this basis.
    Definition: compositebasis.hh:219
    \n+
    CompositePreBasis(const GV &gv)
    Constructor for given GridView.
    Definition: compositebasis.hh:115
    \n+
    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
    \n+
    size_type size() const
    Same as size(prefix) with empty prefix.
    Definition: compositebasis.hh:158
    \n+
    typename std::tuple_element_t< 0, SubPreBases >::GridView GridView
    The grid view that the FE basis is defined on.
    Definition: compositebasis.hh:65
    \n+
    static const std::size_t children
    Definition: compositebasis.hh:74
    \n+
    std::tuple< SPB... > SubPreBases
    Tuple of child pre-bases.
    Definition: compositebasis.hh:58
    \n+
    Node makeNode() const
    Create tree node.
    Definition: compositebasis.hh:148
    \n+
    void initializeIndices()
    Initialize the global indices.
    Definition: compositebasis.hh:124
    \n+
    std::tuple_element_t< i, SubPreBases > SubPreBasis
    Export individual child pre-bases by index.
    Definition: compositebasis.hh:62
    \n+
    std::make_index_sequence< children > ChildIndices
    Definition: compositebasis.hh:76
    \n+
    void update(const GridView &gv)
    Update the stored grid view, to be called if the grid has changed.
    Definition: compositebasis.hh:138
    \n+
    static constexpr size_type multiIndexBufferSize
    Definition: compositebasis.hh:85
    \n+
    const GridView & gridView() const
    Obtain the grid view that the basis is defined on.
    Definition: compositebasis.hh:132
    \n+
    static constexpr size_type minMultiIndexSize
    Definition: compositebasis.hh:84
    \n+
    static constexpr size_type maxMultiIndexSize
    Definition: compositebasis.hh:83
    \n
    Definition: nodes.hh:219
    \n-
    Definition: taylorhoodbasis.hh:269
    \n-
    TaylorHoodVelocityTree()
    Definition: taylorhoodbasis.hh:274
    \n-
    Definition: taylorhoodbasis.hh:287
    \n-
    TaylorHoodBasisTree()
    Definition: taylorhoodbasis.hh:294
    \n-
    Pre-basis for lowest order Taylor-Hood basis.
    Definition: taylorhoodbasis.hh:61
    \n-
    TaylorHoodPreBasis(const GridView &gv)
    Constructor for a given grid view object.
    Definition: taylorhoodbasis.hh:89
    \n-
    const GridView & gridView() const
    Obtain the grid view that the basis is defined on.
    Definition: taylorhoodbasis.hh:103
    \n-
    static constexpr size_type minMultiIndexSize
    Definition: taylorhoodbasis.hh:78
    \n-
    size_type size(const SizePrefix &prefix) const
    Return number of possible values for next position in multi index.
    Definition: taylorhoodbasis.hh:131
    \n-
    GridView gridView_
    Definition: taylorhoodbasis.hh:258
    \n-
    GV GridView
    The grid view that the FE basis is defined on.
    Definition: taylorhoodbasis.hh:69
    \n-
    void update(const GridView &gv)
    Update the stored grid view, to be called if the grid has changed.
    Definition: taylorhoodbasis.hh:109
    \n-
    PQ2PreBasis pq2PreBasis_
    Definition: taylorhoodbasis.hh:261
    \n-
    size_type size() const
    Same as size(prefix) with empty prefix.
    Definition: taylorhoodbasis.hh:124
    \n-
    size_type dimension() const
    Get the total dimension of the space spanned by this basis.
    Definition: taylorhoodbasis.hh:182
    \n-
    PQ1PreBasis pq1PreBasis_
    Definition: taylorhoodbasis.hh:260
    \n-
    static const void multiIndexPushFront(MultiIndex &M, size_type M0)
    Definition: taylorhoodbasis.hh:202
    \n-
    static constexpr size_type maxMultiIndexSize
    Definition: taylorhoodbasis.hh:77
    \n-
    Node makeNode() const
    Create tree node.
    Definition: taylorhoodbasis.hh:118
    \n-
    It indices(const Node &node, It it) const
    Definition: taylorhoodbasis.hh:194
    \n-
    static constexpr size_type multiIndexBufferSize
    Definition: taylorhoodbasis.hh:79
    \n-
    void initializeIndices()
    Initialize the global indices.
    Definition: taylorhoodbasis.hh:96
    \n-
    size_type maxNodeSize() const
    Get the maximal number of DOFs associated to node for any element.
    Definition: taylorhoodbasis.hh:188
    \n-
    std::size_t size_type
    Type used for indices and size information.
    Definition: taylorhoodbasis.hh:72
    \n-
    It indicesImp(const Node &node, It multiIndices) const
    Definition: taylorhoodbasis.hh:212
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,438 +5,541 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-taylorhoodbasis.hh\n+compositebasis.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH\n 5\n- 6#include \n- 7#include \n- 8#include \n- 9\n- 10#include \n- 11#include \n- 12\n- 13#include \n- 14\n- 15#include \n- 16#include \n- 17\n- 18namespace Dune {\n- 19namespace Functions {\n- 20\n- 21\n- 22/\n+ 6#include \n+ 7#include \n+ 8\n+ 9#include \n+ 10#include \n+ 11#include \n+ 12#include \n+ 13#include \n+ 14#include \n+ 15#include \n+ 16\n+ 17#include \n+ 18#include \n+ 19#include \n+ 20#include \n+ 21#include \n+ 22#include \n+ 23#include \n+ 24\n+ 25\n+ 26namespace Dune {\n+ 27namespace Functions {\n+ 28\n+ 29/\n / *****************************************************************************\n- 23// This is the reusable part of the basis. It contains\n- 24//\n- 25// TaylorHoodPreBasis\n- 26// TaylorHoodBasisTree\n- 27// TaylorHoodVelocityTree\n- 28//\n- 29// The pre-basis allows to create the others and is the owner of possible\n+ 30// This is the reusable part of the composite bases. It contains\n+ 31//\n+ 32// CompositePreBasis\n+ 33//\n+ 34// The pre-basis allows to create the others and is the owner of possible\n shared\n- 30// state. These components do _not_ depend on the global basis and local\n+ 35// state. These components do _not_ depend on the global basis and local\n view\n- 31// and can be used without a global basis.\n- 32/\n+ 36// and can be used without a global basis.\n+ 37/\n / *****************************************************************************\n- 33\n- 34template\n- 35class TaylorHoodVelocityTree;\n- 36\n- 37template\n- 38class TaylorHoodBasisTree;\n+ 38\n 39\n- 59template\n-60class TaylorHoodPreBasis\n- 61{\n- 62 static const bool useHybridIndices = HI;\n+ 51template\n+52class CompositePreBasis\n+ 53{\n+ 54 static const bool isBlocked = std::is_same_v or std::is_same_v;\n+ 55public:\n+ 56\n+58 using SubPreBases = std::tuple;\n+ 59\n+ 61 template\n+62 using SubPreBasis = std::tuple_element_t;\n 63\n- 64 static const int dim = GV::dimension;\n- 65\n- 66public:\n- 67\n-69 using GridView = GV;\n- 70\n-72 using size_type = std::size_t;\n- 73\n-75 using Node = TaylorHoodBasisTree;\n- 76\n-77 static constexpr size_type maxMultiIndexSize = useHybridIndices ? 3 : 2;\n-78 static constexpr size_type minMultiIndexSize = 2;\n-79 static constexpr size_type multiIndexBufferSize = maxMultiIndexSize;\n- 80\n- 81private:\n+65 using GridView = typename std::tuple_element_t<0, SubPreBases>::GridView;\n+ 66\n+68 using size_type = std::size_t;\n+ 69\n+71 using IndexMergingStrategy = IMS;\n+ 72\n+ 73protected:\n+74 static const std::size_t children = sizeof...(SPB);\n+ 75\n+76 using ChildIndices = std::make_index_sequence;\n+ 77\n+ 78public:\n+ 79\n+81 using Node = CompositeBasisNode;\n 82\n- 83 using PQ1PreBasis = LagrangePreBasis;\n- 84 using PQ2PreBasis = LagrangePreBasis;\n- 85\n- 86public:\n- 87\n-89 TaylorHoodPreBasis(const GridView& gv) :\n- 90 gridView_(gv),\n- 91 pq1PreBasis_(gv),\n- 92 pq2PreBasis_(gv)\n- 93 {}\n- 94\n-96 void initializeIndices()\n+83 static constexpr size_type maxMultiIndexSize = std::max({SPB::\n+maxMultiIndexSize...}) + isBlocked;\n+84 static constexpr size_type minMultiIndexSize = std::min({SPB::\n+minMultiIndexSize...}) + isBlocked;\n+85 static constexpr size_type multiIndexBufferSize = std::max({SPB::\n+multiIndexBufferSize...}) + isBlocked;\n+ 86\n+ 92 template = 0,\n+ 94 enableIfConstructible, SFArgs...> = 0>\n+95 CompositePreBasis(SFArgs&&... sfArgs) :\n+ 96 subPreBases_(std::forward(sfArgs)...)\n 97 {\n- 98 pq1PreBasis_.initializeIndices();\n- 99 pq2PreBasis_.initializeIndices();\n- 100 }\n- 101\n-103 const GridView& gridView() const\n- 104 {\n- 105 return gridView_;\n- 106 }\n- 107\n-109 void update (const GridView& gv)\n- 110 {\n- 111 pq1PreBasis_.update(gv);\n- 112 pq2PreBasis_.update(gv);\n- 113 }\n- 114\n-118 Node makeNode() const\n- 119 {\n- 120 return Node{};\n+ 98 Hybrid::forEach(subPreBases_, [&](const auto& subPreBasis){\n+ 99 static_assert(models, std::decay_t>(), \"Subprebases passed to CompositePreBasis does not model the\n+PreBasis concept.\");\n+ 100 });\n+ 101 }\n+ 102\n+ 109 template 1)>, // Avoid ambiguous constructor if\n+there's only one child\n+ 112 std::is_same,\n+ 113 std::is_constructible...\n+ 114 >, int> = 0>\n+115 CompositePreBasis(const GV& gv) :\n+ 116 subPreBases_(SPB(gv)...)\n+ 117 {\n+ 118 Hybrid::forEach(subPreBases_, [&](const auto& subPreBasis){\n+ 119 static_assert(models, std::decay_t>(), \"Subprebases passed to CompositePreBasis does not model the\n+PreBasis concept.\");\n+ 120 });\n 121 }\n 122\n-124 size_type size() const\n+124 void initializeIndices()\n 125 {\n- 126 return 2;\n- 127 }\n- 128\n- 130 template\n-131 size_type size(const SizePrefix& prefix) const\n- 132 {\n- 133 return sizeImp(prefix);\n- 134 }\n- 135\n- 136private:\n- 137\n- 138 template::type = 0>\n- 140 size_type sizeImp(const SizePrefix& prefix) const\n- 141 {\n- 142 if (prefix.size() == 0)\n- 143 return 2;\n- 144 if (prefix.size() == 1)\n- 145 {\n- 146 if (prefix[0] == 0)\n- 147 return dim * pq2PreBasis_.size();\n- 148 if (prefix[0] == 1)\n- 149 return pq1PreBasis_.size();\n- 150 }\n- 151 assert(prefix.size() == 2);\n- 152 return 0;\n- 153 }\n- 154\n- 155 template::type = 0>\n- 157 size_type sizeImp(const SizePrefix& prefix) const\n- 158 {\n- 159 if (prefix.size() == 0)\n- 160 return 2;\n- 161 if (prefix.size() == 1)\n- 162 {\n- 163 if (prefix[0] == 0)\n- 164 return pq2PreBasis_.size();\n- 165 if (prefix[0] == 1)\n- 166 return pq1PreBasis_.size();\n- 167 }\n- 168 if (prefix.size() == 2)\n- 169 {\n- 170 if (prefix[0] == 0)\n- 171 return dim;\n- 172 if (prefix[0] == 1)\n- 173 return 0;\n- 174 }\n- 175 assert(prefix.size() == 3);\n- 176 return 0;\n- 177 }\n- 178\n- 179public:\n- 180\n-182 size_type dimension() const\n- 183 {\n- 184 return dim * pq2PreBasis_.size() + pq1PreBasis_.size();\n- 185 }\n- 186\n-188 size_type maxNodeSize() const\n- 189 {\n- 190 return dim * pq2PreBasis_.maxNodeSize() + pq1PreBasis_.maxNodeSize();\n- 191 }\n- 192\n- 193 template\n-194 It indices(const Node& node, It it) const\n- 195 {\n- 196 return indicesImp(node, it);\n- 197 }\n- 198\n- 199protected:\n- 200\n- 201 template\n-202 static const void multiIndexPushFront(MultiIndex& M, size_type M0)\n- 203 {\n- 204 M.resize(M.size()+1);\n- 205 for(std::size_t i=M.size()-1; i>0; --i)\n- 206 M[i] = M[i-1];\n- 207 M[0] = M0;\n+ 126 Hybrid::forEach(ChildIndices(), [&](auto i) {\n+ 127 this->subPreBasis(i).initializeIndices();\n+ 128 });\n+ 129 }\n+ 130\n+132 const GridView& gridView() const\n+ 133 {\n+ 134 return std::get<0>(subPreBases_).gridView();\n+ 135 }\n+ 136\n+138 void update(const GridView& gv)\n+ 139 {\n+ 140 Hybrid::forEach(ChildIndices(), [&](auto i) {\n+ 141 this->subPreBasis(i).update(gv);\n+ 142 });\n+ 143 }\n+ 144\n+148 Node makeNode() const\n+ 149 {\n+ 150 auto node = Node{};\n+ 151 Hybrid::forEach(ChildIndices(), [&](auto i) {\n+ 152 node.setChild(this->subPreBasis(i).makeNode(), i);\n+ 153 });\n+ 154 return node;\n+ 155 }\n+ 156\n+158 size_type size() const\n+ 159 {\n+ 160 return size(Dune::ReservedVector{});\n+ 161 }\n+ 162\n+ 164 template\n+165 size_type size(const SizePrefix& prefix) const\n+ 166 {\n+ 167 return size(prefix, IndexMergingStrategy{});\n+ 168 }\n+ 169\n+ 170private:\n+ 171\n+ 172 template\n+ 173 size_type size(const SizePrefix& prefix, BasisFactory::\n+BlockedLexicographic) const\n+ 174 {\n+ 175 if (prefix.size() == 0)\n+ 176 return children;\n+ 177\n+ 178 return Hybrid::switchCases(ChildIndices(), prefix[0], [&] (auto i) {\n+ 179 SizePrefix subPrefix;\n+ 180 for(std::size_t i=1; isubPreBasis(i).size(subPrefix);\n+ 183 }, []() {\n+ 184 return size_type(0);\n+ 185 });\n+ 186 }\n+ 187\n+ 188 template\n+ 189 size_type size(const SizePrefix& prefix, BasisFactory::FlatLexicographic)\n+const\n+ 190 {\n+ 191 size_type result = 0;\n+ 192 if (prefix.size() == 0)\n+ 193 Hybrid::forEach(ChildIndices(), [&](auto i) {\n+ 194 result += this->subPreBasis(i).size();\n+ 195 });\n+ 196 else {\n+ 197 size_type shiftedFirstDigit = prefix[0];\n+ 198 staticFindInRange<0, children>([&](auto i) {\n+ 199 auto firstDigitSize = this->subPreBasis(i).size();\n+ 200 if (shiftedFirstDigit < firstDigitSize)\n+ 201 {\n+ 202 SizePrefix subPrefix;\n+ 203 subPrefix.push_back(shiftedFirstDigit);\n+ 204 for(std::size_t i=1; isubPreBasis(i).size(subPrefix);\n+ 207 return true;\n 208 }\n- 209\n- 210 template::type = 0>\n-212 It indicesImp(const Node& node, It multiIndices) const\n- 213 {\n- 214 using namespace Dune::Indices;\n- 215 for(std::size_t child=0; child::type = 0>\n-236 It indicesImp(const Node& node, It multiIndices) const\n- 237 {\n- 238 using namespace Dune::Indices;\n- 239 for(std::size_t child=0; child\n-267class TaylorHoodVelocityTree :\n- 268 public PowerBasisNode, GV::dimension>\n- 269{\n- 270 using PQ2Node = LagrangeNode;\n- 271 using Base = PowerBasisNode;\n- 272\n- 273public:\n-274 TaylorHoodVelocityTree()\n- 275 {\n- 276 for(int i=0; isetChild(i, std::make_shared());\n- 278 }\n- 279};\n- 280\n- 281template\n-282class TaylorHoodBasisTree :\n- 283 public CompositeBasisNode<\n- 284 TaylorHoodVelocityTree,\n- 285 LagrangeNode\n- 286 >\n- 287{\n- 288 using VelocityNode=TaylorHoodVelocityTree;\n- 289 using PressureNode=LagrangeNode;\n- 290\n- 291 using Base=CompositeBasisNode;\n+ 221 size_type r=0;\n+ 222 // Accumulate dimension() for all subprebases\n+ 223 Hybrid::forEach(ChildIndices(), [&](auto i) {\n+ 224 r += this->subPreBasis(i).dimension();\n+ 225 });\n+ 226 return r;\n+ 227 }\n+ 228\n+230 size_type maxNodeSize() const\n+ 231 {\n+ 232 size_type r=0;\n+ 233 // Accumulate maxNodeSize() for all subprebases\n+ 234 Hybrid::forEach(ChildIndices(), [&](auto i) {\n+ 235 r += this->subPreBasis(i).maxNodeSize();\n+ 236 });\n+ 237 return r;\n+ 238 }\n+ 239\n+ 241 template\n+242 const SubPreBasis& subPreBasis(Dune::index_constant = {}) const\n+ 243 {\n+ 244 return std::get(subPreBases_);\n+ 245 }\n+ 246\n+ 248 template\n+249 SubPreBasis& subPreBasis(Dune::index_constant = {})\n+ 250 {\n+ 251 return std::get(subPreBases_);\n+ 252 }\n+ 253\n+ 255 template\n+256 It indices(const Node& node, It it) const\n+ 257 {\n+ 258 return indices(node, it, IndexMergingStrategy{});\n+ 259 }\n+ 260\n+ 261private:\n+ 262\n+ 263 template\n+ 264 It indices(const Node& node, It multiIndices, BasisFactory::\n+FlatLexicographic) const\n+ 265 {\n+ 266 size_type firstComponentOffset = 0;\n+ 267 // Loop over all children\n+ 268 Hybrid::forEach(ChildIndices(), [&](auto child){\n+ 269 size_type subTreeSize = node.child(child).size();\n+ 270 // Fill indices for current child into index buffer starting from current\n+ 271 // buffer position and shift first index component of any index for\n+current\n+ 272 // child by suitable offset to get lexicographic indices.\n+ 273 subPreBasis(child).indices(node.child(child), multiIndices);\n+ 274 for (std::size_t i = 0; i\n+ 285 static void multiIndexPushFront(MultiIndex& M, size_type M0)\n+ 286 {\n+ 287 M.resize(M.size()+1);\n+ 288 for(std::size_t i=M.size()-1; i>0; --i)\n+ 289 M[i] = M[i-1];\n+ 290 M[0] = M0;\n+ 291 }\n 292\n- 293public:\n-294 TaylorHoodBasisTree()\n+ 293 template\n+ 294 It indices(const Node& node, It multiIndices, BasisFactory::\n+BlockedLexicographic) const\n 295 {\n- 296 this->template setChild<0>(std::make_shared());\n- 297 this->template setChild<1>(std::make_shared());\n- 298 }\n- 299};\n- 300\n- 301\n- 302\n- 303namespace BasisFactory {\n- 304\n-311inline auto taylorHood()\n- 312{\n- 313 return [](const auto& gridView) {\n- 314 return TaylorHoodPreBasis>(gridView);\n- 315 };\n- 316}\n- 317\n- 318} // end namespace BasisFactory\n- 319\n- 320/\n-/ *****************************************************************************\n- 321// This is the actual global basis implementation based on the reusable\n-parts.\n- 322/\n-/ *****************************************************************************\n- 323\n- 345template\n-346using TaylorHoodBasis = DefaultGlobalBasis >;\n+ 296 // Loop over all children\n+ 297 Hybrid::forEach(ChildIndices(), [&](auto child){\n+ 298 size_type subTreeSize = node.child(child).size();\n+ 299 // Fill indices for current child into index buffer starting from current\n+position\n+ 300 subPreBasis(child).indices(node.child(child), multiIndices);\n+ 301 // Insert child index before first component of all indices of current\n+child.\n+ 302 for (std::size_t i = 0; imultiIndexPushFront(multiIndices[i], child);\n+ 304 // Increment buffer iterator by the number of indices processed for\n+current child\n+ 305 multiIndices += subTreeSize;\n+ 306 });\n+ 307 return multiIndices;\n+ 308 }\n+ 309\n+ 310 std::tuple subPreBases_;\n+ 311};\n+ 312\n+ 313\n+ 314\n+ 315namespace BasisFactory {\n+ 316\n+ 317namespace Imp {\n+ 318\n+ 319template\n+ 320class CompositePreBasisFactory\n+ 321{\n+ 322\n+ 323 template\n+ 324 auto makePreBasisFromChildPreBases(const GridView&, ChildPreBasis&&...\n+childPreBasis) const\n+ 325 {\n+ 326 return CompositePreBasis...>(std::forward(childPreBasis)...);\n+ 327 }\n+ 328\n+ 329public:\n+ 330\n+ 331 CompositePreBasisFactory(const ChildPreBasisFactory&...\n+childPreBasisFactory) :\n+ 332 childPreBasisFactories_(childPreBasisFactory...)\n+ 333 {}\n+ 334\n+ 335 CompositePreBasisFactory(ChildPreBasisFactory&&... childPreBasisFactory) :\n+ 336 childPreBasisFactories_(std::move(childPreBasisFactory)...)\n+ 337 {}\n+ 338\n+ 339 template\n+ 340 auto operator()(const GridView& gridView) const\n+ 341 {\n+ 342 // Use std::apply to unpack the tuple childPreBasisFactories_\n+ 343 return std::apply([&](const auto&... childPreBasisFactory) {\n+ 344 return this->makePreBasisFromChildPreBases(gridView, childPreBasisFactory\n+(gridView)...);\n+ 345 }, childPreBasisFactories_);\n+ 346 }\n 347\n- 348\n- 349\n- 350} // end namespace Functions\n- 351} // end namespace Dune\n- 352\n+ 348private:\n+ 349 std::tuple childPreBasisFactories_;\n+ 350};\n+ 351\n+ 352} // end namespace BasisFactory::Imp\n 353\n- 354#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TAYLORHOODBASIS_HH\n+ 354\n+ 355\n+ 366template<\n+ 367 typename... Args,\n+ 368 std::enable_if_t::type>(),int> = 0>\n+369auto composite(Args&&... args)\n+ 370{\n+ 371 // We have to separate the last entry which is the IndexMergingStrategy\n+ 372 // and the preceding ones, which are the ChildPreBasisFactories\n+ 373\n+ 374 using ArgTuple = std::tuple...>;\n+ 375\n+ 376 // Compute number of children and index of the IndexMergingStrategy\n+argument\n+ 377 constexpr std::size_t children = Dune::SizeOf::value-1;\n+ 378\n+ 379 // Use last type as IndexMergingStrategy\n+ 380 using IndexMergingStrategy = std::tuple_element_t;\n+ 381\n+ 382 // Index sequence for all but the last entry for partial tuple unpacking\n+ 383 auto childIndices = std::make_index_sequence{};\n+ 384\n+ 385 // Unpack tuple only for those entries related to children\n+ 386 return applyPartial([](auto&&... childPreBasisFactory){\n+ 387 return Imp::CompositePreBasisFactory...>(std::forward(childPreBasisFactory)...);\n+ 388 },\n+ 389 std::forward_as_tuple(std::forward(args)...),\n+ 390 childIndices);\n+ 391}\n+ 392\n+ 404template<\n+ 405 typename... Args,\n+ 406 std::enable_if_t::type>(),int> = 0>\n+ 407auto composite(Args&&... args)\n+ 408{\n+ 409 return Imp::CompositePreBasisFactory...>(std::forward(args)...);\n+ 410}\n+ 411\n+ 412} // end namespace BasisFactory\n+ 413\n+ 414// Backward compatibility\n+ 415namespace BasisBuilder {\n+ 416\n+ 417 using namespace BasisFactory;\n+ 418\n+ 419}\n+ 420\n+ 421\n+ 422\n+ 423} // end namespace Functions\n+ 424} // end namespace Dune\n+ 425\n+ 426\n+ 427#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_COMPOSITEBASIS_HH\n+type_traits.hh\n+utility.hh\n+staticforloop.hh\n+basistags.hh\n nodes.hh\n defaultglobalbasis.hh\n-lagrangebasis.hh\n-Dune::Functions::BasisFactory::taylorHood\n-auto taylorHood()\n-Create a pre-basis factory that can create a Taylor-Hood pre-basis.\n-Definition: taylorhoodbasis.hh:311\n+Dune::Functions::BasisFactory::composite\n+auto composite(Args &&... args)\n+Create a factory builder that can build a CompositePreBasis.\n+Definition: compositebasis.hh:369\n+Dune::Functions::enableIfConstructible\n+typename std::enable_if< std::is_constructible< T, Args... >::value, int >::\n+type enableIfConstructible\n+Helper to constrain forwarding constructors.\n+Definition: type_traits.hh:26\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::DefaultGlobalBasis\n-Global basis for given pre-basis.\n-Definition: defaultglobalbasis.hh:46\n-Dune::Functions::LagrangeNode\n-Definition: lagrangebasis.hh:387\n-Dune::Functions::LagrangePreBasis<_GV,_1_>\n-Dune::Functions::LagrangePreBasis::indices\n-It indices(const Node &node, It it) const\n-Definition: lagrangebasis.hh:192\n-Dune::Functions::LagrangePreBasis::initializeIndices\n-void initializeIndices()\n-Initialize the global indices.\n-Definition: lagrangebasis.hh:96\n-Dune::Functions::LagrangePreBasis::update\n-void update(const GridView &gv)\n-Update the stored grid view, to be called if the grid has changed.\n-Definition: lagrangebasis.hh:126\n-Dune::Functions::LagrangePreBasis::maxNodeSize\n+Dune::Functions::Concept::isIndexMergingStrategy\n+static constexpr bool isIndexMergingStrategy()\n+Definition: basistags.hh:23\n+Dune::Functions::LastType\n+Get last entry of type list.\n+Definition: utility.hh:222\n+Dune::Functions::BasisFactory::IndexMergingStrategy\n+Base class for index merging strategies to simplify detection.\n+Definition: basistags.hh:44\n+Dune::Functions::BasisFactory::FlatLexicographic\n+Lexicographic merging of direct children without blocking.\n+Definition: basistags.hh:80\n+Dune::Functions::BasisFactory::BlockedLexicographic\n+Lexicographic merging of direct children with blocking (i.e. creating one block\n+per direct child).\n+Definition: basistags.hh:148\n+Dune::Functions::CompositePreBasis\n+A pre-basis for composite bases.\n+Definition: compositebasis.hh:53\n+Dune::Functions::CompositePreBasis::subPreBasis\n+SubPreBasis< i > & subPreBasis(Dune::index_constant< i >={})\n+Mutable access to the stored prebasis of the factor in the power space.\n+Definition: compositebasis.hh:249\n+Dune::Functions::CompositePreBasis::IndexMergingStrategy\n+IMS IndexMergingStrategy\n+Strategy used to merge the global indices of the child pre-bases.\n+Definition: compositebasis.hh:71\n+Dune::Functions::CompositePreBasis::maxNodeSize\n size_type maxNodeSize() const\n Get the maximal number of DOFs associated to node for any element.\n-Definition: lagrangebasis.hh:184\n-Dune::Functions::LagrangePreBasis::size\n-size_type size() const\n-Same as size(prefix) with empty prefix.\n-Definition: lagrangebasis.hh:140\n-Dune::Functions::BasisNodeMixin::size\n-size_type size() const\n-Definition: nodes.hh:142\n-Dune::Functions::PowerBasisNode\n-Definition: nodes.hh:193\n-Dune::Functions::CompositeBasisNode\n-Definition: nodes.hh:219\n-Dune::Functions::TaylorHoodVelocityTree\n-Definition: taylorhoodbasis.hh:269\n-Dune::Functions::TaylorHoodVelocityTree::TaylorHoodVelocityTree\n-TaylorHoodVelocityTree()\n-Definition: taylorhoodbasis.hh:274\n-Dune::Functions::TaylorHoodBasisTree\n-Definition: taylorhoodbasis.hh:287\n-Dune::Functions::TaylorHoodBasisTree::TaylorHoodBasisTree\n-TaylorHoodBasisTree()\n-Definition: taylorhoodbasis.hh:294\n-Dune::Functions::TaylorHoodPreBasis\n-Pre-basis for lowest order Taylor-Hood basis.\n-Definition: taylorhoodbasis.hh:61\n-Dune::Functions::TaylorHoodPreBasis::TaylorHoodPreBasis\n-TaylorHoodPreBasis(const GridView &gv)\n-Constructor for a given grid view object.\n-Definition: taylorhoodbasis.hh:89\n-Dune::Functions::TaylorHoodPreBasis::gridView\n-const GridView & gridView() const\n-Obtain the grid view that the basis is defined on.\n-Definition: taylorhoodbasis.hh:103\n-Dune::Functions::TaylorHoodPreBasis::minMultiIndexSize\n-static constexpr size_type minMultiIndexSize\n-Definition: taylorhoodbasis.hh:78\n-Dune::Functions::TaylorHoodPreBasis::size\n+Definition: compositebasis.hh:230\n+Dune::Functions::CompositePreBasis::subPreBasis\n+const SubPreBasis< i > & subPreBasis(Dune::index_constant< i >={}) const\n+Const access to the stored prebasis of the factor in the power space.\n+Definition: compositebasis.hh:242\n+Dune::Functions::CompositePreBasis::size_type\n+std::size_t size_type\n+Type used for indices and size information.\n+Definition: compositebasis.hh:68\n+Dune::Functions::CompositePreBasis::Node\n+CompositeBasisNode< typename SPB::Node... > Node\n+Template mapping root tree path to type of created tree node.\n+Definition: compositebasis.hh:81\n+Dune::Functions::CompositePreBasis::size\n size_type size(const SizePrefix &prefix) const\n Return number of possible values for next position in multi index.\n-Definition: taylorhoodbasis.hh:131\n-Dune::Functions::TaylorHoodPreBasis::gridView_\n-GridView gridView_\n-Definition: taylorhoodbasis.hh:258\n-Dune::Functions::TaylorHoodPreBasis::GridView\n-GV GridView\n-The grid view that the FE basis is defined on.\n-Definition: taylorhoodbasis.hh:69\n-Dune::Functions::TaylorHoodPreBasis::update\n-void update(const GridView &gv)\n-Update the stored grid view, to be called if the grid has changed.\n-Definition: taylorhoodbasis.hh:109\n-Dune::Functions::TaylorHoodPreBasis::pq2PreBasis_\n-PQ2PreBasis pq2PreBasis_\n-Definition: taylorhoodbasis.hh:261\n-Dune::Functions::TaylorHoodPreBasis::size\n-size_type size() const\n-Same as size(prefix) with empty prefix.\n-Definition: taylorhoodbasis.hh:124\n-Dune::Functions::TaylorHoodPreBasis::dimension\n+Definition: compositebasis.hh:165\n+Dune::Functions::CompositePreBasis::CompositePreBasis\n+CompositePreBasis(SFArgs &&... sfArgs)\n+Constructor for given child pre-basis objects.\n+Definition: compositebasis.hh:95\n+Dune::Functions::CompositePreBasis::dimension\n size_type dimension() const\n Get the total dimension of the space spanned by this basis.\n-Definition: taylorhoodbasis.hh:182\n-Dune::Functions::TaylorHoodPreBasis::pq1PreBasis_\n-PQ1PreBasis pq1PreBasis_\n-Definition: taylorhoodbasis.hh:260\n-Dune::Functions::TaylorHoodPreBasis::multiIndexPushFront\n-static const void multiIndexPushFront(MultiIndex &M, size_type M0)\n-Definition: taylorhoodbasis.hh:202\n-Dune::Functions::TaylorHoodPreBasis::maxMultiIndexSize\n-static constexpr size_type maxMultiIndexSize\n-Definition: taylorhoodbasis.hh:77\n-Dune::Functions::TaylorHoodPreBasis::makeNode\n+Definition: compositebasis.hh:219\n+Dune::Functions::CompositePreBasis::CompositePreBasis\n+CompositePreBasis(const GV &gv)\n+Constructor for given GridView.\n+Definition: compositebasis.hh:115\n+Dune::Functions::CompositePreBasis::indices\n+It indices(const Node &node, It it) const\n+Maps from subtree index set [0..size-1] to a globally unique multi index in\n+global basis.\n+Definition: compositebasis.hh:256\n+Dune::Functions::CompositePreBasis::size\n+size_type size() const\n+Same as size(prefix) with empty prefix.\n+Definition: compositebasis.hh:158\n+Dune::Functions::CompositePreBasis::GridView\n+typename std::tuple_element_t< 0, SubPreBases >::GridView GridView\n+The grid view that the FE basis is defined on.\n+Definition: compositebasis.hh:65\n+Dune::Functions::CompositePreBasis::children\n+static const std::size_t children\n+Definition: compositebasis.hh:74\n+Dune::Functions::CompositePreBasis::SubPreBases\n+std::tuple< SPB... > SubPreBases\n+Tuple of child pre-bases.\n+Definition: compositebasis.hh:58\n+Dune::Functions::CompositePreBasis::makeNode\n Node makeNode() const\n Create tree node.\n-Definition: taylorhoodbasis.hh:118\n-Dune::Functions::TaylorHoodPreBasis::indices\n-It indices(const Node &node, It it) const\n-Definition: taylorhoodbasis.hh:194\n-Dune::Functions::TaylorHoodPreBasis::multiIndexBufferSize\n-static constexpr size_type multiIndexBufferSize\n-Definition: taylorhoodbasis.hh:79\n-Dune::Functions::TaylorHoodPreBasis::initializeIndices\n+Definition: compositebasis.hh:148\n+Dune::Functions::CompositePreBasis::initializeIndices\n void initializeIndices()\n Initialize the global indices.\n-Definition: taylorhoodbasis.hh:96\n-Dune::Functions::TaylorHoodPreBasis::maxNodeSize\n-size_type maxNodeSize() const\n-Get the maximal number of DOFs associated to node for any element.\n-Definition: taylorhoodbasis.hh:188\n-Dune::Functions::TaylorHoodPreBasis::size_type\n-std::size_t size_type\n-Type used for indices and size information.\n-Definition: taylorhoodbasis.hh:72\n-Dune::Functions::TaylorHoodPreBasis::indicesImp\n-It indicesImp(const Node &node, It multiIndices) const\n-Definition: taylorhoodbasis.hh:212\n+Definition: compositebasis.hh:124\n+Dune::Functions::CompositePreBasis::SubPreBasis\n+std::tuple_element_t< i, SubPreBases > SubPreBasis\n+Export individual child pre-bases by index.\n+Definition: compositebasis.hh:62\n+Dune::Functions::CompositePreBasis::ChildIndices\n+std::make_index_sequence< children > ChildIndices\n+Definition: compositebasis.hh:76\n+Dune::Functions::CompositePreBasis::update\n+void update(const GridView &gv)\n+Update the stored grid view, to be called if the grid has changed.\n+Definition: compositebasis.hh:138\n+Dune::Functions::CompositePreBasis::multiIndexBufferSize\n+static constexpr size_type multiIndexBufferSize\n+Definition: compositebasis.hh:85\n+Dune::Functions::CompositePreBasis::gridView\n+const GridView & gridView() const\n+Obtain the grid view that the basis is defined on.\n+Definition: compositebasis.hh:132\n+Dune::Functions::CompositePreBasis::minMultiIndexSize\n+static constexpr size_type minMultiIndexSize\n+Definition: compositebasis.hh:84\n+Dune::Functions::CompositePreBasis::maxMultiIndexSize\n+static constexpr size_type maxMultiIndexSize\n+Definition: compositebasis.hh:83\n+Dune::Functions::CompositeBasisNode\n+Definition: nodes.hh:219\n+concepts.hh\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00128.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00128.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: defaultglobalbasis.hh File Reference\n+dune-functions: hierarchicallagrangebasis.hh File Reference\n \n \n \n \n \n \n \n@@ -65,58 +65,57 @@\n
  • dune
  • functions
  • functionspacebases
  • \n \n \n
    \n \n-
    defaultglobalbasis.hh File Reference
    \n+
    hierarchicallagrangebasis.hh File Reference
    \n
    \n
    \n-
    #include <cstddef>
    \n-#include <type_traits>
    \n-#include <utility>
    \n-#include <dune/common/reservedvector.hh>
    \n-#include <dune/common/typeutilities.hh>
    \n-#include <dune/common/concept.hh>
    \n-#include <dune/functions/common/type_traits.hh>
    \n-#include <dune/functions/functionspacebases/defaultlocalview.hh>
    \n-#include <dune/functions/functionspacebases/concepts.hh>
    \n+
    #include <dune/common/exceptions.hh>
    \n+#include <dune/localfunctions/hierarchical/hierarchicalp2.hh>
    \n+#include <dune/functions/functionspacebases/nodes.hh>
    \n+#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
    \n+#include <dune/grid/common/mcmgmapper.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n+\n+\n+\n+\n \n

    \n Classes

    class  Dune::Functions::DefaultGlobalBasis< PB >
     Global basis for given pre-basis. More...
    class  Dune::Functions::HierarchicalLagrangePreBasis< GV, k, R >
     A pre-basis for a hierarchical basis. More...
     
    class  Dune::Functions::HierarchicalLagrangeNode< GV, k, R >
     
    \n \n \n \n \n \n \n \n-\n-\n+

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    namespace  Dune::Functions::BasisFactory
     
    namespace  Dune::Functions::BasisBuilder
     
    \n+\n+\n+\n+\n+\n

    \n+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. More...
     
    \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n

    \n 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<std::size_t k, typename R = double>
    auto Dune::Functions::BasisFactory::hierarchicalLagrange ()
     Create a pre-basis factory that can create a HierarchicalLagrange pre-basis. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,48 +5,43 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-Classes | Namespaces | Functions\n-defaultglobalbasis.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+Classes | Namespaces | Typedefs | Functions\n+hierarchicallagrangebasis.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::DefaultGlobalBasis<_PB_>\n-\u00a0 Global basis for given pre-basis. More...\n+class \u00a0Dune::Functions::HierarchicalLagrangePreBasis<_GV,_k,_R_>\n+\u00a0 A pre-basis for a hierarchical basis. More...\n+\u00a0\n+class \u00a0Dune::Functions::HierarchicalLagrangeNode<_GV,_k,_R_>\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n namespace \u00a0Dune::Functions::BasisFactory\n \u00a0\n-namespace \u00a0Dune::Functions::BasisBuilder\n+ Typedefs\n+template\n+using\u00a0Dune::Functions::HierarchicalLagrangeBasis = DefaultGlobalBasis<\n+ HierarchicalLagrangePreBasis< GV, k, R > >\n+\u00a0 Basis of a scalar Hierarchical Lagrange finite element space. More...\n \u00a0\n Functions\n-template\n- \u00a0Dune::Functions::DefaultGlobalBasis (PreBasis &&) -> DefaultGlobalBasis<\n- std::decay_t< PreBasis > >\n-\u00a0\n-template\n- \u00a0Dune::Functions::DefaultGlobalBasis (const GridView &gv, PreBasisFactory\n- &&f) -> DefaultGlobalBasis< std::decay_t< decltype(f(gv))> >\n-\u00a0\n-template\n-auto\u00a0Dune::Functions::BasisFactory::makeBasis (const GridView &gridView,\n- PreBasisFactory &&preBasisFactory)\n+template\n+auto\u00a0Dune::Functions::BasisFactory::hierarchicalLagrange ()\n+\u00a0 Create a pre-basis factory that can create a HierarchicalLagrange pre-\n+ basis. More...\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00128_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00128_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: defaultglobalbasis.hh Source File\n+dune-functions: hierarchicallagrangebasis.hh Source File\n \n \n \n \n \n \n \n@@ -62,203 +62,265 @@\n \n \n
    \n
    \n-
    defaultglobalbasis.hh
    \n+
    hierarchicallagrangebasis.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH
    \n
    5
    \n-
    6#include <cstddef>
    \n-
    7#include <type_traits>
    \n-
    8#include <utility>
    \n-
    9
    \n-
    10#include <dune/common/reservedvector.hh>
    \n-
    11#include <dune/common/typeutilities.hh>
    \n-
    12#include <dune/common/concept.hh>
    \n-
    13
    \n-\n-\n-\n-
    17
    \n-
    18
    \n-
    19
    \n-
    20namespace Dune {
    \n-
    21namespace Functions {
    \n-
    22
    \n-
    23
    \n-
    24
    \n-
    44template<class PB>
    \n-\n-
    46{
    \n-
    47
    \n-
    48public:
    \n-
    49
    \n-
    51 using PreBasis = PB;
    \n-
    52
    \n-
    54 using PrefixPath = TypeTree::HybridTreePath<>;
    \n-
    55
    \n-
    57 using GridView = typename PreBasis::GridView;
    \n-
    58
    \n-
    60 using size_type = std::size_t;
    \n-
    61
    \n-\n-
    64
    \n-\n-
    67
    \n-
    69 using SizePrefix = Dune::ReservedVector<std::size_t, PreBasis::multiIndexBufferSize>;
    \n-
    70
    \n-
    79 template<class... T,
    \n-
    80 disableCopyMove<DefaultGlobalBasis, T...> = 0,
    \n-\n-\n-
    83 preBasis_(std::forward<T>(t)...),
    \n-\n-
    85 {
    \n-
    86 static_assert(models<Concept::PreBasis<GridView>, PreBasis>(), "Type passed to DefaultGlobalBasis does not model the PreBasis concept.");
    \n-
    87 preBasis_.initializeIndices();
    \n-
    88 }
    \n-
    89
    \n-
    96 template<class PreBasisFactory,
    \n-
    97 std::enable_if_t<Dune::IsCallable<PreBasisFactory(GridView), PreBasis>::value, int> = 0>
    \n-
    98 DefaultGlobalBasis(const GridView& gridView, PreBasisFactory&& factory) :
    \n-
    99 preBasis_(factory(gridView)),
    \n-\n-
    101 {
    \n-
    102 static_assert(models<Concept::PreBasis<GridView>, PreBasis>(), "Type passed to DefaultGlobalBasis does not model the PreBasis concept.");
    \n-
    103 preBasis_.initializeIndices();
    \n-
    104 }
    \n-
    105
    \n-
    107 const GridView& gridView() const
    \n-
    108 {
    \n-
    109 return preBasis_.gridView();
    \n-
    110 }
    \n-
    111
    \n-
    113 const PreBasis& preBasis() const
    \n-
    114 {
    \n-
    115 return preBasis_;
    \n-
    116 }
    \n-
    117
    \n-\n-
    120 {
    \n-
    121 return preBasis_;
    \n-
    122 }
    \n-
    123
    \n-
    130 void update(const GridView & gv)
    \n-
    131 {
    \n-
    132 preBasis_.update(gv);
    \n-
    133 preBasis_.initializeIndices();
    \n-
    134 }
    \n-
    135
    \n-\n-
    138 {
    \n-
    139 return preBasis_.dimension();
    \n-
    140 }
    \n+
    6#include <dune/common/exceptions.hh>
    \n+
    7#include <dune/localfunctions/hierarchical/hierarchicalp2.hh>
    \n+
    8
    \n+\n+\n+
    11#include <dune/grid/common/mcmgmapper.hh>
    \n+
    12
    \n+
    13namespace Dune {
    \n+
    14 namespace Functions {
    \n+
    15
    \n+
    16 // *****************************************************************************
    \n+
    17 // Implementation for Hierarchical Lagrange Basis
    \n+
    18 //
    \n+
    19 // -- only order k=2 is implemented up to now --
    \n+
    20 // -- currently only supports simplex grids --
    \n+
    21 //
    \n+
    22 // This is the reusable part of the HierarchicalLagrangeBasis. It contains
    \n+
    23 //
    \n+
    24 // HierarchicalLagrangePreBasis
    \n+
    25 // HierarchicalLagrangeNode
    \n+
    26 //
    \n+
    27 // The pre-basis allows to create the others and is the owner of possible shared
    \n+
    28 // state. These components do _not_ depend on the global basis and can be
    \n+
    29 // used without a global basis.
    \n+
    30 // *****************************************************************************
    \n+
    31
    \n+
    32 template<typename GV, int k, typename R=double>
    \n+
    33 class HierarchicalLagrangeNode;
    \n+
    34
    \n+
    35 template<typename GV, int k, typename R=double>
    \n+
    36 class HierarchicalLagrangePreBasis;
    \n+
    37
    \n+
    47 template<typename GV, int k, typename R>
    \n+\n+
    49 {
    \n+
    50 static const int dim = GV::dimension;
    \n+
    51
    \n+
    52 public:
    \n+
    53
    \n+
    55 using GridView = GV;
    \n+
    56
    \n+
    58 using size_type = std::size_t;
    \n+
    59
    \n+\n+
    62
    \n+
    63 static constexpr size_type maxMultiIndexSize = 1;
    \n+
    64 static constexpr size_type minMultiIndexSize = 1;
    \n+
    65 static constexpr size_type multiIndexBufferSize = 1;
    \n+
    66
    \n+\n+
    72 {}
    \n+
    73
    \n+\n+
    76 {}
    \n+
    77
    \n+
    79 const GridView& gridView() const
    \n+
    80 {
    \n+
    81 return gridView_;
    \n+
    82 }
    \n+
    83
    \n+
    85 void update (const GridView& gv)
    \n+
    86 {
    \n+
    87 gridView_ = gv;
    \n+
    88 mcmgMapper_.update(gv);
    \n+
    89 }
    \n+
    90
    \n+
    94 Node makeNode() const
    \n+
    95 {
    \n+
    96 return Node{};
    \n+
    97 }
    \n+
    98
    \n+\n+
    101 {
    \n+
    102 return mcmgMapper_.size();
    \n+
    103 }
    \n+
    104
    \n+
    106 template<class SizePrefix>
    \n+
    107 size_type size(const SizePrefix prefix) const
    \n+
    108 {
    \n+
    109 assert(prefix.size() == 0 || prefix.size() == 1);
    \n+
    110 return (prefix.size() == 0) ? size() : 0;
    \n+
    111 }
    \n+
    112
    \n+\n+
    115 {
    \n+
    116 return size();
    \n+
    117 }
    \n+
    118
    \n+\n+
    124 {
    \n+
    125 // That cast to unsigned int is necessary because GV::dimension is an enum
    \n+
    126 return Dune::binomial(std::size_t(order() + (unsigned int)GV::dimension),std::size_t(order()));
    \n+
    127 }
    \n+
    128
    \n+
    129 template<typename It>
    \n+
    130 It indices(const Node& node, It it) const
    \n+
    131 {
    \n+
    132 for (size_type i = 0, end = node.finiteElement().size() ; i < end ; ++it, ++i)
    \n+
    133 {
    \n+
    134 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
    \n+
    135 const auto& element = node.element();
    \n+
    136
    \n+
    137 *it = {{ (size_type)(mcmgMapper_.subIndex(element,localKey.subEntity(),localKey.codim())) }};
    \n+
    138 }
    \n+
    139 return it;
    \n+
    140 }
    \n
    141
    \n-\n-
    144 {
    \n-
    145 return preBasis_.size();
    \n-
    146 }
    \n-
    147
    \n-
    149 size_type size(const SizePrefix& prefix) const
    \n-
    150 {
    \n-
    151 return preBasis_.size(prefix);
    \n-
    152 }
    \n-
    153
    \n-\n-
    156 {
    \n-
    157 return LocalView(*this);
    \n-
    158 }
    \n-
    159
    \n-\n-
    162 {
    \n-
    163 return *this;
    \n-
    164 }
    \n-
    165
    \n-
    167 const PrefixPath& prefixPath() const
    \n-
    168 {
    \n-
    169 return prefixPath_;
    \n-
    170 }
    \n-
    171
    \n-
    172protected:
    \n-\n-\n-
    175};
    \n-
    176
    \n-
    177
    \n-
    178
    \n-
    179template<class PreBasis>
    \n-\n-
    181
    \n-
    182template<class GridView, class PreBasisFactory>
    \n-
    183DefaultGlobalBasis(const GridView& gv, PreBasisFactory&& f) -> DefaultGlobalBasis<std::decay_t<decltype(f(gv))>>;
    \n-
    184
    \n-
    185
    \n+
    142 protected:
    \n+\n+
    144
    \n+
    145 unsigned int order() const
    \n+
    146 {
    \n+
    147 return 2;
    \n+
    148 }
    \n+
    149
    \n+
    150 MultipleCodimMultipleGeomTypeMapper<GridView> mcmgMapper_;
    \n+
    151
    \n+
    152 private:
    \n+
    157 static auto p2Layout()
    \n+
    158 {
    \n+
    159 return [](Dune::GeometryType type, int gridDim)
    \n+
    160 {
    \n+
    161 if (type.isVertex())
    \n+
    162 return 1;
    \n+
    163 if (type.isLine())
    \n+
    164 return 1;
    \n+
    165 if (type.isTriangle())
    \n+
    166 return 0;
    \n+
    167 assert(type.isTetrahedron());
    \n+
    168 return 0;
    \n+
    169 };
    \n+
    170 }
    \n+
    171 };
    \n+
    172
    \n+
    173
    \n+
    174
    \n+
    175 template<typename GV, int k, typename R>
    \n+\n+
    177 public LeafBasisNode
    \n+
    178 {
    \n+
    179 static const int dim = GV::dimension;
    \n+
    180
    \n+
    181 public:
    \n+
    182
    \n+
    183 using size_type = std::size_t;
    \n+
    184 using Element = typename GV::template Codim<0>::Entity;
    \n+
    185 using FiniteElement = HierarchicalP2LocalFiniteElement<typename GV::ctype,R,dim>;
    \n
    186
    \n-
    187namespace BasisFactory {
    \n-
    188
    \n-
    189template<class GridView, class PreBasisFactory>
    \n-
    190auto makeBasis(const GridView& gridView, PreBasisFactory&& preBasisFactory)
    \n-
    191{
    \n-
    192 return DefaultGlobalBasis(preBasisFactory(gridView));
    \n-
    193}
    \n-
    194
    \n-
    195} // end namespace BasisFactory
    \n-
    196
    \n-
    197// Backward compatibility
    \n-
    198namespace BasisBuilder {
    \n-
    199
    \n-
    200 using namespace BasisFactory;
    \n-
    201
    \n-
    202}
    \n-
    203
    \n-
    204
    \n-
    205} // end namespace Functions
    \n-
    206} // end namespace Dune
    \n-
    207
    \n-
    208
    \n-
    209
    \n-
    210#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH
    \n-\n-\n-
    typename std::enable_if< std::is_constructible< T, Args... >::value, int >::type enableIfConstructible
    Helper to constrain forwarding constructors.
    Definition: type_traits.hh:26
    \n+\n+\n+
    189 element_(nullptr)
    \n+
    190 {}
    \n+
    191
    \n+
    193 const Element& element() const
    \n+
    194 {
    \n+
    195 return *element_;
    \n+
    196 }
    \n+
    197
    \n+\n+
    203 {
    \n+
    204 return finiteElement_;
    \n+
    205 }
    \n+
    206
    \n+
    208 void bind(const Element& e)
    \n+
    209 {
    \n+
    210 element_ = &e;
    \n+
    211
    \n+
    212 if (e.type() != finiteElement_.type())
    \n+
    213 DUNE_THROW(Dune::Exception,
    \n+
    214 "HierarchicalLagrange-elements do not exist for elements of type " << e.type());
    \n+
    215
    \n+
    216 this->setSize(finiteElement_.size());
    \n+
    217 }
    \n+
    218
    \n+
    219 protected:
    \n+
    220
    \n+
    221 unsigned int order() const
    \n+
    222 {
    \n+
    223 return 2;
    \n+
    224 }
    \n+
    225
    \n+\n+\n+
    228 };
    \n+
    229
    \n+
    230
    \n+
    231
    \n+
    232 namespace BasisFactory {
    \n+
    233
    \n+
    242 template<std::size_t k, typename R=double>
    \n+\n+
    244 {
    \n+
    245 return [](const auto& gridView) {
    \n+
    246 return HierarchicalLagrangePreBasis<std::decay_t<decltype(gridView)>, k, R>(gridView);
    \n+
    247 };
    \n+
    248 }
    \n+
    249
    \n+
    250 } // end namespace BasisFactory
    \n+
    251
    \n+
    262 template<typename GV, int k, typename R=double>
    \n+\n+
    264
    \n+
    265 } // end namespace Functions
    \n+
    266} // end namespace Dune
    \n+
    267
    \n+
    268#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH
    \n+\n+\n+
    auto hierarchicalLagrange()
    Create a pre-basis factory that can create a HierarchicalLagrange pre-basis.
    Definition: hierarchicallagrangebasis.hh:243
    \n
    Definition: polynomial.hh:10
    \n-
    DefaultGlobalBasis(PreBasis &&) -> DefaultGlobalBasis< std::decay_t< PreBasis > >
    \n-
    auto makeBasis(const GridView &gridView, PreBasisFactory &&preBasisFactory)
    Definition: defaultglobalbasis.hh:190
    \n
    Global basis for given pre-basis.
    Definition: defaultglobalbasis.hh:46
    \n-
    Dune::ReservedVector< std::size_t, PreBasis::multiIndexBufferSize > SizePrefix
    Type used for prefixes handed to the size() method.
    Definition: defaultglobalbasis.hh:69
    \n-
    std::size_t size_type
    Type used for indices and size information.
    Definition: defaultglobalbasis.hh:60
    \n-
    typename PreBasis::GridView GridView
    The grid view that the FE space is defined on.
    Definition: defaultglobalbasis.hh:57
    \n-
    const GridView & gridView() const
    Obtain the grid view that the basis is defined on.
    Definition: defaultglobalbasis.hh:107
    \n-
    PB PreBasis
    Pre-basis providing the implementation details.
    Definition: defaultglobalbasis.hh:51
    \n-
    PreBasis & preBasis()
    Obtain the pre-basis providing the implementation details.
    Definition: defaultglobalbasis.hh:119
    \n-
    void update(const GridView &gv)
    Update the stored grid view.
    Definition: defaultglobalbasis.hh:130
    \n-
    DefaultLocalView< DefaultGlobalBasis< PreBasis > > LocalView
    Type of the local view on the restriction of the basis to a single element.
    Definition: defaultglobalbasis.hh:63
    \n-
    typename LocalView::MultiIndex MultiIndex
    Type used for global numbering of the basis vectors.
    Definition: defaultglobalbasis.hh:66
    \n-
    size_type size(const SizePrefix &prefix) const
    Return number of possible values for next position in multi index.
    Definition: defaultglobalbasis.hh:149
    \n-
    size_type dimension() const
    Get the total dimension of the space spanned by this basis.
    Definition: defaultglobalbasis.hh:137
    \n-
    PreBasis preBasis_
    Definition: defaultglobalbasis.hh:173
    \n-
    LocalView localView() const
    Return local view for basis.
    Definition: defaultglobalbasis.hh:155
    \n-
    TypeTree::HybridTreePath<> PrefixPath
    The empty prefix path that identifies the root in the local ansatz tree.
    Definition: defaultglobalbasis.hh:54
    \n-
    DefaultGlobalBasis(T &&... t)
    Constructor.
    Definition: defaultglobalbasis.hh:82
    \n-
    DefaultGlobalBasis(const GridView &gridView, PreBasisFactory &&factory)
    Constructor from a PreBasis factory.
    Definition: defaultglobalbasis.hh:98
    \n-
    size_type size() const
    Return number of possible values for next position in empty multi index.
    Definition: defaultglobalbasis.hh:143
    \n-
    const PreBasis & preBasis() const
    Obtain the pre-basis providing the implementation details.
    Definition: defaultglobalbasis.hh:113
    \n-
    PrefixPath prefixPath_
    Definition: defaultglobalbasis.hh:174
    \n-
    const DefaultGlobalBasis & rootBasis() const
    Return *this because we are not embedded in a larger basis.
    Definition: defaultglobalbasis.hh:161
    \n-
    const PrefixPath & prefixPath() const
    Return empty path, because this is the root in the local ansatz tree.
    Definition: defaultglobalbasis.hh:167
    \n-
    The restriction of a finite element basis to a single element.
    Definition: defaultlocalview.hh:28
    \n-
    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
    \n-\n+
    Definition: hierarchicallagrangebasis.hh:178
    \n+
    HierarchicalP2LocalFiniteElement< typename GV::ctype, R, dim > FiniteElement
    Definition: hierarchicallagrangebasis.hh:185
    \n+
    const Element & element() const
    Return current element, throw if unbound.
    Definition: hierarchicallagrangebasis.hh:193
    \n+
    void bind(const Element &e)
    Bind to element.
    Definition: hierarchicallagrangebasis.hh:208
    \n+
    const FiniteElement & finiteElement() const
    Return the LocalFiniteElement for the element we are bound to.
    Definition: hierarchicallagrangebasis.hh:202
    \n+
    const Element * element_
    Definition: hierarchicallagrangebasis.hh:227
    \n+
    const FiniteElement finiteElement_
    Definition: hierarchicallagrangebasis.hh:226
    \n+
    unsigned int order() const
    Definition: hierarchicallagrangebasis.hh:221
    \n+
    HierarchicalLagrangeNode()
    Definition: hierarchicallagrangebasis.hh:187
    \n+
    std::size_t size_type
    Definition: hierarchicallagrangebasis.hh:183
    \n+
    typename GV::template Codim< 0 >::Entity Element
    Definition: hierarchicallagrangebasis.hh:184
    \n+
    A pre-basis for a hierarchical basis.
    Definition: hierarchicallagrangebasis.hh:49
    \n+
    std::size_t size_type
    Type used for indices and size information.
    Definition: hierarchicallagrangebasis.hh:58
    \n+
    unsigned int order() const
    Definition: hierarchicallagrangebasis.hh:145
    \n+
    Node makeNode() const
    Create tree node.
    Definition: hierarchicallagrangebasis.hh:94
    \n+
    size_type maxNodeSize() const
    Get the maximal number of DOFs associated to node for any element.
    Definition: hierarchicallagrangebasis.hh:123
    \n+
    static constexpr size_type multiIndexBufferSize
    Definition: hierarchicallagrangebasis.hh:65
    \n+
    void update(const GridView &gv)
    Update the stored grid view & MultipleCodimMultipleGeomTypeMapper, to be called if the grid has chang...
    Definition: hierarchicallagrangebasis.hh:85
    \n+
    MultipleCodimMultipleGeomTypeMapper< GridView > mcmgMapper_
    Definition: hierarchicallagrangebasis.hh:150
    \n+
    size_type dimension() const
    Get the total dimension of the space spanned by this basis.
    Definition: hierarchicallagrangebasis.hh:114
    \n+
    GV GridView
    The grid view that the FE basis is defined on.
    Definition: hierarchicallagrangebasis.hh:55
    \n+
    HierarchicalLagrangePreBasis(const GridView &gv)
    Constructor for a given grid view object with layout for second order.
    Definition: hierarchicallagrangebasis.hh:71
    \n+
    static constexpr size_type maxMultiIndexSize
    Definition: hierarchicallagrangebasis.hh:63
    \n+
    size_type size(const SizePrefix prefix) const
    Return number of possible values for next position in multi index.
    Definition: hierarchicallagrangebasis.hh:107
    \n+
    const GridView & gridView() const
    Obtain the grid view that the basis is defined on.
    Definition: hierarchicallagrangebasis.hh:79
    \n+
    GridView gridView_
    Definition: hierarchicallagrangebasis.hh:143
    \n+
    size_type size() const
    Same as size(prefix) with empty prefix.
    Definition: hierarchicallagrangebasis.hh:100
    \n+
    void initializeIndices()
    Initialize the global indices.
    Definition: hierarchicallagrangebasis.hh:75
    \n+
    It indices(const Node &node, It it) const
    Definition: hierarchicallagrangebasis.hh:130
    \n+
    static constexpr size_type minMultiIndexSize
    Definition: hierarchicallagrangebasis.hh:64
    \n+
    void setSize(const size_type size)
    Definition: nodes.hh:164
    \n+
    Definition: nodes.hh:186
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,283 +5,355 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-defaultglobalbasis.hh\n+hierarchicallagrangebasis.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH\n 5\n- 6#include \n- 7#include \n- 8#include \n- 9\n- 10#include \n- 11#include \n- 12#include \n- 13\n- 14#include \n- 15#include \n- 16#include \n- 17\n- 18\n- 19\n- 20namespace Dune {\n- 21namespace Functions {\n- 22\n- 23\n- 24\n- 44template\n-45class DefaultGlobalBasis\n- 46{\n- 47\n- 48public:\n- 49\n-51 using PreBasis = PB;\n- 52\n-54 using PrefixPath = TypeTree::HybridTreePath<>;\n- 55\n-57 using GridView = typename PreBasis::GridView;\n- 58\n-60 using size_type = std::size_t;\n- 61\n-63 using LocalView = DefaultLocalView>;\n- 64\n-66 using MultiIndex = typename LocalView::MultiIndex;\n- 67\n-69 using SizePrefix = Dune::ReservedVector;\n- 70\n- 79 template = 0,\n- 81 enableIfConstructible = 0>\n-82 DefaultGlobalBasis(T&&... t) :\n- 83 preBasis_(std::forward(t)...),\n- 84 prefixPath_()\n- 85 {\n- 86 static_assert(models, PreBasis>(), \"Type passed\n-to DefaultGlobalBasis does not model the PreBasis concept.\");\n- 87 preBasis_.initializeIndices();\n- 88 }\n- 89\n- 96 template::\n-value, int> = 0>\n-98 DefaultGlobalBasis(const GridView& gridView, PreBasisFactory&& factory) :\n- 99 preBasis_(factory(gridView)),\n- 100 prefixPath_()\n+ 6#include \n+ 7#include \n+ 8\n+ 9#include \n+ 10#include \n+ 11#include \n+ 12\n+ 13namespace Dune {\n+ 14 namespace Functions {\n+ 15\n+ 16 /\n+/ *****************************************************************************\n+ 17 // Implementation for Hierarchical Lagrange Basis\n+ 18 //\n+ 19 // -- only order k=2 is implemented up to now --\n+ 20 // -- currently only supports simplex grids --\n+ 21 //\n+ 22 // This is the reusable part of the HierarchicalLagrangeBasis. It contains\n+ 23 //\n+ 24 // HierarchicalLagrangePreBasis\n+ 25 // HierarchicalLagrangeNode\n+ 26 //\n+ 27 // The pre-basis allows to create the others and is the owner of possible\n+shared\n+ 28 // state. These components do _not_ depend on the global basis and can be\n+ 29 // used without a global basis.\n+ 30 /\n+/ *****************************************************************************\n+ 31\n+ 32 template\n+ 33 class HierarchicalLagrangeNode;\n+ 34\n+ 35 template\n+ 36 class HierarchicalLagrangePreBasis;\n+ 37\n+ 47 template\n+48 class HierarchicalLagrangePreBasis\n+ 49 {\n+ 50 static const int dim = GV::dimension;\n+ 51\n+ 52 public:\n+ 53\n+55 using GridView = GV;\n+ 56\n+58 using size_type = std::size_t;\n+ 59\n+61 using Node = HierarchicalLagrangeNode;\n+ 62\n+63 static constexpr size_type maxMultiIndexSize = 1;\n+64 static constexpr size_type minMultiIndexSize = 1;\n+65 static constexpr size_type multiIndexBufferSize = 1;\n+ 66\n+71 HierarchicalLagrangePreBasis(const GridView& gv) : gridView_(gv) ,\n+mcmgMapper_(gv,p2Layout())\n+ 72 {}\n+ 73\n+75 void initializeIndices()\n+ 76 {}\n+ 77\n+79 const GridView& gridView() const\n+ 80 {\n+ 81 return gridView_;\n+ 82 }\n+ 83\n+85 void update (const GridView& gv)\n+ 86 {\n+ 87 gridView_ = gv;\n+ 88 mcmgMapper_.update(gv);\n+ 89 }\n+ 90\n+94 Node makeNode() const\n+ 95 {\n+ 96 return Node{};\n+ 97 }\n+ 98\n+100 size_type size() const\n 101 {\n- 102 static_assert(models, PreBasis>(), \"Type\n-passed to DefaultGlobalBasis does not model the PreBasis concept.\");\n- 103 preBasis_.initializeIndices();\n- 104 }\n- 105\n-107 const GridView& gridView() const\n+ 102 return mcmgMapper_.size();\n+ 103 }\n+ 104\n+ 106 template\n+107 size_type size(const SizePrefix prefix) const\n 108 {\n- 109 return preBasis_.gridView();\n- 110 }\n- 111\n-113 const PreBasis& preBasis() const\n- 114 {\n- 115 return preBasis_;\n- 116 }\n- 117\n-119 PreBasis& preBasis()\n- 120 {\n- 121 return preBasis_;\n- 122 }\n- 123\n-130 void update(const GridView & gv)\n+ 109 assert(prefix.size() == 0 || prefix.size() == 1);\n+ 110 return (prefix.size() == 0) ? size() : 0;\n+ 111 }\n+ 112\n+114 size_type dimension() const\n+ 115 {\n+ 116 return size();\n+ 117 }\n+ 118\n+123 size_type maxNodeSize() const\n+ 124 {\n+ 125 // That cast to unsigned int is necessary because GV::dimension is an enum\n+ 126 return Dune::binomial(std::size_t(order() + (unsigned int)GV::\n+dimension),std::size_t(order()));\n+ 127 }\n+ 128\n+ 129 template\n+130 It indices(const Node& node, It it) const\n 131 {\n- 132 preBasis_.update(gv);\n- 133 preBasis_.initializeIndices();\n- 134 }\n- 135\n-137 size_type dimension() const\n- 138 {\n- 139 return preBasis_.dimension();\n+ 132 for (size_type i = 0, end = node.finiteElement().size() ; i < end ; ++it,\n+++i)\n+ 133 {\n+ 134 Dune::LocalKey localKey = node.finiteElement().localCoefficients\n+().localKey(i);\n+ 135 const auto& element = node.element();\n+ 136\n+ 137 *it = {{ (size_type)(mcmgMapper_.subIndex(element,localKey.subEntity\n+(),localKey.codim())) }};\n+ 138 }\n+ 139 return it;\n 140 }\n 141\n-143 size_type size() const\n- 144 {\n- 145 return preBasis_.size();\n- 146 }\n- 147\n-149 size_type size(const SizePrefix& prefix) const\n- 150 {\n- 151 return preBasis_.size(prefix);\n- 152 }\n- 153\n-155 LocalView localView() const\n- 156 {\n- 157 return LocalView(*this);\n- 158 }\n- 159\n-161 const DefaultGlobalBasis& rootBasis() const\n- 162 {\n- 163 return *this;\n- 164 }\n- 165\n-167 const PrefixPath& prefixPath() const\n- 168 {\n- 169 return prefixPath_;\n+ 142 protected:\n+143 GridView gridView_;\n+ 144\n+145 unsigned int order() const\n+ 146 {\n+ 147 return 2;\n+ 148 }\n+ 149\n+150 MultipleCodimMultipleGeomTypeMapper mcmgMapper_;\n+ 151\n+ 152 private:\n+ 157 static auto p2Layout()\n+ 158 {\n+ 159 return [](Dune::GeometryType type, int gridDim)\n+ 160 {\n+ 161 if (type.isVertex())\n+ 162 return 1;\n+ 163 if (type.isLine())\n+ 164 return 1;\n+ 165 if (type.isTriangle())\n+ 166 return 0;\n+ 167 assert(type.isTetrahedron());\n+ 168 return 0;\n+ 169 };\n 170 }\n- 171\n- 172protected:\n-173 PreBasis preBasis_;\n-174 PrefixPath prefixPath_;\n- 175};\n- 176\n- 177\n- 178\n- 179template\n-180DefaultGlobalBasis(PreBasis&&) -> DefaultGlobalBasis>;\n- 181\n- 182template\n-183DefaultGlobalBasis(const GridView& gv, PreBasisFactory&& f) -\n-> DefaultGlobalBasis>;\n- 184\n- 185\n+ 171 };\n+ 172\n+ 173\n+ 174\n+ 175 template\n+176 class HierarchicalLagrangeNode :\n+ 177 public LeafBasisNode\n+ 178 {\n+ 179 static const int dim = GV::dimension;\n+ 180\n+ 181 public:\n+ 182\n+183 using size_type = std::size_t;\n+184 using Element = typename GV::template Codim<0>::Entity;\n+185 using FiniteElement = HierarchicalP2LocalFiniteElement;\n 186\n- 187namespace BasisFactory {\n- 188\n- 189template\n-190auto makeBasis(const GridView& gridView, PreBasisFactory&& preBasisFactory)\n- 191{\n- 192 return DefaultGlobalBasis(preBasisFactory(gridView));\n- 193}\n- 194\n- 195} // end namespace BasisFactory\n- 196\n- 197// Backward compatibility\n- 198namespace BasisBuilder {\n- 199\n- 200 using namespace BasisFactory;\n- 201\n- 202}\n- 203\n- 204\n- 205} // end namespace Functions\n- 206} // end namespace Dune\n- 207\n- 208\n- 209\n- 210#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH\n-type_traits.hh\n-defaultlocalview.hh\n-Dune::Functions::enableIfConstructible\n-typename std::enable_if< std::is_constructible< T, Args... >::value, int >::\n-type enableIfConstructible\n-Helper to constrain forwarding constructors.\n-Definition: type_traits.hh:26\n+187 HierarchicalLagrangeNode() :\n+ 188 finiteElement_(),\n+ 189 element_(nullptr)\n+ 190 {}\n+ 191\n+193 const Element& element() const\n+ 194 {\n+ 195 return *element_;\n+ 196 }\n+ 197\n+202 const FiniteElement& finiteElement() const\n+ 203 {\n+ 204 return finiteElement_;\n+ 205 }\n+ 206\n+208 void bind(const Element& e)\n+ 209 {\n+ 210 element_ = &e;\n+ 211\n+ 212 if (e.type() != finiteElement_.type())\n+ 213 DUNE_THROW(Dune::Exception,\n+ 214 \"HierarchicalLagrange-elements do not exist for elements of type \" <<\n+e.type());\n+ 215\n+ 216 this->setSize(finiteElement_.size());\n+ 217 }\n+ 218\n+ 219 protected:\n+ 220\n+221 unsigned int order() const\n+ 222 {\n+ 223 return 2;\n+ 224 }\n+ 225\n+226 const FiniteElement finiteElement_;\n+227 const Element* element_;\n+ 228 };\n+ 229\n+ 230\n+ 231\n+ 232 namespace BasisFactory {\n+ 233\n+ 242 template\n+243 auto hierarchicalLagrange()\n+ 244 {\n+ 245 return [](const auto& gridView) {\n+ 246 return HierarchicalLagrangePreBasis, k,\n+R>(gridView);\n+ 247 };\n+ 248 }\n+ 249\n+ 250 } // end namespace BasisFactory\n+ 251\n+ 262 template\n+263 using HierarchicalLagrangeBasis =\n+DefaultGlobalBasis >;\n+ 264\n+ 265 } // end namespace Functions\n+ 266} // end namespace Dune\n+ 267\n+ 268#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICALLAGRANGEBASIS_HH\n+nodes.hh\n+defaultglobalbasis.hh\n+Dune::Functions::BasisFactory::hierarchicalLagrange\n+auto hierarchicalLagrange()\n+Create a pre-basis factory that can create a HierarchicalLagrange pre-basis.\n+Definition: hierarchicallagrangebasis.hh:243\n Dune\n Definition: polynomial.hh:10\n Dune::Functions::DefaultGlobalBasis\n-DefaultGlobalBasis(PreBasis &&) -> DefaultGlobalBasis< std::decay_t< PreBasis >\n->\n-Dune::Functions::BasisFactory::makeBasis\n-auto makeBasis(const GridView &gridView, PreBasisFactory &&preBasisFactory)\n-Definition: defaultglobalbasis.hh:190\n-Dune::Functions::DefaultGlobalBasis\n Global basis for given pre-basis.\n Definition: defaultglobalbasis.hh:46\n-Dune::Functions::DefaultGlobalBasis::SizePrefix\n-Dune::ReservedVector< std::size_t, PreBasis::multiIndexBufferSize > SizePrefix\n-Type used for prefixes handed to the size() method.\n-Definition: defaultglobalbasis.hh:69\n-Dune::Functions::DefaultGlobalBasis::size_type\n+Dune::Functions::HierarchicalLagrangeNode\n+Definition: hierarchicallagrangebasis.hh:178\n+Dune::Functions::HierarchicalLagrangeNode::FiniteElement\n+HierarchicalP2LocalFiniteElement< typename GV::ctype, R, dim > FiniteElement\n+Definition: hierarchicallagrangebasis.hh:185\n+Dune::Functions::HierarchicalLagrangeNode::element\n+const Element & element() const\n+Return current element, throw if unbound.\n+Definition: hierarchicallagrangebasis.hh:193\n+Dune::Functions::HierarchicalLagrangeNode::bind\n+void bind(const Element &e)\n+Bind to element.\n+Definition: hierarchicallagrangebasis.hh:208\n+Dune::Functions::HierarchicalLagrangeNode::finiteElement\n+const FiniteElement & finiteElement() const\n+Return the LocalFiniteElement for the element we are bound to.\n+Definition: hierarchicallagrangebasis.hh:202\n+Dune::Functions::HierarchicalLagrangeNode::element_\n+const Element * element_\n+Definition: hierarchicallagrangebasis.hh:227\n+Dune::Functions::HierarchicalLagrangeNode::finiteElement_\n+const FiniteElement finiteElement_\n+Definition: hierarchicallagrangebasis.hh:226\n+Dune::Functions::HierarchicalLagrangeNode::order\n+unsigned int order() const\n+Definition: hierarchicallagrangebasis.hh:221\n+Dune::Functions::HierarchicalLagrangeNode::HierarchicalLagrangeNode\n+HierarchicalLagrangeNode()\n+Definition: hierarchicallagrangebasis.hh:187\n+Dune::Functions::HierarchicalLagrangeNode::size_type\n+std::size_t size_type\n+Definition: hierarchicallagrangebasis.hh:183\n+Dune::Functions::HierarchicalLagrangeNode::Element\n+typename GV::template Codim< 0 >::Entity Element\n+Definition: hierarchicallagrangebasis.hh:184\n+Dune::Functions::HierarchicalLagrangePreBasis\n+A pre-basis for a hierarchical basis.\n+Definition: hierarchicallagrangebasis.hh:49\n+Dune::Functions::HierarchicalLagrangePreBasis::size_type\n std::size_t size_type\n Type used for indices and size information.\n-Definition: defaultglobalbasis.hh:60\n-Dune::Functions::DefaultGlobalBasis::GridView\n-typename PreBasis::GridView GridView\n-The grid view that the FE space is defined on.\n-Definition: defaultglobalbasis.hh:57\n-Dune::Functions::DefaultGlobalBasis::gridView\n-const GridView & gridView() const\n-Obtain the grid view that the basis is defined on.\n-Definition: defaultglobalbasis.hh:107\n-Dune::Functions::DefaultGlobalBasis::PreBasis\n-PB PreBasis\n-Pre-basis providing the implementation details.\n-Definition: defaultglobalbasis.hh:51\n-Dune::Functions::DefaultGlobalBasis::preBasis\n-PreBasis & preBasis()\n-Obtain the pre-basis providing the implementation details.\n-Definition: defaultglobalbasis.hh:119\n-Dune::Functions::DefaultGlobalBasis::update\n+Definition: hierarchicallagrangebasis.hh:58\n+Dune::Functions::HierarchicalLagrangePreBasis::order\n+unsigned int order() const\n+Definition: hierarchicallagrangebasis.hh:145\n+Dune::Functions::HierarchicalLagrangePreBasis::makeNode\n+Node makeNode() const\n+Create tree node.\n+Definition: hierarchicallagrangebasis.hh:94\n+Dune::Functions::HierarchicalLagrangePreBasis::maxNodeSize\n+size_type maxNodeSize() const\n+Get the maximal number of DOFs associated to node for any element.\n+Definition: hierarchicallagrangebasis.hh:123\n+Dune::Functions::HierarchicalLagrangePreBasis::multiIndexBufferSize\n+static constexpr size_type multiIndexBufferSize\n+Definition: hierarchicallagrangebasis.hh:65\n+Dune::Functions::HierarchicalLagrangePreBasis::update\n void update(const GridView &gv)\n-Update the stored grid view.\n-Definition: defaultglobalbasis.hh:130\n-Dune::Functions::DefaultGlobalBasis::LocalView\n-DefaultLocalView< DefaultGlobalBasis< PreBasis > > LocalView\n-Type of the local view on the restriction of the basis to a single element.\n-Definition: defaultglobalbasis.hh:63\n-Dune::Functions::DefaultGlobalBasis::MultiIndex\n-typename LocalView::MultiIndex MultiIndex\n-Type used for global numbering of the basis vectors.\n-Definition: defaultglobalbasis.hh:66\n-Dune::Functions::DefaultGlobalBasis::size\n-size_type size(const SizePrefix &prefix) const\n-Return number of possible values for next position in multi index.\n-Definition: defaultglobalbasis.hh:149\n-Dune::Functions::DefaultGlobalBasis::dimension\n+Update the stored grid view & MultipleCodimMultipleGeomTypeMapper, to be called\n+if the grid has chang...\n+Definition: hierarchicallagrangebasis.hh:85\n+Dune::Functions::HierarchicalLagrangePreBasis::mcmgMapper_\n+MultipleCodimMultipleGeomTypeMapper< GridView > mcmgMapper_\n+Definition: hierarchicallagrangebasis.hh:150\n+Dune::Functions::HierarchicalLagrangePreBasis::dimension\n size_type dimension() const\n Get the total dimension of the space spanned by this basis.\n-Definition: defaultglobalbasis.hh:137\n-Dune::Functions::DefaultGlobalBasis::preBasis_\n-PreBasis preBasis_\n-Definition: defaultglobalbasis.hh:173\n-Dune::Functions::DefaultGlobalBasis::localView\n-LocalView localView() const\n-Return local view for basis.\n-Definition: defaultglobalbasis.hh:155\n-Dune::Functions::DefaultGlobalBasis::PrefixPath\n-TypeTree::HybridTreePath<> PrefixPath\n-The empty prefix path that identifies the root in the local ansatz tree.\n-Definition: defaultglobalbasis.hh:54\n-Dune::Functions::DefaultGlobalBasis::DefaultGlobalBasis\n-DefaultGlobalBasis(T &&... t)\n-Constructor.\n-Definition: defaultglobalbasis.hh:82\n-Dune::Functions::DefaultGlobalBasis::DefaultGlobalBasis\n-DefaultGlobalBasis(const GridView &gridView, PreBasisFactory &&factory)\n-Constructor from a PreBasis factory.\n-Definition: defaultglobalbasis.hh:98\n-Dune::Functions::DefaultGlobalBasis::size\n+Definition: hierarchicallagrangebasis.hh:114\n+Dune::Functions::HierarchicalLagrangePreBasis::GridView\n+GV GridView\n+The grid view that the FE basis is defined on.\n+Definition: hierarchicallagrangebasis.hh:55\n+Dune::Functions::HierarchicalLagrangePreBasis::HierarchicalLagrangePreBasis\n+HierarchicalLagrangePreBasis(const GridView &gv)\n+Constructor for a given grid view object with layout for second order.\n+Definition: hierarchicallagrangebasis.hh:71\n+Dune::Functions::HierarchicalLagrangePreBasis::maxMultiIndexSize\n+static constexpr size_type maxMultiIndexSize\n+Definition: hierarchicallagrangebasis.hh:63\n+Dune::Functions::HierarchicalLagrangePreBasis::size\n+size_type size(const SizePrefix prefix) const\n+Return number of possible values for next position in multi index.\n+Definition: hierarchicallagrangebasis.hh:107\n+Dune::Functions::HierarchicalLagrangePreBasis::gridView\n+const GridView & gridView() const\n+Obtain the grid view that the basis is defined on.\n+Definition: hierarchicallagrangebasis.hh:79\n+Dune::Functions::HierarchicalLagrangePreBasis::gridView_\n+GridView gridView_\n+Definition: hierarchicallagrangebasis.hh:143\n+Dune::Functions::HierarchicalLagrangePreBasis::size\n size_type size() const\n-Return number of possible values for next position in empty multi index.\n-Definition: defaultglobalbasis.hh:143\n-Dune::Functions::DefaultGlobalBasis::preBasis\n-const PreBasis & preBasis() const\n-Obtain the pre-basis providing the implementation details.\n-Definition: defaultglobalbasis.hh:113\n-Dune::Functions::DefaultGlobalBasis::prefixPath_\n-PrefixPath prefixPath_\n-Definition: defaultglobalbasis.hh:174\n-Dune::Functions::DefaultGlobalBasis::rootBasis\n-const DefaultGlobalBasis & rootBasis() const\n-Return *this because we are not embedded in a larger basis.\n-Definition: defaultglobalbasis.hh:161\n-Dune::Functions::DefaultGlobalBasis::prefixPath\n-const PrefixPath & prefixPath() const\n-Return empty path, because this is the root in the local ansatz tree.\n-Definition: defaultglobalbasis.hh:167\n-Dune::Functions::DefaultLocalView\n-The restriction of a finite element basis to a single element.\n-Definition: defaultlocalview.hh:28\n-Dune::Functions::DefaultLocalView::MultiIndex\n-std::conditional_t<(PreBasis::minMultiIndexSize==PreBasis::maxMultiIndexSize),\n-StaticMultiIndex< size_type, PreBasis::maxMultiIndexSize >, Dune::\n-ReservedVector< size_type, PreBasis::multiIndexBufferSize > > MultiIndex\n-Type used for global numbering of the basis vectors.\n-Definition: defaultlocalview.hh:64\n-concepts.hh\n+Same as size(prefix) with empty prefix.\n+Definition: hierarchicallagrangebasis.hh:100\n+Dune::Functions::HierarchicalLagrangePreBasis::initializeIndices\n+void initializeIndices()\n+Initialize the global indices.\n+Definition: hierarchicallagrangebasis.hh:75\n+Dune::Functions::HierarchicalLagrangePreBasis::indices\n+It indices(const Node &node, It it) const\n+Definition: hierarchicallagrangebasis.hh:130\n+Dune::Functions::HierarchicalLagrangePreBasis::minMultiIndexSize\n+static constexpr size_type minMultiIndexSize\n+Definition: hierarchicallagrangebasis.hh:64\n+Dune::Functions::BasisNodeMixin::setSize\n+void setSize(const size_type size)\n+Definition: nodes.hh:164\n+Dune::Functions::LeafBasisNode\n+Definition: nodes.hh:186\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00131.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00131.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: defaultlocalview.hh File Reference\n+dune-functions: hierarchicvectorwrapper.hh File Reference\n \n \n \n \n \n \n \n@@ -64,41 +64,53 @@\n \n \n \n
    \n \n-
    defaultlocalview.hh File Reference
    \n+Namespaces |\n+Functions
    \n+
    hierarchicvectorwrapper.hh File Reference
    \n \n
    \n-
    #include <tuple>
    \n-#include <optional>
    \n-#include <dune/common/concept.hh>
    \n+
    #include <dune/common/concept.hh>
    \n #include <dune/common/hybridutilities.hh>
    \n-#include <dune/common/reservedvector.hh>
    \n-#include <dune/functions/common/overflowarray.hh>
    \n-#include <dune/functions/common/multiindex.hh>
    \n+#include <dune/common/indices.hh>
    \n+#include <dune/functions/common/indexaccess.hh>
    \n+#include <dune/functions/common/utility.hh>
    \n+#include <dune/functions/common/type_traits.hh>
    \n #include <dune/functions/functionspacebases/concepts.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n+\n+\n \n

    \n Classes

    class  Dune::Functions::DefaultLocalView< GB >
     The restriction of a finite element basis to a single element. More...
    class  Dune::Functions::HierarchicVectorWrapper< V, CO >
     A wrapper providing multiindex access to vector entries. More...
     
    \n \n \n \n \n \n+

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n

    \n+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)
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,30 +5,43 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-Classes | Namespaces\n-defaultlocalview.hh File Reference\n-#include \n-#include \n+Classes | Namespaces | Functions\n+hierarchicvectorwrapper.hh File Reference\n #include \n #include \n-#include \n-#include \n-#include \n+#include \n+#include \n+#include \n+#include \n #include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::DefaultLocalView<_GB_>\n-\u00a0 The restriction of a finite element basis to a single element. More...\n+class \u00a0Dune::Functions::HierarchicVectorWrapper<_V,_CO_>\n+\u00a0 A wrapper providing multiindex access to vector entries. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n+ Functions\n+template\n+HierarchicVectorWrapper< V >\u00a0Dune::Functions::hierarchicVector (V &v)\n+\u00a0\n+template(), int >::type = 0>\n+ V &\u00a0Dune::Functions::\n+ makeHierarchicVectorForMultiIndex (V &v)\n+\u00a0\n+template(), int >::type = 0>\n+HierarchicVectorWrapper< V >\u00a0Dune::Functions::\n+ makeHierarchicVectorForMultiIndex (V &v)\n+\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00131_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00131_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: defaultlocalview.hh Source File\n+dune-functions: hierarchicvectorwrapper.hh Source File\n \n \n \n \n \n \n \n@@ -62,189 +62,275 @@\n \n \n
    \n
    \n-
    defaultlocalview.hh
    \n+
    hierarchicvectorwrapper.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICVECTORWRAPPER_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICVECTORWRAPPER_HH
    \n
    5
    \n-
    6
    \n-
    7#include <tuple>
    \n-
    8#include <optional>
    \n+
    6#include <dune/common/concept.hh>
    \n+
    7#include <dune/common/hybridutilities.hh>
    \n+
    8#include <dune/common/indices.hh>
    \n
    9
    \n-
    10#include <dune/common/concept.hh>
    \n-
    11#include <dune/common/hybridutilities.hh>
    \n-
    12#include <dune/common/reservedvector.hh>
    \n-
    13
    \n-\n-\n-\n-
    17
    \n+\n+\n+\n+\n+
    14
    \n+
    15
    \n+
    16namespace Dune {
    \n+
    17namespace Functions {
    \n
    18
    \n
    19
    \n-
    20namespace Dune {
    \n-
    21namespace Functions {
    \n+
    20
    \n+
    21namespace Imp {
    \n
    22
    \n-
    23
    \n-
    24
    \n-
    26template<class GB>
    \n-\n-
    28{
    \n-
    29public:
    \n-
    30
    \n-
    32 using GlobalBasis = GB;
    \n-
    33
    \n-
    35 using GridView = typename GlobalBasis::GridView;
    \n-
    36
    \n-
    38 using Element = typename GridView::template Codim<0>::Entity;
    \n-
    39
    \n-
    41 using size_type = std::size_t;
    \n-
    42
    \n-
    44 using Tree = typename GlobalBasis::PreBasis::Node;
    \n-
    45
    \n-
    46protected:
    \n-
    47
    \n-
    48 using PreBasis = typename GlobalBasis::PreBasis;
    \n-
    49
    \n-
    50 // Type used to store the multi indices of the basis vectors.
    \n-
    51 // In contrast to MultiIndex this always has dynamic size.
    \n-
    52 // It's guaranteed, that you can always cast it to MultiIndex
    \n-\n-
    54 std::conditional_t<(PreBasis::minMultiIndexSize == PreBasis::maxMultiIndexSize),
    \n-\n-
    56 Dune::ReservedVector<size_type, PreBasis::multiIndexBufferSize>>;
    \n-
    57
    \n-
    58public:
    \n+
    23 // Construct default coefficient type from vector and multiindex type
    \n+
    24 // This requires that MultiIndex has a static size. Otherwise the
    \n+
    25 // vector type itself is returned.
    \n+
    26 template<class V, class MultiIndex>
    \n+
    27 struct CoefficientType
    \n+
    28 {
    \n+
    29 template<class E, std::size_t size>
    \n+
    30 struct DefaultCoefficientTypeHelper
    \n+
    31 {
    \n+
    32 using E0 = decltype(std::declval<E>()[Dune::Indices::_0]);
    \n+
    33 using type = typename DefaultCoefficientTypeHelper<E0, size-1>::type;
    \n+
    34 };
    \n+
    35
    \n+
    36 template<class E>
    \n+
    37 struct DefaultCoefficientTypeHelper<E, 0>
    \n+
    38 {
    \n+
    39 using type = E;
    \n+
    40 };
    \n+
    41
    \n+
    42 template<class MI,
    \n+
    43 typename std::enable_if<HasStaticSize<MI>::value, int>::type = 0>
    \n+
    44 static constexpr std::size_t getStaticSizeOrZero()
    \n+
    45 {
    \n+
    46 return StaticSize<MI>::value;
    \n+
    47 }
    \n+
    48
    \n+
    49 template<class MI,
    \n+
    50 typename std::enable_if<not HasStaticSize<MI>::value, int>::type = 0>
    \n+
    51 static constexpr std::size_t getStaticSizeOrZero()
    \n+
    52 {
    \n+
    53 return 0;
    \n+
    54 }
    \n+
    55
    \n+
    56 using type = typename DefaultCoefficientTypeHelper<V, getStaticSizeOrZero<MultiIndex>()>::type;
    \n+
    57 };
    \n+
    58
    \n
    59
    \n-
    61 using MultiIndex =
    \n-
    62 std::conditional_t<(PreBasis::minMultiIndexSize == PreBasis::maxMultiIndexSize),
    \n-\n-
    64 Dune::ReservedVector<size_type, PreBasis::multiIndexBufferSize>>;
    \n+
    60
    \n+
    61 // This tag class is used as Coefficient template parameter
    \n+
    62 // for HierarchicVectorWrapper if the coefficient type should
    \n+
    63 // be deduced.
    \n+
    64 struct DeducedCoefficientTag {};
    \n
    65
    \n-
    66
    \n-\n-\n-
    70 tree_(globalBasis_->preBasis().makeNode())
    \n-
    71 {
    \n-
    72 static_assert(models<Concept::BasisTree<GridView>, Tree>(), "Tree type passed to DefaultLocalView does not model the BasisNode concept.");
    \n-\n-
    74 }
    \n-
    75
    \n-
    81 void bind(const Element& e)
    \n-
    82 {
    \n-
    83 element_ = e;
    \n-\n-
    85 indices_.resize(size());
    \n-
    86 globalBasis_->preBasis().indices(tree_, indices_.begin());
    \n-
    87 }
    \n-
    88
    \n-
    91 [[deprecated("Use the bound() method instead")]]
    \n-
    92 bool isBound() const {
    \n-
    93 return static_cast<bool>(element_);
    \n-
    94 }
    \n-
    95
    \n-
    98 bool bound() const
    \n-
    99 {
    \n-
    100 return static_cast<bool>(element_);
    \n-
    101 }
    \n-
    102
    \n-
    107 const Element& element() const
    \n-
    108 {
    \n-
    109 return *element_;
    \n+
    66} // namespace Imp
    \n+
    67
    \n+
    68
    \n+
    69
    \n+
    90template<class V, class CO=Imp::DeducedCoefficientTag>
    \n+\n+
    92{
    \n+
    93 template<class MultiIndex>
    \n+
    94 using Coefficient = typename std::conditional< std::is_same<Imp::DeducedCoefficientTag,CO>::value and HasStaticSize<MultiIndex>::value,
    \n+
    95 typename Imp::CoefficientType<V, MultiIndex>::type,
    \n+
    96 CO
    \n+
    97 >::type;
    \n+
    98
    \n+
    99
    \n+
    100 using size_type = std::size_t;
    \n+
    101
    \n+
    102 template<class C, class SizeProvider,
    \n+
    103 typename std::enable_if< not models<Concept::HasResize, C>(), int>::type = 0,
    \n+
    104 typename std::enable_if< not models<Concept::HasSizeMethod, C>(), int>::type = 0>
    \n+
    105 static void resizeHelper(C& c, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
    \n+
    106 {
    \n+
    107 auto size = sizeProvider.size(prefix);
    \n+
    108 if (size != 0)
    \n+
    109 DUNE_THROW(RangeError, "Can't resize scalar vector entry v[" << prefix << "] to size(" << prefix << ")=" << size);
    \n
    110 }
    \n
    111
    \n-
    116 void unbind()
    \n-
    117 {
    \n-
    118 element_.reset();
    \n-
    119 }
    \n-
    120
    \n-
    125 const Tree& tree() const
    \n-
    126 {
    \n-
    127 return tree_;
    \n-
    128 }
    \n-
    129
    \n-\n-
    133 {
    \n-
    134 return tree_.size();
    \n-
    135 }
    \n-
    136
    \n-\n-
    144 {
    \n-
    145 return globalBasis_->preBasis().maxNodeSize();
    \n-
    146 }
    \n-
    147
    \n-
    149 const MultiIndex& index(size_type i) const
    \n-
    150 {
    \n-
    151 return indices_[i];
    \n-
    152 }
    \n+
    112 struct StaticResizeHelper
    \n+
    113 {
    \n+
    114 template<class I, class C, class SizeProvider>
    \n+
    115 static void apply(I&& i, C& c, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
    \n+
    116 {
    \n+
    117 prefix.back() = i;
    \n+
    118 resizeHelper(c[i], sizeProvider, prefix);
    \n+
    119 }
    \n+
    120 };
    \n+
    121
    \n+
    122 template<class C, class SizeProvider,
    \n+
    123 typename std::enable_if< not models<Concept::HasResize, C>(), int>::type = 0,
    \n+
    124 typename std::enable_if< models<Concept::HasSizeMethod, C>(), int>::type = 0>
    \n+
    125 static void resizeHelper(C& c, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
    \n+
    126 {
    \n+
    127 auto size = sizeProvider.size(prefix);
    \n+
    128 if (size == 0)
    \n+
    129 return;
    \n+
    130
    \n+
    131 if (c.size() != size)
    \n+
    132 DUNE_THROW(RangeError, "Can't resize statically sized vector entry v[" << prefix << "] of size " << c.size() << " to size(" << prefix << ")=" << size);
    \n+
    133
    \n+
    134 using namespace Dune::Hybrid;
    \n+
    135 prefix.push_back(0);
    \n+
    136 forEach(integralRange(Hybrid::size(c)), [&](auto&& i) {
    \n+
    137 StaticResizeHelper::apply(i, c, sizeProvider, prefix);
    \n+
    138 });
    \n+
    139 }
    \n+
    140
    \n+
    141 template<class C, class SizeProvider,
    \n+
    142 typename std::enable_if< models<Concept::HasResize, C>(), int>::type = 0>
    \n+
    143 static void resizeHelper(C& c, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
    \n+
    144 {
    \n+
    145 auto size = sizeProvider.size(prefix);
    \n+
    146 if (size==0)
    \n+
    147 {
    \n+
    148 if (c.size()==0)
    \n+
    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.");
    \n+
    150 else
    \n+
    151 return;
    \n+
    152 }
    \n
    153
    \n-\n-
    157 {
    \n-
    158 return *globalBasis_;
    \n-
    159 }
    \n-
    160
    \n-\n-
    162 {
    \n-
    163 return *this;
    \n-
    164 }
    \n-
    165
    \n-
    166protected:
    \n-\n-
    168 std::optional<Element> element_;
    \n-\n-
    170 std::vector<MultiIndexStorage> indices_;
    \n-
    171};
    \n-
    172
    \n-
    173
    \n-
    174
    \n-
    175} // end namespace Functions
    \n-
    176} // end namespace Dune
    \n-
    177
    \n-
    178
    \n-
    179
    \n-
    180#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH
    \n-\n-\n+
    154 c.resize(size);
    \n+
    155 prefix.push_back(0);
    \n+
    156 for(std::size_t i=0; i<size; ++i)
    \n+
    157 {
    \n+
    158 prefix.back() = i;
    \n+
    159 resizeHelper(c[i], sizeProvider, prefix);
    \n+
    160 }
    \n+
    161 }
    \n+
    162
    \n+
    163
    \n+
    164
    \n+
    165public:
    \n+
    166
    \n+
    167 using Vector = V;
    \n+
    168
    \n+
    169 template<class MultiIndex>
    \n+
    170 using Entry = Coefficient<MultiIndex>;
    \n+
    171
    \n+\n+
    173 vector_(&vector)
    \n+
    174 {}
    \n+
    175
    \n+
    176 template<class SizeProvider>
    \n+
    177 void resize(const SizeProvider& sizeProvider)
    \n+
    178 {
    \n+
    179 typename SizeProvider::SizePrefix prefix;
    \n+
    180 prefix.resize(0);
    \n+
    181 resizeHelper(*vector_, sizeProvider, prefix);
    \n+
    182 }
    \n+
    183
    \n+
    184 template<class MultiIndex>
    \n+
    185 const Entry<MultiIndex>& operator[](const MultiIndex& index) const
    \n+
    186 {
    \n+
    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!");
    \n+
    188 return hybridMultiIndexAccess<const Entry<MultiIndex>&>(*vector_, index);
    \n+
    189 }
    \n+
    190
    \n+
    191 template<class MultiIndex>
    \n+
    192 Entry<MultiIndex>& operator[](const MultiIndex& index)
    \n+
    193 {
    \n+
    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!");
    \n+
    195 return hybridMultiIndexAccess<Entry<MultiIndex>&>(*vector_, index);
    \n+
    196 }
    \n+
    197
    \n+
    198 template<class MultiIndex>
    \n+
    199 const Entry<MultiIndex>& operator()(const MultiIndex& index) const
    \n+
    200 {
    \n+
    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!");
    \n+
    202 return (*this)[index];
    \n+
    203 }
    \n+
    204
    \n+
    205 template<class MultiIndex>
    \n+
    206 Entry<MultiIndex>& operator()(const MultiIndex& index)
    \n+
    207 {
    \n+
    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!");
    \n+
    209 return (*this)[index];
    \n+
    210 }
    \n+
    211
    \n+
    212 const Vector& vector() const
    \n+
    213 {
    \n+
    214 return *vector_;
    \n+
    215 }
    \n+
    216
    \n+\n+
    218 {
    \n+
    219 return *vector_;
    \n+
    220 }
    \n+
    221
    \n+
    222private:
    \n+
    223
    \n+
    224 Vector* vector_;
    \n+
    225};
    \n+
    226
    \n+
    227
    \n+
    228
    \n+
    229
    \n+
    230template<class V>
    \n+\n+
    232{
    \n+\n+
    234}
    \n+
    235
    \n+
    236
    \n+
    237
    \n+
    238template<class MultiIndex, class V,
    \n+
    239 typename std::enable_if< models<Concept::HasIndexAccess, V, MultiIndex>(), int>::type = 0>
    \n+\n+
    241{
    \n+
    242 return v;
    \n+
    243}
    \n+
    244
    \n+
    245
    \n+
    246
    \n+
    247template<class MultiIndex, class V,
    \n+
    248 typename std::enable_if< not models<Concept::HasIndexAccess, V, MultiIndex>(), int>::type = 0>
    \n+\n+
    250{
    \n+\n+
    252}
    \n+
    253
    \n+
    254
    \n+
    255
    \n+
    256} // namespace Dune::Functions
    \n+
    257} // namespace Dune
    \n+
    258
    \n+
    259
    \n+
    260#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICVECTORWRAPPER_HH
    \n+\n+\n+\n
    Definition: polynomial.hh:10
    \n-
    void bindTree(Tree &tree, const Entity &entity, std::size_t offset=0)
    Definition: nodes.hh:253
    \n-
    void initializeTree(Tree &tree, std::size_t treeIndexOffset=0)
    Definition: nodes.hh:260
    \n-
    A statically sized MultiIndex type.
    Definition: multiindex.hh:25
    \n-
    A dynamically sized array-like class with overflow.
    Definition: overflowarray.hh:45
    \n-
    The restriction of a finite element basis to a single element.
    Definition: defaultlocalview.hh:28
    \n-
    typename GlobalBasis::PreBasis PreBasis
    Definition: defaultlocalview.hh:48
    \n-
    void unbind()
    Unbind from the current element.
    Definition: defaultlocalview.hh:116
    \n-
    bool bound() const
    Return if the view is bound to a grid element.
    Definition: defaultlocalview.hh:98
    \n-
    typename GlobalBasis::GridView GridView
    The grid view the global FE basis lives on.
    Definition: defaultlocalview.hh:35
    \n-
    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
    \n-
    std::optional< Element > element_
    Definition: defaultlocalview.hh:168
    \n-
    typename GridView::template Codim< 0 >::Entity Element
    Type of the grid element we are bound to.
    Definition: defaultlocalview.hh:38
    \n-
    const Tree & tree() const
    Return the local ansatz tree associated to the bound entity.
    Definition: defaultlocalview.hh:125
    \n-
    void bind(const Element &e)
    Bind the view to a grid element.
    Definition: defaultlocalview.hh:81
    \n-
    const Element & element() const
    Return the grid element that the view is bound to.
    Definition: defaultlocalview.hh:107
    \n-
    size_type size() const
    Total number of degrees of freedom on this element.
    Definition: defaultlocalview.hh:132
    \n-
    GB GlobalBasis
    The global FE basis that this is a view on.
    Definition: defaultlocalview.hh:32
    \n-
    Tree tree_
    Definition: defaultlocalview.hh:169
    \n-
    size_type maxSize() const
    Maximum local size for any element on the GridView.
    Definition: defaultlocalview.hh:143
    \n-
    std::size_t size_type
    The type used for sizes.
    Definition: defaultlocalview.hh:41
    \n-
    bool isBound() const
    Return if the view is bound to a grid element.
    Definition: defaultlocalview.hh:92
    \n-
    const DefaultLocalView & rootLocalView() const
    Definition: defaultlocalview.hh:161
    \n-
    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
    \n-
    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
    \n-
    std::vector< MultiIndexStorage > indices_
    Definition: defaultlocalview.hh:170
    \n-
    typename GlobalBasis::PreBasis::Node Tree
    Tree of local finite elements / local shape function sets.
    Definition: defaultlocalview.hh:44
    \n-
    DefaultLocalView(const GlobalBasis &globalBasis)
    Construct local view for a given global finite element basis.
    Definition: defaultlocalview.hh:68
    \n-
    const GlobalBasis * globalBasis_
    Definition: defaultlocalview.hh:167
    \n-
    const GlobalBasis & globalBasis() const
    Return the global basis that we are a view on.
    Definition: defaultlocalview.hh:156
    \n+
    V & makeHierarchicVectorForMultiIndex(V &v)
    Definition: hierarchicvectorwrapper.hh:240
    \n+
    HierarchicVectorWrapper< V > hierarchicVector(V &v)
    Definition: hierarchicvectorwrapper.hh:231
    \n+
    Check if type is a statically sized container.
    Definition: type_traits.hh:83
    \n+
    A wrapper providing multiindex access to vector entries.
    Definition: hierarchicvectorwrapper.hh:92
    \n+
    Entry< MultiIndex > & operator()(const MultiIndex &index)
    Definition: hierarchicvectorwrapper.hh:206
    \n+
    Entry< MultiIndex > & operator[](const MultiIndex &index)
    Definition: hierarchicvectorwrapper.hh:192
    \n+
    const Entry< MultiIndex > & operator[](const MultiIndex &index) const
    Definition: hierarchicvectorwrapper.hh:185
    \n+
    Vector & vector()
    Definition: hierarchicvectorwrapper.hh:217
    \n+
    V Vector
    Definition: hierarchicvectorwrapper.hh:167
    \n+
    Coefficient< MultiIndex > Entry
    Definition: hierarchicvectorwrapper.hh:170
    \n+
    const Vector & vector() const
    Definition: hierarchicvectorwrapper.hh:212
    \n+
    HierarchicVectorWrapper(Vector &vector)
    Definition: hierarchicvectorwrapper.hh:172
    \n+
    const Entry< MultiIndex > & operator()(const MultiIndex &index) const
    Definition: hierarchicvectorwrapper.hh:199
    \n+
    void resize(const SizeProvider &sizeProvider)
    Definition: hierarchicvectorwrapper.hh:177
    \n \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,271 +5,328 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-defaultlocalview.hh\n+hierarchicvectorwrapper.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICVECTORWRAPPER_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICVECTORWRAPPER_HH\n 5\n- 6\n- 7#include \n- 8#include \n+ 6#include \n+ 7#include \n+ 8#include \n 9\n- 10#include \n- 11#include \n- 12#include \n- 13\n- 14#include \n- 15#include \n- 16#include \n- 17\n+ 10#include \n+ 11#include \n+ 12#include \n+ 13#include \n+ 14\n+ 15\n+ 16namespace Dune {\n+ 17namespace Functions {\n 18\n 19\n- 20namespace Dune {\n- 21namespace Functions {\n+ 20\n+ 21namespace Imp {\n 22\n- 23\n- 24\n- 26template\n-27class DefaultLocalView\n- 28{\n- 29public:\n- 30\n-32 using GlobalBasis = GB;\n- 33\n-35 using GridView = typename GlobalBasis::GridView;\n- 36\n-38 using Element = typename GridView::template Codim<0>::Entity;\n- 39\n-41 using size_type = std::size_t;\n- 42\n-44 using Tree = typename GlobalBasis::PreBasis::Node;\n- 45\n- 46protected:\n- 47\n-48 using PreBasis = typename GlobalBasis::PreBasis;\n- 49\n- 50 // Type used to store the multi indices of the basis vectors.\n- 51 // In contrast to MultiIndex this always has dynamic size.\n- 52 // It's guaranteed, that you can always cast it to MultiIndex\n-53 using MultiIndexStorage =\n- 54 std::conditional_t<(PreBasis::minMultiIndexSize == PreBasis::\n-maxMultiIndexSize),\n- 55 OverflowArray,\n-PreBasis::multiIndexBufferSize>,\n- 56 Dune::ReservedVector>;\n- 57\n- 58public:\n+ 23 // Construct default coefficient type from vector and multiindex type\n+ 24 // This requires that MultiIndex has a static size. Otherwise the\n+ 25 // vector type itself is returned.\n+ 26 template\n+ 27 struct CoefficientType\n+ 28 {\n+ 29 template\n+ 30 struct DefaultCoefficientTypeHelper\n+ 31 {\n+ 32 using E0 = decltype(std::declval()[Dune::Indices::_0]);\n+ 33 using type = typename DefaultCoefficientTypeHelper::type;\n+ 34 };\n+ 35\n+ 36 template\n+ 37 struct DefaultCoefficientTypeHelper\n+ 38 {\n+ 39 using type = E;\n+ 40 };\n+ 41\n+ 42 template::value, int>::type = 0>\n+ 44 static constexpr std::size_t getStaticSizeOrZero()\n+ 45 {\n+ 46 return StaticSize::value;\n+ 47 }\n+ 48\n+ 49 template::value, int>::type = 0>\n+ 51 static constexpr std::size_t getStaticSizeOrZero()\n+ 52 {\n+ 53 return 0;\n+ 54 }\n+ 55\n+ 56 using type = typename DefaultCoefficientTypeHelper()>::type;\n+ 57 };\n+ 58\n 59\n-61 using MultiIndex =\n- 62 std::conditional_t<(PreBasis::minMultiIndexSize == PreBasis::\n-maxMultiIndexSize),\n- 63 StaticMultiIndex,\n- 64 Dune::ReservedVector>;\n+ 60\n+ 61 // This tag class is used as Coefficient template parameter\n+ 62 // for HierarchicVectorWrapper if the coefficient type should\n+ 63 // be deduced.\n+ 64 struct DeducedCoefficientTag {};\n 65\n- 66\n-68 DefaultLocalView(const GlobalBasis& globalBasis) :\n- 69 globalBasis_(&globalBasis),\n- 70 tree_(globalBasis_->preBasis().makeNode())\n- 71 {\n- 72 static_assert(models, Tree>(), \"Tree type\n-passed to DefaultLocalView does not model the BasisNode concept.\");\n- 73 initializeTree(tree_);\n- 74 }\n- 75\n-81 void bind(const Element& e)\n- 82 {\n- 83 element_ = e;\n- 84 bindTree(tree_, *element_);\n- 85 indices_.resize(size());\n- 86 globalBasis_->preBasis().indices(tree_, indices_.begin());\n- 87 }\n- 88\n- 91 [[deprecated(\"Use the bound() method instead\")]]\n-92 bool isBound() const {\n- 93 return static_cast(element_);\n- 94 }\n- 95\n-98 bool bound() const\n- 99 {\n- 100 return static_cast(element_);\n- 101 }\n- 102\n-107 const Element& element() const\n- 108 {\n- 109 return *element_;\n+ 66} // namespace Imp\n+ 67\n+ 68\n+ 69\n+ 90template\n+91class HierarchicVectorWrapper\n+ 92{\n+ 93 template\n+ 94 using Coefficient = typename std::conditional< std::is_same::value and HasStaticSize::value,\n+ 95 typename Imp::CoefficientType::type,\n+ 96 CO\n+ 97 >::type;\n+ 98\n+ 99\n+ 100 using size_type = std::size_t;\n+ 101\n+ 102 template(), int>::type =\n+0,\n+ 104 typename std::enable_if< not models(), int>::\n+type = 0>\n+ 105 static void resizeHelper(C& c, const SizeProvider& sizeProvider, typename\n+SizeProvider::SizePrefix prefix)\n+ 106 {\n+ 107 auto size = sizeProvider.size(prefix);\n+ 108 if (size != 0)\n+ 109 DUNE_THROW(RangeError, \"Can't resize scalar vector entry v[\" << prefix <<\n+\"] to size(\" << prefix << \")=\" << size);\n 110 }\n 111\n-116 void unbind()\n- 117 {\n- 118 element_.reset();\n+ 112 struct StaticResizeHelper\n+ 113 {\n+ 114 template\n+ 115 static void apply(I&& i, C& c, const SizeProvider& sizeProvider, typename\n+SizeProvider::SizePrefix prefix)\n+ 116 {\n+ 117 prefix.back() = i;\n+ 118 resizeHelper(c[i], sizeProvider, prefix);\n 119 }\n- 120\n-125 const Tree& tree() const\n+ 120 };\n+ 121\n+ 122 template(), int>::type =\n+0,\n+ 124 typename std::enable_if< models(), int>::type =\n+0>\n+ 125 static void resizeHelper(C& c, const SizeProvider& sizeProvider, typename\n+SizeProvider::SizePrefix prefix)\n 126 {\n- 127 return tree_;\n- 128 }\n- 129\n-132 size_type size() const\n- 133 {\n- 134 return tree_.size();\n- 135 }\n- 136\n-143 size_type maxSize() const\n+ 127 auto size = sizeProvider.size(prefix);\n+ 128 if (size == 0)\n+ 129 return;\n+ 130\n+ 131 if (c.size() != size)\n+ 132 DUNE_THROW(RangeError, \"Can't resize statically sized vector entry v[\" <<\n+prefix << \"] of size \" << c.size() << \" to size(\" << prefix << \")=\" << size);\n+ 133\n+ 134 using namespace Dune::Hybrid;\n+ 135 prefix.push_back(0);\n+ 136 forEach(integralRange(Hybrid::size(c)), [&](auto&& i) {\n+ 137 StaticResizeHelper::apply(i, c, sizeProvider, prefix);\n+ 138 });\n+ 139 }\n+ 140\n+ 141 template(), int>::type = 0>\n+ 143 static void resizeHelper(C& c, const SizeProvider& sizeProvider, typename\n+SizeProvider::SizePrefix prefix)\n 144 {\n- 145 return globalBasis_->preBasis().maxNodeSize();\n- 146 }\n- 147\n-149 const MultiIndex& index(size_type i) const\n- 150 {\n- 151 return indices_[i];\n+ 145 auto size = sizeProvider.size(prefix);\n+ 146 if (size==0)\n+ 147 {\n+ 148 if (c.size()==0)\n+ 149 DUNE_THROW(RangeError, \"Can't resize dynamically sized vector entry v[\" <<\n+prefix << \"]. Its size is 0 but the target size is unknown due to size(\" <<\n+prefix << \")=0.\");\n+ 150 else\n+ 151 return;\n 152 }\n 153\n-156 const GlobalBasis& globalBasis() const\n+ 154 c.resize(size);\n+ 155 prefix.push_back(0);\n+ 156 for(std::size_t i=0; i element_;\n-169 Tree tree_;\n-170 std::vector indices_;\n- 171};\n- 172\n- 173\n- 174\n- 175} // end namespace Functions\n- 176} // end namespace Dune\n- 177\n- 178\n- 179\n- 180#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH\n-overflowarray.hh\n-multiindex.hh\n+ 158 prefix.back() = i;\n+ 159 resizeHelper(c[i], sizeProvider, prefix);\n+ 160 }\n+ 161 }\n+ 162\n+ 163\n+ 164\n+ 165public:\n+ 166\n+167 using Vector = V;\n+ 168\n+ 169 template\n+170 using Entry = Coefficient;\n+ 171\n+172 HierarchicVectorWrapper(Vector& vector) :\n+ 173 vector_(&vector)\n+ 174 {}\n+ 175\n+ 176 template\n+177 void resize(const SizeProvider& sizeProvider)\n+ 178 {\n+ 179 typename SizeProvider::SizePrefix prefix;\n+ 180 prefix.resize(0);\n+ 181 resizeHelper(*vector_, sizeProvider, prefix);\n+ 182 }\n+ 183\n+ 184 template\n+185 const Entry& operator[](const MultiIndex& index) const\n+ 186 {\n+ 187 static_assert(not std::is_same>::value, \"Coefficient type for\n+HierarchicVectorWrapper and given multi-index type cannot be determined\n+automatically!\");\n+ 188 return hybridMultiIndexAccess&>(*vector_, index);\n+ 189 }\n+ 190\n+ 191 template\n+192 Entry& operator[](const MultiIndex& index)\n+ 193 {\n+ 194 static_assert(not std::is_same>::value, \"Coefficient type for\n+HierarchicVectorWrapper and given multi-index type cannot be determined\n+automatically!\");\n+ 195 return hybridMultiIndexAccess&>(*vector_, index);\n+ 196 }\n+ 197\n+ 198 template\n+199 const Entry& operator()(const MultiIndex& index) const\n+ 200 {\n+ 201 static_assert(not std::is_same>::value, \"Coefficient type for\n+HierarchicVectorWrapper and given multi-index type cannot be determined\n+automatically!\");\n+ 202 return (*this)[index];\n+ 203 }\n+ 204\n+ 205 template\n+206 Entry& operator()(const MultiIndex& index)\n+ 207 {\n+ 208 static_assert(not std::is_same>::value, \"Coefficient type for\n+HierarchicVectorWrapper and given multi-index type cannot be determined\n+automatically!\");\n+ 209 return (*this)[index];\n+ 210 }\n+ 211\n+212 const Vector& vector() const\n+ 213 {\n+ 214 return *vector_;\n+ 215 }\n+ 216\n+217 Vector& vector()\n+ 218 {\n+ 219 return *vector_;\n+ 220 }\n+ 221\n+ 222private:\n+ 223\n+ 224 Vector* vector_;\n+ 225};\n+ 226\n+ 227\n+ 228\n+ 229\n+ 230template\n+231HierarchicVectorWrapper<_V_> hierarchicVector(V& v)\n+ 232{\n+ 233 return HierarchicVectorWrapper(v);\n+ 234}\n+ 235\n+ 236\n+ 237\n+ 238template(),\n+int>::type = 0>\n+240V& makeHierarchicVectorForMultiIndex(V& v)\n+ 241{\n+ 242 return v;\n+ 243}\n+ 244\n+ 245\n+ 246\n+ 247template(), int>::type = 0>\n+249HierarchicVectorWrapper<_V_> makeHierarchicVectorForMultiIndex(V& v)\n+ 250{\n+ 251 return HierarchicVectorWrapper(v);\n+ 252}\n+ 253\n+ 254\n+ 255\n+ 256} // namespace Dune::Functions\n+ 257} // namespace Dune\n+ 258\n+ 259\n+ 260#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICVECTORWRAPPER_HH\n+indexaccess.hh\n+type_traits.hh\n+utility.hh\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::bindTree\n-void bindTree(Tree &tree, const Entity &entity, std::size_t offset=0)\n-Definition: nodes.hh:253\n-Dune::Functions::initializeTree\n-void initializeTree(Tree &tree, std::size_t treeIndexOffset=0)\n-Definition: nodes.hh:260\n-Dune::Functions::StaticMultiIndex\n-A statically sized MultiIndex type.\n-Definition: multiindex.hh:25\n-Dune::Functions::OverflowArray\n-A dynamically sized array-like class with overflow.\n-Definition: overflowarray.hh:45\n-Dune::Functions::DefaultLocalView\n-The restriction of a finite element basis to a single element.\n-Definition: defaultlocalview.hh:28\n-Dune::Functions::DefaultLocalView::PreBasis\n-typename GlobalBasis::PreBasis PreBasis\n-Definition: defaultlocalview.hh:48\n-Dune::Functions::DefaultLocalView::unbind\n-void unbind()\n-Unbind from the current element.\n-Definition: defaultlocalview.hh:116\n-Dune::Functions::DefaultLocalView::bound\n-bool bound() const\n-Return if the view is bound to a grid element.\n-Definition: defaultlocalview.hh:98\n-Dune::Functions::DefaultLocalView::GridView\n-typename GlobalBasis::GridView GridView\n-The grid view the global FE basis lives on.\n-Definition: defaultlocalview.hh:35\n-Dune::Functions::DefaultLocalView::index\n-const MultiIndex & index(size_type i) const\n-Maps from subtree index set [0..size-1] to a globally unique multi index in\n-global basis.\n-Definition: defaultlocalview.hh:149\n-Dune::Functions::DefaultLocalView::element_\n-std::optional< Element > element_\n-Definition: defaultlocalview.hh:168\n-Dune::Functions::DefaultLocalView::Element\n-typename GridView::template Codim< 0 >::Entity Element\n-Type of the grid element we are bound to.\n-Definition: defaultlocalview.hh:38\n-Dune::Functions::DefaultLocalView::tree\n-const Tree & tree() const\n-Return the local ansatz tree associated to the bound entity.\n-Definition: defaultlocalview.hh:125\n-Dune::Functions::DefaultLocalView::bind\n-void bind(const Element &e)\n-Bind the view to a grid element.\n-Definition: defaultlocalview.hh:81\n-Dune::Functions::DefaultLocalView::element\n-const Element & element() const\n-Return the grid element that the view is bound to.\n-Definition: defaultlocalview.hh:107\n-Dune::Functions::DefaultLocalView::size\n-size_type size() const\n-Total number of degrees of freedom on this element.\n-Definition: defaultlocalview.hh:132\n-Dune::Functions::DefaultLocalView::GlobalBasis\n-GB GlobalBasis\n-The global FE basis that this is a view on.\n-Definition: defaultlocalview.hh:32\n-Dune::Functions::DefaultLocalView::tree_\n-Tree tree_\n-Definition: defaultlocalview.hh:169\n-Dune::Functions::DefaultLocalView::maxSize\n-size_type maxSize() const\n-Maximum local size for any element on the GridView.\n-Definition: defaultlocalview.hh:143\n-Dune::Functions::DefaultLocalView::size_type\n-std::size_t size_type\n-The type used for sizes.\n-Definition: defaultlocalview.hh:41\n-Dune::Functions::DefaultLocalView::isBound\n-bool isBound() const\n-Return if the view is bound to a grid element.\n-Definition: defaultlocalview.hh:92\n-Dune::Functions::DefaultLocalView::rootLocalView\n-const DefaultLocalView & rootLocalView() const\n-Definition: defaultlocalview.hh:161\n-Dune::Functions::DefaultLocalView::MultiIndexStorage\n-std::conditional_t<(PreBasis::minMultiIndexSize==PreBasis::maxMultiIndexSize),\n-OverflowArray< StaticMultiIndex< size_type, PreBasis::maxMultiIndexSize >,\n-PreBasis::multiIndexBufferSize >, Dune::ReservedVector< size_type, PreBasis::\n-multiIndexBufferSize > > MultiIndexStorage\n-Definition: defaultlocalview.hh:56\n-Dune::Functions::DefaultLocalView::MultiIndex\n-std::conditional_t<(PreBasis::minMultiIndexSize==PreBasis::maxMultiIndexSize),\n-StaticMultiIndex< size_type, PreBasis::maxMultiIndexSize >, Dune::\n-ReservedVector< size_type, PreBasis::multiIndexBufferSize > > MultiIndex\n-Type used for global numbering of the basis vectors.\n-Definition: defaultlocalview.hh:64\n-Dune::Functions::DefaultLocalView::indices_\n-std::vector< MultiIndexStorage > indices_\n-Definition: defaultlocalview.hh:170\n-Dune::Functions::DefaultLocalView::Tree\n-typename GlobalBasis::PreBasis::Node Tree\n-Tree of local finite elements / local shape function sets.\n-Definition: defaultlocalview.hh:44\n-Dune::Functions::DefaultLocalView::DefaultLocalView\n-DefaultLocalView(const GlobalBasis &globalBasis)\n-Construct local view for a given global finite element basis.\n-Definition: defaultlocalview.hh:68\n-Dune::Functions::DefaultLocalView::globalBasis_\n-const GlobalBasis * globalBasis_\n-Definition: defaultlocalview.hh:167\n-Dune::Functions::DefaultLocalView::globalBasis\n-const GlobalBasis & globalBasis() const\n-Return the global basis that we are a view on.\n-Definition: defaultlocalview.hh:156\n+Dune::Functions::makeHierarchicVectorForMultiIndex\n+V & makeHierarchicVectorForMultiIndex(V &v)\n+Definition: hierarchicvectorwrapper.hh:240\n+Dune::Functions::hierarchicVector\n+HierarchicVectorWrapper< V > hierarchicVector(V &v)\n+Definition: hierarchicvectorwrapper.hh:231\n+Dune::Functions::HasStaticSize\n+Check if type is a statically sized container.\n+Definition: type_traits.hh:83\n+Dune::Functions::HierarchicVectorWrapper\n+A wrapper providing multiindex access to vector entries.\n+Definition: hierarchicvectorwrapper.hh:92\n+Dune::Functions::HierarchicVectorWrapper::operator()\n+Entry< MultiIndex > & operator()(const MultiIndex &index)\n+Definition: hierarchicvectorwrapper.hh:206\n+Dune::Functions::HierarchicVectorWrapper::operator[]\n+Entry< MultiIndex > & operator[](const MultiIndex &index)\n+Definition: hierarchicvectorwrapper.hh:192\n+Dune::Functions::HierarchicVectorWrapper::operator[]\n+const Entry< MultiIndex > & operator[](const MultiIndex &index) const\n+Definition: hierarchicvectorwrapper.hh:185\n+Dune::Functions::HierarchicVectorWrapper::vector\n+Vector & vector()\n+Definition: hierarchicvectorwrapper.hh:217\n+Dune::Functions::HierarchicVectorWrapper::Vector\n+V Vector\n+Definition: hierarchicvectorwrapper.hh:167\n+Dune::Functions::HierarchicVectorWrapper::Entry\n+Coefficient< MultiIndex > Entry\n+Definition: hierarchicvectorwrapper.hh:170\n+Dune::Functions::HierarchicVectorWrapper::vector\n+const Vector & vector() const\n+Definition: hierarchicvectorwrapper.hh:212\n+Dune::Functions::HierarchicVectorWrapper::HierarchicVectorWrapper\n+HierarchicVectorWrapper(Vector &vector)\n+Definition: hierarchicvectorwrapper.hh:172\n+Dune::Functions::HierarchicVectorWrapper::operator()\n+const Entry< MultiIndex > & operator()(const MultiIndex &index) const\n+Definition: hierarchicvectorwrapper.hh:199\n+Dune::Functions::HierarchicVectorWrapper::resize\n+void resize(const SizeProvider &sizeProvider)\n+Definition: hierarchicvectorwrapper.hh:177\n concepts.hh\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00134.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00134.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: lagrangebasis.hh File Reference\n+dune-functions: hierarchicnodetorangemap.hh File Reference\n \n \n \n \n \n \n \n@@ -64,64 +64,38 @@\n \n \n \n
    \n \n-
    lagrangebasis.hh File Reference
    \n+Namespaces
    \n+
    hierarchicnodetorangemap.hh File Reference
    \n \n
    \n-
    #include <type_traits>
    \n-#include <dune/common/exceptions.hh>
    \n-#include <dune/localfunctions/lagrange.hh>
    \n-#include <dune/localfunctions/lagrange/equidistantpoints.hh>
    \n-#include <dune/localfunctions/lagrange/pqkfactory.hh>
    \n-#include <dune/functions/functionspacebases/nodes.hh>
    \n-#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
    \n+
    #include <utility>
    \n+#include <type_traits>
    \n+#include <dune/common/concept.hh>
    \n+#include <dune/functions/functionspacebases/concepts.hh>
    \n+#include <dune/functions/common/indexaccess.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n-\n-\n+\n+\n \n

    \n 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 >
    struct  Dune::Functions::HierarchicNodeToRangeMap
     A simple node to range map using the nested tree indices. More...
     
    \n \n \n \n \n \n-\n-\n-

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    namespace  Dune::Functions::BasisFactory
     
    \n-\n-\n-\n-\n-\n-

    \n-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. More...
     
    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n

    \n-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. More...
     
    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. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,50 +5,27 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-Classes | Namespaces | Typedefs | Functions\n-lagrangebasis.hh File Reference\n+Classes | Namespaces\n+hierarchicnodetorangemap.hh File Reference\n+#include \n #include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::LagrangePreBasis<_GV,_k,_R_>\n-\u00a0 A pre-basis for a PQ-lagrange bases with given order. More...\n-\u00a0\n-class \u00a0Dune::Functions::LagrangeNode<_GV,_k,_R_>\n+struct \u00a0Dune::Functions::HierarchicNodeToRangeMap\n+\u00a0 A simple node to range map using the nested tree indices. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n-namespace \u00a0Dune::Functions::BasisFactory\n-\u00a0\n- Typedefs\n-template\n-using\u00a0Dune::Functions::LagrangeBasis = DefaultGlobalBasis< LagrangePreBasis<\n- GV, k, R > >\n-\u00a0 Nodal basis of a scalar k-th-order Lagrangean finite element space.\n- More...\n-\u00a0\n- Functions\n-template\n-auto\u00a0Dune::Functions::BasisFactory::lagrange ()\n-\u00a0 Create a pre-basis factory that can create a Lagrange pre-basis. More...\n-\u00a0\n-template\n-auto\u00a0Dune::Functions::BasisFactory::lagrange (int order)\n-\u00a0 Create a pre-basis factory that can create a Lagrange pre-basis with a\n- run-time order. More...\n-\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00134_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00134_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: lagrangebasis.hh Source File\n+dune-functions: hierarchicnodetorangemap.hh Source File\n \n \n \n \n \n \n \n@@ -62,548 +62,67 @@\n \n \n
    \n
    \n-
    lagrangebasis.hh
    \n+
    hierarchicnodetorangemap.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH
    \n
    5
    \n-
    6#include <type_traits>
    \n-
    7#include <dune/common/exceptions.hh>
    \n-
    8
    \n-
    9#include <dune/localfunctions/lagrange.hh>
    \n-
    10#include <dune/localfunctions/lagrange/equidistantpoints.hh>
    \n-
    11#include <dune/localfunctions/lagrange/pqkfactory.hh>
    \n-
    12
    \n-\n-\n-
    15
    \n-
    16
    \n-
    17namespace Dune {
    \n-
    18namespace Functions {
    \n+
    6
    \n+
    7#include <utility>
    \n+
    8#include <type_traits>
    \n+
    9
    \n+
    10#include <dune/common/concept.hh>
    \n+
    11
    \n+\n+\n+
    14
    \n+
    15namespace Dune {
    \n+
    16namespace Functions {
    \n+
    17
    \n+
    18
    \n
    19
    \n-
    20// *****************************************************************************
    \n-
    21// This is the reusable part of the LagrangeBasis. It contains
    \n-
    22//
    \n-
    23// LagrangePreBasis
    \n-
    24// LagrangeNode
    \n-
    25//
    \n-
    26// The pre-basis allows to create the others and is the owner of possible shared
    \n-
    27// state. These components do _not_ depend on the global basis and local view
    \n-
    28// and can be used without a global basis.
    \n-
    29// *****************************************************************************
    \n-
    30
    \n-
    31template<typename GV, int k, typename R=double>
    \n-
    32class LagrangeNode;
    \n-
    33
    \n-
    34template<typename GV, int k, typename R=double>
    \n-
    35class LagrangePreBasis;
    \n-
    36
    \n+\n+
    30{
    \n+
    31 template<class Node, class TreePath, class Range,
    \n+
    32 std::enable_if_t< models<Concept::HasIndexAccess, Range, Dune::index_constant<0>>(), int> = 0>
    \n+
    33 decltype(auto) operator()(const Node&, const TreePath& treePath, Range&& y) const
    \n+
    34 {
    \n+
    35 return resolveStaticMultiIndex(y, treePath);
    \n+
    36 }
    \n
    37
    \n-
    38
    \n-
    53template<typename GV, int k, typename R>
    \n-\n-
    55{
    \n-
    56 static const int dim = GV::dimension;
    \n-
    57 static const bool useDynamicOrder = (k<0);
    \n-
    58
    \n-
    59public:
    \n-
    60
    \n-
    62 using GridView = GV;
    \n-
    63
    \n-
    65 using size_type = std::size_t;
    \n-
    66
    \n-\n-
    69
    \n-
    70 static constexpr size_type maxMultiIndexSize = 1;
    \n-
    71 static constexpr size_type minMultiIndexSize = 1;
    \n-
    72 static constexpr size_type multiIndexBufferSize = 1;
    \n-
    73
    \n-\n-
    76 : LagrangePreBasis(gv, std::numeric_limits<unsigned int>::max())
    \n-
    77 {}
    \n-
    78
    \n-
    80 LagrangePreBasis(const GridView& gv, unsigned int order) :
    \n-\n-
    82 {
    \n-
    83 if (!useDynamicOrder && order!=std::numeric_limits<unsigned int>::max())
    \n-
    84 DUNE_THROW(RangeError, "Template argument k has to be -1 when supplying a run-time order!");
    \n-
    85
    \n-
    86 for (int i=0; i<=dim; i++)
    \n-
    87 {
    \n-\n-\n-
    90 }
    \n-\n-\n-
    93 }
    \n-
    94
    \n-\n-
    97 {
    \n-
    98 vertexOffset_ = 0;
    \n-\n-
    100
    \n-
    101 if (dim>=2)
    \n-
    102 {
    \n-\n-
    104
    \n-
    105 quadrilateralOffset_ = triangleOffset_ + dofsPerSimplex(2) * ((size_type)gridView_.size(Dune::GeometryTypes::triangle));
    \n-
    106 }
    \n-
    107
    \n-
    108 if (dim==3) {
    \n-
    109 tetrahedronOffset_ = quadrilateralOffset_ + dofsPerCube(2) * ((size_type)gridView_.size(Dune::GeometryTypes::quadrilateral));
    \n-
    110
    \n-
    111 prismOffset_ = tetrahedronOffset_ + dofsPerSimplex(3) * ((size_type)gridView_.size(Dune::GeometryTypes::tetrahedron));
    \n-
    112
    \n-
    113 hexahedronOffset_ = prismOffset_ + dofsPerPrism() * ((size_type)gridView_.size(Dune::GeometryTypes::prism));
    \n-
    114
    \n-
    115 pyramidOffset_ = hexahedronOffset_ + dofsPerCube(3) * ((size_type)gridView_.size(Dune::GeometryTypes::hexahedron));
    \n-
    116 }
    \n-
    117 }
    \n-
    118
    \n-
    120 const GridView& gridView() const
    \n-
    121 {
    \n-
    122 return gridView_;
    \n-
    123 }
    \n-
    124
    \n-
    126 void update (const GridView& gv)
    \n-
    127 {
    \n-
    128 gridView_ = gv;
    \n-
    129 }
    \n-
    130
    \n-\n-
    135 {
    \n-
    136 return Node{order_};
    \n-
    137 }
    \n-
    138
    \n-\n-
    141 {
    \n-
    142 switch (dim)
    \n-
    143 {
    \n-
    144 case 1:
    \n-
    145 return dofsPerCube(0) * ((size_type)gridView_.size(dim))
    \n-
    146 + dofsPerCube(1) * ((size_type)gridView_.size(dim-1));
    \n-
    147 case 2:
    \n-
    148 {
    \n-
    149 return dofsPerCube(0) * ((size_type)gridView_.size(dim))
    \n-
    150 + dofsPerCube(1) * ((size_type)gridView_.size(dim-1))
    \n-
    151 + dofsPerSimplex(2) * ((size_type)gridView_.size(Dune::GeometryTypes::triangle))
    \n-
    152 + dofsPerCube(2) * ((size_type)gridView_.size(Dune::GeometryTypes::quadrilateral));
    \n-
    153 }
    \n-
    154 case 3:
    \n-
    155 {
    \n-
    156 return dofsPerCube(0) * ((size_type)gridView_.size(dim))
    \n-
    157 + dofsPerCube(1) * ((size_type)gridView_.size(dim-1))
    \n-
    158 + dofsPerSimplex(2) * ((size_type)gridView_.size(Dune::GeometryTypes::triangle))
    \n-
    159 + dofsPerCube(2) * ((size_type)gridView_.size(Dune::GeometryTypes::quadrilateral))
    \n-
    160 + dofsPerSimplex(3) * ((size_type)gridView_.size(Dune::GeometryTypes::tetrahedron))
    \n-
    161 + dofsPerPyramid() * ((size_type)gridView_.size(Dune::GeometryTypes::pyramid))
    \n-
    162 + dofsPerPrism() * ((size_type)gridView_.size(Dune::GeometryTypes::prism))
    \n-
    163 + dofsPerCube(3) * ((size_type)gridView_.size(Dune::GeometryTypes::hexahedron));
    \n-
    164 }
    \n-
    165 }
    \n-
    166 DUNE_THROW(Dune::NotImplemented, "No size method for " << dim << "d grids available yet!");
    \n-
    167 }
    \n-
    168
    \n-
    170 template<class SizePrefix>
    \n-
    171 size_type size(const SizePrefix& prefix) const
    \n-
    172 {
    \n-
    173 assert(prefix.size() == 0 || prefix.size() == 1);
    \n-
    174 return (prefix.size() == 0) ? size() : 0;
    \n-
    175 }
    \n-
    176
    \n-\n-
    179 {
    \n-
    180 return size();
    \n-
    181 }
    \n-
    182
    \n-\n-
    185 {
    \n-
    186 // That cast to unsigned int is necessary because GV::dimension is an enum,
    \n-
    187 // which is not recognized by the power method as an integer type...
    \n-
    188 return power(order()+1, (unsigned int)GV::dimension);
    \n-
    189 }
    \n-
    190
    \n-
    191 template<typename It>
    \n-
    192 It indices(const Node& node, It it) const
    \n-
    193 {
    \n-
    194 for (size_type i = 0, end = node.finiteElement().size() ; i < end ; ++it, ++i)
    \n-
    195 {
    \n-
    196 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
    \n-
    197 const auto& gridIndexSet = gridView().indexSet();
    \n-
    198 const auto& element = node.element();
    \n-
    199
    \n-
    200 // The dimension of the entity that the current dof is related to
    \n-
    201 auto dofDim = dim - localKey.codim();
    \n-
    202
    \n-
    203 // Test for a vertex dof
    \n-
    204 // The test for k==1 is redundant, but having it here allows the compiler to conclude
    \n-
    205 // at compile-time that the dofDim==0 case is the only one that will ever happen.
    \n-
    206 // This leads to measurable speed-up: see
    \n-
    207 // https://gitlab.dune-project.org/staging/dune-functions/issues/30
    \n-
    208 if (k==1 || dofDim==0) {
    \n-
    209 *it = {{ (size_type)(gridIndexSet.subIndex(element,localKey.subEntity(),dim)) }};
    \n-
    210 continue;
    \n-
    211 }
    \n-
    212
    \n-
    213 if (dofDim==1)
    \n-
    214 { // edge dof
    \n-
    215 if (dim==1) // element dof -- any local numbering is fine
    \n-
    216 {
    \n-
    217 *it = {{ edgeOffset_
    \n-
    218 + dofsPerCube(1) * ((size_type)gridIndexSet.subIndex(element,0,0))
    \n-
    219 + localKey.index() }};
    \n-
    220 continue;
    \n-
    221 }
    \n-
    222 else
    \n-
    223 {
    \n-
    224 const auto refElement
    \n-
    225 = Dune::referenceElement<double,dim>(element.type());
    \n-
    226
    \n-
    227 // We have to reverse the numbering if the local element edge is
    \n-
    228 // not aligned with the global edge.
    \n-
    229 auto v0 = (size_type)gridIndexSet.subIndex(element,refElement.subEntity(localKey.subEntity(),localKey.codim(),0,dim),dim);
    \n-
    230 auto v1 = (size_type)gridIndexSet.subIndex(element,refElement.subEntity(localKey.subEntity(),localKey.codim(),1,dim),dim);
    \n-
    231 bool flip = (v0 > v1);
    \n-
    232 *it = {{ (flip)
    \n-\n-
    234 + dofsPerCube(1)*((size_type)gridIndexSet.subIndex(element,localKey.subEntity(),localKey.codim()))
    \n-
    235 + (dofsPerCube(1)-1)-localKey.index()
    \n-\n-
    237 + dofsPerCube(1)*((size_type)gridIndexSet.subIndex(element,localKey.subEntity(),localKey.codim()))
    \n-
    238 + localKey.index() }};
    \n-
    239 continue;
    \n-
    240 }
    \n-
    241 }
    \n-
    242
    \n-
    243 if (dofDim==2)
    \n-
    244 {
    \n-
    245 if (dim==2) // element dof -- any local numbering is fine
    \n-
    246 {
    \n-
    247 if (element.type().isTriangle())
    \n-
    248 {
    \n-
    249 *it = {{ triangleOffset_ + dofsPerSimplex(2)*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
    \n-
    250 continue;
    \n-
    251 }
    \n-
    252 else if (element.type().isQuadrilateral())
    \n-
    253 {
    \n-
    254 *it = {{ quadrilateralOffset_ + dofsPerCube(2)*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
    \n-
    255 continue;
    \n-
    256 }
    \n-
    257 else
    \n-
    258 DUNE_THROW(Dune::NotImplemented, "2d elements have to be triangles or quadrilaterals");
    \n-
    259 } else
    \n-
    260 {
    \n-
    261 const auto refElement
    \n-
    262 = Dune::referenceElement<double,dim>(element.type());
    \n-
    263
    \n-
    264 if (order()>3)
    \n-
    265 DUNE_THROW(Dune::NotImplemented, "LagrangeBasis for 3D grids is only implemented if k<=3");
    \n-
    266
    \n-
    267 if (order()==3 and !refElement.type(localKey.subEntity(), localKey.codim()).isTriangle())
    \n-
    268 DUNE_THROW(Dune::NotImplemented, "LagrangeBasis for 3D grids with k==3 is only implemented if the grid is a simplex grid");
    \n-
    269
    \n-
    270 *it = {{ triangleOffset_ + ((size_type)gridIndexSet.subIndex(element,localKey.subEntity(),localKey.codim())) }};
    \n-
    271 continue;
    \n-
    272 }
    \n-
    273 }
    \n-
    274
    \n-
    275 if (dofDim==3)
    \n-
    276 {
    \n-
    277 if (dim==3) // element dof -- any local numbering is fine
    \n-
    278 {
    \n-
    279 if (element.type().isTetrahedron())
    \n-
    280 {
    \n-
    281 *it = {{ tetrahedronOffset_ + dofsPerSimplex(3)*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
    \n-
    282 continue;
    \n-
    283 }
    \n-
    284 else if (element.type().isHexahedron())
    \n-
    285 {
    \n-
    286 *it = {{ hexahedronOffset_ + dofsPerCube(3)*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
    \n-
    287 continue;
    \n-
    288 }
    \n-
    289 else if (element.type().isPrism())
    \n-
    290 {
    \n-
    291 *it = {{ prismOffset_ + dofsPerPrism()*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
    \n-
    292 continue;
    \n-
    293 }
    \n-
    294 else if (element.type().isPyramid())
    \n-
    295 {
    \n-
    296 *it = {{ pyramidOffset_ + dofsPerPyramid()*((size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};
    \n-
    297 continue;
    \n-
    298 }
    \n-
    299 else
    \n-
    300 DUNE_THROW(Dune::NotImplemented, "3d elements have to be tetrahedra, hexahedra, prisms, or pyramids");
    \n-
    301 } else
    \n-
    302 DUNE_THROW(Dune::NotImplemented, "Grids of dimension larger than 3 are no supported");
    \n-
    303 }
    \n-
    304 DUNE_THROW(Dune::NotImplemented, "Grid contains elements not supported for the LagrangeBasis");
    \n-
    305 }
    \n-
    306 return it;
    \n-
    307 }
    \n-
    308
    \n-
    310 unsigned int order() const
    \n-
    311 {
    \n-
    312 return (useDynamicOrder) ? order_ : k;
    \n-
    313 }
    \n-
    314
    \n-
    315protected:
    \n-\n-
    317
    \n-
    318 // Run-time order, only valid if k<0
    \n-
    319 const unsigned int order_;
    \n-
    320
    \n-
    322 size_type dofsPerSimplex(std::size_t simplexDim) const
    \n-
    323 {
    \n-
    324 return useDynamicOrder ? dofsPerSimplex_[simplexDim] : computeDofsPerSimplex(simplexDim);
    \n-
    325 }
    \n-
    326
    \n-
    328 size_type dofsPerCube(std::size_t cubeDim) const
    \n-
    329 {
    \n-
    330 return useDynamicOrder ? dofsPerCube_[cubeDim] : computeDofsPerCube(cubeDim);
    \n-
    331 }
    \n-
    332
    \n-\n-
    334 {
    \n-
    335 return useDynamicOrder ? dofsPerPrism_ : computeDofsPerPrism();
    \n-
    336 }
    \n-
    337
    \n-\n-
    339 {
    \n-
    340 return useDynamicOrder ? dofsPerPyramid_ : computeDofsPerPyramid();
    \n-
    341 }
    \n-
    342
    \n-
    344 size_type computeDofsPerSimplex(std::size_t simplexDim) const
    \n-
    345 {
    \n-
    346 return order() == 0 ? (dim == simplexDim ? 1 : 0) : Dune::binomial(std::size_t(order()-1),simplexDim);
    \n-
    347 }
    \n-
    348
    \n-
    350 size_type computeDofsPerCube(std::size_t cubeDim) const
    \n-
    351 {
    \n-
    352 return order() == 0 ? (dim == cubeDim ? 1 : 0) : Dune::power(order()-1, cubeDim);
    \n-
    353 }
    \n-
    354
    \n-\n-
    356 {
    \n-
    357 return order() == 0 ? (dim == 3 ? 1 : 0) : (order()-1)*(order()-1)*(order()-2)/2;
    \n-
    358 }
    \n-
    359
    \n-\n-
    361 {
    \n-
    362 return order() == 0 ? (dim == 3 ? 1 : 0) : (order()-2)*(order()-1)*(2*order()-3)/6;
    \n-
    363 }
    \n-
    364
    \n-
    365 // When the order is given at run-time, the following numbers are pre-computed:
    \n-
    366 std::array<size_type,dim+1> dofsPerSimplex_;
    \n-
    367 std::array<size_type,dim+1> dofsPerCube_;
    \n-\n-\n-
    370
    \n-\n-\n-\n-\n-\n-\n-\n-\n-
    379
    \n-
    380};
    \n-
    381
    \n-
    382
    \n-
    383
    \n-
    384template<typename GV, int k, typename R>
    \n-\n-
    386 public LeafBasisNode
    \n-
    387{
    \n-
    388 // Stores LocalFiniteElement implementations with run-time order as a function of GeometryType
    \n-
    389 template<typename Domain, typename Range, int dim>
    \n-
    390 class LagrangeRunTimeLFECache
    \n-
    391 {
    \n-
    392 public:
    \n-
    393 using FiniteElementType = LagrangeLocalFiniteElement<EquidistantPointSet,dim,Domain,Range>;
    \n-
    394
    \n-
    395 const FiniteElementType& get(GeometryType type)
    \n-
    396 {
    \n-
    397 auto i = data_.find(type);
    \n-
    398 if (i==data_.end())
    \n-
    399 i = data_.emplace(type,FiniteElementType(type,order_)).first;
    \n-
    400 return (*i).second;
    \n-
    401 }
    \n-
    402
    \n-
    403 std::map<GeometryType, FiniteElementType> data_;
    \n-
    404 unsigned int order_;
    \n-
    405 };
    \n-
    406
    \n-
    407 static constexpr int dim = GV::dimension;
    \n-
    408 static constexpr bool useDynamicOrder = (k<0);
    \n-
    409
    \n-
    410 using FiniteElementCache = typename std::conditional<(useDynamicOrder),
    \n-
    411 LagrangeRunTimeLFECache<typename GV::ctype, R, dim>,
    \n-
    412 PQkLocalFiniteElementCache<typename GV::ctype, R, dim, k>
    \n-
    413 >::type;
    \n-
    414
    \n-
    415public:
    \n-
    416
    \n-
    417 using size_type = std::size_t;
    \n-
    418 using Element = typename GV::template Codim<0>::Entity;
    \n-
    419 using FiniteElement = typename FiniteElementCache::FiniteElementType;
    \n-
    420
    \n-\n-
    423 finiteElement_(nullptr),
    \n-
    424 element_(nullptr)
    \n-
    425 {}
    \n-
    426
    \n-
    428 LagrangeNode(unsigned int order) :
    \n-
    429 order_(order),
    \n-
    430 finiteElement_(nullptr),
    \n-
    431 element_(nullptr)
    \n-
    432 {
    \n-
    433 // Only the cache for the run-time-order case (i.e., k<0), has the 'order_' member
    \n-
    434 if constexpr (useDynamicOrder)
    \n-
    435 cache_.order_ = order;
    \n-
    436 }
    \n-
    437
    \n-
    439 const Element& element() const
    \n-
    440 {
    \n-
    441 return *element_;
    \n-
    442 }
    \n-
    443
    \n-\n-
    449 {
    \n-
    450 return *finiteElement_;
    \n-
    451 }
    \n-
    452
    \n-
    454 void bind(const Element& e)
    \n-
    455 {
    \n-
    456 element_ = &e;
    \n-
    457 finiteElement_ = &(cache_.get(element_->type()));
    \n-
    458 this->setSize(finiteElement_->size());
    \n-
    459 }
    \n-
    460
    \n-
    461protected:
    \n-
    462
    \n-
    463 unsigned int order() const
    \n-
    464 {
    \n-
    465 return (useDynamicOrder) ? order_ : k;
    \n-
    466 }
    \n-
    467
    \n-
    468 // Run-time order, only valid if k<0
    \n-
    469 unsigned int order_;
    \n-
    470
    \n-
    471 FiniteElementCache cache_;
    \n-\n-\n-
    474};
    \n-
    475
    \n-
    476
    \n-
    477
    \n-
    478namespace BasisFactory {
    \n-
    479
    \n-
    488template<std::size_t k, typename R=double>
    \n-\n-
    490{
    \n-
    491 return [](const auto& gridView) {
    \n-
    492 return LagrangePreBasis<std::decay_t<decltype(gridView)>, k, R>(gridView);
    \n-
    493 };
    \n-
    494}
    \n-
    495
    \n-
    503template<typename R=double>
    \n-
    504auto lagrange(int order)
    \n-
    505{
    \n-
    506 return [=](const auto& gridView) {
    \n-
    507 return LagrangePreBasis<std::decay_t<decltype(gridView)>, -1, R>(gridView, order);
    \n-
    508 };
    \n-
    509}
    \n-
    510
    \n-
    511} // end namespace BasisFactory
    \n-
    512
    \n-
    513
    \n-
    514
    \n-
    538template<typename GV, int k=-1, typename R=double>
    \n-\n-
    540
    \n-
    541
    \n-
    542
    \n-
    543
    \n-
    544
    \n-
    545} // end namespace Functions
    \n-
    546} // end namespace Dune
    \n-
    547
    \n-
    548
    \n-
    549#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH
    \n-\n-\n-
    auto power(ChildPreBasisFactory &&childPreBasisFactory, const IndexMergingStrategy &)
    Create a pre-basis factory that can build a PowerPreBasis.
    Definition: powerbasis.hh:369
    \n-
    auto lagrange()
    Create a pre-basis factory that can create a Lagrange pre-basis.
    Definition: lagrangebasis.hh:489
    \n+
    38 template<class Node, class TreePath, class Range,
    \n+
    39 std::enable_if_t<not models<Concept::HasIndexAccess, Range, Dune::index_constant<0>>(), int> = 0>
    \n+
    40 decltype(auto) operator()(const Node&, const TreePath&, Range&& y) const
    \n+
    41 {
    \n+
    42 return std::forward<Range>(y);
    \n+
    43 }
    \n+
    44};
    \n+
    45
    \n+
    46
    \n+
    47
    \n+
    48} // namespace Dune::Functions
    \n+
    49} // namespace Dune
    \n+
    50
    \n+
    51
    \n+
    52#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH
    \n+\n+
    constexpr decltype(auto) resolveStaticMultiIndex(C &&c, const MultiIndex &multiIndex)
    Provide multi-index access by chaining operator[].
    Definition: indexaccess.hh:398
    \n
    Definition: polynomial.hh:10
    \n-
    Global basis for given pre-basis.
    Definition: defaultglobalbasis.hh:46
    \n-
    Definition: lagrangebasis.hh:387
    \n-
    LagrangeNode(unsigned int order)
    Constructor with a run-time order.
    Definition: lagrangebasis.hh:428
    \n-
    unsigned int order() const
    Definition: lagrangebasis.hh:463
    \n-
    const FiniteElement & finiteElement() const
    Return the LocalFiniteElement for the element we are bound to.
    Definition: lagrangebasis.hh:448
    \n-
    const Element * element_
    Definition: lagrangebasis.hh:473
    \n-
    const Element & element() const
    Return current element, throw if unbound.
    Definition: lagrangebasis.hh:439
    \n-
    FiniteElementCache cache_
    Definition: lagrangebasis.hh:471
    \n-
    typename FiniteElementCache::FiniteElementType FiniteElement
    Definition: lagrangebasis.hh:419
    \n-
    void bind(const Element &e)
    Bind to element.
    Definition: lagrangebasis.hh:454
    \n-
    typename GV::template Codim< 0 >::Entity Element
    Definition: lagrangebasis.hh:418
    \n-
    const FiniteElement * finiteElement_
    Definition: lagrangebasis.hh:472
    \n-
    unsigned int order_
    Definition: lagrangebasis.hh:469
    \n-
    std::size_t size_type
    Definition: lagrangebasis.hh:417
    \n-
    LagrangeNode()
    Constructor without order (uses the compile-time value)
    Definition: lagrangebasis.hh:422
    \n-
    A pre-basis for a PQ-lagrange bases with given order.
    Definition: lagrangebasis.hh:55
    \n-
    size_type dofsPerPrism() const
    Definition: lagrangebasis.hh:333
    \n-
    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
    \n-
    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
    \n-
    static constexpr size_type maxMultiIndexSize
    Definition: lagrangebasis.hh:70
    \n-
    size_type computeDofsPerPrism() const
    Definition: lagrangebasis.hh:355
    \n-
    size_type edgeOffset_
    Definition: lagrangebasis.hh:372
    \n-
    std::array< size_type, dim+1 > dofsPerSimplex_
    Definition: lagrangebasis.hh:366
    \n-
    It indices(const Node &node, It it) const
    Definition: lagrangebasis.hh:192
    \n-
    size_type vertexOffset_
    Definition: lagrangebasis.hh:371
    \n-
    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
    \n-
    std::size_t size_type
    Type used for indices and size information.
    Definition: lagrangebasis.hh:65
    \n-
    size_type pyramidOffset_
    Definition: lagrangebasis.hh:376
    \n-
    size_type prismOffset_
    Definition: lagrangebasis.hh:377
    \n-
    size_type tetrahedronOffset_
    Definition: lagrangebasis.hh:375
    \n-
    void initializeIndices()
    Initialize the global indices.
    Definition: lagrangebasis.hh:96
    \n-
    size_type computeDofsPerPyramid() const
    Definition: lagrangebasis.hh:360
    \n-
    LagrangePreBasis(const GridView &gv, unsigned int order)
    Constructor for a given grid view object and run-time order.
    Definition: lagrangebasis.hh:80
    \n-
    size_type dofsPerPyramid_
    Definition: lagrangebasis.hh:369
    \n-
    size_type dimension() const
    Get the total dimension of the space spanned by this basis.
    Definition: lagrangebasis.hh:178
    \n-
    LagrangePreBasis(const GridView &gv)
    Constructor for a given grid view object with compile-time order.
    Definition: lagrangebasis.hh:75
    \n-
    void update(const GridView &gv)
    Update the stored grid view, to be called if the grid has changed.
    Definition: lagrangebasis.hh:126
    \n-
    size_type size(const SizePrefix &prefix) const
    Return number of possible values for next position in multi index.
    Definition: lagrangebasis.hh:171
    \n-
    static constexpr size_type multiIndexBufferSize
    Definition: lagrangebasis.hh:72
    \n-
    GV GridView
    The grid view that the FE basis is defined on.
    Definition: lagrangebasis.hh:62
    \n-
    size_type quadrilateralOffset_
    Definition: lagrangebasis.hh:374
    \n-
    const GridView & gridView() const
    Obtain the grid view that the basis is defined on.
    Definition: lagrangebasis.hh:120
    \n-
    GridView gridView_
    Definition: lagrangebasis.hh:316
    \n-
    Node makeNode() const
    Create tree node.
    Definition: lagrangebasis.hh:134
    \n-
    unsigned int order() const
    Polynomial order used in the local Lagrange finite-elements.
    Definition: lagrangebasis.hh:310
    \n-
    const unsigned int order_
    Definition: lagrangebasis.hh:319
    \n-
    std::array< size_type, dim+1 > dofsPerCube_
    Definition: lagrangebasis.hh:367
    \n-
    size_type maxNodeSize() const
    Get the maximal number of DOFs associated to node for any element.
    Definition: lagrangebasis.hh:184
    \n-
    size_type size() const
    Same as size(prefix) with empty prefix.
    Definition: lagrangebasis.hh:140
    \n-
    size_type dofsPerPrism_
    Definition: lagrangebasis.hh:368
    \n-
    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
    \n-
    size_type triangleOffset_
    Definition: lagrangebasis.hh:373
    \n-
    size_type hexahedronOffset_
    Definition: lagrangebasis.hh:378
    \n-
    static constexpr size_type minMultiIndexSize
    Definition: lagrangebasis.hh:71
    \n-
    size_type dofsPerPyramid() const
    Definition: lagrangebasis.hh:338
    \n-
    void setSize(const size_type size)
    Definition: nodes.hh:164
    \n-
    Definition: nodes.hh:186
    \n+
    A simple node to range map using the nested tree indices.
    Definition: hierarchicnodetorangemap.hh:30
    \n+
    decltype(auto) operator()(const Node &, const TreePath &treePath, Range &&y) const
    Definition: hierarchicnodetorangemap.hh:33
    \n+
    decltype(auto) operator()(const Node &, const TreePath &, Range &&y) const
    Definition: hierarchicnodetorangemap.hh:40
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,744 +5,77 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-lagrangebasis.hh\n+hierarchicnodetorangemap.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH\n 5\n- 6#include \n- 7#include \n- 8\n- 9#include \n- 10#include \n- 11#include \n- 12\n- 13#include \n- 14#include \n- 15\n- 16\n- 17namespace Dune {\n- 18namespace Functions {\n+ 6\n+ 7#include \n+ 8#include \n+ 9\n+ 10#include \n+ 11\n+ 12#include \n+ 13#include \n+ 14\n+ 15namespace Dune {\n+ 16namespace Functions {\n+ 17\n+ 18\n 19\n- 20/\n-/ *****************************************************************************\n- 21// This is the reusable part of the LagrangeBasis. It contains\n- 22//\n- 23// LagrangePreBasis\n- 24// LagrangeNode\n- 25//\n- 26// The pre-basis allows to create the others and is the owner of possible\n-shared\n- 27// state. These components do _not_ depend on the global basis and local\n-view\n- 28// and can be used without a global basis.\n- 29/\n-/ *****************************************************************************\n- 30\n- 31template\n- 32class LagrangeNode;\n- 33\n- 34template\n- 35class LagrangePreBasis;\n- 36\n+29struct HierarchicNodeToRangeMap\n+ 30{\n+ 31 template>(), int> = 0>\n+33 decltype(auto) operator()(const Node&, const TreePath& treePath, Range&& y)\n+const\n+ 34 {\n+ 35 return resolveStaticMultiIndex(y, treePath);\n+ 36 }\n 37\n- 38\n- 53template\n-54class LagrangePreBasis\n- 55{\n- 56 static const int dim = GV::dimension;\n- 57 static const bool useDynamicOrder = (k<0);\n- 58\n- 59public:\n- 60\n-62 using GridView = GV;\n- 63\n-65 using size_type = std::size_t;\n- 66\n-68 using Node = LagrangeNode;\n- 69\n-70 static constexpr size_type maxMultiIndexSize = 1;\n-71 static constexpr size_type minMultiIndexSize = 1;\n-72 static constexpr size_type multiIndexBufferSize = 1;\n- 73\n-75 LagrangePreBasis(const GridView& gv)\n- 76 : LagrangePreBasis(gv, std::numeric_limits::max())\n- 77 {}\n- 78\n-80 LagrangePreBasis(const GridView& gv, unsigned int order) :\n- 81 gridView_(gv), order_(order)\n- 82 {\n- 83 if (!useDynamicOrder && order!=std::numeric_limits::max())\n- 84 DUNE_THROW(RangeError, \"Template argument k has to be -1 when supplying a\n-run-time order!\");\n- 85\n- 86 for (int i=0; i<=dim; i++)\n- 87 {\n- 88 dofsPerCube_[i] = computeDofsPerCube(i);\n- 89 dofsPerSimplex_[i] = computeDofsPerSimplex(i);\n- 90 }\n- 91 dofsPerPrism_ = computeDofsPerPrism();\n- 92 dofsPerPyramid_ = computeDofsPerPyramid();\n- 93 }\n- 94\n-96 void initializeIndices()\n- 97 {\n- 98 vertexOffset_ = 0;\n- 99 edgeOffset_ = vertexOffset_ + dofsPerCube(0) * ((size_type)gridView_.size\n-(dim));\n- 100\n- 101 if (dim>=2)\n- 102 {\n- 103 triangleOffset_ = edgeOffset_ + dofsPerCube(1) * ((size_type)\n-gridView_.size(dim-1));\n- 104\n- 105 quadrilateralOffset_ = triangleOffset_ + dofsPerSimplex(2) * (\n-(size_type)gridView_.size(Dune::GeometryTypes::triangle));\n- 106 }\n- 107\n- 108 if (dim==3) {\n- 109 tetrahedronOffset_ = quadrilateralOffset_ + dofsPerCube(2) * (\n-(size_type)gridView_.size(Dune::GeometryTypes::quadrilateral));\n- 110\n- 111 prismOffset_ = tetrahedronOffset_ + dofsPerSimplex(3) * (\n-(size_type)gridView_.size(Dune::GeometryTypes::tetrahedron));\n- 112\n- 113 hexahedronOffset_ = prismOffset_ + dofsPerPrism() * (\n-(size_type)gridView_.size(Dune::GeometryTypes::prism));\n- 114\n- 115 pyramidOffset_ = hexahedronOffset_ + dofsPerCube(3) * (\n-(size_type)gridView_.size(Dune::GeometryTypes::hexahedron));\n- 116 }\n- 117 }\n- 118\n-120 const GridView& gridView() const\n- 121 {\n- 122 return gridView_;\n- 123 }\n- 124\n-126 void update (const GridView& gv)\n- 127 {\n- 128 gridView_ = gv;\n- 129 }\n- 130\n-134 Node makeNode() const\n- 135 {\n- 136 return Node{order_};\n- 137 }\n- 138\n-140 size_type size() const\n- 141 {\n- 142 switch (dim)\n- 143 {\n- 144 case 1:\n- 145 return dofsPerCube(0) * ((size_type)gridView_.size(dim))\n- 146 + dofsPerCube(1) * ((size_type)gridView_.size(dim-1));\n- 147 case 2:\n- 148 {\n- 149 return dofsPerCube(0) * ((size_type)gridView_.size(dim))\n- 150 + dofsPerCube(1) * ((size_type)gridView_.size(dim-1))\n- 151 + dofsPerSimplex(2) * ((size_type)gridView_.size(Dune::GeometryTypes::\n-triangle))\n- 152 + dofsPerCube(2) * ((size_type)gridView_.size(Dune::GeometryTypes::\n-quadrilateral));\n- 153 }\n- 154 case 3:\n- 155 {\n- 156 return dofsPerCube(0) * ((size_type)gridView_.size(dim))\n- 157 + dofsPerCube(1) * ((size_type)gridView_.size(dim-1))\n- 158 + dofsPerSimplex(2) * ((size_type)gridView_.size(Dune::GeometryTypes::\n-triangle))\n- 159 + dofsPerCube(2) * ((size_type)gridView_.size(Dune::GeometryTypes::\n-quadrilateral))\n- 160 + dofsPerSimplex(3) * ((size_type)gridView_.size(Dune::GeometryTypes::\n-tetrahedron))\n- 161 + dofsPerPyramid() * ((size_type)gridView_.size(Dune::GeometryTypes::\n-pyramid))\n- 162 + dofsPerPrism() * ((size_type)gridView_.size(Dune::GeometryTypes::prism))\n- 163 + dofsPerCube(3) * ((size_type)gridView_.size(Dune::GeometryTypes::\n-hexahedron));\n- 164 }\n- 165 }\n- 166 DUNE_THROW(Dune::NotImplemented, \"No size method for \" << dim << \"d grids\n-available yet!\");\n- 167 }\n- 168\n- 170 template\n-171 size_type size(const SizePrefix& prefix) const\n- 172 {\n- 173 assert(prefix.size() == 0 || prefix.size() == 1);\n- 174 return (prefix.size() == 0) ? size() : 0;\n- 175 }\n- 176\n-178 size_type dimension() const\n- 179 {\n- 180 return size();\n- 181 }\n- 182\n-184 size_type maxNodeSize() const\n- 185 {\n- 186 // That cast to unsigned int is necessary because GV::dimension is an\n-enum,\n- 187 // which is not recognized by the power method as an integer type...\n- 188 return power(order()+1, (unsigned int)GV::dimension);\n- 189 }\n- 190\n- 191 template\n-192 It indices(const Node& node, It it) const\n- 193 {\n- 194 for (size_type i = 0, end = node.finiteElement().size() ; i < end ; ++it,\n-++i)\n- 195 {\n- 196 Dune::LocalKey localKey = node.finiteElement().localCoefficients\n-().localKey(i);\n- 197 const auto& gridIndexSet = gridView().indexSet();\n- 198 const auto& element = node.element();\n- 199\n- 200 // The dimension of the entity that the current dof is related to\n- 201 auto dofDim = dim - localKey.codim();\n- 202\n- 203 // Test for a vertex dof\n- 204 // The test for k==1 is redundant, but having it here allows the compiler\n-to conclude\n- 205 // at compile-time that the dofDim==0 case is the only one that will ever\n-happen.\n- 206 // This leads to measurable speed-up: see\n- 207 // https://gitlab.dune-project.org/staging/dune-functions/issues/30\n- 208 if (k==1 || dofDim==0) {\n- 209 *it = {{ (size_type)(gridIndexSet.subIndex(element,localKey.subEntity\n-(),dim)) }};\n- 210 continue;\n- 211 }\n- 212\n- 213 if (dofDim==1)\n- 214 { // edge dof\n- 215 if (dim==1) // element dof -- any local numbering is fine\n- 216 {\n- 217 *it = {{ edgeOffset_\n- 218 + dofsPerCube(1) * ((size_type)gridIndexSet.subIndex(element,0,0))\n- 219 + localKey.index() }};\n- 220 continue;\n- 221 }\n- 222 else\n- 223 {\n- 224 const auto refElement\n- 225 = Dune::referenceElement(element.type());\n- 226\n- 227 // We have to reverse the numbering if the local element edge is\n- 228 // not aligned with the global edge.\n- 229 auto v0 = (size_type)gridIndexSet.subIndex(element,refElement.subEntity\n-(localKey.subEntity(),localKey.codim(),0,dim),dim);\n- 230 auto v1 = (size_type)gridIndexSet.subIndex(element,refElement.subEntity\n-(localKey.subEntity(),localKey.codim(),1,dim),dim);\n- 231 bool flip = (v0 > v1);\n- 232 *it = {{ (flip)\n- 233 ? edgeOffset_\n- 234 + dofsPerCube(1)*((size_type)gridIndexSet.subIndex\n-(element,localKey.subEntity(),localKey.codim()))\n- 235 + (dofsPerCube(1)-1)-localKey.index()\n- 236 : edgeOffset_\n- 237 + dofsPerCube(1)*((size_type)gridIndexSet.subIndex\n-(element,localKey.subEntity(),localKey.codim()))\n- 238 + localKey.index() }};\n- 239 continue;\n- 240 }\n- 241 }\n- 242\n- 243 if (dofDim==2)\n- 244 {\n- 245 if (dim==2) // element dof -- any local numbering is fine\n- 246 {\n- 247 if (element.type().isTriangle())\n- 248 {\n- 249 *it = {{ triangleOffset_ + dofsPerSimplex(2)*(\n-(size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};\n- 250 continue;\n- 251 }\n- 252 else if (element.type().isQuadrilateral())\n- 253 {\n- 254 *it = {{ quadrilateralOffset_ + dofsPerCube(2)*(\n-(size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};\n- 255 continue;\n- 256 }\n- 257 else\n- 258 DUNE_THROW(Dune::NotImplemented, \"2d elements have to be triangles or\n-quadrilaterals\");\n- 259 } else\n- 260 {\n- 261 const auto refElement\n- 262 = Dune::referenceElement(element.type());\n- 263\n- 264 if (order()>3)\n- 265 DUNE_THROW(Dune::NotImplemented, \"LagrangeBasis for 3D grids is only\n-implemented if k<=3\");\n- 266\n- 267 if (order()==3 and !refElement.type(localKey.subEntity(), localKey.codim\n-()).isTriangle())\n- 268 DUNE_THROW(Dune::NotImplemented, \"LagrangeBasis for 3D grids with k==3 is\n-only implemented if the grid is a simplex grid\");\n- 269\n- 270 *it = {{ triangleOffset_ + ((size_type)gridIndexSet.subIndex\n-(element,localKey.subEntity(),localKey.codim())) }};\n- 271 continue;\n- 272 }\n- 273 }\n- 274\n- 275 if (dofDim==3)\n- 276 {\n- 277 if (dim==3) // element dof -- any local numbering is fine\n- 278 {\n- 279 if (element.type().isTetrahedron())\n- 280 {\n- 281 *it = {{ tetrahedronOffset_ + dofsPerSimplex(3)*(\n-(size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};\n- 282 continue;\n- 283 }\n- 284 else if (element.type().isHexahedron())\n- 285 {\n- 286 *it = {{ hexahedronOffset_ + dofsPerCube(3)*(\n-(size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};\n- 287 continue;\n- 288 }\n- 289 else if (element.type().isPrism())\n- 290 {\n- 291 *it = {{ prismOffset_ + dofsPerPrism()*((size_type)gridIndexSet.subIndex\n-(element,0,0)) + localKey.index() }};\n- 292 continue;\n- 293 }\n- 294 else if (element.type().isPyramid())\n- 295 {\n- 296 *it = {{ pyramidOffset_ + dofsPerPyramid()*(\n-(size_type)gridIndexSet.subIndex(element,0,0)) + localKey.index() }};\n- 297 continue;\n- 298 }\n- 299 else\n- 300 DUNE_THROW(Dune::NotImplemented, \"3d elements have to be tetrahedra,\n-hexahedra, prisms, or pyramids\");\n- 301 } else\n- 302 DUNE_THROW(Dune::NotImplemented, \"Grids of dimension larger than 3 are no\n-supported\");\n- 303 }\n- 304 DUNE_THROW(Dune::NotImplemented, \"Grid contains elements not supported for\n-the LagrangeBasis\");\n- 305 }\n- 306 return it;\n- 307 }\n- 308\n-310 unsigned int order() const\n- 311 {\n- 312 return (useDynamicOrder) ? order_ : k;\n- 313 }\n- 314\n- 315protected:\n-316 GridView gridView_;\n- 317\n- 318 // Run-time order, only valid if k<0\n-319 const unsigned int order_;\n- 320\n-322 size_type dofsPerSimplex(std::size_t simplexDim) const\n- 323 {\n- 324 return useDynamicOrder ? dofsPerSimplex_[simplexDim] :\n-computeDofsPerSimplex(simplexDim);\n- 325 }\n- 326\n-328 size_type dofsPerCube(std::size_t cubeDim) const\n- 329 {\n- 330 return useDynamicOrder ? dofsPerCube_[cubeDim] : computeDofsPerCube\n-(cubeDim);\n- 331 }\n- 332\n-333 size_type dofsPerPrism() const\n- 334 {\n- 335 return useDynamicOrder ? dofsPerPrism_ : computeDofsPerPrism();\n- 336 }\n- 337\n-338 size_type dofsPerPyramid() const\n- 339 {\n- 340 return useDynamicOrder ? dofsPerPyramid_ : computeDofsPerPyramid();\n- 341 }\n- 342\n-344 size_type computeDofsPerSimplex(std::size_t simplexDim) const\n- 345 {\n- 346 return order() == 0 ? (dim == simplexDim ? 1 : 0) : Dune::binomial(std::\n-size_t(order()-1),simplexDim);\n- 347 }\n- 348\n-350 size_type computeDofsPerCube(std::size_t cubeDim) const\n- 351 {\n- 352 return order() == 0 ? (dim == cubeDim ? 1 : 0) : Dune::power(order()-1,\n-cubeDim);\n- 353 }\n- 354\n-355 size_type computeDofsPerPrism() const\n- 356 {\n- 357 return order() == 0 ? (dim == 3 ? 1 : 0) : (order()-1)*(order()-1)*(order\n-()-2)/2;\n- 358 }\n- 359\n-360 size_type computeDofsPerPyramid() const\n- 361 {\n- 362 return order() == 0 ? (dim == 3 ? 1 : 0) : (order()-2)*(order()-1)*\n-(2*order()-3)/6;\n- 363 }\n- 364\n- 365 // When the order is given at run-time, the following numbers are pre-\n-computed:\n-366 std::array dofsPerSimplex_;\n-367 std::array dofsPerCube_;\n-368 size_type dofsPerPrism_;\n-369 size_type dofsPerPyramid_;\n- 370\n-371 size_type vertexOffset_;\n-372 size_type edgeOffset_;\n-373 size_type triangleOffset_;\n-374 size_type quadrilateralOffset_;\n-375 size_type tetrahedronOffset_;\n-376 size_type pyramidOffset_;\n-377 size_type prismOffset_;\n-378 size_type hexahedronOffset_;\n- 379\n- 380};\n- 381\n- 382\n- 383\n- 384template\n-385class LagrangeNode :\n- 386 public LeafBasisNode\n- 387{\n- 388 // Stores LocalFiniteElement implementations with run-time order as a\n-function of GeometryType\n- 389 template\n- 390 class LagrangeRunTimeLFECache\n- 391 {\n- 392 public:\n- 393 using FiniteElementType =\n-LagrangeLocalFiniteElement;\n- 394\n- 395 const FiniteElementType& get(GeometryType type)\n- 396 {\n- 397 auto i = data_.find(type);\n- 398 if (i==data_.end())\n- 399 i = data_.emplace(type,FiniteElementType(type,order_)).first;\n- 400 return (*i).second;\n- 401 }\n- 402\n- 403 std::map data_;\n- 404 unsigned int order_;\n- 405 };\n- 406\n- 407 static constexpr int dim = GV::dimension;\n- 408 static constexpr bool useDynamicOrder = (k<0);\n- 409\n- 410 using FiniteElementCache = typename std::conditional<(useDynamicOrder),\n- 411 LagrangeRunTimeLFECache,\n- 412 PQkLocalFiniteElementCache\n- 413 >::type;\n- 414\n- 415public:\n- 416\n-417 using size_type = std::size_t;\n-418 using Element = typename GV::template Codim<0>::Entity;\n-419 using FiniteElement = typename FiniteElementCache::FiniteElementType;\n- 420\n-422 LagrangeNode() :\n- 423 finiteElement_(nullptr),\n- 424 element_(nullptr)\n- 425 {}\n- 426\n-428 LagrangeNode(unsigned int order) :\n- 429 order_(order),\n- 430 finiteElement_(nullptr),\n- 431 element_(nullptr)\n- 432 {\n- 433 // Only the cache for the run-time-order case (i.e., k<0), has the\n-'order_' member\n- 434 if constexpr (useDynamicOrder)\n- 435 cache_.order_ = order;\n- 436 }\n- 437\n-439 const Element& element() const\n- 440 {\n- 441 return *element_;\n- 442 }\n- 443\n-448 const FiniteElement& finiteElement() const\n- 449 {\n- 450 return *finiteElement_;\n- 451 }\n- 452\n-454 void bind(const Element& e)\n- 455 {\n- 456 element_ = &e;\n- 457 finiteElement_ = &(cache_.get(element_->type()));\n- 458 this->setSize(finiteElement_->size());\n- 459 }\n- 460\n- 461protected:\n- 462\n-463 unsigned int order() const\n- 464 {\n- 465 return (useDynamicOrder) ? order_ : k;\n- 466 }\n- 467\n- 468 // Run-time order, only valid if k<0\n-469 unsigned int order_;\n- 470\n-471 FiniteElementCache cache_;\n-472 const FiniteElement* finiteElement_;\n-473 const Element* element_;\n- 474};\n- 475\n- 476\n- 477\n- 478namespace BasisFactory {\n- 479\n- 488template\n-489auto lagrange()\n- 490{\n- 491 return [](const auto& gridView) {\n- 492 return LagrangePreBasis, k, R>(gridView);\n- 493 };\n- 494}\n- 495\n- 503template\n-504auto lagrange(int order)\n- 505{\n- 506 return [=](const auto& gridView) {\n- 507 return LagrangePreBasis, -1, R>(gridView,\n-order);\n- 508 };\n- 509}\n- 510\n- 511} // end namespace BasisFactory\n- 512\n- 513\n- 514\n- 538template\n-539using LagrangeBasis = DefaultGlobalBasis >;\n- 540\n- 541\n- 542\n- 543\n- 544\n- 545} // end namespace Functions\n- 546} // end namespace Dune\n- 547\n- 548\n- 549#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEBASIS_HH\n-nodes.hh\n-defaultglobalbasis.hh\n-Dune::Functions::BasisFactory::power\n-auto power(ChildPreBasisFactory &&childPreBasisFactory, const\n-IndexMergingStrategy &)\n-Create a pre-basis factory that can build a PowerPreBasis.\n-Definition: powerbasis.hh:369\n-Dune::Functions::BasisFactory::lagrange\n-auto lagrange()\n-Create a pre-basis factory that can create a Lagrange pre-basis.\n-Definition: lagrangebasis.hh:489\n+ 38 template>(), int> = 0>\n+40 decltype(auto) operator()(const Node&, const TreePath&, Range&& y) const\n+ 41 {\n+ 42 return std::forward(y);\n+ 43 }\n+ 44};\n+ 45\n+ 46\n+ 47\n+ 48} // namespace Dune::Functions\n+ 49} // namespace Dune\n+ 50\n+ 51\n+ 52#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH\n+indexaccess.hh\n+Dune::Functions::resolveStaticMultiIndex\n+constexpr decltype(auto) resolveStaticMultiIndex(C &&c, const MultiIndex\n+&multiIndex)\n+Provide multi-index access by chaining operator[].\n+Definition: indexaccess.hh:398\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::DefaultGlobalBasis\n-Global basis for given pre-basis.\n-Definition: defaultglobalbasis.hh:46\n-Dune::Functions::LagrangeNode\n-Definition: lagrangebasis.hh:387\n-Dune::Functions::LagrangeNode::LagrangeNode\n-LagrangeNode(unsigned int order)\n-Constructor with a run-time order.\n-Definition: lagrangebasis.hh:428\n-Dune::Functions::LagrangeNode::order\n-unsigned int order() const\n-Definition: lagrangebasis.hh:463\n-Dune::Functions::LagrangeNode::finiteElement\n-const FiniteElement & finiteElement() const\n-Return the LocalFiniteElement for the element we are bound to.\n-Definition: lagrangebasis.hh:448\n-Dune::Functions::LagrangeNode::element_\n-const Element * element_\n-Definition: lagrangebasis.hh:473\n-Dune::Functions::LagrangeNode::element\n-const Element & element() const\n-Return current element, throw if unbound.\n-Definition: lagrangebasis.hh:439\n-Dune::Functions::LagrangeNode::cache_\n-FiniteElementCache cache_\n-Definition: lagrangebasis.hh:471\n-Dune::Functions::LagrangeNode::FiniteElement\n-typename FiniteElementCache::FiniteElementType FiniteElement\n-Definition: lagrangebasis.hh:419\n-Dune::Functions::LagrangeNode::bind\n-void bind(const Element &e)\n-Bind to element.\n-Definition: lagrangebasis.hh:454\n-Dune::Functions::LagrangeNode::Element\n-typename GV::template Codim< 0 >::Entity Element\n-Definition: lagrangebasis.hh:418\n-Dune::Functions::LagrangeNode::finiteElement_\n-const FiniteElement * finiteElement_\n-Definition: lagrangebasis.hh:472\n-Dune::Functions::LagrangeNode::order_\n-unsigned int order_\n-Definition: lagrangebasis.hh:469\n-Dune::Functions::LagrangeNode::size_type\n-std::size_t size_type\n-Definition: lagrangebasis.hh:417\n-Dune::Functions::LagrangeNode::LagrangeNode\n-LagrangeNode()\n-Constructor without order (uses the compile-time value)\n-Definition: lagrangebasis.hh:422\n-Dune::Functions::LagrangePreBasis\n-A pre-basis for a PQ-lagrange bases with given order.\n-Definition: lagrangebasis.hh:55\n-Dune::Functions::LagrangePreBasis::dofsPerPrism\n-size_type dofsPerPrism() const\n-Definition: lagrangebasis.hh:333\n-Dune::Functions::LagrangePreBasis::computeDofsPerCube\n-size_type computeDofsPerCube(std::size_t cubeDim) const\n-Number of degrees of freedom assigned to a cube (without the ones assigned to\n-its faces!...\n-Definition: lagrangebasis.hh:350\n-Dune::Functions::LagrangePreBasis::computeDofsPerSimplex\n-size_type computeDofsPerSimplex(std::size_t simplexDim) const\n-Number of degrees of freedom assigned to a simplex (without the ones assigned\n-to its faces!...\n-Definition: lagrangebasis.hh:344\n-Dune::Functions::LagrangePreBasis::maxMultiIndexSize\n-static constexpr size_type maxMultiIndexSize\n-Definition: lagrangebasis.hh:70\n-Dune::Functions::LagrangePreBasis::computeDofsPerPrism\n-size_type computeDofsPerPrism() const\n-Definition: lagrangebasis.hh:355\n-Dune::Functions::LagrangePreBasis::edgeOffset_\n-size_type edgeOffset_\n-Definition: lagrangebasis.hh:372\n-Dune::Functions::LagrangePreBasis::dofsPerSimplex_\n-std::array< size_type, dim+1 > dofsPerSimplex_\n-Definition: lagrangebasis.hh:366\n-Dune::Functions::LagrangePreBasis::indices\n-It indices(const Node &node, It it) const\n-Definition: lagrangebasis.hh:192\n-Dune::Functions::LagrangePreBasis::vertexOffset_\n-size_type vertexOffset_\n-Definition: lagrangebasis.hh:371\n-Dune::Functions::LagrangePreBasis::dofsPerSimplex\n-size_type dofsPerSimplex(std::size_t simplexDim) const\n-Number of degrees of freedom assigned to a simplex (without the ones assigned\n-to its faces!...\n-Definition: lagrangebasis.hh:322\n-Dune::Functions::LagrangePreBasis::size_type\n-std::size_t size_type\n-Type used for indices and size information.\n-Definition: lagrangebasis.hh:65\n-Dune::Functions::LagrangePreBasis::pyramidOffset_\n-size_type pyramidOffset_\n-Definition: lagrangebasis.hh:376\n-Dune::Functions::LagrangePreBasis::prismOffset_\n-size_type prismOffset_\n-Definition: lagrangebasis.hh:377\n-Dune::Functions::LagrangePreBasis::tetrahedronOffset_\n-size_type tetrahedronOffset_\n-Definition: lagrangebasis.hh:375\n-Dune::Functions::LagrangePreBasis::initializeIndices\n-void initializeIndices()\n-Initialize the global indices.\n-Definition: lagrangebasis.hh:96\n-Dune::Functions::LagrangePreBasis::computeDofsPerPyramid\n-size_type computeDofsPerPyramid() const\n-Definition: lagrangebasis.hh:360\n-Dune::Functions::LagrangePreBasis::LagrangePreBasis\n-LagrangePreBasis(const GridView &gv, unsigned int order)\n-Constructor for a given grid view object and run-time order.\n-Definition: lagrangebasis.hh:80\n-Dune::Functions::LagrangePreBasis::dofsPerPyramid_\n-size_type dofsPerPyramid_\n-Definition: lagrangebasis.hh:369\n-Dune::Functions::LagrangePreBasis::dimension\n-size_type dimension() const\n-Get the total dimension of the space spanned by this basis.\n-Definition: lagrangebasis.hh:178\n-Dune::Functions::LagrangePreBasis::LagrangePreBasis\n-LagrangePreBasis(const GridView &gv)\n-Constructor for a given grid view object with compile-time order.\n-Definition: lagrangebasis.hh:75\n-Dune::Functions::LagrangePreBasis::update\n-void update(const GridView &gv)\n-Update the stored grid view, to be called if the grid has changed.\n-Definition: lagrangebasis.hh:126\n-Dune::Functions::LagrangePreBasis::size\n-size_type size(const SizePrefix &prefix) const\n-Return number of possible values for next position in multi index.\n-Definition: lagrangebasis.hh:171\n-Dune::Functions::LagrangePreBasis::multiIndexBufferSize\n-static constexpr size_type multiIndexBufferSize\n-Definition: lagrangebasis.hh:72\n-Dune::Functions::LagrangePreBasis::GridView\n-GV GridView\n-The grid view that the FE basis is defined on.\n-Definition: lagrangebasis.hh:62\n-Dune::Functions::LagrangePreBasis::quadrilateralOffset_\n-size_type quadrilateralOffset_\n-Definition: lagrangebasis.hh:374\n-Dune::Functions::LagrangePreBasis::gridView\n-const GridView & gridView() const\n-Obtain the grid view that the basis is defined on.\n-Definition: lagrangebasis.hh:120\n-Dune::Functions::LagrangePreBasis::gridView_\n-GridView gridView_\n-Definition: lagrangebasis.hh:316\n-Dune::Functions::LagrangePreBasis::makeNode\n-Node makeNode() const\n-Create tree node.\n-Definition: lagrangebasis.hh:134\n-Dune::Functions::LagrangePreBasis::order\n-unsigned int order() const\n-Polynomial order used in the local Lagrange finite-elements.\n-Definition: lagrangebasis.hh:310\n-Dune::Functions::LagrangePreBasis::order_\n-const unsigned int order_\n-Definition: lagrangebasis.hh:319\n-Dune::Functions::LagrangePreBasis::dofsPerCube_\n-std::array< size_type, dim+1 > dofsPerCube_\n-Definition: lagrangebasis.hh:367\n-Dune::Functions::LagrangePreBasis::maxNodeSize\n-size_type maxNodeSize() const\n-Get the maximal number of DOFs associated to node for any element.\n-Definition: lagrangebasis.hh:184\n-Dune::Functions::LagrangePreBasis::size\n-size_type size() const\n-Same as size(prefix) with empty prefix.\n-Definition: lagrangebasis.hh:140\n-Dune::Functions::LagrangePreBasis::dofsPerPrism_\n-size_type dofsPerPrism_\n-Definition: lagrangebasis.hh:368\n-Dune::Functions::LagrangePreBasis::dofsPerCube\n-size_type dofsPerCube(std::size_t cubeDim) const\n-Number of degrees of freedom assigned to a cube (without the ones assigned to\n-its faces!...\n-Definition: lagrangebasis.hh:328\n-Dune::Functions::LagrangePreBasis::triangleOffset_\n-size_type triangleOffset_\n-Definition: lagrangebasis.hh:373\n-Dune::Functions::LagrangePreBasis::hexahedronOffset_\n-size_type hexahedronOffset_\n-Definition: lagrangebasis.hh:378\n-Dune::Functions::LagrangePreBasis::minMultiIndexSize\n-static constexpr size_type minMultiIndexSize\n-Definition: lagrangebasis.hh:71\n-Dune::Functions::LagrangePreBasis::dofsPerPyramid\n-size_type dofsPerPyramid() const\n-Definition: lagrangebasis.hh:338\n-Dune::Functions::BasisNodeMixin::setSize\n-void setSize(const size_type size)\n-Definition: nodes.hh:164\n-Dune::Functions::LeafBasisNode\n-Definition: nodes.hh:186\n+Dune::Functions::HierarchicNodeToRangeMap\n+A simple node to range map using the nested tree indices.\n+Definition: hierarchicnodetorangemap.hh:30\n+Dune::Functions::HierarchicNodeToRangeMap::operator()\n+decltype(auto) operator()(const Node &, const TreePath &treePath, Range &&y)\n+const\n+Definition: hierarchicnodetorangemap.hh:33\n+Dune::Functions::HierarchicNodeToRangeMap::operator()\n+decltype(auto) operator()(const Node &, const TreePath &, Range &&y) const\n+Definition: hierarchicnodetorangemap.hh:40\n+concepts.hh\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00137.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00137.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: sizeinfo.hh File Reference\n+dune-functions: transformedindexbasis.hh File Reference\n \n \n \n \n \n \n \n@@ -66,39 +66,70 @@\n \n \n
    \n \n-
    sizeinfo.hh File Reference
    \n+
    transformedindexbasis.hh File Reference
    \n
    \n
    \n-
    #include <array>
    \n+
    #include <tuple>
    \n+#include <utility>
    \n+#include <dune/common/std/apply.hh>
    \n+#include <dune/common/hybridutilities.hh>
    \n+#include <dune/common/reservedvector.hh>
    \n+#include <dune/common/typeutilities.hh>
    \n+#include <dune/typetree/compositenode.hh>
    \n+#include <dune/typetree/utility.hh>
    \n+#include <dune/functions/common/staticforloop.hh>
    \n+#include <dune/functions/common/type_traits.hh>
    \n+#include <dune/functions/common/utility.hh>
    \n+#include <dune/functions/functionspacebases/basistags.hh>
    \n+#include <dune/functions/functionspacebases/nodes.hh>
    \n+#include <dune/functions/functionspacebases/concepts.hh>
    \n+#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n+\n+\n+\n+\n+\n \n

    \n Classes

    class  Dune::Functions::SizeInfo< B >
     A class encapsulating size information. More...
    class  Dune::Functions::Experimental::TransformedIndexPreBasis< RPB, T >
     A pre-basis transforming multi-indices. More...
     
    class  Dune::Functions::BasisFactory::Experimental::GenericIndexingTransformation< IndexTransformation, SizeImplementation, minIS, maxIS >
     A generic implementation of a transformation. More...
     
    \n \n \n \n \n \n+\n+\n+\n+\n+\n+\n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    namespace  Dune::Functions::Experimental
     
    namespace  Dune::Functions::BasisFactory
     
    namespace  Dune::Functions::BasisFactory::Experimental
     
    \n \n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n

    \n Functions

    template<class Basis >
    SizeInfo< Basis > Dune::Functions::sizeInfo (const Basis &basis)
     
    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. More...
     
    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. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,26 +6,65 @@\n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n Classes | Namespaces | Functions\n-sizeinfo.hh File Reference\n-#include \n+transformedindexbasis.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::SizeInfo<_B_>\n-\u00a0 A class encapsulating size information. More...\n+class \u00a0Dune::Functions::Experimental::TransformedIndexPreBasis<_RPB,_T_>\n+\u00a0 A pre-basis transforming multi-indices. More...\n+\u00a0\n+class \u00a0Dune::Functions::BasisFactory::Experimental::\n+ GenericIndexingTransformation<_IndexTransformation,_SizeImplementation,\n+ minIS,_maxIS_>\n+\u00a0 A generic implementation of a transformation. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n+namespace \u00a0Dune::Functions::Experimental\n+\u00a0\n+namespace \u00a0Dune::Functions::BasisFactory\n+\u00a0\n+namespace \u00a0Dune::Functions::BasisFactory::Experimental\n+\u00a0\n Functions\n-template\n-SizeInfo< Basis >\u00a0Dune::Functions::sizeInfo (const Basis &basis)\n+template\n+ \u00a0Dune::Functions::Experimental::TransformedIndexPreBasis (RPB &&, T &&) -\n+ > TransformedIndexPreBasis< std::decay_t< RPB >, std::decay_t< T > >\n+\u00a0\n+template\n+auto\u00a0Dune::Functions::BasisFactory::Experimental::transformIndices\n+ (RawPreBasisFactory &&preBasisFactory, Transformation &&transformation)\n+\u00a0 Create a TransformedIndexPreBasisFactory. More...\n+\u00a0\n+template\n+auto\u00a0Dune::Functions::BasisFactory::Experimental::indexTransformation\n+ (IndexTransformation &&indexTransformation, SizeImplementation\n+ &&sizeImplementation, Dune::index_constant< minIndexSize >, Dune::\n+ index_constant< maxIndexSize >)\n+\u00a0 A generic implementation of a transformation. More...\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00137_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00137_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: sizeinfo.hh Source File\n+dune-functions: transformedindexbasis.hh Source File\n \n \n \n \n \n \n \n@@ -62,84 +62,275 @@\n \n \n
    \n
    \n-
    sizeinfo.hh
    \n+
    transformedindexbasis.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH
    \n
    5
    \n-
    6#include <array>
    \n-
    7
    \n-
    8namespace Dune {
    \n-
    9namespace Functions {
    \n-
    10
    \n-
    11
    \n-
    12
    \n-
    23template<class B>
    \n-\n-
    25{
    \n-
    26public:
    \n-
    27 using Basis = B;
    \n-
    28 using size_type = typename Basis::size_type;
    \n-
    29 using SizePrefix = typename Basis::SizePrefix;
    \n+
    6#include <tuple>
    \n+
    7#include <utility>
    \n+
    8
    \n+
    9#include <dune/common/std/apply.hh>
    \n+
    10#include <dune/common/hybridutilities.hh>
    \n+
    11#include <dune/common/reservedvector.hh>
    \n+
    12#include <dune/common/typeutilities.hh>
    \n+
    13#include <dune/common/hybridutilities.hh>
    \n+
    14
    \n+
    15#include <dune/typetree/compositenode.hh>
    \n+
    16#include <dune/typetree/utility.hh>
    \n+
    17
    \n+\n+\n+\n+\n+\n+\n+\n+
    25
    \n+
    26
    \n+
    27namespace Dune {
    \n+
    28namespace Functions {
    \n+
    29namespace Experimental {
    \n
    30
    \n-
    34 SizeInfo(const Basis& basis) :
    \n-
    35 basis_(&basis)
    \n-
    36 {}
    \n-
    37
    \n-
    41 size_type operator()(const SizePrefix& prefix) const
    \n-
    42 {
    \n-
    43 return basis_->size(prefix);
    \n-
    44 }
    \n-
    45
    \n-
    52 size_type size(const SizePrefix& prefix) const
    \n-
    53 {
    \n-
    54 return basis_->size(prefix);
    \n-
    55 }
    \n+
    31// *****************************************************************************
    \n+
    32// *****************************************************************************
    \n+
    33
    \n+
    50template<class RPB, class T>
    \n+\n+
    52{
    \n+
    53 using Transformation = T;
    \n+
    54
    \n+\n
    56
    \n-
    57 operator size_type () const
    \n-
    58 {
    \n-
    59 return basis_->dimension();
    \n-
    60 }
    \n-
    61
    \n-
    62protected:
    \n+
    57public:
    \n+
    58
    \n+
    59 using RawPreBasis = RPB;
    \n+
    60
    \n+
    62 using GridView = typename RawPreBasis::GridView;
    \n
    63
    \n-
    64 const Basis* basis_;
    \n-
    65};
    \n+
    65 using size_type = std::size_t;
    \n
    66
    \n-
    67
    \n-
    68template<class Basis>
    \n-
    69SizeInfo<Basis> sizeInfo(const Basis& basis)
    \n-
    70{
    \n-
    71 return SizeInfo<Basis>(basis);
    \n-
    72}
    \n+
    68 using Node = typename RawPreBasis::Node;
    \n+
    69
    \n+
    70 static constexpr size_type maxMultiIndexSize = Transformation::maxIndexSize;
    \n+
    71 static constexpr size_type minMultiIndexSize = Transformation::minIndexSize;
    \n+
    72 static constexpr size_type multiIndexBufferSize = std::max(RawPreBasis::multiIndexBufferSize, maxMultiIndexSize);
    \n
    73
    \n-
    74
    \n-
    75
    \n-
    76} // end namespace Functions
    \n-
    77} // end namespace Dune
    \n-
    78
    \n-
    79#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH
    \n+
    79 template<class RPB_R, class T_R>
    \n+
    80 TransformedIndexPreBasis(RPB_R&& rawPreBasis, T_R&& transformation) :
    \n+
    81 rawPreBasis_(std::forward<RPB_R>(rawPreBasis)),
    \n+
    82 transformation_(std::forward<T_R>(transformation))
    \n+
    83 {}
    \n+
    84
    \n+\n+
    87 {
    \n+
    88 rawPreBasis_.initializeIndices();
    \n+
    89 }
    \n+
    90
    \n+
    92 const GridView& gridView() const
    \n+
    93 {
    \n+
    94 return rawPreBasis_.gridView();
    \n+
    95 }
    \n+
    96
    \n+
    98 void update(const GridView& gv)
    \n+
    99 {
    \n+
    100 rawPreBasis_.update(gv);
    \n+
    101 }
    \n+
    102
    \n+\n+
    114 {
    \n+
    115 return rawPreBasis_.makeNode();
    \n+
    116 }
    \n+
    117
    \n+\n+
    120 {
    \n+
    121 return size(Dune::ReservedVector<size_type, multiIndexBufferSize>{});
    \n+
    122 }
    \n+
    123
    \n+
    125 template<class SizePrefix>
    \n+
    126 size_type size(const SizePrefix& prefix) const
    \n+
    127 {
    \n+
    128 return transformation_.size(prefix, rawPreBasis_);
    \n+
    129 }
    \n+
    130
    \n+\n+
    133 {
    \n+
    134 return transformation_.dimension(rawPreBasis_);
    \n+
    135 }
    \n+
    136
    \n+\n+
    139 {
    \n+
    140 return rawPreBasis_.maxNodeSize();
    \n+
    141 }
    \n+
    142
    \n+\n+
    144 {
    \n+
    145 return rawPreBasis_;
    \n+
    146 }
    \n+
    147
    \n+\n+
    149 {
    \n+
    150 return rawPreBasis_;
    \n+
    151 }
    \n+
    152
    \n+
    153 template<class MultiIndex>
    \n+
    154 void transformIndex(MultiIndex& multiIndex) const
    \n+
    155 {
    \n+
    156 transformation_.transformIndex(multiIndex, rawPreBasis_);
    \n+
    157 }
    \n+
    158
    \n+
    159 template<typename It>
    \n+
    160 It indices(const Node& node, It it) const
    \n+
    161 {
    \n+
    162 rawPreBasis().indices(node, it);
    \n+
    163 for(std::size_t i=0; i<node.size(); ++i)
    \n+
    164 {
    \n+
    165 transformIndex(*it);
    \n+
    166 ++it;
    \n+
    167 }
    \n+
    168 return it;
    \n+
    169 }
    \n+
    170
    \n+
    171protected:
    \n+\n+
    173 Transformation transformation_;
    \n+
    174};
    \n+
    175
    \n+
    176template<class RPB, class T>
    \n+\n+
    178
    \n+
    179
    \n+
    180} // end namespace Experimental
    \n+
    181
    \n+
    182
    \n+
    183namespace BasisFactory {
    \n+
    184namespace Experimental {
    \n+
    185
    \n+
    197template<class RawPreBasisFactory, class Transformation>
    \n+\n+
    199 RawPreBasisFactory&& preBasisFactory,
    \n+
    200 Transformation&& transformation)
    \n+
    201{
    \n+
    202 return [
    \n+
    203 preBasisFactory=std::forward<RawPreBasisFactory>(preBasisFactory),
    \n+
    204 transformation =std::forward<Transformation>(transformation)
    \n+
    205 ](const auto& gridView) {
    \n+
    206 return Dune::Functions::Experimental::TransformedIndexPreBasis(preBasisFactory(gridView), std::move(transformation));
    \n+
    207 };
    \n+
    208}
    \n+
    209
    \n+
    210
    \n+
    211
    \n+
    230template<class IndexTransformation, class SizeImplementation, std::size_t minIS, std::size_t maxIS>
    \n+\n+
    232{
    \n+
    233public:
    \n+
    234
    \n+
    235 static constexpr std::size_t minIndexSize = minIS;
    \n+
    236 static constexpr std::size_t maxIndexSize = maxIS;
    \n+
    237
    \n+
    238 template<class IT_R, class SI_R>
    \n+
    239 GenericIndexingTransformation(IT_R&& indexTransformation, SI_R&& sizeImplementation) :
    \n+
    240 indexTransformation_(std::forward<IT_R>(indexTransformation)),
    \n+
    241 sizeImplementation_(std::forward<SI_R>(sizeImplementation))
    \n+
    242 {}
    \n+
    243
    \n+
    244 template<class MultiIndex, class PreBasis>
    \n+
    245 void transformIndex(MultiIndex& multiIndex, const PreBasis& preBasis) const
    \n+
    246 {
    \n+
    247 indexTransformation_(multiIndex, preBasis);
    \n+
    248 }
    \n+
    249
    \n+
    250 template<class Prefix, class PreBasis>
    \n+
    251 auto size(const Prefix& prefix, const PreBasis& preBasis) const
    \n+
    252 {
    \n+
    253 return sizeImplementation_(prefix, preBasis);
    \n+
    254 }
    \n+
    255
    \n+
    256 template<class PreBasis>
    \n+
    257 auto dimension(const PreBasis& preBasis) const
    \n+
    258 {
    \n+
    259 return preBasis.dimension();
    \n+
    260 }
    \n+
    261
    \n+
    262private:
    \n+
    263 IndexTransformation indexTransformation_;
    \n+
    264 SizeImplementation sizeImplementation_;
    \n+
    265};
    \n+
    266
    \n+
    267
    \n+
    268
    \n+
    287template<class IndexTransformation, class SizeImplementation, std::size_t minIndexSize, std::size_t maxIndexSize>
    \n+
    288auto indexTransformation(IndexTransformation&& indexTransformation, SizeImplementation&& sizeImplementation, Dune::index_constant<minIndexSize>, Dune::index_constant<maxIndexSize>)
    \n+
    289{
    \n+\n+
    291 std::decay_t<IndexTransformation>,
    \n+
    292 std::decay_t<SizeImplementation>,
    \n+
    293 minIndexSize, maxIndexSize>(
    \n+
    294 std::forward<IndexTransformation>(indexTransformation),
    \n+
    295 std::forward<SizeImplementation>(sizeImplementation));
    \n+
    296}
    \n+
    297
    \n+
    298
    \n+
    299} // end namespace Experimental
    \n+
    300} // end namespace BasisFactory
    \n+
    301} // end namespace Functions
    \n+
    302} // end namespace Dune
    \n+
    303
    \n+
    304
    \n+
    305#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH
    \n+\n+\n+\n+\n+\n+\n
    Definition: polynomial.hh:10
    \n-
    SizeInfo< Basis > sizeInfo(const Basis &basis)
    Definition: sizeinfo.hh:69
    \n-
    A class encapsulating size information.
    Definition: sizeinfo.hh:25
    \n-
    typename Basis::SizePrefix SizePrefix
    Definition: sizeinfo.hh:29
    \n-
    size_type size(const SizePrefix &prefix) const
    Return number possible values for next position in multi index.
    Definition: sizeinfo.hh:52
    \n-
    size_type operator()(const SizePrefix &prefix) const
    Return number possible values for next position in multi index.
    Definition: sizeinfo.hh:41
    \n-
    typename Basis::size_type size_type
    Definition: sizeinfo.hh:28
    \n-
    B Basis
    Definition: sizeinfo.hh:27
    \n-
    SizeInfo(const Basis &basis)
    Construct from basis.
    Definition: sizeinfo.hh:34
    \n-
    const Basis * basis_
    Definition: sizeinfo.hh:64
    \n+
    auto transformIndices(RawPreBasisFactory &&preBasisFactory, Transformation &&transformation)
    Create a TransformedIndexPreBasisFactory.
    Definition: transformedindexbasis.hh:198
    \n+
    auto indexTransformation(IndexTransformation &&indexTransformation, SizeImplementation &&sizeImplementation, Dune::index_constant< minIndexSize >, Dune::index_constant< maxIndexSize >)
    A generic implementation of a transformation.
    Definition: transformedindexbasis.hh:288
    \n+
    TransformedIndexPreBasis(RPB &&, T &&) -> TransformedIndexPreBasis< std::decay_t< RPB >, std::decay_t< T > >
    \n+
    A pre-basis transforming multi-indices.
    Definition: transformedindexbasis.hh:52
    \n+
    It indices(const Node &node, It it) const
    Definition: transformedindexbasis.hh:160
    \n+
    Transformation transformation_
    Definition: transformedindexbasis.hh:173
    \n+
    void initializeIndices()
    Initialize the global indices.
    Definition: transformedindexbasis.hh:86
    \n+
    typename RawPreBasis::GridView GridView
    The grid view that the FE basis is defined on.
    Definition: transformedindexbasis.hh:62
    \n+
    void transformIndex(MultiIndex &multiIndex) const
    Definition: transformedindexbasis.hh:154
    \n+
    RawPreBasis rawPreBasis_
    Definition: transformedindexbasis.hh:172
    \n+
    typename RawPreBasis::Node Node
    Template mapping root tree path to type of created tree node.
    Definition: transformedindexbasis.hh:68
    \n+
    TransformedIndexPreBasis(RPB_R &&rawPreBasis, T_R &&transformation)
    Constructor for given child pre-basis objects.
    Definition: transformedindexbasis.hh:80
    \n+
    RawPreBasis & rawPreBasis()
    Definition: transformedindexbasis.hh:148
    \n+
    static constexpr size_type maxMultiIndexSize
    Definition: transformedindexbasis.hh:70
    \n+
    void update(const GridView &gv)
    Update the stored grid view, to be called if the grid has changed.
    Definition: transformedindexbasis.hh:98
    \n+
    Node makeNode() const
    Create tree node with given root tree path.
    Definition: transformedindexbasis.hh:113
    \n+
    const GridView & gridView() const
    Obtain the grid view that the basis is defined on.
    Definition: transformedindexbasis.hh:92
    \n+
    size_type size(const SizePrefix &prefix) const
    Return number of possible values for next position in multi index.
    Definition: transformedindexbasis.hh:126
    \n+
    RPB RawPreBasis
    Definition: transformedindexbasis.hh:59
    \n+
    size_type size() const
    Same as size(prefix) with empty prefix.
    Definition: transformedindexbasis.hh:119
    \n+
    size_type maxNodeSize() const
    Get the maximal number of DOFs associated to node for any element.
    Definition: transformedindexbasis.hh:138
    \n+
    std::size_t size_type
    Type used for indices and size information.
    Definition: transformedindexbasis.hh:65
    \n+
    static constexpr size_type multiIndexBufferSize
    Definition: transformedindexbasis.hh:72
    \n+
    size_type dimension() const
    Get the total dimension of the space spanned by this basis.
    Definition: transformedindexbasis.hh:132
    \n+
    const RawPreBasis & rawPreBasis() const
    Definition: transformedindexbasis.hh:143
    \n+
    static constexpr size_type minMultiIndexSize
    Definition: transformedindexbasis.hh:71
    \n+
    A generic implementation of a transformation.
    Definition: transformedindexbasis.hh:232
    \n+
    auto dimension(const PreBasis &preBasis) const
    Definition: transformedindexbasis.hh:257
    \n+
    GenericIndexingTransformation(IT_R &&indexTransformation, SI_R &&sizeImplementation)
    Definition: transformedindexbasis.hh:239
    \n+
    void transformIndex(MultiIndex &multiIndex, const PreBasis &preBasis) const
    Definition: transformedindexbasis.hh:245
    \n+
    static constexpr std::size_t maxIndexSize
    Definition: transformedindexbasis.hh:236
    \n+
    static constexpr std::size_t minIndexSize
    Definition: transformedindexbasis.hh:235
    \n+
    auto size(const Prefix &prefix, const PreBasis &preBasis) const
    Definition: transformedindexbasis.hh:251
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,101 +5,372 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-sizeinfo.hh\n+transformedindexbasis.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH\n 5\n- 6#include \n- 7\n- 8namespace Dune {\n- 9namespace Functions {\n- 10\n- 11\n- 12\n- 23template\n-24class SizeInfo\n- 25{\n- 26public:\n-27 using Basis = B;\n-28 using size_type = typename Basis::size_type;\n-29 using SizePrefix = typename Basis::SizePrefix;\n+ 6#include \n+ 7#include \n+ 8\n+ 9#include \n+ 10#include \n+ 11#include \n+ 12#include \n+ 13#include \n+ 14\n+ 15#include \n+ 16#include \n+ 17\n+ 18#include \n+ 19#include \n+ 20#include \n+ 21#include \n+ 22#include \n+ 23#include \n+ 24#include \n+ 25\n+ 26\n+ 27namespace Dune {\n+ 28namespace Functions {\n+29namespace Experimental {\n 30\n-34 SizeInfo(const Basis& basis) :\n- 35 basis_(&basis)\n- 36 {}\n- 37\n-41 size_type operator()(const SizePrefix& prefix) const\n- 42 {\n- 43 return basis_->size(prefix);\n- 44 }\n- 45\n-52 size_type size(const SizePrefix& prefix) const\n- 53 {\n- 54 return basis_->size(prefix);\n- 55 }\n+ 31/\n+/ *****************************************************************************\n+ 32/\n+/ *****************************************************************************\n+ 33\n+ 50template\n+51class TransformedIndexPreBasis\n+ 52{\n+ 53 using Transformation = T;\n+ 54\n+ 55 using This = TransformedIndexPreBasis;\n 56\n-57 operator size_type () const\n- 58 {\n- 59 return basis_->dimension();\n- 60 }\n- 61\n- 62protected:\n+ 57public:\n+ 58\n+59 using RawPreBasis = RPB;\n+ 60\n+62 using GridView = typename RawPreBasis::GridView;\n 63\n-64 const Basis* basis_;\n- 65};\n+65 using size_type = std::size_t;\n 66\n- 67\n- 68template\n-69SizeInfo sizeInfo(const Basis& basis)\n- 70{\n- 71 return SizeInfo(basis);\n- 72}\n+68 using Node = typename RawPreBasis::Node;\n+ 69\n+70 static constexpr size_type maxMultiIndexSize = Transformation::maxIndexSize;\n+71 static constexpr size_type minMultiIndexSize = Transformation::minIndexSize;\n+72 static constexpr size_type multiIndexBufferSize = std::max(RawPreBasis::\n+multiIndexBufferSize, maxMultiIndexSize);\n 73\n- 74\n- 75\n- 76} // end namespace Functions\n- 77} // end namespace Dune\n- 78\n- 79#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SIZEINFO_HH\n+ 79 template\n+80 TransformedIndexPreBasis(RPB_R&& rawPreBasis, T_R&& transformation) :\n+ 81 rawPreBasis_(std::forward(rawPreBasis)),\n+ 82 transformation_(std::forward(transformation))\n+ 83 {}\n+ 84\n+86 void initializeIndices()\n+ 87 {\n+ 88 rawPreBasis_.initializeIndices();\n+ 89 }\n+ 90\n+92 const GridView& gridView() const\n+ 93 {\n+ 94 return rawPreBasis_.gridView();\n+ 95 }\n+ 96\n+98 void update(const GridView& gv)\n+ 99 {\n+ 100 rawPreBasis_.update(gv);\n+ 101 }\n+ 102\n+113 Node makeNode() const\n+ 114 {\n+ 115 return rawPreBasis_.makeNode();\n+ 116 }\n+ 117\n+119 size_type size() const\n+ 120 {\n+ 121 return size(Dune::ReservedVector{});\n+ 122 }\n+ 123\n+ 125 template\n+126 size_type size(const SizePrefix& prefix) const\n+ 127 {\n+ 128 return transformation_.size(prefix, rawPreBasis_);\n+ 129 }\n+ 130\n+132 size_type dimension() const\n+ 133 {\n+ 134 return transformation_.dimension(rawPreBasis_);\n+ 135 }\n+ 136\n+138 size_type maxNodeSize() const\n+ 139 {\n+ 140 return rawPreBasis_.maxNodeSize();\n+ 141 }\n+ 142\n+143 const RawPreBasis& rawPreBasis() const\n+ 144 {\n+ 145 return rawPreBasis_;\n+ 146 }\n+ 147\n+148 RawPreBasis& rawPreBasis()\n+ 149 {\n+ 150 return rawPreBasis_;\n+ 151 }\n+ 152\n+ 153 template\n+154 void transformIndex(MultiIndex& multiIndex) const\n+ 155 {\n+ 156 transformation_.transformIndex(multiIndex, rawPreBasis_);\n+ 157 }\n+ 158\n+ 159 template\n+160 It indices(const Node& node, It it) const\n+ 161 {\n+ 162 rawPreBasis().indices(node, it);\n+ 163 for(std::size_t i=0; i\n+177TransformedIndexPreBasis(RPB&&, T&&) -> TransformedIndexPreBasis, std::decay_t>;\n+ 178\n+ 179\n+ 180} // end namespace Experimental\n+ 181\n+ 182\n+ 183namespace BasisFactory {\n+ 184namespace Experimental {\n+ 185\n+ 197template\n+198auto transformIndices(\n+ 199 RawPreBasisFactory&& preBasisFactory,\n+ 200 Transformation&& transformation)\n+ 201{\n+ 202 return [\n+ 203 preBasisFactory=std::forward(preBasisFactory),\n+ 204 transformation =std::forward(transformation)\n+ 205 ](const auto& gridView) {\n+ 206 return Dune::Functions::Experimental::TransformedIndexPreBasis\n+(preBasisFactory(gridView), std::move(transformation));\n+ 207 };\n+ 208}\n+ 209\n+ 210\n+ 211\n+ 230template\n+231class GenericIndexingTransformation\n+ 232{\n+ 233public:\n+ 234\n+235 static constexpr std::size_t minIndexSize = minIS;\n+236 static constexpr std::size_t maxIndexSize = maxIS;\n+ 237\n+ 238 template\n+239 GenericIndexingTransformation(IT_R&& indexTransformation, SI_R&&\n+sizeImplementation) :\n+ 240 indexTransformation_(std::forward(indexTransformation)),\n+ 241 sizeImplementation_(std::forward(sizeImplementation))\n+ 242 {}\n+ 243\n+ 244 template\n+245 void transformIndex(MultiIndex& multiIndex, const PreBasis& preBasis) const\n+ 246 {\n+ 247 indexTransformation_(multiIndex, preBasis);\n+ 248 }\n+ 249\n+ 250 template\n+251 auto size(const Prefix& prefix, const PreBasis& preBasis) const\n+ 252 {\n+ 253 return sizeImplementation_(prefix, preBasis);\n+ 254 }\n+ 255\n+ 256 template\n+257 auto dimension(const PreBasis& preBasis) const\n+ 258 {\n+ 259 return preBasis.dimension();\n+ 260 }\n+ 261\n+ 262private:\n+ 263 IndexTransformation indexTransformation_;\n+ 264 SizeImplementation sizeImplementation_;\n+ 265};\n+ 266\n+ 267\n+ 268\n+ 287template\n+288auto indexTransformation(IndexTransformation&& indexTransformation,\n+SizeImplementation&& sizeImplementation, Dune::index_constant,\n+Dune::index_constant)\n+ 289{\n+ 290 return GenericIndexingTransformation<\n+ 291 std::decay_t,\n+ 292 std::decay_t,\n+ 293 minIndexSize, maxIndexSize>(\n+ 294 std::forward(indexTransformation),\n+ 295 std::forward(sizeImplementation));\n+ 296}\n+ 297\n+ 298\n+ 299} // end namespace Experimental\n+ 300} // end namespace BasisFactory\n+ 301} // end namespace Functions\n+ 302} // end namespace Dune\n+ 303\n+ 304\n+ 305#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH\n+type_traits.hh\n+utility.hh\n+staticforloop.hh\n+basistags.hh\n+nodes.hh\n+defaultglobalbasis.hh\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::sizeInfo\n-SizeInfo< Basis > sizeInfo(const Basis &basis)\n-Definition: sizeinfo.hh:69\n-Dune::Functions::SizeInfo\n-A class encapsulating size information.\n-Definition: sizeinfo.hh:25\n-Dune::Functions::SizeInfo::SizePrefix\n-typename Basis::SizePrefix SizePrefix\n-Definition: sizeinfo.hh:29\n-Dune::Functions::SizeInfo::size\n+Dune::Functions::BasisFactory::Experimental::transformIndices\n+auto transformIndices(RawPreBasisFactory &&preBasisFactory, Transformation\n+&&transformation)\n+Create a TransformedIndexPreBasisFactory.\n+Definition: transformedindexbasis.hh:198\n+Dune::Functions::BasisFactory::Experimental::indexTransformation\n+auto indexTransformation(IndexTransformation &&indexTransformation,\n+SizeImplementation &&sizeImplementation, Dune::index_constant< minIndexSize >,\n+Dune::index_constant< maxIndexSize >)\n+A generic implementation of a transformation.\n+Definition: transformedindexbasis.hh:288\n+Dune::Functions::Experimental::TransformedIndexPreBasis\n+TransformedIndexPreBasis(RPB &&, T &&) -> TransformedIndexPreBasis< std::\n+decay_t< RPB >, std::decay_t< T > >\n+Dune::Functions::Experimental::TransformedIndexPreBasis\n+A pre-basis transforming multi-indices.\n+Definition: transformedindexbasis.hh:52\n+Dune::Functions::Experimental::TransformedIndexPreBasis::indices\n+It indices(const Node &node, It it) const\n+Definition: transformedindexbasis.hh:160\n+Dune::Functions::Experimental::TransformedIndexPreBasis::transformation_\n+Transformation transformation_\n+Definition: transformedindexbasis.hh:173\n+Dune::Functions::Experimental::TransformedIndexPreBasis::initializeIndices\n+void initializeIndices()\n+Initialize the global indices.\n+Definition: transformedindexbasis.hh:86\n+Dune::Functions::Experimental::TransformedIndexPreBasis::GridView\n+typename RawPreBasis::GridView GridView\n+The grid view that the FE basis is defined on.\n+Definition: transformedindexbasis.hh:62\n+Dune::Functions::Experimental::TransformedIndexPreBasis::transformIndex\n+void transformIndex(MultiIndex &multiIndex) const\n+Definition: transformedindexbasis.hh:154\n+Dune::Functions::Experimental::TransformedIndexPreBasis::rawPreBasis_\n+RawPreBasis rawPreBasis_\n+Definition: transformedindexbasis.hh:172\n+Dune::Functions::Experimental::TransformedIndexPreBasis::Node\n+typename RawPreBasis::Node Node\n+Template mapping root tree path to type of created tree node.\n+Definition: transformedindexbasis.hh:68\n+Dune::Functions::Experimental::TransformedIndexPreBasis::\n+TransformedIndexPreBasis\n+TransformedIndexPreBasis(RPB_R &&rawPreBasis, T_R &&transformation)\n+Constructor for given child pre-basis objects.\n+Definition: transformedindexbasis.hh:80\n+Dune::Functions::Experimental::TransformedIndexPreBasis::rawPreBasis\n+RawPreBasis & rawPreBasis()\n+Definition: transformedindexbasis.hh:148\n+Dune::Functions::Experimental::TransformedIndexPreBasis::maxMultiIndexSize\n+static constexpr size_type maxMultiIndexSize\n+Definition: transformedindexbasis.hh:70\n+Dune::Functions::Experimental::TransformedIndexPreBasis::update\n+void update(const GridView &gv)\n+Update the stored grid view, to be called if the grid has changed.\n+Definition: transformedindexbasis.hh:98\n+Dune::Functions::Experimental::TransformedIndexPreBasis::makeNode\n+Node makeNode() const\n+Create tree node with given root tree path.\n+Definition: transformedindexbasis.hh:113\n+Dune::Functions::Experimental::TransformedIndexPreBasis::gridView\n+const GridView & gridView() const\n+Obtain the grid view that the basis is defined on.\n+Definition: transformedindexbasis.hh:92\n+Dune::Functions::Experimental::TransformedIndexPreBasis::size\n size_type size(const SizePrefix &prefix) const\n-Return number possible values for next position in multi index.\n-Definition: sizeinfo.hh:52\n-Dune::Functions::SizeInfo::operator()\n-size_type operator()(const SizePrefix &prefix) const\n-Return number possible values for next position in multi index.\n-Definition: sizeinfo.hh:41\n-Dune::Functions::SizeInfo::size_type\n-typename Basis::size_type size_type\n-Definition: sizeinfo.hh:28\n-Dune::Functions::SizeInfo::Basis\n-B Basis\n-Definition: sizeinfo.hh:27\n-Dune::Functions::SizeInfo::SizeInfo\n-SizeInfo(const Basis &basis)\n-Construct from basis.\n-Definition: sizeinfo.hh:34\n-Dune::Functions::SizeInfo::basis_\n-const Basis * basis_\n-Definition: sizeinfo.hh:64\n+Return number of possible values for next position in multi index.\n+Definition: transformedindexbasis.hh:126\n+Dune::Functions::Experimental::TransformedIndexPreBasis::RawPreBasis\n+RPB RawPreBasis\n+Definition: transformedindexbasis.hh:59\n+Dune::Functions::Experimental::TransformedIndexPreBasis::size\n+size_type size() const\n+Same as size(prefix) with empty prefix.\n+Definition: transformedindexbasis.hh:119\n+Dune::Functions::Experimental::TransformedIndexPreBasis::maxNodeSize\n+size_type maxNodeSize() const\n+Get the maximal number of DOFs associated to node for any element.\n+Definition: transformedindexbasis.hh:138\n+Dune::Functions::Experimental::TransformedIndexPreBasis::size_type\n+std::size_t size_type\n+Type used for indices and size information.\n+Definition: transformedindexbasis.hh:65\n+Dune::Functions::Experimental::TransformedIndexPreBasis::multiIndexBufferSize\n+static constexpr size_type multiIndexBufferSize\n+Definition: transformedindexbasis.hh:72\n+Dune::Functions::Experimental::TransformedIndexPreBasis::dimension\n+size_type dimension() const\n+Get the total dimension of the space spanned by this basis.\n+Definition: transformedindexbasis.hh:132\n+Dune::Functions::Experimental::TransformedIndexPreBasis::rawPreBasis\n+const RawPreBasis & rawPreBasis() const\n+Definition: transformedindexbasis.hh:143\n+Dune::Functions::Experimental::TransformedIndexPreBasis::minMultiIndexSize\n+static constexpr size_type minMultiIndexSize\n+Definition: transformedindexbasis.hh:71\n+Dune::Functions::BasisFactory::Experimental::GenericIndexingTransformation\n+A generic implementation of a transformation.\n+Definition: transformedindexbasis.hh:232\n+Dune::Functions::BasisFactory::Experimental::GenericIndexingTransformation::\n+dimension\n+auto dimension(const PreBasis &preBasis) const\n+Definition: transformedindexbasis.hh:257\n+Dune::Functions::BasisFactory::Experimental::GenericIndexingTransformation::\n+GenericIndexingTransformation\n+GenericIndexingTransformation(IT_R &&indexTransformation, SI_R\n+&&sizeImplementation)\n+Definition: transformedindexbasis.hh:239\n+Dune::Functions::BasisFactory::Experimental::GenericIndexingTransformation::\n+transformIndex\n+void transformIndex(MultiIndex &multiIndex, const PreBasis &preBasis) const\n+Definition: transformedindexbasis.hh:245\n+Dune::Functions::BasisFactory::Experimental::GenericIndexingTransformation::\n+maxIndexSize\n+static constexpr std::size_t maxIndexSize\n+Definition: transformedindexbasis.hh:236\n+Dune::Functions::BasisFactory::Experimental::GenericIndexingTransformation::\n+minIndexSize\n+static constexpr std::size_t minIndexSize\n+Definition: transformedindexbasis.hh:235\n+Dune::Functions::BasisFactory::Experimental::GenericIndexingTransformation::\n+size\n+auto size(const Prefix &prefix, const PreBasis &preBasis) const\n+Definition: transformedindexbasis.hh:251\n+concepts.hh\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00140.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00140.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: flatvectorview.hh File Reference\n+dune-functions: raviartthomasbasis.hh File Reference\n \n \n \n \n \n \n \n@@ -63,48 +63,70 @@\n \n \n
    \n \n-
    flatvectorview.hh File Reference
    \n+
    raviartthomasbasis.hh File Reference
    \n
    \n
    \n
    #include <array>
    \n-#include <dune/common/concept.hh>
    \n-#include <dune/common/hybridutilities.hh>
    \n-#include <dune/common/indices.hh>
    \n-#include <dune/functions/functionspacebases/concepts.hh>
    \n+#include <dune/common/exceptions.hh>
    \n+#include <dune/grid/common/capabilities.hh>
    \n+#include <dune/grid/common/mcmgmapper.hh>
    \n+#include <dune/localfunctions/common/localfiniteelementvariant.hh>
    \n+#include <dune/localfunctions/raviartthomas.hh>
    \n+#include <dune/localfunctions/raviartthomas/raviartthomas0cube2d.hh>
    \n+#include <dune/localfunctions/raviartthomas/raviartthomas0cube3d.hh>
    \n+#include <dune/localfunctions/raviartthomas/raviartthomas02d.hh>
    \n+#include <dune/localfunctions/raviartthomas/raviartthomas03d.hh>
    \n+#include <dune/localfunctions/raviartthomas/raviartthomas1cube2d.hh>
    \n+#include <dune/localfunctions/raviartthomas/raviartthomas1cube3d.hh>
    \n+#include <dune/localfunctions/raviartthomas/raviartthomas12d.hh>
    \n+#include <dune/localfunctions/raviartthomas/raviartthomas2cube2d.hh>
    \n+#include <dune/functions/functionspacebases/globalvaluedlocalfiniteelement.hh>
    \n+#include <dune/functions/functionspacebases/nodes.hh>
    \n+#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n+\n+\n+\n+\n+\n+

    \n+Classes

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    namespace  Dune::Functions::BasisFactory
     
    \n+\n+\n+\n+\n+\n

    \n+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. More...
     
    \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n

    \n Functions

    template<class T >
    auto Dune::Functions::flatVectorView (T &t)
     Create flat vector view of passed mutable container. More...
     
    template<class T >
    auto Dune::Functions::flatVectorView (const T &t)
     Create flat vector view of passed const container. More...
     
    template<class T >
    auto Dune::Functions::flatVectorView (T &&t)
     Create flat vector view of passed container temporary. More...
     
    template<std::size_t k>
    auto Dune::Functions::BasisFactory::raviartThomas ()
     Create a pre-basis factory that can create a Raviart-Thomas pre-basis. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,36 +5,54 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-Namespaces | Functions\n-flatvectorview.hh File Reference\n+Classes | Namespaces | Typedefs | Functions\n+raviartthomasbasis.hh File Reference\n #include \n-#include \n-#include \n-#include \n-#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n+ Classes\n+class \u00a0Dune::Functions::RaviartThomasPreBasis<_GV,_k_>\n+\u00a0\n+class \u00a0Dune::Functions::RaviartThomasNode<_GV,_k_>\n+\u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n+namespace \u00a0Dune::Functions::BasisFactory\n+\u00a0\n+ Typedefs\n+template\n+using\u00a0Dune::Functions::RaviartThomasBasis = DefaultGlobalBasis<\n+ RaviartThomasPreBasis< GV, k > >\n+\u00a0 Basis of a k-th-order Raviart Thomas finite element space. More...\n+\u00a0\n Functions\n-template\n-auto\u00a0Dune::Functions::flatVectorView (T &t)\n-\u00a0 Create flat vector view of passed mutable container. More...\n-\u00a0\n-template\n-auto\u00a0Dune::Functions::flatVectorView (const T &t)\n-\u00a0 Create flat vector view of passed const container. More...\n-\u00a0\n-template\n-auto\u00a0Dune::Functions::flatVectorView (T &&t)\n-\u00a0 Create flat vector view of passed container temporary. More...\n+template\n+auto\u00a0Dune::Functions::BasisFactory::raviartThomas ()\n+\u00a0 Create a pre-basis factory that can create a Raviart-Thomas pre-basis.\n+ More...\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00140_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00140_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: flatvectorview.hh Source File\n+dune-functions: raviartthomasbasis.hh Source File\n \n \n \n \n \n \n \n@@ -62,209 +62,445 @@\n \n \n \n
    \n-
    flatvectorview.hh
    \n+
    raviartthomasbasis.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH
    \n
    5
    \n-
    6
    \n-
    7#include <array>
    \n+
    6#include <array>
    \n+
    7#include <dune/common/exceptions.hh>
    \n
    8
    \n-
    9#include <dune/common/concept.hh>
    \n-
    10#include <dune/common/hybridutilities.hh>
    \n-
    11#include <dune/common/indices.hh>
    \n-
    12
    \n-\n-
    14
    \n-
    15
    \n-
    16
    \n-
    17
    \n-
    18namespace Dune {
    \n-
    19namespace Functions {
    \n-
    20namespace Impl {
    \n-
    21
    \n+
    9#include <dune/grid/common/capabilities.hh>
    \n+
    10#include <dune/grid/common/mcmgmapper.hh>
    \n+
    11
    \n+
    12#include <dune/localfunctions/common/localfiniteelementvariant.hh>
    \n+
    13#include <dune/localfunctions/raviartthomas.hh>
    \n+
    14#include <dune/localfunctions/raviartthomas/raviartthomas0cube2d.hh>
    \n+
    15#include <dune/localfunctions/raviartthomas/raviartthomas0cube3d.hh>
    \n+
    16#include <dune/localfunctions/raviartthomas/raviartthomas02d.hh>
    \n+
    17#include <dune/localfunctions/raviartthomas/raviartthomas03d.hh>
    \n+
    18#include <dune/localfunctions/raviartthomas/raviartthomas1cube2d.hh>
    \n+
    19#include <dune/localfunctions/raviartthomas/raviartthomas1cube3d.hh>
    \n+
    20#include <dune/localfunctions/raviartthomas/raviartthomas12d.hh>
    \n+
    21#include <dune/localfunctions/raviartthomas/raviartthomas2cube2d.hh>
    \n
    22
    \n-
    23template<class V>
    \n-
    24struct FlatVectorBackend
    \n-
    25{
    \n+\n+\n+\n
    26
    \n-
    27 template<class VV, class Index,
    \n-
    28 typename std::enable_if< models<Concept::HasIndexAccess, VV, Index>(), int>::type = 0>
    \n-
    29 static decltype(auto) getEntry(VV&& v, const Index& i)
    \n-
    30 {
    \n-
    31 return v[i];
    \n-
    32 }
    \n-
    33
    \n-
    34 template<class VV, class Index,
    \n-
    35 typename std::enable_if< not models<Concept::HasIndexAccess, VV, Index>(), int>::type = 0>
    \n-
    36 static decltype(auto) getEntry(VV&& v, const Index&)
    \n-
    37 {
    \n-
    38 return std::forward<VV>(v);
    \n-
    39 }
    \n-
    40
    \n-
    41 template<class VV,
    \n-
    42 typename std::enable_if< models<Concept::HasSizeMethod, VV>(), int>::type = 0>
    \n-
    43 static auto size(VV&& v)
    \n-
    44 {
    \n-
    45 return Dune::Hybrid::size(v);
    \n-
    46 }
    \n-
    47
    \n-
    48 template<class VV,
    \n-
    49 typename std::enable_if< not models<Concept::HasSizeMethod, VV>(), int>::type = 0>
    \n-
    50 static auto size(VV&&)
    \n-
    51 {
    \n-
    52 return Dune::index_constant<1>{};
    \n-
    53 }
    \n-
    54};
    \n-
    55
    \n+
    27namespace Dune {
    \n+
    28namespace Functions {
    \n+
    29
    \n+
    30namespace Impl {
    \n+
    31
    \n+
    32 template<int dim, typename D, typename R, std::size_t k>
    \n+
    33 struct RaviartThomasSimplexLocalInfo
    \n+
    34 {
    \n+
    35 // Dummy type, must be something that we can have a std::unique_ptr to
    \n+
    36 using FiniteElement = void*;
    \n+
    37 };
    \n+
    38
    \n+
    39 template<typename D, typename R>
    \n+
    40 struct RaviartThomasSimplexLocalInfo<2,D,R,0>
    \n+
    41 {
    \n+
    42 using FiniteElement = RT02DLocalFiniteElement<D,R>;
    \n+
    43 };
    \n+
    44
    \n+
    45 template<typename D, typename R>
    \n+
    46 struct RaviartThomasSimplexLocalInfo<2,D,R,1>
    \n+
    47 {
    \n+
    48 using FiniteElement = RT12DLocalFiniteElement<D,R>;
    \n+
    49 };
    \n+
    50
    \n+
    51 template<typename D, typename R>
    \n+
    52 struct RaviartThomasSimplexLocalInfo<3,D,R,0>
    \n+
    53 {
    \n+
    54 using FiniteElement = RT03DLocalFiniteElement<D,R>;
    \n+
    55 };
    \n
    56
    \n-
    57
    \n-
    58
    \n-
    59template<class K, int n, int m>
    \n-
    60struct FlatVectorBackend<typename Dune::FieldMatrix<K, n, m> >
    \n-
    61{
    \n-
    62
    \n-
    63 template<class VV, class Index>
    \n-
    64 static decltype(auto) getEntry(VV&& v, const Index& i)
    \n-
    65 {
    \n-
    66 return v[i/m][i%m];
    \n-
    67 }
    \n-
    68
    \n-
    69 template<class VV>
    \n-
    70 static auto size(VV&& v)
    \n-
    71 {
    \n-
    72 return Dune::index_constant<n*m>{};
    \n-
    73 }
    \n-
    74};
    \n+
    57 template<int dim, typename D, typename R, std::size_t k>
    \n+
    58 struct RaviartThomasCubeLocalInfo
    \n+
    59 {
    \n+
    60 // Dummy type, must be something that we can have a std::unique_ptr to
    \n+
    61 using FiniteElement = void*;
    \n+
    62 };
    \n+
    63
    \n+
    64 template<typename D, typename R>
    \n+
    65 struct RaviartThomasCubeLocalInfo<2,D,R,0>
    \n+
    66 {
    \n+
    67 using FiniteElement = RT0Cube2DLocalFiniteElement<D,R>;
    \n+
    68 };
    \n+
    69
    \n+
    70 template<typename D, typename R>
    \n+
    71 struct RaviartThomasCubeLocalInfo<2,D,R,1>
    \n+
    72 {
    \n+
    73 using FiniteElement = RT1Cube2DLocalFiniteElement<D,R>;
    \n+
    74 };
    \n
    75
    \n-
    76
    \n-
    77
    \n-
    78template<class K, std::size_t n>
    \n-
    79struct FlatVectorBackend< std::array<K, n> >
    \n-
    80{
    \n+
    76 template<typename D, typename R>
    \n+
    77 struct RaviartThomasCubeLocalInfo<2,D,R,2>
    \n+
    78 {
    \n+
    79 using FiniteElement = RT2Cube2DLocalFiniteElement<D,R>;
    \n+
    80 };
    \n
    81
    \n-
    82 template<class VV, class Index>
    \n-
    83 static decltype(auto) getEntry(VV&& v, const Index& i)
    \n+
    82 template<typename D, typename R>
    \n+
    83 struct RaviartThomasCubeLocalInfo<3,D,R,0>
    \n
    84 {
    \n-
    85 const auto innerSize = decltype(FlatVectorBackend<K>::size(v[0]))::value;
    \n-
    86 return FlatVectorBackend<K>::getEntry(v[i/innerSize], i%innerSize);
    \n-
    87 }
    \n-
    88
    \n-
    89 template<class VV>
    \n-
    90 static auto size(VV&& v)
    \n-
    91 {
    \n-
    92 const auto innerSize = decltype(FlatVectorBackend<K>::size(v[0]))::value;
    \n-
    93 return Dune::index_constant<n*innerSize>{};
    \n-
    94 }
    \n-
    95
    \n-
    96};
    \n-
    97
    \n-
    98
    \n+
    85 using FiniteElement = RT0Cube3DLocalFiniteElement<D,R>;
    \n+
    86 };
    \n+
    87
    \n+
    88 template<typename D, typename R>
    \n+
    89 struct RaviartThomasCubeLocalInfo<3,D,R,1>
    \n+
    90 {
    \n+
    91 using FiniteElement = RT1Cube3DLocalFiniteElement<D,R>;
    \n+
    92 };
    \n+
    93
    \n+
    94 template<typename GV, int dim, typename R, std::size_t k>
    \n+
    95 class RaviartThomasLocalFiniteElementMap
    \n+
    96 {
    \n+
    97 using D = typename GV::ctype;
    \n+
    98 constexpr static bool hasFixedElementType = Capabilities::hasSingleGeometryType<typename GV::Grid>::v;
    \n
    99
    \n-
    100
    \n-
    101template<class T>
    \n-
    102class FlatVectorView
    \n-
    103{
    \n-
    104 using Backend = FlatVectorBackend<std::decay_t<T>>;
    \n-
    105public:
    \n-
    106 FlatVectorView(T& t) :
    \n-
    107 t_(&t)
    \n-
    108 {}
    \n+
    100 using CubeFiniteElement = typename RaviartThomasCubeLocalInfo<dim, D, R, k>::FiniteElement;
    \n+
    101 using SimplexFiniteElement = typename RaviartThomasSimplexLocalInfo<dim, D, R, k>::FiniteElement;
    \n+
    102
    \n+
    103 public:
    \n+
    104
    \n+
    105 using T = LocalBasisTraits<D, dim, FieldVector<D,dim>, R, dim, FieldVector<R,dim>, FieldMatrix<D,dim,dim> >;
    \n+
    106
    \n+
    107 constexpr static unsigned int topologyId = Capabilities::hasSingleGeometryType<typename GV::Grid>::topologyId; // meaningless if hasFixedElementType is false
    \n+
    108 constexpr static GeometryType type = GeometryType(topologyId, GV::dimension);
    \n
    109
    \n-
    110 auto size() const
    \n-
    111 {
    \n-
    112 return Backend::size(*t_);
    \n-
    113 }
    \n-
    114
    \n-
    115 template<class Index>
    \n-
    116 decltype(auto) operator[](const Index& i) const
    \n-
    117 {
    \n-
    118 return Backend::getEntry(*t_, i);
    \n-
    119 }
    \n-
    120
    \n-
    121 template<class Index>
    \n-
    122 decltype(auto) operator[](const Index& i)
    \n-
    123 {
    \n-
    124 return Backend::getEntry(*t_, i);
    \n-
    125 }
    \n-
    126
    \n-
    127private:
    \n-
    128 T* t_;
    \n-
    129};
    \n-
    130
    \n-
    131
    \n-
    132template<class T>
    \n-
    133class FlatVectorView<T&&>
    \n-
    134{
    \n-
    135 using Backend = FlatVectorBackend<std::decay_t<T>>;
    \n-
    136public:
    \n-
    137 FlatVectorView(T&& t) :
    \n-
    138 t_(std::move(t))
    \n-
    139 {}
    \n-
    140
    \n-
    141 auto size() const
    \n-
    142 {
    \n-
    143 return Backend::size(t_);
    \n-
    144 }
    \n-
    145
    \n-
    146 template<class Index>
    \n-
    147 decltype(auto) operator[](const Index& i) const
    \n-
    148 {
    \n-
    149 return Backend::getEntry(t_, i);
    \n-
    150 }
    \n-
    151
    \n-
    152 template<class Index>
    \n-
    153 decltype(auto) operator[](const Index& i)
    \n-
    154 {
    \n-
    155 return Backend::getEntry(t_, i);
    \n-
    156 }
    \n-
    157
    \n-
    158private:
    \n-
    159 T t_;
    \n-
    160};
    \n-
    161
    \n-
    162} // namespace Impl
    \n-
    163
    \n-
    164
    \n+
    110 using FiniteElement = std::conditional_t<hasFixedElementType,
    \n+
    111 std::conditional_t<type.isCube(),CubeFiniteElement,SimplexFiniteElement>,
    \n+
    112 LocalFiniteElementVariant<CubeFiniteElement, SimplexFiniteElement> >;
    \n+
    113
    \n+
    114 // Each element facet can have its orientation reversed, hence there are
    \n+
    115 // 2^#facets different variants.
    \n+
    116 static std::size_t numVariants(GeometryType type)
    \n+
    117 {
    \n+
    118 auto numFacets = referenceElement<D,dim>(type).size(1);
    \n+
    119 return power(2,numFacets);
    \n+
    120 }
    \n+
    121
    \n+
    122 RaviartThomasLocalFiniteElementMap(const GV& gv)
    \n+
    123 : elementMapper_(gv, mcmgElementLayout()),
    \n+
    124 orient_(gv.size(0))
    \n+
    125 {
    \n+
    126 if constexpr (hasFixedElementType)
    \n+
    127 {
    \n+
    128 variants_.resize(numVariants(type));
    \n+
    129 for (size_t i = 0; i < numVariants(type); i++)
    \n+
    130 variants_[i] = FiniteElement(i);
    \n+
    131 }
    \n+
    132 else
    \n+
    133 {
    \n+
    134 // for mixed grids add offset for cubes
    \n+
    135 variants_.resize(numVariants(GeometryTypes::simplex(dim)) + numVariants(GeometryTypes::cube(dim)));
    \n+
    136 for (size_t i = 0; i < numVariants(GeometryTypes::simplex(dim)); i++)
    \n+
    137 variants_[i] = SimplexFiniteElement(i);
    \n+
    138 for (size_t i = 0; i < numVariants(GeometryTypes::cube(dim)); i++)
    \n+
    139 variants_[i + numVariants(GeometryTypes::simplex(dim))] = CubeFiniteElement(i);
    \n+
    140 }
    \n+
    141
    \n+
    142 for(const auto& cell : elements(gv))
    \n+
    143 {
    \n+
    144 unsigned int myId = elementMapper_.index(cell);
    \n+
    145 orient_[myId] = 0;
    \n+
    146
    \n+
    147 for (const auto& intersection : intersections(gv,cell))
    \n+
    148 {
    \n+
    149 if (intersection.neighbor() && (elementMapper_.index(intersection.outside()) > myId))
    \n+
    150 orient_[myId] |= (1 << intersection.indexInInside());
    \n+
    151 }
    \n+
    152
    \n+
    153 // for mixed grids add offset for cubes
    \n+
    154 if constexpr (!hasFixedElementType)
    \n+
    155 if (cell.type().isCube())
    \n+
    156 orient_[myId] += numVariants(GeometryTypes::simplex(dim));
    \n+
    157 }
    \n+
    158 }
    \n+
    159
    \n+
    160 template<class EntityType>
    \n+
    161 const FiniteElement& find(const EntityType& e) const
    \n+
    162 {
    \n+
    163 return variants_[orient_[elementMapper_.index(e)]];
    \n+
    164 }
    \n
    165
    \n-
    178template<class T>
    \n-\n-
    180{
    \n-
    181 return Impl::FlatVectorView<T>(t);
    \n-
    182}
    \n-
    183
    \n-
    196template<class T>
    \n-
    197auto flatVectorView(const T& t)
    \n-
    198{
    \n-
    199 return Impl::FlatVectorView<const T>(t);
    \n-
    200}
    \n+
    166 private:
    \n+
    167 std::vector<FiniteElement> variants_;
    \n+
    168 const Dune::MultipleCodimMultipleGeomTypeMapper<GV> elementMapper_;
    \n+
    169 std::vector<unsigned char> orient_;
    \n+
    170 };
    \n+
    171
    \n+
    172
    \n+
    173} // namespace Impl
    \n+
    174
    \n+
    175
    \n+
    176// *****************************************************************************
    \n+
    177// This is the reusable part of the basis. It contains
    \n+
    178//
    \n+
    179// RaviartThomasPreBasis
    \n+
    180// RaviartThomasNode
    \n+
    181//
    \n+
    182// The pre-basis allows to create the others and is the owner of possible shared
    \n+
    183// state. These components do _not_ depend on the global basis and local view
    \n+
    184// and can be used without a global basis.
    \n+
    185// *****************************************************************************
    \n+
    186
    \n+
    187template<typename GV, int k>
    \n+
    188class RaviartThomasNode;
    \n+
    189
    \n+
    190template<typename GV, int k>
    \n+\n+
    192{
    \n+
    193 static const int dim = GV::dimension;
    \n+
    194 using FiniteElementMap = typename Impl::RaviartThomasLocalFiniteElementMap<GV, dim, double, k>;
    \n+
    195
    \n+
    196public:
    \n+
    197
    \n+
    199 using GridView = GV;
    \n+
    200 using size_type = std::size_t;
    \n
    201
    \n-
    214template<class T>
    \n-
    215auto flatVectorView(T&& t)
    \n-
    216{
    \n-
    217 return Impl::FlatVectorView<T&&>(std::move(t));
    \n-
    218}
    \n-
    219
    \n+\n+
    203
    \n+
    204 static constexpr size_type maxMultiIndexSize = 1;
    \n+
    205 static constexpr size_type minMultiIndexSize = 1;
    \n+
    206 static constexpr size_type multiIndexBufferSize = 1;
    \n+
    207
    \n+\n+
    210 gridView_(gv),
    \n+\n+
    212 {
    \n+
    213 // Currently there are some unresolved bugs with hybrid grids and higher order Raviart-Thomas elements
    \n+
    214 if (gv.indexSet().types(0).size() > 1 and k>0)
    \n+
    215 DUNE_THROW(Dune::NotImplemented, "Raviart-Thomas basis with index k>0 is only implemented for grids with a single element type");
    \n+
    216
    \n+
    217 for(auto type : gv.indexSet().types(0))
    \n+
    218 if (!type.isSimplex() && !type.isCube())
    \n+
    219 DUNE_THROW(Dune::NotImplemented, "Raviart-Thomas elements are only implemented for grids with simplex or cube elements.");
    \n
    220
    \n-
    221} // namespace Dune::Functions
    \n-
    222} // namespace Dune
    \n-
    223
    \n+
    221 GeometryType type = gv.template begin<0>()->type();
    \n+
    222 const static int dofsPerElement = type.isCube() ? ((dim == 2) ? k*(k+1)*dim : k*(k+1)*(k+1)*dim) : k*dim;
    \n+
    223 const static int dofsPerFace = type.isCube() ? (dim-2)*2*k+k+1 : (dim-1)*k+1 ;
    \n
    224
    \n-
    225#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH
    \n+
    225 dofsPerCodim_ = {{dofsPerElement, dofsPerFace}};
    \n+
    226 }
    \n+
    227
    \n+\n+
    229 {
    \n+
    230 codimOffset_[0] = 0;
    \n+
    231 codimOffset_[1] = codimOffset_[0] + dofsPerCodim_[0] * gridView_.size(0);
    \n+
    232 }
    \n+
    233
    \n+
    236 const GridView& gridView() const
    \n+
    237 {
    \n+
    238 return gridView_;
    \n+
    239 }
    \n+
    240
    \n+
    241 /* \\brief Update the stored grid view, to be called if the grid has changed */
    \n+
    242 void update (const GridView& gv)
    \n+
    243 {
    \n+
    244 gridView_ = gv;
    \n+
    245 }
    \n+
    246
    \n+\n+
    251 {
    \n+
    252 return Node{&finiteElementMap_};
    \n+
    253 }
    \n+
    254
    \n+\n+
    256 {
    \n+
    257 return dofsPerCodim_[0] * gridView_.size(0) + dofsPerCodim_[1] * gridView_.size(1);
    \n+
    258 }
    \n+
    259
    \n+
    261 template<class SizePrefix>
    \n+
    262 size_type size(const SizePrefix& prefix) const
    \n+
    263 {
    \n+
    264 assert(prefix.size() == 0 || prefix.size() == 1);
    \n+
    265 return (prefix.size() == 0) ? size() : 0;
    \n+
    266 }
    \n+
    267
    \n+\n+
    270 {
    \n+
    271 return size();
    \n+
    272 }
    \n+
    273
    \n+\n+
    275 {
    \n+
    276 size_type result = 0;
    \n+
    277 for (auto&& type : gridView_.indexSet().types(0))
    \n+
    278 {
    \n+
    279 size_t numFaces = ReferenceElements<double,dim>::general(type).size(1);
    \n+
    280 const static int dofsPerElement = type.isCube() ? ((dim == 2) ? k*(k+1)*dim : k*(k+1)*(k+1)*dim) : k*dim;
    \n+
    281 const static int dofsPerFace = type.isCube() ? (dim-2)*2*k+k+1 : (dim-1)*k+1 ;
    \n+
    282 result = std::max(result, dofsPerElement + dofsPerFace * numFaces);
    \n+
    283 }
    \n+
    284
    \n+
    285 return result;
    \n+
    286 }
    \n+
    287
    \n+
    293 template<typename It>
    \n+
    294 It indices(const Node& node, It it) const
    \n+
    295 {
    \n+
    296 const auto& gridIndexSet = gridView().indexSet();
    \n+
    297 const auto& element = node.element();
    \n+
    298
    \n+
    299 // throw if Element is not of predefined type
    \n+
    300 if (not(element.type().isCube()) and not(element.type().isSimplex()))
    \n+
    301 DUNE_THROW(Dune::NotImplemented, "RaviartThomasBasis only implemented for cube and simplex elements.");
    \n+
    302
    \n+
    303 for(std::size_t i=0, end=node.size(); i<end; ++i, ++it)
    \n+
    304 {
    \n+
    305 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
    \n+
    306
    \n+
    307 // The dimension of the entity that the current dof is related to
    \n+
    308 size_t subentity = localKey.subEntity();
    \n+
    309 size_t codim = localKey.codim();
    \n+
    310
    \n+
    311 if (not(codim==0 or codim==1))
    \n+
    312 DUNE_THROW(Dune::NotImplemented, "Grid contains elements not supported for the RaviartThomasBasis");
    \n+
    313
    \n+
    314 *it = { codimOffset_[codim] +
    \n+
    315 dofsPerCodim_[codim] * gridIndexSet.subIndex(element, subentity, codim) + localKey.index() };
    \n+
    316 }
    \n+
    317
    \n+
    318 return it;
    \n+
    319 }
    \n+
    320
    \n+
    321protected:
    \n+\n+
    323 std::array<size_t,dim+1> codimOffset_;
    \n+
    324 FiniteElementMap finiteElementMap_;
    \n+
    325 // Number of dofs per entity type depending on the entity's codimension and type
    \n+
    326 std::array<int,dim+1> dofsPerCodim_;
    \n+
    327};
    \n+
    328
    \n+
    329
    \n+
    330
    \n+
    331template<typename GV, int k>
    \n+\n+
    333 public LeafBasisNode
    \n+
    334{
    \n+
    335 static const int dim = GV::dimension;
    \n+
    336
    \n+
    337public:
    \n+
    338
    \n+
    339 using size_type = std::size_t;
    \n+
    340 using Element = typename GV::template Codim<0>::Entity;
    \n+
    341 using FiniteElementMap = typename Impl::RaviartThomasLocalFiniteElementMap<GV, dim, double, k>;
    \n+
    342 using FiniteElement = Impl::GlobalValuedLocalFiniteElement<Impl::ContravariantPiolaTransformator,
    \n+
    343 typename FiniteElementMap::FiniteElement,
    \n+
    344 Element>;
    \n+
    345
    \n+
    346 RaviartThomasNode(const FiniteElementMap* finiteElementMap) :
    \n+
    347 element_(nullptr),
    \n+
    348 finiteElementMap_(finiteElementMap)
    \n+
    349 { }
    \n+
    350
    \n+
    352 const Element& element() const
    \n+
    353 {
    \n+
    354 return *element_;
    \n+
    355 }
    \n+
    356
    \n+\n+
    362 {
    \n+
    363 return finiteElement_;
    \n+
    364 }
    \n+
    365
    \n+
    367 void bind(const Element& e)
    \n+
    368 {
    \n+
    369 element_ = &e;
    \n+
    370 finiteElement_.bind((finiteElementMap_->find(*element_)), e);
    \n+
    371 this->setSize(finiteElement_.size());
    \n+
    372 }
    \n+
    373
    \n+
    374protected:
    \n+
    375
    \n+\n+\n+\n+
    379};
    \n+
    380
    \n+
    381namespace BasisFactory {
    \n+
    382
    \n+
    390template<std::size_t k>
    \n+\n+
    392{
    \n+
    393 return [](const auto& gridView) {
    \n+
    394 return RaviartThomasPreBasis<std::decay_t<decltype(gridView)>, k>(gridView);
    \n+
    395 };
    \n+
    396}
    \n+
    397
    \n+
    398} // end namespace BasisFactory
    \n+
    399
    \n+
    400
    \n+
    401
    \n+
    402// *****************************************************************************
    \n+
    403// This is the actual global basis implementation based on the reusable parts.
    \n+
    404// *****************************************************************************
    \n+
    405
    \n+
    413template<typename GV, int k>
    \n+\n+
    415
    \n+
    416} // end namespace Functions
    \n+
    417} // end namespace Dune
    \n+
    418
    \n+
    419
    \n+
    420#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH
    \n+\n+\n+\n+
    auto power(ChildPreBasisFactory &&childPreBasisFactory, const IndexMergingStrategy &)
    Create a pre-basis factory that can build a PowerPreBasis.
    Definition: powerbasis.hh:369
    \n+
    auto raviartThomas()
    Create a pre-basis factory that can create a Raviart-Thomas pre-basis.
    Definition: raviartthomasbasis.hh:391
    \n
    Definition: polynomial.hh:10
    \n-
    auto flatVectorView(T &t)
    Create flat vector view of passed mutable container.
    Definition: flatvectorview.hh:179
    \n-\n+
    Global basis for given pre-basis.
    Definition: defaultglobalbasis.hh:46
    \n+
    size_type size() const
    Definition: nodes.hh:142
    \n+
    std::size_t size_type
    Definition: nodes.hh:128
    \n+
    void setSize(const size_type size)
    Definition: nodes.hh:164
    \n+
    Definition: nodes.hh:186
    \n+
    Definition: raviartthomasbasis.hh:334
    \n+
    typename Impl::RaviartThomasLocalFiniteElementMap< GV, dim, double, k > FiniteElementMap
    Definition: raviartthomasbasis.hh:341
    \n+
    void bind(const Element &e)
    Bind to element.
    Definition: raviartthomasbasis.hh:367
    \n+
    Impl::GlobalValuedLocalFiniteElement< Impl::ContravariantPiolaTransformator, typename FiniteElementMap::FiniteElement, Element > FiniteElement
    Definition: raviartthomasbasis.hh:344
    \n+
    typename GV::template Codim< 0 >::Entity Element
    Definition: raviartthomasbasis.hh:340
    \n+
    const Element * element_
    Definition: raviartthomasbasis.hh:377
    \n+
    const FiniteElement & finiteElement() const
    Return the LocalFiniteElement for the element we are bound to.
    Definition: raviartthomasbasis.hh:361
    \n+
    RaviartThomasNode(const FiniteElementMap *finiteElementMap)
    Definition: raviartthomasbasis.hh:346
    \n+
    const Element & element() const
    Return current element, throw if unbound.
    Definition: raviartthomasbasis.hh:352
    \n+
    FiniteElement finiteElement_
    Definition: raviartthomasbasis.hh:376
    \n+
    const FiniteElementMap * finiteElementMap_
    Definition: raviartthomasbasis.hh:378
    \n+
    Definition: raviartthomasbasis.hh:192
    \n+
    static constexpr size_type minMultiIndexSize
    Definition: raviartthomasbasis.hh:205
    \n+
    static constexpr size_type maxMultiIndexSize
    Definition: raviartthomasbasis.hh:204
    \n+
    Node makeNode() const
    Create tree node.
    Definition: raviartthomasbasis.hh:250
    \n+
    std::array< int, dim+1 > dofsPerCodim_
    Definition: raviartthomasbasis.hh:326
    \n+
    void update(const GridView &gv)
    Definition: raviartthomasbasis.hh:242
    \n+
    RaviartThomasPreBasis(const GridView &gv)
    Constructor for a given grid view object.
    Definition: raviartthomasbasis.hh:209
    \n+
    std::size_t size_type
    Definition: raviartthomasbasis.hh:200
    \n+
    const GridView & gridView() const
    Obtain the grid view that the basis is defined on.
    Definition: raviartthomasbasis.hh:236
    \n+
    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
    \n+
    static constexpr size_type multiIndexBufferSize
    Definition: raviartthomasbasis.hh:206
    \n+
    FiniteElementMap finiteElementMap_
    Definition: raviartthomasbasis.hh:324
    \n+
    size_type size() const
    Definition: raviartthomasbasis.hh:255
    \n+
    size_type dimension() const
    Definition: raviartthomasbasis.hh:269
    \n+
    GV GridView
    The grid view that the FE space is defined on.
    Definition: raviartthomasbasis.hh:199
    \n+
    size_type maxNodeSize() const
    Definition: raviartthomasbasis.hh:274
    \n+
    GridView gridView_
    Definition: raviartthomasbasis.hh:322
    \n+
    size_type size(const SizePrefix &prefix) const
    Return number possible values for next position in multi index.
    Definition: raviartthomasbasis.hh:262
    \n+
    void initializeIndices()
    Definition: raviartthomasbasis.hh:228
    \n+
    std::array< size_t, dim+1 > codimOffset_
    Definition: raviartthomasbasis.hh:323
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,212 +5,566 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-flatvectorview.hh\n+raviartthomasbasis.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH\n 5\n- 6\n- 7#include \n+ 6#include \n+ 7#include \n 8\n- 9#include \n- 10#include \n- 11#include \n- 12\n- 13#include \n- 14\n- 15\n- 16\n- 17\n- 18namespace Dune {\n- 19namespace Functions {\n- 20namespace Impl {\n- 21\n+ 9#include \n+ 10#include \n+ 11\n+ 12#include \n+ 13#include \n+ 14#include \n+ 15#include \n+ 16#include \n+ 17#include \n+ 18#include \n+ 19#include \n+ 20#include \n+ 21#include \n 22\n- 23template\n- 24struct FlatVectorBackend\n- 25{\n+ 23#include \n+ 24#include \n+ 25#include \n 26\n- 27 template(),\n-int>::type = 0>\n- 29 static decltype(auto) getEntry(VV&& v, const Index& i)\n- 30 {\n- 31 return v[i];\n- 32 }\n- 33\n- 34 template(),\n-int>::type = 0>\n- 36 static decltype(auto) getEntry(VV&& v, const Index&)\n- 37 {\n- 38 return std::forward(v);\n- 39 }\n- 40\n- 41 template(), int>::type =\n-0>\n- 43 static auto size(VV&& v)\n- 44 {\n- 45 return Dune::Hybrid::size(v);\n- 46 }\n- 47\n- 48 template(), int>::\n-type = 0>\n- 50 static auto size(VV&&)\n- 51 {\n- 52 return Dune::index_constant<1>{};\n- 53 }\n- 54};\n- 55\n+ 27namespace Dune {\n+ 28namespace Functions {\n+ 29\n+ 30namespace Impl {\n+ 31\n+ 32 template\n+ 33 struct RaviartThomasSimplexLocalInfo\n+ 34 {\n+ 35 // Dummy type, must be something that we can have a std::unique_ptr to\n+ 36 using FiniteElement = void*;\n+ 37 };\n+ 38\n+ 39 template\n+ 40 struct RaviartThomasSimplexLocalInfo<2,D,R,0>\n+ 41 {\n+ 42 using FiniteElement = RT02DLocalFiniteElement;\n+ 43 };\n+ 44\n+ 45 template\n+ 46 struct RaviartThomasSimplexLocalInfo<2,D,R,1>\n+ 47 {\n+ 48 using FiniteElement = RT12DLocalFiniteElement;\n+ 49 };\n+ 50\n+ 51 template\n+ 52 struct RaviartThomasSimplexLocalInfo<3,D,R,0>\n+ 53 {\n+ 54 using FiniteElement = RT03DLocalFiniteElement;\n+ 55 };\n 56\n- 57\n- 58\n- 59template\n- 60struct FlatVectorBackend >\n- 61{\n- 62\n- 63 template\n- 64 static decltype(auto) getEntry(VV&& v, const Index& i)\n- 65 {\n- 66 return v[i/m][i%m];\n- 67 }\n- 68\n- 69 template\n- 70 static auto size(VV&& v)\n- 71 {\n- 72 return Dune::index_constant{};\n- 73 }\n- 74};\n+ 57 template\n+ 58 struct RaviartThomasCubeLocalInfo\n+ 59 {\n+ 60 // Dummy type, must be something that we can have a std::unique_ptr to\n+ 61 using FiniteElement = void*;\n+ 62 };\n+ 63\n+ 64 template\n+ 65 struct RaviartThomasCubeLocalInfo<2,D,R,0>\n+ 66 {\n+ 67 using FiniteElement = RT0Cube2DLocalFiniteElement;\n+ 68 };\n+ 69\n+ 70 template\n+ 71 struct RaviartThomasCubeLocalInfo<2,D,R,1>\n+ 72 {\n+ 73 using FiniteElement = RT1Cube2DLocalFiniteElement;\n+ 74 };\n 75\n- 76\n- 77\n- 78template\n- 79struct FlatVectorBackend< std::array >\n- 80{\n+ 76 template\n+ 77 struct RaviartThomasCubeLocalInfo<2,D,R,2>\n+ 78 {\n+ 79 using FiniteElement = RT2Cube2DLocalFiniteElement;\n+ 80 };\n 81\n- 82 template\n- 83 static decltype(auto) getEntry(VV&& v, const Index& i)\n+ 82 template\n+ 83 struct RaviartThomasCubeLocalInfo<3,D,R,0>\n 84 {\n- 85 const auto innerSize = decltype(FlatVectorBackend::size(v[0]))::value;\n- 86 return FlatVectorBackend::getEntry(v[i/innerSize], i%innerSize);\n- 87 }\n- 88\n- 89 template\n- 90 static auto size(VV&& v)\n- 91 {\n- 92 const auto innerSize = decltype(FlatVectorBackend::size(v[0]))::value;\n- 93 return Dune::index_constant{};\n- 94 }\n- 95\n- 96};\n- 97\n- 98\n+ 85 using FiniteElement = RT0Cube3DLocalFiniteElement;\n+ 86 };\n+ 87\n+ 88 template\n+ 89 struct RaviartThomasCubeLocalInfo<3,D,R,1>\n+ 90 {\n+ 91 using FiniteElement = RT1Cube3DLocalFiniteElement;\n+ 92 };\n+ 93\n+ 94 template\n+ 95 class RaviartThomasLocalFiniteElementMap\n+ 96 {\n+ 97 using D = typename GV::ctype;\n+ 98 constexpr static bool hasFixedElementType = Capabilities::\n+hasSingleGeometryType::v;\n 99\n- 100\n- 101template\n- 102class FlatVectorView\n- 103{\n- 104 using Backend = FlatVectorBackend>;\n- 105public:\n- 106 FlatVectorView(T& t) :\n- 107 t_(&t)\n- 108 {}\n+ 100 using CubeFiniteElement = typename RaviartThomasCubeLocalInfo::FiniteElement;\n+ 101 using SimplexFiniteElement = typename RaviartThomasSimplexLocalInfo::FiniteElement;\n+ 102\n+ 103 public:\n+ 104\n+ 105 using T = LocalBasisTraits, R, dim,\n+FieldVector, FieldMatrix >;\n+ 106\n+ 107 constexpr static unsigned int topologyId = Capabilities::\n+hasSingleGeometryType::topologyId; // meaningless if\n+hasFixedElementType is false\n+ 108 constexpr static GeometryType type = GeometryType(topologyId, GV::\n+dimension);\n 109\n- 110 auto size() const\n- 111 {\n- 112 return Backend::size(*t_);\n- 113 }\n- 114\n- 115 template\n- 116 decltype(auto) operator[](const Index& i) const\n+ 110 using FiniteElement = std::conditional_t,\n+ 112 LocalFiniteElementVariant >;\n+ 113\n+ 114 // Each element facet can have its orientation reversed, hence there are\n+ 115 // 2^#facets different variants.\n+ 116 static std::size_t numVariants(GeometryType type)\n 117 {\n- 118 return Backend::getEntry(*t_, i);\n- 119 }\n- 120\n- 121 template\n- 122 decltype(auto) operator[](const Index& i)\n- 123 {\n- 124 return Backend::getEntry(*t_, i);\n- 125 }\n- 126\n- 127private:\n- 128 T* t_;\n- 129};\n- 130\n- 131\n- 132template\n- 133class FlatVectorView\n- 134{\n- 135 using Backend = FlatVectorBackend>;\n- 136public:\n- 137 FlatVectorView(T&& t) :\n- 138 t_(std::move(t))\n- 139 {}\n- 140\n- 141 auto size() const\n- 142 {\n- 143 return Backend::size(t_);\n- 144 }\n- 145\n- 146 template\n- 147 decltype(auto) operator[](const Index& i) const\n+ 118 auto numFacets = referenceElement(type).size(1);\n+ 119 return power(2,numFacets);\n+ 120 }\n+ 121\n+ 122 RaviartThomasLocalFiniteElementMap(const GV& gv)\n+ 123 : elementMapper_(gv, mcmgElementLayout()),\n+ 124 orient_(gv.size(0))\n+ 125 {\n+ 126 if constexpr (hasFixedElementType)\n+ 127 {\n+ 128 variants_.resize(numVariants(type));\n+ 129 for (size_t i = 0; i < numVariants(type); i++)\n+ 130 variants_[i] = FiniteElement(i);\n+ 131 }\n+ 132 else\n+ 133 {\n+ 134 // for mixed grids add offset for cubes\n+ 135 variants_.resize(numVariants(GeometryTypes::simplex(dim)) + numVariants\n+(GeometryTypes::cube(dim)));\n+ 136 for (size_t i = 0; i < numVariants(GeometryTypes::simplex(dim)); i++)\n+ 137 variants_[i] = SimplexFiniteElement(i);\n+ 138 for (size_t i = 0; i < numVariants(GeometryTypes::cube(dim)); i++)\n+ 139 variants_[i + numVariants(GeometryTypes::simplex(dim))] =\n+CubeFiniteElement(i);\n+ 140 }\n+ 141\n+ 142 for(const auto& cell : elements(gv))\n+ 143 {\n+ 144 unsigned int myId = elementMapper_.index(cell);\n+ 145 orient_[myId] = 0;\n+ 146\n+ 147 for (const auto& intersection : intersections(gv,cell))\n 148 {\n- 149 return Backend::getEntry(t_, i);\n- 150 }\n- 151\n- 152 template\n- 153 decltype(auto) operator[](const Index& i)\n- 154 {\n- 155 return Backend::getEntry(t_, i);\n- 156 }\n- 157\n- 158private:\n- 159 T t_;\n- 160};\n- 161\n- 162} // namespace Impl\n- 163\n- 164\n+ 149 if (intersection.neighbor() && (elementMapper_.index(intersection.outside\n+()) > myId))\n+ 150 orient_[myId] |= (1 << intersection.indexInInside());\n+ 151 }\n+ 152\n+ 153 // for mixed grids add offset for cubes\n+ 154 if constexpr (!hasFixedElementType)\n+ 155 if (cell.type().isCube())\n+ 156 orient_[myId] += numVariants(GeometryTypes::simplex(dim));\n+ 157 }\n+ 158 }\n+ 159\n+ 160 template\n+ 161 const FiniteElement& find(const EntityType& e) const\n+ 162 {\n+ 163 return variants_[orient_[elementMapper_.index(e)]];\n+ 164 }\n 165\n- 178template\n-179auto flatVectorView(T& t)\n- 180{\n- 181 return Impl::FlatVectorView(t);\n- 182}\n- 183\n- 196template\n-197auto flatVectorView(const T& t)\n- 198{\n- 199 return Impl::FlatVectorView(t);\n- 200}\n+ 166 private:\n+ 167 std::vector variants_;\n+ 168 const Dune::MultipleCodimMultipleGeomTypeMapper elementMapper_;\n+ 169 std::vector orient_;\n+ 170 };\n+ 171\n+ 172\n+ 173} // namespace Impl\n+ 174\n+ 175\n+ 176/\n+/ *****************************************************************************\n+ 177// This is the reusable part of the basis. It contains\n+ 178//\n+ 179// RaviartThomasPreBasis\n+ 180// RaviartThomasNode\n+ 181//\n+ 182// The pre-basis allows to create the others and is the owner of possible\n+shared\n+ 183// state. These components do _not_ depend on the global basis and local\n+view\n+ 184// and can be used without a global basis.\n+ 185/\n+/ *****************************************************************************\n+ 186\n+ 187template\n+ 188class RaviartThomasNode;\n+ 189\n+ 190template\n+191class RaviartThomasPreBasis\n+ 192{\n+ 193 static const int dim = GV::dimension;\n+ 194 using FiniteElementMap = typename Impl::\n+RaviartThomasLocalFiniteElementMap;\n+ 195\n+ 196public:\n+ 197\n+199 using GridView = GV;\n+200 using size_type = std::size_t;\n 201\n- 214template\n-215auto flatVectorView(T&& t)\n- 216{\n- 217 return Impl::FlatVectorView(std::move(t));\n- 218}\n- 219\n+202 using Node = RaviartThomasNode;\n+ 203\n+204 static constexpr size_type maxMultiIndexSize = 1;\n+205 static constexpr size_type minMultiIndexSize = 1;\n+206 static constexpr size_type multiIndexBufferSize = 1;\n+ 207\n+209 RaviartThomasPreBasis(const GridView& gv) :\n+ 210 gridView_(gv),\n+ 211 finiteElementMap_(gv)\n+ 212 {\n+ 213 // Currently there are some unresolved bugs with hybrid grids and higher\n+order Raviart-Thomas elements\n+ 214 if (gv.indexSet().types(0).size() > 1 and k>0)\n+ 215 DUNE_THROW(Dune::NotImplemented, \"Raviart-Thomas basis with index k>0 is\n+only implemented for grids with a single element type\");\n+ 216\n+ 217 for(auto type : gv.indexSet().types(0))\n+ 218 if (!type.isSimplex() && !type.isCube())\n+ 219 DUNE_THROW(Dune::NotImplemented, \"Raviart-Thomas elements are only\n+implemented for grids with simplex or cube elements.\");\n 220\n- 221} // namespace Dune::Functions\n- 222} // namespace Dune\n- 223\n+ 221 GeometryType type = gv.template begin<0>()->type();\n+ 222 const static int dofsPerElement = type.isCube() ? ((dim == 2) ? k*\n+(k+1)*dim : k*(k+1)*(k+1)*dim) : k*dim;\n+ 223 const static int dofsPerFace = type.isCube() ? (dim-2)*2*k+k+1 : (dim-\n+1)*k+1 ;\n 224\n- 225#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_FLATVECTORVIEW_HH\n+ 225 dofsPerCodim_ = {{dofsPerElement, dofsPerFace}};\n+ 226 }\n+ 227\n+228 void initializeIndices()\n+ 229 {\n+ 230 codimOffset_[0] = 0;\n+ 231 codimOffset_[1] = codimOffset_[0] + dofsPerCodim_[0] * gridView_.size(0);\n+ 232 }\n+ 233\n+236 const GridView& gridView() const\n+ 237 {\n+ 238 return gridView_;\n+ 239 }\n+ 240\n+ 241 /* \\brief Update the stored grid view, to be called if the grid has\n+changed */\n+242 void update (const GridView& gv)\n+ 243 {\n+ 244 gridView_ = gv;\n+ 245 }\n+ 246\n+250 Node makeNode() const\n+ 251 {\n+ 252 return Node{&finiteElementMap_};\n+ 253 }\n+ 254\n+255 size_type size() const\n+ 256 {\n+ 257 return dofsPerCodim_[0] * gridView_.size(0) + dofsPerCodim_[1] *\n+gridView_.size(1);\n+ 258 }\n+ 259\n+ 261 template\n+262 size_type size(const SizePrefix& prefix) const\n+ 263 {\n+ 264 assert(prefix.size() == 0 || prefix.size() == 1);\n+ 265 return (prefix.size() == 0) ? size() : 0;\n+ 266 }\n+ 267\n+269 size_type dimension() const\n+ 270 {\n+ 271 return size();\n+ 272 }\n+ 273\n+274 size_type maxNodeSize() const\n+ 275 {\n+ 276 size_type result = 0;\n+ 277 for (auto&& type : gridView_.indexSet().types(0))\n+ 278 {\n+ 279 size_t numFaces = ReferenceElements::general(type).size(1);\n+ 280 const static int dofsPerElement = type.isCube() ? ((dim == 2) ? k*\n+(k+1)*dim : k*(k+1)*(k+1)*dim) : k*dim;\n+ 281 const static int dofsPerFace = type.isCube() ? (dim-2)*2*k+k+1 : (dim-\n+1)*k+1 ;\n+ 282 result = std::max(result, dofsPerElement + dofsPerFace * numFaces);\n+ 283 }\n+ 284\n+ 285 return result;\n+ 286 }\n+ 287\n+ 293 template\n+294 It indices(const Node& node, It it) const\n+ 295 {\n+ 296 const auto& gridIndexSet = gridView().indexSet();\n+ 297 const auto& element = node.element();\n+ 298\n+ 299 // throw if Element is not of predefined type\n+ 300 if (not(element.type().isCube()) and not(element.type().isSimplex()))\n+ 301 DUNE_THROW(Dune::NotImplemented, \"RaviartThomasBasis only implemented for\n+cube and simplex elements.\");\n+ 302\n+ 303 for(std::size_t i=0, end=node.size(); i codimOffset_;\n+324 FiniteElementMap finiteElementMap_;\n+ 325 // Number of dofs per entity type depending on the entity's codimension\n+and type\n+326 std::array dofsPerCodim_;\n+ 327};\n+ 328\n+ 329\n+ 330\n+ 331template\n+332class RaviartThomasNode :\n+ 333 public LeafBasisNode\n+ 334{\n+ 335 static const int dim = GV::dimension;\n+ 336\n+ 337public:\n+ 338\n+339 using size_type = std::size_t;\n+340 using Element = typename GV::template Codim<0>::Entity;\n+341 using FiniteElementMap = typename Impl::\n+RaviartThomasLocalFiniteElementMap;\n+342 using FiniteElement = Impl::GlobalValuedLocalFiniteElement;\n+ 345\n+346 RaviartThomasNode(const FiniteElementMap* finiteElementMap) :\n+ 347 element_(nullptr),\n+ 348 finiteElementMap_(finiteElementMap)\n+ 349 { }\n+ 350\n+352 const Element& element() const\n+ 353 {\n+ 354 return *element_;\n+ 355 }\n+ 356\n+361 const FiniteElement& finiteElement() const\n+ 362 {\n+ 363 return finiteElement_;\n+ 364 }\n+ 365\n+367 void bind(const Element& e)\n+ 368 {\n+ 369 element_ = &e;\n+ 370 finiteElement_.bind((finiteElementMap_->find(*element_)), e);\n+ 371 this->setSize(finiteElement_.size());\n+ 372 }\n+ 373\n+ 374protected:\n+ 375\n+376 FiniteElement finiteElement_;\n+377 const Element* element_;\n+378 const FiniteElementMap* finiteElementMap_;\n+ 379};\n+ 380\n+ 381namespace BasisFactory {\n+ 382\n+ 390template\n+391auto raviartThomas()\n+ 392{\n+ 393 return [](const auto& gridView) {\n+ 394 return RaviartThomasPreBasis, k>\n+(gridView);\n+ 395 };\n+ 396}\n+ 397\n+ 398} // end namespace BasisFactory\n+ 399\n+ 400\n+ 401\n+ 402/\n+/ *****************************************************************************\n+ 403// This is the actual global basis implementation based on the reusable\n+parts.\n+ 404/\n+/ *****************************************************************************\n+ 405\n+ 413template\n+414using RaviartThomasBasis = DefaultGlobalBasis\n+>;\n+ 415\n+ 416} // end namespace Functions\n+ 417} // end namespace Dune\n+ 418\n+ 419\n+ 420#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH\n+nodes.hh\n+defaultglobalbasis.hh\n+globalvaluedlocalfiniteelement.hh\n+Dune::Functions::BasisFactory::power\n+auto power(ChildPreBasisFactory &&childPreBasisFactory, const\n+IndexMergingStrategy &)\n+Create a pre-basis factory that can build a PowerPreBasis.\n+Definition: powerbasis.hh:369\n+Dune::Functions::BasisFactory::raviartThomas\n+auto raviartThomas()\n+Create a pre-basis factory that can create a Raviart-Thomas pre-basis.\n+Definition: raviartthomasbasis.hh:391\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::flatVectorView\n-auto flatVectorView(T &t)\n-Create flat vector view of passed mutable container.\n-Definition: flatvectorview.hh:179\n-concepts.hh\n+Dune::Functions::DefaultGlobalBasis\n+Global basis for given pre-basis.\n+Definition: defaultglobalbasis.hh:46\n+Dune::Functions::BasisNodeMixin::size\n+size_type size() const\n+Definition: nodes.hh:142\n+Dune::Functions::BasisNodeMixin::size_type\n+std::size_t size_type\n+Definition: nodes.hh:128\n+Dune::Functions::BasisNodeMixin::setSize\n+void setSize(const size_type size)\n+Definition: nodes.hh:164\n+Dune::Functions::LeafBasisNode\n+Definition: nodes.hh:186\n+Dune::Functions::RaviartThomasNode\n+Definition: raviartthomasbasis.hh:334\n+Dune::Functions::RaviartThomasNode::FiniteElementMap\n+typename Impl::RaviartThomasLocalFiniteElementMap< GV, dim, double, k >\n+FiniteElementMap\n+Definition: raviartthomasbasis.hh:341\n+Dune::Functions::RaviartThomasNode::bind\n+void bind(const Element &e)\n+Bind to element.\n+Definition: raviartthomasbasis.hh:367\n+Dune::Functions::RaviartThomasNode::FiniteElement\n+Impl::GlobalValuedLocalFiniteElement< Impl::ContravariantPiolaTransformator,\n+typename FiniteElementMap::FiniteElement, Element > FiniteElement\n+Definition: raviartthomasbasis.hh:344\n+Dune::Functions::RaviartThomasNode::Element\n+typename GV::template Codim< 0 >::Entity Element\n+Definition: raviartthomasbasis.hh:340\n+Dune::Functions::RaviartThomasNode::element_\n+const Element * element_\n+Definition: raviartthomasbasis.hh:377\n+Dune::Functions::RaviartThomasNode::finiteElement\n+const FiniteElement & finiteElement() const\n+Return the LocalFiniteElement for the element we are bound to.\n+Definition: raviartthomasbasis.hh:361\n+Dune::Functions::RaviartThomasNode::RaviartThomasNode\n+RaviartThomasNode(const FiniteElementMap *finiteElementMap)\n+Definition: raviartthomasbasis.hh:346\n+Dune::Functions::RaviartThomasNode::element\n+const Element & element() const\n+Return current element, throw if unbound.\n+Definition: raviartthomasbasis.hh:352\n+Dune::Functions::RaviartThomasNode::finiteElement_\n+FiniteElement finiteElement_\n+Definition: raviartthomasbasis.hh:376\n+Dune::Functions::RaviartThomasNode::finiteElementMap_\n+const FiniteElementMap * finiteElementMap_\n+Definition: raviartthomasbasis.hh:378\n+Dune::Functions::RaviartThomasPreBasis\n+Definition: raviartthomasbasis.hh:192\n+Dune::Functions::RaviartThomasPreBasis::minMultiIndexSize\n+static constexpr size_type minMultiIndexSize\n+Definition: raviartthomasbasis.hh:205\n+Dune::Functions::RaviartThomasPreBasis::maxMultiIndexSize\n+static constexpr size_type maxMultiIndexSize\n+Definition: raviartthomasbasis.hh:204\n+Dune::Functions::RaviartThomasPreBasis::makeNode\n+Node makeNode() const\n+Create tree node.\n+Definition: raviartthomasbasis.hh:250\n+Dune::Functions::RaviartThomasPreBasis::dofsPerCodim_\n+std::array< int, dim+1 > dofsPerCodim_\n+Definition: raviartthomasbasis.hh:326\n+Dune::Functions::RaviartThomasPreBasis::update\n+void update(const GridView &gv)\n+Definition: raviartthomasbasis.hh:242\n+Dune::Functions::RaviartThomasPreBasis::RaviartThomasPreBasis\n+RaviartThomasPreBasis(const GridView &gv)\n+Constructor for a given grid view object.\n+Definition: raviartthomasbasis.hh:209\n+Dune::Functions::RaviartThomasPreBasis::size_type\n+std::size_t size_type\n+Definition: raviartthomasbasis.hh:200\n+Dune::Functions::RaviartThomasPreBasis::gridView\n+const GridView & gridView() const\n+Obtain the grid view that the basis is defined on.\n+Definition: raviartthomasbasis.hh:236\n+Dune::Functions::RaviartThomasPreBasis::indices\n+It indices(const Node &node, It it) const\n+Maps from subtree index set [0..size-1] to a globally unique multi index in\n+global basis.\n+Definition: raviartthomasbasis.hh:294\n+Dune::Functions::RaviartThomasPreBasis::multiIndexBufferSize\n+static constexpr size_type multiIndexBufferSize\n+Definition: raviartthomasbasis.hh:206\n+Dune::Functions::RaviartThomasPreBasis::finiteElementMap_\n+FiniteElementMap finiteElementMap_\n+Definition: raviartthomasbasis.hh:324\n+Dune::Functions::RaviartThomasPreBasis::size\n+size_type size() const\n+Definition: raviartthomasbasis.hh:255\n+Dune::Functions::RaviartThomasPreBasis::dimension\n+size_type dimension() const\n+Definition: raviartthomasbasis.hh:269\n+Dune::Functions::RaviartThomasPreBasis::GridView\n+GV GridView\n+The grid view that the FE space is defined on.\n+Definition: raviartthomasbasis.hh:199\n+Dune::Functions::RaviartThomasPreBasis::maxNodeSize\n+size_type maxNodeSize() const\n+Definition: raviartthomasbasis.hh:274\n+Dune::Functions::RaviartThomasPreBasis::gridView_\n+GridView gridView_\n+Definition: raviartthomasbasis.hh:322\n+Dune::Functions::RaviartThomasPreBasis::size\n+size_type size(const SizePrefix &prefix) const\n+Return number possible values for next position in multi index.\n+Definition: raviartthomasbasis.hh:262\n+Dune::Functions::RaviartThomasPreBasis::initializeIndices\n+void initializeIndices()\n+Definition: raviartthomasbasis.hh:228\n+Dune::Functions::RaviartThomasPreBasis::codimOffset_\n+std::array< size_t, dim+1 > codimOffset_\n+Definition: raviartthomasbasis.hh:323\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00143.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00143.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: nedelecbasis.hh File Reference\n+dune-functions: defaultlocalview.hh File Reference\n \n \n \n \n \n \n \n@@ -64,61 +64,41 @@\n \n \n \n
    \n \n-
    nedelecbasis.hh File Reference
    \n+Namespaces
    \n+
    defaultlocalview.hh File Reference
    \n \n
    \n-
    #include <array>
    \n-#include <dune/common/exceptions.hh>
    \n-#include <dune/grid/common/capabilities.hh>
    \n-#include <dune/grid/common/mcmgmapper.hh>
    \n-#include <dune/localfunctions/common/localfiniteelementvariant.hh>
    \n-#include <dune/localfunctions/nedelec.hh>
    \n-#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
    \n-#include <dune/functions/functionspacebases/globalvaluedlocalfiniteelement.hh>
    \n-#include <dune/functions/functionspacebases/nodes.hh>
    \n+
    #include <tuple>
    \n+#include <optional>
    \n+#include <dune/common/concept.hh>
    \n+#include <dune/common/hybridutilities.hh>
    \n+#include <dune/common/reservedvector.hh>
    \n+#include <dune/functions/common/overflowarray.hh>
    \n+#include <dune/functions/common/multiindex.hh>
    \n+#include <dune/functions/functionspacebases/concepts.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n-\n+\n+\n \n

    \n Classes

    class  Dune::Functions::NedelecPreBasis< GV, Range, kind, order >
     
    class  Dune::Functions::NedelecNode< GV, Range, kind, order >
    class  Dune::Functions::DefaultLocalView< GB >
     The restriction of a finite element basis to a single element. More...
     
    \n \n \n \n \n \n-\n-\n-

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    namespace  Dune::Functions::BasisFactory
     
    \n-\n-\n-\n-\n-\n-

    \n-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\u00e9d\u00e9lec finite element space. More...
     
    \n-\n-\n-\n-\n-\n

    \n-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\u00e9d\u00e9lec pre-basis. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "encoding", "source2": "encoding", "unified_diff": "@@ -1 +1 @@\n-utf-8\n+us-ascii\n"}, {"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,46 +5,30 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-Classes | Namespaces | Typedefs | Functions\n-nedelecbasis.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+Classes | Namespaces\n+defaultlocalview.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::NedelecPreBasis<_GV,_Range,_kind,_order_>\n-\u00a0\n-class \u00a0Dune::Functions::NedelecNode<_GV,_Range,_kind,_order_>\n+class \u00a0Dune::Functions::DefaultLocalView<_GB_>\n+\u00a0 The restriction of a finite element basis to a single element. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n-namespace \u00a0Dune::Functions::BasisFactory\n-\u00a0\n- Typedefs\n-template\n-using\u00a0Dune::Functions::NedelecBasis = DefaultGlobalBasis< NedelecPreBasis< GV,\n- Range, kind, order > >\n-\u00a0 Basis of a k-th-order N\u00e9d\u00e9lec finite element space. More...\n-\u00a0\n- Functions\n-template\n-auto\u00a0Dune::Functions::BasisFactory::nedelec ()\n-\u00a0 Create a pre-basis factory that can create a N\u00e9d\u00e9lec pre-basis. More...\n-\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00143_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00143_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: nedelecbasis.hh Source File\n+dune-functions: defaultlocalview.hh Source File\n \n \n \n \n \n \n \n@@ -62,381 +62,190 @@\n \n \n
    \n
    \n-
    nedelecbasis.hh
    \n+
    defaultlocalview.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH
    \n
    5
    \n-
    6#include <array>
    \n-
    7#include <dune/common/exceptions.hh>
    \n-
    8
    \n-
    9#include <dune/grid/common/capabilities.hh>
    \n-
    10#include <dune/grid/common/mcmgmapper.hh>
    \n-
    11
    \n-
    12#include <dune/localfunctions/common/localfiniteelementvariant.hh>
    \n-
    13#include <dune/localfunctions/nedelec.hh>
    \n-
    14
    \n-\n-\n-\n+
    6
    \n+
    7#include <tuple>
    \n+
    8#include <optional>
    \n+
    9
    \n+
    10#include <dune/common/concept.hh>
    \n+
    11#include <dune/common/hybridutilities.hh>
    \n+
    12#include <dune/common/reservedvector.hh>
    \n+
    13
    \n+\n+\n+\n+
    17
    \n
    18
    \n-
    19namespace Dune::Functions
    \n-
    20{
    \n-
    21
    \n-
    22namespace Impl
    \n-
    23{
    \n-
    24 template<typename GV, int dim, typename R, std::size_t order>
    \n-
    25 class Nedelec1stKindLocalFiniteElementMap
    \n-
    26 {
    \n-
    27 using D = typename GV::ctype;
    \n-
    28 constexpr static bool hasFixedElementType = Capabilities::hasSingleGeometryType<typename GV::Grid>::v;
    \n-
    29
    \n-
    30 using CubeFiniteElement = Nedelec1stKindCubeLocalFiniteElement<D,R,dim,order>;
    \n-
    31 using SimplexFiniteElement = Nedelec1stKindSimplexLocalFiniteElement<D,R,dim,order>;
    \n-
    32
    \n-
    33 public:
    \n-
    34
    \n-
    35 using T = LocalBasisTraits<D, dim, FieldVector<D,dim>, R, dim, FieldVector<R,dim>, FieldMatrix<D,dim,dim> >;
    \n+
    19
    \n+
    20namespace Dune {
    \n+
    21namespace Functions {
    \n+
    22
    \n+
    23
    \n+
    24
    \n+
    26template<class GB>
    \n+\n+
    28{
    \n+
    29public:
    \n+
    30
    \n+
    32 using GlobalBasis = GB;
    \n+
    33
    \n+
    35 using GridView = typename GlobalBasis::GridView;
    \n
    36
    \n-
    37 constexpr static unsigned int topologyId = Capabilities::hasSingleGeometryType<typename GV::Grid>::topologyId; // meaningless if hasFixedElementType is false
    \n-
    38 constexpr static GeometryType type = GeometryType(topologyId, GV::dimension);
    \n+
    38 using Element = typename GridView::template Codim<0>::Entity;
    \n
    39
    \n-
    40 using FiniteElement = std::conditional_t<hasFixedElementType,
    \n-
    41 std::conditional_t<type.isCube(),CubeFiniteElement,SimplexFiniteElement>,
    \n-
    42 LocalFiniteElementVariant<CubeFiniteElement, SimplexFiniteElement> >;
    \n-
    43
    \n-
    44 static std::size_t numVariants(GeometryType type)
    \n-
    45 {
    \n-
    46 if (order!=1) // I am not sure whether the formula below is correct for all orders.
    \n-
    47 DUNE_THROW(NotImplemented, "Only Nedelec elements of order 1 are implemented!");
    \n-
    48
    \n-
    49 auto numEdges = referenceElement<D,dim>(type).size(dim-1);
    \n-
    50 return power(2,numEdges);
    \n-
    51 }
    \n-
    52
    \n-
    53 Nedelec1stKindLocalFiniteElementMap(const GV& gv)
    \n-
    54 : elementMapper_(gv, mcmgElementLayout()),
    \n-
    55 orientation_(gv.size(0))
    \n-
    56 {
    \n-
    57 // create all variants
    \n-
    58 if constexpr (hasFixedElementType)
    \n-
    59 {
    \n-
    60 variants_.resize(numVariants(type));
    \n-
    61 for (size_t i = 0; i < numVariants(type); i++)
    \n-
    62 variants_[i] = FiniteElement(i);
    \n-
    63 }
    \n-
    64 else
    \n-
    65 {
    \n-
    66 // for mixed grids add offset for cubes
    \n-
    67 variants_.resize(numVariants(GeometryTypes::simplex(dim)) + numVariants(GeometryTypes::cube(dim)));
    \n-
    68 for (size_t i = 0; i < numVariants(GeometryTypes::simplex(dim)); i++)
    \n-
    69 variants_[i] = SimplexFiniteElement(i);
    \n-
    70 for (size_t i = 0; i < numVariants(GeometryTypes::cube(dim)); i++)
    \n-
    71 variants_[i + numVariants(GeometryTypes::simplex(dim))] = CubeFiniteElement(i);
    \n-
    72 }
    \n-
    73
    \n-
    74
    \n-
    75 // compute orientation for all elements
    \n-
    76 const auto& indexSet = gv.indexSet();
    \n-
    77
    \n-
    78 for(const auto& element : elements(gv))
    \n-
    79 {
    \n-
    80 const auto& refElement = referenceElement(element);
    \n-
    81 auto elementIndex = elementMapper_.index(element);
    \n-
    82 orientation_[elementIndex] = 0;
    \n-
    83
    \n-
    84 for (std::size_t i=0; i<element.subEntities(dim-1); i++)
    \n-
    85 {
    \n-
    86 // Local vertex indices within the element
    \n-
    87 auto localV0 = refElement.subEntity(i,dim-1, 0,dim);
    \n-
    88 auto localV1 = refElement.subEntity(i,dim-1, 1,dim);
    \n-
    89
    \n-
    90 // Global vertex indices within the grid
    \n-
    91 auto globalV0 = indexSet.subIndex(element,localV0,dim);
    \n-
    92 auto globalV1 = indexSet.subIndex(element,localV1,dim);
    \n-
    93
    \n-
    94 if ( (localV0<localV1 && globalV0>globalV1) || (localV0>localV1 && globalV0<globalV1) )
    \n-
    95 orientation_[elementIndex] |= (1 << i);
    \n-
    96 }
    \n-
    97 // for mixed grids add offset for cubes
    \n-
    98 if constexpr (!hasFixedElementType)
    \n-
    99 if (element.type().isCube())
    \n-
    100 orientation_[elementIndex] += numVariants(GeometryTypes::simplex(dim));
    \n-
    101 }
    \n-
    102 }
    \n-
    103
    \n-
    104 template<class Element>
    \n-
    105 const auto& find(const Element& element) const
    \n-
    106 {
    \n-
    107 return variants_[orientation_[elementMapper_.index(element)]];
    \n-
    108 }
    \n-
    109
    \n-
    110 private:
    \n-
    111 std::vector<FiniteElement> variants_;
    \n-
    112 const Dune::MultipleCodimMultipleGeomTypeMapper<GV> elementMapper_;
    \n-
    113 std::vector<unsigned short> orientation_;
    \n-
    114 };
    \n-
    115
    \n-
    116
    \n-
    117} // namespace Impl
    \n-
    118
    \n-
    119
    \n-
    120// *****************************************************************************
    \n-
    121// This is the reusable part of the basis. It contains
    \n-
    122//
    \n-
    123// NedelecPreBasis
    \n-
    124// NedelecNode
    \n-
    125//
    \n-
    126// The pre-basis allows to create the others and is the owner of possible shared
    \n-
    127// state. These components do _not_ depend on the global basis and local view
    \n-
    128// and can be used without a global basis.
    \n-
    129// *****************************************************************************
    \n-
    130
    \n-
    131template<typename GV, typename Range, std::size_t kind, int order>
    \n-
    132class NedelecNode;
    \n-
    133
    \n-
    134template<typename GV, typename Range, std::size_t kind, int order>
    \n-\n-
    136{
    \n-
    137 static const int dim = GV::dimension;
    \n-
    138 static_assert(kind==1, "Only the Nedelec basis of the first kind is currently implemented!");
    \n-
    139 using FiniteElementMap = typename Impl::Nedelec1stKindLocalFiniteElementMap<GV, dim, Range, order>;
    \n-
    140
    \n-
    141 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper<GV>;
    \n-
    142public:
    \n-
    143
    \n-
    145 using GridView = GV;
    \n-
    146 using size_type = std::size_t;
    \n+
    41 using size_type = std::size_t;
    \n+
    42
    \n+
    44 using Tree = typename GlobalBasis::PreBasis::Node;
    \n+
    45
    \n+
    46protected:
    \n+
    47
    \n+
    48 using PreBasis = typename GlobalBasis::PreBasis;
    \n+
    49
    \n+
    50 // Type used to store the multi indices of the basis vectors.
    \n+
    51 // In contrast to MultiIndex this always has dynamic size.
    \n+
    52 // It's guaranteed, that you can always cast it to MultiIndex
    \n+\n+
    54 std::conditional_t<(PreBasis::minMultiIndexSize == PreBasis::maxMultiIndexSize),
    \n+\n+
    56 Dune::ReservedVector<size_type, PreBasis::multiIndexBufferSize>>;
    \n+
    57
    \n+
    58public:
    \n+
    59
    \n+
    61 using MultiIndex =
    \n+
    62 std::conditional_t<(PreBasis::minMultiIndexSize == PreBasis::maxMultiIndexSize),
    \n+\n+
    64 Dune::ReservedVector<size_type, PreBasis::multiIndexBufferSize>>;
    \n+
    65
    \n+
    66
    \n+\n+\n+
    70 tree_(globalBasis_->preBasis().makeNode())
    \n+
    71 {
    \n+
    72 static_assert(models<Concept::BasisTree<GridView>, Tree>(), "Tree type passed to DefaultLocalView does not model the BasisNode concept.");
    \n+\n+
    74 }
    \n+
    75
    \n+
    81 void bind(const Element& e)
    \n+
    82 {
    \n+
    83 element_ = e;
    \n+\n+
    85 indices_.resize(size());
    \n+
    86 globalBasis_->preBasis().indices(tree_, indices_.begin());
    \n+
    87 }
    \n+
    88
    \n+
    91 [[deprecated("Use the bound() method instead")]]
    \n+
    92 bool isBound() const {
    \n+
    93 return static_cast<bool>(element_);
    \n+
    94 }
    \n+
    95
    \n+
    98 bool bound() const
    \n+
    99 {
    \n+
    100 return static_cast<bool>(element_);
    \n+
    101 }
    \n+
    102
    \n+
    107 const Element& element() const
    \n+
    108 {
    \n+
    109 return *element_;
    \n+
    110 }
    \n+
    111
    \n+
    116 void unbind()
    \n+
    117 {
    \n+
    118 element_.reset();
    \n+
    119 }
    \n+
    120
    \n+
    125 const Tree& tree() const
    \n+
    126 {
    \n+
    127 return tree_;
    \n+
    128 }
    \n+
    129
    \n+\n+
    133 {
    \n+
    134 return tree_.size();
    \n+
    135 }
    \n+
    136
    \n+\n+
    144 {
    \n+
    145 return globalBasis_->preBasis().maxNodeSize();
    \n+
    146 }
    \n
    147
    \n-\n-
    149
    \n-
    150 static constexpr size_type maxMultiIndexSize = 1;
    \n-
    151 static constexpr size_type minMultiIndexSize = 1;
    \n-
    152 static constexpr size_type multiIndexBufferSize = 1;
    \n+
    149 const MultiIndex& index(size_type i) const
    \n+
    150 {
    \n+
    151 return indices_[i];
    \n+
    152 }
    \n
    153
    \n-\n-
    156 gridView_(gv),
    \n-\n-
    158 mapper_(gridView_, mcmgLayout(Dim<1>{}))
    \n-
    159 {
    \n-
    160 if (kind!=1)
    \n-
    161 DUNE_THROW(NotImplemented, "Only Nedelec elements of the first kind are implemented!");
    \n-
    162
    \n-
    163 // There is no inherent reason why the basis shouldn't work for grids with more than two
    \n-
    164 // element types. Somebody simply has to sit down and implement the missing bits.
    \n-
    165 if (gv.indexSet().types(0).size() > 2)
    \n-
    166 DUNE_THROW(NotImplemented, "N\u00e9d\u00e9lec basis is only implemented for grids with simplex and cube elements");
    \n-
    167
    \n-
    168 for(auto type : gv.indexSet().types(0))
    \n-
    169 if (!type.isSimplex() && !type.isCube())
    \n-
    170 DUNE_THROW(NotImplemented, "N\u00e9d\u00e9lec basis is only implemented for grids with simplex or cube elements.");
    \n-
    171
    \n-
    172 if (order>1)
    \n-
    173 DUNE_THROW(NotImplemented, "Only first-order elements are implemented");
    \n+\n+
    157 {
    \n+
    158 return *globalBasis_;
    \n+
    159 }
    \n+
    160
    \n+\n+
    162 {
    \n+
    163 return *this;
    \n+
    164 }
    \n+
    165
    \n+
    166protected:
    \n+\n+
    168 std::optional<Element> element_;
    \n+\n+
    170 std::vector<MultiIndexStorage> indices_;
    \n+
    171};
    \n+
    172
    \n+
    173
    \n
    174
    \n-
    175 if (dim!=2 && dim!=3)
    \n-
    176 DUNE_THROW(NotImplemented, "Only 2d and 3d N\u00e9d\u00e9lec elements are implemented");
    \n-
    177 }
    \n+
    175} // end namespace Functions
    \n+
    176} // end namespace Dune
    \n+
    177
    \n
    178
    \n-\n-
    180 {}
    \n-
    181
    \n-
    184 const GridView& gridView() const
    \n-
    185 {
    \n-
    186 return gridView_;
    \n-
    187 }
    \n-
    188
    \n-
    189 /* \\brief Update the stored grid view, to be called if the grid has changed */
    \n-
    190 void update (const GridView& gv)
    \n-
    191 {
    \n-
    192 gridView_ = gv;
    \n-
    193 mapper_.update(gridView_);
    \n-
    194 }
    \n-
    195
    \n-\n-
    200 {
    \n-
    201 return Node{&finiteElementMap_};
    \n-
    202 }
    \n-
    203
    \n-\n-
    205 {
    \n-
    206 return mapper_.size();
    \n-
    207 }
    \n-
    208
    \n-
    210 template<class SizePrefix>
    \n-
    211 size_type size(const SizePrefix& prefix) const
    \n-
    212 {
    \n-
    213 assert(prefix.size() == 0 || prefix.size() == 1);
    \n-
    214 return (prefix.size() == 0) ? size() : 0;
    \n-
    215 }
    \n-
    216
    \n-\n-
    218 {
    \n-
    219 return size();
    \n-
    220 }
    \n-
    221
    \n-\n-
    223 {
    \n-
    224 size_type result = 0;
    \n-
    225 for (auto&& type : gridView_.indexSet().types(0))
    \n-
    226 {
    \n-
    227 size_type numEdges = referenceElement<typename GV::ctype,dim>(type).size(dim-1);
    \n-
    228 result = std::max(result, numEdges);
    \n-
    229 }
    \n-
    230
    \n-
    231 return result;
    \n-
    232 }
    \n-
    233
    \n-
    237 template<typename It>
    \n-
    238 It indices(const Node& node, It it) const
    \n-
    239 {
    \n-
    240 const auto& element = node.element();
    \n-
    241
    \n-
    242 // throw if Element is not of predefined type
    \n-
    243 if (not(element.type().isCube()) and not(element.type().isSimplex()))
    \n-
    244 DUNE_THROW(NotImplemented, "NedelecBasis only implemented for cube and simplex elements.");
    \n-
    245
    \n-
    246 for(std::size_t i=0, end=node.size(); i<end; ++i, ++it)
    \n-
    247 {
    \n-
    248 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
    \n-
    249 *it = { mapper_.subIndex(element, localKey.subEntity(), localKey.codim()) + localKey.index() };
    \n-
    250 }
    \n-
    251
    \n-
    252 return it;
    \n-
    253 }
    \n-
    254
    \n-
    255protected:
    \n-\n-
    257 FiniteElementMap finiteElementMap_;
    \n-
    258 Mapper mapper_;
    \n-
    259};
    \n-
    260
    \n-
    261
    \n-
    262
    \n-
    263template<typename GV, typename Range, size_t kind, int order>
    \n-\n-
    265 public LeafBasisNode
    \n-
    266{
    \n-
    267 static const int dim = GV::dimension;
    \n-
    268
    \n-
    269public:
    \n-
    270
    \n-
    271 using size_type = std::size_t;
    \n-
    272 using Element = typename GV::template Codim<0>::Entity;
    \n-
    273 static_assert(kind==1, "Only Nedelec elements of the first kind are implemented!");
    \n-
    274 using FiniteElementMap = typename Impl::Nedelec1stKindLocalFiniteElementMap<GV, dim, Range, order>;
    \n-
    275 using FiniteElement = Impl::GlobalValuedLocalFiniteElement<Impl::CovariantPiolaTransformator,
    \n-
    276 typename FiniteElementMap::FiniteElement,
    \n-
    277 Element>;
    \n-
    278
    \n-
    279 NedelecNode(const FiniteElementMap* finiteElementMap) :
    \n-
    280 element_(nullptr),
    \n-
    281 finiteElementMap_(finiteElementMap)
    \n-
    282 { }
    \n-
    283
    \n-
    285 const Element& element() const
    \n-
    286 {
    \n-
    287 return *element_;
    \n-
    288 }
    \n-
    289
    \n-\n-
    295 {
    \n-
    296 return finiteElement_;
    \n-
    297 }
    \n-
    298
    \n-
    300 void bind(const Element& e)
    \n-
    301 {
    \n-
    302 element_ = &e;
    \n-
    303 finiteElement_.bind((finiteElementMap_->find(*element_)), e);
    \n-
    304 this->setSize(finiteElement_.size());
    \n-
    305 }
    \n-
    306
    \n-
    307protected:
    \n-
    308
    \n-\n-\n-\n-
    312};
    \n-
    313
    \n-
    314
    \n-
    315
    \n-
    316namespace BasisFactory {
    \n-
    317
    \n-
    327template<std::size_t kind, std::size_t order, typename Range=double>
    \n-\n-
    329{
    \n-
    330 return [](const auto& gridView) {
    \n-
    331 return NedelecPreBasis<std::decay_t<decltype(gridView)>, Range, kind, order>(gridView);
    \n-
    332 };
    \n-
    333}
    \n-
    334
    \n-
    335} // end namespace BasisFactory
    \n-
    336
    \n-
    337
    \n-
    338
    \n-
    339// *****************************************************************************
    \n-
    340// This is the actual global basis implementation based on the reusable parts.
    \n-
    341// *****************************************************************************
    \n-
    342
    \n-
    350template<typename GV, std::size_t kind, std::size_t order, typename Range=double>
    \n-\n-
    352
    \n-
    353} // end namespace Dune::Functions
    \n-
    354
    \n-
    355
    \n-
    356#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH
    \n-\n-\n-\n-
    auto power(ChildPreBasisFactory &&childPreBasisFactory, const IndexMergingStrategy &)
    Create a pre-basis factory that can build a PowerPreBasis.
    Definition: powerbasis.hh:369
    \n-
    auto nedelec()
    Create a pre-basis factory that can create a N\u00e9d\u00e9lec pre-basis.
    Definition: nedelecbasis.hh:328
    \n-
    Definition: polynomial.hh:11
    \n-
    Global basis for given pre-basis.
    Definition: defaultglobalbasis.hh:46
    \n-
    Definition: nedelecbasis.hh:266
    \n-
    const FiniteElementMap * finiteElementMap_
    Definition: nedelecbasis.hh:311
    \n-
    FiniteElement finiteElement_
    Definition: nedelecbasis.hh:309
    \n-
    Impl::GlobalValuedLocalFiniteElement< Impl::CovariantPiolaTransformator, typename FiniteElementMap::FiniteElement, Element > FiniteElement
    Definition: nedelecbasis.hh:277
    \n-
    void bind(const Element &e)
    Bind to element.
    Definition: nedelecbasis.hh:300
    \n-
    const Element & element() const
    Return current element, throw if unbound.
    Definition: nedelecbasis.hh:285
    \n-
    typename GV::template Codim< 0 >::Entity Element
    Definition: nedelecbasis.hh:272
    \n-
    const FiniteElement & finiteElement() const
    Return the LocalFiniteElement for the element we are bound to.
    Definition: nedelecbasis.hh:294
    \n-
    NedelecNode(const FiniteElementMap *finiteElementMap)
    Definition: nedelecbasis.hh:279
    \n-
    typename Impl::Nedelec1stKindLocalFiniteElementMap< GV, dim, Range, order > FiniteElementMap
    Definition: nedelecbasis.hh:274
    \n-
    const Element * element_
    Definition: nedelecbasis.hh:310
    \n-
    std::size_t size_type
    Definition: nedelecbasis.hh:271
    \n-
    Definition: nedelecbasis.hh:136
    \n-
    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
    \n-
    size_type size(const SizePrefix &prefix) const
    Return number possible values for next position in multi index.
    Definition: nedelecbasis.hh:211
    \n-
    std::size_t size_type
    Definition: nedelecbasis.hh:146
    \n-
    NedelecPreBasis(const GridView &gv)
    Constructor for a given grid view object.
    Definition: nedelecbasis.hh:155
    \n-
    GV GridView
    The grid view that the FE space is defined on.
    Definition: nedelecbasis.hh:145
    \n-
    size_type dimension() const
    Definition: nedelecbasis.hh:217
    \n-
    static constexpr size_type maxMultiIndexSize
    Definition: nedelecbasis.hh:150
    \n-
    static constexpr size_type multiIndexBufferSize
    Definition: nedelecbasis.hh:152
    \n-
    GridView gridView_
    Definition: nedelecbasis.hh:256
    \n-
    FiniteElementMap finiteElementMap_
    Definition: nedelecbasis.hh:257
    \n-
    static constexpr size_type minMultiIndexSize
    Definition: nedelecbasis.hh:151
    \n-
    void initializeIndices()
    Definition: nedelecbasis.hh:179
    \n-
    void update(const GridView &gv)
    Definition: nedelecbasis.hh:190
    \n-
    size_type maxNodeSize() const
    Definition: nedelecbasis.hh:222
    \n-
    const GridView & gridView() const
    Obtain the grid view that the basis is defined on.
    Definition: nedelecbasis.hh:184
    \n-
    Node makeNode() const
    Create tree node.
    Definition: nedelecbasis.hh:199
    \n-
    size_type size() const
    Definition: nedelecbasis.hh:204
    \n-
    Mapper mapper_
    Definition: nedelecbasis.hh:258
    \n-
    size_type size() const
    Definition: nodes.hh:142
    \n-
    void setSize(const size_type size)
    Definition: nodes.hh:164
    \n-
    Definition: nodes.hh:186
    \n+
    179
    \n+
    180#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH
    \n+\n+\n+
    Definition: polynomial.hh:10
    \n+
    void bindTree(Tree &tree, const Entity &entity, std::size_t offset=0)
    Definition: nodes.hh:253
    \n+
    void initializeTree(Tree &tree, std::size_t treeIndexOffset=0)
    Definition: nodes.hh:260
    \n+
    A statically sized MultiIndex type.
    Definition: multiindex.hh:25
    \n+
    A dynamically sized array-like class with overflow.
    Definition: overflowarray.hh:45
    \n+
    The restriction of a finite element basis to a single element.
    Definition: defaultlocalview.hh:28
    \n+
    typename GlobalBasis::PreBasis PreBasis
    Definition: defaultlocalview.hh:48
    \n+
    void unbind()
    Unbind from the current element.
    Definition: defaultlocalview.hh:116
    \n+
    bool bound() const
    Return if the view is bound to a grid element.
    Definition: defaultlocalview.hh:98
    \n+
    typename GlobalBasis::GridView GridView
    The grid view the global FE basis lives on.
    Definition: defaultlocalview.hh:35
    \n+
    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
    \n+
    std::optional< Element > element_
    Definition: defaultlocalview.hh:168
    \n+
    typename GridView::template Codim< 0 >::Entity Element
    Type of the grid element we are bound to.
    Definition: defaultlocalview.hh:38
    \n+
    const Tree & tree() const
    Return the local ansatz tree associated to the bound entity.
    Definition: defaultlocalview.hh:125
    \n+
    void bind(const Element &e)
    Bind the view to a grid element.
    Definition: defaultlocalview.hh:81
    \n+
    const Element & element() const
    Return the grid element that the view is bound to.
    Definition: defaultlocalview.hh:107
    \n+
    size_type size() const
    Total number of degrees of freedom on this element.
    Definition: defaultlocalview.hh:132
    \n+
    GB GlobalBasis
    The global FE basis that this is a view on.
    Definition: defaultlocalview.hh:32
    \n+
    Tree tree_
    Definition: defaultlocalview.hh:169
    \n+
    size_type maxSize() const
    Maximum local size for any element on the GridView.
    Definition: defaultlocalview.hh:143
    \n+
    std::size_t size_type
    The type used for sizes.
    Definition: defaultlocalview.hh:41
    \n+
    bool isBound() const
    Return if the view is bound to a grid element.
    Definition: defaultlocalview.hh:92
    \n+
    const DefaultLocalView & rootLocalView() const
    Definition: defaultlocalview.hh:161
    \n+
    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
    \n+
    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
    \n+
    std::vector< MultiIndexStorage > indices_
    Definition: defaultlocalview.hh:170
    \n+
    typename GlobalBasis::PreBasis::Node Tree
    Tree of local finite elements / local shape function sets.
    Definition: defaultlocalview.hh:44
    \n+
    DefaultLocalView(const GlobalBasis &globalBasis)
    Construct local view for a given global finite element basis.
    Definition: defaultlocalview.hh:68
    \n+
    const GlobalBasis * globalBasis_
    Definition: defaultlocalview.hh:167
    \n+
    const GlobalBasis & globalBasis() const
    Return the global basis that we are a view on.
    Definition: defaultlocalview.hh:156
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "encoding", "source2": "encoding", "unified_diff": "@@ -1 +1 @@\n-utf-8\n+us-ascii\n"}, {"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,502 +5,271 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-nedelecbasis.hh\n+defaultlocalview.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH\n 5\n- 6#include \n- 7#include \n- 8\n- 9#include \n- 10#include \n- 11\n- 12#include \n- 13#include \n- 14\n- 15#include \n- 16#include \n- 17#include \n+ 6\n+ 7#include \n+ 8#include \n+ 9\n+ 10#include \n+ 11#include \n+ 12#include \n+ 13\n+ 14#include \n+ 15#include \n+ 16#include \n+ 17\n 18\n- 19namespace Dune::Functions\n- 20{\n- 21\n- 22namespace Impl\n- 23{\n- 24 template\n- 25 class Nedelec1stKindLocalFiniteElementMap\n- 26 {\n- 27 using D = typename GV::ctype;\n- 28 constexpr static bool hasFixedElementType = Capabilities::\n-hasSingleGeometryType::v;\n- 29\n- 30 using CubeFiniteElement =\n-Nedelec1stKindCubeLocalFiniteElement;\n- 31 using SimplexFiniteElement =\n-Nedelec1stKindSimplexLocalFiniteElement;\n- 32\n- 33 public:\n- 34\n- 35 using T = LocalBasisTraits, R, dim,\n-FieldVector, FieldMatrix >;\n+ 19\n+ 20namespace Dune {\n+ 21namespace Functions {\n+ 22\n+ 23\n+ 24\n+ 26template\n+27class DefaultLocalView\n+ 28{\n+ 29public:\n+ 30\n+32 using GlobalBasis = GB;\n+ 33\n+35 using GridView = typename GlobalBasis::GridView;\n 36\n- 37 constexpr static unsigned int topologyId = Capabilities::\n-hasSingleGeometryType::topologyId; // meaningless if\n-hasFixedElementType is false\n- 38 constexpr static GeometryType type = GeometryType(topologyId, GV::\n-dimension);\n+38 using Element = typename GridView::template Codim<0>::Entity;\n 39\n- 40 using FiniteElement = std::conditional_t,\n- 42 LocalFiniteElementVariant >;\n- 43\n- 44 static std::size_t numVariants(GeometryType type)\n- 45 {\n- 46 if (order!=1) // I am not sure whether the formula below is correct for all\n-orders.\n- 47 DUNE_THROW(NotImplemented, \"Only Nedelec elements of order 1 are\n-implemented!\");\n- 48\n- 49 auto numEdges = referenceElement(type).size(dim-1);\n- 50 return power(2,numEdges);\n- 51 }\n- 52\n- 53 Nedelec1stKindLocalFiniteElementMap(const GV& gv)\n- 54 : elementMapper_(gv, mcmgElementLayout()),\n- 55 orientation_(gv.size(0))\n- 56 {\n- 57 // create all variants\n- 58 if constexpr (hasFixedElementType)\n- 59 {\n- 60 variants_.resize(numVariants(type));\n- 61 for (size_t i = 0; i < numVariants(type); i++)\n- 62 variants_[i] = FiniteElement(i);\n- 63 }\n- 64 else\n- 65 {\n- 66 // for mixed grids add offset for cubes\n- 67 variants_.resize(numVariants(GeometryTypes::simplex(dim)) + numVariants\n-(GeometryTypes::cube(dim)));\n- 68 for (size_t i = 0; i < numVariants(GeometryTypes::simplex(dim)); i++)\n- 69 variants_[i] = SimplexFiniteElement(i);\n- 70 for (size_t i = 0; i < numVariants(GeometryTypes::cube(dim)); i++)\n- 71 variants_[i + numVariants(GeometryTypes::simplex(dim))] = CubeFiniteElement\n-(i);\n- 72 }\n- 73\n- 74\n- 75 // compute orientation for all elements\n- 76 const auto& indexSet = gv.indexSet();\n- 77\n- 78 for(const auto& element : elements(gv))\n- 79 {\n- 80 const auto& refElement = referenceElement(element);\n- 81 auto elementIndex = elementMapper_.index(element);\n- 82 orientation_[elementIndex] = 0;\n- 83\n- 84 for (std::size_t i=0; iglobalV1) || (localV0>localV1 &&\n-globalV0,\n+PreBasis::multiIndexBufferSize>,\n+ 56 Dune::ReservedVector>;\n+ 57\n+ 58public:\n+ 59\n+61 using MultiIndex =\n+ 62 std::conditional_t<(PreBasis::minMultiIndexSize == PreBasis::\n+maxMultiIndexSize),\n+ 63 StaticMultiIndex,\n+ 64 Dune::ReservedVector>;\n+ 65\n+ 66\n+68 DefaultLocalView(const GlobalBasis& globalBasis) :\n+ 69 globalBasis_(&globalBasis),\n+ 70 tree_(globalBasis_->preBasis().makeNode())\n+ 71 {\n+ 72 static_assert(models, Tree>(), \"Tree type\n+passed to DefaultLocalView does not model the BasisNode concept.\");\n+ 73 initializeTree(tree_);\n+ 74 }\n+ 75\n+81 void bind(const Element& e)\n+ 82 {\n+ 83 element_ = e;\n+ 84 bindTree(tree_, *element_);\n+ 85 indices_.resize(size());\n+ 86 globalBasis_->preBasis().indices(tree_, indices_.begin());\n+ 87 }\n+ 88\n+ 91 [[deprecated(\"Use the bound() method instead\")]]\n+92 bool isBound() const {\n+ 93 return static_cast(element_);\n+ 94 }\n+ 95\n+98 bool bound() const\n+ 99 {\n+ 100 return static_cast(element_);\n 101 }\n- 102 }\n- 103\n- 104 template\n- 105 const auto& find(const Element& element) const\n- 106 {\n- 107 return variants_[orientation_[elementMapper_.index(element)]];\n- 108 }\n- 109\n- 110 private:\n- 111 std::vector variants_;\n- 112 const Dune::MultipleCodimMultipleGeomTypeMapper elementMapper_;\n- 113 std::vector orientation_;\n- 114 };\n- 115\n- 116\n- 117} // namespace Impl\n- 118\n- 119\n- 120/\n-/ *****************************************************************************\n- 121// This is the reusable part of the basis. It contains\n- 122//\n- 123// NedelecPreBasis\n- 124// NedelecNode\n- 125//\n- 126// The pre-basis allows to create the others and is the owner of possible\n-shared\n- 127// state. These components do _not_ depend on the global basis and local\n-view\n- 128// and can be used without a global basis.\n- 129/\n-/ *****************************************************************************\n- 130\n- 131template\n- 132class NedelecNode;\n- 133\n- 134template\n-135class NedelecPreBasis\n- 136{\n- 137 static const int dim = GV::dimension;\n- 138 static_assert(kind==1, \"Only the Nedelec basis of the first kind is\n-currently implemented!\");\n- 139 using FiniteElementMap = typename Impl::\n-Nedelec1stKindLocalFiniteElementMap;\n- 140\n- 141 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper;\n- 142public:\n- 143\n-145 using GridView = GV;\n-146 using size_type = std::size_t;\n+ 102\n+107 const Element& element() const\n+ 108 {\n+ 109 return *element_;\n+ 110 }\n+ 111\n+116 void unbind()\n+ 117 {\n+ 118 element_.reset();\n+ 119 }\n+ 120\n+125 const Tree& tree() const\n+ 126 {\n+ 127 return tree_;\n+ 128 }\n+ 129\n+132 size_type size() const\n+ 133 {\n+ 134 return tree_.size();\n+ 135 }\n+ 136\n+143 size_type maxSize() const\n+ 144 {\n+ 145 return globalBasis_->preBasis().maxNodeSize();\n+ 146 }\n 147\n-148 using Node = NedelecNode;\n- 149\n-150 static constexpr size_type maxMultiIndexSize = 1;\n-151 static constexpr size_type minMultiIndexSize = 1;\n-152 static constexpr size_type multiIndexBufferSize = 1;\n+149 const MultiIndex& index(size_type i) const\n+ 150 {\n+ 151 return indices_[i];\n+ 152 }\n 153\n-155 NedelecPreBasis(const GridView& gv) :\n- 156 gridView_(gv),\n- 157 finiteElementMap_(gv),\n- 158 mapper_(gridView_, mcmgLayout(Dim<1>{}))\n- 159 {\n- 160 if (kind!=1)\n- 161 DUNE_THROW(NotImplemented, \"Only Nedelec elements of the first kind are\n-implemented!\");\n- 162\n- 163 // There is no inherent reason why the basis shouldn't work for grids with\n-more than two\n- 164 // element types. Somebody simply has to sit down and implement the\n-missing bits.\n- 165 if (gv.indexSet().types(0).size() > 2)\n- 166 DUNE_THROW(NotImplemented, \"N\u00e9d\u00e9lec basis is only implemented for grids\n-with simplex and cube elements\");\n- 167\n- 168 for(auto type : gv.indexSet().types(0))\n- 169 if (!type.isSimplex() && !type.isCube())\n- 170 DUNE_THROW(NotImplemented, \"N\u00e9d\u00e9lec basis is only implemented for grids\n-with simplex or cube elements.\");\n- 171\n- 172 if (order>1)\n- 173 DUNE_THROW(NotImplemented, \"Only first-order elements are implemented\");\n+156 const GlobalBasis& globalBasis() const\n+ 157 {\n+ 158 return *globalBasis_;\n+ 159 }\n+ 160\n+161 const DefaultLocalView& rootLocalView() const\n+ 162 {\n+ 163 return *this;\n+ 164 }\n+ 165\n+ 166protected:\n+167 const GlobalBasis* globalBasis_;\n+168 std::optional element_;\n+169 Tree tree_;\n+170 std::vector indices_;\n+ 171};\n+ 172\n+ 173\n 174\n- 175 if (dim!=2 && dim!=3)\n- 176 DUNE_THROW(NotImplemented, \"Only 2d and 3d N\u00e9d\u00e9lec elements are\n-implemented\");\n- 177 }\n+ 175} // end namespace Functions\n+ 176} // end namespace Dune\n+ 177\n 178\n-179 void initializeIndices()\n- 180 {}\n- 181\n-184 const GridView& gridView() const\n- 185 {\n- 186 return gridView_;\n- 187 }\n- 188\n- 189 /* \\brief Update the stored grid view, to be called if the grid has\n-changed */\n-190 void update (const GridView& gv)\n- 191 {\n- 192 gridView_ = gv;\n- 193 mapper_.update(gridView_);\n- 194 }\n- 195\n-199 Node makeNode() const\n- 200 {\n- 201 return Node{&finiteElementMap_};\n- 202 }\n- 203\n-204 size_type size() const\n- 205 {\n- 206 return mapper_.size();\n- 207 }\n- 208\n- 210 template\n-211 size_type size(const SizePrefix& prefix) const\n- 212 {\n- 213 assert(prefix.size() == 0 || prefix.size() == 1);\n- 214 return (prefix.size() == 0) ? size() : 0;\n- 215 }\n- 216\n-217 size_type dimension() const\n- 218 {\n- 219 return size();\n- 220 }\n- 221\n-222 size_type maxNodeSize() const\n- 223 {\n- 224 size_type result = 0;\n- 225 for (auto&& type : gridView_.indexSet().types(0))\n- 226 {\n- 227 size_type numEdges = referenceElement(type).size\n-(dim-1);\n- 228 result = std::max(result, numEdges);\n- 229 }\n- 230\n- 231 return result;\n- 232 }\n- 233\n- 237 template\n-238 It indices(const Node& node, It it) const\n- 239 {\n- 240 const auto& element = node.element();\n- 241\n- 242 // throw if Element is not of predefined type\n- 243 if (not(element.type().isCube()) and not(element.type().isSimplex()))\n- 244 DUNE_THROW(NotImplemented, \"NedelecBasis only implemented for cube and\n-simplex elements.\");\n- 245\n- 246 for(std::size_t i=0, end=node.size(); i\n-264class NedelecNode :\n- 265 public LeafBasisNode\n- 266{\n- 267 static const int dim = GV::dimension;\n- 268\n- 269public:\n- 270\n-271 using size_type = std::size_t;\n-272 using Element = typename GV::template Codim<0>::Entity;\n- 273 static_assert(kind==1, \"Only Nedelec elements of the first kind are\n-implemented!\");\n-274 using FiniteElementMap = typename Impl::\n-Nedelec1stKindLocalFiniteElementMap;\n-275 using FiniteElement = Impl::GlobalValuedLocalFiniteElement;\n- 278\n-279 NedelecNode(const FiniteElementMap* finiteElementMap) :\n- 280 element_(nullptr),\n- 281 finiteElementMap_(finiteElementMap)\n- 282 { }\n- 283\n-285 const Element& element() const\n- 286 {\n- 287 return *element_;\n- 288 }\n- 289\n-294 const FiniteElement& finiteElement() const\n- 295 {\n- 296 return finiteElement_;\n- 297 }\n- 298\n-300 void bind(const Element& e)\n- 301 {\n- 302 element_ = &e;\n- 303 finiteElement_.bind((finiteElementMap_->find(*element_)), e);\n- 304 this->setSize(finiteElement_.size());\n- 305 }\n- 306\n- 307protected:\n- 308\n-309 FiniteElement finiteElement_;\n-310 const Element* element_;\n-311 const FiniteElementMap* finiteElementMap_;\n- 312};\n- 313\n- 314\n- 315\n- 316namespace BasisFactory {\n- 317\n- 327template\n-328auto nedelec()\n- 329{\n- 330 return [](const auto& gridView) {\n- 331 return NedelecPreBasis, Range, kind,\n-order>(gridView);\n- 332 };\n- 333}\n- 334\n- 335} // end namespace BasisFactory\n- 336\n- 337\n- 338\n- 339/\n-/ *****************************************************************************\n- 340// This is the actual global basis implementation based on the reusable\n-parts.\n- 341/\n-/ *****************************************************************************\n- 342\n- 350template\n-351using NedelecBasis = DefaultGlobalBasis >;\n- 352\n- 353} // end namespace Dune::Functions\n- 354\n- 355\n- 356#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH\n-nodes.hh\n-defaultglobalbasis.hh\n-globalvaluedlocalfiniteelement.hh\n-Dune::Functions::BasisFactory::power\n-auto power(ChildPreBasisFactory &&childPreBasisFactory, const\n-IndexMergingStrategy &)\n-Create a pre-basis factory that can build a PowerPreBasis.\n-Definition: powerbasis.hh:369\n-Dune::Functions::BasisFactory::nedelec\n-auto nedelec()\n-Create a pre-basis factory that can create a N\u00e9d\u00e9lec pre-basis.\n-Definition: nedelecbasis.hh:328\n-Dune::Functions\n-Definition: polynomial.hh:11\n-Dune::Functions::DefaultGlobalBasis\n-Global basis for given pre-basis.\n-Definition: defaultglobalbasis.hh:46\n-Dune::Functions::NedelecNode\n-Definition: nedelecbasis.hh:266\n-Dune::Functions::NedelecNode::finiteElementMap_\n-const FiniteElementMap * finiteElementMap_\n-Definition: nedelecbasis.hh:311\n-Dune::Functions::NedelecNode::finiteElement_\n-FiniteElement finiteElement_\n-Definition: nedelecbasis.hh:309\n-Dune::Functions::NedelecNode::FiniteElement\n-Impl::GlobalValuedLocalFiniteElement< Impl::CovariantPiolaTransformator,\n-typename FiniteElementMap::FiniteElement, Element > FiniteElement\n-Definition: nedelecbasis.hh:277\n-Dune::Functions::NedelecNode::bind\n-void bind(const Element &e)\n-Bind to element.\n-Definition: nedelecbasis.hh:300\n-Dune::Functions::NedelecNode::element\n-const Element & element() const\n-Return current element, throw if unbound.\n-Definition: nedelecbasis.hh:285\n-Dune::Functions::NedelecNode::Element\n-typename GV::template Codim< 0 >::Entity Element\n-Definition: nedelecbasis.hh:272\n-Dune::Functions::NedelecNode::finiteElement\n-const FiniteElement & finiteElement() const\n-Return the LocalFiniteElement for the element we are bound to.\n-Definition: nedelecbasis.hh:294\n-Dune::Functions::NedelecNode::NedelecNode\n-NedelecNode(const FiniteElementMap *finiteElementMap)\n-Definition: nedelecbasis.hh:279\n-Dune::Functions::NedelecNode::FiniteElementMap\n-typename Impl::Nedelec1stKindLocalFiniteElementMap< GV, dim, Range, order >\n-FiniteElementMap\n-Definition: nedelecbasis.hh:274\n-Dune::Functions::NedelecNode::element_\n-const Element * element_\n-Definition: nedelecbasis.hh:310\n-Dune::Functions::NedelecNode::size_type\n-std::size_t size_type\n-Definition: nedelecbasis.hh:271\n-Dune::Functions::NedelecPreBasis\n-Definition: nedelecbasis.hh:136\n-Dune::Functions::NedelecPreBasis::indices\n-It indices(const Node &node, It it) const\n+ 179\n+ 180#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTLOCALVIEW_HH\n+multiindex.hh\n+overflowarray.hh\n+Dune\n+Definition: polynomial.hh:10\n+Dune::Functions::bindTree\n+void bindTree(Tree &tree, const Entity &entity, std::size_t offset=0)\n+Definition: nodes.hh:253\n+Dune::Functions::initializeTree\n+void initializeTree(Tree &tree, std::size_t treeIndexOffset=0)\n+Definition: nodes.hh:260\n+Dune::Functions::StaticMultiIndex\n+A statically sized MultiIndex type.\n+Definition: multiindex.hh:25\n+Dune::Functions::OverflowArray\n+A dynamically sized array-like class with overflow.\n+Definition: overflowarray.hh:45\n+Dune::Functions::DefaultLocalView\n+The restriction of a finite element basis to a single element.\n+Definition: defaultlocalview.hh:28\n+Dune::Functions::DefaultLocalView::PreBasis\n+typename GlobalBasis::PreBasis PreBasis\n+Definition: defaultlocalview.hh:48\n+Dune::Functions::DefaultLocalView::unbind\n+void unbind()\n+Unbind from the current element.\n+Definition: defaultlocalview.hh:116\n+Dune::Functions::DefaultLocalView::bound\n+bool bound() const\n+Return if the view is bound to a grid element.\n+Definition: defaultlocalview.hh:98\n+Dune::Functions::DefaultLocalView::GridView\n+typename GlobalBasis::GridView GridView\n+The grid view the global FE basis lives on.\n+Definition: defaultlocalview.hh:35\n+Dune::Functions::DefaultLocalView::index\n+const MultiIndex & index(size_type i) const\n Maps from subtree index set [0..size-1] to a globally unique multi index in\n global basis.\n-Definition: nedelecbasis.hh:238\n-Dune::Functions::NedelecPreBasis::size\n-size_type size(const SizePrefix &prefix) const\n-Return number possible values for next position in multi index.\n-Definition: nedelecbasis.hh:211\n-Dune::Functions::NedelecPreBasis::size_type\n-std::size_t size_type\n-Definition: nedelecbasis.hh:146\n-Dune::Functions::NedelecPreBasis::NedelecPreBasis\n-NedelecPreBasis(const GridView &gv)\n-Constructor for a given grid view object.\n-Definition: nedelecbasis.hh:155\n-Dune::Functions::NedelecPreBasis::GridView\n-GV GridView\n-The grid view that the FE space is defined on.\n-Definition: nedelecbasis.hh:145\n-Dune::Functions::NedelecPreBasis::dimension\n-size_type dimension() const\n-Definition: nedelecbasis.hh:217\n-Dune::Functions::NedelecPreBasis::maxMultiIndexSize\n-static constexpr size_type maxMultiIndexSize\n-Definition: nedelecbasis.hh:150\n-Dune::Functions::NedelecPreBasis::multiIndexBufferSize\n-static constexpr size_type multiIndexBufferSize\n-Definition: nedelecbasis.hh:152\n-Dune::Functions::NedelecPreBasis::gridView_\n-GridView gridView_\n-Definition: nedelecbasis.hh:256\n-Dune::Functions::NedelecPreBasis::finiteElementMap_\n-FiniteElementMap finiteElementMap_\n-Definition: nedelecbasis.hh:257\n-Dune::Functions::NedelecPreBasis::minMultiIndexSize\n-static constexpr size_type minMultiIndexSize\n-Definition: nedelecbasis.hh:151\n-Dune::Functions::NedelecPreBasis::initializeIndices\n-void initializeIndices()\n-Definition: nedelecbasis.hh:179\n-Dune::Functions::NedelecPreBasis::update\n-void update(const GridView &gv)\n-Definition: nedelecbasis.hh:190\n-Dune::Functions::NedelecPreBasis::maxNodeSize\n-size_type maxNodeSize() const\n-Definition: nedelecbasis.hh:222\n-Dune::Functions::NedelecPreBasis::gridView\n-const GridView & gridView() const\n-Obtain the grid view that the basis is defined on.\n-Definition: nedelecbasis.hh:184\n-Dune::Functions::NedelecPreBasis::makeNode\n-Node makeNode() const\n-Create tree node.\n-Definition: nedelecbasis.hh:199\n-Dune::Functions::NedelecPreBasis::size\n-size_type size() const\n-Definition: nedelecbasis.hh:204\n-Dune::Functions::NedelecPreBasis::mapper_\n-Mapper mapper_\n-Definition: nedelecbasis.hh:258\n-Dune::Functions::BasisNodeMixin::size\n+Definition: defaultlocalview.hh:149\n+Dune::Functions::DefaultLocalView::element_\n+std::optional< Element > element_\n+Definition: defaultlocalview.hh:168\n+Dune::Functions::DefaultLocalView::Element\n+typename GridView::template Codim< 0 >::Entity Element\n+Type of the grid element we are bound to.\n+Definition: defaultlocalview.hh:38\n+Dune::Functions::DefaultLocalView::tree\n+const Tree & tree() const\n+Return the local ansatz tree associated to the bound entity.\n+Definition: defaultlocalview.hh:125\n+Dune::Functions::DefaultLocalView::bind\n+void bind(const Element &e)\n+Bind the view to a grid element.\n+Definition: defaultlocalview.hh:81\n+Dune::Functions::DefaultLocalView::element\n+const Element & element() const\n+Return the grid element that the view is bound to.\n+Definition: defaultlocalview.hh:107\n+Dune::Functions::DefaultLocalView::size\n size_type size() const\n-Definition: nodes.hh:142\n-Dune::Functions::BasisNodeMixin::setSize\n-void setSize(const size_type size)\n-Definition: nodes.hh:164\n-Dune::Functions::LeafBasisNode\n-Definition: nodes.hh:186\n+Total number of degrees of freedom on this element.\n+Definition: defaultlocalview.hh:132\n+Dune::Functions::DefaultLocalView::GlobalBasis\n+GB GlobalBasis\n+The global FE basis that this is a view on.\n+Definition: defaultlocalview.hh:32\n+Dune::Functions::DefaultLocalView::tree_\n+Tree tree_\n+Definition: defaultlocalview.hh:169\n+Dune::Functions::DefaultLocalView::maxSize\n+size_type maxSize() const\n+Maximum local size for any element on the GridView.\n+Definition: defaultlocalview.hh:143\n+Dune::Functions::DefaultLocalView::size_type\n+std::size_t size_type\n+The type used for sizes.\n+Definition: defaultlocalview.hh:41\n+Dune::Functions::DefaultLocalView::isBound\n+bool isBound() const\n+Return if the view is bound to a grid element.\n+Definition: defaultlocalview.hh:92\n+Dune::Functions::DefaultLocalView::rootLocalView\n+const DefaultLocalView & rootLocalView() const\n+Definition: defaultlocalview.hh:161\n+Dune::Functions::DefaultLocalView::MultiIndexStorage\n+std::conditional_t<(PreBasis::minMultiIndexSize==PreBasis::maxMultiIndexSize),\n+OverflowArray< StaticMultiIndex< size_type, PreBasis::maxMultiIndexSize >,\n+PreBasis::multiIndexBufferSize >, Dune::ReservedVector< size_type, PreBasis::\n+multiIndexBufferSize > > MultiIndexStorage\n+Definition: defaultlocalview.hh:56\n+Dune::Functions::DefaultLocalView::MultiIndex\n+std::conditional_t<(PreBasis::minMultiIndexSize==PreBasis::maxMultiIndexSize),\n+StaticMultiIndex< size_type, PreBasis::maxMultiIndexSize >, Dune::\n+ReservedVector< size_type, PreBasis::multiIndexBufferSize > > MultiIndex\n+Type used for global numbering of the basis vectors.\n+Definition: defaultlocalview.hh:64\n+Dune::Functions::DefaultLocalView::indices_\n+std::vector< MultiIndexStorage > indices_\n+Definition: defaultlocalview.hh:170\n+Dune::Functions::DefaultLocalView::Tree\n+typename GlobalBasis::PreBasis::Node Tree\n+Tree of local finite elements / local shape function sets.\n+Definition: defaultlocalview.hh:44\n+Dune::Functions::DefaultLocalView::DefaultLocalView\n+DefaultLocalView(const GlobalBasis &globalBasis)\n+Construct local view for a given global finite element basis.\n+Definition: defaultlocalview.hh:68\n+Dune::Functions::DefaultLocalView::globalBasis_\n+const GlobalBasis * globalBasis_\n+Definition: defaultlocalview.hh:167\n+Dune::Functions::DefaultLocalView::globalBasis\n+const GlobalBasis & globalBasis() const\n+Return the global basis that we are a view on.\n+Definition: defaultlocalview.hh:156\n+concepts.hh\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00146.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00146.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: brezzidouglasmarinibasis.hh File Reference\n+dune-functions: lagrangedgbasis.hh File Reference\n \n \n \n \n \n \n \n@@ -67,62 +67,56 @@\n \n
    \n \n-
    brezzidouglasmarinibasis.hh File Reference
    \n+
    lagrangedgbasis.hh File Reference
    \n
    \n
    \n
    #include <array>
    \n #include <dune/common/exceptions.hh>
    \n-#include <dune/geometry/referenceelements.hh>
    \n-#include <dune/localfunctions/common/virtualinterface.hh>
    \n-#include <dune/localfunctions/common/virtualwrappers.hh>
    \n-#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1cube2d.hh>
    \n-#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1cube3d.hh>
    \n-#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1simplex2d.hh>
    \n-#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini2cube2d.hh>
    \n-#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini2simplex2d.hh>
    \n-#include <dune/functions/functionspacebases/globalvaluedlocalfiniteelement.hh>
    \n-#include <dune/functions/functionspacebases/nodes.hh>
    \n-#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
    \n+#include <dune/common/math.hh>
    \n+#include <dune/functions/functionspacebases/nodes.hh>
    \n+#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
    \n+#include <dune/functions/functionspacebases/lagrangebasis.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n-\n+\n \n

    \n Classes

    class  Dune::Functions::BrezziDouglasMariniPreBasis< GV, k >
     
    class  Dune::Functions::BrezziDouglasMariniNode< GV, k >
    class  Dune::Functions::LagrangeDGPreBasis< GV, k >
     
    \n \n \n \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    namespace  Dune::Functions::BasisFactory
     
    \n \n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n

    \n 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. More...
     
    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. More...
     
    \n \n-\n-\n-\n-\n+\n+\n+\n+\n

    \n 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. More...
     
    template<std::size_t k>
    auto Dune::Functions::BasisFactory::lagrangeDG ()
     Create a pre-basis factory that can create a LagrangeDG pre-basis. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,55 +6,43 @@\n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n Classes | Namespaces | Typedefs | Functions\n-brezzidouglasmarinibasis.hh File Reference\n+lagrangedgbasis.hh File Reference\n #include \n #include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+#include \n #include \n #include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::BrezziDouglasMariniPreBasis<_GV,_k_>\n-\u00a0\n-class \u00a0Dune::Functions::BrezziDouglasMariniNode<_GV,_k_>\n+class \u00a0Dune::Functions::LagrangeDGPreBasis<_GV,_k_>\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n namespace \u00a0Dune::Functions::BasisFactory\n \u00a0\n Typedefs\n template\n-using\u00a0Dune::Functions::BrezziDouglasMariniBasis = DefaultGlobalBasis<\n- BrezziDouglasMariniPreBasis< GV, k > >\n-\u00a0 Basis of a scalar k-th-order BDM finite element space on simplex and\n- cube grids. More...\n+using\u00a0Dune::Functions::LagrangeDGNode = LagrangeNode< GV, k >\n+\u00a0\n+template\n+using\u00a0Dune::Functions::LagrangeDGBasis = DefaultGlobalBasis<\n+ LagrangeDGPreBasis< GV, k > >\n+\u00a0 Basis of a scalar k-th-order Lagrangean-DG finite element space. More...\n \u00a0\n Functions\n template\n-auto\u00a0Dune::Functions::BasisFactory::brezziDouglasMarini ()\n-\u00a0 Create a pre-basis factory that can create a Brezzi-Douglas-Marini pre-\n- basis. More...\n+auto\u00a0Dune::Functions::BasisFactory::lagrangeDG ()\n+\u00a0 Create a pre-basis factory that can create a LagrangeDG pre-basis.\n+ More...\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00146_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00146_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: brezzidouglasmarinibasis.hh Source File\n+dune-functions: lagrangedgbasis.hh Source File\n \n \n \n \n \n \n \n@@ -62,389 +62,283 @@\n \n \n \n
    \n-
    brezzidouglasmarinibasis.hh
    \n+
    lagrangedgbasis.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH
    \n
    5
    \n
    6#include <array>
    \n
    7#include <dune/common/exceptions.hh>
    \n-
    8#include <dune/geometry/referenceelements.hh>
    \n+
    8#include <dune/common/math.hh>
    \n
    9
    \n-
    10#include <dune/localfunctions/common/virtualinterface.hh>
    \n-
    11#include <dune/localfunctions/common/virtualwrappers.hh>
    \n-
    12
    \n-
    13#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1cube2d.hh>
    \n-
    14#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1cube3d.hh>
    \n-
    15#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini1simplex2d.hh>
    \n-
    16#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini2cube2d.hh>
    \n-
    17#include <dune/localfunctions/brezzidouglasmarini/brezzidouglasmarini2simplex2d.hh>
    \n-
    18
    \n-\n-\n-\n-
    22
    \n-
    23namespace Dune {
    \n-
    24namespace Functions {
    \n-
    25
    \n-
    26namespace Impl {
    \n-
    27
    \n-
    28 template<int dim, typename D, typename R, std::size_t k>
    \n-
    29 struct BDMSimplexLocalInfo
    \n-
    30 {
    \n-
    31 static_assert((AlwaysFalse<D>::value),"The requested type of BDM element is not implemented, sorry!");
    \n-
    32 };
    \n-
    33
    \n-
    34 template<typename D, typename R>
    \n-
    35 struct BDMSimplexLocalInfo<2,D,R,1>
    \n-
    36 {
    \n-
    37 using FiniteElement = BDM1Simplex2DLocalFiniteElement<D,R>;
    \n-
    38 static const std::size_t Variants = 8;
    \n-
    39 };
    \n+\n+\n+\n+
    13
    \n+
    14
    \n+
    15
    \n+
    16
    \n+
    17namespace Dune {
    \n+
    18namespace Functions {
    \n+
    19
    \n+
    20
    \n+
    21
    \n+
    22// *****************************************************************************
    \n+
    23// This is the reusable part of the basis. It contains
    \n+
    24//
    \n+
    25// LagrangeDGPreBasis
    \n+
    26// LagrangeDGNode
    \n+
    27//
    \n+
    28// The pre-basis allows to create the others and is the owner of possible shared
    \n+
    29// state. These components do _not_ depend on the global basis and local view
    \n+
    30// and can be used without a global basis.
    \n+
    31// *****************************************************************************
    \n+
    32
    \n+
    33template<typename GV, int k>
    \n+\n+
    35
    \n+
    36template<typename GV, int k>
    \n+\n+
    38{
    \n+
    39 static const int dim = GV::dimension;
    \n
    40
    \n-
    41 template<typename D, typename R>
    \n-
    42 struct BDMSimplexLocalInfo<2,D,R,2>
    \n-
    43 {
    \n-
    44 using FiniteElement = BDM2Simplex2DLocalFiniteElement<D,R>;
    \n-
    45 static const std::size_t Variants = 8;
    \n-
    46 };
    \n+
    41public:
    \n+
    42
    \n+
    44 using GridView = GV;
    \n+
    45 using size_type = std::size_t;
    \n+
    46
    \n
    47
    \n-
    48 template<int dim, typename D, typename R, std::size_t k>
    \n-
    49 struct BDMCubeLocalInfo
    \n-
    50 {
    \n-
    51 static_assert((AlwaysFalse<D>::value),"The requested type of BDM element is not implemented, sorry!");
    \n-
    52 };
    \n-
    53
    \n-
    54 template<typename D, typename R>
    \n-
    55 struct BDMCubeLocalInfo<2,D,R,1>
    \n-
    56 {
    \n-
    57 using FiniteElement = BDM1Cube2DLocalFiniteElement<D,R>;
    \n-
    58 static const std::size_t Variants = 16;
    \n-
    59 };
    \n-
    60
    \n-
    61 template<typename D, typename R>
    \n-
    62 struct BDMCubeLocalInfo<2,D,R,2>
    \n-
    63 {
    \n-
    64 using FiniteElement = BDM2Cube2DLocalFiniteElement<D,R>;
    \n-
    65 static const std::size_t Variants = 16;
    \n-
    66 };
    \n-
    67
    \n-
    68 template<typename D, typename R>
    \n-
    69 struct BDMCubeLocalInfo<3,D,R,1>
    \n-
    70 {
    \n-
    71 using FiniteElement = BDM1Cube3DLocalFiniteElement<D,R>;
    \n-
    72 static const std::size_t Variants = 64;
    \n-
    73 };
    \n-
    74
    \n-
    75 template<typename GV, int dim, typename R, std::size_t k>
    \n-
    76 class BDMLocalFiniteElementMap
    \n-
    77 {
    \n-
    78 using D = typename GV::ctype;
    \n-
    79 using CubeFiniteElement = typename BDMCubeLocalInfo<dim, D, R, k>::FiniteElement;
    \n-
    80 using SimplexFiniteElement = typename BDMSimplexLocalInfo<dim, D, R, k>::FiniteElement;
    \n-
    81
    \n-
    82 public:
    \n-
    83
    \n-
    84 using T = LocalBasisTraits<D, dim, FieldVector<D,dim>, R, dim, FieldVector<R,dim>, FieldMatrix<D,dim,dim> >;
    \n-
    85 using FiniteElement = LocalFiniteElementVirtualInterface<T>;
    \n+
    48 // Precompute the number of dofs per entity type
    \n+
    49 const static int dofsPerEdge = k+1;
    \n+
    50 const static int dofsPerTriangle = (k+1)*(k+2)/2;
    \n+
    51 const static int dofsPerQuad = (k+1)*(k+1);
    \n+
    52 const static int dofsPerTetrahedron = (k+1)*(k+2)*(k+3)/6;
    \n+
    53 const static int dofsPerPrism = (k+1)*(k+1)*(k+2)/2;
    \n+
    54 const static int dofsPerHexahedron = (k+1)*(k+1)*(k+1);
    \n+
    55 const static int dofsPerPyramid = (k+1)*(k+2)*(2*k+3)/6;
    \n+
    56
    \n+
    57
    \n+\n+
    59
    \n+
    60 static constexpr size_type maxMultiIndexSize = 1;
    \n+
    61 static constexpr size_type minMultiIndexSize = 1;
    \n+
    62 static constexpr size_type multiIndexBufferSize = 1;
    \n+
    63
    \n+\n+
    66 gridView_(gv)
    \n+
    67 {}
    \n+
    68
    \n+
    69
    \n+\n+
    71 {
    \n+
    72 switch (dim)
    \n+
    73 {
    \n+
    74 case 1:
    \n+
    75 {
    \n+
    76 break;
    \n+
    77 }
    \n+
    78 case 2:
    \n+
    79 {
    \n+
    80 quadrilateralOffset_ = dofsPerTriangle * gridView_.size(Dune::GeometryTypes::triangle);
    \n+
    81 break;
    \n+
    82 }
    \n+
    83 case 3:
    \n+
    84 {
    \n+
    85 prismOffset_ = dofsPerTetrahedron * gridView_.size(Dune::GeometryTypes::tetrahedron);
    \n
    86
    \n-
    87 BDMLocalFiniteElementMap(const GV& gv)
    \n-
    88 : is_(&(gv.indexSet())), orient_(gv.size(0))
    \n-
    89 {
    \n-
    90 cubeVariant_.resize(BDMCubeLocalInfo<dim, D, R, k>::Variants);
    \n-
    91 simplexVariant_.resize(BDMSimplexLocalInfo<dim, D, R, k>::Variants);
    \n-
    92
    \n-
    93 // create all variants
    \n-
    94 for (size_t i = 0; i < cubeVariant_.size(); i++)
    \n-
    95 cubeVariant_[i] = std::make_unique<LocalFiniteElementVirtualImp<CubeFiniteElement> >(CubeFiniteElement(i));
    \n-
    96
    \n-
    97 for (size_t i = 0; i < simplexVariant_.size(); i++)
    \n-
    98 simplexVariant_[i] = std::make_unique<LocalFiniteElementVirtualImp<SimplexFiniteElement> >(SimplexFiniteElement(i));
    \n-
    99
    \n-
    100 // compute orientation for all elements
    \n-
    101 // loop once over the grid
    \n-
    102 for(const auto& cell : elements(gv))
    \n-
    103 {
    \n-
    104 unsigned int myId = is_->index(cell);
    \n-
    105 orient_[myId] = 0;
    \n+
    87 hexahedronOffset_ = prismOffset_ + dofsPerPrism * gridView_.size(Dune::GeometryTypes::prism);
    \n+
    88
    \n+
    89 pyramidOffset_ = hexahedronOffset_ + dofsPerHexahedron * gridView_.size(Dune::GeometryTypes::hexahedron);
    \n+
    90 break;
    \n+
    91 }
    \n+
    92 }
    \n+
    93 }
    \n+
    94
    \n+
    97 const GridView& gridView() const
    \n+
    98 {
    \n+
    99 return gridView_;
    \n+
    100 }
    \n+
    101
    \n+
    102 void update(const GridView& gv)
    \n+
    103 {
    \n+
    104 gridView_ = gv;
    \n+
    105 }
    \n
    106
    \n-
    107 for (const auto& intersection : intersections(gv,cell))
    \n-
    108 {
    \n-
    109 if (intersection.neighbor() && (is_->index(intersection.outside()) > myId))
    \n-
    110 orient_[myId] |= (1 << intersection.indexInInside());
    \n-
    111 }
    \n-
    112 }
    \n-
    113 }
    \n+\n+
    111 {
    \n+
    112 return Node{};
    \n+
    113 }
    \n
    114
    \n-
    116 template<class EntityType>
    \n-
    117 const FiniteElement& find(const EntityType& e) const
    \n-
    118 {
    \n-
    119 if (e.type().isCube())
    \n-
    120 return *cubeVariant_[orient_[is_->index(e)]];
    \n-
    121 else
    \n-
    122 return *simplexVariant_[orient_[is_->index(e)]];
    \n-
    123 }
    \n-
    124
    \n-
    125 private:
    \n-
    126 std::vector<std::unique_ptr<LocalFiniteElementVirtualImp<CubeFiniteElement> > > cubeVariant_;
    \n-
    127 std::vector<std::unique_ptr<LocalFiniteElementVirtualImp<SimplexFiniteElement> > > simplexVariant_;
    \n-
    128 const typename GV::IndexSet* is_;
    \n-
    129 std::vector<unsigned char> orient_;
    \n-
    130 };
    \n-
    131
    \n-
    132
    \n-
    133} // namespace Impl
    \n-
    134
    \n+\n+
    116 {
    \n+
    117 switch (dim)
    \n+
    118 {
    \n+
    119 case 1:
    \n+
    120 return dofsPerEdge*gridView_.size(0);
    \n+
    121 case 2:
    \n+
    122 {
    \n+
    123 return dofsPerTriangle*gridView_.size(Dune::GeometryTypes::triangle) + dofsPerQuad*gridView_.size(Dune::GeometryTypes::quadrilateral);
    \n+
    124 }
    \n+
    125 case 3:
    \n+
    126 {
    \n+
    127 return dofsPerTetrahedron*gridView_.size(Dune::GeometryTypes::tetrahedron)
    \n+
    128 + dofsPerPyramid*gridView_.size(Dune::GeometryTypes::pyramid)
    \n+
    129 + dofsPerPrism*gridView_.size(Dune::GeometryTypes::prism)
    \n+
    130 + dofsPerHexahedron*gridView_.size(Dune::GeometryTypes::hexahedron);
    \n+
    131 }
    \n+
    132 }
    \n+
    133 DUNE_THROW(Dune::NotImplemented, "No size method for " << dim << "d grids available yet!");
    \n+
    134 }
    \n
    135
    \n-
    136// *****************************************************************************
    \n-
    137// This is the reusable part of the basis. It contains
    \n-
    138//
    \n-
    139// BrezziDouglasMariniPreBasis
    \n-
    140// BrezziDouglasMariniNode
    \n-
    141//
    \n-
    142// The pre-basis allows to create the others and is the owner of possible shared
    \n-
    143// state. These components do _not_ depend on the global basis and local view
    \n-
    144// and can be used without a global basis.
    \n-
    145// *****************************************************************************
    \n-
    146
    \n-
    147template<typename GV, int k>
    \n-
    148class BrezziDouglasMariniNode;
    \n+
    137 template<class SizePrefix>
    \n+
    138 size_type size(const SizePrefix& prefix) const
    \n+
    139 {
    \n+
    140 assert(prefix.size() == 0 || prefix.size() == 1);
    \n+
    141 return (prefix.size() == 0) ? size() : 0;
    \n+
    142 }
    \n+
    143
    \n+\n+
    146 {
    \n+
    147 return size();
    \n+
    148 }
    \n
    149
    \n-
    150template<typename GV, int k>
    \n-\n-
    152{
    \n-
    153 static const int dim = GV::dimension;
    \n-
    154 using FiniteElementMap = typename Impl::BDMLocalFiniteElementMap<GV, dim, double, k>;
    \n-
    155
    \n-
    156public:
    \n-
    157
    \n-
    159 using GridView = GV;
    \n-
    160 using size_type = std::size_t;
    \n-
    161
    \n-\n-
    163
    \n-
    164 static constexpr size_type maxMultiIndexSize = 1;
    \n-
    165 static constexpr size_type minMultiIndexSize = 1;
    \n-
    166 static constexpr size_type multiIndexBufferSize = 1;
    \n-
    167
    \n-\n-
    170 gridView_(gv),
    \n-\n-
    172 {
    \n-
    173 // There is no inherent reason why the basis shouldn't work for grids with more than one
    \n-
    174 // element types. Somebody simply has to sit down and implement the missing bits.
    \n-
    175 if (gv.indexSet().types(0).size() > 1)
    \n-
    176 DUNE_THROW(Dune::NotImplemented, "Brezzi-Douglas-Marini basis is only implemented for grids with a single element type");
    \n-
    177 }
    \n-
    178
    \n-\n-
    180 {
    \n-
    181 codimOffset_[0] = 0;
    \n-
    182 codimOffset_[1] = codimOffset_[0] + dofsPerCodim_[0] * gridView_.size(0);
    \n-
    183 //if (dim==3) codimOffset_[2] = codimOffset_[1] + dofsPerCodim[1] * gridView_.size(1);
    \n-
    184 }
    \n-
    185
    \n-
    188 const GridView& gridView() const
    \n-
    189 {
    \n-
    190 return gridView_;
    \n+\n+
    151 {
    \n+
    152 return Dune::power(k+1, int(GV::dimension));
    \n+
    153 }
    \n+
    154
    \n+
    155 template<typename It>
    \n+
    156 It indices(const Node& node, It it) const
    \n+
    157 {
    \n+
    158 const auto& gridIndexSet = gridView().indexSet();
    \n+
    159 const auto& element = node.element();
    \n+
    160
    \n+
    161 size_type offset = 0;
    \n+
    162 if constexpr (dim==1)
    \n+
    163 offset = dofsPerEdge*gridIndexSet.subIndex(element,0,0);
    \n+
    164 else if constexpr (dim==2)
    \n+
    165 {
    \n+
    166 if (element.type().isTriangle())
    \n+
    167 offset = dofsPerTriangle*gridIndexSet.subIndex(element,0,0);
    \n+
    168 else if (element.type().isQuadrilateral())
    \n+
    169 offset = quadrilateralOffset_ + dofsPerQuad*gridIndexSet.subIndex(element,0,0);
    \n+
    170 else
    \n+
    171 DUNE_THROW(Dune::NotImplemented, "2d elements have to be triangles or quadrilaterals");
    \n+
    172 }
    \n+
    173 else if constexpr (dim==3)
    \n+
    174 {
    \n+
    175 if (element.type().isTetrahedron())
    \n+
    176 offset = dofsPerTetrahedron*gridIndexSet.subIndex(element,0,0);
    \n+
    177 else if (element.type().isPrism())
    \n+
    178 offset = prismOffset_ + dofsPerPrism*gridIndexSet.subIndex(element,0,0);
    \n+
    179 else if (element.type().isHexahedron())
    \n+
    180 offset = hexahedronOffset_ + dofsPerHexahedron*gridIndexSet.subIndex(element,0,0);
    \n+
    181 else if (element.type().isPyramid())
    \n+
    182 offset = pyramidOffset_ + dofsPerPyramid*gridIndexSet.subIndex(element,0,0);
    \n+
    183 else
    \n+
    184 DUNE_THROW(Dune::NotImplemented, "3d elements have to be tetrahedrons, prisms, hexahedrons or pyramids");
    \n+
    185 }
    \n+
    186 else
    \n+
    187 DUNE_THROW(Dune::NotImplemented, "No index method for " << dim << "d grids available yet!");
    \n+
    188 for (size_type i = 0, end = node.size() ; i < end ; ++i, ++it)
    \n+
    189 *it = {offset + i};
    \n+
    190 return it;
    \n
    191 }
    \n
    192
    \n-
    193 /* \\brief Update the stored grid view, to be called if the grid has changed */
    \n-
    194 void update (const GridView& gv)
    \n-
    195 {
    \n-
    196 gridView_ = gv;
    \n+
    194 unsigned int order() const
    \n+
    195 {
    \n+
    196 return k;
    \n
    197 }
    \n
    198
    \n-\n-
    203 {
    \n-
    204 return Node{&finiteElementMap_};
    \n-
    205 }
    \n-
    206
    \n-\n-
    208 {
    \n-
    209 return dofsPerCodim_[0] * gridView_.size(0) + dofsPerCodim_[1] * gridView_.size(1); // only 2d
    \n-
    210 }
    \n+
    199protected:
    \n+\n+
    201
    \n+\n+\n+\n+\n+
    206};
    \n+
    207
    \n+
    208
    \n+
    209
    \n+
    210namespace BasisFactory {
    \n
    211
    \n-
    213 template<class SizePrefix>
    \n-
    214 size_type size(const SizePrefix prefix) const
    \n-
    215 {
    \n-
    216 assert(prefix.size() == 0 || prefix.size() == 1);
    \n-
    217 return (prefix.size() == 0) ? size() : 0;
    \n-
    218 }
    \n-
    219
    \n-\n-
    222 {
    \n-
    223 return size();
    \n-
    224 }
    \n-
    225
    \n-\n-
    227 {
    \n-
    228 // The implementation currently only supports grids with a single element type.
    \n-
    229 // We can therefore return the actual number of dofs here.
    \n-
    230 GeometryType elementType = *(gridView_.indexSet().types(0).begin());
    \n-
    231 size_t numFaces = ReferenceElements<double,dim>::general(elementType).size(1);
    \n-
    232 return dofsPerCodim_[0] + dofsPerCodim_[1] * numFaces;
    \n-
    233 }
    \n+
    219template<std::size_t k>
    \n+\n+
    221{
    \n+
    222 return [](const auto& gridView) {
    \n+
    223 return LagrangeDGPreBasis<std::decay_t<decltype(gridView)>, k>(gridView);
    \n+
    224 };
    \n+
    225}
    \n+
    226
    \n+
    227} // end namespace BasisFactory
    \n+
    228
    \n+
    229
    \n+
    230
    \n+
    231// *****************************************************************************
    \n+
    232// This is the actual global basis implementation based on the reusable parts.
    \n+
    233// *****************************************************************************
    \n
    234
    \n-
    240 template<typename It>
    \n-
    241 It indices(const Node& node, It it) const
    \n-
    242 {
    \n-
    243 const auto& gridIndexSet = gridView().indexSet();
    \n-
    244 const auto& element = node.element();
    \n+
    242template<typename GV, int k>
    \n+\n+
    244
    \n
    245
    \n-
    246 // throw if element is not of predefined type
    \n-
    247 if (not(element.type().isCube()) and not(element.type().isSimplex()))
    \n-
    248 DUNE_THROW(Dune::NotImplemented, "BrezziDouglasMariniBasis only implemented for cube and simplex elements.");
    \n+
    246
    \n+
    247} // end namespace Functions
    \n+
    248} // end namespace Dune
    \n
    249
    \n-
    250 for(std::size_t i=0, end=node.size(); i<end; ++i, ++it)
    \n-
    251 {
    \n-
    252 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
    \n-
    253
    \n-
    254 // The dimension of the entity that the current dof is related to
    \n-
    255 size_t subentity = localKey.subEntity();
    \n-
    256 size_t codim = localKey.codim();
    \n-
    257
    \n-
    258 *it = { codimOffset_[codim] +
    \n-
    259 dofsPerCodim_[codim] * gridIndexSet.subIndex(element, subentity, codim) + localKey.index() };
    \n-
    260 }
    \n-
    261
    \n-
    262 return it;
    \n-
    263 }
    \n-
    264
    \n-
    265protected:
    \n-\n-
    267 std::array<size_t,dim+1> codimOffset_;
    \n-
    268 FiniteElementMap finiteElementMap_;
    \n-
    269 // Number of dofs per entity type depending on the entity's codimension and type
    \n-
    270 std::array<int,2> dofsPerCodim_ {{dim*(k-1)*3, dim+(k-1)}};
    \n-
    271};
    \n-
    272
    \n-
    273
    \n-
    274
    \n-
    275template<typename GV, int k>
    \n-\n-
    277 public LeafBasisNode
    \n-
    278{
    \n-
    279 static const int dim = GV::dimension;
    \n-
    280
    \n-
    281public:
    \n-
    282
    \n-
    283 using size_type = std::size_t;
    \n-
    284 using Element = typename GV::template Codim<0>::Entity;
    \n-
    285 using FiniteElementMap = typename Impl::BDMLocalFiniteElementMap<GV, dim, double, k>;
    \n-
    286 using FiniteElement = Impl::GlobalValuedLocalFiniteElement<Impl::ContravariantPiolaTransformator,
    \n-
    287 typename FiniteElementMap::FiniteElement,
    \n-
    288 Element>;
    \n-
    289
    \n-
    290 BrezziDouglasMariniNode(const FiniteElementMap* finiteElementMap) :
    \n-
    291 element_(nullptr),
    \n-
    292 finiteElementMap_(finiteElementMap)
    \n-
    293 {}
    \n-
    294
    \n-
    296 const Element& element() const
    \n-
    297 {
    \n-
    298 return *element_;
    \n-
    299 }
    \n-
    300
    \n-\n-
    306 {
    \n-
    307 return finiteElement_;
    \n-
    308 }
    \n-
    309
    \n-
    311 void bind(const Element& e)
    \n-
    312 {
    \n-
    313 element_ = &e;
    \n-
    314 finiteElement_.bind((finiteElementMap_->find(*element_)), e);
    \n-
    315 this->setSize(finiteElement_.size());
    \n-
    316 }
    \n-
    317
    \n-
    318protected:
    \n-
    319
    \n-\n-\n-\n-
    323};
    \n-
    324
    \n-
    325
    \n-
    326
    \n-
    327namespace BasisFactory {
    \n-
    328
    \n-
    336template<std::size_t k>
    \n-\n-
    338{
    \n-
    339 return [](const auto& gridView) {
    \n-
    340 return BrezziDouglasMariniPreBasis<std::decay_t<decltype(gridView)>, k>(gridView);
    \n-
    341 };
    \n-
    342}
    \n-
    343
    \n-
    344} // end namespace BasisFactory
    \n-
    345
    \n-
    346
    \n-
    347
    \n-
    348// *****************************************************************************
    \n-
    349// This is the actual global basis implementation based on the reusable parts.
    \n-
    350// *****************************************************************************
    \n-
    351
    \n-
    359template<typename GV, int k>
    \n-\n-
    361
    \n-
    362} // end namespace Functions
    \n-
    363} // end namespace Dune
    \n-
    364
    \n-
    365
    \n-
    366#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_HH
    \n-\n-\n-\n-
    auto brezziDouglasMarini()
    Create a pre-basis factory that can create a Brezzi-Douglas-Marini pre-basis.
    Definition: brezzidouglasmarinibasis.hh:337
    \n+
    250
    \n+
    251#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH
    \n+\n+\n+\n+
    auto power(ChildPreBasisFactory &&childPreBasisFactory, const IndexMergingStrategy &)
    Create a pre-basis factory that can build a PowerPreBasis.
    Definition: powerbasis.hh:369
    \n+
    auto lagrangeDG()
    Create a pre-basis factory that can create a LagrangeDG pre-basis.
    Definition: lagrangedgbasis.hh:220
    \n
    Definition: polynomial.hh:10
    \n-
    Definition: brezzidouglasmarinibasis.hh:278
    \n-
    const FiniteElement & finiteElement() const
    Return the LocalFiniteElement for the element we are bound to.
    Definition: brezzidouglasmarinibasis.hh:305
    \n-
    typename GV::template Codim< 0 >::Entity Element
    Definition: brezzidouglasmarinibasis.hh:284
    \n-
    const FiniteElementMap * finiteElementMap_
    Definition: brezzidouglasmarinibasis.hh:322
    \n-
    std::size_t size_type
    Definition: brezzidouglasmarinibasis.hh:283
    \n-
    FiniteElement finiteElement_
    Definition: brezzidouglasmarinibasis.hh:320
    \n-
    typename Impl::BDMLocalFiniteElementMap< GV, dim, double, k > FiniteElementMap
    Definition: brezzidouglasmarinibasis.hh:285
    \n-
    const Element * element_
    Definition: brezzidouglasmarinibasis.hh:321
    \n-
    Impl::GlobalValuedLocalFiniteElement< Impl::ContravariantPiolaTransformator, typename FiniteElementMap::FiniteElement, Element > FiniteElement
    Definition: brezzidouglasmarinibasis.hh:288
    \n-
    void bind(const Element &e)
    Bind to element.
    Definition: brezzidouglasmarinibasis.hh:311
    \n-
    BrezziDouglasMariniNode(const FiniteElementMap *finiteElementMap)
    Definition: brezzidouglasmarinibasis.hh:290
    \n-
    const Element & element() const
    Return current element, throw if unbound.
    Definition: brezzidouglasmarinibasis.hh:296
    \n-
    Definition: brezzidouglasmarinibasis.hh:152
    \n-
    std::size_t size_type
    Definition: brezzidouglasmarinibasis.hh:160
    \n-
    std::array< int, 2 > dofsPerCodim_
    Definition: brezzidouglasmarinibasis.hh:270
    \n-
    size_type dimension() const
    Definition: brezzidouglasmarinibasis.hh:221
    \n-
    static constexpr size_type minMultiIndexSize
    Definition: brezzidouglasmarinibasis.hh:165
    \n-
    static constexpr size_type maxMultiIndexSize
    Definition: brezzidouglasmarinibasis.hh:164
    \n-
    std::array< size_t, dim+1 > codimOffset_
    Definition: brezzidouglasmarinibasis.hh:267
    \n-
    size_type size(const SizePrefix prefix) const
    Return number possible values for next position in multi index.
    Definition: brezzidouglasmarinibasis.hh:214
    \n-
    Node makeNode() const
    Create tree node.
    Definition: brezzidouglasmarinibasis.hh:202
    \n-
    GV GridView
    The grid view that the FE space is defined on.
    Definition: brezzidouglasmarinibasis.hh:159
    \n-
    BrezziDouglasMariniPreBasis(const GridView &gv)
    Constructor for a given grid view object.
    Definition: brezzidouglasmarinibasis.hh:169
    \n-
    FiniteElementMap finiteElementMap_
    Definition: brezzidouglasmarinibasis.hh:268
    \n-
    void update(const GridView &gv)
    Definition: brezzidouglasmarinibasis.hh:194
    \n-
    void initializeIndices()
    Definition: brezzidouglasmarinibasis.hh:179
    \n-
    const GridView & gridView() const
    Obtain the grid view that the basis is defined on.
    Definition: brezzidouglasmarinibasis.hh:188
    \n-
    size_type size() const
    Definition: brezzidouglasmarinibasis.hh:207
    \n-
    static constexpr size_type multiIndexBufferSize
    Definition: brezzidouglasmarinibasis.hh:166
    \n-
    size_type maxNodeSize() const
    Definition: brezzidouglasmarinibasis.hh:226
    \n-
    GridView gridView_
    Definition: brezzidouglasmarinibasis.hh:266
    \n-
    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
    \n
    Global basis for given pre-basis.
    Definition: defaultglobalbasis.hh:46
    \n+
    Definition: lagrangebasis.hh:387
    \n+
    const Element & element() const
    Return current element, throw if unbound.
    Definition: lagrangebasis.hh:439
    \n+
    Definition: lagrangedgbasis.hh:38
    \n+
    size_type size() const
    Definition: lagrangedgbasis.hh:115
    \n+
    It indices(const Node &node, It it) const
    Definition: lagrangedgbasis.hh:156
    \n+
    size_type maxNodeSize() const
    Definition: lagrangedgbasis.hh:150
    \n+
    static constexpr size_type multiIndexBufferSize
    Definition: lagrangedgbasis.hh:62
    \n+
    unsigned int order() const
    Polynomial order used in the local Lagrange finite-elements.
    Definition: lagrangedgbasis.hh:194
    \n+
    void update(const GridView &gv)
    Definition: lagrangedgbasis.hh:102
    \n+
    size_t hexahedronOffset_
    Definition: lagrangedgbasis.hh:205
    \n+
    Node makeNode() const
    Create tree node.
    Definition: lagrangedgbasis.hh:110
    \n+
    static constexpr size_type maxMultiIndexSize
    Definition: lagrangedgbasis.hh:60
    \n+
    static const int dofsPerHexahedron
    Definition: lagrangedgbasis.hh:54
    \n+
    LagrangeDGPreBasis(const GridView &gv)
    Constructor for a given grid view object.
    Definition: lagrangedgbasis.hh:65
    \n+
    size_t pyramidOffset_
    Definition: lagrangedgbasis.hh:203
    \n+
    static const int dofsPerTetrahedron
    Definition: lagrangedgbasis.hh:52
    \n+
    size_type size(const SizePrefix &prefix) const
    Return number possible values for next position in multi index.
    Definition: lagrangedgbasis.hh:138
    \n+
    GV GridView
    The grid view that the FE space is defined on.
    Definition: lagrangedgbasis.hh:44
    \n+
    void initializeIndices()
    Definition: lagrangedgbasis.hh:70
    \n+
    size_t quadrilateralOffset_
    Definition: lagrangedgbasis.hh:202
    \n+
    static const int dofsPerEdge
    Definition: lagrangedgbasis.hh:49
    \n+
    const GridView & gridView() const
    Obtain the grid view that the basis is defined on.
    Definition: lagrangedgbasis.hh:97
    \n+
    static const int dofsPerQuad
    Definition: lagrangedgbasis.hh:51
    \n+
    static const int dofsPerTriangle
    Definition: lagrangedgbasis.hh:50
    \n+
    static const int dofsPerPyramid
    Definition: lagrangedgbasis.hh:55
    \n+
    GridView gridView_
    Definition: lagrangedgbasis.hh:200
    \n+
    static constexpr size_type minMultiIndexSize
    Definition: lagrangedgbasis.hh:61
    \n+
    std::size_t size_type
    Definition: lagrangedgbasis.hh:45
    \n+
    size_type dimension() const
    Definition: lagrangedgbasis.hh:145
    \n+
    size_t prismOffset_
    Definition: lagrangedgbasis.hh:204
    \n+
    static const int dofsPerPrism
    Definition: lagrangedgbasis.hh:53
    \n
    size_type size() const
    Definition: nodes.hh:142
    \n-
    void setSize(const size_type size)
    Definition: nodes.hh:164
    \n-
    Definition: nodes.hh:186
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,511 +5,376 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-brezzidouglasmarinibasis.hh\n+lagrangedgbasis.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH\n 5\n 6#include \n 7#include \n- 8#include \n+ 8#include \n 9\n- 10#include \n- 11#include \n- 12\n- 13#include \n- 14#include \n- 15#include \n- 16#include \n- 17#include \n- 18\n- 19#include \n- 20#include \n- 21#include \n- 22\n- 23namespace Dune {\n- 24namespace Functions {\n- 25\n- 26namespace Impl {\n- 27\n- 28 template\n- 29 struct BDMSimplexLocalInfo\n- 30 {\n- 31 static_assert((AlwaysFalse::value),\"The requested type of BDM element is\n-not implemented, sorry!\");\n- 32 };\n- 33\n- 34 template\n- 35 struct BDMSimplexLocalInfo<2,D,R,1>\n- 36 {\n- 37 using FiniteElement = BDM1Simplex2DLocalFiniteElement;\n- 38 static const std::size_t Variants = 8;\n- 39 };\n+ 10#include \n+ 11#include \n+ 12#include \n+ 13\n+ 14\n+ 15\n+ 16\n+ 17namespace Dune {\n+ 18namespace Functions {\n+ 19\n+ 20\n+ 21\n+ 22/\n+/ *****************************************************************************\n+ 23// This is the reusable part of the basis. It contains\n+ 24//\n+ 25// LagrangeDGPreBasis\n+ 26// LagrangeDGNode\n+ 27//\n+ 28// The pre-basis allows to create the others and is the owner of possible\n+shared\n+ 29// state. These components do _not_ depend on the global basis and local\n+view\n+ 30// and can be used without a global basis.\n+ 31/\n+/ *****************************************************************************\n+ 32\n+ 33template\n+34using LagrangeDGNode = LagrangeNode;\n+ 35\n+ 36template\n+37class LagrangeDGPreBasis\n+ 38{\n+ 39 static const int dim = GV::dimension;\n 40\n- 41 template\n- 42 struct BDMSimplexLocalInfo<2,D,R,2>\n- 43 {\n- 44 using FiniteElement = BDM2Simplex2DLocalFiniteElement;\n- 45 static const std::size_t Variants = 8;\n- 46 };\n+ 41public:\n+ 42\n+44 using GridView = GV;\n+45 using size_type = std::size_t;\n+ 46\n 47\n- 48 template\n- 49 struct BDMCubeLocalInfo\n- 50 {\n- 51 static_assert((AlwaysFalse::value),\"The requested type of BDM element is\n-not implemented, sorry!\");\n- 52 };\n- 53\n- 54 template\n- 55 struct BDMCubeLocalInfo<2,D,R,1>\n- 56 {\n- 57 using FiniteElement = BDM1Cube2DLocalFiniteElement;\n- 58 static const std::size_t Variants = 16;\n- 59 };\n- 60\n- 61 template\n- 62 struct BDMCubeLocalInfo<2,D,R,2>\n- 63 {\n- 64 using FiniteElement = BDM2Cube2DLocalFiniteElement;\n- 65 static const std::size_t Variants = 16;\n- 66 };\n- 67\n- 68 template\n- 69 struct BDMCubeLocalInfo<3,D,R,1>\n- 70 {\n- 71 using FiniteElement = BDM1Cube3DLocalFiniteElement;\n- 72 static const std::size_t Variants = 64;\n- 73 };\n- 74\n- 75 template\n- 76 class BDMLocalFiniteElementMap\n- 77 {\n- 78 using D = typename GV::ctype;\n- 79 using CubeFiniteElement = typename BDMCubeLocalInfo::\n-FiniteElement;\n- 80 using SimplexFiniteElement = typename BDMSimplexLocalInfo::\n-FiniteElement;\n- 81\n- 82 public:\n- 83\n- 84 using T = LocalBasisTraits, R, dim,\n-FieldVector, FieldMatrix >;\n- 85 using FiniteElement = LocalFiniteElementVirtualInterface;\n+ 48 // Precompute the number of dofs per entity type\n+49 const static int dofsPerEdge = k+1;\n+50 const static int dofsPerTriangle = (k+1)*(k+2)/2;\n+51 const static int dofsPerQuad = (k+1)*(k+1);\n+52 const static int dofsPerTetrahedron = (k+1)*(k+2)*(k+3)/6;\n+53 const static int dofsPerPrism = (k+1)*(k+1)*(k+2)/2;\n+54 const static int dofsPerHexahedron = (k+1)*(k+1)*(k+1);\n+55 const static int dofsPerPyramid = (k+1)*(k+2)*(2*k+3)/6;\n+ 56\n+ 57\n+58 using Node = LagrangeDGNode;\n+ 59\n+60 static constexpr size_type maxMultiIndexSize = 1;\n+61 static constexpr size_type minMultiIndexSize = 1;\n+62 static constexpr size_type multiIndexBufferSize = 1;\n+ 63\n+65 LagrangeDGPreBasis(const GridView& gv) :\n+ 66 gridView_(gv)\n+ 67 {}\n+ 68\n+ 69\n+70 void initializeIndices()\n+ 71 {\n+ 72 switch (dim)\n+ 73 {\n+ 74 case 1:\n+ 75 {\n+ 76 break;\n+ 77 }\n+ 78 case 2:\n+ 79 {\n+ 80 quadrilateralOffset_ = dofsPerTriangle * gridView_.size(Dune::\n+GeometryTypes::triangle);\n+ 81 break;\n+ 82 }\n+ 83 case 3:\n+ 84 {\n+ 85 prismOffset_ = dofsPerTetrahedron * gridView_.size(Dune::GeometryTypes::\n+tetrahedron);\n 86\n- 87 BDMLocalFiniteElementMap(const GV& gv)\n- 88 : is_(&(gv.indexSet())), orient_(gv.size(0))\n- 89 {\n- 90 cubeVariant_.resize(BDMCubeLocalInfo::Variants);\n- 91 simplexVariant_.resize(BDMSimplexLocalInfo::Variants);\n- 92\n- 93 // create all variants\n- 94 for (size_t i = 0; i < cubeVariant_.size(); i++)\n- 95 cubeVariant_[i] = std::\n-make_unique >(CubeFiniteElement\n-(i));\n- 96\n- 97 for (size_t i = 0; i < simplexVariant_.size(); i++)\n- 98 simplexVariant_[i] = std::\n-make_unique >\n-(SimplexFiniteElement(i));\n- 99\n- 100 // compute orientation for all elements\n- 101 // loop once over the grid\n- 102 for(const auto& cell : elements(gv))\n+ 87 hexahedronOffset_ = prismOffset_ + dofsPerPrism * gridView_.size(Dune::\n+GeometryTypes::prism);\n+ 88\n+ 89 pyramidOffset_ = hexahedronOffset_ + dofsPerHexahedron * gridView_.size\n+(Dune::GeometryTypes::hexahedron);\n+ 90 break;\n+ 91 }\n+ 92 }\n+ 93 }\n+ 94\n+97 const GridView& gridView() const\n+ 98 {\n+ 99 return gridView_;\n+ 100 }\n+ 101\n+102 void update(const GridView& gv)\n 103 {\n- 104 unsigned int myId = is_->index(cell);\n- 105 orient_[myId] = 0;\n+ 104 gridView_ = gv;\n+ 105 }\n 106\n- 107 for (const auto& intersection : intersections(gv,cell))\n- 108 {\n- 109 if (intersection.neighbor() && (is_->index(intersection.outside()) >\n-myId))\n- 110 orient_[myId] |= (1 << intersection.indexInInside());\n- 111 }\n- 112 }\n+110 Node makeNode() const\n+ 111 {\n+ 112 return Node{};\n 113 }\n 114\n- 116 template\n- 117 const FiniteElement& find(const EntityType& e) const\n+115 size_type size() const\n+ 116 {\n+ 117 switch (dim)\n 118 {\n- 119 if (e.type().isCube())\n- 120 return *cubeVariant_[orient_[is_->index(e)]];\n- 121 else\n- 122 return *simplexVariant_[orient_[is_->index(e)]];\n- 123 }\n- 124\n- 125 private:\n- 126 std::vector > > cubeVariant_;\n- 127 std::vector > >\n-simplexVariant_;\n- 128 const typename GV::IndexSet* is_;\n- 129 std::vector orient_;\n- 130 };\n- 131\n- 132\n- 133} // namespace Impl\n- 134\n+ 119 case 1:\n+ 120 return dofsPerEdge*gridView_.size(0);\n+ 121 case 2:\n+ 122 {\n+ 123 return dofsPerTriangle*gridView_.size(Dune::GeometryTypes::triangle) +\n+dofsPerQuad*gridView_.size(Dune::GeometryTypes::quadrilateral);\n+ 124 }\n+ 125 case 3:\n+ 126 {\n+ 127 return dofsPerTetrahedron*gridView_.size(Dune::GeometryTypes::tetrahedron)\n+ 128 + dofsPerPyramid*gridView_.size(Dune::GeometryTypes::pyramid)\n+ 129 + dofsPerPrism*gridView_.size(Dune::GeometryTypes::prism)\n+ 130 + dofsPerHexahedron*gridView_.size(Dune::GeometryTypes::hexahedron);\n+ 131 }\n+ 132 }\n+ 133 DUNE_THROW(Dune::NotImplemented, \"No size method for \" << dim << \"d grids\n+available yet!\");\n+ 134 }\n 135\n- 136/\n-/ *****************************************************************************\n- 137// This is the reusable part of the basis. It contains\n- 138//\n- 139// BrezziDouglasMariniPreBasis\n- 140// BrezziDouglasMariniNode\n- 141//\n- 142// The pre-basis allows to create the others and is the owner of possible\n-shared\n- 143// state. These components do _not_ depend on the global basis and local\n-view\n- 144// and can be used without a global basis.\n- 145/\n-/ *****************************************************************************\n- 146\n- 147template\n- 148class BrezziDouglasMariniNode;\n+ 137 template\n+138 size_type size(const SizePrefix& prefix) const\n+ 139 {\n+ 140 assert(prefix.size() == 0 || prefix.size() == 1);\n+ 141 return (prefix.size() == 0) ? size() : 0;\n+ 142 }\n+ 143\n+145 size_type dimension() const\n+ 146 {\n+ 147 return size();\n+ 148 }\n 149\n- 150template\n-151class BrezziDouglasMariniPreBasis\n- 152{\n- 153 static const int dim = GV::dimension;\n- 154 using FiniteElementMap = typename Impl::BDMLocalFiniteElementMap;\n- 155\n- 156public:\n- 157\n-159 using GridView = GV;\n-160 using size_type = std::size_t;\n- 161\n-162 using Node = BrezziDouglasMariniNode;\n- 163\n-164 static constexpr size_type maxMultiIndexSize = 1;\n-165 static constexpr size_type minMultiIndexSize = 1;\n-166 static constexpr size_type multiIndexBufferSize = 1;\n- 167\n-169 BrezziDouglasMariniPreBasis(const GridView& gv) :\n- 170 gridView_(gv),\n- 171 finiteElementMap_(gv)\n- 172 {\n- 173 // There is no inherent reason why the basis shouldn't work for grids with\n-more than one\n- 174 // element types. Somebody simply has to sit down and implement the\n-missing bits.\n- 175 if (gv.indexSet().types(0).size() > 1)\n- 176 DUNE_THROW(Dune::NotImplemented, \"Brezzi-Douglas-Marini basis is only\n-implemented for grids with a single element type\");\n- 177 }\n- 178\n-179 void initializeIndices()\n- 180 {\n- 181 codimOffset_[0] = 0;\n- 182 codimOffset_[1] = codimOffset_[0] + dofsPerCodim_[0] * gridView_.size(0);\n- 183 //if (dim==3) codimOffset_[2] = codimOffset_[1] + dofsPerCodim[1] *\n-gridView_.size(1);\n- 184 }\n- 185\n-188 const GridView& gridView() const\n- 189 {\n- 190 return gridView_;\n+150 size_type maxNodeSize() const\n+ 151 {\n+ 152 return Dune::power(k+1, int(GV::dimension));\n+ 153 }\n+ 154\n+ 155 template\n+156 It indices(const Node& node, It it) const\n+ 157 {\n+ 158 const auto& gridIndexSet = gridView().indexSet();\n+ 159 const auto& element = node.element();\n+ 160\n+ 161 size_type offset = 0;\n+ 162 if constexpr (dim==1)\n+ 163 offset = dofsPerEdge*gridIndexSet.subIndex(element,0,0);\n+ 164 else if constexpr (dim==2)\n+ 165 {\n+ 166 if (element.type().isTriangle())\n+ 167 offset = dofsPerTriangle*gridIndexSet.subIndex(element,0,0);\n+ 168 else if (element.type().isQuadrilateral())\n+ 169 offset = quadrilateralOffset_ + dofsPerQuad*gridIndexSet.subIndex\n+(element,0,0);\n+ 170 else\n+ 171 DUNE_THROW(Dune::NotImplemented, \"2d elements have to be triangles or\n+quadrilaterals\");\n+ 172 }\n+ 173 else if constexpr (dim==3)\n+ 174 {\n+ 175 if (element.type().isTetrahedron())\n+ 176 offset = dofsPerTetrahedron*gridIndexSet.subIndex(element,0,0);\n+ 177 else if (element.type().isPrism())\n+ 178 offset = prismOffset_ + dofsPerPrism*gridIndexSet.subIndex(element,0,0);\n+ 179 else if (element.type().isHexahedron())\n+ 180 offset = hexahedronOffset_ + dofsPerHexahedron*gridIndexSet.subIndex\n+(element,0,0);\n+ 181 else if (element.type().isPyramid())\n+ 182 offset = pyramidOffset_ + dofsPerPyramid*gridIndexSet.subIndex\n+(element,0,0);\n+ 183 else\n+ 184 DUNE_THROW(Dune::NotImplemented, \"3d elements have to be tetrahedrons,\n+prisms, hexahedrons or pyramids\");\n+ 185 }\n+ 186 else\n+ 187 DUNE_THROW(Dune::NotImplemented, \"No index method for \" << dim << \"d grids\n+available yet!\");\n+ 188 for (size_type i = 0, end = node.size() ; i < end ; ++i, ++it)\n+ 189 *it = {offset + i};\n+ 190 return it;\n 191 }\n 192\n- 193 /* \\brief Update the stored grid view, to be called if the grid has\n-changed */\n-194 void update (const GridView& gv)\n+194 unsigned int order() const\n 195 {\n- 196 gridView_ = gv;\n+ 196 return k;\n 197 }\n 198\n-202 Node makeNode() const\n- 203 {\n- 204 return Node{&finiteElementMap_};\n- 205 }\n- 206\n-207 size_type size() const\n- 208 {\n- 209 return dofsPerCodim_[0] * gridView_.size(0) + dofsPerCodim_[1] *\n-gridView_.size(1); // only 2d\n- 210 }\n+ 199protected:\n+200 GridView gridView_;\n+ 201\n+202 size_t quadrilateralOffset_;\n+203 size_t pyramidOffset_;\n+204 size_t prismOffset_;\n+205 size_t hexahedronOffset_;\n+ 206};\n+ 207\n+ 208\n+ 209\n+ 210namespace BasisFactory {\n 211\n- 213 template\n-214 size_type size(const SizePrefix prefix) const\n- 215 {\n- 216 assert(prefix.size() == 0 || prefix.size() == 1);\n- 217 return (prefix.size() == 0) ? size() : 0;\n- 218 }\n- 219\n-221 size_type dimension() const\n- 222 {\n- 223 return size();\n- 224 }\n- 225\n-226 size_type maxNodeSize() const\n- 227 {\n- 228 // The implementation currently only supports grids with a single element\n-type.\n- 229 // We can therefore return the actual number of dofs here.\n- 230 GeometryType elementType = *(gridView_.indexSet().types(0).begin());\n- 231 size_t numFaces = ReferenceElements::general(elementType).size\n-(1);\n- 232 return dofsPerCodim_[0] + dofsPerCodim_[1] * numFaces;\n- 233 }\n- 234\n- 240 template\n-241 It indices(const Node& node, It it) const\n- 242 {\n- 243 const auto& gridIndexSet = gridView().indexSet();\n- 244 const auto& element = node.element();\n- 245\n- 246 // throw if element is not of predefined type\n- 247 if (not(element.type().isCube()) and not(element.type().isSimplex()))\n- 248 DUNE_THROW(Dune::NotImplemented, \"BrezziDouglasMariniBasis only\n-implemented for cube and simplex elements.\");\n- 249\n- 250 for(std::size_t i=0, end=node.size(); i codimOffset_;\n-268 FiniteElementMap finiteElementMap_;\n- 269 // Number of dofs per entity type depending on the entity's codimension\n-and type\n-270 std::array dofsPerCodim_ {{dim*(k-1)*3, dim+(k-1)}};\n- 271};\n- 272\n- 273\n- 274\n- 275template\n-276class BrezziDouglasMariniNode :\n- 277 public LeafBasisNode\n- 278{\n- 279 static const int dim = GV::dimension;\n- 280\n- 281public:\n- 282\n-283 using size_type = std::size_t;\n-284 using Element = typename GV::template Codim<0>::Entity;\n-285 using FiniteElementMap = typename Impl::BDMLocalFiniteElementMap;\n-286 using FiniteElement = Impl::GlobalValuedLocalFiniteElement;\n- 289\n-290 BrezziDouglasMariniNode(const FiniteElementMap* finiteElementMap) :\n- 291 element_(nullptr),\n- 292 finiteElementMap_(finiteElementMap)\n- 293 {}\n- 294\n-296 const Element& element() const\n- 297 {\n- 298 return *element_;\n- 299 }\n- 300\n-305 const FiniteElement& finiteElement() const\n- 306 {\n- 307 return finiteElement_;\n- 308 }\n- 309\n-311 void bind(const Element& e)\n- 312 {\n- 313 element_ = &e;\n- 314 finiteElement_.bind((finiteElementMap_->find(*element_)), e);\n- 315 this->setSize(finiteElement_.size());\n- 316 }\n- 317\n- 318protected:\n- 319\n-320 FiniteElement finiteElement_;\n-321 const Element* element_;\n-322 const FiniteElementMap* finiteElementMap_;\n- 323};\n- 324\n- 325\n- 326\n- 327namespace BasisFactory {\n- 328\n- 336template\n-337auto brezziDouglasMarini()\n- 338{\n- 339 return [](const auto& gridView) {\n- 340 return BrezziDouglasMariniPreBasis, k>\n-(gridView);\n- 341 };\n- 342}\n- 343\n- 344} // end namespace BasisFactory\n- 345\n- 346\n- 347\n- 348/\n+ 219template\n+220auto lagrangeDG()\n+ 221{\n+ 222 return [](const auto& gridView) {\n+ 223 return LagrangeDGPreBasis, k>(gridView);\n+ 224 };\n+ 225}\n+ 226\n+ 227} // end namespace BasisFactory\n+ 228\n+ 229\n+ 230\n+ 231/\n / *****************************************************************************\n- 349// This is the actual global basis implementation based on the reusable\n+ 232// This is the actual global basis implementation based on the reusable\n parts.\n- 350/\n+ 233/\n / *****************************************************************************\n- 351\n- 359template\n-360using BrezziDouglasMariniBasis =\n-DefaultGlobalBasis >;\n- 361\n- 362} // end namespace Functions\n- 363} // end namespace Dune\n- 364\n- 365\n- 366#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BREZZIDOUGLASMARINIBASIS_HH\n+ 234\n+ 242template\n+243using LagrangeDGBasis = DefaultGlobalBasis >;\n+ 244\n+ 245\n+ 246\n+ 247} // end namespace Functions\n+ 248} // end namespace Dune\n+ 249\n+ 250\n+ 251#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH\n nodes.hh\n+lagrangebasis.hh\n defaultglobalbasis.hh\n-globalvaluedlocalfiniteelement.hh\n-Dune::Functions::BasisFactory::brezziDouglasMarini\n-auto brezziDouglasMarini()\n-Create a pre-basis factory that can create a Brezzi-Douglas-Marini pre-basis.\n-Definition: brezzidouglasmarinibasis.hh:337\n+Dune::Functions::BasisFactory::power\n+auto power(ChildPreBasisFactory &&childPreBasisFactory, const\n+IndexMergingStrategy &)\n+Create a pre-basis factory that can build a PowerPreBasis.\n+Definition: powerbasis.hh:369\n+Dune::Functions::BasisFactory::lagrangeDG\n+auto lagrangeDG()\n+Create a pre-basis factory that can create a LagrangeDG pre-basis.\n+Definition: lagrangedgbasis.hh:220\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::BrezziDouglasMariniNode\n-Definition: brezzidouglasmarinibasis.hh:278\n-Dune::Functions::BrezziDouglasMariniNode::finiteElement\n-const FiniteElement & finiteElement() const\n-Return the LocalFiniteElement for the element we are bound to.\n-Definition: brezzidouglasmarinibasis.hh:305\n-Dune::Functions::BrezziDouglasMariniNode::Element\n-typename GV::template Codim< 0 >::Entity Element\n-Definition: brezzidouglasmarinibasis.hh:284\n-Dune::Functions::BrezziDouglasMariniNode::finiteElementMap_\n-const FiniteElementMap * finiteElementMap_\n-Definition: brezzidouglasmarinibasis.hh:322\n-Dune::Functions::BrezziDouglasMariniNode::size_type\n-std::size_t size_type\n-Definition: brezzidouglasmarinibasis.hh:283\n-Dune::Functions::BrezziDouglasMariniNode::finiteElement_\n-FiniteElement finiteElement_\n-Definition: brezzidouglasmarinibasis.hh:320\n-Dune::Functions::BrezziDouglasMariniNode::FiniteElementMap\n-typename Impl::BDMLocalFiniteElementMap< GV, dim, double, k > FiniteElementMap\n-Definition: brezzidouglasmarinibasis.hh:285\n-Dune::Functions::BrezziDouglasMariniNode::element_\n-const Element * element_\n-Definition: brezzidouglasmarinibasis.hh:321\n-Dune::Functions::BrezziDouglasMariniNode::FiniteElement\n-Impl::GlobalValuedLocalFiniteElement< Impl::ContravariantPiolaTransformator,\n-typename FiniteElementMap::FiniteElement, Element > FiniteElement\n-Definition: brezzidouglasmarinibasis.hh:288\n-Dune::Functions::BrezziDouglasMariniNode::bind\n-void bind(const Element &e)\n-Bind to element.\n-Definition: brezzidouglasmarinibasis.hh:311\n-Dune::Functions::BrezziDouglasMariniNode::BrezziDouglasMariniNode\n-BrezziDouglasMariniNode(const FiniteElementMap *finiteElementMap)\n-Definition: brezzidouglasmarinibasis.hh:290\n-Dune::Functions::BrezziDouglasMariniNode::element\n+Dune::Functions::DefaultGlobalBasis\n+Global basis for given pre-basis.\n+Definition: defaultglobalbasis.hh:46\n+Dune::Functions::LagrangeNode\n+Definition: lagrangebasis.hh:387\n+Dune::Functions::LagrangeNode::element\n const Element & element() const\n Return current element, throw if unbound.\n-Definition: brezzidouglasmarinibasis.hh:296\n-Dune::Functions::BrezziDouglasMariniPreBasis\n-Definition: brezzidouglasmarinibasis.hh:152\n-Dune::Functions::BrezziDouglasMariniPreBasis::size_type\n-std::size_t size_type\n-Definition: brezzidouglasmarinibasis.hh:160\n-Dune::Functions::BrezziDouglasMariniPreBasis::dofsPerCodim_\n-std::array< int, 2 > dofsPerCodim_\n-Definition: brezzidouglasmarinibasis.hh:270\n-Dune::Functions::BrezziDouglasMariniPreBasis::dimension\n-size_type dimension() const\n-Definition: brezzidouglasmarinibasis.hh:221\n-Dune::Functions::BrezziDouglasMariniPreBasis::minMultiIndexSize\n-static constexpr size_type minMultiIndexSize\n-Definition: brezzidouglasmarinibasis.hh:165\n-Dune::Functions::BrezziDouglasMariniPreBasis::maxMultiIndexSize\n-static constexpr size_type maxMultiIndexSize\n-Definition: brezzidouglasmarinibasis.hh:164\n-Dune::Functions::BrezziDouglasMariniPreBasis::codimOffset_\n-std::array< size_t, dim+1 > codimOffset_\n-Definition: brezzidouglasmarinibasis.hh:267\n-Dune::Functions::BrezziDouglasMariniPreBasis::size\n-size_type size(const SizePrefix prefix) const\n-Return number possible values for next position in multi index.\n-Definition: brezzidouglasmarinibasis.hh:214\n-Dune::Functions::BrezziDouglasMariniPreBasis::makeNode\n+Definition: lagrangebasis.hh:439\n+Dune::Functions::LagrangeDGPreBasis\n+Definition: lagrangedgbasis.hh:38\n+Dune::Functions::LagrangeDGPreBasis::size\n+size_type size() const\n+Definition: lagrangedgbasis.hh:115\n+Dune::Functions::LagrangeDGPreBasis::indices\n+It indices(const Node &node, It it) const\n+Definition: lagrangedgbasis.hh:156\n+Dune::Functions::LagrangeDGPreBasis::maxNodeSize\n+size_type maxNodeSize() const\n+Definition: lagrangedgbasis.hh:150\n+Dune::Functions::LagrangeDGPreBasis::multiIndexBufferSize\n+static constexpr size_type multiIndexBufferSize\n+Definition: lagrangedgbasis.hh:62\n+Dune::Functions::LagrangeDGPreBasis::order\n+unsigned int order() const\n+Polynomial order used in the local Lagrange finite-elements.\n+Definition: lagrangedgbasis.hh:194\n+Dune::Functions::LagrangeDGPreBasis::update\n+void update(const GridView &gv)\n+Definition: lagrangedgbasis.hh:102\n+Dune::Functions::LagrangeDGPreBasis::hexahedronOffset_\n+size_t hexahedronOffset_\n+Definition: lagrangedgbasis.hh:205\n+Dune::Functions::LagrangeDGPreBasis::makeNode\n Node makeNode() const\n Create tree node.\n-Definition: brezzidouglasmarinibasis.hh:202\n-Dune::Functions::BrezziDouglasMariniPreBasis::GridView\n+Definition: lagrangedgbasis.hh:110\n+Dune::Functions::LagrangeDGPreBasis::maxMultiIndexSize\n+static constexpr size_type maxMultiIndexSize\n+Definition: lagrangedgbasis.hh:60\n+Dune::Functions::LagrangeDGPreBasis::dofsPerHexahedron\n+static const int dofsPerHexahedron\n+Definition: lagrangedgbasis.hh:54\n+Dune::Functions::LagrangeDGPreBasis::LagrangeDGPreBasis\n+LagrangeDGPreBasis(const GridView &gv)\n+Constructor for a given grid view object.\n+Definition: lagrangedgbasis.hh:65\n+Dune::Functions::LagrangeDGPreBasis::pyramidOffset_\n+size_t pyramidOffset_\n+Definition: lagrangedgbasis.hh:203\n+Dune::Functions::LagrangeDGPreBasis::dofsPerTetrahedron\n+static const int dofsPerTetrahedron\n+Definition: lagrangedgbasis.hh:52\n+Dune::Functions::LagrangeDGPreBasis::size\n+size_type size(const SizePrefix &prefix) const\n+Return number possible values for next position in multi index.\n+Definition: lagrangedgbasis.hh:138\n+Dune::Functions::LagrangeDGPreBasis::GridView\n GV GridView\n The grid view that the FE space is defined on.\n-Definition: brezzidouglasmarinibasis.hh:159\n-Dune::Functions::BrezziDouglasMariniPreBasis::BrezziDouglasMariniPreBasis\n-BrezziDouglasMariniPreBasis(const GridView &gv)\n-Constructor for a given grid view object.\n-Definition: brezzidouglasmarinibasis.hh:169\n-Dune::Functions::BrezziDouglasMariniPreBasis::finiteElementMap_\n-FiniteElementMap finiteElementMap_\n-Definition: brezzidouglasmarinibasis.hh:268\n-Dune::Functions::BrezziDouglasMariniPreBasis::update\n-void update(const GridView &gv)\n-Definition: brezzidouglasmarinibasis.hh:194\n-Dune::Functions::BrezziDouglasMariniPreBasis::initializeIndices\n+Definition: lagrangedgbasis.hh:44\n+Dune::Functions::LagrangeDGPreBasis::initializeIndices\n void initializeIndices()\n-Definition: brezzidouglasmarinibasis.hh:179\n-Dune::Functions::BrezziDouglasMariniPreBasis::gridView\n+Definition: lagrangedgbasis.hh:70\n+Dune::Functions::LagrangeDGPreBasis::quadrilateralOffset_\n+size_t quadrilateralOffset_\n+Definition: lagrangedgbasis.hh:202\n+Dune::Functions::LagrangeDGPreBasis::dofsPerEdge\n+static const int dofsPerEdge\n+Definition: lagrangedgbasis.hh:49\n+Dune::Functions::LagrangeDGPreBasis::gridView\n const GridView & gridView() const\n Obtain the grid view that the basis is defined on.\n-Definition: brezzidouglasmarinibasis.hh:188\n-Dune::Functions::BrezziDouglasMariniPreBasis::size\n-size_type size() const\n-Definition: brezzidouglasmarinibasis.hh:207\n-Dune::Functions::BrezziDouglasMariniPreBasis::multiIndexBufferSize\n-static constexpr size_type multiIndexBufferSize\n-Definition: brezzidouglasmarinibasis.hh:166\n-Dune::Functions::BrezziDouglasMariniPreBasis::maxNodeSize\n-size_type maxNodeSize() const\n-Definition: brezzidouglasmarinibasis.hh:226\n-Dune::Functions::BrezziDouglasMariniPreBasis::gridView_\n+Definition: lagrangedgbasis.hh:97\n+Dune::Functions::LagrangeDGPreBasis::dofsPerQuad\n+static const int dofsPerQuad\n+Definition: lagrangedgbasis.hh:51\n+Dune::Functions::LagrangeDGPreBasis::dofsPerTriangle\n+static const int dofsPerTriangle\n+Definition: lagrangedgbasis.hh:50\n+Dune::Functions::LagrangeDGPreBasis::dofsPerPyramid\n+static const int dofsPerPyramid\n+Definition: lagrangedgbasis.hh:55\n+Dune::Functions::LagrangeDGPreBasis::gridView_\n GridView gridView_\n-Definition: brezzidouglasmarinibasis.hh:266\n-Dune::Functions::BrezziDouglasMariniPreBasis::indices\n-It indices(const Node &node, It it) const\n-Maps from subtree index set [0..size-1] to a globally unique multi index in\n-global basis.\n-Definition: brezzidouglasmarinibasis.hh:241\n-Dune::Functions::DefaultGlobalBasis\n-Global basis for given pre-basis.\n-Definition: defaultglobalbasis.hh:46\n+Definition: lagrangedgbasis.hh:200\n+Dune::Functions::LagrangeDGPreBasis::minMultiIndexSize\n+static constexpr size_type minMultiIndexSize\n+Definition: lagrangedgbasis.hh:61\n+Dune::Functions::LagrangeDGPreBasis::size_type\n+std::size_t size_type\n+Definition: lagrangedgbasis.hh:45\n+Dune::Functions::LagrangeDGPreBasis::dimension\n+size_type dimension() const\n+Definition: lagrangedgbasis.hh:145\n+Dune::Functions::LagrangeDGPreBasis::prismOffset_\n+size_t prismOffset_\n+Definition: lagrangedgbasis.hh:204\n+Dune::Functions::LagrangeDGPreBasis::dofsPerPrism\n+static const int dofsPerPrism\n+Definition: lagrangedgbasis.hh:53\n Dune::Functions::BasisNodeMixin::size\n size_type size() const\n Definition: nodes.hh:142\n-Dune::Functions::BasisNodeMixin::setSize\n-void setSize(const size_type size)\n-Definition: nodes.hh:164\n-Dune::Functions::LeafBasisNode\n-Definition: nodes.hh:186\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00149.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00149.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: raviartthomasbasis.hh File Reference\n+dune-functions: defaultglobalbasis.hh File Reference\n \n \n \n \n \n \n \n@@ -65,68 +65,58 @@\n
  • dune
  • functions
  • functionspacebases
  • \n \n \n
    \n \n-
    raviartthomasbasis.hh File Reference
    \n+
    defaultglobalbasis.hh File Reference
    \n
    \n
    \n-
    #include <array>
    \n-#include <dune/common/exceptions.hh>
    \n-#include <dune/grid/common/capabilities.hh>
    \n-#include <dune/grid/common/mcmgmapper.hh>
    \n-#include <dune/localfunctions/common/localfiniteelementvariant.hh>
    \n-#include <dune/localfunctions/raviartthomas.hh>
    \n-#include <dune/localfunctions/raviartthomas/raviartthomas0cube2d.hh>
    \n-#include <dune/localfunctions/raviartthomas/raviartthomas0cube3d.hh>
    \n-#include <dune/localfunctions/raviartthomas/raviartthomas02d.hh>
    \n-#include <dune/localfunctions/raviartthomas/raviartthomas03d.hh>
    \n-#include <dune/localfunctions/raviartthomas/raviartthomas1cube2d.hh>
    \n-#include <dune/localfunctions/raviartthomas/raviartthomas1cube3d.hh>
    \n-#include <dune/localfunctions/raviartthomas/raviartthomas12d.hh>
    \n-#include <dune/localfunctions/raviartthomas/raviartthomas2cube2d.hh>
    \n-#include <dune/functions/functionspacebases/globalvaluedlocalfiniteelement.hh>
    \n-#include <dune/functions/functionspacebases/nodes.hh>
    \n-#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
    \n+
    #include <cstddef>
    \n+#include <type_traits>
    \n+#include <utility>
    \n+#include <dune/common/reservedvector.hh>
    \n+#include <dune/common/typeutilities.hh>
    \n+#include <dune/common/concept.hh>
    \n+#include <dune/functions/common/type_traits.hh>
    \n+#include <dune/functions/functionspacebases/defaultlocalview.hh>
    \n+#include <dune/functions/functionspacebases/concepts.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n-\n+\n+\n \n

    \n Classes

    class  Dune::Functions::RaviartThomasPreBasis< GV, k >
     
    class  Dune::Functions::RaviartThomasNode< GV, k >
    class  Dune::Functions::DefaultGlobalBasis< PB >
     Global basis for given pre-basis. More...
     
    \n \n \n \n \n \n \n \n-

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    namespace  Dune::Functions::BasisFactory
     
    \n-\n-\n-\n-\n-\n+\n+\n

    \n-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. More...
     
    namespace  Dune::Functions::BasisBuilder
     
    \n \n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n

    \n Functions

    template<std::size_t k>
    auto Dune::Functions::BasisFactory::raviartThomas ()
     Create a pre-basis factory that can create a Raviart-Thomas pre-basis. More...
     
    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)
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,54 +5,48 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-Classes | Namespaces | Typedefs | Functions\n-raviartthomasbasis.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+Classes | Namespaces | Functions\n+defaultglobalbasis.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::RaviartThomasPreBasis<_GV,_k_>\n-\u00a0\n-class \u00a0Dune::Functions::RaviartThomasNode<_GV,_k_>\n+class \u00a0Dune::Functions::DefaultGlobalBasis<_PB_>\n+\u00a0 Global basis for given pre-basis. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n namespace \u00a0Dune::Functions::BasisFactory\n \u00a0\n- Typedefs\n-template\n-using\u00a0Dune::Functions::RaviartThomasBasis = DefaultGlobalBasis<\n- RaviartThomasPreBasis< GV, k > >\n-\u00a0 Basis of a k-th-order Raviart Thomas finite element space. More...\n+namespace \u00a0Dune::Functions::BasisBuilder\n \u00a0\n Functions\n-template\n-auto\u00a0Dune::Functions::BasisFactory::raviartThomas ()\n-\u00a0 Create a pre-basis factory that can create a Raviart-Thomas pre-basis.\n- More...\n+template\n+ \u00a0Dune::Functions::DefaultGlobalBasis (PreBasis &&) -> DefaultGlobalBasis<\n+ std::decay_t< PreBasis > >\n+\u00a0\n+template\n+ \u00a0Dune::Functions::DefaultGlobalBasis (const GridView &gv, PreBasisFactory\n+ &&f) -> DefaultGlobalBasis< std::decay_t< decltype(f(gv))> >\n+\u00a0\n+template\n+auto\u00a0Dune::Functions::BasisFactory::makeBasis (const GridView &gridView,\n+ PreBasisFactory &&preBasisFactory)\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00149_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00149_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: raviartthomasbasis.hh Source File\n+dune-functions: defaultglobalbasis.hh Source File\n \n \n \n \n \n \n \n@@ -62,445 +62,203 @@\n \n \n
    \n
    \n-
    raviartthomasbasis.hh
    \n+
    defaultglobalbasis.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH
    \n
    5
    \n-
    6#include <array>
    \n-
    7#include <dune/common/exceptions.hh>
    \n-
    8
    \n-
    9#include <dune/grid/common/capabilities.hh>
    \n-
    10#include <dune/grid/common/mcmgmapper.hh>
    \n-
    11
    \n-
    12#include <dune/localfunctions/common/localfiniteelementvariant.hh>
    \n-
    13#include <dune/localfunctions/raviartthomas.hh>
    \n-
    14#include <dune/localfunctions/raviartthomas/raviartthomas0cube2d.hh>
    \n-
    15#include <dune/localfunctions/raviartthomas/raviartthomas0cube3d.hh>
    \n-
    16#include <dune/localfunctions/raviartthomas/raviartthomas02d.hh>
    \n-
    17#include <dune/localfunctions/raviartthomas/raviartthomas03d.hh>
    \n-
    18#include <dune/localfunctions/raviartthomas/raviartthomas1cube2d.hh>
    \n-
    19#include <dune/localfunctions/raviartthomas/raviartthomas1cube3d.hh>
    \n-
    20#include <dune/localfunctions/raviartthomas/raviartthomas12d.hh>
    \n-
    21#include <dune/localfunctions/raviartthomas/raviartthomas2cube2d.hh>
    \n+
    6#include <cstddef>
    \n+
    7#include <type_traits>
    \n+
    8#include <utility>
    \n+
    9
    \n+
    10#include <dune/common/reservedvector.hh>
    \n+
    11#include <dune/common/typeutilities.hh>
    \n+
    12#include <dune/common/concept.hh>
    \n+
    13
    \n+\n+\n+\n+
    17
    \n+
    18
    \n+
    19
    \n+
    20namespace Dune {
    \n+
    21namespace Functions {
    \n
    22
    \n-\n-\n-\n-
    26
    \n-
    27namespace Dune {
    \n-
    28namespace Functions {
    \n-
    29
    \n-
    30namespace Impl {
    \n-
    31
    \n-
    32 template<int dim, typename D, typename R, std::size_t k>
    \n-
    33 struct RaviartThomasSimplexLocalInfo
    \n-
    34 {
    \n-
    35 // Dummy type, must be something that we can have a std::unique_ptr to
    \n-
    36 using FiniteElement = void*;
    \n-
    37 };
    \n-
    38
    \n-
    39 template<typename D, typename R>
    \n-
    40 struct RaviartThomasSimplexLocalInfo<2,D,R,0>
    \n-
    41 {
    \n-
    42 using FiniteElement = RT02DLocalFiniteElement<D,R>;
    \n-
    43 };
    \n-
    44
    \n-
    45 template<typename D, typename R>
    \n-
    46 struct RaviartThomasSimplexLocalInfo<2,D,R,1>
    \n-
    47 {
    \n-
    48 using FiniteElement = RT12DLocalFiniteElement<D,R>;
    \n-
    49 };
    \n-
    50
    \n-
    51 template<typename D, typename R>
    \n-
    52 struct RaviartThomasSimplexLocalInfo<3,D,R,0>
    \n-
    53 {
    \n-
    54 using FiniteElement = RT03DLocalFiniteElement<D,R>;
    \n-
    55 };
    \n-
    56
    \n-
    57 template<int dim, typename D, typename R, std::size_t k>
    \n-
    58 struct RaviartThomasCubeLocalInfo
    \n-
    59 {
    \n-
    60 // Dummy type, must be something that we can have a std::unique_ptr to
    \n-
    61 using FiniteElement = void*;
    \n-
    62 };
    \n-
    63
    \n-
    64 template<typename D, typename R>
    \n-
    65 struct RaviartThomasCubeLocalInfo<2,D,R,0>
    \n-
    66 {
    \n-
    67 using FiniteElement = RT0Cube2DLocalFiniteElement<D,R>;
    \n-
    68 };
    \n-
    69
    \n-
    70 template<typename D, typename R>
    \n-
    71 struct RaviartThomasCubeLocalInfo<2,D,R,1>
    \n-
    72 {
    \n-
    73 using FiniteElement = RT1Cube2DLocalFiniteElement<D,R>;
    \n-
    74 };
    \n-
    75
    \n-
    76 template<typename D, typename R>
    \n-
    77 struct RaviartThomasCubeLocalInfo<2,D,R,2>
    \n-
    78 {
    \n-
    79 using FiniteElement = RT2Cube2DLocalFiniteElement<D,R>;
    \n-
    80 };
    \n-
    81
    \n-
    82 template<typename D, typename R>
    \n-
    83 struct RaviartThomasCubeLocalInfo<3,D,R,0>
    \n-
    84 {
    \n-
    85 using FiniteElement = RT0Cube3DLocalFiniteElement<D,R>;
    \n-
    86 };
    \n-
    87
    \n-
    88 template<typename D, typename R>
    \n-
    89 struct RaviartThomasCubeLocalInfo<3,D,R,1>
    \n-
    90 {
    \n-
    91 using FiniteElement = RT1Cube3DLocalFiniteElement<D,R>;
    \n-
    92 };
    \n-
    93
    \n-
    94 template<typename GV, int dim, typename R, std::size_t k>
    \n-
    95 class RaviartThomasLocalFiniteElementMap
    \n-
    96 {
    \n-
    97 using D = typename GV::ctype;
    \n-
    98 constexpr static bool hasFixedElementType = Capabilities::hasSingleGeometryType<typename GV::Grid>::v;
    \n-
    99
    \n-
    100 using CubeFiniteElement = typename RaviartThomasCubeLocalInfo<dim, D, R, k>::FiniteElement;
    \n-
    101 using SimplexFiniteElement = typename RaviartThomasSimplexLocalInfo<dim, D, R, k>::FiniteElement;
    \n-
    102
    \n-
    103 public:
    \n-
    104
    \n-
    105 using T = LocalBasisTraits<D, dim, FieldVector<D,dim>, R, dim, FieldVector<R,dim>, FieldMatrix<D,dim,dim> >;
    \n-
    106
    \n-
    107 constexpr static unsigned int topologyId = Capabilities::hasSingleGeometryType<typename GV::Grid>::topologyId; // meaningless if hasFixedElementType is false
    \n-
    108 constexpr static GeometryType type = GeometryType(topologyId, GV::dimension);
    \n-
    109
    \n-
    110 using FiniteElement = std::conditional_t<hasFixedElementType,
    \n-
    111 std::conditional_t<type.isCube(),CubeFiniteElement,SimplexFiniteElement>,
    \n-
    112 LocalFiniteElementVariant<CubeFiniteElement, SimplexFiniteElement> >;
    \n-
    113
    \n-
    114 // Each element facet can have its orientation reversed, hence there are
    \n-
    115 // 2^#facets different variants.
    \n-
    116 static std::size_t numVariants(GeometryType type)
    \n-
    117 {
    \n-
    118 auto numFacets = referenceElement<D,dim>(type).size(1);
    \n-
    119 return power(2,numFacets);
    \n-
    120 }
    \n-
    121
    \n-
    122 RaviartThomasLocalFiniteElementMap(const GV& gv)
    \n-
    123 : elementMapper_(gv, mcmgElementLayout()),
    \n-
    124 orient_(gv.size(0))
    \n-
    125 {
    \n-
    126 if constexpr (hasFixedElementType)
    \n-
    127 {
    \n-
    128 variants_.resize(numVariants(type));
    \n-
    129 for (size_t i = 0; i < numVariants(type); i++)
    \n-
    130 variants_[i] = FiniteElement(i);
    \n-
    131 }
    \n-
    132 else
    \n-
    133 {
    \n-
    134 // for mixed grids add offset for cubes
    \n-
    135 variants_.resize(numVariants(GeometryTypes::simplex(dim)) + numVariants(GeometryTypes::cube(dim)));
    \n-
    136 for (size_t i = 0; i < numVariants(GeometryTypes::simplex(dim)); i++)
    \n-
    137 variants_[i] = SimplexFiniteElement(i);
    \n-
    138 for (size_t i = 0; i < numVariants(GeometryTypes::cube(dim)); i++)
    \n-
    139 variants_[i + numVariants(GeometryTypes::simplex(dim))] = CubeFiniteElement(i);
    \n-
    140 }
    \n+
    23
    \n+
    24
    \n+
    44template<class PB>
    \n+\n+
    46{
    \n+
    47
    \n+
    48public:
    \n+
    49
    \n+
    51 using PreBasis = PB;
    \n+
    52
    \n+
    54 using PrefixPath = TypeTree::HybridTreePath<>;
    \n+
    55
    \n+
    57 using GridView = typename PreBasis::GridView;
    \n+
    58
    \n+
    60 using size_type = std::size_t;
    \n+
    61
    \n+\n+
    64
    \n+\n+
    67
    \n+
    69 using SizePrefix = Dune::ReservedVector<std::size_t, PreBasis::multiIndexBufferSize>;
    \n+
    70
    \n+
    79 template<class... T,
    \n+
    80 disableCopyMove<DefaultGlobalBasis, T...> = 0,
    \n+\n+\n+
    83 preBasis_(std::forward<T>(t)...),
    \n+\n+
    85 {
    \n+
    86 static_assert(models<Concept::PreBasis<GridView>, PreBasis>(), "Type passed to DefaultGlobalBasis does not model the PreBasis concept.");
    \n+
    87 preBasis_.initializeIndices();
    \n+
    88 }
    \n+
    89
    \n+
    96 template<class PreBasisFactory,
    \n+
    97 std::enable_if_t<Dune::IsCallable<PreBasisFactory(GridView), PreBasis>::value, int> = 0>
    \n+
    98 DefaultGlobalBasis(const GridView& gridView, PreBasisFactory&& factory) :
    \n+
    99 preBasis_(factory(gridView)),
    \n+\n+
    101 {
    \n+
    102 static_assert(models<Concept::PreBasis<GridView>, PreBasis>(), "Type passed to DefaultGlobalBasis does not model the PreBasis concept.");
    \n+
    103 preBasis_.initializeIndices();
    \n+
    104 }
    \n+
    105
    \n+
    107 const GridView& gridView() const
    \n+
    108 {
    \n+
    109 return preBasis_.gridView();
    \n+
    110 }
    \n+
    111
    \n+
    113 const PreBasis& preBasis() const
    \n+
    114 {
    \n+
    115 return preBasis_;
    \n+
    116 }
    \n+
    117
    \n+\n+
    120 {
    \n+
    121 return preBasis_;
    \n+
    122 }
    \n+
    123
    \n+
    130 void update(const GridView & gv)
    \n+
    131 {
    \n+
    132 preBasis_.update(gv);
    \n+
    133 preBasis_.initializeIndices();
    \n+
    134 }
    \n+
    135
    \n+\n+
    138 {
    \n+
    139 return preBasis_.dimension();
    \n+
    140 }
    \n
    141
    \n-
    142 for(const auto& cell : elements(gv))
    \n-
    143 {
    \n-
    144 unsigned int myId = elementMapper_.index(cell);
    \n-
    145 orient_[myId] = 0;
    \n-
    146
    \n-
    147 for (const auto& intersection : intersections(gv,cell))
    \n-
    148 {
    \n-
    149 if (intersection.neighbor() && (elementMapper_.index(intersection.outside()) > myId))
    \n-
    150 orient_[myId] |= (1 << intersection.indexInInside());
    \n-
    151 }
    \n-
    152
    \n-
    153 // for mixed grids add offset for cubes
    \n-
    154 if constexpr (!hasFixedElementType)
    \n-
    155 if (cell.type().isCube())
    \n-
    156 orient_[myId] += numVariants(GeometryTypes::simplex(dim));
    \n-
    157 }
    \n-
    158 }
    \n+\n+
    144 {
    \n+
    145 return preBasis_.size();
    \n+
    146 }
    \n+
    147
    \n+
    149 size_type size(const SizePrefix& prefix) const
    \n+
    150 {
    \n+
    151 return preBasis_.size(prefix);
    \n+
    152 }
    \n+
    153
    \n+\n+
    156 {
    \n+
    157 return LocalView(*this);
    \n+
    158 }
    \n
    159
    \n-
    160 template<class EntityType>
    \n-
    161 const FiniteElement& find(const EntityType& e) const
    \n-
    162 {
    \n-
    163 return variants_[orient_[elementMapper_.index(e)]];
    \n-
    164 }
    \n+\n+
    162 {
    \n+
    163 return *this;
    \n+
    164 }
    \n
    165
    \n-
    166 private:
    \n-
    167 std::vector<FiniteElement> variants_;
    \n-
    168 const Dune::MultipleCodimMultipleGeomTypeMapper<GV> elementMapper_;
    \n-
    169 std::vector<unsigned char> orient_;
    \n-
    170 };
    \n+
    167 const PrefixPath& prefixPath() const
    \n+
    168 {
    \n+
    169 return prefixPath_;
    \n+
    170 }
    \n
    171
    \n-
    172
    \n-
    173} // namespace Impl
    \n-
    174
    \n-
    175
    \n-
    176// *****************************************************************************
    \n-
    177// This is the reusable part of the basis. It contains
    \n-
    178//
    \n-
    179// RaviartThomasPreBasis
    \n-
    180// RaviartThomasNode
    \n-
    181//
    \n-
    182// The pre-basis allows to create the others and is the owner of possible shared
    \n-
    183// state. These components do _not_ depend on the global basis and local view
    \n-
    184// and can be used without a global basis.
    \n-
    185// *****************************************************************************
    \n+
    172protected:
    \n+\n+\n+
    175};
    \n+
    176
    \n+
    177
    \n+
    178
    \n+
    179template<class PreBasis>
    \n+\n+
    181
    \n+
    182template<class GridView, class PreBasisFactory>
    \n+
    183DefaultGlobalBasis(const GridView& gv, PreBasisFactory&& f) -> DefaultGlobalBasis<std::decay_t<decltype(f(gv))>>;
    \n+
    184
    \n+
    185
    \n
    186
    \n-
    187template<typename GV, int k>
    \n-
    188class RaviartThomasNode;
    \n-
    189
    \n-
    190template<typename GV, int k>
    \n-\n-
    192{
    \n-
    193 static const int dim = GV::dimension;
    \n-
    194 using FiniteElementMap = typename Impl::RaviartThomasLocalFiniteElementMap<GV, dim, double, k>;
    \n-
    195
    \n-
    196public:
    \n-
    197
    \n-
    199 using GridView = GV;
    \n-
    200 using size_type = std::size_t;
    \n+
    187namespace BasisFactory {
    \n+
    188
    \n+
    189template<class GridView, class PreBasisFactory>
    \n+
    190auto makeBasis(const GridView& gridView, PreBasisFactory&& preBasisFactory)
    \n+
    191{
    \n+
    192 return DefaultGlobalBasis(preBasisFactory(gridView));
    \n+
    193}
    \n+
    194
    \n+
    195} // end namespace BasisFactory
    \n+
    196
    \n+
    197// Backward compatibility
    \n+
    198namespace BasisBuilder {
    \n+
    199
    \n+
    200 using namespace BasisFactory;
    \n
    201
    \n-\n+
    202}
    \n
    203
    \n-
    204 static constexpr size_type maxMultiIndexSize = 1;
    \n-
    205 static constexpr size_type minMultiIndexSize = 1;
    \n-
    206 static constexpr size_type multiIndexBufferSize = 1;
    \n+
    204
    \n+
    205} // end namespace Functions
    \n+
    206} // end namespace Dune
    \n
    207
    \n-\n-
    210 gridView_(gv),
    \n-\n-
    212 {
    \n-
    213 // Currently there are some unresolved bugs with hybrid grids and higher order Raviart-Thomas elements
    \n-
    214 if (gv.indexSet().types(0).size() > 1 and k>0)
    \n-
    215 DUNE_THROW(Dune::NotImplemented, "Raviart-Thomas basis with index k>0 is only implemented for grids with a single element type");
    \n-
    216
    \n-
    217 for(auto type : gv.indexSet().types(0))
    \n-
    218 if (!type.isSimplex() && !type.isCube())
    \n-
    219 DUNE_THROW(Dune::NotImplemented, "Raviart-Thomas elements are only implemented for grids with simplex or cube elements.");
    \n-
    220
    \n-
    221 GeometryType type = gv.template begin<0>()->type();
    \n-
    222 const static int dofsPerElement = type.isCube() ? ((dim == 2) ? k*(k+1)*dim : k*(k+1)*(k+1)*dim) : k*dim;
    \n-
    223 const static int dofsPerFace = type.isCube() ? (dim-2)*2*k+k+1 : (dim-1)*k+1 ;
    \n-
    224
    \n-
    225 dofsPerCodim_ = {{dofsPerElement, dofsPerFace}};
    \n-
    226 }
    \n-
    227
    \n-\n-
    229 {
    \n-
    230 codimOffset_[0] = 0;
    \n-
    231 codimOffset_[1] = codimOffset_[0] + dofsPerCodim_[0] * gridView_.size(0);
    \n-
    232 }
    \n-
    233
    \n-
    236 const GridView& gridView() const
    \n-
    237 {
    \n-
    238 return gridView_;
    \n-
    239 }
    \n-
    240
    \n-
    241 /* \\brief Update the stored grid view, to be called if the grid has changed */
    \n-
    242 void update (const GridView& gv)
    \n-
    243 {
    \n-
    244 gridView_ = gv;
    \n-
    245 }
    \n-
    246
    \n-\n-
    251 {
    \n-
    252 return Node{&finiteElementMap_};
    \n-
    253 }
    \n-
    254
    \n-\n-
    256 {
    \n-
    257 return dofsPerCodim_[0] * gridView_.size(0) + dofsPerCodim_[1] * gridView_.size(1);
    \n-
    258 }
    \n-
    259
    \n-
    261 template<class SizePrefix>
    \n-
    262 size_type size(const SizePrefix& prefix) const
    \n-
    263 {
    \n-
    264 assert(prefix.size() == 0 || prefix.size() == 1);
    \n-
    265 return (prefix.size() == 0) ? size() : 0;
    \n-
    266 }
    \n-
    267
    \n-\n-
    270 {
    \n-
    271 return size();
    \n-
    272 }
    \n-
    273
    \n-\n-
    275 {
    \n-
    276 size_type result = 0;
    \n-
    277 for (auto&& type : gridView_.indexSet().types(0))
    \n-
    278 {
    \n-
    279 size_t numFaces = ReferenceElements<double,dim>::general(type).size(1);
    \n-
    280 const static int dofsPerElement = type.isCube() ? ((dim == 2) ? k*(k+1)*dim : k*(k+1)*(k+1)*dim) : k*dim;
    \n-
    281 const static int dofsPerFace = type.isCube() ? (dim-2)*2*k+k+1 : (dim-1)*k+1 ;
    \n-
    282 result = std::max(result, dofsPerElement + dofsPerFace * numFaces);
    \n-
    283 }
    \n-
    284
    \n-
    285 return result;
    \n-
    286 }
    \n-
    287
    \n-
    293 template<typename It>
    \n-
    294 It indices(const Node& node, It it) const
    \n-
    295 {
    \n-
    296 const auto& gridIndexSet = gridView().indexSet();
    \n-
    297 const auto& element = node.element();
    \n-
    298
    \n-
    299 // throw if Element is not of predefined type
    \n-
    300 if (not(element.type().isCube()) and not(element.type().isSimplex()))
    \n-
    301 DUNE_THROW(Dune::NotImplemented, "RaviartThomasBasis only implemented for cube and simplex elements.");
    \n-
    302
    \n-
    303 for(std::size_t i=0, end=node.size(); i<end; ++i, ++it)
    \n-
    304 {
    \n-
    305 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
    \n-
    306
    \n-
    307 // The dimension of the entity that the current dof is related to
    \n-
    308 size_t subentity = localKey.subEntity();
    \n-
    309 size_t codim = localKey.codim();
    \n-
    310
    \n-
    311 if (not(codim==0 or codim==1))
    \n-
    312 DUNE_THROW(Dune::NotImplemented, "Grid contains elements not supported for the RaviartThomasBasis");
    \n-
    313
    \n-
    314 *it = { codimOffset_[codim] +
    \n-
    315 dofsPerCodim_[codim] * gridIndexSet.subIndex(element, subentity, codim) + localKey.index() };
    \n-
    316 }
    \n-
    317
    \n-
    318 return it;
    \n-
    319 }
    \n-
    320
    \n-
    321protected:
    \n-\n-
    323 std::array<size_t,dim+1> codimOffset_;
    \n-
    324 FiniteElementMap finiteElementMap_;
    \n-
    325 // Number of dofs per entity type depending on the entity's codimension and type
    \n-
    326 std::array<int,dim+1> dofsPerCodim_;
    \n-
    327};
    \n-
    328
    \n-
    329
    \n-
    330
    \n-
    331template<typename GV, int k>
    \n-\n-
    333 public LeafBasisNode
    \n-
    334{
    \n-
    335 static const int dim = GV::dimension;
    \n-
    336
    \n-
    337public:
    \n-
    338
    \n-
    339 using size_type = std::size_t;
    \n-
    340 using Element = typename GV::template Codim<0>::Entity;
    \n-
    341 using FiniteElementMap = typename Impl::RaviartThomasLocalFiniteElementMap<GV, dim, double, k>;
    \n-
    342 using FiniteElement = Impl::GlobalValuedLocalFiniteElement<Impl::ContravariantPiolaTransformator,
    \n-
    343 typename FiniteElementMap::FiniteElement,
    \n-
    344 Element>;
    \n-
    345
    \n-
    346 RaviartThomasNode(const FiniteElementMap* finiteElementMap) :
    \n-
    347 element_(nullptr),
    \n-
    348 finiteElementMap_(finiteElementMap)
    \n-
    349 { }
    \n-
    350
    \n-
    352 const Element& element() const
    \n-
    353 {
    \n-
    354 return *element_;
    \n-
    355 }
    \n-
    356
    \n-\n-
    362 {
    \n-
    363 return finiteElement_;
    \n-
    364 }
    \n-
    365
    \n-
    367 void bind(const Element& e)
    \n-
    368 {
    \n-
    369 element_ = &e;
    \n-
    370 finiteElement_.bind((finiteElementMap_->find(*element_)), e);
    \n-
    371 this->setSize(finiteElement_.size());
    \n-
    372 }
    \n-
    373
    \n-
    374protected:
    \n-
    375
    \n-\n-\n-\n-
    379};
    \n-
    380
    \n-
    381namespace BasisFactory {
    \n-
    382
    \n-
    390template<std::size_t k>
    \n-\n-
    392{
    \n-
    393 return [](const auto& gridView) {
    \n-
    394 return RaviartThomasPreBasis<std::decay_t<decltype(gridView)>, k>(gridView);
    \n-
    395 };
    \n-
    396}
    \n-
    397
    \n-
    398} // end namespace BasisFactory
    \n-
    399
    \n-
    400
    \n-
    401
    \n-
    402// *****************************************************************************
    \n-
    403// This is the actual global basis implementation based on the reusable parts.
    \n-
    404// *****************************************************************************
    \n-
    405
    \n-
    413template<typename GV, int k>
    \n-\n-
    415
    \n-
    416} // end namespace Functions
    \n-
    417} // end namespace Dune
    \n-
    418
    \n-
    419
    \n-
    420#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH
    \n-\n-\n-\n-
    auto power(ChildPreBasisFactory &&childPreBasisFactory, const IndexMergingStrategy &)
    Create a pre-basis factory that can build a PowerPreBasis.
    Definition: powerbasis.hh:369
    \n-
    auto raviartThomas()
    Create a pre-basis factory that can create a Raviart-Thomas pre-basis.
    Definition: raviartthomasbasis.hh:391
    \n+
    208
    \n+
    209
    \n+
    210#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH
    \n+\n+\n+
    typename std::enable_if< std::is_constructible< T, Args... >::value, int >::type enableIfConstructible
    Helper to constrain forwarding constructors.
    Definition: type_traits.hh:26
    \n
    Definition: polynomial.hh:10
    \n+
    DefaultGlobalBasis(PreBasis &&) -> DefaultGlobalBasis< std::decay_t< PreBasis > >
    \n+
    auto makeBasis(const GridView &gridView, PreBasisFactory &&preBasisFactory)
    Definition: defaultglobalbasis.hh:190
    \n
    Global basis for given pre-basis.
    Definition: defaultglobalbasis.hh:46
    \n-
    size_type size() const
    Definition: nodes.hh:142
    \n-
    std::size_t size_type
    Definition: nodes.hh:128
    \n-
    void setSize(const size_type size)
    Definition: nodes.hh:164
    \n-
    Definition: nodes.hh:186
    \n-
    Definition: raviartthomasbasis.hh:334
    \n-
    typename Impl::RaviartThomasLocalFiniteElementMap< GV, dim, double, k > FiniteElementMap
    Definition: raviartthomasbasis.hh:341
    \n-
    void bind(const Element &e)
    Bind to element.
    Definition: raviartthomasbasis.hh:367
    \n-
    Impl::GlobalValuedLocalFiniteElement< Impl::ContravariantPiolaTransformator, typename FiniteElementMap::FiniteElement, Element > FiniteElement
    Definition: raviartthomasbasis.hh:344
    \n-
    typename GV::template Codim< 0 >::Entity Element
    Definition: raviartthomasbasis.hh:340
    \n-
    const Element * element_
    Definition: raviartthomasbasis.hh:377
    \n-
    const FiniteElement & finiteElement() const
    Return the LocalFiniteElement for the element we are bound to.
    Definition: raviartthomasbasis.hh:361
    \n-
    RaviartThomasNode(const FiniteElementMap *finiteElementMap)
    Definition: raviartthomasbasis.hh:346
    \n-
    const Element & element() const
    Return current element, throw if unbound.
    Definition: raviartthomasbasis.hh:352
    \n-
    FiniteElement finiteElement_
    Definition: raviartthomasbasis.hh:376
    \n-
    const FiniteElementMap * finiteElementMap_
    Definition: raviartthomasbasis.hh:378
    \n-
    Definition: raviartthomasbasis.hh:192
    \n-
    static constexpr size_type minMultiIndexSize
    Definition: raviartthomasbasis.hh:205
    \n-
    static constexpr size_type maxMultiIndexSize
    Definition: raviartthomasbasis.hh:204
    \n-
    Node makeNode() const
    Create tree node.
    Definition: raviartthomasbasis.hh:250
    \n-
    std::array< int, dim+1 > dofsPerCodim_
    Definition: raviartthomasbasis.hh:326
    \n-
    void update(const GridView &gv)
    Definition: raviartthomasbasis.hh:242
    \n-
    RaviartThomasPreBasis(const GridView &gv)
    Constructor for a given grid view object.
    Definition: raviartthomasbasis.hh:209
    \n-
    std::size_t size_type
    Definition: raviartthomasbasis.hh:200
    \n-
    const GridView & gridView() const
    Obtain the grid view that the basis is defined on.
    Definition: raviartthomasbasis.hh:236
    \n-
    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
    \n-
    static constexpr size_type multiIndexBufferSize
    Definition: raviartthomasbasis.hh:206
    \n-
    FiniteElementMap finiteElementMap_
    Definition: raviartthomasbasis.hh:324
    \n-
    size_type size() const
    Definition: raviartthomasbasis.hh:255
    \n-
    size_type dimension() const
    Definition: raviartthomasbasis.hh:269
    \n-
    GV GridView
    The grid view that the FE space is defined on.
    Definition: raviartthomasbasis.hh:199
    \n-
    size_type maxNodeSize() const
    Definition: raviartthomasbasis.hh:274
    \n-
    GridView gridView_
    Definition: raviartthomasbasis.hh:322
    \n-
    size_type size(const SizePrefix &prefix) const
    Return number possible values for next position in multi index.
    Definition: raviartthomasbasis.hh:262
    \n-
    void initializeIndices()
    Definition: raviartthomasbasis.hh:228
    \n-
    std::array< size_t, dim+1 > codimOffset_
    Definition: raviartthomasbasis.hh:323
    \n+
    Dune::ReservedVector< std::size_t, PreBasis::multiIndexBufferSize > SizePrefix
    Type used for prefixes handed to the size() method.
    Definition: defaultglobalbasis.hh:69
    \n+
    std::size_t size_type
    Type used for indices and size information.
    Definition: defaultglobalbasis.hh:60
    \n+
    typename PreBasis::GridView GridView
    The grid view that the FE space is defined on.
    Definition: defaultglobalbasis.hh:57
    \n+
    const GridView & gridView() const
    Obtain the grid view that the basis is defined on.
    Definition: defaultglobalbasis.hh:107
    \n+
    PB PreBasis
    Pre-basis providing the implementation details.
    Definition: defaultglobalbasis.hh:51
    \n+
    PreBasis & preBasis()
    Obtain the pre-basis providing the implementation details.
    Definition: defaultglobalbasis.hh:119
    \n+
    void update(const GridView &gv)
    Update the stored grid view.
    Definition: defaultglobalbasis.hh:130
    \n+
    DefaultLocalView< DefaultGlobalBasis< PreBasis > > LocalView
    Type of the local view on the restriction of the basis to a single element.
    Definition: defaultglobalbasis.hh:63
    \n+
    typename LocalView::MultiIndex MultiIndex
    Type used for global numbering of the basis vectors.
    Definition: defaultglobalbasis.hh:66
    \n+
    size_type size(const SizePrefix &prefix) const
    Return number of possible values for next position in multi index.
    Definition: defaultglobalbasis.hh:149
    \n+
    size_type dimension() const
    Get the total dimension of the space spanned by this basis.
    Definition: defaultglobalbasis.hh:137
    \n+
    PreBasis preBasis_
    Definition: defaultglobalbasis.hh:173
    \n+
    LocalView localView() const
    Return local view for basis.
    Definition: defaultglobalbasis.hh:155
    \n+
    TypeTree::HybridTreePath<> PrefixPath
    The empty prefix path that identifies the root in the local ansatz tree.
    Definition: defaultglobalbasis.hh:54
    \n+
    DefaultGlobalBasis(T &&... t)
    Constructor.
    Definition: defaultglobalbasis.hh:82
    \n+
    DefaultGlobalBasis(const GridView &gridView, PreBasisFactory &&factory)
    Constructor from a PreBasis factory.
    Definition: defaultglobalbasis.hh:98
    \n+
    size_type size() const
    Return number of possible values for next position in empty multi index.
    Definition: defaultglobalbasis.hh:143
    \n+
    const PreBasis & preBasis() const
    Obtain the pre-basis providing the implementation details.
    Definition: defaultglobalbasis.hh:113
    \n+
    PrefixPath prefixPath_
    Definition: defaultglobalbasis.hh:174
    \n+
    const DefaultGlobalBasis & rootBasis() const
    Return *this because we are not embedded in a larger basis.
    Definition: defaultglobalbasis.hh:161
    \n+
    const PrefixPath & prefixPath() const
    Return empty path, because this is the root in the local ansatz tree.
    Definition: defaultglobalbasis.hh:167
    \n+
    The restriction of a finite element basis to a single element.
    Definition: defaultlocalview.hh:28
    \n+
    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
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,566 +5,283 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-raviartthomasbasis.hh\n+defaultglobalbasis.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH\n 5\n- 6#include \n- 7#include \n- 8\n- 9#include \n- 10#include \n- 11\n- 12#include \n- 13#include \n- 14#include \n- 15#include \n- 16#include \n- 17#include \n- 18#include \n- 19#include \n- 20#include \n- 21#include \n+ 6#include \n+ 7#include \n+ 8#include \n+ 9\n+ 10#include \n+ 11#include \n+ 12#include \n+ 13\n+ 14#include \n+ 15#include \n+ 16#include \n+ 17\n+ 18\n+ 19\n+ 20namespace Dune {\n+ 21namespace Functions {\n 22\n- 23#include \n- 24#include \n- 25#include \n- 26\n- 27namespace Dune {\n- 28namespace Functions {\n- 29\n- 30namespace Impl {\n- 31\n- 32 template\n- 33 struct RaviartThomasSimplexLocalInfo\n- 34 {\n- 35 // Dummy type, must be something that we can have a std::unique_ptr to\n- 36 using FiniteElement = void*;\n- 37 };\n- 38\n- 39 template\n- 40 struct RaviartThomasSimplexLocalInfo<2,D,R,0>\n- 41 {\n- 42 using FiniteElement = RT02DLocalFiniteElement;\n- 43 };\n- 44\n- 45 template\n- 46 struct RaviartThomasSimplexLocalInfo<2,D,R,1>\n- 47 {\n- 48 using FiniteElement = RT12DLocalFiniteElement;\n- 49 };\n- 50\n- 51 template\n- 52 struct RaviartThomasSimplexLocalInfo<3,D,R,0>\n- 53 {\n- 54 using FiniteElement = RT03DLocalFiniteElement;\n- 55 };\n- 56\n- 57 template\n- 58 struct RaviartThomasCubeLocalInfo\n- 59 {\n- 60 // Dummy type, must be something that we can have a std::unique_ptr to\n- 61 using FiniteElement = void*;\n- 62 };\n- 63\n- 64 template\n- 65 struct RaviartThomasCubeLocalInfo<2,D,R,0>\n- 66 {\n- 67 using FiniteElement = RT0Cube2DLocalFiniteElement;\n- 68 };\n- 69\n- 70 template\n- 71 struct RaviartThomasCubeLocalInfo<2,D,R,1>\n- 72 {\n- 73 using FiniteElement = RT1Cube2DLocalFiniteElement;\n- 74 };\n- 75\n- 76 template\n- 77 struct RaviartThomasCubeLocalInfo<2,D,R,2>\n- 78 {\n- 79 using FiniteElement = RT2Cube2DLocalFiniteElement;\n- 80 };\n- 81\n- 82 template\n- 83 struct RaviartThomasCubeLocalInfo<3,D,R,0>\n- 84 {\n- 85 using FiniteElement = RT0Cube3DLocalFiniteElement;\n- 86 };\n- 87\n- 88 template\n- 89 struct RaviartThomasCubeLocalInfo<3,D,R,1>\n- 90 {\n- 91 using FiniteElement = RT1Cube3DLocalFiniteElement;\n- 92 };\n- 93\n- 94 template\n- 95 class RaviartThomasLocalFiniteElementMap\n- 96 {\n- 97 using D = typename GV::ctype;\n- 98 constexpr static bool hasFixedElementType = Capabilities::\n-hasSingleGeometryType::v;\n- 99\n- 100 using CubeFiniteElement = typename RaviartThomasCubeLocalInfo::FiniteElement;\n- 101 using SimplexFiniteElement = typename RaviartThomasSimplexLocalInfo::FiniteElement;\n- 102\n- 103 public:\n- 104\n- 105 using T = LocalBasisTraits, R, dim,\n-FieldVector, FieldMatrix >;\n- 106\n- 107 constexpr static unsigned int topologyId = Capabilities::\n-hasSingleGeometryType::topologyId; // meaningless if\n-hasFixedElementType is false\n- 108 constexpr static GeometryType type = GeometryType(topologyId, GV::\n-dimension);\n- 109\n- 110 using FiniteElement = std::conditional_t,\n- 112 LocalFiniteElementVariant >;\n- 113\n- 114 // Each element facet can have its orientation reversed, hence there are\n- 115 // 2^#facets different variants.\n- 116 static std::size_t numVariants(GeometryType type)\n- 117 {\n- 118 auto numFacets = referenceElement(type).size(1);\n- 119 return power(2,numFacets);\n- 120 }\n- 121\n- 122 RaviartThomasLocalFiniteElementMap(const GV& gv)\n- 123 : elementMapper_(gv, mcmgElementLayout()),\n- 124 orient_(gv.size(0))\n- 125 {\n- 126 if constexpr (hasFixedElementType)\n- 127 {\n- 128 variants_.resize(numVariants(type));\n- 129 for (size_t i = 0; i < numVariants(type); i++)\n- 130 variants_[i] = FiniteElement(i);\n- 131 }\n- 132 else\n- 133 {\n- 134 // for mixed grids add offset for cubes\n- 135 variants_.resize(numVariants(GeometryTypes::simplex(dim)) + numVariants\n-(GeometryTypes::cube(dim)));\n- 136 for (size_t i = 0; i < numVariants(GeometryTypes::simplex(dim)); i++)\n- 137 variants_[i] = SimplexFiniteElement(i);\n- 138 for (size_t i = 0; i < numVariants(GeometryTypes::cube(dim)); i++)\n- 139 variants_[i + numVariants(GeometryTypes::simplex(dim))] =\n-CubeFiniteElement(i);\n+ 23\n+ 24\n+ 44template\n+45class DefaultGlobalBasis\n+ 46{\n+ 47\n+ 48public:\n+ 49\n+51 using PreBasis = PB;\n+ 52\n+54 using PrefixPath = TypeTree::HybridTreePath<>;\n+ 55\n+57 using GridView = typename PreBasis::GridView;\n+ 58\n+60 using size_type = std::size_t;\n+ 61\n+63 using LocalView = DefaultLocalView>;\n+ 64\n+66 using MultiIndex = typename LocalView::MultiIndex;\n+ 67\n+69 using SizePrefix = Dune::ReservedVector;\n+ 70\n+ 79 template = 0,\n+ 81 enableIfConstructible = 0>\n+82 DefaultGlobalBasis(T&&... t) :\n+ 83 preBasis_(std::forward(t)...),\n+ 84 prefixPath_()\n+ 85 {\n+ 86 static_assert(models, PreBasis>(), \"Type passed\n+to DefaultGlobalBasis does not model the PreBasis concept.\");\n+ 87 preBasis_.initializeIndices();\n+ 88 }\n+ 89\n+ 96 template::\n+value, int> = 0>\n+98 DefaultGlobalBasis(const GridView& gridView, PreBasisFactory&& factory) :\n+ 99 preBasis_(factory(gridView)),\n+ 100 prefixPath_()\n+ 101 {\n+ 102 static_assert(models, PreBasis>(), \"Type\n+passed to DefaultGlobalBasis does not model the PreBasis concept.\");\n+ 103 preBasis_.initializeIndices();\n+ 104 }\n+ 105\n+107 const GridView& gridView() const\n+ 108 {\n+ 109 return preBasis_.gridView();\n+ 110 }\n+ 111\n+113 const PreBasis& preBasis() const\n+ 114 {\n+ 115 return preBasis_;\n+ 116 }\n+ 117\n+119 PreBasis& preBasis()\n+ 120 {\n+ 121 return preBasis_;\n+ 122 }\n+ 123\n+130 void update(const GridView & gv)\n+ 131 {\n+ 132 preBasis_.update(gv);\n+ 133 preBasis_.initializeIndices();\n+ 134 }\n+ 135\n+137 size_type dimension() const\n+ 138 {\n+ 139 return preBasis_.dimension();\n 140 }\n 141\n- 142 for(const auto& cell : elements(gv))\n- 143 {\n- 144 unsigned int myId = elementMapper_.index(cell);\n- 145 orient_[myId] = 0;\n- 146\n- 147 for (const auto& intersection : intersections(gv,cell))\n- 148 {\n- 149 if (intersection.neighbor() && (elementMapper_.index(intersection.outside\n-()) > myId))\n- 150 orient_[myId] |= (1 << intersection.indexInInside());\n- 151 }\n- 152\n- 153 // for mixed grids add offset for cubes\n- 154 if constexpr (!hasFixedElementType)\n- 155 if (cell.type().isCube())\n- 156 orient_[myId] += numVariants(GeometryTypes::simplex(dim));\n- 157 }\n+143 size_type size() const\n+ 144 {\n+ 145 return preBasis_.size();\n+ 146 }\n+ 147\n+149 size_type size(const SizePrefix& prefix) const\n+ 150 {\n+ 151 return preBasis_.size(prefix);\n+ 152 }\n+ 153\n+155 LocalView localView() const\n+ 156 {\n+ 157 return LocalView(*this);\n 158 }\n 159\n- 160 template\n- 161 const FiniteElement& find(const EntityType& e) const\n+161 const DefaultGlobalBasis& rootBasis() const\n 162 {\n- 163 return variants_[orient_[elementMapper_.index(e)]];\n+ 163 return *this;\n 164 }\n 165\n- 166 private:\n- 167 std::vector variants_;\n- 168 const Dune::MultipleCodimMultipleGeomTypeMapper elementMapper_;\n- 169 std::vector orient_;\n- 170 };\n+167 const PrefixPath& prefixPath() const\n+ 168 {\n+ 169 return prefixPath_;\n+ 170 }\n 171\n- 172\n- 173} // namespace Impl\n- 174\n- 175\n- 176/\n-/ *****************************************************************************\n- 177// This is the reusable part of the basis. It contains\n- 178//\n- 179// RaviartThomasPreBasis\n- 180// RaviartThomasNode\n- 181//\n- 182// The pre-basis allows to create the others and is the owner of possible\n-shared\n- 183// state. These components do _not_ depend on the global basis and local\n-view\n- 184// and can be used without a global basis.\n- 185/\n-/ *****************************************************************************\n+ 172protected:\n+173 PreBasis preBasis_;\n+174 PrefixPath prefixPath_;\n+ 175};\n+ 176\n+ 177\n+ 178\n+ 179template\n+180DefaultGlobalBasis(PreBasis&&) -> DefaultGlobalBasis>;\n+ 181\n+ 182template\n+183DefaultGlobalBasis(const GridView& gv, PreBasisFactory&& f) -\n+> DefaultGlobalBasis>;\n+ 184\n+ 185\n 186\n- 187template\n- 188class RaviartThomasNode;\n- 189\n- 190template\n-191class RaviartThomasPreBasis\n- 192{\n- 193 static const int dim = GV::dimension;\n- 194 using FiniteElementMap = typename Impl::\n-RaviartThomasLocalFiniteElementMap;\n- 195\n- 196public:\n- 197\n-199 using GridView = GV;\n-200 using size_type = std::size_t;\n+ 187namespace BasisFactory {\n+ 188\n+ 189template\n+190auto makeBasis(const GridView& gridView, PreBasisFactory&& preBasisFactory)\n+ 191{\n+ 192 return DefaultGlobalBasis(preBasisFactory(gridView));\n+ 193}\n+ 194\n+ 195} // end namespace BasisFactory\n+ 196\n+ 197// Backward compatibility\n+ 198namespace BasisBuilder {\n+ 199\n+ 200 using namespace BasisFactory;\n 201\n-202 using Node = RaviartThomasNode;\n+ 202}\n 203\n-204 static constexpr size_type maxMultiIndexSize = 1;\n-205 static constexpr size_type minMultiIndexSize = 1;\n-206 static constexpr size_type multiIndexBufferSize = 1;\n+ 204\n+ 205} // end namespace Functions\n+ 206} // end namespace Dune\n 207\n-209 RaviartThomasPreBasis(const GridView& gv) :\n- 210 gridView_(gv),\n- 211 finiteElementMap_(gv)\n- 212 {\n- 213 // Currently there are some unresolved bugs with hybrid grids and higher\n-order Raviart-Thomas elements\n- 214 if (gv.indexSet().types(0).size() > 1 and k>0)\n- 215 DUNE_THROW(Dune::NotImplemented, \"Raviart-Thomas basis with index k>0 is\n-only implemented for grids with a single element type\");\n- 216\n- 217 for(auto type : gv.indexSet().types(0))\n- 218 if (!type.isSimplex() && !type.isCube())\n- 219 DUNE_THROW(Dune::NotImplemented, \"Raviart-Thomas elements are only\n-implemented for grids with simplex or cube elements.\");\n- 220\n- 221 GeometryType type = gv.template begin<0>()->type();\n- 222 const static int dofsPerElement = type.isCube() ? ((dim == 2) ? k*\n-(k+1)*dim : k*(k+1)*(k+1)*dim) : k*dim;\n- 223 const static int dofsPerFace = type.isCube() ? (dim-2)*2*k+k+1 : (dim-\n-1)*k+1 ;\n- 224\n- 225 dofsPerCodim_ = {{dofsPerElement, dofsPerFace}};\n- 226 }\n- 227\n-228 void initializeIndices()\n- 229 {\n- 230 codimOffset_[0] = 0;\n- 231 codimOffset_[1] = codimOffset_[0] + dofsPerCodim_[0] * gridView_.size(0);\n- 232 }\n- 233\n-236 const GridView& gridView() const\n- 237 {\n- 238 return gridView_;\n- 239 }\n- 240\n- 241 /* \\brief Update the stored grid view, to be called if the grid has\n-changed */\n-242 void update (const GridView& gv)\n- 243 {\n- 244 gridView_ = gv;\n- 245 }\n- 246\n-250 Node makeNode() const\n- 251 {\n- 252 return Node{&finiteElementMap_};\n- 253 }\n- 254\n-255 size_type size() const\n- 256 {\n- 257 return dofsPerCodim_[0] * gridView_.size(0) + dofsPerCodim_[1] *\n-gridView_.size(1);\n- 258 }\n- 259\n- 261 template\n-262 size_type size(const SizePrefix& prefix) const\n- 263 {\n- 264 assert(prefix.size() == 0 || prefix.size() == 1);\n- 265 return (prefix.size() == 0) ? size() : 0;\n- 266 }\n- 267\n-269 size_type dimension() const\n- 270 {\n- 271 return size();\n- 272 }\n- 273\n-274 size_type maxNodeSize() const\n- 275 {\n- 276 size_type result = 0;\n- 277 for (auto&& type : gridView_.indexSet().types(0))\n- 278 {\n- 279 size_t numFaces = ReferenceElements::general(type).size(1);\n- 280 const static int dofsPerElement = type.isCube() ? ((dim == 2) ? k*\n-(k+1)*dim : k*(k+1)*(k+1)*dim) : k*dim;\n- 281 const static int dofsPerFace = type.isCube() ? (dim-2)*2*k+k+1 : (dim-\n-1)*k+1 ;\n- 282 result = std::max(result, dofsPerElement + dofsPerFace * numFaces);\n- 283 }\n- 284\n- 285 return result;\n- 286 }\n- 287\n- 293 template\n-294 It indices(const Node& node, It it) const\n- 295 {\n- 296 const auto& gridIndexSet = gridView().indexSet();\n- 297 const auto& element = node.element();\n- 298\n- 299 // throw if Element is not of predefined type\n- 300 if (not(element.type().isCube()) and not(element.type().isSimplex()))\n- 301 DUNE_THROW(Dune::NotImplemented, \"RaviartThomasBasis only implemented for\n-cube and simplex elements.\");\n- 302\n- 303 for(std::size_t i=0, end=node.size(); i codimOffset_;\n-324 FiniteElementMap finiteElementMap_;\n- 325 // Number of dofs per entity type depending on the entity's codimension\n-and type\n-326 std::array dofsPerCodim_;\n- 327};\n- 328\n- 329\n- 330\n- 331template\n-332class RaviartThomasNode :\n- 333 public LeafBasisNode\n- 334{\n- 335 static const int dim = GV::dimension;\n- 336\n- 337public:\n- 338\n-339 using size_type = std::size_t;\n-340 using Element = typename GV::template Codim<0>::Entity;\n-341 using FiniteElementMap = typename Impl::\n-RaviartThomasLocalFiniteElementMap;\n-342 using FiniteElement = Impl::GlobalValuedLocalFiniteElement;\n- 345\n-346 RaviartThomasNode(const FiniteElementMap* finiteElementMap) :\n- 347 element_(nullptr),\n- 348 finiteElementMap_(finiteElementMap)\n- 349 { }\n- 350\n-352 const Element& element() const\n- 353 {\n- 354 return *element_;\n- 355 }\n- 356\n-361 const FiniteElement& finiteElement() const\n- 362 {\n- 363 return finiteElement_;\n- 364 }\n- 365\n-367 void bind(const Element& e)\n- 368 {\n- 369 element_ = &e;\n- 370 finiteElement_.bind((finiteElementMap_->find(*element_)), e);\n- 371 this->setSize(finiteElement_.size());\n- 372 }\n- 373\n- 374protected:\n- 375\n-376 FiniteElement finiteElement_;\n-377 const Element* element_;\n-378 const FiniteElementMap* finiteElementMap_;\n- 379};\n- 380\n- 381namespace BasisFactory {\n- 382\n- 390template\n-391auto raviartThomas()\n- 392{\n- 393 return [](const auto& gridView) {\n- 394 return RaviartThomasPreBasis, k>\n-(gridView);\n- 395 };\n- 396}\n- 397\n- 398} // end namespace BasisFactory\n- 399\n- 400\n- 401\n- 402/\n-/ *****************************************************************************\n- 403// This is the actual global basis implementation based on the reusable\n-parts.\n- 404/\n-/ *****************************************************************************\n- 405\n- 413template\n-414using RaviartThomasBasis = DefaultGlobalBasis\n->;\n- 415\n- 416} // end namespace Functions\n- 417} // end namespace Dune\n- 418\n- 419\n- 420#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RAVIARTTHOMASBASIS_HH\n-nodes.hh\n-defaultglobalbasis.hh\n-globalvaluedlocalfiniteelement.hh\n-Dune::Functions::BasisFactory::power\n-auto power(ChildPreBasisFactory &&childPreBasisFactory, const\n-IndexMergingStrategy &)\n-Create a pre-basis factory that can build a PowerPreBasis.\n-Definition: powerbasis.hh:369\n-Dune::Functions::BasisFactory::raviartThomas\n-auto raviartThomas()\n-Create a pre-basis factory that can create a Raviart-Thomas pre-basis.\n-Definition: raviartthomasbasis.hh:391\n+ 208\n+ 209\n+ 210#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH\n+type_traits.hh\n+defaultlocalview.hh\n+Dune::Functions::enableIfConstructible\n+typename std::enable_if< std::is_constructible< T, Args... >::value, int >::\n+type enableIfConstructible\n+Helper to constrain forwarding constructors.\n+Definition: type_traits.hh:26\n Dune\n Definition: polynomial.hh:10\n Dune::Functions::DefaultGlobalBasis\n+DefaultGlobalBasis(PreBasis &&) -> DefaultGlobalBasis< std::decay_t< PreBasis >\n+>\n+Dune::Functions::BasisFactory::makeBasis\n+auto makeBasis(const GridView &gridView, PreBasisFactory &&preBasisFactory)\n+Definition: defaultglobalbasis.hh:190\n+Dune::Functions::DefaultGlobalBasis\n Global basis for given pre-basis.\n Definition: defaultglobalbasis.hh:46\n-Dune::Functions::BasisNodeMixin::size\n-size_type size() const\n-Definition: nodes.hh:142\n-Dune::Functions::BasisNodeMixin::size_type\n+Dune::Functions::DefaultGlobalBasis::SizePrefix\n+Dune::ReservedVector< std::size_t, PreBasis::multiIndexBufferSize > SizePrefix\n+Type used for prefixes handed to the size() method.\n+Definition: defaultglobalbasis.hh:69\n+Dune::Functions::DefaultGlobalBasis::size_type\n std::size_t size_type\n-Definition: nodes.hh:128\n-Dune::Functions::BasisNodeMixin::setSize\n-void setSize(const size_type size)\n-Definition: nodes.hh:164\n-Dune::Functions::LeafBasisNode\n-Definition: nodes.hh:186\n-Dune::Functions::RaviartThomasNode\n-Definition: raviartthomasbasis.hh:334\n-Dune::Functions::RaviartThomasNode::FiniteElementMap\n-typename Impl::RaviartThomasLocalFiniteElementMap< GV, dim, double, k >\n-FiniteElementMap\n-Definition: raviartthomasbasis.hh:341\n-Dune::Functions::RaviartThomasNode::bind\n-void bind(const Element &e)\n-Bind to element.\n-Definition: raviartthomasbasis.hh:367\n-Dune::Functions::RaviartThomasNode::FiniteElement\n-Impl::GlobalValuedLocalFiniteElement< Impl::ContravariantPiolaTransformator,\n-typename FiniteElementMap::FiniteElement, Element > FiniteElement\n-Definition: raviartthomasbasis.hh:344\n-Dune::Functions::RaviartThomasNode::Element\n-typename GV::template Codim< 0 >::Entity Element\n-Definition: raviartthomasbasis.hh:340\n-Dune::Functions::RaviartThomasNode::element_\n-const Element * element_\n-Definition: raviartthomasbasis.hh:377\n-Dune::Functions::RaviartThomasNode::finiteElement\n-const FiniteElement & finiteElement() const\n-Return the LocalFiniteElement for the element we are bound to.\n-Definition: raviartthomasbasis.hh:361\n-Dune::Functions::RaviartThomasNode::RaviartThomasNode\n-RaviartThomasNode(const FiniteElementMap *finiteElementMap)\n-Definition: raviartthomasbasis.hh:346\n-Dune::Functions::RaviartThomasNode::element\n-const Element & element() const\n-Return current element, throw if unbound.\n-Definition: raviartthomasbasis.hh:352\n-Dune::Functions::RaviartThomasNode::finiteElement_\n-FiniteElement finiteElement_\n-Definition: raviartthomasbasis.hh:376\n-Dune::Functions::RaviartThomasNode::finiteElementMap_\n-const FiniteElementMap * finiteElementMap_\n-Definition: raviartthomasbasis.hh:378\n-Dune::Functions::RaviartThomasPreBasis\n-Definition: raviartthomasbasis.hh:192\n-Dune::Functions::RaviartThomasPreBasis::minMultiIndexSize\n-static constexpr size_type minMultiIndexSize\n-Definition: raviartthomasbasis.hh:205\n-Dune::Functions::RaviartThomasPreBasis::maxMultiIndexSize\n-static constexpr size_type maxMultiIndexSize\n-Definition: raviartthomasbasis.hh:204\n-Dune::Functions::RaviartThomasPreBasis::makeNode\n-Node makeNode() const\n-Create tree node.\n-Definition: raviartthomasbasis.hh:250\n-Dune::Functions::RaviartThomasPreBasis::dofsPerCodim_\n-std::array< int, dim+1 > dofsPerCodim_\n-Definition: raviartthomasbasis.hh:326\n-Dune::Functions::RaviartThomasPreBasis::update\n-void update(const GridView &gv)\n-Definition: raviartthomasbasis.hh:242\n-Dune::Functions::RaviartThomasPreBasis::RaviartThomasPreBasis\n-RaviartThomasPreBasis(const GridView &gv)\n-Constructor for a given grid view object.\n-Definition: raviartthomasbasis.hh:209\n-Dune::Functions::RaviartThomasPreBasis::size_type\n-std::size_t size_type\n-Definition: raviartthomasbasis.hh:200\n-Dune::Functions::RaviartThomasPreBasis::gridView\n+Type used for indices and size information.\n+Definition: defaultglobalbasis.hh:60\n+Dune::Functions::DefaultGlobalBasis::GridView\n+typename PreBasis::GridView GridView\n+The grid view that the FE space is defined on.\n+Definition: defaultglobalbasis.hh:57\n+Dune::Functions::DefaultGlobalBasis::gridView\n const GridView & gridView() const\n Obtain the grid view that the basis is defined on.\n-Definition: raviartthomasbasis.hh:236\n-Dune::Functions::RaviartThomasPreBasis::indices\n-It indices(const Node &node, It it) const\n-Maps from subtree index set [0..size-1] to a globally unique multi index in\n-global basis.\n-Definition: raviartthomasbasis.hh:294\n-Dune::Functions::RaviartThomasPreBasis::multiIndexBufferSize\n-static constexpr size_type multiIndexBufferSize\n-Definition: raviartthomasbasis.hh:206\n-Dune::Functions::RaviartThomasPreBasis::finiteElementMap_\n-FiniteElementMap finiteElementMap_\n-Definition: raviartthomasbasis.hh:324\n-Dune::Functions::RaviartThomasPreBasis::size\n-size_type size() const\n-Definition: raviartthomasbasis.hh:255\n-Dune::Functions::RaviartThomasPreBasis::dimension\n-size_type dimension() const\n-Definition: raviartthomasbasis.hh:269\n-Dune::Functions::RaviartThomasPreBasis::GridView\n-GV GridView\n-The grid view that the FE space is defined on.\n-Definition: raviartthomasbasis.hh:199\n-Dune::Functions::RaviartThomasPreBasis::maxNodeSize\n-size_type maxNodeSize() const\n-Definition: raviartthomasbasis.hh:274\n-Dune::Functions::RaviartThomasPreBasis::gridView_\n-GridView gridView_\n-Definition: raviartthomasbasis.hh:322\n-Dune::Functions::RaviartThomasPreBasis::size\n+Definition: defaultglobalbasis.hh:107\n+Dune::Functions::DefaultGlobalBasis::PreBasis\n+PB PreBasis\n+Pre-basis providing the implementation details.\n+Definition: defaultglobalbasis.hh:51\n+Dune::Functions::DefaultGlobalBasis::preBasis\n+PreBasis & preBasis()\n+Obtain the pre-basis providing the implementation details.\n+Definition: defaultglobalbasis.hh:119\n+Dune::Functions::DefaultGlobalBasis::update\n+void update(const GridView &gv)\n+Update the stored grid view.\n+Definition: defaultglobalbasis.hh:130\n+Dune::Functions::DefaultGlobalBasis::LocalView\n+DefaultLocalView< DefaultGlobalBasis< PreBasis > > LocalView\n+Type of the local view on the restriction of the basis to a single element.\n+Definition: defaultglobalbasis.hh:63\n+Dune::Functions::DefaultGlobalBasis::MultiIndex\n+typename LocalView::MultiIndex MultiIndex\n+Type used for global numbering of the basis vectors.\n+Definition: defaultglobalbasis.hh:66\n+Dune::Functions::DefaultGlobalBasis::size\n size_type size(const SizePrefix &prefix) const\n-Return number possible values for next position in multi index.\n-Definition: raviartthomasbasis.hh:262\n-Dune::Functions::RaviartThomasPreBasis::initializeIndices\n-void initializeIndices()\n-Definition: raviartthomasbasis.hh:228\n-Dune::Functions::RaviartThomasPreBasis::codimOffset_\n-std::array< size_t, dim+1 > codimOffset_\n-Definition: raviartthomasbasis.hh:323\n+Return number of possible values for next position in multi index.\n+Definition: defaultglobalbasis.hh:149\n+Dune::Functions::DefaultGlobalBasis::dimension\n+size_type dimension() const\n+Get the total dimension of the space spanned by this basis.\n+Definition: defaultglobalbasis.hh:137\n+Dune::Functions::DefaultGlobalBasis::preBasis_\n+PreBasis preBasis_\n+Definition: defaultglobalbasis.hh:173\n+Dune::Functions::DefaultGlobalBasis::localView\n+LocalView localView() const\n+Return local view for basis.\n+Definition: defaultglobalbasis.hh:155\n+Dune::Functions::DefaultGlobalBasis::PrefixPath\n+TypeTree::HybridTreePath<> PrefixPath\n+The empty prefix path that identifies the root in the local ansatz tree.\n+Definition: defaultglobalbasis.hh:54\n+Dune::Functions::DefaultGlobalBasis::DefaultGlobalBasis\n+DefaultGlobalBasis(T &&... t)\n+Constructor.\n+Definition: defaultglobalbasis.hh:82\n+Dune::Functions::DefaultGlobalBasis::DefaultGlobalBasis\n+DefaultGlobalBasis(const GridView &gridView, PreBasisFactory &&factory)\n+Constructor from a PreBasis factory.\n+Definition: defaultglobalbasis.hh:98\n+Dune::Functions::DefaultGlobalBasis::size\n+size_type size() const\n+Return number of possible values for next position in empty multi index.\n+Definition: defaultglobalbasis.hh:143\n+Dune::Functions::DefaultGlobalBasis::preBasis\n+const PreBasis & preBasis() const\n+Obtain the pre-basis providing the implementation details.\n+Definition: defaultglobalbasis.hh:113\n+Dune::Functions::DefaultGlobalBasis::prefixPath_\n+PrefixPath prefixPath_\n+Definition: defaultglobalbasis.hh:174\n+Dune::Functions::DefaultGlobalBasis::rootBasis\n+const DefaultGlobalBasis & rootBasis() const\n+Return *this because we are not embedded in a larger basis.\n+Definition: defaultglobalbasis.hh:161\n+Dune::Functions::DefaultGlobalBasis::prefixPath\n+const PrefixPath & prefixPath() const\n+Return empty path, because this is the root in the local ansatz tree.\n+Definition: defaultglobalbasis.hh:167\n+Dune::Functions::DefaultLocalView\n+The restriction of a finite element basis to a single element.\n+Definition: defaultlocalview.hh:28\n+Dune::Functions::DefaultLocalView::MultiIndex\n+std::conditional_t<(PreBasis::minMultiIndexSize==PreBasis::maxMultiIndexSize),\n+StaticMultiIndex< size_type, PreBasis::maxMultiIndexSize >, Dune::\n+ReservedVector< size_type, PreBasis::multiIndexBufferSize > > MultiIndex\n+Type used for global numbering of the basis vectors.\n+Definition: defaultlocalview.hh:64\n+concepts.hh\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00152.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00152.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: powerbasis.hh File Reference\n+dune-functions: nedelecbasis.hh File Reference\n \n \n \n \n \n \n \n@@ -65,57 +65,60 @@\n
  • dune
  • functions
  • functionspacebases
  • \n \n \n
    \n \n-
    powerbasis.hh File Reference
    \n+
    nedelecbasis.hh File Reference
    \n
    \n
    \n-
    #include <dune/common/reservedvector.hh>
    \n-#include <dune/common/typeutilities.hh>
    \n-#include <dune/common/indices.hh>
    \n-#include <dune/functions/common/utility.hh>
    \n-#include <dune/functions/common/type_traits.hh>
    \n-#include <dune/functions/functionspacebases/basistags.hh>
    \n-#include <dune/functions/functionspacebases/nodes.hh>
    \n-#include <dune/functions/functionspacebases/concepts.hh>
    \n-#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
    \n+
    #include <array>
    \n+#include <dune/common/exceptions.hh>
    \n+#include <dune/grid/common/capabilities.hh>
    \n+#include <dune/grid/common/mcmgmapper.hh>
    \n+#include <dune/localfunctions/common/localfiniteelementvariant.hh>
    \n+#include <dune/localfunctions/nedelec.hh>
    \n+#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
    \n+#include <dune/functions/functionspacebases/globalvaluedlocalfiniteelement.hh>
    \n+#include <dune/functions/functionspacebases/nodes.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n+\n+\n+\n \n

    \n Classes

    class  Dune::Functions::PowerPreBasis< IMS, SPB, C >
     A pre-basis for power bases. More...
    class  Dune::Functions::NedelecPreBasis< GV, Range, kind, order >
     
    class  Dune::Functions::NedelecNode< GV, Range, kind, order >
     
    \n \n \n \n \n \n \n \n-\n-\n+

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    namespace  Dune::Functions::BasisFactory
     
    namespace  Dune::Functions::BasisBuilder
     
    \n+\n+\n+\n+\n+\n

    \n+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\u00e9d\u00e9lec finite element space. More...
     
    \n \n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n

    \n Functions

    template<std::size_t k, class ChildPreBasisFactory , class IndexMergingStrategy >
    auto Dune::Functions::BasisFactory::power (ChildPreBasisFactory &&childPreBasisFactory, const IndexMergingStrategy &)
     Create a pre-basis factory that can build a PowerPreBasis. More...
     
    template<std::size_t k, class ChildPreBasisFactory >
    auto Dune::Functions::BasisFactory::power (ChildPreBasisFactory &&childPreBasisFactory)
     Create a factory builder that can build a PowerPreBasis. More...
     
    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\u00e9d\u00e9lec pre-basis. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "encoding", "source2": "encoding", "unified_diff": "@@ -1 +1 @@\n-us-ascii\n+utf-8\n"}, {"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,47 +5,46 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-Classes | Namespaces | Functions\n-powerbasis.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+Classes | Namespaces | Typedefs | Functions\n+nedelecbasis.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n #include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::PowerPreBasis<_IMS,_SPB,_C_>\n-\u00a0 A pre-basis for power bases. More...\n+class \u00a0Dune::Functions::NedelecPreBasis<_GV,_Range,_kind,_order_>\n+\u00a0\n+class \u00a0Dune::Functions::NedelecNode<_GV,_Range,_kind,_order_>\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n namespace \u00a0Dune::Functions::BasisFactory\n \u00a0\n-namespace \u00a0Dune::Functions::BasisBuilder\n+ Typedefs\n+template\n+using\u00a0Dune::Functions::NedelecBasis = DefaultGlobalBasis< NedelecPreBasis< GV,\n+ Range, kind, order > >\n+\u00a0 Basis of a k-th-order N\u00e9d\u00e9lec finite element space. More...\n \u00a0\n Functions\n-template\n-auto\u00a0Dune::Functions::BasisFactory::power (ChildPreBasisFactory\n- &&childPreBasisFactory, const IndexMergingStrategy &)\n-\u00a0 Create a pre-basis factory that can build a PowerPreBasis. More...\n-\u00a0\n-template\n-auto\u00a0Dune::Functions::BasisFactory::power (ChildPreBasisFactory\n- &&childPreBasisFactory)\n-\u00a0 Create a factory builder that can build a PowerPreBasis. More...\n+template\n+auto\u00a0Dune::Functions::BasisFactory::nedelec ()\n+\u00a0 Create a pre-basis factory that can create a N\u00e9d\u00e9lec pre-basis. More...\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00152_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00152_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: powerbasis.hh Source File\n+dune-functions: nedelecbasis.hh Source File\n \n \n \n \n \n \n \n@@ -62,406 +62,381 @@\n \n \n
    \n
    \n-
    powerbasis.hh
    \n+
    nedelecbasis.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH
    \n
    5
    \n-
    6#include <dune/common/reservedvector.hh>
    \n-
    7#include <dune/common/typeutilities.hh>
    \n-
    8#include <dune/common/indices.hh>
    \n-
    9
    \n-\n-\n-\n-\n-\n-\n-
    16
    \n-
    17
    \n+
    6#include <array>
    \n+
    7#include <dune/common/exceptions.hh>
    \n+
    8
    \n+
    9#include <dune/grid/common/capabilities.hh>
    \n+
    10#include <dune/grid/common/mcmgmapper.hh>
    \n+
    11
    \n+
    12#include <dune/localfunctions/common/localfiniteelementvariant.hh>
    \n+
    13#include <dune/localfunctions/nedelec.hh>
    \n+
    14
    \n+\n+\n+\n
    18
    \n-
    19namespace Dune {
    \n-
    20namespace Functions {
    \n+
    19namespace Dune::Functions
    \n+
    20{
    \n
    21
    \n-
    22
    \n-
    23// *****************************************************************************
    \n-
    24// This is the reusable part of the power bases. It contains
    \n-
    25//
    \n-
    26// PowerPreBasis
    \n-
    27//
    \n-
    28// The pre-basis allows to create the others and is the owner of possible shared
    \n-
    29// state. These components do _not_ depend on the global basis and local view
    \n-
    30// and can be used without a global basis.
    \n-
    31// *****************************************************************************
    \n+
    22namespace Impl
    \n+
    23{
    \n+
    24 template<typename GV, int dim, typename R, std::size_t order>
    \n+
    25 class Nedelec1stKindLocalFiniteElementMap
    \n+
    26 {
    \n+
    27 using D = typename GV::ctype;
    \n+
    28 constexpr static bool hasFixedElementType = Capabilities::hasSingleGeometryType<typename GV::Grid>::v;
    \n+
    29
    \n+
    30 using CubeFiniteElement = Nedelec1stKindCubeLocalFiniteElement<D,R,dim,order>;
    \n+
    31 using SimplexFiniteElement = Nedelec1stKindSimplexLocalFiniteElement<D,R,dim,order>;
    \n
    32
    \n-
    43template<class IMS, class SPB, std::size_t C>
    \n-\n-
    45{
    \n-
    46 static const std::size_t children = C;
    \n-
    47 static const bool isBlocked = std::is_same_v<IMS,BasisFactory::BlockedLexicographic> or std::is_same_v<IMS,BasisFactory::BlockedInterleaved>;
    \n+
    33 public:
    \n+
    34
    \n+
    35 using T = LocalBasisTraits<D, dim, FieldVector<D,dim>, R, dim, FieldVector<R,dim>, FieldMatrix<D,dim,dim> >;
    \n+
    36
    \n+
    37 constexpr static unsigned int topologyId = Capabilities::hasSingleGeometryType<typename GV::Grid>::topologyId; // meaningless if hasFixedElementType is false
    \n+
    38 constexpr static GeometryType type = GeometryType(topologyId, GV::dimension);
    \n+
    39
    \n+
    40 using FiniteElement = std::conditional_t<hasFixedElementType,
    \n+
    41 std::conditional_t<type.isCube(),CubeFiniteElement,SimplexFiniteElement>,
    \n+
    42 LocalFiniteElementVariant<CubeFiniteElement, SimplexFiniteElement> >;
    \n+
    43
    \n+
    44 static std::size_t numVariants(GeometryType type)
    \n+
    45 {
    \n+
    46 if (order!=1) // I am not sure whether the formula below is correct for all orders.
    \n+
    47 DUNE_THROW(NotImplemented, "Only Nedelec elements of order 1 are implemented!");
    \n
    48
    \n-
    49public:
    \n-
    50
    \n-
    52 using SubPreBasis = SPB;
    \n-
    53
    \n-
    55 using GridView = typename SPB::GridView;
    \n-
    56
    \n-
    58 using size_type = std::size_t;
    \n-
    59
    \n-\n-
    62
    \n-
    63 using SubNode = typename SubPreBasis::Node;
    \n-
    64
    \n-\n-
    67
    \n-
    68 static constexpr size_type maxMultiIndexSize = SubPreBasis::maxMultiIndexSize + isBlocked;
    \n-
    69 static constexpr size_type minMultiIndexSize = SubPreBasis::minMultiIndexSize + isBlocked;
    \n-
    70 static constexpr size_type multiIndexBufferSize = SubPreBasis::multiIndexBufferSize + isBlocked;
    \n-
    71
    \n-
    77 template<class... SFArgs,
    \n-
    78 disableCopyMove<PowerPreBasis, SFArgs...> = 0,
    \n-
    79 enableIfConstructible<SubPreBasis, SFArgs...> = 0>
    \n-
    80 PowerPreBasis(SFArgs&&... sfArgs) :
    \n-
    81 subPreBasis_(std::forward<SFArgs>(sfArgs)...)
    \n-
    82 {
    \n-
    83 static_assert(models<Concept::PreBasis<GridView>, SubPreBasis>(), "Subprebasis passed to PowerPreBasis does not model the PreBasis concept.");
    \n-
    84 }
    \n-
    85
    \n-\n-
    88 {
    \n-
    89 subPreBasis_.initializeIndices();
    \n-
    90 }
    \n-
    91
    \n-
    93 const GridView& gridView() const
    \n-
    94 {
    \n-
    95 return subPreBasis_.gridView();
    \n-
    96 }
    \n-
    97
    \n-
    99 void update(const GridView& gv)
    \n-
    100 {
    \n-
    101 subPreBasis_.update(gv);
    \n-
    102 }
    \n+
    49 auto numEdges = referenceElement<D,dim>(type).size(dim-1);
    \n+
    50 return power(2,numEdges);
    \n+
    51 }
    \n+
    52
    \n+
    53 Nedelec1stKindLocalFiniteElementMap(const GV& gv)
    \n+
    54 : elementMapper_(gv, mcmgElementLayout()),
    \n+
    55 orientation_(gv.size(0))
    \n+
    56 {
    \n+
    57 // create all variants
    \n+
    58 if constexpr (hasFixedElementType)
    \n+
    59 {
    \n+
    60 variants_.resize(numVariants(type));
    \n+
    61 for (size_t i = 0; i < numVariants(type); i++)
    \n+
    62 variants_[i] = FiniteElement(i);
    \n+
    63 }
    \n+
    64 else
    \n+
    65 {
    \n+
    66 // for mixed grids add offset for cubes
    \n+
    67 variants_.resize(numVariants(GeometryTypes::simplex(dim)) + numVariants(GeometryTypes::cube(dim)));
    \n+
    68 for (size_t i = 0; i < numVariants(GeometryTypes::simplex(dim)); i++)
    \n+
    69 variants_[i] = SimplexFiniteElement(i);
    \n+
    70 for (size_t i = 0; i < numVariants(GeometryTypes::cube(dim)); i++)
    \n+
    71 variants_[i + numVariants(GeometryTypes::simplex(dim))] = CubeFiniteElement(i);
    \n+
    72 }
    \n+
    73
    \n+
    74
    \n+
    75 // compute orientation for all elements
    \n+
    76 const auto& indexSet = gv.indexSet();
    \n+
    77
    \n+
    78 for(const auto& element : elements(gv))
    \n+
    79 {
    \n+
    80 const auto& refElement = referenceElement(element);
    \n+
    81 auto elementIndex = elementMapper_.index(element);
    \n+
    82 orientation_[elementIndex] = 0;
    \n+
    83
    \n+
    84 for (std::size_t i=0; i<element.subEntities(dim-1); i++)
    \n+
    85 {
    \n+
    86 // Local vertex indices within the element
    \n+
    87 auto localV0 = refElement.subEntity(i,dim-1, 0,dim);
    \n+
    88 auto localV1 = refElement.subEntity(i,dim-1, 1,dim);
    \n+
    89
    \n+
    90 // Global vertex indices within the grid
    \n+
    91 auto globalV0 = indexSet.subIndex(element,localV0,dim);
    \n+
    92 auto globalV1 = indexSet.subIndex(element,localV1,dim);
    \n+
    93
    \n+
    94 if ( (localV0<localV1 && globalV0>globalV1) || (localV0>localV1 && globalV0<globalV1) )
    \n+
    95 orientation_[elementIndex] |= (1 << i);
    \n+
    96 }
    \n+
    97 // for mixed grids add offset for cubes
    \n+
    98 if constexpr (!hasFixedElementType)
    \n+
    99 if (element.type().isCube())
    \n+
    100 orientation_[elementIndex] += numVariants(GeometryTypes::simplex(dim));
    \n+
    101 }
    \n+
    102 }
    \n
    103
    \n-\n-
    108 {
    \n-
    109 auto node = Node{};
    \n-
    110 for (std::size_t i=0; i<children; ++i)
    \n-
    111 node.setChild(i, subPreBasis_.makeNode());
    \n-
    112 return node;
    \n-
    113 }
    \n-
    114
    \n-\n-
    117 {
    \n-
    118 return size(Dune::ReservedVector<size_type, multiIndexBufferSize>{});
    \n-
    119 }
    \n-
    120
    \n-
    122
    \n-
    123 template<class SizePrefix>
    \n-
    124 size_type size(const SizePrefix& prefix) const
    \n-
    125 {
    \n-
    126 return size(prefix, IndexMergingStrategy{});
    \n-
    127 }
    \n-
    128
    \n-
    129private:
    \n+
    104 template<class Element>
    \n+
    105 const auto& find(const Element& element) const
    \n+
    106 {
    \n+
    107 return variants_[orientation_[elementMapper_.index(element)]];
    \n+
    108 }
    \n+
    109
    \n+
    110 private:
    \n+
    111 std::vector<FiniteElement> variants_;
    \n+
    112 const Dune::MultipleCodimMultipleGeomTypeMapper<GV> elementMapper_;
    \n+
    113 std::vector<unsigned short> orientation_;
    \n+
    114 };
    \n+
    115
    \n+
    116
    \n+
    117} // namespace Impl
    \n+
    118
    \n+
    119
    \n+
    120// *****************************************************************************
    \n+
    121// This is the reusable part of the basis. It contains
    \n+
    122//
    \n+
    123// NedelecPreBasis
    \n+
    124// NedelecNode
    \n+
    125//
    \n+
    126// The pre-basis allows to create the others and is the owner of possible shared
    \n+
    127// state. These components do _not_ depend on the global basis and local view
    \n+
    128// and can be used without a global basis.
    \n+
    129// *****************************************************************************
    \n
    130
    \n-
    131 template<class SizePrefix>
    \n-
    132 size_type size(const SizePrefix& prefix, BasisFactory::FlatInterleaved) const
    \n-
    133 {
    \n-
    134 // The root index size is the root index size of a single subnode
    \n-
    135 // multiplied by the number of subnodes because we enumerate all
    \n-
    136 // child indices in a row.
    \n-
    137 if (prefix.size() == 0)
    \n-
    138 return children*subPreBasis_.size();
    \n-
    139
    \n-
    140 // The first prefix entry refers to one of the (root index size)
    \n-
    141 // subindex trees. Hence we have to first compute the corresponding
    \n-
    142 // prefix entry for a single subnode subnode. The we can append
    \n-
    143 // the other prefix entries unmodified, because the index tree
    \n-
    144 // looks the same after the first level.
    \n-
    145 SizePrefix subPrefix;
    \n-
    146 subPrefix.push_back(prefix[0] / children);
    \n-
    147 for(std::size_t i=1; i<prefix.size(); ++i)
    \n-
    148 subPrefix.push_back(prefix[i]);
    \n-
    149 return subPreBasis_.size(subPrefix);
    \n-
    150 }
    \n-
    151
    \n-
    152 template<class SizePrefix>
    \n-
    153 size_type size(const SizePrefix& prefix, BasisFactory::FlatLexicographic) const
    \n-
    154 {
    \n-
    155 // The size at the index tree root is the size of at the index tree
    \n-
    156 // root of a single subnode multiplied by the number of subnodes
    \n-
    157 // because we enumerate all child indices in a row.
    \n-
    158 if (prefix.size() == 0)
    \n-
    159 return children*subPreBasis_.size();
    \n-
    160
    \n-
    161 // The first prefix entry refers to one of the (root index size)
    \n-
    162 // subindex trees. Hence we have to first compute the corresponding
    \n-
    163 // prefix entry for a single subnode subnode. The we can append
    \n-
    164 // the other prefix entries unmodified, because the index tree
    \n-
    165 // looks the same after the first level.
    \n-
    166 SizePrefix subPrefix;
    \n-
    167 subPrefix.push_back(prefix[0] % children);
    \n-
    168 for(std::size_t i=1; i<prefix.size(); ++i)
    \n-
    169 subPrefix.push_back(prefix[i]);
    \n-
    170 return subPreBasis_.size(subPrefix);
    \n-
    171 }
    \n-
    172
    \n-
    173 template<class SizePrefix>
    \n-
    174 size_type size(const SizePrefix& prefix, BasisFactory::BlockedLexicographic) const
    \n-
    175 {
    \n-
    176 if (prefix.size() == 0)
    \n-
    177 return children;
    \n-
    178 SizePrefix subPrefix;
    \n-
    179 for(std::size_t i=1; i<prefix.size(); ++i)
    \n-
    180 subPrefix.push_back(prefix[i]);
    \n-
    181 return subPreBasis_.size(subPrefix);
    \n-
    182 }
    \n-
    183
    \n-
    184 template<class SizePrefix>
    \n-
    185 size_type size(const SizePrefix& prefix, BasisFactory::BlockedInterleaved) const
    \n-
    186 {
    \n-
    187 if (prefix.size() == 0)
    \n-
    188 return subPreBasis_.size();
    \n-
    189
    \n-
    190 SizePrefix subPrefix;
    \n-
    191 for(std::size_t i=0; i<prefix.size()-1; ++i)
    \n-
    192 subPrefix.push_back(prefix[i]);
    \n-
    193
    \n-
    194 size_type r = subPreBasis_.size(subPrefix);
    \n-
    195 if (r==0)
    \n-
    196 return 0;
    \n-
    197 subPrefix.push_back(prefix.back());
    \n-
    198 r = subPreBasis_.size(subPrefix);
    \n-
    199 if (r==0)
    \n-
    200 return children;
    \n-
    201 return r;
    \n+
    131template<typename GV, typename Range, std::size_t kind, int order>
    \n+
    132class NedelecNode;
    \n+
    133
    \n+
    134template<typename GV, typename Range, std::size_t kind, int order>
    \n+\n+
    136{
    \n+
    137 static const int dim = GV::dimension;
    \n+
    138 static_assert(kind==1, "Only the Nedelec basis of the first kind is currently implemented!");
    \n+
    139 using FiniteElementMap = typename Impl::Nedelec1stKindLocalFiniteElementMap<GV, dim, Range, order>;
    \n+
    140
    \n+
    141 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper<GV>;
    \n+
    142public:
    \n+
    143
    \n+
    145 using GridView = GV;
    \n+
    146 using size_type = std::size_t;
    \n+
    147
    \n+\n+
    149
    \n+
    150 static constexpr size_type maxMultiIndexSize = 1;
    \n+
    151 static constexpr size_type minMultiIndexSize = 1;
    \n+
    152 static constexpr size_type multiIndexBufferSize = 1;
    \n+
    153
    \n+\n+
    156 gridView_(gv),
    \n+\n+
    158 mapper_(gridView_, mcmgLayout(Dim<1>{}))
    \n+
    159 {
    \n+
    160 if (kind!=1)
    \n+
    161 DUNE_THROW(NotImplemented, "Only Nedelec elements of the first kind are implemented!");
    \n+
    162
    \n+
    163 // There is no inherent reason why the basis shouldn't work for grids with more than two
    \n+
    164 // element types. Somebody simply has to sit down and implement the missing bits.
    \n+
    165 if (gv.indexSet().types(0).size() > 2)
    \n+
    166 DUNE_THROW(NotImplemented, "N\u00e9d\u00e9lec basis is only implemented for grids with simplex and cube elements");
    \n+
    167
    \n+
    168 for(auto type : gv.indexSet().types(0))
    \n+
    169 if (!type.isSimplex() && !type.isCube())
    \n+
    170 DUNE_THROW(NotImplemented, "N\u00e9d\u00e9lec basis is only implemented for grids with simplex or cube elements.");
    \n+
    171
    \n+
    172 if (order>1)
    \n+
    173 DUNE_THROW(NotImplemented, "Only first-order elements are implemented");
    \n+
    174
    \n+
    175 if (dim!=2 && dim!=3)
    \n+
    176 DUNE_THROW(NotImplemented, "Only 2d and 3d N\u00e9d\u00e9lec elements are implemented");
    \n+
    177 }
    \n+
    178
    \n+\n+
    180 {}
    \n+
    181
    \n+
    184 const GridView& gridView() const
    \n+
    185 {
    \n+
    186 return gridView_;
    \n+
    187 }
    \n+
    188
    \n+
    189 /* \\brief Update the stored grid view, to be called if the grid has changed */
    \n+
    190 void update (const GridView& gv)
    \n+
    191 {
    \n+
    192 gridView_ = gv;
    \n+
    193 mapper_.update(gridView_);
    \n+
    194 }
    \n+
    195
    \n+\n+
    200 {
    \n+
    201 return Node{&finiteElementMap_};
    \n
    202 }
    \n
    203
    \n-
    204public:
    \n-
    205
    \n-\n-
    208 {
    \n-
    209 return subPreBasis_.dimension() * children;
    \n-
    210 }
    \n-
    211
    \n-\n-
    214 {
    \n-
    215 return subPreBasis_.maxNodeSize() * children;
    \n-
    216 }
    \n-
    217
    \n-\n-
    220 {
    \n-
    221 return subPreBasis_;
    \n-
    222 }
    \n-
    223
    \n-\n-
    226 {
    \n-
    227 return subPreBasis_;
    \n-
    228 }
    \n-
    229
    \n-
    231 template<typename It>
    \n-
    232 It indices(const Node& node, It it) const
    \n-
    233 {
    \n-
    234 return indices(node, it, IndexMergingStrategy{});
    \n-
    235 }
    \n-
    236
    \n-
    237private:
    \n-
    238
    \n-
    239 template<typename It>
    \n-
    240 It indices(const Node& node, It multiIndices, BasisFactory::FlatInterleaved) const
    \n-
    241 {
    \n-
    242 using namespace Dune::Indices;
    \n-
    243 size_type subTreeSize = node.child(_0).size();
    \n-
    244 // Fill indices for first child at the beginning.
    \n-
    245 auto next = subPreBasis().indices(node.child(_0), multiIndices);
    \n-
    246 // Multiply first component of all indices for first child by
    \n-
    247 // number of children to stretch the index range for interleaving.
    \n-
    248 for (std::size_t i = 0; i<subTreeSize; ++i)
    \n-
    249 multiIndices[i][0] *= children;
    \n-
    250 for (std::size_t child = 1; child<children; ++child)
    \n-
    251 {
    \n-
    252 for (std::size_t i = 0; i<subTreeSize; ++i)
    \n-
    253 {
    \n-
    254 // Copy indices from first child for all other children
    \n-
    255 // and shift them by child index to interleave indices.
    \n-
    256 // multiIndices[child*subTreeSize+i] = multiIndices[i];
    \n-
    257 // multiIndices[child*subTreeSize+i][0] = multiIndices[i][0]+child;
    \n-
    258 (*next) = multiIndices[i];
    \n-
    259 (*next)[0] = multiIndices[i][0]+child;
    \n-
    260 ++next;
    \n-
    261 }
    \n-
    262 }
    \n-
    263 return next;
    \n-
    264 }
    \n-
    265
    \n-
    266 template<typename It>
    \n-
    267 It indices(const Node& node, It multiIndices, BasisFactory::FlatLexicographic) const
    \n-
    268 {
    \n-
    269 using namespace Dune::Indices;
    \n-
    270 size_type subTreeSize = node.child(_0).size();
    \n-
    271 size_type firstIndexEntrySize = subPreBasis().size();
    \n-
    272 // Fill indices for first child at the beginning.
    \n-
    273 auto next = subPreBasis().indices(node.child(_0), multiIndices);
    \n-
    274 for (std::size_t child = 1; child<children; ++child)
    \n-
    275 {
    \n-
    276 for (std::size_t i = 0; i<subTreeSize; ++i)
    \n-
    277 {
    \n-
    278 // Copy indices from first child for all other children
    \n-
    279 // and shift them by suitable offset to get lexicographic indices.
    \n-
    280 // multiIndices[child*subTreeSize+i] = multiIndices[i];
    \n-
    281 // multiIndices[child*subTreeSize+i][0] += child*firstIndexEntrySize;
    \n-
    282 (*next) = multiIndices[i];
    \n-
    283 (*next)[0] += child*firstIndexEntrySize;
    \n-
    284 ++next;
    \n-
    285 }
    \n-
    286 }
    \n-
    287 return next;
    \n+\n+
    205 {
    \n+
    206 return mapper_.size();
    \n+
    207 }
    \n+
    208
    \n+
    210 template<class SizePrefix>
    \n+
    211 size_type size(const SizePrefix& prefix) const
    \n+
    212 {
    \n+
    213 assert(prefix.size() == 0 || prefix.size() == 1);
    \n+
    214 return (prefix.size() == 0) ? size() : 0;
    \n+
    215 }
    \n+
    216
    \n+\n+
    218 {
    \n+
    219 return size();
    \n+
    220 }
    \n+
    221
    \n+\n+
    223 {
    \n+
    224 size_type result = 0;
    \n+
    225 for (auto&& type : gridView_.indexSet().types(0))
    \n+
    226 {
    \n+
    227 size_type numEdges = referenceElement<typename GV::ctype,dim>(type).size(dim-1);
    \n+
    228 result = std::max(result, numEdges);
    \n+
    229 }
    \n+
    230
    \n+
    231 return result;
    \n+
    232 }
    \n+
    233
    \n+
    237 template<typename It>
    \n+
    238 It indices(const Node& node, It it) const
    \n+
    239 {
    \n+
    240 const auto& element = node.element();
    \n+
    241
    \n+
    242 // throw if Element is not of predefined type
    \n+
    243 if (not(element.type().isCube()) and not(element.type().isSimplex()))
    \n+
    244 DUNE_THROW(NotImplemented, "NedelecBasis only implemented for cube and simplex elements.");
    \n+
    245
    \n+
    246 for(std::size_t i=0, end=node.size(); i<end; ++i, ++it)
    \n+
    247 {
    \n+
    248 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
    \n+
    249 *it = { mapper_.subIndex(element, localKey.subEntity(), localKey.codim()) + localKey.index() };
    \n+
    250 }
    \n+
    251
    \n+
    252 return it;
    \n+
    253 }
    \n+
    254
    \n+
    255protected:
    \n+\n+
    257 FiniteElementMap finiteElementMap_;
    \n+
    258 Mapper mapper_;
    \n+
    259};
    \n+
    260
    \n+
    261
    \n+
    262
    \n+
    263template<typename GV, typename Range, size_t kind, int order>
    \n+\n+
    265 public LeafBasisNode
    \n+
    266{
    \n+
    267 static const int dim = GV::dimension;
    \n+
    268
    \n+
    269public:
    \n+
    270
    \n+
    271 using size_type = std::size_t;
    \n+
    272 using Element = typename GV::template Codim<0>::Entity;
    \n+
    273 static_assert(kind==1, "Only Nedelec elements of the first kind are implemented!");
    \n+
    274 using FiniteElementMap = typename Impl::Nedelec1stKindLocalFiniteElementMap<GV, dim, Range, order>;
    \n+
    275 using FiniteElement = Impl::GlobalValuedLocalFiniteElement<Impl::CovariantPiolaTransformator,
    \n+
    276 typename FiniteElementMap::FiniteElement,
    \n+
    277 Element>;
    \n+
    278
    \n+
    279 NedelecNode(const FiniteElementMap* finiteElementMap) :
    \n+
    280 element_(nullptr),
    \n+
    281 finiteElementMap_(finiteElementMap)
    \n+
    282 { }
    \n+
    283
    \n+
    285 const Element& element() const
    \n+
    286 {
    \n+
    287 return *element_;
    \n
    288 }
    \n
    289
    \n-
    290 template<class MultiIndex>
    \n-
    291 static void multiIndexPushFront(MultiIndex& M, size_type M0)
    \n-
    292 {
    \n-
    293 M.resize(M.size()+1);
    \n-
    294 for(std::size_t i=M.size()-1; i>0; --i)
    \n-
    295 M[i] = M[i-1];
    \n-
    296 M[0] = M0;
    \n+\n+
    295 {
    \n+
    296 return finiteElement_;
    \n
    297 }
    \n
    298
    \n-
    299 template<typename It>
    \n-
    300 It indices(const Node& node, It multiIndices, BasisFactory::BlockedLexicographic) const
    \n-
    301 {
    \n-
    302 using namespace Dune::Indices;
    \n-
    303 size_type subTreeSize = node.child(_0).size();
    \n-
    304 // Fill indices for first child at the beginning.
    \n-
    305 auto next = subPreBasis().indices(node.child(_0), multiIndices);
    \n-
    306 // Insert 0 before first component of all indices for first child.
    \n-
    307 for (std::size_t i = 0; i<subTreeSize; ++i)
    \n-
    308 multiIndexPushFront(multiIndices[i], 0);
    \n-
    309 for (std::size_t child = 1; child<children; ++child)
    \n-
    310 {
    \n-
    311 for (std::size_t i = 0; i<subTreeSize; ++i)
    \n-
    312 {
    \n-
    313 // Copy indices from first child for all other children and overwrite
    \n-
    314 // zero in first component as inserted above by child index.
    \n-
    315 // multiIndices[child*subTreeSize+i] = multiIndices[i];
    \n-
    316 // multiIndices[child*subTreeSize+i][0] = child;
    \n-
    317 (*next) = multiIndices[i];
    \n-
    318 (*next)[0] = child;
    \n-
    319 ++next;
    \n-
    320 }
    \n-
    321 }
    \n-
    322 return next;
    \n-
    323 }
    \n-
    324
    \n-
    325 template<typename It>
    \n-
    326 It indices(const Node& node, It multiIndices, BasisFactory::BlockedInterleaved) const
    \n-
    327 {
    \n-
    328 using namespace Dune::Indices;
    \n-
    329 size_type subTreeSize = node.child(_0).size();
    \n-
    330 // Fill indices for first child at the beginning.
    \n-
    331 auto next = subPreBasis().indices(node.child(_0), multiIndices);
    \n-
    332 // Append 0 after last component of all indices for first child.
    \n-
    333 for (std::size_t i = 0; i<subTreeSize; ++i)
    \n-
    334 multiIndices[i].push_back(0);
    \n-
    335 for (std::size_t child = 1; child<children; ++child)
    \n-
    336 {
    \n-
    337 for (std::size_t i = 0; i<subTreeSize; ++i)
    \n-
    338 {
    \n-
    339 // Copy indices from first child for all other children and overwrite
    \n-
    340 // zero in last component as appended above by child index.
    \n-
    341 (*next) = multiIndices[i];
    \n-
    342 (*next).back() = child;
    \n-
    343 ++next;
    \n-
    344 }
    \n-
    345 }
    \n-
    346 return next;
    \n-
    347 }
    \n-
    348
    \n-
    349 SubPreBasis subPreBasis_;
    \n-
    350};
    \n-
    351
    \n+
    300 void bind(const Element& e)
    \n+
    301 {
    \n+
    302 element_ = &e;
    \n+
    303 finiteElement_.bind((finiteElementMap_->find(*element_)), e);
    \n+
    304 this->setSize(finiteElement_.size());
    \n+
    305 }
    \n+
    306
    \n+
    307protected:
    \n+
    308
    \n+\n+\n+\n+
    312};
    \n+
    313
    \n+
    314
    \n+
    315
    \n+
    316namespace BasisFactory {
    \n+
    317
    \n+
    327template<std::size_t kind, std::size_t order, typename Range=double>
    \n+\n+
    329{
    \n+
    330 return [](const auto& gridView) {
    \n+
    331 return NedelecPreBasis<std::decay_t<decltype(gridView)>, Range, kind, order>(gridView);
    \n+
    332 };
    \n+
    333}
    \n+
    334
    \n+
    335} // end namespace BasisFactory
    \n+
    336
    \n+
    337
    \n+
    338
    \n+
    339// *****************************************************************************
    \n+
    340// This is the actual global basis implementation based on the reusable parts.
    \n+
    341// *****************************************************************************
    \n+
    342
    \n+
    350template<typename GV, std::size_t kind, std::size_t order, typename Range=double>
    \n+\n
    352
    \n-
    353
    \n-
    354namespace BasisFactory {
    \n+
    353} // end namespace Dune::Functions
    \n+
    354
    \n
    355
    \n-
    368template<std::size_t k, class ChildPreBasisFactory, class IndexMergingStrategy>
    \n-
    369auto power(ChildPreBasisFactory&& childPreBasisFactory, const IndexMergingStrategy&)
    \n-
    370{
    \n-
    371 return [childPreBasisFactory](const auto& gridView) {
    \n-
    372 auto childPreBasis = childPreBasisFactory(gridView);
    \n-\n-
    374 };
    \n-
    375}
    \n-
    376
    \n-
    387template<std::size_t k, class ChildPreBasisFactory>
    \n-
    388auto power(ChildPreBasisFactory&& childPreBasisFactory)
    \n-
    389{
    \n-
    390 return [childPreBasisFactory](const auto& gridView) {
    \n-
    391 auto childPreBasis = childPreBasisFactory(gridView);
    \n-\n-
    393 };
    \n-
    394}
    \n-
    395
    \n-
    396} // end namespace BasisFactory
    \n-
    397
    \n-
    398// Backward compatibility
    \n-
    399namespace BasisBuilder {
    \n-
    400
    \n-
    401 using namespace BasisFactory;
    \n-
    402
    \n-
    403}
    \n-
    404
    \n-
    405
    \n-
    406} // end namespace Functions
    \n-
    407} // end namespace Dune
    \n-
    408
    \n-
    409
    \n-
    410#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH
    \n-\n-\n-\n-\n-\n-
    auto power(ChildPreBasisFactory &&childPreBasisFactory)
    Create a factory builder that can build a PowerPreBasis.
    Definition: powerbasis.hh:388
    \n-
    typename std::enable_if< std::is_constructible< T, Args... >::value, int >::type enableIfConstructible
    Helper to constrain forwarding constructors.
    Definition: type_traits.hh:26
    \n-
    Definition: polynomial.hh:10
    \n-
    Base class for index merging strategies to simplify detection.
    Definition: basistags.hh:44
    \n-
    Interleaved merging of direct children without blocking.
    Definition: basistags.hh:114
    \n-
    Definition: nodes.hh:193
    \n-
    A pre-basis for power bases.
    Definition: powerbasis.hh:45
    \n-
    size_type dimension() const
    Get the total dimension of the space spanned by this basis.
    Definition: powerbasis.hh:207
    \n-
    std::size_t size_type
    Type used for indices and size information.
    Definition: powerbasis.hh:58
    \n-
    IMS IndexMergingStrategy
    Strategy used to merge the global indices of the child factories.
    Definition: powerbasis.hh:61
    \n-
    PowerBasisNode< SubNode, children > Node
    Template mapping root tree path to type of created tree node.
    Definition: powerbasis.hh:66
    \n-
    typename SPB::GridView GridView
    The grid view that the FE basis is defined on.
    Definition: powerbasis.hh:55
    \n-
    static constexpr size_type multiIndexBufferSize
    Definition: powerbasis.hh:70
    \n-
    SPB SubPreBasis
    The child pre-basis.
    Definition: powerbasis.hh:52
    \n-
    typename SubPreBasis::Node SubNode
    Definition: powerbasis.hh:63
    \n-
    void initializeIndices()
    Initialize the global indices.
    Definition: powerbasis.hh:87
    \n-
    void update(const GridView &gv)
    Update the stored grid view, to be called if the grid has changed.
    Definition: powerbasis.hh:99
    \n-
    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
    \n-
    PowerPreBasis(SFArgs &&... sfArgs)
    Constructor for given child pre-basis objects.
    Definition: powerbasis.hh:80
    \n-
    size_type size() const
    Same as size(prefix) with empty prefix.
    Definition: powerbasis.hh:116
    \n-
    SubPreBasis & subPreBasis()
    Mutable access to the stored prebasis of the factor in the power space.
    Definition: powerbasis.hh:225
    \n-
    Node makeNode() const
    Create tree node.
    Definition: powerbasis.hh:107
    \n-
    static constexpr size_type maxMultiIndexSize
    Definition: powerbasis.hh:68
    \n-
    static constexpr size_type minMultiIndexSize
    Definition: powerbasis.hh:69
    \n-
    size_type maxNodeSize() const
    Get the maximal number of DOFs associated to node for any element.
    Definition: powerbasis.hh:213
    \n-
    const GridView & gridView() const
    Obtain the grid view that the basis is defined on.
    Definition: powerbasis.hh:93
    \n-
    size_type size(const SizePrefix &prefix) const
    Return number of possible values for next position in multi index.
    Definition: powerbasis.hh:124
    \n-
    const SubPreBasis & subPreBasis() const
    Const access to the stored prebasis of the factor in the power space.
    Definition: powerbasis.hh:219
    \n-\n+
    356#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH
    \n+\n+\n+\n+
    auto power(ChildPreBasisFactory &&childPreBasisFactory, const IndexMergingStrategy &)
    Create a pre-basis factory that can build a PowerPreBasis.
    Definition: powerbasis.hh:369
    \n+
    auto nedelec()
    Create a pre-basis factory that can create a N\u00e9d\u00e9lec pre-basis.
    Definition: nedelecbasis.hh:328
    \n+
    Definition: polynomial.hh:11
    \n+
    Global basis for given pre-basis.
    Definition: defaultglobalbasis.hh:46
    \n+
    Definition: nedelecbasis.hh:266
    \n+
    const FiniteElementMap * finiteElementMap_
    Definition: nedelecbasis.hh:311
    \n+
    FiniteElement finiteElement_
    Definition: nedelecbasis.hh:309
    \n+
    Impl::GlobalValuedLocalFiniteElement< Impl::CovariantPiolaTransformator, typename FiniteElementMap::FiniteElement, Element > FiniteElement
    Definition: nedelecbasis.hh:277
    \n+
    void bind(const Element &e)
    Bind to element.
    Definition: nedelecbasis.hh:300
    \n+
    const Element & element() const
    Return current element, throw if unbound.
    Definition: nedelecbasis.hh:285
    \n+
    typename GV::template Codim< 0 >::Entity Element
    Definition: nedelecbasis.hh:272
    \n+
    const FiniteElement & finiteElement() const
    Return the LocalFiniteElement for the element we are bound to.
    Definition: nedelecbasis.hh:294
    \n+
    NedelecNode(const FiniteElementMap *finiteElementMap)
    Definition: nedelecbasis.hh:279
    \n+
    typename Impl::Nedelec1stKindLocalFiniteElementMap< GV, dim, Range, order > FiniteElementMap
    Definition: nedelecbasis.hh:274
    \n+
    const Element * element_
    Definition: nedelecbasis.hh:310
    \n+
    std::size_t size_type
    Definition: nedelecbasis.hh:271
    \n+
    Definition: nedelecbasis.hh:136
    \n+
    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
    \n+
    size_type size(const SizePrefix &prefix) const
    Return number possible values for next position in multi index.
    Definition: nedelecbasis.hh:211
    \n+
    std::size_t size_type
    Definition: nedelecbasis.hh:146
    \n+
    NedelecPreBasis(const GridView &gv)
    Constructor for a given grid view object.
    Definition: nedelecbasis.hh:155
    \n+
    GV GridView
    The grid view that the FE space is defined on.
    Definition: nedelecbasis.hh:145
    \n+
    size_type dimension() const
    Definition: nedelecbasis.hh:217
    \n+
    static constexpr size_type maxMultiIndexSize
    Definition: nedelecbasis.hh:150
    \n+
    static constexpr size_type multiIndexBufferSize
    Definition: nedelecbasis.hh:152
    \n+
    GridView gridView_
    Definition: nedelecbasis.hh:256
    \n+
    FiniteElementMap finiteElementMap_
    Definition: nedelecbasis.hh:257
    \n+
    static constexpr size_type minMultiIndexSize
    Definition: nedelecbasis.hh:151
    \n+
    void initializeIndices()
    Definition: nedelecbasis.hh:179
    \n+
    void update(const GridView &gv)
    Definition: nedelecbasis.hh:190
    \n+
    size_type maxNodeSize() const
    Definition: nedelecbasis.hh:222
    \n+
    const GridView & gridView() const
    Obtain the grid view that the basis is defined on.
    Definition: nedelecbasis.hh:184
    \n+
    Node makeNode() const
    Create tree node.
    Definition: nedelecbasis.hh:199
    \n+
    size_type size() const
    Definition: nedelecbasis.hh:204
    \n+
    Mapper mapper_
    Definition: nedelecbasis.hh:258
    \n+
    size_type size() const
    Definition: nodes.hh:142
    \n+
    void setSize(const size_type size)
    Definition: nodes.hh:164
    \n+
    Definition: nodes.hh:186
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "encoding", "source2": "encoding", "unified_diff": "@@ -1 +1 @@\n-us-ascii\n+utf-8\n"}, {"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,497 +5,502 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-powerbasis.hh\n+nedelecbasis.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH\n 5\n- 6#include \n- 7#include \n- 8#include \n- 9\n- 10#include \n- 11#include \n- 12#include \n- 13#include \n- 14#include \n+ 6#include \n+ 7#include \n+ 8\n+ 9#include \n+ 10#include \n+ 11\n+ 12#include \n+ 13#include \n+ 14\n 15#include \n- 16\n- 17\n+ 16#include \n+ 17#include \n 18\n- 19namespace Dune {\n- 20namespace Functions {\n+ 19namespace Dune::Functions\n+ 20{\n 21\n- 22\n- 23/\n-/ *****************************************************************************\n- 24// This is the reusable part of the power bases. It contains\n- 25//\n- 26// PowerPreBasis\n- 27//\n- 28// The pre-basis allows to create the others and is the owner of possible\n-shared\n- 29// state. These components do _not_ depend on the global basis and local\n-view\n- 30// and can be used without a global basis.\n- 31/\n-/ *****************************************************************************\n+ 22namespace Impl\n+ 23{\n+ 24 template\n+ 25 class Nedelec1stKindLocalFiniteElementMap\n+ 26 {\n+ 27 using D = typename GV::ctype;\n+ 28 constexpr static bool hasFixedElementType = Capabilities::\n+hasSingleGeometryType::v;\n+ 29\n+ 30 using CubeFiniteElement =\n+Nedelec1stKindCubeLocalFiniteElement;\n+ 31 using SimplexFiniteElement =\n+Nedelec1stKindSimplexLocalFiniteElement;\n 32\n- 43template\n-44class PowerPreBasis\n- 45{\n- 46 static const std::size_t children = C;\n- 47 static const bool isBlocked = std::is_same_v or std::is_same_v;\n+ 33 public:\n+ 34\n+ 35 using T = LocalBasisTraits, R, dim,\n+FieldVector, FieldMatrix >;\n+ 36\n+ 37 constexpr static unsigned int topologyId = Capabilities::\n+hasSingleGeometryType::topologyId; // meaningless if\n+hasFixedElementType is false\n+ 38 constexpr static GeometryType type = GeometryType(topologyId, GV::\n+dimension);\n+ 39\n+ 40 using FiniteElement = std::conditional_t,\n+ 42 LocalFiniteElementVariant >;\n+ 43\n+ 44 static std::size_t numVariants(GeometryType type)\n+ 45 {\n+ 46 if (order!=1) // I am not sure whether the formula below is correct for all\n+orders.\n+ 47 DUNE_THROW(NotImplemented, \"Only Nedelec elements of order 1 are\n+implemented!\");\n 48\n- 49public:\n- 50\n-52 using SubPreBasis = SPB;\n- 53\n-55 using GridView = typename SPB::GridView;\n- 56\n-58 using size_type = std::size_t;\n- 59\n-61 using IndexMergingStrategy = IMS;\n- 62\n-63 using SubNode = typename SubPreBasis::Node;\n- 64\n-66 using Node = PowerBasisNode;\n- 67\n-68 static constexpr size_type maxMultiIndexSize = SubPreBasis::\n-maxMultiIndexSize + isBlocked;\n-69 static constexpr size_type minMultiIndexSize = SubPreBasis::\n-minMultiIndexSize + isBlocked;\n-70 static constexpr size_type multiIndexBufferSize = SubPreBasis::\n-multiIndexBufferSize + isBlocked;\n- 71\n- 77 template = 0,\n- 79 enableIfConstructible = 0>\n-80 PowerPreBasis(SFArgs&&... sfArgs) :\n- 81 subPreBasis_(std::forward(sfArgs)...)\n- 82 {\n- 83 static_assert(models, SubPreBasis>(),\n-\"Subprebasis passed to PowerPreBasis does not model the PreBasis concept.\");\n- 84 }\n- 85\n-87 void initializeIndices()\n- 88 {\n- 89 subPreBasis_.initializeIndices();\n- 90 }\n- 91\n-93 const GridView& gridView() const\n- 94 {\n- 95 return subPreBasis_.gridView();\n+ 49 auto numEdges = referenceElement(type).size(dim-1);\n+ 50 return power(2,numEdges);\n+ 51 }\n+ 52\n+ 53 Nedelec1stKindLocalFiniteElementMap(const GV& gv)\n+ 54 : elementMapper_(gv, mcmgElementLayout()),\n+ 55 orientation_(gv.size(0))\n+ 56 {\n+ 57 // create all variants\n+ 58 if constexpr (hasFixedElementType)\n+ 59 {\n+ 60 variants_.resize(numVariants(type));\n+ 61 for (size_t i = 0; i < numVariants(type); i++)\n+ 62 variants_[i] = FiniteElement(i);\n+ 63 }\n+ 64 else\n+ 65 {\n+ 66 // for mixed grids add offset for cubes\n+ 67 variants_.resize(numVariants(GeometryTypes::simplex(dim)) + numVariants\n+(GeometryTypes::cube(dim)));\n+ 68 for (size_t i = 0; i < numVariants(GeometryTypes::simplex(dim)); i++)\n+ 69 variants_[i] = SimplexFiniteElement(i);\n+ 70 for (size_t i = 0; i < numVariants(GeometryTypes::cube(dim)); i++)\n+ 71 variants_[i + numVariants(GeometryTypes::simplex(dim))] = CubeFiniteElement\n+(i);\n+ 72 }\n+ 73\n+ 74\n+ 75 // compute orientation for all elements\n+ 76 const auto& indexSet = gv.indexSet();\n+ 77\n+ 78 for(const auto& element : elements(gv))\n+ 79 {\n+ 80 const auto& refElement = referenceElement(element);\n+ 81 auto elementIndex = elementMapper_.index(element);\n+ 82 orientation_[elementIndex] = 0;\n+ 83\n+ 84 for (std::size_t i=0; iglobalV1) || (localV0>localV1 &&\n+globalV0{});\n- 119 }\n- 120\n- 122\n- 123 template\n-124 size_type size(const SizePrefix& prefix) const\n- 125 {\n- 126 return size(prefix, IndexMergingStrategy{});\n- 127 }\n- 128\n- 129private:\n+ 104 template\n+ 105 const auto& find(const Element& element) const\n+ 106 {\n+ 107 return variants_[orientation_[elementMapper_.index(element)]];\n+ 108 }\n+ 109\n+ 110 private:\n+ 111 std::vector variants_;\n+ 112 const Dune::MultipleCodimMultipleGeomTypeMapper elementMapper_;\n+ 113 std::vector orientation_;\n+ 114 };\n+ 115\n+ 116\n+ 117} // namespace Impl\n+ 118\n+ 119\n+ 120/\n+/ *****************************************************************************\n+ 121// This is the reusable part of the basis. It contains\n+ 122//\n+ 123// NedelecPreBasis\n+ 124// NedelecNode\n+ 125//\n+ 126// The pre-basis allows to create the others and is the owner of possible\n+shared\n+ 127// state. These components do _not_ depend on the global basis and local\n+view\n+ 128// and can be used without a global basis.\n+ 129/\n+/ *****************************************************************************\n 130\n- 131 template\n- 132 size_type size(const SizePrefix& prefix, BasisFactory::FlatInterleaved)\n-const\n- 133 {\n- 134 // The root index size is the root index size of a single subnode\n- 135 // multiplied by the number of subnodes because we enumerate all\n- 136 // child indices in a row.\n- 137 if (prefix.size() == 0)\n- 138 return children*subPreBasis_.size();\n- 139\n- 140 // The first prefix entry refers to one of the (root index size)\n- 141 // subindex trees. Hence we have to first compute the corresponding\n- 142 // prefix entry for a single subnode subnode. The we can append\n- 143 // the other prefix entries unmodified, because the index tree\n- 144 // looks the same after the first level.\n- 145 SizePrefix subPrefix;\n- 146 subPrefix.push_back(prefix[0] / children);\n- 147 for(std::size_t i=1; i\n- 153 size_type size(const SizePrefix& prefix, BasisFactory::FlatLexicographic)\n-const\n- 154 {\n- 155 // The size at the index tree root is the size of at the index tree\n- 156 // root of a single subnode multiplied by the number of subnodes\n- 157 // because we enumerate all child indices in a row.\n- 158 if (prefix.size() == 0)\n- 159 return children*subPreBasis_.size();\n- 160\n- 161 // The first prefix entry refers to one of the (root index size)\n- 162 // subindex trees. Hence we have to first compute the corresponding\n- 163 // prefix entry for a single subnode subnode. The we can append\n- 164 // the other prefix entries unmodified, because the index tree\n- 165 // looks the same after the first level.\n- 166 SizePrefix subPrefix;\n- 167 subPrefix.push_back(prefix[0] % children);\n- 168 for(std::size_t i=1; i\n- 174 size_type size(const SizePrefix& prefix, BasisFactory::\n-BlockedLexicographic) const\n- 175 {\n- 176 if (prefix.size() == 0)\n- 177 return children;\n- 178 SizePrefix subPrefix;\n- 179 for(std::size_t i=1; i\n- 185 size_type size(const SizePrefix& prefix, BasisFactory::BlockedInterleaved)\n-const\n- 186 {\n- 187 if (prefix.size() == 0)\n- 188 return subPreBasis_.size();\n- 189\n- 190 SizePrefix subPrefix;\n- 191 for(std::size_t i=0; i\n+ 132class NedelecNode;\n+ 133\n+ 134template\n+135class NedelecPreBasis\n+ 136{\n+ 137 static const int dim = GV::dimension;\n+ 138 static_assert(kind==1, \"Only the Nedelec basis of the first kind is\n+currently implemented!\");\n+ 139 using FiniteElementMap = typename Impl::\n+Nedelec1stKindLocalFiniteElementMap;\n+ 140\n+ 141 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper;\n+ 142public:\n+ 143\n+145 using GridView = GV;\n+146 using size_type = std::size_t;\n+ 147\n+148 using Node = NedelecNode;\n+ 149\n+150 static constexpr size_type maxMultiIndexSize = 1;\n+151 static constexpr size_type minMultiIndexSize = 1;\n+152 static constexpr size_type multiIndexBufferSize = 1;\n+ 153\n+155 NedelecPreBasis(const GridView& gv) :\n+ 156 gridView_(gv),\n+ 157 finiteElementMap_(gv),\n+ 158 mapper_(gridView_, mcmgLayout(Dim<1>{}))\n+ 159 {\n+ 160 if (kind!=1)\n+ 161 DUNE_THROW(NotImplemented, \"Only Nedelec elements of the first kind are\n+implemented!\");\n+ 162\n+ 163 // There is no inherent reason why the basis shouldn't work for grids with\n+more than two\n+ 164 // element types. Somebody simply has to sit down and implement the\n+missing bits.\n+ 165 if (gv.indexSet().types(0).size() > 2)\n+ 166 DUNE_THROW(NotImplemented, \"N\u00e9d\u00e9lec basis is only implemented for grids\n+with simplex and cube elements\");\n+ 167\n+ 168 for(auto type : gv.indexSet().types(0))\n+ 169 if (!type.isSimplex() && !type.isCube())\n+ 170 DUNE_THROW(NotImplemented, \"N\u00e9d\u00e9lec basis is only implemented for grids\n+with simplex or cube elements.\");\n+ 171\n+ 172 if (order>1)\n+ 173 DUNE_THROW(NotImplemented, \"Only first-order elements are implemented\");\n+ 174\n+ 175 if (dim!=2 && dim!=3)\n+ 176 DUNE_THROW(NotImplemented, \"Only 2d and 3d N\u00e9d\u00e9lec elements are\n+implemented\");\n+ 177 }\n+ 178\n+179 void initializeIndices()\n+ 180 {}\n+ 181\n+184 const GridView& gridView() const\n+ 185 {\n+ 186 return gridView_;\n+ 187 }\n+ 188\n+ 189 /* \\brief Update the stored grid view, to be called if the grid has\n+changed */\n+190 void update (const GridView& gv)\n+ 191 {\n+ 192 gridView_ = gv;\n+ 193 mapper_.update(gridView_);\n+ 194 }\n+ 195\n+199 Node makeNode() const\n+ 200 {\n+ 201 return Node{&finiteElementMap_};\n 202 }\n 203\n- 204public:\n- 205\n-207 size_type dimension() const\n- 208 {\n- 209 return subPreBasis_.dimension() * children;\n- 210 }\n- 211\n-213 size_type maxNodeSize() const\n- 214 {\n- 215 return subPreBasis_.maxNodeSize() * children;\n- 216 }\n- 217\n-219 const SubPreBasis& subPreBasis() const\n- 220 {\n- 221 return subPreBasis_;\n- 222 }\n- 223\n-225 SubPreBasis& subPreBasis()\n+204 size_type size() const\n+ 205 {\n+ 206 return mapper_.size();\n+ 207 }\n+ 208\n+ 210 template\n+211 size_type size(const SizePrefix& prefix) const\n+ 212 {\n+ 213 assert(prefix.size() == 0 || prefix.size() == 1);\n+ 214 return (prefix.size() == 0) ? size() : 0;\n+ 215 }\n+ 216\n+217 size_type dimension() const\n+ 218 {\n+ 219 return size();\n+ 220 }\n+ 221\n+222 size_type maxNodeSize() const\n+ 223 {\n+ 224 size_type result = 0;\n+ 225 for (auto&& type : gridView_.indexSet().types(0))\n 226 {\n- 227 return subPreBasis_;\n- 228 }\n- 229\n- 231 template\n-232 It indices(const Node& node, It it) const\n- 233 {\n- 234 return indices(node, it, IndexMergingStrategy{});\n- 235 }\n- 236\n- 237private:\n- 238\n- 239 template\n- 240 It indices(const Node& node, It multiIndices, BasisFactory::\n-FlatInterleaved) const\n- 241 {\n- 242 using namespace Dune::Indices;\n- 243 size_type subTreeSize = node.child(_0).size();\n- 244 // Fill indices for first child at the beginning.\n- 245 auto next = subPreBasis().indices(node.child(_0), multiIndices);\n- 246 // Multiply first component of all indices for first child by\n- 247 // number of children to stretch the index range for interleaving.\n- 248 for (std::size_t i = 0; i\n- 267 It indices(const Node& node, It multiIndices, BasisFactory::\n-FlatLexicographic) const\n- 268 {\n- 269 using namespace Dune::Indices;\n- 270 size_type subTreeSize = node.child(_0).size();\n- 271 size_type firstIndexEntrySize = subPreBasis().size();\n- 272 // Fill indices for first child at the beginning.\n- 273 auto next = subPreBasis().indices(node.child(_0), multiIndices);\n- 274 for (std::size_t child = 1; child(type).size\n+(dim-1);\n+ 228 result = std::max(result, numEdges);\n+ 229 }\n+ 230\n+ 231 return result;\n+ 232 }\n+ 233\n+ 237 template\n+238 It indices(const Node& node, It it) const\n+ 239 {\n+ 240 const auto& element = node.element();\n+ 241\n+ 242 // throw if Element is not of predefined type\n+ 243 if (not(element.type().isCube()) and not(element.type().isSimplex()))\n+ 244 DUNE_THROW(NotImplemented, \"NedelecBasis only implemented for cube and\n+simplex elements.\");\n+ 245\n+ 246 for(std::size_t i=0, end=node.size(); i\n+264class NedelecNode :\n+ 265 public LeafBasisNode\n+ 266{\n+ 267 static const int dim = GV::dimension;\n+ 268\n+ 269public:\n+ 270\n+271 using size_type = std::size_t;\n+272 using Element = typename GV::template Codim<0>::Entity;\n+ 273 static_assert(kind==1, \"Only Nedelec elements of the first kind are\n+implemented!\");\n+274 using FiniteElementMap = typename Impl::\n+Nedelec1stKindLocalFiniteElementMap;\n+275 using FiniteElement = Impl::GlobalValuedLocalFiniteElement;\n+ 278\n+279 NedelecNode(const FiniteElementMap* finiteElementMap) :\n+ 280 element_(nullptr),\n+ 281 finiteElementMap_(finiteElementMap)\n+ 282 { }\n+ 283\n+285 const Element& element() const\n+ 286 {\n+ 287 return *element_;\n 288 }\n 289\n- 290 template\n- 291 static void multiIndexPushFront(MultiIndex& M, size_type M0)\n- 292 {\n- 293 M.resize(M.size()+1);\n- 294 for(std::size_t i=M.size()-1; i>0; --i)\n- 295 M[i] = M[i-1];\n- 296 M[0] = M0;\n+294 const FiniteElement& finiteElement() const\n+ 295 {\n+ 296 return finiteElement_;\n 297 }\n 298\n- 299 template\n- 300 It indices(const Node& node, It multiIndices, BasisFactory::\n-BlockedLexicographic) const\n+300 void bind(const Element& e)\n 301 {\n- 302 using namespace Dune::Indices;\n- 303 size_type subTreeSize = node.child(_0).size();\n- 304 // Fill indices for first child at the beginning.\n- 305 auto next = subPreBasis().indices(node.child(_0), multiIndices);\n- 306 // Insert 0 before first component of all indices for first child.\n- 307 for (std::size_t i = 0; i\n- 326 It indices(const Node& node, It multiIndices, BasisFactory::\n-BlockedInterleaved) const\n- 327 {\n- 328 using namespace Dune::Indices;\n- 329 size_type subTreeSize = node.child(_0).size();\n- 330 // Fill indices for first child at the beginning.\n- 331 auto next = subPreBasis().indices(node.child(_0), multiIndices);\n- 332 // Append 0 after last component of all indices for first child.\n- 333 for (std::size_t i = 0; ifind(*element_)), e);\n+ 304 this->setSize(finiteElement_.size());\n+ 305 }\n+ 306\n+ 307protected:\n+ 308\n+309 FiniteElement finiteElement_;\n+310 const Element* element_;\n+311 const FiniteElementMap* finiteElementMap_;\n+ 312};\n+ 313\n+ 314\n+ 315\n+ 316namespace BasisFactory {\n+ 317\n+ 327template\n+328auto nedelec()\n+ 329{\n+ 330 return [](const auto& gridView) {\n+ 331 return NedelecPreBasis, Range, kind,\n+order>(gridView);\n+ 332 };\n+ 333}\n+ 334\n+ 335} // end namespace BasisFactory\n+ 336\n+ 337\n+ 338\n+ 339/\n+/ *****************************************************************************\n+ 340// This is the actual global basis implementation based on the reusable\n+parts.\n+ 341/\n+/ *****************************************************************************\n+ 342\n+ 350template\n+351using NedelecBasis = DefaultGlobalBasis >;\n 352\n- 353\n- 354namespace BasisFactory {\n+ 353} // end namespace Dune::Functions\n+ 354\n 355\n- 368template\n-369auto power(ChildPreBasisFactory&& childPreBasisFactory, const\n-IndexMergingStrategy&)\n- 370{\n- 371 return [childPreBasisFactory](const auto& gridView) {\n- 372 auto childPreBasis = childPreBasisFactory(gridView);\n- 373 return PowerPreBasis\n-(std::move(childPreBasis));\n- 374 };\n- 375}\n- 376\n- 387template\n-388auto power(ChildPreBasisFactory&& childPreBasisFactory)\n- 389{\n- 390 return [childPreBasisFactory](const auto& gridView) {\n- 391 auto childPreBasis = childPreBasisFactory(gridView);\n- 392 return PowerPreBasis(std::\n-move(childPreBasis));\n- 393 };\n- 394}\n- 395\n- 396} // end namespace BasisFactory\n- 397\n- 398// Backward compatibility\n- 399namespace BasisBuilder {\n- 400\n- 401 using namespace BasisFactory;\n- 402\n- 403}\n- 404\n- 405\n- 406} // end namespace Functions\n- 407} // end namespace Dune\n- 408\n- 409\n- 410#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_POWERBASIS_HH\n-type_traits.hh\n-utility.hh\n+ 356#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_NEDELECBASIS_HH\n nodes.hh\n defaultglobalbasis.hh\n-basistags.hh\n+globalvaluedlocalfiniteelement.hh\n Dune::Functions::BasisFactory::power\n-auto power(ChildPreBasisFactory &&childPreBasisFactory)\n-Create a factory builder that can build a PowerPreBasis.\n-Definition: powerbasis.hh:388\n-Dune::Functions::enableIfConstructible\n-typename std::enable_if< std::is_constructible< T, Args... >::value, int >::\n-type enableIfConstructible\n-Helper to constrain forwarding constructors.\n-Definition: type_traits.hh:26\n-Dune\n-Definition: polynomial.hh:10\n-Dune::Functions::BasisFactory::IndexMergingStrategy\n-Base class for index merging strategies to simplify detection.\n-Definition: basistags.hh:44\n-Dune::Functions::BasisFactory::FlatInterleaved\n-Interleaved merging of direct children without blocking.\n-Definition: basistags.hh:114\n-Dune::Functions::PowerBasisNode\n-Definition: nodes.hh:193\n-Dune::Functions::PowerPreBasis\n-A pre-basis for power bases.\n-Definition: powerbasis.hh:45\n-Dune::Functions::PowerPreBasis::dimension\n-size_type dimension() const\n-Get the total dimension of the space spanned by this basis.\n-Definition: powerbasis.hh:207\n-Dune::Functions::PowerPreBasis::size_type\n+auto power(ChildPreBasisFactory &&childPreBasisFactory, const\n+IndexMergingStrategy &)\n+Create a pre-basis factory that can build a PowerPreBasis.\n+Definition: powerbasis.hh:369\n+Dune::Functions::BasisFactory::nedelec\n+auto nedelec()\n+Create a pre-basis factory that can create a N\u00e9d\u00e9lec pre-basis.\n+Definition: nedelecbasis.hh:328\n+Dune::Functions\n+Definition: polynomial.hh:11\n+Dune::Functions::DefaultGlobalBasis\n+Global basis for given pre-basis.\n+Definition: defaultglobalbasis.hh:46\n+Dune::Functions::NedelecNode\n+Definition: nedelecbasis.hh:266\n+Dune::Functions::NedelecNode::finiteElementMap_\n+const FiniteElementMap * finiteElementMap_\n+Definition: nedelecbasis.hh:311\n+Dune::Functions::NedelecNode::finiteElement_\n+FiniteElement finiteElement_\n+Definition: nedelecbasis.hh:309\n+Dune::Functions::NedelecNode::FiniteElement\n+Impl::GlobalValuedLocalFiniteElement< Impl::CovariantPiolaTransformator,\n+typename FiniteElementMap::FiniteElement, Element > FiniteElement\n+Definition: nedelecbasis.hh:277\n+Dune::Functions::NedelecNode::bind\n+void bind(const Element &e)\n+Bind to element.\n+Definition: nedelecbasis.hh:300\n+Dune::Functions::NedelecNode::element\n+const Element & element() const\n+Return current element, throw if unbound.\n+Definition: nedelecbasis.hh:285\n+Dune::Functions::NedelecNode::Element\n+typename GV::template Codim< 0 >::Entity Element\n+Definition: nedelecbasis.hh:272\n+Dune::Functions::NedelecNode::finiteElement\n+const FiniteElement & finiteElement() const\n+Return the LocalFiniteElement for the element we are bound to.\n+Definition: nedelecbasis.hh:294\n+Dune::Functions::NedelecNode::NedelecNode\n+NedelecNode(const FiniteElementMap *finiteElementMap)\n+Definition: nedelecbasis.hh:279\n+Dune::Functions::NedelecNode::FiniteElementMap\n+typename Impl::Nedelec1stKindLocalFiniteElementMap< GV, dim, Range, order >\n+FiniteElementMap\n+Definition: nedelecbasis.hh:274\n+Dune::Functions::NedelecNode::element_\n+const Element * element_\n+Definition: nedelecbasis.hh:310\n+Dune::Functions::NedelecNode::size_type\n std::size_t size_type\n-Type used for indices and size information.\n-Definition: powerbasis.hh:58\n-Dune::Functions::PowerPreBasis::IndexMergingStrategy\n-IMS IndexMergingStrategy\n-Strategy used to merge the global indices of the child factories.\n-Definition: powerbasis.hh:61\n-Dune::Functions::PowerPreBasis::Node\n-PowerBasisNode< SubNode, children > Node\n-Template mapping root tree path to type of created tree node.\n-Definition: powerbasis.hh:66\n-Dune::Functions::PowerPreBasis::GridView\n-typename SPB::GridView GridView\n-The grid view that the FE basis is defined on.\n-Definition: powerbasis.hh:55\n-Dune::Functions::PowerPreBasis::multiIndexBufferSize\n-static constexpr size_type multiIndexBufferSize\n-Definition: powerbasis.hh:70\n-Dune::Functions::PowerPreBasis::SubPreBasis\n-SPB SubPreBasis\n-The child pre-basis.\n-Definition: powerbasis.hh:52\n-Dune::Functions::PowerPreBasis::SubNode\n-typename SubPreBasis::Node SubNode\n-Definition: powerbasis.hh:63\n-Dune::Functions::PowerPreBasis::initializeIndices\n-void initializeIndices()\n-Initialize the global indices.\n-Definition: powerbasis.hh:87\n-Dune::Functions::PowerPreBasis::update\n-void update(const GridView &gv)\n-Update the stored grid view, to be called if the grid has changed.\n-Definition: powerbasis.hh:99\n-Dune::Functions::PowerPreBasis::indices\n+Definition: nedelecbasis.hh:271\n+Dune::Functions::NedelecPreBasis\n+Definition: nedelecbasis.hh:136\n+Dune::Functions::NedelecPreBasis::indices\n It indices(const Node &node, It it) const\n Maps from subtree index set [0..size-1] to a globally unique multi index in\n global basis.\n-Definition: powerbasis.hh:232\n-Dune::Functions::PowerPreBasis::PowerPreBasis\n-PowerPreBasis(SFArgs &&... sfArgs)\n-Constructor for given child pre-basis objects.\n-Definition: powerbasis.hh:80\n-Dune::Functions::PowerPreBasis::size\n-size_type size() const\n-Same as size(prefix) with empty prefix.\n-Definition: powerbasis.hh:116\n-Dune::Functions::PowerPreBasis::subPreBasis\n-SubPreBasis & subPreBasis()\n-Mutable access to the stored prebasis of the factor in the power space.\n-Definition: powerbasis.hh:225\n-Dune::Functions::PowerPreBasis::makeNode\n-Node makeNode() const\n-Create tree node.\n-Definition: powerbasis.hh:107\n-Dune::Functions::PowerPreBasis::maxMultiIndexSize\n+Definition: nedelecbasis.hh:238\n+Dune::Functions::NedelecPreBasis::size\n+size_type size(const SizePrefix &prefix) const\n+Return number possible values for next position in multi index.\n+Definition: nedelecbasis.hh:211\n+Dune::Functions::NedelecPreBasis::size_type\n+std::size_t size_type\n+Definition: nedelecbasis.hh:146\n+Dune::Functions::NedelecPreBasis::NedelecPreBasis\n+NedelecPreBasis(const GridView &gv)\n+Constructor for a given grid view object.\n+Definition: nedelecbasis.hh:155\n+Dune::Functions::NedelecPreBasis::GridView\n+GV GridView\n+The grid view that the FE space is defined on.\n+Definition: nedelecbasis.hh:145\n+Dune::Functions::NedelecPreBasis::dimension\n+size_type dimension() const\n+Definition: nedelecbasis.hh:217\n+Dune::Functions::NedelecPreBasis::maxMultiIndexSize\n static constexpr size_type maxMultiIndexSize\n-Definition: powerbasis.hh:68\n-Dune::Functions::PowerPreBasis::minMultiIndexSize\n+Definition: nedelecbasis.hh:150\n+Dune::Functions::NedelecPreBasis::multiIndexBufferSize\n+static constexpr size_type multiIndexBufferSize\n+Definition: nedelecbasis.hh:152\n+Dune::Functions::NedelecPreBasis::gridView_\n+GridView gridView_\n+Definition: nedelecbasis.hh:256\n+Dune::Functions::NedelecPreBasis::finiteElementMap_\n+FiniteElementMap finiteElementMap_\n+Definition: nedelecbasis.hh:257\n+Dune::Functions::NedelecPreBasis::minMultiIndexSize\n static constexpr size_type minMultiIndexSize\n-Definition: powerbasis.hh:69\n-Dune::Functions::PowerPreBasis::maxNodeSize\n+Definition: nedelecbasis.hh:151\n+Dune::Functions::NedelecPreBasis::initializeIndices\n+void initializeIndices()\n+Definition: nedelecbasis.hh:179\n+Dune::Functions::NedelecPreBasis::update\n+void update(const GridView &gv)\n+Definition: nedelecbasis.hh:190\n+Dune::Functions::NedelecPreBasis::maxNodeSize\n size_type maxNodeSize() const\n-Get the maximal number of DOFs associated to node for any element.\n-Definition: powerbasis.hh:213\n-Dune::Functions::PowerPreBasis::gridView\n+Definition: nedelecbasis.hh:222\n+Dune::Functions::NedelecPreBasis::gridView\n const GridView & gridView() const\n Obtain the grid view that the basis is defined on.\n-Definition: powerbasis.hh:93\n-Dune::Functions::PowerPreBasis::size\n-size_type size(const SizePrefix &prefix) const\n-Return number of possible values for next position in multi index.\n-Definition: powerbasis.hh:124\n-Dune::Functions::PowerPreBasis::subPreBasis\n-const SubPreBasis & subPreBasis() const\n-Const access to the stored prebasis of the factor in the power space.\n-Definition: powerbasis.hh:219\n-concepts.hh\n+Definition: nedelecbasis.hh:184\n+Dune::Functions::NedelecPreBasis::makeNode\n+Node makeNode() const\n+Create tree node.\n+Definition: nedelecbasis.hh:199\n+Dune::Functions::NedelecPreBasis::size\n+size_type size() const\n+Definition: nedelecbasis.hh:204\n+Dune::Functions::NedelecPreBasis::mapper_\n+Mapper mapper_\n+Definition: nedelecbasis.hh:258\n+Dune::Functions::BasisNodeMixin::size\n+size_type size() const\n+Definition: nodes.hh:142\n+Dune::Functions::BasisNodeMixin::setSize\n+void setSize(const size_type size)\n+Definition: nodes.hh:164\n+Dune::Functions::LeafBasisNode\n+Definition: nodes.hh:186\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00155.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00155.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: lagrangedgbasis.hh File Reference\n+dune-functions: globalvaluedlocalfiniteelement.hh File Reference\n \n \n \n \n \n \n \n@@ -63,60 +63,37 @@\n \n \n
    \n \n-
    lagrangedgbasis.hh File Reference
    \n+Namespaces
    \n+
    globalvaluedlocalfiniteelement.hh File Reference
    \n \n
    \n
    #include <array>
    \n-#include <dune/common/exceptions.hh>
    \n+#include <numeric>
    \n+#include <dune/common/fmatrix.hh>
    \n+#include <dune/common/fvector.hh>
    \n #include <dune/common/math.hh>
    \n-#include <dune/functions/functionspacebases/nodes.hh>
    \n-#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
    \n-#include <dune/functions/functionspacebases/lagrangebasis.hh>
    \n+#include <dune/common/rangeutilities.hh>
    \n+#include <dune/geometry/referenceelements.hh>
    \n+#include <dune/localfunctions/common/localbasis.hh>
    \n+#include <dune/localfunctions/common/localfiniteelementtraits.hh>
    \n+#include <dune/localfunctions/common/localinterpolation.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n-\n-\n-\n-

    \n-Classes

    class  Dune::Functions::LagrangeDGPreBasis< GV, k >
     
    \n \n \n \n \n \n-\n-\n-

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    namespace  Dune::Functions::BasisFactory
     
    \n-\n-\n-\n-\n-\n-\n-\n-\n-

    \n-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. More...
     
    \n-\n-\n-\n-\n-\n

    \n-Functions

    template<std::size_t k>
    auto Dune::Functions::BasisFactory::lagrangeDG ()
     Create a pre-basis factory that can create a LagrangeDG pre-basis. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,44 +5,28 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-Classes | Namespaces | Typedefs | Functions\n-lagrangedgbasis.hh File Reference\n+Namespaces\n+globalvaluedlocalfiniteelement.hh File Reference\n #include \n-#include \n+#include \n+#include \n+#include \n #include \n-#include \n-#include \n-#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n- Classes\n-class \u00a0Dune::Functions::LagrangeDGPreBasis<_GV,_k_>\n-\u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n-namespace \u00a0Dune::Functions::BasisFactory\n-\u00a0\n- Typedefs\n-template\n-using\u00a0Dune::Functions::LagrangeDGNode = LagrangeNode< GV, k >\n-\u00a0\n-template\n-using\u00a0Dune::Functions::LagrangeDGBasis = DefaultGlobalBasis<\n- LagrangeDGPreBasis< GV, k > >\n-\u00a0 Basis of a scalar k-th-order Lagrangean-DG finite element space. More...\n-\u00a0\n- Functions\n-template\n-auto\u00a0Dune::Functions::BasisFactory::lagrangeDG ()\n-\u00a0 Create a pre-basis factory that can create a LagrangeDG pre-basis.\n- More...\n-\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00155_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00155_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: lagrangedgbasis.hh Source File\n+dune-functions: globalvaluedlocalfiniteelement.hh Source File\n \n \n \n \n \n \n \n@@ -62,283 +62,324 @@\n \n \n \n
    \n-
    lagrangedgbasis.hh
    \n+
    globalvaluedlocalfiniteelement.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH
    \n
    5
    \n
    6#include <array>
    \n-
    7#include <dune/common/exceptions.hh>
    \n-
    8#include <dune/common/math.hh>
    \n-
    9
    \n-\n-\n-\n+
    7#include <numeric>
    \n+
    8
    \n+
    9#include <dune/common/fmatrix.hh>
    \n+
    10#include <dune/common/fvector.hh>
    \n+
    11#include <dune/common/math.hh>
    \n+
    12#include <dune/common/rangeutilities.hh>
    \n
    13
    \n-
    14
    \n+
    14#include <dune/geometry/referenceelements.hh>
    \n
    15
    \n-
    16
    \n-
    17namespace Dune {
    \n-
    18namespace Functions {
    \n+
    16#include <dune/localfunctions/common/localbasis.hh>
    \n+
    17#include <dune/localfunctions/common/localfiniteelementtraits.hh>
    \n+
    18#include <dune/localfunctions/common/localinterpolation.hh>
    \n
    19
    \n-
    20
    \n-
    21
    \n-
    22// *****************************************************************************
    \n-
    23// This is the reusable part of the basis. It contains
    \n-
    24//
    \n-
    25// LagrangeDGPreBasis
    \n-
    26// LagrangeDGNode
    \n-
    27//
    \n-
    28// The pre-basis allows to create the others and is the owner of possible shared
    \n-
    29// state. These components do _not_ depend on the global basis and local view
    \n-
    30// and can be used without a global basis.
    \n-
    31// *****************************************************************************
    \n-
    32
    \n-
    33template<typename GV, int k>
    \n-\n-
    35
    \n-
    36template<typename GV, int k>
    \n-\n-
    38{
    \n-
    39 static const int dim = GV::dimension;
    \n-
    40
    \n-
    41public:
    \n-
    42
    \n-
    44 using GridView = GV;
    \n-
    45 using size_type = std::size_t;
    \n-
    46
    \n-
    47
    \n-
    48 // Precompute the number of dofs per entity type
    \n-
    49 const static int dofsPerEdge = k+1;
    \n-
    50 const static int dofsPerTriangle = (k+1)*(k+2)/2;
    \n-
    51 const static int dofsPerQuad = (k+1)*(k+1);
    \n-
    52 const static int dofsPerTetrahedron = (k+1)*(k+2)*(k+3)/6;
    \n-
    53 const static int dofsPerPrism = (k+1)*(k+1)*(k+2)/2;
    \n-
    54 const static int dofsPerHexahedron = (k+1)*(k+1)*(k+1);
    \n-
    55 const static int dofsPerPyramid = (k+1)*(k+2)*(2*k+3)/6;
    \n-
    56
    \n+
    20namespace Dune::Functions::Impl
    \n+
    21{
    \n+
    22
    \n+
    36 struct ContravariantPiolaTransformator
    \n+
    37 {
    \n+
    42 template<typename Values, typename LocalCoordinate, typename Geometry>
    \n+
    43 static auto apply(Values& values,
    \n+
    44 const LocalCoordinate& xi,
    \n+
    45 const Geometry& geometry)
    \n+
    46 {
    \n+
    47 auto jacobianTransposed = geometry.jacobianTransposed(xi);
    \n+
    48 auto integrationElement = geometry.integrationElement(xi);
    \n+
    49
    \n+
    50 for (auto& value : values)
    \n+
    51 {
    \n+
    52 auto tmp = value;
    \n+
    53 jacobianTransposed.mtv(tmp, value);
    \n+
    54 value /= integrationElement;
    \n+
    55 }
    \n+
    56 }
    \n
    57
    \n-\n-
    59
    \n-
    60 static constexpr size_type maxMultiIndexSize = 1;
    \n-
    61 static constexpr size_type minMultiIndexSize = 1;
    \n-
    62 static constexpr size_type multiIndexBufferSize = 1;
    \n-
    63
    \n-\n-
    66 gridView_(gv)
    \n-
    67 {}
    \n-
    68
    \n-
    69
    \n-\n-
    71 {
    \n-
    72 switch (dim)
    \n-
    73 {
    \n-
    74 case 1:
    \n+
    67 template<typename Gradients, typename LocalCoordinate, typename Geometry>
    \n+
    68 static auto applyJacobian(Gradients& gradients,
    \n+
    69 const LocalCoordinate& xi,
    \n+
    70 const Geometry& geometry)
    \n+
    71 {
    \n+
    72 auto jacobianTransposed = geometry.jacobianTransposed(xi);
    \n+
    73 auto integrationElement = geometry.integrationElement(xi);
    \n+
    74 for (auto& gradient : gradients)
    \n
    75 {
    \n-
    76 break;
    \n-
    77 }
    \n-
    78 case 2:
    \n-
    79 {
    \n-
    80 quadrilateralOffset_ = dofsPerTriangle * gridView_.size(Dune::GeometryTypes::triangle);
    \n-
    81 break;
    \n-
    82 }
    \n-
    83 case 3:
    \n-
    84 {
    \n-
    85 prismOffset_ = dofsPerTetrahedron * gridView_.size(Dune::GeometryTypes::tetrahedron);
    \n+
    76 auto tmp = gradient;
    \n+
    77 gradient = 0;
    \n+
    78 for (size_t k=0; k<gradient.M(); k++)
    \n+
    79 for (size_t l=0; l<tmp.N(); l++)
    \n+
    80 // Use sparseRange because jacobianTransposed may be a sparse DiagonalMatrix
    \n+
    81 for(auto&& [jacobianTransposed_l_j, j] : sparseRange(jacobianTransposed[l]))
    \n+
    82 gradient[j][k] += jacobianTransposed_l_j * tmp[l][k];
    \n+
    83 gradient /= integrationElement;
    \n+
    84 }
    \n+
    85 }
    \n
    86
    \n-
    87 hexahedronOffset_ = prismOffset_ + dofsPerPrism * gridView_.size(Dune::GeometryTypes::prism);
    \n-
    88
    \n-
    89 pyramidOffset_ = hexahedronOffset_ + dofsPerHexahedron * gridView_.size(Dune::GeometryTypes::hexahedron);
    \n-
    90 break;
    \n-
    91 }
    \n-
    92 }
    \n-
    93 }
    \n-
    94
    \n-
    97 const GridView& gridView() const
    \n-
    98 {
    \n-
    99 return gridView_;
    \n-
    100 }
    \n+
    94 template<class Function, class LocalCoordinate, class Element>
    \n+
    95 class LocalValuedFunction
    \n+
    96 {
    \n+
    97 const Function& f_;
    \n+
    98 const Element& element_;
    \n+
    99
    \n+
    100 public:
    \n
    101
    \n-
    102 void update(const GridView& gv)
    \n-
    103 {
    \n-
    104 gridView_ = gv;
    \n-
    105 }
    \n-
    106
    \n-\n-
    111 {
    \n-
    112 return Node{};
    \n-
    113 }
    \n+
    102 LocalValuedFunction(const Function& f, const Element& element)
    \n+
    103 : f_(f), element_(element)
    \n+
    104 {}
    \n+
    105
    \n+
    106 auto operator()(const LocalCoordinate& xi) const
    \n+
    107 {
    \n+
    108 auto&& f = Dune::Impl::makeFunctionWithCallOperator<LocalCoordinate>(f_);
    \n+
    109 auto globalValue = f(xi);
    \n+
    110
    \n+
    111 // Apply the inverse Piola transform
    \n+
    112 auto jacobianInverseTransposed = element_.geometry().jacobianInverseTransposed(xi);
    \n+
    113 auto integrationElement = element_.geometry().integrationElement(xi);
    \n
    114
    \n-\n-
    116 {
    \n-
    117 switch (dim)
    \n-
    118 {
    \n-
    119 case 1:
    \n-
    120 return dofsPerEdge*gridView_.size(0);
    \n-
    121 case 2:
    \n-
    122 {
    \n-
    123 return dofsPerTriangle*gridView_.size(Dune::GeometryTypes::triangle) + dofsPerQuad*gridView_.size(Dune::GeometryTypes::quadrilateral);
    \n-
    124 }
    \n-
    125 case 3:
    \n-
    126 {
    \n-
    127 return dofsPerTetrahedron*gridView_.size(Dune::GeometryTypes::tetrahedron)
    \n-
    128 + dofsPerPyramid*gridView_.size(Dune::GeometryTypes::pyramid)
    \n-
    129 + dofsPerPrism*gridView_.size(Dune::GeometryTypes::prism)
    \n-
    130 + dofsPerHexahedron*gridView_.size(Dune::GeometryTypes::hexahedron);
    \n-
    131 }
    \n-
    132 }
    \n-
    133 DUNE_THROW(Dune::NotImplemented, "No size method for " << dim << "d grids available yet!");
    \n-
    134 }
    \n-
    135
    \n-
    137 template<class SizePrefix>
    \n-
    138 size_type size(const SizePrefix& prefix) const
    \n-
    139 {
    \n-
    140 assert(prefix.size() == 0 || prefix.size() == 1);
    \n-
    141 return (prefix.size() == 0) ? size() : 0;
    \n-
    142 }
    \n-
    143
    \n-\n-
    146 {
    \n-
    147 return size();
    \n-
    148 }
    \n+
    115 auto localValue = globalValue;
    \n+
    116 jacobianInverseTransposed.mtv(globalValue, localValue);
    \n+
    117 localValue *= integrationElement;
    \n+
    118
    \n+
    119 return localValue;
    \n+
    120 }
    \n+
    121 };
    \n+
    122 };
    \n+
    123
    \n+
    137 struct CovariantPiolaTransformator
    \n+
    138 {
    \n+
    143 template<typename Values, typename LocalCoordinate, typename Geometry>
    \n+
    144 static auto apply(Values& values,
    \n+
    145 const LocalCoordinate& xi,
    \n+
    146 const Geometry& geometry)
    \n+
    147 {
    \n+
    148 auto jacobianInverseTransposed = geometry.jacobianInverseTransposed(xi);
    \n
    149
    \n-\n-
    151 {
    \n-
    152 return Dune::power(k+1, int(GV::dimension));
    \n-
    153 }
    \n-
    154
    \n-
    155 template<typename It>
    \n-
    156 It indices(const Node& node, It it) const
    \n-
    157 {
    \n-
    158 const auto& gridIndexSet = gridView().indexSet();
    \n-
    159 const auto& element = node.element();
    \n-
    160
    \n-
    161 size_type offset = 0;
    \n-
    162 if constexpr (dim==1)
    \n-
    163 offset = dofsPerEdge*gridIndexSet.subIndex(element,0,0);
    \n-
    164 else if constexpr (dim==2)
    \n-
    165 {
    \n-
    166 if (element.type().isTriangle())
    \n-
    167 offset = dofsPerTriangle*gridIndexSet.subIndex(element,0,0);
    \n-
    168 else if (element.type().isQuadrilateral())
    \n-
    169 offset = quadrilateralOffset_ + dofsPerQuad*gridIndexSet.subIndex(element,0,0);
    \n-
    170 else
    \n-
    171 DUNE_THROW(Dune::NotImplemented, "2d elements have to be triangles or quadrilaterals");
    \n-
    172 }
    \n-
    173 else if constexpr (dim==3)
    \n-
    174 {
    \n-
    175 if (element.type().isTetrahedron())
    \n-
    176 offset = dofsPerTetrahedron*gridIndexSet.subIndex(element,0,0);
    \n-
    177 else if (element.type().isPrism())
    \n-
    178 offset = prismOffset_ + dofsPerPrism*gridIndexSet.subIndex(element,0,0);
    \n-
    179 else if (element.type().isHexahedron())
    \n-
    180 offset = hexahedronOffset_ + dofsPerHexahedron*gridIndexSet.subIndex(element,0,0);
    \n-
    181 else if (element.type().isPyramid())
    \n-
    182 offset = pyramidOffset_ + dofsPerPyramid*gridIndexSet.subIndex(element,0,0);
    \n-
    183 else
    \n-
    184 DUNE_THROW(Dune::NotImplemented, "3d elements have to be tetrahedrons, prisms, hexahedrons or pyramids");
    \n-
    185 }
    \n-
    186 else
    \n-
    187 DUNE_THROW(Dune::NotImplemented, "No index method for " << dim << "d grids available yet!");
    \n-
    188 for (size_type i = 0, end = node.size() ; i < end ; ++i, ++it)
    \n-
    189 *it = {offset + i};
    \n-
    190 return it;
    \n-
    191 }
    \n-
    192
    \n-
    194 unsigned int order() const
    \n-
    195 {
    \n-
    196 return k;
    \n-
    197 }
    \n-
    198
    \n-
    199protected:
    \n-\n-
    201
    \n-\n-\n-\n-\n-
    206};
    \n-
    207
    \n+
    150 for (auto& value : values)
    \n+
    151 {
    \n+
    152 auto tmp = value;
    \n+
    153 jacobianInverseTransposed.mv(tmp, value);
    \n+
    154 }
    \n+
    155 }
    \n+
    156
    \n+
    166 template<typename Gradients, typename LocalCoordinate, typename Geometry>
    \n+
    167 static auto applyJacobian(Gradients& gradients,
    \n+
    168 const LocalCoordinate& xi,
    \n+
    169 const Geometry& geometry)
    \n+
    170 {
    \n+
    171 auto jacobianInverseTransposed = geometry.jacobianInverseTransposed(xi);
    \n+
    172
    \n+
    173 for (auto& gradient : gradients)
    \n+
    174 {
    \n+
    175 auto tmp = gradient;
    \n+
    176 gradient = 0;
    \n+
    177 for (size_t j=0; j<gradient.N(); j++)
    \n+
    178 for (size_t k=0; k<gradient.M(); k++)
    \n+
    179 // Use sparseRange because jacobianTransposed may be a sparse DiagonalMatrix
    \n+
    180 for(auto&& [jacobianInverseTransposed_j_l, l] : sparseRange(jacobianInverseTransposed[j]))
    \n+
    181 gradient[j][k] += jacobianInverseTransposed_j_l * tmp[l][k];
    \n+
    182 }
    \n+
    183 }
    \n+
    184
    \n+
    192 template<class Function, class LocalCoordinate, class Element>
    \n+
    193 class LocalValuedFunction
    \n+
    194 {
    \n+
    195 const Function& f_;
    \n+
    196 const Element& element_;
    \n+
    197
    \n+
    198 public:
    \n+
    199
    \n+
    200 LocalValuedFunction(const Function& f, const Element& element)
    \n+
    201 : f_(f), element_(element)
    \n+
    202 {}
    \n+
    203
    \n+
    204 auto operator()(const LocalCoordinate& xi) const
    \n+
    205 {
    \n+
    206 auto&& f = Dune::Impl::makeFunctionWithCallOperator<LocalCoordinate>(f_);
    \n+
    207 auto globalValue = f(xi);
    \n
    208
    \n-
    209
    \n-
    210namespace BasisFactory {
    \n+
    209 // Apply the inverse Piola transform
    \n+
    210 auto jacobianTransposed = element_.geometry().jacobianTransposed(xi);
    \n
    211
    \n-
    219template<std::size_t k>
    \n-\n-
    221{
    \n-
    222 return [](const auto& gridView) {
    \n-
    223 return LagrangeDGPreBasis<std::decay_t<decltype(gridView)>, k>(gridView);
    \n-
    224 };
    \n-
    225}
    \n-
    226
    \n-
    227} // end namespace BasisFactory
    \n-
    228
    \n-
    229
    \n-
    230
    \n-
    231// *****************************************************************************
    \n-
    232// This is the actual global basis implementation based on the reusable parts.
    \n-
    233// *****************************************************************************
    \n-
    234
    \n-
    242template<typename GV, int k>
    \n-\n-
    244
    \n-
    245
    \n+
    212 auto localValue = globalValue;
    \n+
    213 jacobianTransposed.mv(globalValue, localValue);
    \n+
    214
    \n+
    215 return localValue;
    \n+
    216 }
    \n+
    217 };
    \n+
    218 };
    \n+
    219
    \n+
    226 template<class Transformator, class LocalValuedLocalBasis, class Element>
    \n+
    227 class GlobalValuedLocalBasis
    \n+
    228 {
    \n+
    229 public:
    \n+
    230 using Traits = typename LocalValuedLocalBasis::Traits;
    \n+
    231
    \n+
    234 void bind(const LocalValuedLocalBasis& localValuedLocalBasis, const Element& element)
    \n+
    235 {
    \n+
    236 localValuedLocalBasis_ = &localValuedLocalBasis;
    \n+
    237 element_ = &element;
    \n+
    238 }
    \n+
    239
    \n+
    242 auto size() const
    \n+
    243 {
    \n+
    244 return localValuedLocalBasis_->size();
    \n+
    245 }
    \n
    246
    \n-
    247} // end namespace Functions
    \n-
    248} // end namespace Dune
    \n-
    249
    \n-
    250
    \n-
    251#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH
    \n-\n-\n-\n-
    auto power(ChildPreBasisFactory &&childPreBasisFactory, const IndexMergingStrategy &)
    Create a pre-basis factory that can build a PowerPreBasis.
    Definition: powerbasis.hh:369
    \n-
    auto lagrangeDG()
    Create a pre-basis factory that can create a LagrangeDG pre-basis.
    Definition: lagrangedgbasis.hh:220
    \n-
    Definition: polynomial.hh:10
    \n-
    Global basis for given pre-basis.
    Definition: defaultglobalbasis.hh:46
    \n-
    Definition: lagrangebasis.hh:387
    \n-
    const Element & element() const
    Return current element, throw if unbound.
    Definition: lagrangebasis.hh:439
    \n-
    Definition: lagrangedgbasis.hh:38
    \n-
    size_type size() const
    Definition: lagrangedgbasis.hh:115
    \n-
    It indices(const Node &node, It it) const
    Definition: lagrangedgbasis.hh:156
    \n-
    size_type maxNodeSize() const
    Definition: lagrangedgbasis.hh:150
    \n-
    static constexpr size_type multiIndexBufferSize
    Definition: lagrangedgbasis.hh:62
    \n-
    unsigned int order() const
    Polynomial order used in the local Lagrange finite-elements.
    Definition: lagrangedgbasis.hh:194
    \n-
    void update(const GridView &gv)
    Definition: lagrangedgbasis.hh:102
    \n-
    size_t hexahedronOffset_
    Definition: lagrangedgbasis.hh:205
    \n-
    Node makeNode() const
    Create tree node.
    Definition: lagrangedgbasis.hh:110
    \n-
    static constexpr size_type maxMultiIndexSize
    Definition: lagrangedgbasis.hh:60
    \n-
    static const int dofsPerHexahedron
    Definition: lagrangedgbasis.hh:54
    \n-
    LagrangeDGPreBasis(const GridView &gv)
    Constructor for a given grid view object.
    Definition: lagrangedgbasis.hh:65
    \n-
    size_t pyramidOffset_
    Definition: lagrangedgbasis.hh:203
    \n-
    static const int dofsPerTetrahedron
    Definition: lagrangedgbasis.hh:52
    \n-
    size_type size(const SizePrefix &prefix) const
    Return number possible values for next position in multi index.
    Definition: lagrangedgbasis.hh:138
    \n-
    GV GridView
    The grid view that the FE space is defined on.
    Definition: lagrangedgbasis.hh:44
    \n-
    void initializeIndices()
    Definition: lagrangedgbasis.hh:70
    \n-
    size_t quadrilateralOffset_
    Definition: lagrangedgbasis.hh:202
    \n-
    static const int dofsPerEdge
    Definition: lagrangedgbasis.hh:49
    \n-
    const GridView & gridView() const
    Obtain the grid view that the basis is defined on.
    Definition: lagrangedgbasis.hh:97
    \n-
    static const int dofsPerQuad
    Definition: lagrangedgbasis.hh:51
    \n-
    static const int dofsPerTriangle
    Definition: lagrangedgbasis.hh:50
    \n-
    static const int dofsPerPyramid
    Definition: lagrangedgbasis.hh:55
    \n-
    GridView gridView_
    Definition: lagrangedgbasis.hh:200
    \n-
    static constexpr size_type minMultiIndexSize
    Definition: lagrangedgbasis.hh:61
    \n-
    std::size_t size_type
    Definition: lagrangedgbasis.hh:45
    \n-
    size_type dimension() const
    Definition: lagrangedgbasis.hh:145
    \n-
    size_t prismOffset_
    Definition: lagrangedgbasis.hh:204
    \n-
    static const int dofsPerPrism
    Definition: lagrangedgbasis.hh:53
    \n-
    size_type size() const
    Definition: nodes.hh:142
    \n+
    248 void evaluateFunction(const typename Traits::DomainType& x,
    \n+
    249 std::vector<typename Traits::RangeType>& out) const
    \n+
    250 {
    \n+
    251 localValuedLocalBasis_->evaluateFunction(x,out);
    \n+
    252
    \n+
    253 Transformator::apply(out, x, element_->geometry());
    \n+
    254 }
    \n+
    255
    \n+
    261 void evaluateJacobian(const typename Traits::DomainType& x,
    \n+
    262 std::vector<typename Traits::JacobianType>& out) const
    \n+
    263 {
    \n+
    264 localValuedLocalBasis_->evaluateJacobian(x,out);
    \n+
    265
    \n+
    266 Transformator::applyJacobian(out, x, element_->geometry());
    \n+
    267 }
    \n+
    268
    \n+
    275 void partial(const std::array<unsigned int,2>& order,
    \n+
    276 const typename Traits::DomainType& x,
    \n+
    277 std::vector<typename Traits::RangeType>& out) const
    \n+
    278 {
    \n+
    279 auto totalOrder = std::accumulate(order.begin(), order.end(), 0);
    \n+
    280 if (totalOrder == 0) {
    \n+
    281 evaluateFunction(x, out);
    \n+
    282 } else if (totalOrder == 1) {
    \n+
    283 auto const direction = std::distance(order.begin(), std::find(order.begin(), order.end(), 1));
    \n+
    284 out.resize(size());
    \n+
    285
    \n+
    286 // TODO: The following is wasteful: We compute the full Jacobian and then return
    \n+
    287 // only a part of it. While we need the full Jacobian of the underlying local-valued LFE,
    \n+
    288 // it should be possible to compute only a partial Piola transform for the requested
    \n+
    289 // partial derivatives.
    \n+
    290 std::vector<typename Traits::JacobianType> fullJacobian;
    \n+
    291 localValuedLocalBasis_->evaluateJacobian(x,fullJacobian);
    \n+
    292
    \n+
    293 Transformator::applyJacobian(fullJacobian, x, element_->geometry());
    \n+
    294
    \n+
    295 for (std::size_t i=0; i<out.size(); i++)
    \n+
    296 for (std::size_t j=0; j<out[i].size(); j++)
    \n+
    297 out[i][j] = fullJacobian[i][j][direction];
    \n+
    298
    \n+
    299 } else
    \n+
    300 DUNE_THROW(NotImplemented, "Partial derivatives of order 2 or higher");
    \n+
    301 }
    \n+
    302
    \n+
    304 auto order() const
    \n+
    305 {
    \n+
    306 return localValuedLocalBasis_->order();
    \n+
    307 }
    \n+
    308
    \n+
    309 const LocalValuedLocalBasis* localValuedLocalBasis_;
    \n+
    310 const Element* element_;
    \n+
    311 };
    \n+
    312
    \n+
    321 template<class Transformator, class LocalValuedLocalInterpolation, class Element>
    \n+
    322 class GlobalValuedLocalInterpolation
    \n+
    323 {
    \n+
    324 public:
    \n+
    327 void bind(const LocalValuedLocalInterpolation& localValuedLocalInterpolation, const Element& element)
    \n+
    328 {
    \n+
    329 localValuedLocalInterpolation_ = &localValuedLocalInterpolation;
    \n+
    330 element_ = &element;
    \n+
    331 }
    \n+
    332
    \n+
    333 template<typename F, typename C>
    \n+
    334 void interpolate (const F& f, std::vector<C>& out) const
    \n+
    335 {
    \n+
    336 using LocalCoordinate = typename Element::Geometry::LocalCoordinate;
    \n+
    337 typename Transformator::template LocalValuedFunction<F,LocalCoordinate,Element> localValuedFunction(f, *element_);
    \n+
    338 localValuedLocalInterpolation_->interpolate(localValuedFunction, out);
    \n+
    339 }
    \n+
    340
    \n+
    341 private:
    \n+
    342 const LocalValuedLocalInterpolation* localValuedLocalInterpolation_;
    \n+
    343 const Element* element_;
    \n+
    344 };
    \n+
    345
    \n+
    346
    \n+
    353 template<class Transformator, class LocalValuedLFE, class Element>
    \n+
    354 class GlobalValuedLocalFiniteElement
    \n+
    355 {
    \n+
    356 using LocalBasis = GlobalValuedLocalBasis<Transformator,
    \n+
    357 typename LocalValuedLFE::Traits::LocalBasisType,
    \n+
    358 Element>;
    \n+
    359 using LocalInterpolation = GlobalValuedLocalInterpolation<Transformator,
    \n+
    360 typename LocalValuedLFE::Traits::LocalInterpolationType,
    \n+
    361 Element>;
    \n+
    362
    \n+
    363 public:
    \n+
    366 using Traits = LocalFiniteElementTraits<LocalBasis,
    \n+
    367 typename LocalValuedLFE::Traits::LocalCoefficientsType,
    \n+
    368 LocalInterpolation>;
    \n+
    369
    \n+
    370 GlobalValuedLocalFiniteElement() {}
    \n+
    371
    \n+
    372 void bind(const LocalValuedLFE& localValuedLFE, const Element& element)
    \n+
    373 {
    \n+
    374 globalValuedLocalBasis_.bind(localValuedLFE.localBasis(), element);
    \n+
    375 globalValuedLocalInterpolation_.bind(localValuedLFE.localInterpolation(), element);
    \n+
    376 localValuedLFE_ = &localValuedLFE;
    \n+
    377 }
    \n+
    378
    \n+
    381 const typename Traits::LocalBasisType& localBasis() const
    \n+
    382 {
    \n+
    383 return globalValuedLocalBasis_;
    \n+
    384 }
    \n+
    385
    \n+
    388 const typename Traits::LocalCoefficientsType& localCoefficients() const
    \n+
    389 {
    \n+
    390 return localValuedLFE_->localCoefficients();
    \n+
    391 }
    \n+
    392
    \n+
    395 const typename Traits::LocalInterpolationType& localInterpolation() const
    \n+
    396 {
    \n+
    397 return globalValuedLocalInterpolation_;
    \n+
    398 }
    \n+
    399
    \n+
    401 std::size_t size() const
    \n+
    402 {
    \n+
    403 return localValuedLFE_->size();
    \n+
    404 }
    \n+
    405
    \n+
    408 GeometryType type() const
    \n+
    409 {
    \n+
    410 return localValuedLFE_->type();
    \n+
    411 }
    \n+
    412
    \n+
    413 private:
    \n+
    414
    \n+
    415 typename Traits::LocalBasisType globalValuedLocalBasis_;
    \n+
    416 typename Traits::LocalInterpolationType globalValuedLocalInterpolation_;
    \n+
    417 const LocalValuedLFE* localValuedLFE_;
    \n+
    418 };
    \n+
    419
    \n+
    420} // namespace Dune::Functions::Impl
    \n+
    421
    \n+
    422#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH
    \n+
    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
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -5,376 +5,339 @@\n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n * functionspacebases\n-lagrangedgbasis.hh\n+globalvaluedlocalfiniteelement.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH\n 5\n 6#include \n- 7#include \n- 8#include \n- 9\n- 10#include \n- 11#include \n- 12#include \n+ 7#include \n+ 8\n+ 9#include \n+ 10#include \n+ 11#include \n+ 12#include \n 13\n- 14\n+ 14#include \n 15\n- 16\n- 17namespace Dune {\n- 18namespace Functions {\n+ 16#include \n+ 17#include \n+ 18#include \n 19\n- 20\n- 21\n- 22/\n-/ *****************************************************************************\n- 23// This is the reusable part of the basis. It contains\n- 24//\n- 25// LagrangeDGPreBasis\n- 26// LagrangeDGNode\n- 27//\n- 28// The pre-basis allows to create the others and is the owner of possible\n-shared\n- 29// state. These components do _not_ depend on the global basis and local\n-view\n- 30// and can be used without a global basis.\n- 31/\n-/ *****************************************************************************\n- 32\n- 33template\n-34using LagrangeDGNode = LagrangeNode;\n- 35\n- 36template\n-37class LagrangeDGPreBasis\n- 38{\n- 39 static const int dim = GV::dimension;\n- 40\n- 41public:\n- 42\n-44 using GridView = GV;\n-45 using size_type = std::size_t;\n- 46\n- 47\n- 48 // Precompute the number of dofs per entity type\n-49 const static int dofsPerEdge = k+1;\n-50 const static int dofsPerTriangle = (k+1)*(k+2)/2;\n-51 const static int dofsPerQuad = (k+1)*(k+1);\n-52 const static int dofsPerTetrahedron = (k+1)*(k+2)*(k+3)/6;\n-53 const static int dofsPerPrism = (k+1)*(k+1)*(k+2)/2;\n-54 const static int dofsPerHexahedron = (k+1)*(k+1)*(k+1);\n-55 const static int dofsPerPyramid = (k+1)*(k+2)*(2*k+3)/6;\n- 56\n+ 20namespace Dune::Functions::Impl\n+ 21{\n+ 22\n+ 36 struct ContravariantPiolaTransformator\n+ 37 {\n+ 42 template\n+ 43 static auto apply(Values& values,\n+ 44 const LocalCoordinate& xi,\n+ 45 const Geometry& geometry)\n+ 46 {\n+ 47 auto jacobianTransposed = geometry.jacobianTransposed(xi);\n+ 48 auto integrationElement = geometry.integrationElement(xi);\n+ 49\n+ 50 for (auto& value : values)\n+ 51 {\n+ 52 auto tmp = value;\n+ 53 jacobianTransposed.mtv(tmp, value);\n+ 54 value /= integrationElement;\n+ 55 }\n+ 56 }\n 57\n-58 using Node = LagrangeDGNode;\n- 59\n-60 static constexpr size_type maxMultiIndexSize = 1;\n-61 static constexpr size_type minMultiIndexSize = 1;\n-62 static constexpr size_type multiIndexBufferSize = 1;\n- 63\n-65 LagrangeDGPreBasis(const GridView& gv) :\n- 66 gridView_(gv)\n- 67 {}\n- 68\n- 69\n-70 void initializeIndices()\n+ 67 template\n+ 68 static auto applyJacobian(Gradients& gradients,\n+ 69 const LocalCoordinate& xi,\n+ 70 const Geometry& geometry)\n 71 {\n- 72 switch (dim)\n- 73 {\n- 74 case 1:\n+ 72 auto jacobianTransposed = geometry.jacobianTransposed(xi);\n+ 73 auto integrationElement = geometry.integrationElement(xi);\n+ 74 for (auto& gradient : gradients)\n 75 {\n- 76 break;\n- 77 }\n- 78 case 2:\n- 79 {\n- 80 quadrilateralOffset_ = dofsPerTriangle * gridView_.size(Dune::\n-GeometryTypes::triangle);\n- 81 break;\n- 82 }\n- 83 case 3:\n- 84 {\n- 85 prismOffset_ = dofsPerTetrahedron * gridView_.size(Dune::GeometryTypes::\n-tetrahedron);\n+ 76 auto tmp = gradient;\n+ 77 gradient = 0;\n+ 78 for (size_t k=0; k\n+ 95 class LocalValuedFunction\n+ 96 {\n+ 97 const Function& f_;\n+ 98 const Element& element_;\n+ 99\n+ 100 public:\n 101\n-102 void update(const GridView& gv)\n- 103 {\n- 104 gridView_ = gv;\n- 105 }\n- 106\n-110 Node makeNode() const\n- 111 {\n- 112 return Node{};\n- 113 }\n+ 102 LocalValuedFunction(const Function& f, const Element& element)\n+ 103 : f_(f), element_(element)\n+ 104 {}\n+ 105\n+ 106 auto operator()(const LocalCoordinate& xi) const\n+ 107 {\n+ 108 auto&& f = Dune::Impl::makeFunctionWithCallOperator(f_);\n+ 109 auto globalValue = f(xi);\n+ 110\n+ 111 // Apply the inverse Piola transform\n+ 112 auto jacobianInverseTransposed = element_.geometry\n+().jacobianInverseTransposed(xi);\n+ 113 auto integrationElement = element_.geometry().integrationElement(xi);\n 114\n-115 size_type size() const\n- 116 {\n- 117 switch (dim)\n- 118 {\n- 119 case 1:\n- 120 return dofsPerEdge*gridView_.size(0);\n- 121 case 2:\n- 122 {\n- 123 return dofsPerTriangle*gridView_.size(Dune::GeometryTypes::triangle) +\n-dofsPerQuad*gridView_.size(Dune::GeometryTypes::quadrilateral);\n- 124 }\n- 125 case 3:\n- 126 {\n- 127 return dofsPerTetrahedron*gridView_.size(Dune::GeometryTypes::tetrahedron)\n- 128 + dofsPerPyramid*gridView_.size(Dune::GeometryTypes::pyramid)\n- 129 + dofsPerPrism*gridView_.size(Dune::GeometryTypes::prism)\n- 130 + dofsPerHexahedron*gridView_.size(Dune::GeometryTypes::hexahedron);\n- 131 }\n- 132 }\n- 133 DUNE_THROW(Dune::NotImplemented, \"No size method for \" << dim << \"d grids\n-available yet!\");\n- 134 }\n- 135\n- 137 template\n-138 size_type size(const SizePrefix& prefix) const\n- 139 {\n- 140 assert(prefix.size() == 0 || prefix.size() == 1);\n- 141 return (prefix.size() == 0) ? size() : 0;\n- 142 }\n- 143\n-145 size_type dimension() const\n- 146 {\n- 147 return size();\n- 148 }\n+ 115 auto localValue = globalValue;\n+ 116 jacobianInverseTransposed.mtv(globalValue, localValue);\n+ 117 localValue *= integrationElement;\n+ 118\n+ 119 return localValue;\n+ 120 }\n+ 121 };\n+ 122 };\n+ 123\n+ 137 struct CovariantPiolaTransformator\n+ 138 {\n+ 143 template\n+ 144 static auto apply(Values& values,\n+ 145 const LocalCoordinate& xi,\n+ 146 const Geometry& geometry)\n+ 147 {\n+ 148 auto jacobianInverseTransposed = geometry.jacobianInverseTransposed(xi);\n 149\n-150 size_type maxNodeSize() const\n+ 150 for (auto& value : values)\n 151 {\n- 152 return Dune::power(k+1, int(GV::dimension));\n- 153 }\n- 154\n- 155 template\n-156 It indices(const Node& node, It it) const\n- 157 {\n- 158 const auto& gridIndexSet = gridView().indexSet();\n- 159 const auto& element = node.element();\n- 160\n- 161 size_type offset = 0;\n- 162 if constexpr (dim==1)\n- 163 offset = dofsPerEdge*gridIndexSet.subIndex(element,0,0);\n- 164 else if constexpr (dim==2)\n- 165 {\n- 166 if (element.type().isTriangle())\n- 167 offset = dofsPerTriangle*gridIndexSet.subIndex(element,0,0);\n- 168 else if (element.type().isQuadrilateral())\n- 169 offset = quadrilateralOffset_ + dofsPerQuad*gridIndexSet.subIndex\n-(element,0,0);\n- 170 else\n- 171 DUNE_THROW(Dune::NotImplemented, \"2d elements have to be triangles or\n-quadrilaterals\");\n- 172 }\n- 173 else if constexpr (dim==3)\n+ 152 auto tmp = value;\n+ 153 jacobianInverseTransposed.mv(tmp, value);\n+ 154 }\n+ 155 }\n+ 156\n+ 166 template\n+ 167 static auto applyJacobian(Gradients& gradients,\n+ 168 const LocalCoordinate& xi,\n+ 169 const Geometry& geometry)\n+ 170 {\n+ 171 auto jacobianInverseTransposed = geometry.jacobianInverseTransposed(xi);\n+ 172\n+ 173 for (auto& gradient : gradients)\n 174 {\n- 175 if (element.type().isTetrahedron())\n- 176 offset = dofsPerTetrahedron*gridIndexSet.subIndex(element,0,0);\n- 177 else if (element.type().isPrism())\n- 178 offset = prismOffset_ + dofsPerPrism*gridIndexSet.subIndex(element,0,0);\n- 179 else if (element.type().isHexahedron())\n- 180 offset = hexahedronOffset_ + dofsPerHexahedron*gridIndexSet.subIndex\n-(element,0,0);\n- 181 else if (element.type().isPyramid())\n- 182 offset = pyramidOffset_ + dofsPerPyramid*gridIndexSet.subIndex\n-(element,0,0);\n- 183 else\n- 184 DUNE_THROW(Dune::NotImplemented, \"3d elements have to be tetrahedrons,\n-prisms, hexahedrons or pyramids\");\n- 185 }\n- 186 else\n- 187 DUNE_THROW(Dune::NotImplemented, \"No index method for \" << dim << \"d grids\n-available yet!\");\n- 188 for (size_type i = 0, end = node.size() ; i < end ; ++i, ++it)\n- 189 *it = {offset + i};\n- 190 return it;\n- 191 }\n- 192\n-194 unsigned int order() const\n- 195 {\n- 196 return k;\n- 197 }\n- 198\n- 199protected:\n-200 GridView gridView_;\n- 201\n-202 size_t quadrilateralOffset_;\n-203 size_t pyramidOffset_;\n-204 size_t prismOffset_;\n-205 size_t hexahedronOffset_;\n- 206};\n- 207\n+ 175 auto tmp = gradient;\n+ 176 gradient = 0;\n+ 177 for (size_t j=0; j\n+ 193 class LocalValuedFunction\n+ 194 {\n+ 195 const Function& f_;\n+ 196 const Element& element_;\n+ 197\n+ 198 public:\n+ 199\n+ 200 LocalValuedFunction(const Function& f, const Element& element)\n+ 201 : f_(f), element_(element)\n+ 202 {}\n+ 203\n+ 204 auto operator()(const LocalCoordinate& xi) const\n+ 205 {\n+ 206 auto&& f = Dune::Impl::makeFunctionWithCallOperator(f_);\n+ 207 auto globalValue = f(xi);\n 208\n- 209\n- 210namespace BasisFactory {\n+ 209 // Apply the inverse Piola transform\n+ 210 auto jacobianTransposed = element_.geometry().jacobianTransposed(xi);\n 211\n- 219template\n-220auto lagrangeDG()\n- 221{\n- 222 return [](const auto& gridView) {\n- 223 return LagrangeDGPreBasis, k>(gridView);\n- 224 };\n- 225}\n- 226\n- 227} // end namespace BasisFactory\n- 228\n- 229\n- 230\n- 231/\n-/ *****************************************************************************\n- 232// This is the actual global basis implementation based on the reusable\n-parts.\n- 233/\n-/ *****************************************************************************\n- 234\n- 242template\n-243using LagrangeDGBasis = DefaultGlobalBasis >;\n- 244\n- 245\n+ 212 auto localValue = globalValue;\n+ 213 jacobianTransposed.mv(globalValue, localValue);\n+ 214\n+ 215 return localValue;\n+ 216 }\n+ 217 };\n+ 218 };\n+ 219\n+ 226 template\n+ 227 class GlobalValuedLocalBasis\n+ 228 {\n+ 229 public:\n+ 230 using Traits = typename LocalValuedLocalBasis::Traits;\n+ 231\n+ 234 void bind(const LocalValuedLocalBasis& localValuedLocalBasis, const\n+Element& element)\n+ 235 {\n+ 236 localValuedLocalBasis_ = &localValuedLocalBasis;\n+ 237 element_ = &element;\n+ 238 }\n+ 239\n+ 242 auto size() const\n+ 243 {\n+ 244 return localValuedLocalBasis_->size();\n+ 245 }\n 246\n- 247} // end namespace Functions\n- 248} // end namespace Dune\n- 249\n- 250\n- 251#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_LAGRANGEDGBASIS_HH\n-nodes.hh\n-defaultglobalbasis.hh\n-lagrangebasis.hh\n-Dune::Functions::BasisFactory::power\n-auto power(ChildPreBasisFactory &&childPreBasisFactory, const\n-IndexMergingStrategy &)\n-Create a pre-basis factory that can build a PowerPreBasis.\n-Definition: powerbasis.hh:369\n-Dune::Functions::BasisFactory::lagrangeDG\n-auto lagrangeDG()\n-Create a pre-basis factory that can create a LagrangeDG pre-basis.\n-Definition: lagrangedgbasis.hh:220\n-Dune\n-Definition: polynomial.hh:10\n-Dune::Functions::DefaultGlobalBasis\n-Global basis for given pre-basis.\n-Definition: defaultglobalbasis.hh:46\n-Dune::Functions::LagrangeNode\n-Definition: lagrangebasis.hh:387\n-Dune::Functions::LagrangeNode::element\n-const Element & element() const\n-Return current element, throw if unbound.\n-Definition: lagrangebasis.hh:439\n-Dune::Functions::LagrangeDGPreBasis\n-Definition: lagrangedgbasis.hh:38\n-Dune::Functions::LagrangeDGPreBasis::size\n-size_type size() const\n-Definition: lagrangedgbasis.hh:115\n-Dune::Functions::LagrangeDGPreBasis::indices\n-It indices(const Node &node, It it) const\n-Definition: lagrangedgbasis.hh:156\n-Dune::Functions::LagrangeDGPreBasis::maxNodeSize\n-size_type maxNodeSize() const\n-Definition: lagrangedgbasis.hh:150\n-Dune::Functions::LagrangeDGPreBasis::multiIndexBufferSize\n-static constexpr size_type multiIndexBufferSize\n-Definition: lagrangedgbasis.hh:62\n-Dune::Functions::LagrangeDGPreBasis::order\n-unsigned int order() const\n-Polynomial order used in the local Lagrange finite-elements.\n-Definition: lagrangedgbasis.hh:194\n-Dune::Functions::LagrangeDGPreBasis::update\n-void update(const GridView &gv)\n-Definition: lagrangedgbasis.hh:102\n-Dune::Functions::LagrangeDGPreBasis::hexahedronOffset_\n-size_t hexahedronOffset_\n-Definition: lagrangedgbasis.hh:205\n-Dune::Functions::LagrangeDGPreBasis::makeNode\n-Node makeNode() const\n-Create tree node.\n-Definition: lagrangedgbasis.hh:110\n-Dune::Functions::LagrangeDGPreBasis::maxMultiIndexSize\n-static constexpr size_type maxMultiIndexSize\n-Definition: lagrangedgbasis.hh:60\n-Dune::Functions::LagrangeDGPreBasis::dofsPerHexahedron\n-static const int dofsPerHexahedron\n-Definition: lagrangedgbasis.hh:54\n-Dune::Functions::LagrangeDGPreBasis::LagrangeDGPreBasis\n-LagrangeDGPreBasis(const GridView &gv)\n-Constructor for a given grid view object.\n-Definition: lagrangedgbasis.hh:65\n-Dune::Functions::LagrangeDGPreBasis::pyramidOffset_\n-size_t pyramidOffset_\n-Definition: lagrangedgbasis.hh:203\n-Dune::Functions::LagrangeDGPreBasis::dofsPerTetrahedron\n-static const int dofsPerTetrahedron\n-Definition: lagrangedgbasis.hh:52\n-Dune::Functions::LagrangeDGPreBasis::size\n-size_type size(const SizePrefix &prefix) const\n-Return number possible values for next position in multi index.\n-Definition: lagrangedgbasis.hh:138\n-Dune::Functions::LagrangeDGPreBasis::GridView\n-GV GridView\n-The grid view that the FE space is defined on.\n-Definition: lagrangedgbasis.hh:44\n-Dune::Functions::LagrangeDGPreBasis::initializeIndices\n-void initializeIndices()\n-Definition: lagrangedgbasis.hh:70\n-Dune::Functions::LagrangeDGPreBasis::quadrilateralOffset_\n-size_t quadrilateralOffset_\n-Definition: lagrangedgbasis.hh:202\n-Dune::Functions::LagrangeDGPreBasis::dofsPerEdge\n-static const int dofsPerEdge\n-Definition: lagrangedgbasis.hh:49\n-Dune::Functions::LagrangeDGPreBasis::gridView\n-const GridView & gridView() const\n-Obtain the grid view that the basis is defined on.\n-Definition: lagrangedgbasis.hh:97\n-Dune::Functions::LagrangeDGPreBasis::dofsPerQuad\n-static const int dofsPerQuad\n-Definition: lagrangedgbasis.hh:51\n-Dune::Functions::LagrangeDGPreBasis::dofsPerTriangle\n-static const int dofsPerTriangle\n-Definition: lagrangedgbasis.hh:50\n-Dune::Functions::LagrangeDGPreBasis::dofsPerPyramid\n-static const int dofsPerPyramid\n-Definition: lagrangedgbasis.hh:55\n-Dune::Functions::LagrangeDGPreBasis::gridView_\n-GridView gridView_\n-Definition: lagrangedgbasis.hh:200\n-Dune::Functions::LagrangeDGPreBasis::minMultiIndexSize\n-static constexpr size_type minMultiIndexSize\n-Definition: lagrangedgbasis.hh:61\n-Dune::Functions::LagrangeDGPreBasis::size_type\n-std::size_t size_type\n-Definition: lagrangedgbasis.hh:45\n-Dune::Functions::LagrangeDGPreBasis::dimension\n-size_type dimension() const\n-Definition: lagrangedgbasis.hh:145\n-Dune::Functions::LagrangeDGPreBasis::prismOffset_\n-size_t prismOffset_\n-Definition: lagrangedgbasis.hh:204\n-Dune::Functions::LagrangeDGPreBasis::dofsPerPrism\n-static const int dofsPerPrism\n-Definition: lagrangedgbasis.hh:53\n-Dune::Functions::BasisNodeMixin::size\n-size_type size() const\n-Definition: nodes.hh:142\n+ 248 void evaluateFunction(const typename Traits::DomainType& x,\n+ 249 std::vector& out) const\n+ 250 {\n+ 251 localValuedLocalBasis_->evaluateFunction(x,out);\n+ 252\n+ 253 Transformator::apply(out, x, element_->geometry());\n+ 254 }\n+ 255\n+ 261 void evaluateJacobian(const typename Traits::DomainType& x,\n+ 262 std::vector& out) const\n+ 263 {\n+ 264 localValuedLocalBasis_->evaluateJacobian(x,out);\n+ 265\n+ 266 Transformator::applyJacobian(out, x, element_->geometry());\n+ 267 }\n+ 268\n+ 275 void partial(const std::array& order,\n+ 276 const typename Traits::DomainType& x,\n+ 277 std::vector& out) const\n+ 278 {\n+ 279 auto totalOrder = std::accumulate(order.begin(), order.end(), 0);\n+ 280 if (totalOrder == 0) {\n+ 281 evaluateFunction(x, out);\n+ 282 } else if (totalOrder == 1) {\n+ 283 auto const direction = std::distance(order.begin(), std::find(order.begin\n+(), order.end(), 1));\n+ 284 out.resize(size());\n+ 285\n+ 286 // TODO: The following is wasteful: We compute the full Jacobian and then\n+return\n+ 287 // only a part of it. While we need the full Jacobian of the underlying\n+local-valued LFE,\n+ 288 // it should be possible to compute only a partial Piola transform for the\n+requested\n+ 289 // partial derivatives.\n+ 290 std::vector fullJacobian;\n+ 291 localValuedLocalBasis_->evaluateJacobian(x,fullJacobian);\n+ 292\n+ 293 Transformator::applyJacobian(fullJacobian, x, element_->geometry());\n+ 294\n+ 295 for (std::size_t i=0; iorder();\n+ 307 }\n+ 308\n+ 309 const LocalValuedLocalBasis* localValuedLocalBasis_;\n+ 310 const Element* element_;\n+ 311 };\n+ 312\n+ 321 template\n+ 322 class GlobalValuedLocalInterpolation\n+ 323 {\n+ 324 public:\n+ 327 void bind(const LocalValuedLocalInterpolation&\n+localValuedLocalInterpolation, const Element& element)\n+ 328 {\n+ 329 localValuedLocalInterpolation_ = &localValuedLocalInterpolation;\n+ 330 element_ = &element;\n+ 331 }\n+ 332\n+ 333 template\n+ 334 void interpolate (const F& f, std::vector& out) const\n+ 335 {\n+ 336 using LocalCoordinate = typename Element::Geometry::LocalCoordinate;\n+ 337 typename Transformator::template\n+LocalValuedFunction localValuedFunction(f,\n+*element_);\n+ 338 localValuedLocalInterpolation_->interpolate(localValuedFunction, out);\n+ 339 }\n+ 340\n+ 341 private:\n+ 342 const LocalValuedLocalInterpolation* localValuedLocalInterpolation_;\n+ 343 const Element* element_;\n+ 344 };\n+ 345\n+ 346\n+ 353 template\n+ 354 class GlobalValuedLocalFiniteElement\n+ 355 {\n+ 356 using LocalBasis = GlobalValuedLocalBasis;\n+ 359 using LocalInterpolation = GlobalValuedLocalInterpolation;\n+ 362\n+ 363 public:\n+ 366 using Traits = LocalFiniteElementTraits;\n+ 369\n+ 370 GlobalValuedLocalFiniteElement() {}\n+ 371\n+ 372 void bind(const LocalValuedLFE& localValuedLFE, const Element& element)\n+ 373 {\n+ 374 globalValuedLocalBasis_.bind(localValuedLFE.localBasis(), element);\n+ 375 globalValuedLocalInterpolation_.bind(localValuedLFE.localInterpolation(),\n+element);\n+ 376 localValuedLFE_ = &localValuedLFE;\n+ 377 }\n+ 378\n+ 381 const typename Traits::LocalBasisType& localBasis() const\n+ 382 {\n+ 383 return globalValuedLocalBasis_;\n+ 384 }\n+ 385\n+ 388 const typename Traits::LocalCoefficientsType& localCoefficients() const\n+ 389 {\n+ 390 return localValuedLFE_->localCoefficients();\n+ 391 }\n+ 392\n+ 395 const typename Traits::LocalInterpolationType& localInterpolation() const\n+ 396 {\n+ 397 return globalValuedLocalInterpolation_;\n+ 398 }\n+ 399\n+ 401 std::size_t size() const\n+ 402 {\n+ 403 return localValuedLFE_->size();\n+ 404 }\n+ 405\n+ 408 GeometryType type() const\n+ 409 {\n+ 410 return localValuedLFE_->type();\n+ 411 }\n+ 412\n+ 413 private:\n+ 414\n+ 415 typename Traits::LocalBasisType globalValuedLocalBasis_;\n+ 416 typename Traits::LocalInterpolationType globalValuedLocalInterpolation_;\n+ 417 const LocalValuedLFE* localValuedLFE_;\n+ 418 };\n+ 419\n+ 420} // namespace Dune::Functions::Impl\n+ 421\n+ 422#endif /\n+/ DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH\n+Dune::Functions::interpolate\n+void interpolate(const B &basis, C &&coeff, const F &f, const BV &bv, const\n+NTRE &nodeToRangeEntry)\n+Interpolate given function in discrete function space.\n+Definition: interpolate.hh:202\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00158.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00158.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: subspacebasis.hh File Reference\n+dune-functions: istlvectorbackend.hh File Reference\n \n \n \n \n \n \n \n@@ -58,61 +58,61 @@\n \n \n \n \n \n
    \n \n-
    subspacebasis.hh File Reference
    \n+
    istlvectorbackend.hh File Reference
    \n
    \n
    \n-
    #include <dune/common/reservedvector.hh>
    \n-#include <dune/common/typeutilities.hh>
    \n+
    #include <cstddef>
    \n+#include <utility>
    \n+#include <type_traits>
    \n+#include <dune/common/std/type_traits.hh>
    \n+#include <dune/common/indices.hh>
    \n+#include <dune/common/hybridutilities.hh>
    \n #include <dune/common/concept.hh>
    \n-#include <dune/functions/common/type_traits.hh>
    \n-#include <dune/functions/functionspacebases/subspacelocalview.hh>
    \n+#include <dune/functions/common/indexaccess.hh>
    \n #include <dune/functions/functionspacebases/concepts.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n-\n-\n-\n-

    \n-Classes

    class  Dune::Functions::SubspaceBasis< RB, TP >
     
    \n \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n

    \n 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. More...
     
    template<class RootBasis , class... PrefixTreeIndices>
    auto Dune::Functions::subspaceBasis (const RootBasis &rootBasis, const PrefixTreeIndices &... prefixTreeIndices)
     
    template<class V >
    constexpr auto Dune::Functions::fieldTypes ()
     Generate list of field types in container. More...
     
    template<class V >
    constexpr bool Dune::Functions::hasUniqueFieldType ()
     Check if container has a unique field type. More...
     
    template<class Vector >
    auto Dune::Functions::istlVectorBackend (Vector &v)
     Return a vector backend wrapping non-const ISTL like containers. More...
     
    template<class Vector >
    auto Dune::Functions::istlVectorBackend (const Vector &v)
     Return a vector backend wrapping const ISTL like containers. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,48 +4,47 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * functionspacebases\n-Classes | Namespaces | Functions\n-subspacebasis.hh File Reference\n-#include \n-#include \n+ * backends\n+Namespaces | Functions\n+istlvectorbackend.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n #include \n-#include \n-#include \n+#include \n #include \n Go_to_the_source_code_of_this_file.\n- Classes\n-class \u00a0Dune::Functions::SubspaceBasis<_RB,_TP_>\n-\u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n Functions\n-template\n- \u00a0Dune::Functions::SubspaceBasis (const RB &, const TP) -> SubspaceBasis<\n- RB, TP >\n-\u00a0\n-template\n- \u00a0Dune::Functions::SubspaceBasis (const SubspaceBasis< RootRootBasis,\n- InnerTP > &rootBasis, const OuterTP &prefixPath) -> SubspaceBasis< std::\n- decay_t< decltype(rootBasis.rootBasis())>, Impl::JoinTreePath_t< InnerTP,\n- OuterTP > >\n-\u00a0\n-template\n-auto\u00a0Dune::Functions::subspaceBasis (const RootBasis &rootBasis, const\n- TypeTree::HybridTreePath< PrefixTreeIndices... > &prefixPath)\n-\u00a0 Create SubspaceBasis from a root basis and a prefixPath. More...\n-\u00a0\n-template\n-auto\u00a0Dune::Functions::subspaceBasis (const RootBasis &rootBasis, const\n- PrefixTreeIndices &... prefixTreeIndices)\n+template\n+constexpr auto\u00a0Dune::Functions::fieldTypes ()\n+\u00a0 Generate list of field types in container. More...\n+\u00a0\n+template\n+constexpr bool\u00a0Dune::Functions::hasUniqueFieldType ()\n+\u00a0 Check if container has a unique field type. More...\n+\u00a0\n+template\n+ auto\u00a0Dune::Functions::istlVectorBackend (Vector &v)\n+\u00a0 Return a vector backend wrapping non-const ISTL like\n+ containers. More...\n+\u00a0\n+template\n+ auto\u00a0Dune::Functions::istlVectorBackend (const Vector &v)\n+\u00a0 Return a vector backend wrapping const ISTL like containers.\n+ More...\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00158_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00158_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: subspacebasis.hh Source File\n+dune-functions: istlvectorbackend.hh Source File\n \n \n \n \n \n \n \n@@ -58,187 +58,338 @@\n \n
    \n \n \n \n
    \n-
    subspacebasis.hh
    \n+
    istlvectorbackend.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACEBASIS_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACEBASIS_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ISTLVECTORBACKEND_HH
    \n+
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ISTLVECTORBACKEND_HH
    \n
    5
    \n-
    6#include <dune/common/reservedvector.hh>
    \n-
    7#include <dune/common/typeutilities.hh>
    \n-
    8#include <dune/common/concept.hh>
    \n+
    6#include <cstddef>
    \n+
    7#include <utility>
    \n+
    8#include <type_traits>
    \n
    9
    \n-\n-\n-\n-
    13
    \n+
    10#include <dune/common/std/type_traits.hh>
    \n+
    11#include <dune/common/indices.hh>
    \n+
    12#include <dune/common/hybridutilities.hh>
    \n+
    13#include <dune/common/concept.hh>
    \n
    14
    \n-
    15
    \n-
    16namespace Dune {
    \n-
    17namespace Functions {
    \n+\n+\n+
    17
    \n
    18
    \n-
    19
    \n-
    20
    \n-
    21namespace Impl {
    \n-
    22
    \n-
    23 template<class... Inner, class... Outer>
    \n-
    24 auto joinTreePaths(const TypeTree::HybridTreePath<Inner...>& inner, const TypeTree::HybridTreePath<Outer...> outer)
    \n-
    25 {
    \n-
    26 return TypeTree::HybridTreePath<Inner..., Outer...>(std::tuple_cat(inner._data, outer._data));
    \n-
    27 }
    \n-
    28
    \n-
    29 template<class InnerTP, class OuterTP>
    \n-
    30 using JoinTreePath_t = std::decay_t<decltype(joinTreePaths(std::declval<InnerTP>(), std::declval<OuterTP>()))>;
    \n-
    31
    \n-
    32}
    \n-
    33
    \n-
    34
    \n-
    35
    \n-
    36template<class RB, class TP>
    \n-\n-
    38{
    \n-
    39public:
    \n-
    40
    \n-
    41 using RootBasis = RB;
    \n-
    42
    \n-
    43 using RootLocalView = typename RootBasis::LocalView;
    \n-
    44
    \n-
    45 using PrefixPath = TP;
    \n-
    46
    \n-
    48 using GridView = typename RootBasis::GridView;
    \n+
    19namespace Dune {
    \n+
    20namespace Functions {
    \n+
    21
    \n+
    22namespace Impl {
    \n+
    23
    \n+
    24template<class V,
    \n+
    25 std::enable_if_t<not Dune::models<Imp::Concept::HasStaticIndexAccess, V>() , int> = 0>
    \n+
    26auto fieldTypes(V&& /*v*/)
    \n+
    27{
    \n+
    28 return TypeList<V>{};
    \n+
    29}
    \n+
    30
    \n+
    31template<class V,
    \n+
    32 std::enable_if_t<Dune::models<Imp::Concept::HasStaticIndexAccess, V>(), int> = 0>
    \n+
    33auto fieldTypes(V&& v)
    \n+
    34{
    \n+
    35 if constexpr (Dune::models<Imp::Concept::HasDynamicIndexAccess<std::size_t>, V>())
    \n+
    36 return fieldTypes(v[std::size_t{0}]);
    \n+
    37 else
    \n+
    38 {
    \n+
    39 auto indexRange = typename decltype(range(Hybrid::size(v)))::integer_sequence();
    \n+
    40 return unpackIntegerSequence([&](auto... i) {
    \n+
    41 return uniqueTypeList(std::tuple_cat(fieldTypes(v[i])...));
    \n+
    42 }, indexRange);
    \n+
    43 }
    \n+
    44}
    \n+
    45
    \n+
    46} // namespace Impl
    \n+
    47
    \n+
    48
    \n
    49
    \n-
    51 using MultiIndex = typename RootBasis::MultiIndex;
    \n-
    52
    \n-
    53 using size_type = std::size_t;
    \n-
    54
    \n-\n-
    57
    \n-
    58 using SizePrefix = typename RootBasis::SizePrefix;
    \n-
    59
    \n-
    60
    \n-\n-\n-\n-
    65 {}
    \n-
    66
    \n-
    72 template<class RootRootBasis, class InnerTP, class OuterTP>
    \n-\n-\n-
    75 {}
    \n-
    76
    \n-
    77
    \n-
    80 const GridView& gridView() const
    \n-
    81 {
    \n-
    82 return rootBasis_->gridView();
    \n-
    83 }
    \n-
    84
    \n-\n-
    89 {
    \n-
    90 return rootBasis_->dimension();
    \n-
    91 }
    \n-
    92
    \n-\n-
    95 {
    \n-
    96 return rootBasis_->size();
    \n-
    97 }
    \n-
    98
    \n-
    100 size_type size(const SizePrefix& prefix) const
    \n-
    101 {
    \n-
    102 return rootBasis_->size(prefix);
    \n-
    103 }
    \n-
    104
    \n-\n-
    109 {
    \n-
    110 return LocalView(*this, prefixPath_);
    \n-
    111 }
    \n-
    112
    \n-
    113 const RootBasis& rootBasis() const
    \n-
    114 {
    \n-
    115 return *rootBasis_;
    \n-
    116 }
    \n-
    117
    \n-
    118 const PrefixPath& prefixPath() const
    \n-
    119 {
    \n-
    120 return prefixPath_;
    \n-
    121 }
    \n+
    62template<class V>
    \n+
    63constexpr auto fieldTypes()
    \n+
    64{
    \n+
    65 return decltype(Impl::fieldTypes(std::declval<V>())){};
    \n+
    66}
    \n+
    67
    \n+
    73template<class V>
    \n+
    74constexpr bool hasUniqueFieldType()
    \n+
    75{
    \n+
    76 return std::tuple_size<std::decay_t<decltype(fieldTypes<V>())>>::value==1;
    \n+
    77}
    \n+
    78
    \n+
    79
    \n+
    80
    \n+
    81namespace Impl {
    \n+
    82
    \n+
    83/*
    \n+
    84 * \\brief A wrapper providing multi-index access to vector entries
    \n+
    85 *
    \n+
    86 * The wrapped vector type should be an istl like random
    \n+
    87 * access container providing operator[] and size() methods.
    \n+
    88 * For classical containers this should support indices
    \n+
    89 * of type std::size_t. For multi-type containers indices
    \n+
    90 * of the form Dune::index_constant<i> should be supported
    \n+
    91 * while size() should be a static constexpr method.
    \n+
    92 *
    \n+
    93 * When resolving multi-indices the backend appends indices
    \n+
    94 * using operator[] as long as the result is not a scalar.
    \n+
    95 * If this exhausts the digits of the multi-index, additional
    \n+
    96 * zero`s are appended.
    \n+
    97 *
    \n+
    98 * \\tparam V Type of the raw wrapper vector
    \n+
    99 */
    \n+
    100template<class V>
    \n+
    101class ISTLVectorBackend
    \n+
    102{
    \n+
    103
    \n+
    104 // Template aliases for using detection idiom.
    \n+
    105 template<class C>
    \n+
    106 using dynamicIndexAccess_t = decltype(std::declval<C>()[0]);
    \n+
    107
    \n+
    108 template<class C>
    \n+
    109 using staticIndexAccess_t = decltype(std::declval<C>()[Dune::Indices::_0]);
    \n+
    110
    \n+
    111 template<class C>
    \n+
    112 using resizeMethod_t = decltype(std::declval<C>().resize(0));
    \n+
    113
    \n+
    114
    \n+
    115
    \n+
    116 // Short cuts for feature detection
    \n+
    117 template<class C>
    \n+
    118 using hasDynamicIndexAccess = Dune::Std::is_detected<dynamicIndexAccess_t, std::remove_reference_t<C>>;
    \n+
    119
    \n+
    120 template<class C>
    \n+
    121 using hasStaticIndexAccess = Dune::Std::is_detected<staticIndexAccess_t, std::remove_reference_t<C>>;
    \n
    122
    \n-
    123protected:
    \n-\n-\n-
    126};
    \n-
    127
    \n+
    123 template<class C>
    \n+
    124 using hasResizeMethod = Dune::Std::is_detected<resizeMethod_t, std::remove_reference_t<C>>;
    \n+
    125
    \n+
    126 template<class C>
    \n+
    127 using isDynamicVector = Dune::Std::is_detected<dynamicIndexAccess_t, std::remove_reference_t<C>>;
    \n
    128
    \n-
    129// CTAD guide for a non-SubspaceBasis root basis
    \n-
    130template<class RB, class TP>
    \n-
    131SubspaceBasis(const RB&, const TP) -> SubspaceBasis<RB, TP>;
    \n-
    132
    \n-
    133// CTAD guide for a SubspaceBasis root basis
    \n-
    134template<class RootRootBasis, class InnerTP, class OuterTP>
    \n-
    135SubspaceBasis(const SubspaceBasis<RootRootBasis, InnerTP>& rootBasis, const OuterTP& prefixPath)
    \n-
    136 -> SubspaceBasis<std::decay_t<decltype(rootBasis.rootBasis())>, Impl::JoinTreePath_t<InnerTP, OuterTP>>;
    \n-
    137
    \n-
    138
    \n+
    129 template<class C>
    \n+
    130 using isStaticVector = Dune::Std::bool_constant<
    \n+
    131 Dune::Std::is_detected_v<staticIndexAccess_t, std::remove_reference_t<C>>
    \n+
    132 and not Dune::Std::is_detected_v<dynamicIndexAccess_t, std::remove_reference_t<C>>>;
    \n+
    133
    \n+
    134 template<class C>
    \n+
    135 using isScalar = Dune::Std::bool_constant<not Dune::Std::is_detected_v<staticIndexAccess_t, std::remove_reference_t<C>>>;
    \n+
    136
    \n+
    137 template<class C>
    \n+
    138 using isVector = Dune::Std::bool_constant<Dune::Std::is_detected_v<staticIndexAccess_t, std::remove_reference_t<C>>>;
    \n
    139
    \n-
    150template<class RootBasis, class... PrefixTreeIndices>
    \n-
    151auto subspaceBasis(const RootBasis& rootBasis, const TypeTree::HybridTreePath<PrefixTreeIndices...>& prefixPath)
    \n-
    152{
    \n-
    153 return SubspaceBasis(rootBasis, prefixPath);
    \n-
    154}
    \n-
    155
    \n-
    156template<class RootBasis, class... PrefixTreeIndices>
    \n-
    157auto subspaceBasis(const RootBasis& rootBasis, const PrefixTreeIndices&... prefixTreeIndices)
    \n-
    158{
    \n-
    159 return subspaceBasis(rootBasis, TypeTree::hybridTreePath(prefixTreeIndices...));
    \n-
    160}
    \n-
    161
    \n-
    162
    \n-
    163
    \n-
    164} // end namespace Functions
    \n-
    165} // end namespace Dune
    \n-
    166
    \n-
    167
    \n-
    168
    \n-
    169#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH
    \n-\n-\n+
    140
    \n+
    141
    \n+
    142 template<class... Args>
    \n+
    143 static void forwardToResize(Args&&... args)
    \n+
    144 {
    \n+
    145 resize(std::forward<Args>(args)...);
    \n+
    146 }
    \n+
    147
    \n+
    148
    \n+
    149 template<class C, class SizeProvider,
    \n+
    150 std::enable_if_t<hasResizeMethod<C>::value, int> = 0>
    \n+
    151 static void resize(C&& c, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
    \n+
    152 {
    \n+
    153 auto size = sizeProvider.size(prefix);
    \n+
    154 if (size==0)
    \n+
    155 {
    \n+
    156 // If size==0 this prefix refers to a single coefficient c.
    \n+
    157 // But being in this overload means that c is not a scalar
    \n+
    158 // because is has a resize() method. Since operator[] deliberately
    \n+
    159 // supports implicit padding of multi-indices by as many
    \n+
    160 // [0]'s as needed to resolve a scalar entry, we should also
    \n+
    161 // except a non-scalar c here. However, this requires that
    \n+
    162 // we silently believe that whatever size c already has is
    \n+
    163 // intended by the user. The only exception is c.size()==0
    \n+
    164 // which is not acceptable but we also cannot know the desired size.
    \n+
    165 if (c.size()==0)
    \n+
    166 DUNE_THROW(RangeError, "The vector entry v[" << prefix << "] should refer to a "
    \n+
    167 << "scalar coefficient, but is a dynamically sized vector of size==0");
    \n+
    168 else
    \n+
    169 // Accept non-zero sized coefficients to avoid that resize(basis)
    \n+
    170 // fails for a vector that works with operator[] and already
    \n+
    171 // has the appropriate size.
    \n+
    172 return;
    \n+
    173 }
    \n+
    174 c.resize(size);
    \n+
    175 prefix.push_back(0);
    \n+
    176 for(std::size_t i=0; i<size; ++i)
    \n+
    177 {
    \n+
    178 prefix.back() = i;
    \n+
    179 resize(c[i], sizeProvider, prefix);
    \n+
    180 }
    \n+
    181 }
    \n+
    182
    \n+
    183 template<class C, class SizeProvider,
    \n+
    184 std::enable_if_t<not hasResizeMethod<C>::value, int> = 0,
    \n+
    185 std::enable_if_t<isVector<C>::value, int> = 0>
    \n+
    186 static void resize(C&& c, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
    \n+
    187 {
    \n+
    188 auto size = sizeProvider.size(prefix);
    \n+
    189 // If size == 0 there's nothing to do:
    \n+
    190 // We can't resize c and it's already
    \n+
    191 // large enough anyway.
    \n+
    192 if (size == 0)
    \n+
    193 return;
    \n+
    194
    \n+
    195 // If size>0 but c does not have the appropriate
    \n+
    196 // size we throw an exception.
    \n+
    197 //
    \n+
    198 // We could perhaps also allow c.size()>size.
    \n+
    199 // But then looping the loop below gets complicated:
    \n+
    200 // We're not allowed to loop until c.size(). But
    \n+
    201 // we also cannot use size for termination,
    \n+
    202 // because this fails if c is a static vector.
    \n+
    203 if (c.size() != size)
    \n+
    204 DUNE_THROW(RangeError, "Can't resize non-resizable entry v[" << prefix << "] of size " << c.size() << " to size(" << prefix << ")=" << size);
    \n+
    205
    \n+
    206 // Recursively resize all entries of c now.
    \n+
    207 using namespace Dune::Hybrid;
    \n+
    208 prefix.push_back(0);
    \n+
    209 forEach(integralRange(Hybrid::size(c)), [&](auto&& i) {
    \n+
    210 prefix.back() = i;
    \n+
    211 // Here we'd simply like to call resize(c[i], sizeProvider, prefix);
    \n+
    212 // but even gcc-7 does not except this bus reports
    \n+
    213 // "error: \u2018this\u2019 was not captured for this lambda function"
    \n+
    214 // although there's no 'this' because we're in a static method.
    \n+
    215 // Bypassing this by and additional method that does perfect
    \n+
    216 // forwarding allows to workaround this.
    \n+
    217 ISTLVectorBackend<V>::forwardToResize(c[i], sizeProvider, prefix);
    \n+
    218 });
    \n+
    219 }
    \n+
    220
    \n+
    221 template<class C, class SizeProvider,
    \n+
    222 std::enable_if_t<not hasResizeMethod<C>::value, int> = 0,
    \n+
    223 std::enable_if_t<isScalar<C>::value, int> = 0>
    \n+
    224 static void resize(C&&, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
    \n+
    225 {
    \n+
    226 auto size = sizeProvider.size(prefix);
    \n+
    227 if (size != 0)
    \n+
    228 DUNE_THROW(RangeError, "Can't resize scalar vector entry v[" << prefix << "] to size(" << prefix << ")=" << size);
    \n+
    229 }
    \n+
    230
    \n+
    231 template<class C, class T,
    \n+
    232 std::enable_if_t<std::is_assignable<C&,T>::value, int> = 0>
    \n+
    233 void recursiveAssign(C& c, const T& t)
    \n+
    234 {
    \n+
    235 c = t;
    \n+
    236 }
    \n+
    237
    \n+
    238 template<class C, class T,
    \n+
    239 std::enable_if_t<not std::is_assignable<C&,T>::value, int> = 0>
    \n+
    240 void recursiveAssign(C& c, const T& t)
    \n+
    241 {
    \n+
    242 Dune::Hybrid::forEach(c, [&](auto&& ci) {
    \n+
    243 recursiveAssign(ci, t);
    \n+
    244 });
    \n+
    245 }
    \n+
    246
    \n+
    247public:
    \n+
    248
    \n+
    249 using Vector = V;
    \n+
    250
    \n+
    251 ISTLVectorBackend(Vector& vector) :
    \n+
    252 vector_(&vector)
    \n+
    253 {}
    \n+
    254
    \n+
    255 template<class SizeProvider>
    \n+
    256 void resize(const SizeProvider& sizeProvider)
    \n+
    257 {
    \n+
    258 auto prefix = typename SizeProvider::SizePrefix();
    \n+
    259 prefix.resize(0);
    \n+
    260 resize(*vector_, sizeProvider, prefix);
    \n+
    261 }
    \n+
    262
    \n+
    263 template<class MultiIndex>
    \n+
    264 decltype(auto) operator[](const MultiIndex& index) const
    \n+
    265 {
    \n+
    266 return resolveDynamicMultiIndex(*vector_, index);
    \n+
    267 }
    \n+
    268
    \n+
    269 template<class MultiIndex>
    \n+
    270 decltype(auto) operator[](const MultiIndex& index)
    \n+
    271 {
    \n+
    272 return resolveDynamicMultiIndex(*vector_, index);
    \n+
    273 }
    \n+
    274
    \n+
    283 template<typename T>
    \n+
    284 void operator= (const T& other)
    \n+
    285 {
    \n+
    286 recursiveAssign(vector(), other);
    \n+
    287 }
    \n+
    288
    \n+
    289 template<typename T>
    \n+
    290 void operator= (const ISTLVectorBackend<T>& other)
    \n+
    291 {
    \n+
    292 vector() = other.vector();
    \n+
    293 }
    \n+
    294
    \n+
    295 const Vector& vector() const
    \n+
    296 {
    \n+
    297 return *vector_;
    \n+
    298 }
    \n+
    299
    \n+
    300 Vector& vector()
    \n+
    301 {
    \n+
    302 return *vector_;
    \n+
    303 }
    \n+
    304
    \n+
    305private:
    \n+
    306
    \n+
    307 Vector* vector_;
    \n+
    308};
    \n+
    309
    \n+
    310} // end namespace Impl
    \n+
    311
    \n+
    312
    \n+
    313
    \n+
    345template<class Vector>
    \n+
    346auto istlVectorBackend(Vector& v)
    \n+
    347{
    \n+
    348 static_assert(hasUniqueFieldType<Vector&>(), "Vector type passed to istlVectorBackend() does not have a unique field type.");
    \n+
    349 return Impl::ISTLVectorBackend<Vector>(v);
    \n+
    350}
    \n+
    351
    \n+
    352
    \n+
    353
    \n+
    383template<class Vector>
    \n+
    384auto istlVectorBackend(const Vector& v)
    \n+
    385{
    \n+
    386 static_assert(hasUniqueFieldType<const Vector&>(), "Vector type passed to istlVectorBackend() does not have a unique field type.");
    \n+
    387 return Impl::ISTLVectorBackend<const Vector>(v);
    \n+
    388}
    \n+
    389
    \n+
    390
    \n+
    391
    \n+
    392} // namespace Functions
    \n+
    393} // namespace Dune
    \n+
    394
    \n+
    395
    \n+
    396#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ISTLVECTORBACKEND_HH
    \n+\n+
    auto istlVectorBackend(Vector &v)
    Return a vector backend wrapping non-const ISTL like containers.
    Definition: istlvectorbackend.hh:346
    \n+
    constexpr decltype(auto) resolveDynamicMultiIndex(C &&c, const MultiIndex &multiIndex, const IsFinal &isFinal)
    Provide multi-index access by chaining operator[].
    Definition: indexaccess.hh:354
    \n
    Definition: polynomial.hh:10
    \n-
    SubspaceBasis(const RB &, const TP) -> SubspaceBasis< RB, TP >
    \n-
    auto subspaceBasis(const RootBasis &rootBasis, const TypeTree::HybridTreePath< PrefixTreeIndices... > &prefixPath)
    Create SubspaceBasis from a root basis and a prefixPath.
    Definition: subspacebasis.hh:151
    \n-
    Definition: subspacebasis.hh:38
    \n-
    typename RootBasis::LocalView RootLocalView
    Definition: subspacebasis.hh:43
    \n-
    LocalView localView() const
    Return local view for basis.
    Definition: subspacebasis.hh:108
    \n-
    const RootBasis * rootBasis_
    Definition: subspacebasis.hh:124
    \n-
    typename RootBasis::SizePrefix SizePrefix
    Definition: subspacebasis.hh:58
    \n-
    TP PrefixPath
    Definition: subspacebasis.hh:45
    \n-
    SubspaceLocalView< RootLocalView, PrefixPath > LocalView
    Type of the local view on the restriction of the basis to a single element.
    Definition: subspacebasis.hh:56
    \n-
    size_type size(const SizePrefix &prefix) const
    Return number possible values for next position in multi index.
    Definition: subspacebasis.hh:100
    \n-
    typename RootBasis::GridView GridView
    The grid view that the FE space is defined on.
    Definition: subspacebasis.hh:48
    \n-
    const PrefixPath & prefixPath() const
    Definition: subspacebasis.hh:118
    \n-
    SubspaceBasis(const SubspaceBasis< RootRootBasis, InnerTP > &rootBasis, const OuterTP &prefixPath)
    Constructor from another SubspaceBasis.
    Definition: subspacebasis.hh:73
    \n-
    const GridView & gridView() const
    Obtain the grid view that the basis is defined on.
    Definition: subspacebasis.hh:80
    \n-
    RB RootBasis
    Definition: subspacebasis.hh:41
    \n-
    PrefixPath prefixPath_
    Definition: subspacebasis.hh:125
    \n-
    size_type size() const
    Return number of possible values for next position in empty multi index.
    Definition: subspacebasis.hh:94
    \n-
    const RootBasis & rootBasis() const
    Definition: subspacebasis.hh:113
    \n-
    typename RootBasis::MultiIndex MultiIndex
    Type used for global numbering of the basis vectors.
    Definition: subspacebasis.hh:51
    \n-
    size_type dimension() const
    Definition: subspacebasis.hh:88
    \n-
    std::size_t size_type
    Definition: subspacebasis.hh:53
    \n-
    SubspaceBasis(const RootBasis &rootBasis, const PrefixPath &prefixPath)
    Constructor for a given grid view object.
    Definition: subspacebasis.hh:62
    \n-
    The restriction of a finite element basis to a single element.
    Definition: subspacelocalview.hh:30
    \n+
    constexpr auto fieldTypes()
    Generate list of field types in container.
    Definition: istlvectorbackend.hh:63
    \n+
    constexpr bool hasUniqueFieldType()
    Check if container has a unique field type.
    Definition: istlvectorbackend.hh:74
    \n \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "encoding", "source2": "encoding", "unified_diff": "@@ -1 +1 @@\n-us-ascii\n+utf-8\n"}, {"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,247 +4,365 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * functionspacebases\n-subspacebasis.hh\n+ * backends\n+istlvectorbackend.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACEBASIS_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBSPACEBASIS_HH\n+ 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ISTLVECTORBACKEND_HH\n+ 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ISTLVECTORBACKEND_HH\n 5\n- 6#include \n- 7#include \n- 8#include \n+ 6#include \n+ 7#include \n+ 8#include \n 9\n- 10#include \n- 11#include \n- 12#include \n- 13\n+ 10#include \n+ 11#include \n+ 12#include \n+ 13#include \n 14\n- 15\n- 16namespace Dune {\n- 17namespace Functions {\n+ 15#include \n+ 16#include \n+ 17\n 18\n- 19\n- 20\n- 21namespace Impl {\n- 22\n- 23 template\n- 24 auto joinTreePaths(const TypeTree::HybridTreePath& inner, const\n-TypeTree::HybridTreePath outer)\n- 25 {\n- 26 return TypeTree::HybridTreePath(std::tuple_cat\n-(inner._data, outer._data));\n- 27 }\n- 28\n- 29 template\n- 30 using JoinTreePath_t = std::decay_t(), std::declval()))>;\n- 31\n- 32}\n- 33\n- 34\n- 35\n- 36template\n-37class SubspaceBasis\n- 38{\n- 39public:\n- 40\n-41 using RootBasis = RB;\n- 42\n-43 using RootLocalView = typename RootBasis::LocalView;\n- 44\n-45 using PrefixPath = TP;\n- 46\n-48 using GridView = typename RootBasis::GridView;\n+ 19namespace Dune {\n+ 20namespace Functions {\n+ 21\n+ 22namespace Impl {\n+ 23\n+ 24template()\n+, int> = 0>\n+ 26auto fieldTypes(V&& /*v*/)\n+ 27{\n+ 28 return TypeList{};\n+ 29}\n+ 30\n+ 31template(),\n+int> = 0>\n+ 33auto fieldTypes(V&& v)\n+ 34{\n+ 35 if constexpr (Dune::models, V>())\n+ 36 return fieldTypes(v[std::size_t{0}]);\n+ 37 else\n+ 38 {\n+ 39 auto indexRange = typename decltype(range(Hybrid::size(v)))::\n+integer_sequence();\n+ 40 return unpackIntegerSequence([&](auto... i) {\n+ 41 return uniqueTypeList(std::tuple_cat(fieldTypes(v[i])...));\n+ 42 }, indexRange);\n+ 43 }\n+ 44}\n+ 45\n+ 46} // namespace Impl\n+ 47\n+ 48\n 49\n-51 using MultiIndex = typename RootBasis::MultiIndex;\n- 52\n-53 using size_type = std::size_t;\n- 54\n-56 using LocalView = SubspaceLocalView;\n- 57\n-58 using SizePrefix = typename RootBasis::SizePrefix;\n- 59\n- 60\n-62 SubspaceBasis(const RootBasis& rootBasis, const PrefixPath& prefixPath) :\n- 63 rootBasis_(&rootBasis),\n- 64 prefixPath_(prefixPath)\n- 65 {}\n- 66\n- 72 template\n-73 SubspaceBasis(const SubspaceBasis& rootBasis, const\n-OuterTP& prefixPath) :\n- 74 SubspaceBasis(rootBasis.rootBasis(), Impl::joinTreePaths\n-(rootBasis.prefixPath(), prefixPath))\n- 75 {}\n- 76\n- 77\n-80 const GridView& gridView() const\n- 81 {\n- 82 return rootBasis_->gridView();\n- 83 }\n- 84\n-88 size_type dimension() const\n- 89 {\n- 90 return rootBasis_->dimension();\n- 91 }\n- 92\n-94 size_type size() const\n- 95 {\n- 96 return rootBasis_->size();\n- 97 }\n- 98\n-100 size_type size(const SizePrefix& prefix) const\n- 101 {\n- 102 return rootBasis_->size(prefix);\n- 103 }\n- 104\n-108 LocalView localView() const\n- 109 {\n- 110 return LocalView(*this, prefixPath_);\n- 111 }\n- 112\n-113 const RootBasis& rootBasis() const\n- 114 {\n- 115 return *rootBasis_;\n- 116 }\n- 117\n-118 const PrefixPath& prefixPath() const\n- 119 {\n- 120 return prefixPath_;\n- 121 }\n+ 62template\n+63constexpr auto fieldTypes()\n+ 64{\n+ 65 return decltype(Impl::fieldTypes(std::declval())){};\n+ 66}\n+ 67\n+ 73template\n+74constexpr bool hasUniqueFieldType()\n+ 75{\n+ 76 return std::tuple_size())>>::value==1;\n+ 77}\n+ 78\n+ 79\n+ 80\n+ 81namespace Impl {\n+ 82\n+ 83/*\n+ 84 * \\brief A wrapper providing multi-index access to vector entries\n+ 85 *\n+ 86 * The wrapped vector type should be an istl like random\n+ 87 * access container providing operator[] and size() methods.\n+ 88 * For classical containers this should support indices\n+ 89 * of type std::size_t. For multi-type containers indices\n+ 90 * of the form Dune::index_constant should be supported\n+ 91 * while size() should be a static constexpr method.\n+ 92 *\n+ 93 * When resolving multi-indices the backend appends indices\n+ 94 * using operator[] as long as the result is not a scalar.\n+ 95 * If this exhausts the digits of the multi-index, additional\n+ 96 * zero`s are appended.\n+ 97 *\n+ 98 * \\tparam V Type of the raw wrapper vector\n+ 99 */\n+ 100template\n+ 101class ISTLVectorBackend\n+ 102{\n+ 103\n+ 104 // Template aliases for using detection idiom.\n+ 105 template\n+ 106 using dynamicIndexAccess_t = decltype(std::declval()[0]);\n+ 107\n+ 108 template\n+ 109 using staticIndexAccess_t = decltype(std::declval()[Dune::Indices::\n+_0]);\n+ 110\n+ 111 template\n+ 112 using resizeMethod_t = decltype(std::declval().resize(0));\n+ 113\n+ 114\n+ 115\n+ 116 // Short cuts for feature detection\n+ 117 template\n+ 118 using hasDynamicIndexAccess = Dune::Std::is_detected>;\n+ 119\n+ 120 template\n+ 121 using hasStaticIndexAccess = Dune::Std::is_detected>;\n 122\n- 123protected:\n-124 const RootBasis* rootBasis_;\n-125 PrefixPath prefixPath_;\n- 126};\n- 127\n+ 123 template\n+ 124 using hasResizeMethod = Dune::Std::is_detected>;\n+ 125\n+ 126 template\n+ 127 using isDynamicVector = Dune::Std::is_detected>;\n 128\n- 129// CTAD guide for a non-SubspaceBasis root basis\n- 130template\n-131SubspaceBasis(const RB&, const TP) -> SubspaceBasis;\n- 132\n- 133// CTAD guide for a SubspaceBasis root basis\n- 134template\n-135SubspaceBasis(const SubspaceBasis& rootBasis, const\n-OuterTP& prefixPath)\n- 136 -> SubspaceBasis, Impl::\n-JoinTreePath_t>;\n- 137\n- 138\n+ 129 template\n+ 130 using isStaticVector = Dune::Std::bool_constant<\n+ 131 Dune::Std::is_detected_v>\n+ 132 and not Dune::Std::is_detected_v>>;\n+ 133\n+ 134 template\n+ 135 using isScalar = Dune::Std::bool_constant>>;\n+ 136\n+ 137 template\n+ 138 using isVector = Dune::Std::bool_constant>>;\n 139\n- 150template\n-151auto subspaceBasis(const RootBasis& rootBasis, const TypeTree::\n-HybridTreePath& prefixPath)\n- 152{\n- 153 return SubspaceBasis(rootBasis, prefixPath);\n- 154}\n- 155\n- 156template\n-157auto subspaceBasis(const RootBasis& rootBasis, const PrefixTreeIndices&...\n-prefixTreeIndices)\n- 158{\n- 159 return subspaceBasis(rootBasis, TypeTree::hybridTreePath\n-(prefixTreeIndices...));\n- 160}\n- 161\n- 162\n- 163\n- 164} // end namespace Functions\n- 165} // end namespace Dune\n- 166\n- 167\n- 168\n- 169#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTGLOBALBASIS_HH\n-type_traits.hh\n-subspacelocalview.hh\n+ 140\n+ 141\n+ 142 template\n+ 143 static void forwardToResize(Args&&... args)\n+ 144 {\n+ 145 resize(std::forward(args)...);\n+ 146 }\n+ 147\n+ 148\n+ 149 template::value, int> = 0>\n+ 151 static void resize(C&& c, const SizeProvider& sizeProvider, typename\n+SizeProvider::SizePrefix prefix)\n+ 152 {\n+ 153 auto size = sizeProvider.size(prefix);\n+ 154 if (size==0)\n+ 155 {\n+ 156 // If size==0 this prefix refers to a single coefficient c.\n+ 157 // But being in this overload means that c is not a scalar\n+ 158 // because is has a resize() method. Since operator[] deliberately\n+ 159 // supports implicit padding of multi-indices by as many\n+ 160 // [0]'s as needed to resolve a scalar entry, we should also\n+ 161 // except a non-scalar c here. However, this requires that\n+ 162 // we silently believe that whatever size c already has is\n+ 163 // intended by the user. The only exception is c.size()==0\n+ 164 // which is not acceptable but we also cannot know the desired size.\n+ 165 if (c.size()==0)\n+ 166 DUNE_THROW(RangeError, \"The vector entry v[\" << prefix << \"] should refer\n+to a \"\n+ 167 << \"scalar coefficient, but is a dynamically sized vector of size==0\");\n+ 168 else\n+ 169 // Accept non-zero sized coefficients to avoid that resize(basis)\n+ 170 // fails for a vector that works with operator[] and already\n+ 171 // has the appropriate size.\n+ 172 return;\n+ 173 }\n+ 174 c.resize(size);\n+ 175 prefix.push_back(0);\n+ 176 for(std::size_t i=0; i::value, int> = 0,\n+ 185 std::enable_if_t::value, int> = 0>\n+ 186 static void resize(C&& c, const SizeProvider& sizeProvider, typename\n+SizeProvider::SizePrefix prefix)\n+ 187 {\n+ 188 auto size = sizeProvider.size(prefix);\n+ 189 // If size == 0 there's nothing to do:\n+ 190 // We can't resize c and it's already\n+ 191 // large enough anyway.\n+ 192 if (size == 0)\n+ 193 return;\n+ 194\n+ 195 // If size>0 but c does not have the appropriate\n+ 196 // size we throw an exception.\n+ 197 //\n+ 198 // We could perhaps also allow c.size()>size.\n+ 199 // But then looping the loop below gets complicated:\n+ 200 // We're not allowed to loop until c.size(). But\n+ 201 // we also cannot use size for termination,\n+ 202 // because this fails if c is a static vector.\n+ 203 if (c.size() != size)\n+ 204 DUNE_THROW(RangeError, \"Can't resize non-resizable entry v[\" << prefix <<\n+\"] of size \" << c.size() << \" to size(\" << prefix << \")=\" << size);\n+ 205\n+ 206 // Recursively resize all entries of c now.\n+ 207 using namespace Dune::Hybrid;\n+ 208 prefix.push_back(0);\n+ 209 forEach(integralRange(Hybrid::size(c)), [&](auto&& i) {\n+ 210 prefix.back() = i;\n+ 211 // Here we'd simply like to call resize(c[i], sizeProvider, prefix);\n+ 212 // but even gcc-7 does not except this bus reports\n+ 213 // \"error: \u2018this\u2019 was not captured for this lambda function\"\n+ 214 // although there's no 'this' because we're in a static method.\n+ 215 // Bypassing this by and additional method that does perfect\n+ 216 // forwarding allows to workaround this.\n+ 217 ISTLVectorBackend::forwardToResize(c[i], sizeProvider, prefix);\n+ 218 });\n+ 219 }\n+ 220\n+ 221 template::value, int> = 0,\n+ 223 std::enable_if_t::value, int> = 0>\n+ 224 static void resize(C&&, const SizeProvider& sizeProvider, typename\n+SizeProvider::SizePrefix prefix)\n+ 225 {\n+ 226 auto size = sizeProvider.size(prefix);\n+ 227 if (size != 0)\n+ 228 DUNE_THROW(RangeError, \"Can't resize scalar vector entry v[\" << prefix <<\n+\"] to size(\" << prefix << \")=\" << size);\n+ 229 }\n+ 230\n+ 231 template::value, int> = 0>\n+ 233 void recursiveAssign(C& c, const T& t)\n+ 234 {\n+ 235 c = t;\n+ 236 }\n+ 237\n+ 238 template::value, int> = 0>\n+ 240 void recursiveAssign(C& c, const T& t)\n+ 241 {\n+ 242 Dune::Hybrid::forEach(c, [&](auto&& ci) {\n+ 243 recursiveAssign(ci, t);\n+ 244 });\n+ 245 }\n+ 246\n+ 247public:\n+ 248\n+ 249 using Vector = V;\n+ 250\n+ 251 ISTLVectorBackend(Vector& vector) :\n+ 252 vector_(&vector)\n+ 253 {}\n+ 254\n+ 255 template\n+ 256 void resize(const SizeProvider& sizeProvider)\n+ 257 {\n+ 258 auto prefix = typename SizeProvider::SizePrefix();\n+ 259 prefix.resize(0);\n+ 260 resize(*vector_, sizeProvider, prefix);\n+ 261 }\n+ 262\n+ 263 template\n+ 264 decltype(auto) operator[](const MultiIndex& index) const\n+ 265 {\n+ 266 return resolveDynamicMultiIndex(*vector_, index);\n+ 267 }\n+ 268\n+ 269 template\n+ 270 decltype(auto) operator[](const MultiIndex& index)\n+ 271 {\n+ 272 return resolveDynamicMultiIndex(*vector_, index);\n+ 273 }\n+ 274\n+ 283 template\n+ 284 void operator= (const T& other)\n+ 285 {\n+ 286 recursiveAssign(vector(), other);\n+ 287 }\n+ 288\n+ 289 template\n+ 290 void operator= (const ISTLVectorBackend& other)\n+ 291 {\n+ 292 vector() = other.vector();\n+ 293 }\n+ 294\n+ 295 const Vector& vector() const\n+ 296 {\n+ 297 return *vector_;\n+ 298 }\n+ 299\n+ 300 Vector& vector()\n+ 301 {\n+ 302 return *vector_;\n+ 303 }\n+ 304\n+ 305private:\n+ 306\n+ 307 Vector* vector_;\n+ 308};\n+ 309\n+ 310} // end namespace Impl\n+ 311\n+ 312\n+ 313\n+ 345template\n+346auto istlVectorBackend(Vector& v)\n+ 347{\n+ 348 static_assert(hasUniqueFieldType(), \"Vector type passed to\n+istlVectorBackend() does not have a unique field type.\");\n+ 349 return Impl::ISTLVectorBackend(v);\n+ 350}\n+ 351\n+ 352\n+ 353\n+ 383template\n+384auto istlVectorBackend(const Vector& v)\n+ 385{\n+ 386 static_assert(hasUniqueFieldType(), \"Vector type passed to\n+istlVectorBackend() does not have a unique field type.\");\n+ 387 return Impl::ISTLVectorBackend(v);\n+ 388}\n+ 389\n+ 390\n+ 391\n+ 392} // namespace Functions\n+ 393} // namespace Dune\n+ 394\n+ 395\n+ 396#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_ISTLVECTORBACKEND_HH\n+indexaccess.hh\n+Dune::Functions::istlVectorBackend\n+auto istlVectorBackend(Vector &v)\n+Return a vector backend wrapping non-const ISTL like containers.\n+Definition: istlvectorbackend.hh:346\n+Dune::Functions::resolveDynamicMultiIndex\n+constexpr decltype(auto) resolveDynamicMultiIndex(C &&c, const MultiIndex\n+&multiIndex, const IsFinal &isFinal)\n+Provide multi-index access by chaining operator[].\n+Definition: indexaccess.hh:354\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::SubspaceBasis\n-SubspaceBasis(const RB &, const TP) -> SubspaceBasis< RB, TP >\n-Dune::Functions::subspaceBasis\n-auto subspaceBasis(const RootBasis &rootBasis, const TypeTree::HybridTreePath<\n-PrefixTreeIndices... > &prefixPath)\n-Create SubspaceBasis from a root basis and a prefixPath.\n-Definition: subspacebasis.hh:151\n-Dune::Functions::SubspaceBasis\n-Definition: subspacebasis.hh:38\n-Dune::Functions::SubspaceBasis::RootLocalView\n-typename RootBasis::LocalView RootLocalView\n-Definition: subspacebasis.hh:43\n-Dune::Functions::SubspaceBasis::localView\n-LocalView localView() const\n-Return local view for basis.\n-Definition: subspacebasis.hh:108\n-Dune::Functions::SubspaceBasis::rootBasis_\n-const RootBasis * rootBasis_\n-Definition: subspacebasis.hh:124\n-Dune::Functions::SubspaceBasis::SizePrefix\n-typename RootBasis::SizePrefix SizePrefix\n-Definition: subspacebasis.hh:58\n-Dune::Functions::SubspaceBasis::PrefixPath\n-TP PrefixPath\n-Definition: subspacebasis.hh:45\n-Dune::Functions::SubspaceBasis::LocalView\n-SubspaceLocalView< RootLocalView, PrefixPath > LocalView\n-Type of the local view on the restriction of the basis to a single element.\n-Definition: subspacebasis.hh:56\n-Dune::Functions::SubspaceBasis::size\n-size_type size(const SizePrefix &prefix) const\n-Return number possible values for next position in multi index.\n-Definition: subspacebasis.hh:100\n-Dune::Functions::SubspaceBasis::GridView\n-typename RootBasis::GridView GridView\n-The grid view that the FE space is defined on.\n-Definition: subspacebasis.hh:48\n-Dune::Functions::SubspaceBasis::prefixPath\n-const PrefixPath & prefixPath() const\n-Definition: subspacebasis.hh:118\n-Dune::Functions::SubspaceBasis::SubspaceBasis\n-SubspaceBasis(const SubspaceBasis< RootRootBasis, InnerTP > &rootBasis, const\n-OuterTP &prefixPath)\n-Constructor from another SubspaceBasis.\n-Definition: subspacebasis.hh:73\n-Dune::Functions::SubspaceBasis::gridView\n-const GridView & gridView() const\n-Obtain the grid view that the basis is defined on.\n-Definition: subspacebasis.hh:80\n-Dune::Functions::SubspaceBasis::RootBasis\n-RB RootBasis\n-Definition: subspacebasis.hh:41\n-Dune::Functions::SubspaceBasis::prefixPath_\n-PrefixPath prefixPath_\n-Definition: subspacebasis.hh:125\n-Dune::Functions::SubspaceBasis::size\n-size_type size() const\n-Return number of possible values for next position in empty multi index.\n-Definition: subspacebasis.hh:94\n-Dune::Functions::SubspaceBasis::rootBasis\n-const RootBasis & rootBasis() const\n-Definition: subspacebasis.hh:113\n-Dune::Functions::SubspaceBasis::MultiIndex\n-typename RootBasis::MultiIndex MultiIndex\n-Type used for global numbering of the basis vectors.\n-Definition: subspacebasis.hh:51\n-Dune::Functions::SubspaceBasis::dimension\n-size_type dimension() const\n-Definition: subspacebasis.hh:88\n-Dune::Functions::SubspaceBasis::size_type\n-std::size_t size_type\n-Definition: subspacebasis.hh:53\n-Dune::Functions::SubspaceBasis::SubspaceBasis\n-SubspaceBasis(const RootBasis &rootBasis, const PrefixPath &prefixPath)\n-Constructor for a given grid view object.\n-Definition: subspacebasis.hh:62\n-Dune::Functions::SubspaceLocalView\n-The restriction of a finite element basis to a single element.\n-Definition: subspacelocalview.hh:30\n+Dune::Functions::fieldTypes\n+constexpr auto fieldTypes()\n+Generate list of field types in container.\n+Definition: istlvectorbackend.hh:63\n+Dune::Functions::hasUniqueFieldType\n+constexpr bool hasUniqueFieldType()\n+Check if container has a unique field type.\n+Definition: istlvectorbackend.hh:74\n concepts.hh\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00161.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00161.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: basistags.hh File Reference\n+dune-functions: polynomial.hh File Reference\n \n \n \n \n \n \n \n@@ -58,85 +58,42 @@\n \n \n \n \n \n
    \n \n-
    basistags.hh File Reference
    \n+Namespaces
    \n+
    polynomial.hh File Reference
    \n \n
    \n-
    #include <type_traits>
    \n-#include <dune/common/concept.hh>
    \n+
    #include <cmath>
    \n+#include <initializer_list>
    \n+#include <vector>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n \n

    \n Classes

    struct  Dune::Functions::Concept::IndexMergingStrategy
     
    struct  Dune::Functions::BasisFactory::IndexMergingStrategy
     Base class for index merging strategies to simplify detection. More...
     
    struct  Dune::Functions::BasisFactory::FlatLexicographic
     Lexicographic merging of direct children without blocking. More...
     
    struct  Dune::Functions::BasisFactory::FlatInterleaved
     Interleaved merging of direct children without blocking. More...
     
    struct  Dune::Functions::BasisFactory::BlockedLexicographic
     Lexicographic merging of direct children with blocking (i.e. creating one block per direct child). More...
     
    struct  Dune::Functions::BasisFactory::BlockedInterleaved
     Interleaved merging of direct children with blocking (i.e. creating blocks at the leaves containing one leaf per child each). More...
    class  Dune::Functions::Polynomial< K >
     A scalar polynomial implementation. More...
     
    \n \n \n \n \n \n-\n-\n-\n-\n-\n-\n-

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    namespace  Dune::Functions::Concept
     
    namespace  Dune::Functions::BasisFactory
     
    namespace  Dune::Functions::BasisBuilder
     
    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n

    \n-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. More...
     
    constexpr FlatInterleaved Dune::Functions::BasisFactory::flatInterleaved ()
     Creates an interleaved merging of direct children without blocking. More...
     
    constexpr BlockedLexicographic Dune::Functions::BasisFactory::blockedLexicographic ()
     Creates a lexicographic merging of direct children with blocking (i.e. creating one block per direct child). More...
     
    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). More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,83 +4,26 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * functionspacebases\n-Classes | Namespaces | Functions\n-basistags.hh File Reference\n-#include \n-#include \n+ * analyticfunctions\n+Classes | Namespaces\n+polynomial.hh File Reference\n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0Dune::Functions::Concept::IndexMergingStrategy\n-\u00a0\n-struct \u00a0Dune::Functions::BasisFactory::IndexMergingStrategy\n-\u00a0 Base class for index merging strategies to simplify detection. More...\n-\u00a0\n-struct \u00a0Dune::Functions::BasisFactory::FlatLexicographic\n-\u00a0 Lexicographic merging of direct children without blocking. More...\n-\u00a0\n-struct \u00a0Dune::Functions::BasisFactory::FlatInterleaved\n-\u00a0 Interleaved merging of direct children without blocking. More...\n-\u00a0\n-struct \u00a0Dune::Functions::BasisFactory::BlockedLexicographic\n-\u00a0 Lexicographic merging of direct children with blocking (i.e. creating\n- one block per direct child). More...\n-\u00a0\n-struct \u00a0Dune::Functions::BasisFactory::BlockedInterleaved\n-\u00a0 Interleaved merging of direct children with blocking (i.e. creating\n- blocks at the leaves containing one leaf per child each). More...\n+class \u00a0Dune::Functions::Polynomial<_K_>\n+\u00a0 A scalar polynomial implementation. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n-namespace \u00a0Dune::Functions::Concept\n-\u00a0\n-namespace \u00a0Dune::Functions::BasisFactory\n-\u00a0\n-namespace \u00a0Dune::Functions::BasisBuilder\n-\u00a0\n- Functions\n-template\n- static constexpr bool\u00a0Dune::Functions::Concept::\n- isIndexMergingStrategy ()\n-\u00a0\n-template\n- static constexpr bool\u00a0Dune::Functions::Concept::\n- isIndexMergingStrategy (T &&t)\n-\u00a0\n- void\u00a0Dune::Functions::BasisFactory::\n- registerIndexMergingStrategy\n- (IndexMergingStrategy)\n-\u00a0\n- constexpr FlatLexicographic\u00a0Dune::Functions::BasisFactory::\n- flatLexicographic ()\n-\u00a0 Creates a lexicographic merging of direct\n- children without blocking. More...\n-\u00a0\n- constexpr FlatInterleaved\u00a0Dune::Functions::BasisFactory::flatInterleaved\n- ()\n-\u00a0 Creates an interleaved merging of direct\n- children without blocking. More...\n-\u00a0\n-constexpr BlockedLexicographic\u00a0Dune::Functions::BasisFactory::\n- blockedLexicographic ()\n- Creates a lexicographic merging of direct\n-\u00a0 children with blocking (i.e. creating one block\n- per direct child). More...\n-\u00a0\n- constexpr BlockedInterleaved\u00a0Dune::Functions::BasisFactory::\n- blockedInterleaved ()\n- Creates an interleaved merging of direct\n-\u00a0 children with blocking (i.e. creating blocks at\n- the leaves containing one leaf per child each).\n- More...\n-\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00161_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00161_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: basistags.hh Source File\n+dune-functions: polynomial.hh Source File\n \n \n \n \n \n \n \n@@ -58,126 +58,106 @@\n \n
    \n \n \n \n
    \n-
    basistags.hh
    \n+
    polynomial.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_ANALYTICFUNCTIONS_POLYNOMIAL_HH
    \n+
    4#define DUNE_FUNCTIONS_ANALYTICFUNCTIONS_POLYNOMIAL_HH
    \n
    5
    \n-
    6#include <type_traits>
    \n-
    7#include <dune/common/concept.hh>
    \n-
    8
    \n-
    9namespace Dune {
    \n-
    10namespace Functions {
    \n-
    11
    \n-
    12 namespace Concept {
    \n+
    6#include <cmath>
    \n+
    7#include <initializer_list>
    \n+
    8#include <vector>
    \n+
    9
    \n+
    10namespace Dune {
    \n+
    11namespace Functions {
    \n+
    12
    \n
    13
    \n-\n-
    15 {
    \n-
    16 template<typename T>
    \n-
    17 auto require(T&& t) -> decltype(
    \n-\n-
    19 );
    \n-
    20 };
    \n-
    21
    \n-
    22 template<typename T>
    \n-
    23 static constexpr bool isIndexMergingStrategy()
    \n-
    24 {
    \n-
    25 return models<Concept::IndexMergingStrategy,T>();
    \n-
    26 }
    \n-
    27
    \n-
    28 template<typename T>
    \n-
    29 static constexpr bool isIndexMergingStrategy(T&& t)
    \n-
    30 {
    \n-
    31 return models<Concept::IndexMergingStrategy,std::decay_t<T>>();
    \n-
    32 }
    \n-
    33
    \n-
    34 } // namespace Concept
    \n-
    35
    \n-
    36
    \n-
    37namespace BasisFactory {
    \n-
    38
    \n-\n-
    45
    \n-\n-
    47
    \n-\n-\n-
    80 {};
    \n-
    81
    \n-\n-
    113 : public IndexMergingStrategy
    \n-
    114 {};
    \n+
    24template<class K>
    \n+\n+
    26{
    \n+
    27public:
    \n+
    28
    \n+
    30 Polynomial() = default;
    \n+
    31
    \n+
    33 Polynomial(const Polynomial& other) = default;
    \n+
    34
    \n+
    36 Polynomial(Polynomial&& other) = default;
    \n+
    37
    \n+
    39 Polynomial& operator=(const Polynomial& other) = default;
    \n+
    40
    \n+
    42 Polynomial& operator=(Polynomial&& other) = default;
    \n+
    43
    \n+
    50 Polynomial(std::initializer_list<K> coefficients) :
    \n+
    51 coefficients_(coefficients)
    \n+
    52 {}
    \n+
    53
    \n+
    61 Polynomial(std::vector<K>&& coefficients) :
    \n+
    62 coefficients_(std::move(coefficients))
    \n+
    63 {}
    \n+
    64
    \n+
    72 Polynomial(const std::vector<K>& coefficients) :
    \n+
    73 coefficients_(coefficients)
    \n+
    74 {}
    \n+
    75
    \n+
    77 K operator() (const K& x) const
    \n+
    78 {
    \n+
    79 auto y = K(0);
    \n+
    80 for (size_t i=0; i<coefficients_.size(); ++i)
    \n+
    81 y += coefficients_[i] * std::pow(x, i);
    \n+
    82 return y;
    \n+
    83 }
    \n+
    84
    \n+\n+
    95 {
    \n+
    96 std::vector<K> dpCoefficients(p.coefficients().size()-1);
    \n+
    97 for (size_t i=1; i<p.coefficients_.size(); ++i)
    \n+
    98 dpCoefficients[i-1] = p.coefficients()[i]*i;
    \n+
    99 return Polynomial(std::move(dpCoefficients));
    \n+
    100 }
    \n+
    101
    \n+
    103 const std::vector<K>& coefficients() const
    \n+
    104 {
    \n+
    105 return coefficients_;
    \n+
    106 }
    \n+
    107
    \n+
    108private:
    \n+
    109 std::vector<K> coefficients_;
    \n+
    110};
    \n+
    111
    \n+
    112
    \n+
    113
    \n+
    114}} // namespace Dune::Functions
    \n
    115
    \n-\n-
    147 : public IndexMergingStrategy
    \n-
    148 {};
    \n-
    149
    \n-\n-
    181
    \n-
    182
    \n-\n-
    189 {
    \n-
    190 return {};
    \n-
    191 }
    \n-
    192
    \n-\n-
    199 {
    \n-
    200 return {};
    \n-
    201 }
    \n-
    202
    \n-\n-
    209 {
    \n-
    210 return {};
    \n-
    211 }
    \n-
    212
    \n-\n-
    219 {
    \n-
    220 return {};
    \n-
    221 }
    \n-
    222
    \n-
    223} // end namespace BasisFactory
    \n-
    224
    \n-
    225// Backward compatibility
    \n-
    226namespace BasisBuilder {
    \n-
    227
    \n-
    228 using namespace BasisFactory;
    \n-
    229
    \n-
    230}
    \n-
    231
    \n-
    232} // end namespace Functions
    \n-
    233} // end namespace Dune
    \n-
    234
    \n-
    235
    \n-
    236#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH
    \n-
    constexpr FlatLexicographic flatLexicographic()
    Creates a lexicographic merging of direct children without blocking.
    Definition: basistags.hh:188
    \n-
    constexpr BlockedInterleaved blockedInterleaved()
    Creates an interleaved merging of direct children with blocking (i.e. creating blocks at the leaves c...
    Definition: basistags.hh:218
    \n-
    constexpr FlatInterleaved flatInterleaved()
    Creates an interleaved merging of direct children without blocking.
    Definition: basistags.hh:198
    \n-
    constexpr BlockedLexicographic blockedLexicographic()
    Creates a lexicographic merging of direct children with blocking (i.e. creating one block per direct ...
    Definition: basistags.hh:208
    \n+
    116
    \n+
    117
    \n+
    118#endif // DUNE_FUNCTIONS_ANALYTICFUNCTIONS_POLYNOMIAL_HH
    \n+
    friend Polynomial derivative(const Polynomial &p)
    Obtain derivative of Polynomial function.
    Definition: polynomial.hh:94
    \n
    Definition: polynomial.hh:10
    \n-
    static constexpr bool isIndexMergingStrategy()
    Definition: basistags.hh:23
    \n-
    void registerIndexMergingStrategy(IndexMergingStrategy)
    \n-\n-
    auto require(T &&t) -> decltype(registerIndexMergingStrategy(t))
    \n-
    Base class for index merging strategies to simplify detection.
    Definition: basistags.hh:44
    \n-
    Lexicographic merging of direct children without blocking.
    Definition: basistags.hh:80
    \n-
    Interleaved merging of direct children without blocking.
    Definition: basistags.hh:114
    \n-
    Lexicographic merging of direct children with blocking (i.e. creating one block per direct child).
    Definition: basistags.hh:148
    \n-
    Interleaved merging of direct children with blocking (i.e. creating blocks at the leaves containing o...
    Definition: basistags.hh:180
    \n+
    A scalar polynomial implementation.
    Definition: polynomial.hh:26
    \n+
    Polynomial()=default
    Default constructor.
    \n+
    const std::vector< K > & coefficients() const
    Obtain reference to coefficient vector.
    Definition: polynomial.hh:103
    \n+
    Polynomial & operator=(const Polynomial &other)=default
    Copy-assignment operator.
    \n+
    Polynomial & operator=(Polynomial &&other)=default
    Move-assignment operator.
    \n+
    Polynomial(std::initializer_list< K > coefficients)
    Create from list of coefficients.
    Definition: polynomial.hh:50
    \n+
    K operator()(const K &x) const
    Evaluate polynomial.
    Definition: polynomial.hh:77
    \n+
    Polynomial(const Polynomial &other)=default
    Copy constructor.
    \n+
    Polynomial(Polynomial &&other)=default
    Move constructor.
    \n+
    Polynomial(const std::vector< K > &coefficients)
    Create from list of coefficients.
    Definition: polynomial.hh:72
    \n+
    Polynomial(std::vector< K > &&coefficients)
    Create from list of coefficients.
    Definition: polynomial.hh:61
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,150 +4,129 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * functionspacebases\n-basistags.hh\n+ * analyticfunctions\n+polynomial.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH\n+ 3#ifndef DUNE_FUNCTIONS_ANALYTICFUNCTIONS_POLYNOMIAL_HH\n+ 4#define DUNE_FUNCTIONS_ANALYTICFUNCTIONS_POLYNOMIAL_HH\n 5\n- 6#include \n- 7#include \n- 8\n- 9namespace Dune {\n- 10namespace Functions {\n- 11\n- 12 namespace Concept {\n+ 6#include \n+ 7#include \n+ 8#include \n+ 9\n+10namespace Dune {\n+11namespace Functions {\n+ 12\n 13\n-14 struct IndexMergingStrategy\n- 15 {\n- 16 template\n-17 auto require(T&& t) -> decltype(\n- 18 registerIndexMergingStrategy(t)\n- 19 );\n- 20 };\n- 21\n- 22 template\n-23 static constexpr bool isIndexMergingStrategy()\n- 24 {\n- 25 return models();\n- 26 }\n- 27\n- 28 template\n-29 static constexpr bool isIndexMergingStrategy(T&& t)\n- 30 {\n- 31 return models>();\n- 32 }\n- 33\n- 34 } // namespace Concept\n- 35\n- 36\n-37namespace BasisFactory {\n- 38\n-44 struct IndexMergingStrategy {};\n- 45\n-46 void registerIndexMergingStrategy(IndexMergingStrategy);\n- 47\n-78 struct FlatLexicographic\n- 79 : public IndexMergingStrategy\n- 80 {};\n- 81\n-112 struct FlatInterleaved\n- 113 : public IndexMergingStrategy\n- 114 {};\n+ 24template\n+25class Polynomial\n+ 26{\n+ 27public:\n+ 28\n+30 Polynomial() = default;\n+ 31\n+33 Polynomial(const Polynomial& other) = default;\n+ 34\n+36 Polynomial(Polynomial&& other) = default;\n+ 37\n+39 Polynomial& operator=(const Polynomial& other) = default;\n+ 40\n+42 Polynomial& operator=(Polynomial&& other) = default;\n+ 43\n+50 Polynomial(std::initializer_list coefficients) :\n+ 51 coefficients_(coefficients)\n+ 52 {}\n+ 53\n+61 Polynomial(std::vector&& coefficients) :\n+ 62 coefficients_(std::move(coefficients))\n+ 63 {}\n+ 64\n+72 Polynomial(const std::vector& coefficients) :\n+ 73 coefficients_(coefficients)\n+ 74 {}\n+ 75\n+77 K operator()(const K& x) const\n+ 78 {\n+ 79 auto y = K(0);\n+ 80 for (size_t i=0; i dpCoefficients(p.coefficients().size()-1);\n+ 97 for (size_t i=1; i& coefficients() const\n+ 104 {\n+ 105 return coefficients_;\n+ 106 }\n+ 107\n+ 108private:\n+ 109 std::vector coefficients_;\n+ 110};\n+ 111\n+ 112\n+ 113\n+ 114}} // namespace Dune::Functions\n 115\n-146 struct BlockedLexicographic\n- 147 : public IndexMergingStrategy\n- 148 {};\n- 149\n-180 struct BlockedInterleaved : public IndexMergingStrategy {};\n- 181\n- 182\n-188 constexpr FlatLexicographic flatLexicographic()\n- 189 {\n- 190 return {};\n- 191 }\n- 192\n-198 constexpr FlatInterleaved flatInterleaved()\n- 199 {\n- 200 return {};\n- 201 }\n- 202\n-208 constexpr BlockedLexicographic blockedLexicographic()\n- 209 {\n- 210 return {};\n- 211 }\n- 212\n-218 constexpr BlockedInterleaved blockedInterleaved()\n- 219 {\n- 220 return {};\n- 221 }\n- 222\n- 223} // end namespace BasisFactory\n- 224\n- 225// Backward compatibility\n-226namespace BasisBuilder {\n- 227\n- 228 using namespace BasisFactory;\n- 229\n- 230}\n- 231\n- 232} // end namespace Functions\n- 233} // end namespace Dune\n- 234\n- 235\n- 236#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_BASISTAGS_HH\n-Dune::Functions::BasisFactory::flatLexicographic\n-constexpr FlatLexicographic flatLexicographic()\n-Creates a lexicographic merging of direct children without blocking.\n-Definition: basistags.hh:188\n-Dune::Functions::BasisFactory::blockedInterleaved\n-constexpr BlockedInterleaved blockedInterleaved()\n-Creates an interleaved merging of direct children with blocking (i.e. creating\n-blocks at the leaves c...\n-Definition: basistags.hh:218\n-Dune::Functions::BasisFactory::flatInterleaved\n-constexpr FlatInterleaved flatInterleaved()\n-Creates an interleaved merging of direct children without blocking.\n-Definition: basistags.hh:198\n-Dune::Functions::BasisFactory::blockedLexicographic\n-constexpr BlockedLexicographic blockedLexicographic()\n-Creates a lexicographic merging of direct children with blocking (i.e. creating\n-one block per direct ...\n-Definition: basistags.hh:208\n+ 116\n+ 117\n+ 118#endif // DUNE_FUNCTIONS_ANALYTICFUNCTIONS_POLYNOMIAL_HH\n+Dune::Functions::Polynomial::derivative\n+friend Polynomial derivative(const Polynomial &p)\n+Obtain derivative of Polynomial function.\n+Definition: polynomial.hh:94\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::Concept::isIndexMergingStrategy\n-static constexpr bool isIndexMergingStrategy()\n-Definition: basistags.hh:23\n-Dune::Functions::BasisFactory::registerIndexMergingStrategy\n-void registerIndexMergingStrategy(IndexMergingStrategy)\n-Dune::Functions::Concept::IndexMergingStrategy\n-Definition: basistags.hh:15\n-Dune::Functions::Concept::IndexMergingStrategy::require\n-auto require(T &&t) -> decltype(registerIndexMergingStrategy(t))\n-Dune::Functions::BasisFactory::IndexMergingStrategy\n-Base class for index merging strategies to simplify detection.\n-Definition: basistags.hh:44\n-Dune::Functions::BasisFactory::FlatLexicographic\n-Lexicographic merging of direct children without blocking.\n-Definition: basistags.hh:80\n-Dune::Functions::BasisFactory::FlatInterleaved\n-Interleaved merging of direct children without blocking.\n-Definition: basistags.hh:114\n-Dune::Functions::BasisFactory::BlockedLexicographic\n-Lexicographic merging of direct children with blocking (i.e. creating one block\n-per direct child).\n-Definition: basistags.hh:148\n-Dune::Functions::BasisFactory::BlockedInterleaved\n-Interleaved merging of direct children with blocking (i.e. creating blocks at\n-the leaves containing o...\n-Definition: basistags.hh:180\n+Dune::Functions::Polynomial\n+A scalar polynomial implementation.\n+Definition: polynomial.hh:26\n+Dune::Functions::Polynomial::Polynomial\n+Polynomial()=default\n+Default constructor.\n+Dune::Functions::Polynomial::coefficients\n+const std::vector< K > & coefficients() const\n+Obtain reference to coefficient vector.\n+Definition: polynomial.hh:103\n+Dune::Functions::Polynomial::operator=\n+Polynomial & operator=(const Polynomial &other)=default\n+Copy-assignment operator.\n+Dune::Functions::Polynomial::operator=\n+Polynomial & operator=(Polynomial &&other)=default\n+Move-assignment operator.\n+Dune::Functions::Polynomial::Polynomial\n+Polynomial(std::initializer_list< K > coefficients)\n+Create from list of coefficients.\n+Definition: polynomial.hh:50\n+Dune::Functions::Polynomial::operator()\n+K operator()(const K &x) const\n+Evaluate polynomial.\n+Definition: polynomial.hh:77\n+Dune::Functions::Polynomial::Polynomial\n+Polynomial(const Polynomial &other)=default\n+Copy constructor.\n+Dune::Functions::Polynomial::Polynomial\n+Polynomial(Polynomial &&other)=default\n+Move constructor.\n+Dune::Functions::Polynomial::Polynomial\n+Polynomial(const std::vector< K > &coefficients)\n+Create from list of coefficients.\n+Definition: polynomial.hh:72\n+Dune::Functions::Polynomial::Polynomial\n+Polynomial(std::vector< K > &&coefficients)\n+Create from list of coefficients.\n+Definition: polynomial.hh:61\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00164.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00164.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: subentitydofs.hh File Reference\n+dune-functions: trigonometricfunction.hh File Reference\n \n \n \n \n \n \n \n@@ -58,58 +58,48 @@\n \n \n \n \n \n
    \n \n-
    subentitydofs.hh File Reference
    \n+
    trigonometricfunction.hh File Reference
    \n
    \n
    \n-
    #include <vector>
    \n-#include <dune/geometry/referenceelements.hh>
    \n-#include <dune/typetree/traversal.hh>
    \n+
    #include <cmath>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n+\n+\n \n

    \n Classes

    class  Dune::Functions::SubEntityDOFs< GridView >
     Range of DOFs associated to sub-entity. More...
    class  Dune::Functions::TrigonometricFunction< K, sinFactor, cosFactor >
     A linear combination of trigonomic functions. More...
     
    \n \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n

    \n Functions

    template<class T >
    auto Dune::Functions::subEntityDOFs (const T &)
     Create SubEntityDOFs object. More...
     
    template<class LocalView >
    auto Dune::Functions::subEntityDOFs (const LocalView &localView, std::size_t subEntityIndex, std::size_t subEntityCodim)
     Create bound SubEntityDOFs object. More...
     
    template<class LocalView , class Intersection >
    auto Dune::Functions::subEntityDOFs (const LocalView &localView, const Intersection &intersection)
     Create bound SubEntityDOFs object. More...
     
    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. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,41 +4,32 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * functionspacebases\n+ * analyticfunctions\n Classes | Namespaces | Functions\n-subentitydofs.hh File Reference\n-#include \n-#include \n-#include \n+trigonometricfunction.hh File Reference\n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::SubEntityDOFs<_GridView_>\n-\u00a0 Range of DOFs associated to sub-entity. More...\n+class \u00a0Dune::Functions::TrigonometricFunction<_K,_sinFactor,_cosFactor_>\n+\u00a0 A linear combination of trigonomic functions. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n Functions\n-template\n-auto\u00a0Dune::Functions::subEntityDOFs (const T &)\n-\u00a0 Create SubEntityDOFs object. More...\n-\u00a0\n-template\n-auto\u00a0Dune::Functions::subEntityDOFs (const LocalView &localView, std::size_t\n- subEntityIndex, std::size_t subEntityCodim)\n-\u00a0 Create bound SubEntityDOFs object. More...\n-\u00a0\n-template\n-auto\u00a0Dune::Functions::subEntityDOFs (const LocalView &localView, const\n- Intersection &intersection)\n-\u00a0 Create bound SubEntityDOFs object. More...\n+template\n+TrigonometricFunction< K, -cosFactor, Dune::Functions::derivative (const\n+ sinFactor >\u00a0TrigonometricFunction< K, sinFactor,\n+ cosFactor > &f)\n+\u00a0 Obtain derivative of\n+ TrigonometricFunction function. More...\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00164_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00164_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: subentitydofs.hh Source File\n+dune-functions: trigonometricfunction.hh Source File\n \n \n \n \n \n \n \n@@ -58,152 +58,61 @@\n \n
    \n \n \n \n
    \n-
    subentitydofs.hh
    \n+
    trigonometricfunction.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
    \n+
    4#define DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
    \n
    5
    \n-
    6#include <vector>
    \n+
    6#include <cmath>
    \n
    7
    \n-
    8#include <dune/geometry/referenceelements.hh>
    \n-
    9#include <dune/typetree/traversal.hh>
    \n+
    8namespace Dune {
    \n+
    9namespace Functions {
    \n
    10
    \n
    11
    \n
    12
    \n-
    13namespace Dune {
    \n-
    14namespace Functions {
    \n-
    15
    \n-
    16
    \n-
    17
    \n-
    40template<class GridView>
    \n-\n-
    42{
    \n-
    43 static const int dim = GridView::dimension;
    \n+
    25template<class K, int sinFactor, int cosFactor>
    \n+\n+
    27{
    \n+
    28public:
    \n+
    30 K operator () (const K& x) const
    \n+
    31 {
    \n+
    32 return sinFactor * std::sin(x) + cosFactor * std::cos(x);
    \n+
    33 }
    \n+
    34};
    \n+
    35
    \n+
    36
    \n+
    38template<class K, int sinFactor, int cosFactor>
    \n+\n+
    40{
    \n+
    41 return TrigonometricFunction<K, -cosFactor, sinFactor>();
    \n+
    42}
    \n+
    43
    \n
    44
    \n-
    45public:
    \n-
    46
    \n-
    63 template<class LocalView>
    \n-
    64 SubEntityDOFs& bind(const LocalView& localView, std::size_t subEntityIndex, std::size_t subEntityCodim)
    \n-
    65 {
    \n-
    66 // fill vector with local indices of all DOFs contained in subentity
    \n-
    67 containedDOFs_.clear();
    \n-
    68 dofIsContained_.assign(localView.size(), false);
    \n-
    69
    \n-
    70 auto re = Dune::referenceElement<double,dim>(localView.element().type());
    \n-
    71
    \n-
    72 Dune::TypeTree::forEachLeafNode(localView.tree(), [&](auto&& node, auto&& /*treePath*/) {
    \n-
    73 const auto& localCoefficients = node.finiteElement().localCoefficients();
    \n-
    74 std::size_t localSize = localCoefficients.size();
    \n-
    75 for(std::size_t i=0; i<localSize; ++i)
    \n-
    76 {
    \n-
    77 auto localKey = localCoefficients.localKey(i);
    \n-
    78 if (re.subEntities(subEntityIndex, subEntityCodim, localKey.codim()).contains(localKey.subEntity()))
    \n-
    79 {
    \n-
    80 containedDOFs_.push_back(node.localIndex(i));
    \n-
    81 dofIsContained_[node.localIndex(i)] = true;
    \n-
    82 }
    \n-
    83 }
    \n-
    84 });
    \n-
    85 return *this;
    \n-
    86 }
    \n-
    87
    \n-
    103 template<class LocalView, class Intersection>
    \n-
    104 SubEntityDOFs& bind(const LocalView& localView, const Intersection& intersection)
    \n-
    105 {
    \n-
    106 return bind(localView, intersection.indexInInside(), 1);
    \n-
    107 }
    \n-
    108
    \n-
    110 auto begin() const
    \n-
    111 {
    \n-
    112 return containedDOFs_.cbegin();
    \n-
    113 }
    \n-
    114
    \n-
    116 auto end() const
    \n-
    117 {
    \n-
    118 return containedDOFs_.cend();
    \n-
    119 }
    \n-
    120
    \n-
    122 auto size() const
    \n-
    123 {
    \n-
    124 return containedDOFs_.size();
    \n-
    125 }
    \n-
    126
    \n-
    128 decltype(auto) operator[](std::size_t i) const
    \n-
    129 {
    \n-
    130 return containedDOFs_[i];
    \n-
    131 }
    \n-
    132
    \n-
    134 bool contains(std::size_t localIndex) const
    \n-
    135 {
    \n-
    136 return dofIsContained_[localIndex];
    \n-
    137 }
    \n-
    138
    \n-
    139private:
    \n-
    140
    \n-
    141 std::vector<std::size_t> containedDOFs_;
    \n-
    142 std::vector<bool> dofIsContained_;
    \n-
    143};
    \n-
    144
    \n-
    145
    \n-
    146
    \n-
    159template<class T>
    \n-
    160auto subEntityDOFs(const T&)
    \n-
    161{
    \n-\n-
    163}
    \n-
    164
    \n-
    165
    \n-
    166
    \n-
    186template<class LocalView>
    \n-
    187auto subEntityDOFs(const LocalView& localView, std::size_t subEntityIndex, std::size_t subEntityCodim)
    \n-
    188{
    \n-
    189 using GridView = typename LocalView::GridView;
    \n-\n-
    191 subEntityDOFs.bind(localView, subEntityIndex, subEntityCodim);
    \n-
    192 return subEntityDOFs;
    \n-
    193}
    \n-
    194
    \n-
    195
    \n-
    196
    \n-
    215template<class LocalView, class Intersection>
    \n-
    216auto subEntityDOFs(const LocalView& localView, const Intersection& intersection)
    \n-
    217{
    \n-
    218 using GridView = typename LocalView::GridView;
    \n-\n-
    220 subEntityDOFs.bind(localView, intersection);
    \n-
    221 return subEntityDOFs;
    \n-
    222}
    \n-
    223
    \n-
    224
    \n-
    225
    \n-
    226} // namespace Functions
    \n-
    227} // namespace Dune
    \n-
    228
    \n-
    229#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH
    \n-
    auto subEntityDOFs(const LocalView &localView, const Intersection &intersection)
    Create bound SubEntityDOFs object.
    Definition: subentitydofs.hh:216
    \n+
    45
    \n+
    46}} // namespace Dune::Functions
    \n+
    47
    \n+
    48
    \n+
    49
    \n+
    50#endif // DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH
    \n+
    TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
    Obtain derivative of TrigonometricFunction function.
    Definition: trigonometricfunction.hh:39
    \n
    Definition: polynomial.hh:10
    \n-
    Range of DOFs associated to sub-entity.
    Definition: subentitydofs.hh:42
    \n-
    auto begin() const
    Create begin iterator for access to range of contained local indices.
    Definition: subentitydofs.hh:110
    \n-
    auto size() const
    Return number of contained DOFs.
    Definition: subentitydofs.hh:122
    \n-
    SubEntityDOFs & bind(const LocalView &localView, const Intersection &intersection)
    Bind SubEntityDOFs object to LocalView and sub-entity.
    Definition: subentitydofs.hh:104
    \n-
    bool contains(std::size_t localIndex) const
    Check if given local index is contained in this range of DOFs.
    Definition: subentitydofs.hh:134
    \n-
    auto end() const
    Create end iterator for access to range of contained local indices.
    Definition: subentitydofs.hh:116
    \n-
    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
    \n+
    A linear combination of trigonomic functions.
    Definition: trigonometricfunction.hh:27
    \n+
    K operator()(const K &x) const
    Evaluate function.
    Definition: trigonometricfunction.hh:30
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,177 +4,64 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * functionspacebases\n-subentitydofs.hh\n+ * analyticfunctions\n+trigonometricfunction.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH\n+ 3#ifndef DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH\n+ 4#define DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH\n 5\n- 6#include \n+ 6#include \n 7\n- 8#include \n- 9#include \n+ 8namespace Dune {\n+ 9namespace Functions {\n 10\n 11\n 12\n- 13namespace Dune {\n- 14namespace Functions {\n- 15\n- 16\n- 17\n- 40template\n-41class SubEntityDOFs\n- 42{\n- 43 static const int dim = GridView::dimension;\n+ 25template\n+26class TrigonometricFunction\n+ 27{\n+ 28public:\n+30 K operator_()(const K& x) const\n+ 31 {\n+ 32 return sinFactor * std::sin(x) + cosFactor * std::cos(x);\n+ 33 }\n+ 34};\n+ 35\n+ 36\n+ 38template\n+39TrigonometricFunction derivative(const\n+TrigonometricFunction& f)\n+ 40{\n+ 41 return TrigonometricFunction();\n+ 42}\n+ 43\n 44\n- 45public:\n- 46\n- 63 template\n-64 SubEntityDOFs& bind(const LocalView& localView, std::size_t subEntityIndex,\n-std::size_t subEntityCodim)\n- 65 {\n- 66 // fill vector with local indices of all DOFs contained in subentity\n- 67 containedDOFs_.clear();\n- 68 dofIsContained_.assign(localView.size(), false);\n- 69\n- 70 auto re = Dune::referenceElement(localView.element().type());\n- 71\n- 72 Dune::TypeTree::forEachLeafNode(localView.tree(), [&](auto&& node, auto&& /\n-*treePath*/) {\n- 73 const auto& localCoefficients = node.finiteElement().localCoefficients();\n- 74 std::size_t localSize = localCoefficients.size();\n- 75 for(std::size_t i=0; i\n-104 SubEntityDOFs& bind(const LocalView& localView, const Intersection&\n-intersection)\n- 105 {\n- 106 return bind(localView, intersection.indexInInside(), 1);\n- 107 }\n- 108\n-110 auto begin() const\n- 111 {\n- 112 return containedDOFs_.cbegin();\n- 113 }\n- 114\n-116 auto end() const\n- 117 {\n- 118 return containedDOFs_.cend();\n- 119 }\n- 120\n-122 auto size() const\n- 123 {\n- 124 return containedDOFs_.size();\n- 125 }\n- 126\n-128 decltype(auto) operator[](std::size_t i) const\n- 129 {\n- 130 return containedDOFs_[i];\n- 131 }\n- 132\n-134 bool contains(std::size_t localIndex) const\n- 135 {\n- 136 return dofIsContained_[localIndex];\n- 137 }\n- 138\n- 139private:\n- 140\n- 141 std::vector containedDOFs_;\n- 142 std::vector dofIsContained_;\n- 143};\n- 144\n- 145\n- 146\n- 159template\n-160auto subEntityDOFs(const T&)\n- 161{\n- 162 return SubEntityDOFs{};\n- 163}\n- 164\n- 165\n- 166\n- 186template\n-187auto subEntityDOFs(const LocalView& localView, std::size_t subEntityIndex,\n-std::size_t subEntityCodim)\n- 188{\n- 189 using GridView = typename LocalView::GridView;\n- 190 SubEntityDOFs subEntityDOFs;\n- 191 subEntityDOFs.bind(localView, subEntityIndex, subEntityCodim);\n- 192 return subEntityDOFs;\n- 193}\n- 194\n- 195\n- 196\n- 215template\n-216auto subEntityDOFs(const LocalView& localView, const Intersection&\n-intersection)\n- 217{\n- 218 using GridView = typename LocalView::GridView;\n- 219 SubEntityDOFs subEntityDOFs;\n- 220 subEntityDOFs.bind(localView, intersection);\n- 221 return subEntityDOFs;\n- 222}\n- 223\n- 224\n- 225\n- 226} // namespace Functions\n- 227} // namespace Dune\n- 228\n- 229#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_SUBENTITYDOFS_HH\n-Dune::Functions::subEntityDOFs\n-auto subEntityDOFs(const LocalView &localView, const Intersection\n-&intersection)\n-Create bound SubEntityDOFs object.\n-Definition: subentitydofs.hh:216\n+ 45\n+ 46}} // namespace Dune::Functions\n+ 47\n+ 48\n+ 49\n+ 50#endif // DUNE_FUNCTIONS_ANALYTICFUNCTIONS_TRIGONOMETRICFUNCTION_HH\n+Dune::Functions::derivative\n+TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const\n+TrigonometricFunction< K, sinFactor, cosFactor > &f)\n+Obtain derivative of TrigonometricFunction function.\n+Definition: trigonometricfunction.hh:39\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::SubEntityDOFs\n-Range of DOFs associated to sub-entity.\n-Definition: subentitydofs.hh:42\n-Dune::Functions::SubEntityDOFs::begin\n-auto begin() const\n-Create begin iterator for access to range of contained local indices.\n-Definition: subentitydofs.hh:110\n-Dune::Functions::SubEntityDOFs::size\n-auto size() const\n-Return number of contained DOFs.\n-Definition: subentitydofs.hh:122\n-Dune::Functions::SubEntityDOFs::bind\n-SubEntityDOFs & bind(const LocalView &localView, const Intersection\n-&intersection)\n-Bind SubEntityDOFs object to LocalView and sub-entity.\n-Definition: subentitydofs.hh:104\n-Dune::Functions::SubEntityDOFs::contains\n-bool contains(std::size_t localIndex) const\n-Check if given local index is contained in this range of DOFs.\n-Definition: subentitydofs.hh:134\n-Dune::Functions::SubEntityDOFs::end\n-auto end() const\n-Create end iterator for access to range of contained local indices.\n-Definition: subentitydofs.hh:116\n-Dune::Functions::SubEntityDOFs::bind\n-SubEntityDOFs & bind(const LocalView &localView, std::size_t subEntityIndex,\n-std::size_t subEntityCodim)\n-Bind SubEntityDOFs object to LocalView and sub-entity.\n-Definition: subentitydofs.hh:64\n+Dune::Functions::TrigonometricFunction\n+A linear combination of trigonomic functions.\n+Definition: trigonometricfunction.hh:27\n+Dune::Functions::TrigonometricFunction::operator()\n+K operator()(const K &x) const\n+Evaluate function.\n+Definition: trigonometricfunction.hh:30\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00167.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00167.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: bsplinebasis.hh File Reference\n+dune-functions: composedgridfunction.hh File Reference\n \n \n \n \n \n \n \n@@ -58,86 +58,55 @@\n \n \n \n \n \n
    \n \n-
    bsplinebasis.hh File Reference
    \n+
    composedgridfunction.hh File Reference
    \n
    \n
    \n-\n-

    The B-spline global function space basis. \n-More...

    \n-
    #include <array>
    \n-#include <numeric>
    \n-#include <dune/common/dynmatrix.hh>
    \n-#include <dune/localfunctions/common/localbasis.hh>
    \n-#include <dune/common/diagonalmatrix.hh>
    \n-#include <dune/localfunctions/common/localkey.hh>
    \n-#include <dune/localfunctions/common/localfiniteelementtraits.hh>
    \n-#include <dune/geometry/type.hh>
    \n-#include <dune/functions/functionspacebases/nodes.hh>
    \n-#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
    \n+
    #include <type_traits>
    \n+#include <tuple>
    \n+#include <dune/common/referencehelper.hh>
    \n+#include <dune/common/typeutilities.hh>
    \n+#include <dune/functions/common/defaultderivativetraits.hh>
    \n+#include <dune/functions/common/differentiablefunction.hh>
    \n+#include <dune/functions/gridfunctions/gridfunction.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n \n

    \n 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::ComposedGridFunction< OF, IF >
     Composition of grid functions with another function. More...
     
    \n \n \n \n \n \n-\n-\n-

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    namespace  Dune::Functions::BasisFactory
     
    \n-\n-\n-\n-\n-\n

    \n-Typedefs

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

    \n 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. More...
     
    template<class OF , class... IF>
    auto Dune::Functions::makeComposedGridFunction (OF &&outerFunction, IF &&... innerFunction)
     Create a ComposedGridFunction that composes grid-functions with another function. More...
     
    \n-

    Detailed Description

    \n-

    The B-spline global function space basis.

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

    Go to the source code of this file.

    \n \n \n-\n-\n+\n \n-\n+\n+\n \n

    \n Classes

    struct  Dune::Functions::DefaultNodeToRangeMap< Tree >
     A simple node to range map using lexicographic ordering. More...
    class  Dune::Functions::GridFunction< Signature, EntitySet, DerivativeTraits, bufferSize >
     
    struct  Dune::Functions::DefaultNodeToRangeMap< Tree >::Visitor
    class  Dune::Functions::GridFunction< Range(Domain), ES, DerivativeTraits, bufferSize >
     Wrapper class for functions defined on a Grid. More...
     
    \n \n \n \n \n \n-

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n-\n-\n-\n-\n-\n-\n-\n

    \n-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)))
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,40 +4,36 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * functionspacebases\n-Classes | Namespaces | Functions\n-defaultnodetorangemap.hh File Reference\n-#include \n-#include \n-#include \n-#include \n+ * gridfunctions\n+Classes | Namespaces\n+gridfunction.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0Dune::Functions::DefaultNodeToRangeMap<_Tree_>\n-\u00a0 A simple node to range map using lexicographic ordering. More...\n+class \u00a0Dune::Functions::GridFunction<_Signature,_EntitySet,_DerivativeTraits,\n+ bufferSize_>\n \u00a0\n-struct \u00a0Dune::Functions::DefaultNodeToRangeMap<_Tree_>::Visitor\n+class \u00a0Dune::Functions::GridFunction<_Range(Domain),_ES,_DerivativeTraits,\n+ bufferSize_>\n+\u00a0 Wrapper class for functions defined on a Grid. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n- Functions\n-template\n-DefaultNodeToRangeMap< Tree >\u00a0Dune::Functions::makeDefaultNodeToRangeMap\n- (const Tree &tree)\n-\u00a0\n-template\n- auto\u00a0Dune::Functions::makeDefaultNodeToRangeMap\n- (const Basis &basis, TreePath &&treePath) -\n- > decltype(makeDefaultNodeToRangeMap(TypeTree::\n- child(basis.localView().tree(), treePath)))\n-\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00170_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00170_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: defaultnodetorangemap.hh Source File\n+dune-functions: gridfunction.hh Source File\n \n \n \n \n \n \n \n@@ -58,131 +58,165 @@\n \n
    \n \n \n \n
    \n-
    defaultnodetorangemap.hh
    \n+
    gridfunction.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH
    \n+
    4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH
    \n
    5
    \n-
    6
    \n-
    7#include <dune/common/concept.hh>
    \n-
    8
    \n-\n-
    10
    \n-
    11#include <dune/typetree/traversal.hh>
    \n-
    12#include <dune/typetree/visitor.hh>
    \n-
    13
    \n-
    14
    \n-
    15namespace Dune {
    \n-
    16namespace Functions {
    \n+
    6#include <type_traits>
    \n+
    7
    \n+
    8#include <dune/common/typeutilities.hh>
    \n+
    9
    \n+\n+\n+\n+\n+\n+\n+\n
    17
    \n
    18
    \n
    19
    \n-
    37template<class Tree>
    \n-\n-
    39{
    \n-
    40
    \n-
    41 // A simple visitor for computing lexicographic
    \n-
    42 // subtree indices. To identify a leaf node
    \n-
    43 // we use its treeIndex() which is unique
    \n-
    44 // wrt the whole tree and store the computed
    \n-
    45 // index in a vector indexed by the tree indices.
    \n-
    46 struct Visitor
    \n-
    47 : public TypeTree::TreeVisitor
    \n-
    48 , public TypeTree::DynamicTraversal
    \n-
    49 {
    \n-
    50 Visitor(std::vector<std::size_t>& indices) :
    \n-
    51 indices_(indices),
    \n-
    52 counter_(0)
    \n-
    53 {}
    \n-
    54
    \n-
    55 template<typename Node, typename TreePath>
    \n-
    56 void leaf(Node& node, TreePath treePath)
    \n-
    57 {
    \n-
    58 if (indices_.size() < node.treeIndex()+1)
    \n-
    59 indices_.resize(node.treeIndex()+1);
    \n-
    60 indices_[node.treeIndex()] = counter_;
    \n-
    61 ++counter_;
    \n-
    62 }
    \n-
    63
    \n-
    64 std::vector<std::size_t>& indices_;
    \n-
    65 std::size_t counter_;
    \n-
    66 };
    \n-
    67
    \n-
    78 DefaultNodeToRangeMap(const Tree& tree)
    \n-
    79 {
    \n-
    80 TypeTree::applyToTree(tree, Visitor(indices_));
    \n-
    81 }
    \n+
    20namespace Dune {
    \n+
    21namespace Functions {
    \n+
    22
    \n+
    23
    \n+
    24
    \n+
    25/*
    \n+
    26 * Default implementation is empty
    \n+
    27 * The actual implementation is only given if Signature is an type
    \n+
    28 * describing a function signature as Range(Domain).
    \n+
    29 */
    \n+
    30template<class Signature, class EntitySet, template<class> class DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>
    \n+\n+
    32{};
    \n+
    33
    \n+
    34
    \n+
    35
    \n+
    36namespace Imp
    \n+
    37{
    \n+
    38
    \n+
    40 template<class S, class ES, template<class> class DerivativeTraits, size_t bufferSize>
    \n+
    41 struct GridFunctionTraits :
    \n+
    42 DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>
    \n+
    43 {
    \n+
    44 protected:
    \n+
    45 using Base=DifferentiableFunctionTraits<S, DerivativeTraits, bufferSize>;
    \n+
    46
    \n+
    47 public:
    \n+
    49 using EntitySet = ES;
    \n+
    50
    \n+
    52 using Element = typename EntitySet::Element;
    \n+
    53
    \n+
    55 using DerivativeSignature = typename Base::DerivativeSignature;
    \n+
    56
    \n+\n+
    59
    \n+
    61 using LocalSignature = typename Base::Range(typename EntitySet::LocalCoordinate);
    \n+
    62
    \n+
    64 template<class R>
    \n+\n+
    66
    \n+
    68 using LocalFunctionTraits = typename Dune::Functions::Imp::LocalFunctionTraits<LocalSignature, Element, LocalDerivativeTraits, bufferSize>;
    \n+
    69
    \n+\n+
    72
    \n+
    74 using Concept = GridFunctionWrapperInterface<S, DerivativeInterface, LocalFunctionInterface, ES>;
    \n+
    75
    \n+
    77 template<class B>
    \n+
    78 using Model = GridFunctionWrapperImplementation<S, DerivativeInterface, LocalFunctionInterface, ES, B>;
    \n+
    79 };
    \n+
    80}
    \n+
    81
    \n
    82
    \n-
    83 template<class Node, class TreePath, class Range,
    \n-
    84 std::enable_if_t<models<Concept::HasIndexAccess, Range, decltype(std::declval<Node>().treeIndex())>() and not Tree::isLeaf, int> = 0>
    \n-
    85 decltype(auto) operator()(const Node& node, const TreePath& treePath, Range&& y) const
    \n-
    86 {
    \n-
    87 return y[indices_[node.treeIndex()]];
    \n-
    88 }
    \n-
    89
    \n-
    90 template<class Node, class TreePath, class Range,
    \n-
    91 std::enable_if_t< not models<Concept::HasIndexAccess, Range, decltype(std::declval<Node>().treeIndex())>() or Tree::isLeaf, int> = 0>
    \n-
    92 decltype(auto) operator()(const Node& node, const TreePath& treePath, Range&& y) const
    \n-
    93 {
    \n-
    94 return std::forward<Range>(y);
    \n-
    95 }
    \n-
    96
    \n-
    97 std::vector<std::size_t> indices_;
    \n-
    98};
    \n-
    99
    \n-
    100
    \n-
    101
    \n-
    102template<class Tree>
    \n-\n-
    104{
    \n-
    105 return DefaultNodeToRangeMap<Tree>(tree);
    \n-
    106}
    \n-
    107
    \n+
    83
    \n+
    95template<class Range, class Domain, class ES, template<class> class DerivativeTraits, size_t bufferSize>
    \n+
    96class GridFunction<Range(Domain), ES, DerivativeTraits, bufferSize> :
    \n+
    97 public TypeErasureBase<
    \n+
    98 typename Imp::GridFunctionTraits<Range(Domain), ES, DerivativeTraits, bufferSize>::Concept,
    \n+
    99 Imp::GridFunctionTraits<Range(Domain), ES, DerivativeTraits, bufferSize>::template Model>
    \n+
    100{
    \n+
    101 using Traits = Imp::GridFunctionTraits<Range(Domain), ES, DerivativeTraits, bufferSize>;
    \n+
    102
    \n+\n+
    104
    \n+
    105 using DerivativeInterface = typename Traits::DerivativeInterface;
    \n+
    106
    \n+
    107 using LocalFunctionInterface = typename Traits::LocalFunctionInterface;
    \n
    108
    \n-
    109
    \n-
    110template<class Basis, class TreePath>
    \n-
    111auto makeDefaultNodeToRangeMap(const Basis& basis, TreePath&& treePath)
    \n-
    112 -> decltype(makeDefaultNodeToRangeMap(TypeTree::child(basis.localView().tree(),treePath)))
    \n-
    113{
    \n-
    114 auto&& localView = basis.localView();
    \n-
    115 localView.bind(*basis.gridView().template begin<0>());
    \n-
    116 auto&& tree = TypeTree::child(localView.tree(),treePath);
    \n-
    117 return makeDefaultNodeToRangeMap(tree);
    \n-
    118}
    \n-
    119
    \n-
    120
    \n-
    121
    \n-
    122} // namespace Dune::Functions
    \n-
    123} // namespace Dune
    \n-
    124
    \n-
    125
    \n-
    126#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH
    \n+
    109 using EntitySet = typename Traits::EntitySet;
    \n+
    110
    \n+
    111public:
    \n+
    112
    \n+
    124 template<class F, disableCopyMove<GridFunction, F> = 0 >
    \n+\n+
    126 Base(std::forward<F>(f))
    \n+
    127 {
    \n+
    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");
    \n+
    129 }
    \n+
    130
    \n+
    131 GridFunction() = default;
    \n+
    132
    \n+
    138 Range operator() (const Domain& x) const
    \n+
    139 {
    \n+
    140 return this->asInterface().operator()(x);
    \n+
    141 }
    \n+
    142
    \n+
    151 friend DerivativeInterface derivative(const GridFunction& t)
    \n+
    152 {
    \n+
    153 return t.asInterface().derivative();
    \n+
    154 }
    \n+
    155
    \n+
    165 friend LocalFunctionInterface localFunction(const GridFunction& t)
    \n+
    166 {
    \n+
    167 return t.asInterface().wrappedLocalFunction();
    \n+
    168 }
    \n+
    169
    \n+
    176 const EntitySet& entitySet() const
    \n+
    177 {
    \n+
    178 return this->asInterface().wrappedEntitySet();
    \n+
    179 }
    \n+
    180};
    \n+
    181
    \n+
    182
    \n+
    183
    \n+
    184}} // namespace Dune::Functions
    \n+
    185
    \n+
    186
    \n+
    187
    \n+
    188#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH
    \n+\n+\n+\n+\n+\n+\n+\n
    Definition: polynomial.hh:10
    \n-
    DefaultNodeToRangeMap< Tree > makeDefaultNodeToRangeMap(const Tree &tree)
    Definition: defaultnodetorangemap.hh:103
    \n-
    A simple node to range map using lexicographic ordering.
    Definition: defaultnodetorangemap.hh:39
    \n-
    std::vector< std::size_t > indices_
    Definition: defaultnodetorangemap.hh:97
    \n-
    DefaultNodeToRangeMap(const Tree &tree)
    Construct DefaultNodeToRangeMap.
    Definition: defaultnodetorangemap.hh:78
    \n-
    Definition: defaultnodetorangemap.hh:49
    \n-
    Visitor(std::vector< std::size_t > &indices)
    Definition: defaultnodetorangemap.hh:50
    \n-
    void leaf(Node &node, TreePath treePath)
    Definition: defaultnodetorangemap.hh:56
    \n-
    std::size_t counter_
    Definition: defaultnodetorangemap.hh:65
    \n-
    std::vector< std::size_t > & indices_
    Definition: defaultnodetorangemap.hh:64
    \n-\n+
    Definition: localfunction.hh:30
    \n+
    Base class for type-erased interface wrapper.
    Definition: typeerasure.hh:165
    \n+
    Definition: gridfunction.hh:32
    \n+
    friend DerivativeInterface derivative(const GridFunction &t)
    Get derivative of wrapped function.
    Definition: gridfunction.hh:151
    \n+\n+
    const EntitySet & entitySet() const
    Get associated EntitySet.
    Definition: gridfunction.hh:176
    \n+
    GridFunction(F &&f)
    Construct from function.
    Definition: gridfunction.hh:125
    \n+
    friend LocalFunctionInterface localFunction(const GridFunction &t)
    Get local function of wrapped function.
    Definition: gridfunction.hh:165
    \n+
    Derivative traits for local functions.
    Definition: localderivativetraits.hh:28
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,147 +4,199 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * functionspacebases\n-defaultnodetorangemap.hh\n+ * gridfunctions\n+gridfunction.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH\n+ 3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH\n+ 4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH\n 5\n- 6\n- 7#include \n- 8\n- 9#include \n- 10\n- 11#include \n- 12#include \n- 13\n- 14\n- 15namespace Dune {\n- 16namespace Functions {\n+ 6#include \n+ 7\n+ 8#include \n+ 9\n+ 10#include \n+ 11#include \n+ 12#include \n+ 13#include \n+ 14#include \n+ 15#include \n+ 16#include \n 17\n 18\n 19\n- 37template\n-38struct DefaultNodeToRangeMap\n- 39{\n- 40\n- 41 // A simple visitor for computing lexicographic\n- 42 // subtree indices. To identify a leaf node\n- 43 // we use its treeIndex() which is unique\n- 44 // wrt the whole tree and store the computed\n- 45 // index in a vector indexed by the tree indices.\n-46 struct Visitor\n- 47 : public TypeTree::TreeVisitor\n- 48 , public TypeTree::DynamicTraversal\n- 49 {\n-50 Visitor(std::vector& indices) :\n- 51 indices_(indices),\n- 52 counter_(0)\n- 53 {}\n- 54\n- 55 template\n-56 void leaf(Node& node, TreePath treePath)\n- 57 {\n- 58 if (indices_.size() < node.treeIndex()+1)\n- 59 indices_.resize(node.treeIndex()+1);\n- 60 indices_[node.treeIndex()] = counter_;\n- 61 ++counter_;\n- 62 }\n- 63\n-64 std::vector& indices_;\n-65 std::size_t counter_;\n- 66 };\n- 67\n-78 DefaultNodeToRangeMap(const Tree& tree)\n- 79 {\n- 80 TypeTree::applyToTree(tree, Visitor(indices_));\n- 81 }\n+ 20namespace Dune {\n+ 21namespace Functions {\n+ 22\n+ 23\n+ 24\n+ 25/*\n+ 26 * Default implementation is empty\n+ 27 * The actual implementation is only given if Signature is an type\n+ 28 * describing a function signature as Range(Domain).\n+ 29 */\n+ 30template class\n+DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>\n+31class GridFunction\n+ 32{};\n+ 33\n+ 34\n+ 35\n+ 36namespace Imp\n+ 37{\n+ 38\n+ 40 template class DerivativeTraits, size_t\n+bufferSize>\n+ 41 struct GridFunctionTraits :\n+ 42 DifferentiableFunctionTraits\n+ 43 {\n+ 44 protected:\n+ 45 using Base=DifferentiableFunctionTraits;\n+ 46\n+ 47 public:\n+ 49 using EntitySet = ES;\n+ 50\n+ 52 using Element = typename EntitySet::Element;\n+ 53\n+ 55 using DerivativeSignature = typename Base::DerivativeSignature;\n+ 56\n+ 58 using DerivativeInterface = GridFunction;\n+ 59\n+ 61 using LocalSignature = typename Base::Range(typename EntitySet::\n+LocalCoordinate);\n+ 62\n+ 64 template\n+ 65 using LocalDerivativeTraits = typename Dune::Functions::\n+LocalDerivativeTraits::template Traits;\n+ 66\n+ 68 using LocalFunctionTraits = typename Dune::Functions::Imp::\n+LocalFunctionTraits;\n+ 69\n+ 71 using LocalFunctionInterface = LocalFunction;\n+ 72\n+ 74 using Concept = GridFunctionWrapperInterface;\n+ 75\n+ 77 template\n+ 78 using Model = GridFunctionWrapperImplementation;\n+ 79 };\n+ 80}\n+ 81\n 82\n- 83 template().treeIndex())>() and not Tree::isLeaf, int> = 0>\n-85 decltype(auto) operator()(const Node& node, const TreePath& treePath,\n-Range&& y) const\n- 86 {\n- 87 return y[indices_[node.treeIndex()]];\n- 88 }\n- 89\n- 90 template().treeIndex())>() or Tree::isLeaf, int> = 0>\n-92 decltype(auto) operator()(const Node& node, const TreePath& treePath,\n-Range&& y) const\n- 93 {\n- 94 return std::forward(y);\n- 95 }\n- 96\n-97 std::vector indices_;\n- 98};\n- 99\n- 100\n- 101\n- 102template\n-103DefaultNodeToRangeMap makeDefaultNodeToRangeMap(const Tree& tree)\n- 104{\n- 105 return DefaultNodeToRangeMap(tree);\n- 106}\n- 107\n+ 83\n+ 95template class\n+DerivativeTraits, size_t bufferSize>\n+96class GridFunction :\n+ 97 public TypeErasureBase<\n+ 98 typename Imp::GridFunctionTraits::Concept,\n+ 99 Imp::GridFunctionTraits::\n+template Model>\n+ 100{\n+ 101 using Traits = Imp::GridFunctionTraits;\n+ 102\n+ 103 using Base = TypeErasureBase;\n+ 104\n+ 105 using DerivativeInterface = typename Traits::DerivativeInterface;\n+ 106\n+ 107 using LocalFunctionInterface = typename Traits::LocalFunctionInterface;\n 108\n- 109\n- 110template\n-111auto makeDefaultNodeToRangeMap(const Basis& basis, TreePath&& treePath)\n- 112 -> decltype(makeDefaultNodeToRangeMap(TypeTree::child(basis.localView\n-().tree(),treePath)))\n- 113{\n- 114 auto&& localView = basis.localView();\n- 115 localView.bind(*basis.gridView().template begin<0>());\n- 116 auto&& tree = TypeTree::child(localView.tree(),treePath);\n- 117 return makeDefaultNodeToRangeMap(tree);\n- 118}\n- 119\n- 120\n- 121\n- 122} // namespace Dune::Functions\n- 123} // namespace Dune\n- 124\n- 125\n- 126#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_DEFAULTNODETORANGEMAP_HH\n+ 109 using EntitySet = typename Traits::EntitySet;\n+ 110\n+ 111public:\n+ 112\n+ 124 template = 0 >\n+125 GridFunction(F&& f) :\n+ 126 Base(std::forward(f))\n+ 127 {\n+ 128 static_assert(Dune::Functions::Concept::isGridFunction(), \"Trying to construct a GridFunction from type that does not model\n+the GridFunction concept\");\n+ 129 }\n+ 130\n+131 GridFunction() = default;\n+ 132\n+138 Range operator() (const Domain& x) const\n+ 139 {\n+ 140 return this->asInterface().operator()(x);\n+ 141 }\n+ 142\n+151 friend DerivativeInterface derivative(const GridFunction& t)\n+ 152 {\n+ 153 return t.asInterface().derivative();\n+ 154 }\n+ 155\n+165 friend LocalFunctionInterface localFunction(const GridFunction& t)\n+ 166 {\n+ 167 return t.asInterface().wrappedLocalFunction();\n+ 168 }\n+ 169\n+176 const EntitySet& entitySet() const\n+ 177 {\n+ 178 return this->asInterface().wrappedEntitySet();\n+ 179 }\n+ 180};\n+ 181\n+ 182\n+ 183\n+ 184}} // namespace Dune::Functions\n+ 185\n+ 186\n+ 187\n+ 188#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_HH\n+localfunction.hh\n+functionconcepts.hh\n+typeerasure.hh\n+defaultderivativetraits.hh\n+differentiablefunction.hh\n+gridfunction_imp.hh\n+localderivativetraits.hh\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::makeDefaultNodeToRangeMap\n-DefaultNodeToRangeMap< Tree > makeDefaultNodeToRangeMap(const Tree &tree)\n-Definition: defaultnodetorangemap.hh:103\n-Dune::Functions::DefaultNodeToRangeMap\n-A simple node to range map using lexicographic ordering.\n-Definition: defaultnodetorangemap.hh:39\n-Dune::Functions::DefaultNodeToRangeMap::indices_\n-std::vector< std::size_t > indices_\n-Definition: defaultnodetorangemap.hh:97\n-Dune::Functions::DefaultNodeToRangeMap::DefaultNodeToRangeMap\n-DefaultNodeToRangeMap(const Tree &tree)\n-Construct DefaultNodeToRangeMap.\n-Definition: defaultnodetorangemap.hh:78\n-Dune::Functions::DefaultNodeToRangeMap::Visitor\n-Definition: defaultnodetorangemap.hh:49\n-Dune::Functions::DefaultNodeToRangeMap::Visitor::Visitor\n-Visitor(std::vector< std::size_t > &indices)\n-Definition: defaultnodetorangemap.hh:50\n-Dune::Functions::DefaultNodeToRangeMap::Visitor::leaf\n-void leaf(Node &node, TreePath treePath)\n-Definition: defaultnodetorangemap.hh:56\n-Dune::Functions::DefaultNodeToRangeMap::Visitor::counter_\n-std::size_t counter_\n-Definition: defaultnodetorangemap.hh:65\n-Dune::Functions::DefaultNodeToRangeMap::Visitor::indices_\n-std::vector< std::size_t > & indices_\n-Definition: defaultnodetorangemap.hh:64\n-concepts.hh\n+Dune::Functions::LocalFunction\n+Definition: localfunction.hh:30\n+Dune::Functions::TypeErasureBase\n+Base class for type-erased interface wrapper.\n+Definition: typeerasure.hh:165\n+Dune::Functions::GridFunction\n+Definition: gridfunction.hh:32\n+Dune::Functions::GridFunction<_Range(Domain),_ES,_DerivativeTraits,_bufferSize\n+>::derivative\n+friend DerivativeInterface derivative(const GridFunction &t)\n+Get derivative of wrapped function.\n+Definition: gridfunction.hh:151\n+Dune::Functions::GridFunction<_Range(Domain),_ES,_DerivativeTraits,_bufferSize\n+>::GridFunction\n+GridFunction()=default\n+Dune::Functions::GridFunction<_Range(Domain),_ES,_DerivativeTraits,_bufferSize\n+>::entitySet\n+const EntitySet & entitySet() const\n+Get associated EntitySet.\n+Definition: gridfunction.hh:176\n+Dune::Functions::GridFunction<_Range(Domain),_ES,_DerivativeTraits,_bufferSize\n+>::GridFunction\n+GridFunction(F &&f)\n+Construct from function.\n+Definition: gridfunction.hh:125\n+Dune::Functions::GridFunction<_Range(Domain),_ES,_DerivativeTraits,_bufferSize\n+>::localFunction\n+friend LocalFunctionInterface localFunction(const GridFunction &t)\n+Get local function of wrapped function.\n+Definition: gridfunction.hh:165\n+Dune::Functions::LocalDerivativeTraits\n+Derivative traits for local functions.\n+Definition: localderivativetraits.hh:28\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00173.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00173.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: globalvaluedlocalfiniteelement.hh File Reference\n+dune-functions: gridfunction_imp.hh File Reference\n \n \n \n \n \n \n \n@@ -58,33 +58,26 @@\n \n \n \n \n \n
    \n \n-
    globalvaluedlocalfiniteelement.hh File Reference
    \n+
    gridfunction_imp.hh File Reference
    \n
    \n
    \n-
    #include <array>
    \n-#include <numeric>
    \n-#include <dune/common/fmatrix.hh>
    \n-#include <dune/common/fvector.hh>
    \n-#include <dune/common/math.hh>
    \n-#include <dune/common/rangeutilities.hh>
    \n-#include <dune/geometry/referenceelements.hh>
    \n-#include <dune/localfunctions/common/localbasis.hh>
    \n-#include <dune/localfunctions/common/localfiniteelementtraits.hh>
    \n-#include <dune/localfunctions/common/localinterpolation.hh>
    \n+\n

    Go to the source code of this file.

    \n \n \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,27 +4,20 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * functionspacebases\n+ * gridfunctions\n Namespaces\n-globalvaluedlocalfiniteelement.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+gridfunction_imp.hh File Reference\n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n \n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00173_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00173_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: globalvaluedlocalfiniteelement.hh Source File\n+dune-functions: gridfunction_imp.hh Source File\n \n \n \n \n \n \n \n@@ -58,328 +58,92 @@\n \n \n \n \n \n
    \n-
    globalvaluedlocalfiniteelement.hh
    \n+
    gridfunction_imp.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH
    \n+
    4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH
    \n
    5
    \n-
    6#include <array>
    \n-
    7#include <numeric>
    \n-
    8
    \n-
    9#include <dune/common/fmatrix.hh>
    \n-
    10#include <dune/common/fvector.hh>
    \n-
    11#include <dune/common/math.hh>
    \n-
    12#include <dune/common/rangeutilities.hh>
    \n-
    13
    \n-
    14#include <dune/geometry/referenceelements.hh>
    \n+\n+\n+\n+
    9
    \n+
    10
    \n+
    11
    \n+
    12namespace Dune {
    \n+
    13namespace Functions {
    \n+
    14namespace Imp {
    \n
    15
    \n-
    16#include <dune/localfunctions/common/localbasis.hh>
    \n-
    17#include <dune/localfunctions/common/localfiniteelementtraits.hh>
    \n-
    18#include <dune/localfunctions/common/localinterpolation.hh>
    \n-
    19
    \n-
    20namespace Dune::Functions::Impl
    \n-
    21{
    \n-
    22
    \n-
    36 struct ContravariantPiolaTransformator
    \n-
    37 {
    \n-
    42 template<typename Values, typename LocalCoordinate, typename Geometry>
    \n-
    43 static auto apply(Values& values,
    \n-
    44 const LocalCoordinate& xi,
    \n-
    45 const Geometry& geometry)
    \n-
    46 {
    \n-
    47 auto jacobianTransposed = geometry.jacobianTransposed(xi);
    \n-
    48 auto integrationElement = geometry.integrationElement(xi);
    \n-
    49
    \n-
    50 for (auto& value : values)
    \n-
    51 {
    \n-
    52 auto tmp = value;
    \n-
    53 jacobianTransposed.mtv(tmp, value);
    \n-
    54 value /= integrationElement;
    \n-
    55 }
    \n-
    56 }
    \n+
    19struct HasFreeLocalFunction
    \n+
    20{
    \n+
    21 template<class F>
    \n+
    22 auto require(F&& f) -> decltype(
    \n+
    23 localFunction(f)
    \n+
    24 );
    \n+
    25};
    \n+
    26
    \n+
    27
    \n+
    28
    \n+
    29// Interface of type erasure wrapper
    \n+
    30//
    \n+
    31// Notice that the basic interface of polymorphic classes (destructor, clone, ...)
    \n+
    32// will be added by the type erasure foundation classes.
    \n+
    33template<class Signature, class DerivativeInterface, class LocalFunctionInterface, class EntitySet>
    \n+
    34class GridFunctionWrapperInterface :
    \n+
    35 public DifferentiableFunctionWrapperInterface<Signature, DerivativeInterface>
    \n+
    36{
    \n+
    37public:
    \n+
    38 virtual LocalFunctionInterface wrappedLocalFunction() const = 0;
    \n+
    39
    \n+
    40 virtual const EntitySet& wrappedEntitySet() const = 0;
    \n+
    41};
    \n+
    42
    \n+
    43
    \n+
    44// Implementation of type erasure wrapper
    \n+
    45template<class Signature, class DerivativeInterface, class LocalFunctionInterface, class EntitySet, class B>
    \n+
    46class GridFunctionWrapperImplementation :
    \n+
    47 public DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>
    \n+
    48{
    \n+
    49 using Base = DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>;
    \n+
    50public:
    \n+
    51 using Base::Base;
    \n+
    52
    \n+
    53 virtual LocalFunctionInterface wrappedLocalFunction() const
    \n+
    54 {
    \n+
    55 return localFunction(this->get());
    \n+
    56 }
    \n
    57
    \n-
    67 template<typename Gradients, typename LocalCoordinate, typename Geometry>
    \n-
    68 static auto applyJacobian(Gradients& gradients,
    \n-
    69 const LocalCoordinate& xi,
    \n-
    70 const Geometry& geometry)
    \n-
    71 {
    \n-
    72 auto jacobianTransposed = geometry.jacobianTransposed(xi);
    \n-
    73 auto integrationElement = geometry.integrationElement(xi);
    \n-
    74 for (auto& gradient : gradients)
    \n-
    75 {
    \n-
    76 auto tmp = gradient;
    \n-
    77 gradient = 0;
    \n-
    78 for (size_t k=0; k<gradient.M(); k++)
    \n-
    79 for (size_t l=0; l<tmp.N(); l++)
    \n-
    80 // Use sparseRange because jacobianTransposed may be a sparse DiagonalMatrix
    \n-
    81 for(auto&& [jacobianTransposed_l_j, j] : sparseRange(jacobianTransposed[l]))
    \n-
    82 gradient[j][k] += jacobianTransposed_l_j * tmp[l][k];
    \n-
    83 gradient /= integrationElement;
    \n-
    84 }
    \n-
    85 }
    \n-
    86
    \n-
    94 template<class Function, class LocalCoordinate, class Element>
    \n-
    95 class LocalValuedFunction
    \n-
    96 {
    \n-
    97 const Function& f_;
    \n-
    98 const Element& element_;
    \n-
    99
    \n-
    100 public:
    \n-
    101
    \n-
    102 LocalValuedFunction(const Function& f, const Element& element)
    \n-
    103 : f_(f), element_(element)
    \n-
    104 {}
    \n-
    105
    \n-
    106 auto operator()(const LocalCoordinate& xi) const
    \n-
    107 {
    \n-
    108 auto&& f = Dune::Impl::makeFunctionWithCallOperator<LocalCoordinate>(f_);
    \n-
    109 auto globalValue = f(xi);
    \n-
    110
    \n-
    111 // Apply the inverse Piola transform
    \n-
    112 auto jacobianInverseTransposed = element_.geometry().jacobianInverseTransposed(xi);
    \n-
    113 auto integrationElement = element_.geometry().integrationElement(xi);
    \n-
    114
    \n-
    115 auto localValue = globalValue;
    \n-
    116 jacobianInverseTransposed.mtv(globalValue, localValue);
    \n-
    117 localValue *= integrationElement;
    \n-
    118
    \n-
    119 return localValue;
    \n-
    120 }
    \n-
    121 };
    \n-
    122 };
    \n-
    123
    \n-
    137 struct CovariantPiolaTransformator
    \n-
    138 {
    \n-
    143 template<typename Values, typename LocalCoordinate, typename Geometry>
    \n-
    144 static auto apply(Values& values,
    \n-
    145 const LocalCoordinate& xi,
    \n-
    146 const Geometry& geometry)
    \n-
    147 {
    \n-
    148 auto jacobianInverseTransposed = geometry.jacobianInverseTransposed(xi);
    \n-
    149
    \n-
    150 for (auto& value : values)
    \n-
    151 {
    \n-
    152 auto tmp = value;
    \n-
    153 jacobianInverseTransposed.mv(tmp, value);
    \n-
    154 }
    \n-
    155 }
    \n-
    156
    \n-
    166 template<typename Gradients, typename LocalCoordinate, typename Geometry>
    \n-
    167 static auto applyJacobian(Gradients& gradients,
    \n-
    168 const LocalCoordinate& xi,
    \n-
    169 const Geometry& geometry)
    \n-
    170 {
    \n-
    171 auto jacobianInverseTransposed = geometry.jacobianInverseTransposed(xi);
    \n-
    172
    \n-
    173 for (auto& gradient : gradients)
    \n-
    174 {
    \n-
    175 auto tmp = gradient;
    \n-
    176 gradient = 0;
    \n-
    177 for (size_t j=0; j<gradient.N(); j++)
    \n-
    178 for (size_t k=0; k<gradient.M(); k++)
    \n-
    179 // Use sparseRange because jacobianTransposed may be a sparse DiagonalMatrix
    \n-
    180 for(auto&& [jacobianInverseTransposed_j_l, l] : sparseRange(jacobianInverseTransposed[j]))
    \n-
    181 gradient[j][k] += jacobianInverseTransposed_j_l * tmp[l][k];
    \n-
    182 }
    \n-
    183 }
    \n-
    184
    \n-
    192 template<class Function, class LocalCoordinate, class Element>
    \n-
    193 class LocalValuedFunction
    \n-
    194 {
    \n-
    195 const Function& f_;
    \n-
    196 const Element& element_;
    \n-
    197
    \n-
    198 public:
    \n-
    199
    \n-
    200 LocalValuedFunction(const Function& f, const Element& element)
    \n-
    201 : f_(f), element_(element)
    \n-
    202 {}
    \n-
    203
    \n-
    204 auto operator()(const LocalCoordinate& xi) const
    \n-
    205 {
    \n-
    206 auto&& f = Dune::Impl::makeFunctionWithCallOperator<LocalCoordinate>(f_);
    \n-
    207 auto globalValue = f(xi);
    \n-
    208
    \n-
    209 // Apply the inverse Piola transform
    \n-
    210 auto jacobianTransposed = element_.geometry().jacobianTransposed(xi);
    \n-
    211
    \n-
    212 auto localValue = globalValue;
    \n-
    213 jacobianTransposed.mv(globalValue, localValue);
    \n-
    214
    \n-
    215 return localValue;
    \n-
    216 }
    \n-
    217 };
    \n-
    218 };
    \n-
    219
    \n-
    226 template<class Transformator, class LocalValuedLocalBasis, class Element>
    \n-
    227 class GlobalValuedLocalBasis
    \n-
    228 {
    \n-
    229 public:
    \n-
    230 using Traits = typename LocalValuedLocalBasis::Traits;
    \n-
    231
    \n-
    234 void bind(const LocalValuedLocalBasis& localValuedLocalBasis, const Element& element)
    \n-
    235 {
    \n-
    236 localValuedLocalBasis_ = &localValuedLocalBasis;
    \n-
    237 element_ = &element;
    \n-
    238 }
    \n-
    239
    \n-
    242 auto size() const
    \n-
    243 {
    \n-
    244 return localValuedLocalBasis_->size();
    \n-
    245 }
    \n-
    246
    \n-
    248 void evaluateFunction(const typename Traits::DomainType& x,
    \n-
    249 std::vector<typename Traits::RangeType>& out) const
    \n-
    250 {
    \n-
    251 localValuedLocalBasis_->evaluateFunction(x,out);
    \n-
    252
    \n-
    253 Transformator::apply(out, x, element_->geometry());
    \n-
    254 }
    \n-
    255
    \n-
    261 void evaluateJacobian(const typename Traits::DomainType& x,
    \n-
    262 std::vector<typename Traits::JacobianType>& out) const
    \n-
    263 {
    \n-
    264 localValuedLocalBasis_->evaluateJacobian(x,out);
    \n-
    265
    \n-
    266 Transformator::applyJacobian(out, x, element_->geometry());
    \n-
    267 }
    \n-
    268
    \n-
    275 void partial(const std::array<unsigned int,2>& order,
    \n-
    276 const typename Traits::DomainType& x,
    \n-
    277 std::vector<typename Traits::RangeType>& out) const
    \n-
    278 {
    \n-
    279 auto totalOrder = std::accumulate(order.begin(), order.end(), 0);
    \n-
    280 if (totalOrder == 0) {
    \n-
    281 evaluateFunction(x, out);
    \n-
    282 } else if (totalOrder == 1) {
    \n-
    283 auto const direction = std::distance(order.begin(), std::find(order.begin(), order.end(), 1));
    \n-
    284 out.resize(size());
    \n-
    285
    \n-
    286 // TODO: The following is wasteful: We compute the full Jacobian and then return
    \n-
    287 // only a part of it. While we need the full Jacobian of the underlying local-valued LFE,
    \n-
    288 // it should be possible to compute only a partial Piola transform for the requested
    \n-
    289 // partial derivatives.
    \n-
    290 std::vector<typename Traits::JacobianType> fullJacobian;
    \n-
    291 localValuedLocalBasis_->evaluateJacobian(x,fullJacobian);
    \n-
    292
    \n-
    293 Transformator::applyJacobian(fullJacobian, x, element_->geometry());
    \n-
    294
    \n-
    295 for (std::size_t i=0; i<out.size(); i++)
    \n-
    296 for (std::size_t j=0; j<out[i].size(); j++)
    \n-
    297 out[i][j] = fullJacobian[i][j][direction];
    \n-
    298
    \n-
    299 } else
    \n-
    300 DUNE_THROW(NotImplemented, "Partial derivatives of order 2 or higher");
    \n-
    301 }
    \n-
    302
    \n-
    304 auto order() const
    \n-
    305 {
    \n-
    306 return localValuedLocalBasis_->order();
    \n-
    307 }
    \n-
    308
    \n-
    309 const LocalValuedLocalBasis* localValuedLocalBasis_;
    \n-
    310 const Element* element_;
    \n-
    311 };
    \n-
    312
    \n-
    321 template<class Transformator, class LocalValuedLocalInterpolation, class Element>
    \n-
    322 class GlobalValuedLocalInterpolation
    \n-
    323 {
    \n-
    324 public:
    \n-
    327 void bind(const LocalValuedLocalInterpolation& localValuedLocalInterpolation, const Element& element)
    \n-
    328 {
    \n-
    329 localValuedLocalInterpolation_ = &localValuedLocalInterpolation;
    \n-
    330 element_ = &element;
    \n-
    331 }
    \n-
    332
    \n-
    333 template<typename F, typename C>
    \n-
    334 void interpolate (const F& f, std::vector<C>& out) const
    \n-
    335 {
    \n-
    336 using LocalCoordinate = typename Element::Geometry::LocalCoordinate;
    \n-
    337 typename Transformator::template LocalValuedFunction<F,LocalCoordinate,Element> localValuedFunction(f, *element_);
    \n-
    338 localValuedLocalInterpolation_->interpolate(localValuedFunction, out);
    \n-
    339 }
    \n-
    340
    \n-
    341 private:
    \n-
    342 const LocalValuedLocalInterpolation* localValuedLocalInterpolation_;
    \n-
    343 const Element* element_;
    \n-
    344 };
    \n-
    345
    \n-
    346
    \n-
    353 template<class Transformator, class LocalValuedLFE, class Element>
    \n-
    354 class GlobalValuedLocalFiniteElement
    \n-
    355 {
    \n-
    356 using LocalBasis = GlobalValuedLocalBasis<Transformator,
    \n-
    357 typename LocalValuedLFE::Traits::LocalBasisType,
    \n-
    358 Element>;
    \n-
    359 using LocalInterpolation = GlobalValuedLocalInterpolation<Transformator,
    \n-
    360 typename LocalValuedLFE::Traits::LocalInterpolationType,
    \n-
    361 Element>;
    \n-
    362
    \n-
    363 public:
    \n-
    366 using Traits = LocalFiniteElementTraits<LocalBasis,
    \n-
    367 typename LocalValuedLFE::Traits::LocalCoefficientsType,
    \n-
    368 LocalInterpolation>;
    \n-
    369
    \n-
    370 GlobalValuedLocalFiniteElement() {}
    \n-
    371
    \n-
    372 void bind(const LocalValuedLFE& localValuedLFE, const Element& element)
    \n-
    373 {
    \n-
    374 globalValuedLocalBasis_.bind(localValuedLFE.localBasis(), element);
    \n-
    375 globalValuedLocalInterpolation_.bind(localValuedLFE.localInterpolation(), element);
    \n-
    376 localValuedLFE_ = &localValuedLFE;
    \n-
    377 }
    \n-
    378
    \n-
    381 const typename Traits::LocalBasisType& localBasis() const
    \n-
    382 {
    \n-
    383 return globalValuedLocalBasis_;
    \n-
    384 }
    \n-
    385
    \n-
    388 const typename Traits::LocalCoefficientsType& localCoefficients() const
    \n-
    389 {
    \n-
    390 return localValuedLFE_->localCoefficients();
    \n-
    391 }
    \n-
    392
    \n-
    395 const typename Traits::LocalInterpolationType& localInterpolation() const
    \n-
    396 {
    \n-
    397 return globalValuedLocalInterpolation_;
    \n-
    398 }
    \n-
    399
    \n-
    401 std::size_t size() const
    \n-
    402 {
    \n-
    403 return localValuedLFE_->size();
    \n-
    404 }
    \n-
    405
    \n-
    408 GeometryType type() const
    \n-
    409 {
    \n-
    410 return localValuedLFE_->type();
    \n-
    411 }
    \n-
    412
    \n-
    413 private:
    \n-
    414
    \n-
    415 typename Traits::LocalBasisType globalValuedLocalBasis_;
    \n-
    416 typename Traits::LocalInterpolationType globalValuedLocalInterpolation_;
    \n-
    417 const LocalValuedLFE* localValuedLFE_;
    \n-
    418 };
    \n-
    419
    \n-
    420} // namespace Dune::Functions::Impl
    \n-
    421
    \n-
    422#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH
    \n-
    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
    \n+
    58 virtual const EntitySet& wrappedEntitySet() const
    \n+
    59 {
    \n+
    60 return this->get().entitySet();
    \n+
    61 }
    \n+
    62};
    \n+
    63
    \n+
    64
    \n+
    65
    \n+
    66}}} // namespace Dune::Functions::Imp
    \n+
    67
    \n+
    68
    \n+
    69
    \n+
    70#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH
    \n+\n+\n+\n+
    Definition: polynomial.hh:10
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,340 +4,91 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * functionspacebases\n-globalvaluedlocalfiniteelement.hh\n+ * gridfunctions\n+gridfunction_imp.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH\n+ 3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH\n+ 4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH\n 5\n- 6#include \n- 7#include \n- 8\n- 9#include \n- 10#include \n- 11#include \n- 12#include \n- 13\n- 14#include \n+ 6#include \n+ 7#include \n+ 8#include \n+ 9\n+ 10\n+ 11\n+ 12namespace Dune {\n+ 13namespace Functions {\n+ 14namespace Imp {\n 15\n- 16#include \n- 17#include \n- 18#include \n- 19\n- 20namespace Dune::Functions::Impl\n- 21{\n- 22\n- 36 struct ContravariantPiolaTransformator\n- 37 {\n- 42 template\n- 43 static auto apply(Values& values,\n- 44 const LocalCoordinate& xi,\n- 45 const Geometry& geometry)\n- 46 {\n- 47 auto jacobianTransposed = geometry.jacobianTransposed(xi);\n- 48 auto integrationElement = geometry.integrationElement(xi);\n- 49\n- 50 for (auto& value : values)\n- 51 {\n- 52 auto tmp = value;\n- 53 jacobianTransposed.mtv(tmp, value);\n- 54 value /= integrationElement;\n- 55 }\n+ 19struct HasFreeLocalFunction\n+ 20{\n+ 21 template\n+ 22 auto require(F&& f) -> decltype(\n+ 23 localFunction(f)\n+ 24 );\n+ 25};\n+ 26\n+ 27\n+ 28\n+ 29// Interface of type erasure wrapper\n+ 30//\n+ 31// Notice that the basic interface of polymorphic classes (destructor,\n+clone, ...)\n+ 32// will be added by the type erasure foundation classes.\n+ 33template\n+ 34class GridFunctionWrapperInterface :\n+ 35 public DifferentiableFunctionWrapperInterface\n+ 36{\n+ 37public:\n+ 38 virtual LocalFunctionInterface wrappedLocalFunction() const = 0;\n+ 39\n+ 40 virtual const EntitySet& wrappedEntitySet() const = 0;\n+ 41};\n+ 42\n+ 43\n+ 44// Implementation of type erasure wrapper\n+ 45template\n+ 46class GridFunctionWrapperImplementation :\n+ 47 public DifferentiableFunctionWrapperImplementation\n+ 48{\n+ 49 using Base = DifferentiableFunctionWrapperImplementation;\n+ 50public:\n+ 51 using Base::Base;\n+ 52\n+ 53 virtual LocalFunctionInterface wrappedLocalFunction() const\n+ 54 {\n+ 55 return localFunction(this->get());\n 56 }\n 57\n- 67 template\n- 68 static auto applyJacobian(Gradients& gradients,\n- 69 const LocalCoordinate& xi,\n- 70 const Geometry& geometry)\n- 71 {\n- 72 auto jacobianTransposed = geometry.jacobianTransposed(xi);\n- 73 auto integrationElement = geometry.integrationElement(xi);\n- 74 for (auto& gradient : gradients)\n- 75 {\n- 76 auto tmp = gradient;\n- 77 gradient = 0;\n- 78 for (size_t k=0; k\n- 95 class LocalValuedFunction\n- 96 {\n- 97 const Function& f_;\n- 98 const Element& element_;\n- 99\n- 100 public:\n- 101\n- 102 LocalValuedFunction(const Function& f, const Element& element)\n- 103 : f_(f), element_(element)\n- 104 {}\n- 105\n- 106 auto operator()(const LocalCoordinate& xi) const\n- 107 {\n- 108 auto&& f = Dune::Impl::makeFunctionWithCallOperator(f_);\n- 109 auto globalValue = f(xi);\n- 110\n- 111 // Apply the inverse Piola transform\n- 112 auto jacobianInverseTransposed = element_.geometry\n-().jacobianInverseTransposed(xi);\n- 113 auto integrationElement = element_.geometry().integrationElement(xi);\n- 114\n- 115 auto localValue = globalValue;\n- 116 jacobianInverseTransposed.mtv(globalValue, localValue);\n- 117 localValue *= integrationElement;\n- 118\n- 119 return localValue;\n- 120 }\n- 121 };\n- 122 };\n- 123\n- 137 struct CovariantPiolaTransformator\n- 138 {\n- 143 template\n- 144 static auto apply(Values& values,\n- 145 const LocalCoordinate& xi,\n- 146 const Geometry& geometry)\n- 147 {\n- 148 auto jacobianInverseTransposed = geometry.jacobianInverseTransposed(xi);\n- 149\n- 150 for (auto& value : values)\n- 151 {\n- 152 auto tmp = value;\n- 153 jacobianInverseTransposed.mv(tmp, value);\n- 154 }\n- 155 }\n- 156\n- 166 template\n- 167 static auto applyJacobian(Gradients& gradients,\n- 168 const LocalCoordinate& xi,\n- 169 const Geometry& geometry)\n- 170 {\n- 171 auto jacobianInverseTransposed = geometry.jacobianInverseTransposed(xi);\n- 172\n- 173 for (auto& gradient : gradients)\n- 174 {\n- 175 auto tmp = gradient;\n- 176 gradient = 0;\n- 177 for (size_t j=0; j\n- 193 class LocalValuedFunction\n- 194 {\n- 195 const Function& f_;\n- 196 const Element& element_;\n- 197\n- 198 public:\n- 199\n- 200 LocalValuedFunction(const Function& f, const Element& element)\n- 201 : f_(f), element_(element)\n- 202 {}\n- 203\n- 204 auto operator()(const LocalCoordinate& xi) const\n- 205 {\n- 206 auto&& f = Dune::Impl::makeFunctionWithCallOperator(f_);\n- 207 auto globalValue = f(xi);\n- 208\n- 209 // Apply the inverse Piola transform\n- 210 auto jacobianTransposed = element_.geometry().jacobianTransposed(xi);\n- 211\n- 212 auto localValue = globalValue;\n- 213 jacobianTransposed.mv(globalValue, localValue);\n- 214\n- 215 return localValue;\n- 216 }\n- 217 };\n- 218 };\n- 219\n- 226 template\n- 227 class GlobalValuedLocalBasis\n- 228 {\n- 229 public:\n- 230 using Traits = typename LocalValuedLocalBasis::Traits;\n- 231\n- 234 void bind(const LocalValuedLocalBasis& localValuedLocalBasis, const\n-Element& element)\n- 235 {\n- 236 localValuedLocalBasis_ = &localValuedLocalBasis;\n- 237 element_ = &element;\n- 238 }\n- 239\n- 242 auto size() const\n- 243 {\n- 244 return localValuedLocalBasis_->size();\n- 245 }\n- 246\n- 248 void evaluateFunction(const typename Traits::DomainType& x,\n- 249 std::vector& out) const\n- 250 {\n- 251 localValuedLocalBasis_->evaluateFunction(x,out);\n- 252\n- 253 Transformator::apply(out, x, element_->geometry());\n- 254 }\n- 255\n- 261 void evaluateJacobian(const typename Traits::DomainType& x,\n- 262 std::vector& out) const\n- 263 {\n- 264 localValuedLocalBasis_->evaluateJacobian(x,out);\n- 265\n- 266 Transformator::applyJacobian(out, x, element_->geometry());\n- 267 }\n- 268\n- 275 void partial(const std::array& order,\n- 276 const typename Traits::DomainType& x,\n- 277 std::vector& out) const\n- 278 {\n- 279 auto totalOrder = std::accumulate(order.begin(), order.end(), 0);\n- 280 if (totalOrder == 0) {\n- 281 evaluateFunction(x, out);\n- 282 } else if (totalOrder == 1) {\n- 283 auto const direction = std::distance(order.begin(), std::find(order.begin\n-(), order.end(), 1));\n- 284 out.resize(size());\n- 285\n- 286 // TODO: The following is wasteful: We compute the full Jacobian and then\n-return\n- 287 // only a part of it. While we need the full Jacobian of the underlying\n-local-valued LFE,\n- 288 // it should be possible to compute only a partial Piola transform for the\n-requested\n- 289 // partial derivatives.\n- 290 std::vector fullJacobian;\n- 291 localValuedLocalBasis_->evaluateJacobian(x,fullJacobian);\n- 292\n- 293 Transformator::applyJacobian(fullJacobian, x, element_->geometry());\n- 294\n- 295 for (std::size_t i=0; iorder();\n- 307 }\n- 308\n- 309 const LocalValuedLocalBasis* localValuedLocalBasis_;\n- 310 const Element* element_;\n- 311 };\n- 312\n- 321 template\n- 322 class GlobalValuedLocalInterpolation\n- 323 {\n- 324 public:\n- 327 void bind(const LocalValuedLocalInterpolation&\n-localValuedLocalInterpolation, const Element& element)\n- 328 {\n- 329 localValuedLocalInterpolation_ = &localValuedLocalInterpolation;\n- 330 element_ = &element;\n- 331 }\n- 332\n- 333 template\n- 334 void interpolate (const F& f, std::vector& out) const\n- 335 {\n- 336 using LocalCoordinate = typename Element::Geometry::LocalCoordinate;\n- 337 typename Transformator::template\n-LocalValuedFunction localValuedFunction(f,\n-*element_);\n- 338 localValuedLocalInterpolation_->interpolate(localValuedFunction, out);\n- 339 }\n- 340\n- 341 private:\n- 342 const LocalValuedLocalInterpolation* localValuedLocalInterpolation_;\n- 343 const Element* element_;\n- 344 };\n- 345\n- 346\n- 353 template\n- 354 class GlobalValuedLocalFiniteElement\n- 355 {\n- 356 using LocalBasis = GlobalValuedLocalBasis;\n- 359 using LocalInterpolation = GlobalValuedLocalInterpolation;\n- 362\n- 363 public:\n- 366 using Traits = LocalFiniteElementTraits;\n- 369\n- 370 GlobalValuedLocalFiniteElement() {}\n- 371\n- 372 void bind(const LocalValuedLFE& localValuedLFE, const Element& element)\n- 373 {\n- 374 globalValuedLocalBasis_.bind(localValuedLFE.localBasis(), element);\n- 375 globalValuedLocalInterpolation_.bind(localValuedLFE.localInterpolation(),\n-element);\n- 376 localValuedLFE_ = &localValuedLFE;\n- 377 }\n- 378\n- 381 const typename Traits::LocalBasisType& localBasis() const\n- 382 {\n- 383 return globalValuedLocalBasis_;\n- 384 }\n- 385\n- 388 const typename Traits::LocalCoefficientsType& localCoefficients() const\n- 389 {\n- 390 return localValuedLFE_->localCoefficients();\n- 391 }\n- 392\n- 395 const typename Traits::LocalInterpolationType& localInterpolation() const\n- 396 {\n- 397 return globalValuedLocalInterpolation_;\n- 398 }\n- 399\n- 401 std::size_t size() const\n- 402 {\n- 403 return localValuedLFE_->size();\n- 404 }\n- 405\n- 408 GeometryType type() const\n- 409 {\n- 410 return localValuedLFE_->type();\n- 411 }\n- 412\n- 413 private:\n- 414\n- 415 typename Traits::LocalBasisType globalValuedLocalBasis_;\n- 416 typename Traits::LocalInterpolationType globalValuedLocalInterpolation_;\n- 417 const LocalValuedLFE* localValuedLFE_;\n- 418 };\n- 419\n- 420} // namespace Dune::Functions::Impl\n- 421\n- 422#endif /\n-/ DUNE_FUNCTIONS_FUNCTIONSPACEBASES_GLOBALVALUEDLOCALFINITEELEMENT_HH\n-Dune::Functions::interpolate\n-void interpolate(const B &basis, C &&coeff, const F &f, const BV &bv, const\n-NTRE &nodeToRangeEntry)\n-Interpolate given function in discrete function space.\n-Definition: interpolate.hh:202\n+ 58 virtual const EntitySet& wrappedEntitySet() const\n+ 59 {\n+ 60 return this->get().entitySet();\n+ 61 }\n+ 62};\n+ 63\n+ 64\n+ 65\n+ 66}}} // namespace Dune::Functions::Imp\n+ 67\n+ 68\n+ 69\n+ 70#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH\n+differentiablefunction_imp.hh\n+type_traits.hh\n+interfaces.hh\n+Dune\n+Definition: polynomial.hh:10\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00176.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00176.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: hierarchicvectorwrapper.hh File Reference\n+dune-functions: gridviewentityset.hh File Reference\n \n \n \n \n \n \n \n@@ -58,59 +58,40 @@\n \n \n \n \n \n
    \n \n-
    hierarchicvectorwrapper.hh File Reference
    \n+Namespaces
    \n+
    gridviewentityset.hh File Reference
    \n \n
    \n-
    #include <dune/common/concept.hh>
    \n-#include <dune/common/hybridutilities.hh>
    \n-#include <dune/common/indices.hh>
    \n-#include <dune/functions/common/indexaccess.hh>
    \n-#include <dune/functions/common/utility.hh>
    \n-#include <dune/functions/common/type_traits.hh>
    \n-#include <dune/functions/functionspacebases/concepts.hh>
    \n+
    #include <memory>
    \n
    \n

    Go to the source code of this file.

    \n

    \n Namespaces

    namespace  Dune
     
    \n \n-\n-\n+\n+\n \n

    \n Classes

    class  Dune::Functions::HierarchicVectorWrapper< V, CO >
     A wrapper providing multiindex access to vector entries. More...
    class  Dune::Functions::GridViewEntitySet< GV, cd >
     An entity set for all entities of given codim in a grid view. More...
     
    \n \n \n \n \n \n-

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n

    \n-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)
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,44 +4,24 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * functionspacebases\n-Classes | Namespaces | Functions\n-hierarchicvectorwrapper.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+ * gridfunctions\n+Classes | Namespaces\n+gridviewentityset.hh File Reference\n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::HierarchicVectorWrapper<_V,_CO_>\n-\u00a0 A wrapper providing multiindex access to vector entries. More...\n+class \u00a0Dune::Functions::GridViewEntitySet<_GV,_cd_>\n+\u00a0 An entity set for all entities of given codim in a grid view. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n- Functions\n-template\n-HierarchicVectorWrapper< V >\u00a0Dune::Functions::hierarchicVector (V &v)\n-\u00a0\n-template(), int >::type = 0>\n- V &\u00a0Dune::Functions::\n- makeHierarchicVectorForMultiIndex (V &v)\n-\u00a0\n-template(), int >::type = 0>\n-HierarchicVectorWrapper< V >\u00a0Dune::Functions::\n- makeHierarchicVectorForMultiIndex (V &v)\n-\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00176_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00176_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: hierarchicvectorwrapper.hh Source File\n+dune-functions: gridviewentityset.hh Source File\n \n \n \n \n \n \n \n@@ -58,280 +58,109 @@\n \n
    \n \n \n \n
    \n-
    hierarchicvectorwrapper.hh
    \n+
    gridviewentityset.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICVECTORWRAPPER_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICVECTORWRAPPER_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH
    \n+
    4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH
    \n
    5
    \n-
    6#include <dune/common/concept.hh>
    \n-
    7#include <dune/common/hybridutilities.hh>
    \n-
    8#include <dune/common/indices.hh>
    \n-
    9
    \n-\n-\n-\n-\n-
    14
    \n-
    15
    \n-
    16namespace Dune {
    \n-
    17namespace Functions {
    \n-
    18
    \n-
    19
    \n-
    20
    \n-
    21namespace Imp {
    \n-
    22
    \n-
    23 // Construct default coefficient type from vector and multiindex type
    \n-
    24 // This requires that MultiIndex has a static size. Otherwise the
    \n-
    25 // vector type itself is returned.
    \n-
    26 template<class V, class MultiIndex>
    \n-
    27 struct CoefficientType
    \n-
    28 {
    \n-
    29 template<class E, std::size_t size>
    \n-
    30 struct DefaultCoefficientTypeHelper
    \n-
    31 {
    \n-
    32 using E0 = decltype(std::declval<E>()[Dune::Indices::_0]);
    \n-
    33 using type = typename DefaultCoefficientTypeHelper<E0, size-1>::type;
    \n-
    34 };
    \n-
    35
    \n-
    36 template<class E>
    \n-
    37 struct DefaultCoefficientTypeHelper<E, 0>
    \n-
    38 {
    \n-
    39 using type = E;
    \n-
    40 };
    \n-
    41
    \n-
    42 template<class MI,
    \n-
    43 typename std::enable_if<HasStaticSize<MI>::value, int>::type = 0>
    \n-
    44 static constexpr std::size_t getStaticSizeOrZero()
    \n-
    45 {
    \n-
    46 return StaticSize<MI>::value;
    \n-
    47 }
    \n-
    48
    \n-
    49 template<class MI,
    \n-
    50 typename std::enable_if<not HasStaticSize<MI>::value, int>::type = 0>
    \n-
    51 static constexpr std::size_t getStaticSizeOrZero()
    \n-
    52 {
    \n-
    53 return 0;
    \n-
    54 }
    \n-
    55
    \n-
    56 using type = typename DefaultCoefficientTypeHelper<V, getStaticSizeOrZero<MultiIndex>()>::type;
    \n-
    57 };
    \n-
    58
    \n-
    59
    \n-
    60
    \n-
    61 // This tag class is used as Coefficient template parameter
    \n-
    62 // for HierarchicVectorWrapper if the coefficient type should
    \n-
    63 // be deduced.
    \n-
    64 struct DeducedCoefficientTag {};
    \n-
    65
    \n-
    66} // namespace Imp
    \n-
    67
    \n+
    6#include <memory>
    \n+
    7
    \n+
    8
    \n+
    9namespace Dune {
    \n+
    10
    \n+
    11namespace Functions {
    \n+
    12
    \n+
    13
    \n+
    21template<class GV, int cd>
    \n+\n+
    23{
    \n+
    24public:
    \n+
    25
    \n+
    26 typedef GV GridView;
    \n+
    27 enum {
    \n+
    28 codim = cd
    \n+
    29 };
    \n+
    30
    \n+
    32 typedef typename GridView::template Codim<codim>::Entity Element;
    \n+
    33
    \n+
    35 typedef typename Element::Geometry::LocalCoordinate LocalCoordinate;
    \n+
    36 typedef typename Element::Geometry::GlobalCoordinate GlobalCoordinate;
    \n+
    37
    \n+\n+
    39
    \n+
    41 typedef typename GridView::template Codim<codim>::Iterator const_iterator;
    \n+
    42
    \n+\n+
    45
    \n+\n+
    48 gv_(gv)
    \n+
    49 {}
    \n+
    50
    \n+
    52 bool contains(const Element& e) const
    \n+
    53 {
    \n+
    54 return gv_.contains(e);
    \n+
    55 }
    \n+
    56
    \n+
    58 size_t size() const
    \n+
    59 {
    \n+
    60 return gv_.size(codim);
    \n+
    61 }
    \n+
    62
    \n+\n+
    65 {
    \n+
    66 return gv_.template begin<codim>();
    \n+
    67 }
    \n
    68
    \n-
    69
    \n-
    90template<class V, class CO=Imp::DeducedCoefficientTag>
    \n-\n-
    92{
    \n-
    93 template<class MultiIndex>
    \n-
    94 using Coefficient = typename std::conditional< std::is_same<Imp::DeducedCoefficientTag,CO>::value and HasStaticSize<MultiIndex>::value,
    \n-
    95 typename Imp::CoefficientType<V, MultiIndex>::type,
    \n-
    96 CO
    \n-
    97 >::type;
    \n-
    98
    \n-
    99
    \n-
    100 using size_type = std::size_t;
    \n-
    101
    \n-
    102 template<class C, class SizeProvider,
    \n-
    103 typename std::enable_if< not models<Concept::HasResize, C>(), int>::type = 0,
    \n-
    104 typename std::enable_if< not models<Concept::HasSizeMethod, C>(), int>::type = 0>
    \n-
    105 static void resizeHelper(C& c, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
    \n-
    106 {
    \n-
    107 auto size = sizeProvider.size(prefix);
    \n-
    108 if (size != 0)
    \n-
    109 DUNE_THROW(RangeError, "Can't resize scalar vector entry v[" << prefix << "] to size(" << prefix << ")=" << size);
    \n-
    110 }
    \n-
    111
    \n-
    112 struct StaticResizeHelper
    \n-
    113 {
    \n-
    114 template<class I, class C, class SizeProvider>
    \n-
    115 static void apply(I&& i, C& c, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
    \n-
    116 {
    \n-
    117 prefix.back() = i;
    \n-
    118 resizeHelper(c[i], sizeProvider, prefix);
    \n-
    119 }
    \n-
    120 };
    \n-
    121
    \n-
    122 template<class C, class SizeProvider,
    \n-
    123 typename std::enable_if< not models<Concept::HasResize, C>(), int>::type = 0,
    \n-
    124 typename std::enable_if< models<Concept::HasSizeMethod, C>(), int>::type = 0>
    \n-
    125 static void resizeHelper(C& c, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
    \n-
    126 {
    \n-
    127 auto size = sizeProvider.size(prefix);
    \n-
    128 if (size == 0)
    \n-
    129 return;
    \n-
    130
    \n-
    131 if (c.size() != size)
    \n-
    132 DUNE_THROW(RangeError, "Can't resize statically sized vector entry v[" << prefix << "] of size " << c.size() << " to size(" << prefix << ")=" << size);
    \n-
    133
    \n-
    134 using namespace Dune::Hybrid;
    \n-
    135 prefix.push_back(0);
    \n-
    136 forEach(integralRange(Hybrid::size(c)), [&](auto&& i) {
    \n-
    137 StaticResizeHelper::apply(i, c, sizeProvider, prefix);
    \n-
    138 });
    \n-
    139 }
    \n-
    140
    \n-
    141 template<class C, class SizeProvider,
    \n-
    142 typename std::enable_if< models<Concept::HasResize, C>(), int>::type = 0>
    \n-
    143 static void resizeHelper(C& c, const SizeProvider& sizeProvider, typename SizeProvider::SizePrefix prefix)
    \n-
    144 {
    \n-
    145 auto size = sizeProvider.size(prefix);
    \n-
    146 if (size==0)
    \n-
    147 {
    \n-
    148 if (c.size()==0)
    \n-
    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.");
    \n-
    150 else
    \n-
    151 return;
    \n-
    152 }
    \n-
    153
    \n-
    154 c.resize(size);
    \n-
    155 prefix.push_back(0);
    \n-
    156 for(std::size_t i=0; i<size; ++i)
    \n-
    157 {
    \n-
    158 prefix.back() = i;
    \n-
    159 resizeHelper(c[i], sizeProvider, prefix);
    \n-
    160 }
    \n-
    161 }
    \n-
    162
    \n-
    163
    \n-
    164
    \n-
    165public:
    \n-
    166
    \n-
    167 using Vector = V;
    \n-
    168
    \n-
    169 template<class MultiIndex>
    \n-
    170 using Entry = Coefficient<MultiIndex>;
    \n-
    171
    \n-\n-
    173 vector_(&vector)
    \n-
    174 {}
    \n-
    175
    \n-
    176 template<class SizeProvider>
    \n-
    177 void resize(const SizeProvider& sizeProvider)
    \n-
    178 {
    \n-
    179 typename SizeProvider::SizePrefix prefix;
    \n-
    180 prefix.resize(0);
    \n-
    181 resizeHelper(*vector_, sizeProvider, prefix);
    \n-
    182 }
    \n-
    183
    \n-
    184 template<class MultiIndex>
    \n-
    185 const Entry<MultiIndex>& operator[](const MultiIndex& index) const
    \n-
    186 {
    \n-
    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!");
    \n-
    188 return hybridMultiIndexAccess<const Entry<MultiIndex>&>(*vector_, index);
    \n-
    189 }
    \n-
    190
    \n-
    191 template<class MultiIndex>
    \n-
    192 Entry<MultiIndex>& operator[](const MultiIndex& index)
    \n-
    193 {
    \n-
    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!");
    \n-
    195 return hybridMultiIndexAccess<Entry<MultiIndex>&>(*vector_, index);
    \n-
    196 }
    \n-
    197
    \n-
    198 template<class MultiIndex>
    \n-
    199 const Entry<MultiIndex>& operator()(const MultiIndex& index) const
    \n-
    200 {
    \n-
    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!");
    \n-
    202 return (*this)[index];
    \n-
    203 }
    \n-
    204
    \n-
    205 template<class MultiIndex>
    \n-
    206 Entry<MultiIndex>& operator()(const MultiIndex& index)
    \n-
    207 {
    \n-
    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!");
    \n-
    209 return (*this)[index];
    \n-
    210 }
    \n-
    211
    \n-
    212 const Vector& vector() const
    \n-
    213 {
    \n-
    214 return *vector_;
    \n-
    215 }
    \n-
    216
    \n-\n-
    218 {
    \n-
    219 return *vector_;
    \n-
    220 }
    \n-
    221
    \n-
    222private:
    \n-
    223
    \n-
    224 Vector* vector_;
    \n-
    225};
    \n-
    226
    \n-
    227
    \n-
    228
    \n-
    229
    \n-
    230template<class V>
    \n-\n-
    232{
    \n-\n-
    234}
    \n-
    235
    \n-
    236
    \n-
    237
    \n-
    238template<class MultiIndex, class V,
    \n-
    239 typename std::enable_if< models<Concept::HasIndexAccess, V, MultiIndex>(), int>::type = 0>
    \n-\n-
    241{
    \n-
    242 return v;
    \n-
    243}
    \n-
    244
    \n-
    245
    \n-
    246
    \n-
    247template<class MultiIndex, class V,
    \n-
    248 typename std::enable_if< not models<Concept::HasIndexAccess, V, MultiIndex>(), int>::type = 0>
    \n-\n-
    250{
    \n-\n-
    252}
    \n-
    253
    \n-
    254
    \n-
    255
    \n-
    256} // namespace Dune::Functions
    \n-
    257} // namespace Dune
    \n-
    258
    \n-
    259
    \n-
    260#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICVECTORWRAPPER_HH
    \n-\n-\n-\n+\n+
    71 {
    \n+
    72 return gv_.template end<codim>();
    \n+
    73 }
    \n+
    74
    \n+
    76 const GridView& gridView() const
    \n+
    77 {
    \n+
    78 return gv_;
    \n+
    79 }
    \n+
    80
    \n+
    81private:
    \n+
    82 GridView gv_;
    \n+
    83};
    \n+
    84
    \n+
    85
    \n+
    86} // end of namespace Dune::Functions
    \n+
    87} // end of namespace Dune
    \n+
    88
    \n+
    89#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH
    \n
    Definition: polynomial.hh:10
    \n-
    V & makeHierarchicVectorForMultiIndex(V &v)
    Definition: hierarchicvectorwrapper.hh:240
    \n-
    HierarchicVectorWrapper< V > hierarchicVector(V &v)
    Definition: hierarchicvectorwrapper.hh:231
    \n-
    Check if type is a statically sized container.
    Definition: type_traits.hh:83
    \n-
    A wrapper providing multiindex access to vector entries.
    Definition: hierarchicvectorwrapper.hh:92
    \n-
    Entry< MultiIndex > & operator()(const MultiIndex &index)
    Definition: hierarchicvectorwrapper.hh:206
    \n-
    Entry< MultiIndex > & operator[](const MultiIndex &index)
    Definition: hierarchicvectorwrapper.hh:192
    \n-
    const Entry< MultiIndex > & operator[](const MultiIndex &index) const
    Definition: hierarchicvectorwrapper.hh:185
    \n-
    Vector & vector()
    Definition: hierarchicvectorwrapper.hh:217
    \n-
    V Vector
    Definition: hierarchicvectorwrapper.hh:167
    \n-
    Coefficient< MultiIndex > Entry
    Definition: hierarchicvectorwrapper.hh:170
    \n-
    const Vector & vector() const
    Definition: hierarchicvectorwrapper.hh:212
    \n-
    HierarchicVectorWrapper(Vector &vector)
    Definition: hierarchicvectorwrapper.hh:172
    \n-
    const Entry< MultiIndex > & operator()(const MultiIndex &index) const
    Definition: hierarchicvectorwrapper.hh:199
    \n-
    void resize(const SizeProvider &sizeProvider)
    Definition: hierarchicvectorwrapper.hh:177
    \n-\n+
    An entity set for all entities of given codim in a grid view.
    Definition: gridviewentityset.hh:23
    \n+
    GridViewEntitySet(const GridView &gv)
    Construct GridViewEntitySet for a GridView.
    Definition: gridviewentityset.hh:47
    \n+
    GV GridView
    Definition: gridviewentityset.hh:26
    \n+
    GridView::template Codim< codim >::Entity Element
    Type of Elements contained in this EntitySet.
    Definition: gridviewentityset.hh:32
    \n+
    const_iterator end() const
    Create an end iterator.
    Definition: gridviewentityset.hh:70
    \n+
    const GridView & gridView() const
    Return the associated GridView.
    Definition: gridviewentityset.hh:76
    \n+
    Element value_type
    Definition: gridviewentityset.hh:38
    \n+
    const_iterator begin() const
    Create a begin iterator.
    Definition: gridviewentityset.hh:64
    \n+
    GridView::template Codim< codim >::Iterator const_iterator
    A forward iterator.
    Definition: gridviewentityset.hh:41
    \n+
    Element::Geometry::LocalCoordinate LocalCoordinate
    Type of local coordinates with respect to the Element.
    Definition: gridviewentityset.hh:35
    \n+
    size_t size() const
    Return number of Elements visited by an iterator.
    Definition: gridviewentityset.hh:58
    \n+
    Element::Geometry::GlobalCoordinate GlobalCoordinate
    Definition: gridviewentityset.hh:36
    \n+
    @ codim
    Definition: gridviewentityset.hh:28
    \n+
    bool contains(const Element &e) const
    Return true if e is contained in the EntitySet.
    Definition: gridviewentityset.hh:52
    \n+
    const_iterator iterator
    Same as const_iterator.
    Definition: gridviewentityset.hh:44
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,329 +4,142 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * functionspacebases\n-hierarchicvectorwrapper.hh\n+ * gridfunctions\n+gridviewentityset.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICVECTORWRAPPER_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICVECTORWRAPPER_HH\n+ 3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH\n+ 4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH\n 5\n- 6#include \n- 7#include \n- 8#include \n- 9\n- 10#include \n- 11#include \n- 12#include \n- 13#include \n- 14\n- 15\n- 16namespace Dune {\n- 17namespace Functions {\n- 18\n- 19\n- 20\n- 21namespace Imp {\n- 22\n- 23 // Construct default coefficient type from vector and multiindex type\n- 24 // This requires that MultiIndex has a static size. Otherwise the\n- 25 // vector type itself is returned.\n- 26 template\n- 27 struct CoefficientType\n- 28 {\n- 29 template\n- 30 struct DefaultCoefficientTypeHelper\n- 31 {\n- 32 using E0 = decltype(std::declval()[Dune::Indices::_0]);\n- 33 using type = typename DefaultCoefficientTypeHelper::type;\n- 34 };\n- 35\n- 36 template\n- 37 struct DefaultCoefficientTypeHelper\n- 38 {\n- 39 using type = E;\n- 40 };\n- 41\n- 42 template::value, int>::type = 0>\n- 44 static constexpr std::size_t getStaticSizeOrZero()\n- 45 {\n- 46 return StaticSize::value;\n- 47 }\n- 48\n- 49 template::value, int>::type = 0>\n- 51 static constexpr std::size_t getStaticSizeOrZero()\n- 52 {\n- 53 return 0;\n- 54 }\n- 55\n- 56 using type = typename DefaultCoefficientTypeHelper()>::type;\n- 57 };\n- 58\n- 59\n- 60\n- 61 // This tag class is used as Coefficient template parameter\n- 62 // for HierarchicVectorWrapper if the coefficient type should\n- 63 // be deduced.\n- 64 struct DeducedCoefficientTag {};\n- 65\n- 66} // namespace Imp\n- 67\n+ 6#include \n+ 7\n+ 8\n+ 9namespace Dune {\n+ 10\n+ 11namespace Functions {\n+ 12\n+ 13\n+ 21template\n+22class GridViewEntitySet\n+ 23{\n+ 24public:\n+ 25\n+26 typedef GV GridView;\n+ 27 enum {\n+ 28 codim = cd\n+29 };\n+ 30\n+32 typedef typename GridView::template Codim::Entity Element;\n+ 33\n+35 typedef typename Element::Geometry::LocalCoordinate LocalCoordinate;\n+36 typedef typename Element::Geometry::GlobalCoordinate GlobalCoordinate;\n+ 37\n+38 typedef Element value_type;\n+ 39\n+41 typedef typename GridView::template Codim::Iterator const_iterator;\n+ 42\n+44 typedef const_iterator iterator;\n+ 45\n+47 GridViewEntitySet(const GridView& gv) :\n+ 48 gv_(gv)\n+ 49 {}\n+ 50\n+52 bool contains(const Element& e) const\n+ 53 {\n+ 54 return gv_.contains(e);\n+ 55 }\n+ 56\n+58 size_t size() const\n+ 59 {\n+ 60 return gv_.size(codim);\n+ 61 }\n+ 62\n+64 const_iterator begin() const\n+ 65 {\n+ 66 return gv_.template begin();\n+ 67 }\n 68\n- 69\n- 90template\n-91class HierarchicVectorWrapper\n- 92{\n- 93 template\n- 94 using Coefficient = typename std::conditional< std::is_same::value and HasStaticSize::value,\n- 95 typename Imp::CoefficientType::type,\n- 96 CO\n- 97 >::type;\n- 98\n- 99\n- 100 using size_type = std::size_t;\n- 101\n- 102 template(), int>::type =\n-0,\n- 104 typename std::enable_if< not models(), int>::\n-type = 0>\n- 105 static void resizeHelper(C& c, const SizeProvider& sizeProvider, typename\n-SizeProvider::SizePrefix prefix)\n- 106 {\n- 107 auto size = sizeProvider.size(prefix);\n- 108 if (size != 0)\n- 109 DUNE_THROW(RangeError, \"Can't resize scalar vector entry v[\" << prefix <<\n-\"] to size(\" << prefix << \")=\" << size);\n- 110 }\n- 111\n- 112 struct StaticResizeHelper\n- 113 {\n- 114 template\n- 115 static void apply(I&& i, C& c, const SizeProvider& sizeProvider, typename\n-SizeProvider::SizePrefix prefix)\n- 116 {\n- 117 prefix.back() = i;\n- 118 resizeHelper(c[i], sizeProvider, prefix);\n- 119 }\n- 120 };\n- 121\n- 122 template(), int>::type =\n-0,\n- 124 typename std::enable_if< models(), int>::type =\n-0>\n- 125 static void resizeHelper(C& c, const SizeProvider& sizeProvider, typename\n-SizeProvider::SizePrefix prefix)\n- 126 {\n- 127 auto size = sizeProvider.size(prefix);\n- 128 if (size == 0)\n- 129 return;\n- 130\n- 131 if (c.size() != size)\n- 132 DUNE_THROW(RangeError, \"Can't resize statically sized vector entry v[\" <<\n-prefix << \"] of size \" << c.size() << \" to size(\" << prefix << \")=\" << size);\n- 133\n- 134 using namespace Dune::Hybrid;\n- 135 prefix.push_back(0);\n- 136 forEach(integralRange(Hybrid::size(c)), [&](auto&& i) {\n- 137 StaticResizeHelper::apply(i, c, sizeProvider, prefix);\n- 138 });\n- 139 }\n- 140\n- 141 template(), int>::type = 0>\n- 143 static void resizeHelper(C& c, const SizeProvider& sizeProvider, typename\n-SizeProvider::SizePrefix prefix)\n- 144 {\n- 145 auto size = sizeProvider.size(prefix);\n- 146 if (size==0)\n- 147 {\n- 148 if (c.size()==0)\n- 149 DUNE_THROW(RangeError, \"Can't resize dynamically sized vector entry v[\" <<\n-prefix << \"]. Its size is 0 but the target size is unknown due to size(\" <<\n-prefix << \")=0.\");\n- 150 else\n- 151 return;\n- 152 }\n- 153\n- 154 c.resize(size);\n- 155 prefix.push_back(0);\n- 156 for(std::size_t i=0; i\n-170 using Entry = Coefficient;\n- 171\n-172 HierarchicVectorWrapper(Vector& vector) :\n- 173 vector_(&vector)\n- 174 {}\n- 175\n- 176 template\n-177 void resize(const SizeProvider& sizeProvider)\n- 178 {\n- 179 typename SizeProvider::SizePrefix prefix;\n- 180 prefix.resize(0);\n- 181 resizeHelper(*vector_, sizeProvider, prefix);\n- 182 }\n- 183\n- 184 template\n-185 const Entry& operator[](const MultiIndex& index) const\n- 186 {\n- 187 static_assert(not std::is_same>::value, \"Coefficient type for\n-HierarchicVectorWrapper and given multi-index type cannot be determined\n-automatically!\");\n- 188 return hybridMultiIndexAccess&>(*vector_, index);\n- 189 }\n- 190\n- 191 template\n-192 Entry& operator[](const MultiIndex& index)\n- 193 {\n- 194 static_assert(not std::is_same>::value, \"Coefficient type for\n-HierarchicVectorWrapper and given multi-index type cannot be determined\n-automatically!\");\n- 195 return hybridMultiIndexAccess&>(*vector_, index);\n- 196 }\n- 197\n- 198 template\n-199 const Entry& operator()(const MultiIndex& index) const\n- 200 {\n- 201 static_assert(not std::is_same>::value, \"Coefficient type for\n-HierarchicVectorWrapper and given multi-index type cannot be determined\n-automatically!\");\n- 202 return (*this)[index];\n- 203 }\n- 204\n- 205 template\n-206 Entry& operator()(const MultiIndex& index)\n- 207 {\n- 208 static_assert(not std::is_same>::value, \"Coefficient type for\n-HierarchicVectorWrapper and given multi-index type cannot be determined\n-automatically!\");\n- 209 return (*this)[index];\n- 210 }\n- 211\n-212 const Vector& vector() const\n- 213 {\n- 214 return *vector_;\n- 215 }\n- 216\n-217 Vector& vector()\n- 218 {\n- 219 return *vector_;\n- 220 }\n- 221\n- 222private:\n- 223\n- 224 Vector* vector_;\n- 225};\n- 226\n- 227\n- 228\n- 229\n- 230template\n-231HierarchicVectorWrapper<_V_> hierarchicVector(V& v)\n- 232{\n- 233 return HierarchicVectorWrapper(v);\n- 234}\n- 235\n- 236\n- 237\n- 238template(),\n-int>::type = 0>\n-240V& makeHierarchicVectorForMultiIndex(V& v)\n- 241{\n- 242 return v;\n- 243}\n- 244\n- 245\n- 246\n- 247template(), int>::type = 0>\n-249HierarchicVectorWrapper<_V_> makeHierarchicVectorForMultiIndex(V& v)\n- 250{\n- 251 return HierarchicVectorWrapper(v);\n- 252}\n- 253\n- 254\n- 255\n- 256} // namespace Dune::Functions\n- 257} // namespace Dune\n- 258\n- 259\n- 260#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICVECTORWRAPPER_HH\n-type_traits.hh\n-indexaccess.hh\n-utility.hh\n+70 const_iterator end() const\n+ 71 {\n+ 72 return gv_.template end();\n+ 73 }\n+ 74\n+76 const GridView& gridView() const\n+ 77 {\n+ 78 return gv_;\n+ 79 }\n+ 80\n+ 81private:\n+ 82 GridView gv_;\n+ 83};\n+ 84\n+ 85\n+ 86} // end of namespace Dune::Functions\n+ 87} // end of namespace Dune\n+ 88\n+ 89#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWENTITYSET_HH\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::makeHierarchicVectorForMultiIndex\n-V & makeHierarchicVectorForMultiIndex(V &v)\n-Definition: hierarchicvectorwrapper.hh:240\n-Dune::Functions::hierarchicVector\n-HierarchicVectorWrapper< V > hierarchicVector(V &v)\n-Definition: hierarchicvectorwrapper.hh:231\n-Dune::Functions::HasStaticSize\n-Check if type is a statically sized container.\n-Definition: type_traits.hh:83\n-Dune::Functions::HierarchicVectorWrapper\n-A wrapper providing multiindex access to vector entries.\n-Definition: hierarchicvectorwrapper.hh:92\n-Dune::Functions::HierarchicVectorWrapper::operator()\n-Entry< MultiIndex > & operator()(const MultiIndex &index)\n-Definition: hierarchicvectorwrapper.hh:206\n-Dune::Functions::HierarchicVectorWrapper::operator[]\n-Entry< MultiIndex > & operator[](const MultiIndex &index)\n-Definition: hierarchicvectorwrapper.hh:192\n-Dune::Functions::HierarchicVectorWrapper::operator[]\n-const Entry< MultiIndex > & operator[](const MultiIndex &index) const\n-Definition: hierarchicvectorwrapper.hh:185\n-Dune::Functions::HierarchicVectorWrapper::vector\n-Vector & vector()\n-Definition: hierarchicvectorwrapper.hh:217\n-Dune::Functions::HierarchicVectorWrapper::Vector\n-V Vector\n-Definition: hierarchicvectorwrapper.hh:167\n-Dune::Functions::HierarchicVectorWrapper::Entry\n-Coefficient< MultiIndex > Entry\n-Definition: hierarchicvectorwrapper.hh:170\n-Dune::Functions::HierarchicVectorWrapper::vector\n-const Vector & vector() const\n-Definition: hierarchicvectorwrapper.hh:212\n-Dune::Functions::HierarchicVectorWrapper::HierarchicVectorWrapper\n-HierarchicVectorWrapper(Vector &vector)\n-Definition: hierarchicvectorwrapper.hh:172\n-Dune::Functions::HierarchicVectorWrapper::operator()\n-const Entry< MultiIndex > & operator()(const MultiIndex &index) const\n-Definition: hierarchicvectorwrapper.hh:199\n-Dune::Functions::HierarchicVectorWrapper::resize\n-void resize(const SizeProvider &sizeProvider)\n-Definition: hierarchicvectorwrapper.hh:177\n-concepts.hh\n+Dune::Functions::GridViewEntitySet\n+An entity set for all entities of given codim in a grid view.\n+Definition: gridviewentityset.hh:23\n+Dune::Functions::GridViewEntitySet::GridViewEntitySet\n+GridViewEntitySet(const GridView &gv)\n+Construct GridViewEntitySet for a GridView.\n+Definition: gridviewentityset.hh:47\n+Dune::Functions::GridViewEntitySet::GridView\n+GV GridView\n+Definition: gridviewentityset.hh:26\n+Dune::Functions::GridViewEntitySet::Element\n+GridView::template Codim< codim >::Entity Element\n+Type of Elements contained in this EntitySet.\n+Definition: gridviewentityset.hh:32\n+Dune::Functions::GridViewEntitySet::end\n+const_iterator end() const\n+Create an end iterator.\n+Definition: gridviewentityset.hh:70\n+Dune::Functions::GridViewEntitySet::gridView\n+const GridView & gridView() const\n+Return the associated GridView.\n+Definition: gridviewentityset.hh:76\n+Dune::Functions::GridViewEntitySet::value_type\n+Element value_type\n+Definition: gridviewentityset.hh:38\n+Dune::Functions::GridViewEntitySet::begin\n+const_iterator begin() const\n+Create a begin iterator.\n+Definition: gridviewentityset.hh:64\n+Dune::Functions::GridViewEntitySet::const_iterator\n+GridView::template Codim< codim >::Iterator const_iterator\n+A forward iterator.\n+Definition: gridviewentityset.hh:41\n+Dune::Functions::GridViewEntitySet::LocalCoordinate\n+Element::Geometry::LocalCoordinate LocalCoordinate\n+Type of local coordinates with respect to the Element.\n+Definition: gridviewentityset.hh:35\n+Dune::Functions::GridViewEntitySet::size\n+size_t size() const\n+Return number of Elements visited by an iterator.\n+Definition: gridviewentityset.hh:58\n+Dune::Functions::GridViewEntitySet::GlobalCoordinate\n+Element::Geometry::GlobalCoordinate GlobalCoordinate\n+Definition: gridviewentityset.hh:36\n+Dune::Functions::GridViewEntitySet::codim\n+@ codim\n+Definition: gridviewentityset.hh:28\n+Dune::Functions::GridViewEntitySet::contains\n+bool contains(const Element &e) const\n+Return true if e is contained in the EntitySet.\n+Definition: gridviewentityset.hh:52\n+Dune::Functions::GridViewEntitySet::iterator\n+const_iterator iterator\n+Same as const_iterator.\n+Definition: gridviewentityset.hh:44\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00179.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00179.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: transformedindexbasis.hh File Reference\n+dune-functions: localderivativetraits.hh File Reference\n \n \n \n \n \n \n \n@@ -58,78 +58,44 @@\n \n \n \n \n \n
    \n \n-
    transformedindexbasis.hh File Reference
    \n+Namespaces
    \n+
    localderivativetraits.hh File Reference
    \n \n
    \n-
    #include <tuple>
    \n-#include <utility>
    \n-#include <dune/common/std/apply.hh>
    \n-#include <dune/common/hybridutilities.hh>
    \n-#include <dune/common/reservedvector.hh>
    \n-#include <dune/common/typeutilities.hh>
    \n-#include <dune/typetree/compositenode.hh>
    \n-#include <dune/typetree/utility.hh>
    \n-#include <dune/functions/common/staticforloop.hh>
    \n-#include <dune/functions/common/type_traits.hh>
    \n-#include <dune/functions/common/utility.hh>
    \n-#include <dune/functions/functionspacebases/basistags.hh>
    \n-#include <dune/functions/functionspacebases/nodes.hh>
    \n-#include <dune/functions/functionspacebases/concepts.hh>
    \n-#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
    \n+\n

    Go to the source code of this file.

    \n \n \n-\n-\n+\n+\n \n-\n-\n+\n+\n+\n \n

    \n Classes

    class  Dune::Functions::Experimental::TransformedIndexPreBasis< RPB, T >
     A pre-basis transforming multi-indices. More...
    struct  Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits >
     Derivative traits for local functions. More...
     
    class  Dune::Functions::BasisFactory::Experimental::GenericIndexingTransformation< IndexTransformation, SizeImplementation, minIS, maxIS >
     A generic implementation of a transformation. More...
    struct  Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits >::Traits< Signature >
     
    struct  Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits >::Traits< R(LocalDomain)>
     
    \n \n \n \n \n \n-\n-\n-\n-\n-\n-\n-

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    namespace  Dune::Functions::Experimental
     
    namespace  Dune::Functions::BasisFactory
     
    namespace  Dune::Functions::BasisFactory::Experimental
     
    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n

    \n-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. More...
     
    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. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,67 +4,30 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * functionspacebases\n-Classes | Namespaces | Functions\n-transformedindexbasis.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+ * gridfunctions\n+Classes | Namespaces\n+localderivativetraits.hh File Reference\n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::Experimental::TransformedIndexPreBasis<_RPB,_T_>\n-\u00a0 A pre-basis transforming multi-indices. More...\n+struct \u00a0Dune::Functions::LocalDerivativeTraits<_EntitySet,_DerivativeTraits_>\n+\u00a0 Derivative traits for local functions. More...\n \u00a0\n-class \u00a0Dune::Functions::BasisFactory::Experimental::\n- GenericIndexingTransformation<_IndexTransformation,_SizeImplementation,\n- minIS,_maxIS_>\n-\u00a0 A generic implementation of a transformation. More...\n+struct \u00a0Dune::Functions::LocalDerivativeTraits<_EntitySet,_DerivativeTraits\n+ >::Traits<_Signature_>\n+\u00a0\n+struct \u00a0Dune::Functions::LocalDerivativeTraits<_EntitySet,_DerivativeTraits\n+ >::Traits<_R(LocalDomain)>\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n-namespace \u00a0Dune::Functions::Experimental\n-\u00a0\n-namespace \u00a0Dune::Functions::BasisFactory\n-\u00a0\n-namespace \u00a0Dune::Functions::BasisFactory::Experimental\n-\u00a0\n- Functions\n-template\n- \u00a0Dune::Functions::Experimental::TransformedIndexPreBasis (RPB &&, T &&) -\n- > TransformedIndexPreBasis< std::decay_t< RPB >, std::decay_t< T > >\n-\u00a0\n-template\n-auto\u00a0Dune::Functions::BasisFactory::Experimental::transformIndices\n- (RawPreBasisFactory &&preBasisFactory, Transformation &&transformation)\n-\u00a0 Create a TransformedIndexPreBasisFactory. More...\n-\u00a0\n-template\n-auto\u00a0Dune::Functions::BasisFactory::Experimental::indexTransformation\n- (IndexTransformation &&indexTransformation, SizeImplementation\n- &&sizeImplementation, Dune::index_constant< minIndexSize >, Dune::\n- index_constant< maxIndexSize >)\n-\u00a0 A generic implementation of a transformation. More...\n-\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00179_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00179_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: transformedindexbasis.hh Source File\n+dune-functions: localderivativetraits.hh Source File\n \n \n \n \n \n \n \n@@ -58,279 +58,66 @@\n \n
    \n \n \n \n
    \n-
    transformedindexbasis.hh
    \n+
    localderivativetraits.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH
    \n+
    4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH
    \n
    5
    \n-
    6#include <tuple>
    \n-
    7#include <utility>
    \n+
    6
    \n+\n
    8
    \n-
    9#include <dune/common/std/apply.hh>
    \n-
    10#include <dune/common/hybridutilities.hh>
    \n-
    11#include <dune/common/reservedvector.hh>
    \n-
    12#include <dune/common/typeutilities.hh>
    \n-
    13#include <dune/common/hybridutilities.hh>
    \n-
    14
    \n-
    15#include <dune/typetree/compositenode.hh>
    \n-
    16#include <dune/typetree/utility.hh>
    \n-
    17
    \n-\n-\n-\n-\n-\n-\n-\n-
    25
    \n-
    26
    \n-
    27namespace Dune {
    \n-
    28namespace Functions {
    \n-
    29namespace Experimental {
    \n-
    30
    \n-
    31// *****************************************************************************
    \n-
    32// *****************************************************************************
    \n-
    33
    \n-
    50template<class RPB, class T>
    \n-\n-
    52{
    \n-
    53 using Transformation = T;
    \n-
    54
    \n-\n-
    56
    \n-
    57public:
    \n-
    58
    \n-
    59 using RawPreBasis = RPB;
    \n-
    60
    \n-
    62 using GridView = typename RawPreBasis::GridView;
    \n-
    63
    \n-
    65 using size_type = std::size_t;
    \n-
    66
    \n-
    68 using Node = typename RawPreBasis::Node;
    \n-
    69
    \n-
    70 static constexpr size_type maxMultiIndexSize = Transformation::maxIndexSize;
    \n-
    71 static constexpr size_type minMultiIndexSize = Transformation::minIndexSize;
    \n-
    72 static constexpr size_type multiIndexBufferSize = std::max(RawPreBasis::multiIndexBufferSize, maxMultiIndexSize);
    \n-
    73
    \n-
    79 template<class RPB_R, class T_R>
    \n-
    80 TransformedIndexPreBasis(RPB_R&& rawPreBasis, T_R&& transformation) :
    \n-
    81 rawPreBasis_(std::forward<RPB_R>(rawPreBasis)),
    \n-
    82 transformation_(std::forward<T_R>(transformation))
    \n-
    83 {}
    \n-
    84
    \n-\n-
    87 {
    \n-
    88 rawPreBasis_.initializeIndices();
    \n-
    89 }
    \n-
    90
    \n-
    92 const GridView& gridView() const
    \n-
    93 {
    \n-
    94 return rawPreBasis_.gridView();
    \n-
    95 }
    \n-
    96
    \n-
    98 void update(const GridView& gv)
    \n-
    99 {
    \n-
    100 rawPreBasis_.update(gv);
    \n-
    101 }
    \n-
    102
    \n-\n-
    114 {
    \n-
    115 return rawPreBasis_.makeNode();
    \n-
    116 }
    \n-
    117
    \n-\n-
    120 {
    \n-
    121 return size(Dune::ReservedVector<size_type, multiIndexBufferSize>{});
    \n-
    122 }
    \n-
    123
    \n-
    125 template<class SizePrefix>
    \n-
    126 size_type size(const SizePrefix& prefix) const
    \n-
    127 {
    \n-
    128 return transformation_.size(prefix, rawPreBasis_);
    \n-
    129 }
    \n-
    130
    \n-\n-
    133 {
    \n-
    134 return transformation_.dimension(rawPreBasis_);
    \n-
    135 }
    \n-
    136
    \n-\n-
    139 {
    \n-
    140 return rawPreBasis_.maxNodeSize();
    \n-
    141 }
    \n-
    142
    \n-\n-
    144 {
    \n-
    145 return rawPreBasis_;
    \n-
    146 }
    \n-
    147
    \n-\n-
    149 {
    \n-
    150 return rawPreBasis_;
    \n-
    151 }
    \n-
    152
    \n-
    153 template<class MultiIndex>
    \n-
    154 void transformIndex(MultiIndex& multiIndex) const
    \n-
    155 {
    \n-
    156 transformation_.transformIndex(multiIndex, rawPreBasis_);
    \n-
    157 }
    \n-
    158
    \n-
    159 template<typename It>
    \n-
    160 It indices(const Node& node, It it) const
    \n-
    161 {
    \n-
    162 rawPreBasis().indices(node, it);
    \n-
    163 for(std::size_t i=0; i<node.size(); ++i)
    \n-
    164 {
    \n-
    165 transformIndex(*it);
    \n-
    166 ++it;
    \n-
    167 }
    \n-
    168 return it;
    \n-
    169 }
    \n-
    170
    \n-
    171protected:
    \n-\n-
    173 Transformation transformation_;
    \n-
    174};
    \n-
    175
    \n-
    176template<class RPB, class T>
    \n-\n-
    178
    \n-
    179
    \n-
    180} // end namespace Experimental
    \n-
    181
    \n-
    182
    \n-
    183namespace BasisFactory {
    \n-
    184namespace Experimental {
    \n-
    185
    \n-
    197template<class RawPreBasisFactory, class Transformation>
    \n-\n-
    199 RawPreBasisFactory&& preBasisFactory,
    \n-
    200 Transformation&& transformation)
    \n-
    201{
    \n-
    202 return [
    \n-
    203 preBasisFactory=std::forward<RawPreBasisFactory>(preBasisFactory),
    \n-
    204 transformation =std::forward<Transformation>(transformation)
    \n-
    205 ](const auto& gridView) {
    \n-
    206 return Dune::Functions::Experimental::TransformedIndexPreBasis(preBasisFactory(gridView), std::move(transformation));
    \n-
    207 };
    \n-
    208}
    \n-
    209
    \n-
    210
    \n-
    211
    \n-
    230template<class IndexTransformation, class SizeImplementation, std::size_t minIS, std::size_t maxIS>
    \n-\n-
    232{
    \n-
    233public:
    \n-
    234
    \n-
    235 static constexpr std::size_t minIndexSize = minIS;
    \n-
    236 static constexpr std::size_t maxIndexSize = maxIS;
    \n-
    237
    \n-
    238 template<class IT_R, class SI_R>
    \n-
    239 GenericIndexingTransformation(IT_R&& indexTransformation, SI_R&& sizeImplementation) :
    \n-
    240 indexTransformation_(std::forward<IT_R>(indexTransformation)),
    \n-
    241 sizeImplementation_(std::forward<SI_R>(sizeImplementation))
    \n-
    242 {}
    \n-
    243
    \n-
    244 template<class MultiIndex, class PreBasis>
    \n-
    245 void transformIndex(MultiIndex& multiIndex, const PreBasis& preBasis) const
    \n-
    246 {
    \n-
    247 indexTransformation_(multiIndex, preBasis);
    \n-
    248 }
    \n-
    249
    \n-
    250 template<class Prefix, class PreBasis>
    \n-
    251 auto size(const Prefix& prefix, const PreBasis& preBasis) const
    \n-
    252 {
    \n-
    253 return sizeImplementation_(prefix, preBasis);
    \n-
    254 }
    \n-
    255
    \n-
    256 template<class PreBasis>
    \n-
    257 auto dimension(const PreBasis& preBasis) const
    \n-
    258 {
    \n-
    259 return preBasis.dimension();
    \n-
    260 }
    \n-
    261
    \n-
    262private:
    \n-
    263 IndexTransformation indexTransformation_;
    \n-
    264 SizeImplementation sizeImplementation_;
    \n-
    265};
    \n-
    266
    \n-
    267
    \n-
    268
    \n-
    287template<class IndexTransformation, class SizeImplementation, std::size_t minIndexSize, std::size_t maxIndexSize>
    \n-
    288auto indexTransformation(IndexTransformation&& indexTransformation, SizeImplementation&& sizeImplementation, Dune::index_constant<minIndexSize>, Dune::index_constant<maxIndexSize>)
    \n-
    289{
    \n-\n-
    291 std::decay_t<IndexTransformation>,
    \n-
    292 std::decay_t<SizeImplementation>,
    \n-
    293 minIndexSize, maxIndexSize>(
    \n-
    294 std::forward<IndexTransformation>(indexTransformation),
    \n-
    295 std::forward<SizeImplementation>(sizeImplementation));
    \n-
    296}
    \n-
    297
    \n-
    298
    \n-
    299} // end namespace Experimental
    \n-
    300} // end namespace BasisFactory
    \n-
    301} // end namespace Functions
    \n-
    302} // end namespace Dune
    \n-
    303
    \n-
    304
    \n-
    305#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH
    \n-\n-\n-\n-\n-\n-\n+
    9
    \n+
    10namespace Dune {
    \n+
    11namespace Functions {
    \n+
    12
    \n+
    13
    \n+
    26template<class EntitySet, template<class> class DerivativeTraits=DefaultDerivativeTraits>
    \n+\n+
    28{
    \n+
    29 using LocalDomain = typename EntitySet::LocalCoordinate;
    \n+
    30 using Domain = typename EntitySet::GlobalCoordinate;
    \n+
    31
    \n+
    32 template<class Signature>
    \n+
    33 struct Traits
    \n+
    34 {
    \n+\n+
    36 };
    \n+
    37
    \n+
    38 template<class R>
    \n+\n+
    40 {
    \n+
    41 using Range = typename DerivativeTraits<R(Domain)>::Range;
    \n+
    42 };
    \n+
    43};
    \n+
    44
    \n+
    45
    \n+
    46}} // namespace Dune::Functions
    \n+
    47
    \n+
    48#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH
    \n+\n
    Definition: polynomial.hh:10
    \n-
    auto transformIndices(RawPreBasisFactory &&preBasisFactory, Transformation &&transformation)
    Create a TransformedIndexPreBasisFactory.
    Definition: transformedindexbasis.hh:198
    \n-
    auto indexTransformation(IndexTransformation &&indexTransformation, SizeImplementation &&sizeImplementation, Dune::index_constant< minIndexSize >, Dune::index_constant< maxIndexSize >)
    A generic implementation of a transformation.
    Definition: transformedindexbasis.hh:288
    \n-
    TransformedIndexPreBasis(RPB &&, T &&) -> TransformedIndexPreBasis< std::decay_t< RPB >, std::decay_t< T > >
    \n-
    A pre-basis transforming multi-indices.
    Definition: transformedindexbasis.hh:52
    \n-
    It indices(const Node &node, It it) const
    Definition: transformedindexbasis.hh:160
    \n-
    Transformation transformation_
    Definition: transformedindexbasis.hh:173
    \n-
    void initializeIndices()
    Initialize the global indices.
    Definition: transformedindexbasis.hh:86
    \n-
    typename RawPreBasis::GridView GridView
    The grid view that the FE basis is defined on.
    Definition: transformedindexbasis.hh:62
    \n-
    void transformIndex(MultiIndex &multiIndex) const
    Definition: transformedindexbasis.hh:154
    \n-
    RawPreBasis rawPreBasis_
    Definition: transformedindexbasis.hh:172
    \n-
    typename RawPreBasis::Node Node
    Template mapping root tree path to type of created tree node.
    Definition: transformedindexbasis.hh:68
    \n-
    TransformedIndexPreBasis(RPB_R &&rawPreBasis, T_R &&transformation)
    Constructor for given child pre-basis objects.
    Definition: transformedindexbasis.hh:80
    \n-
    RawPreBasis & rawPreBasis()
    Definition: transformedindexbasis.hh:148
    \n-
    static constexpr size_type maxMultiIndexSize
    Definition: transformedindexbasis.hh:70
    \n-
    void update(const GridView &gv)
    Update the stored grid view, to be called if the grid has changed.
    Definition: transformedindexbasis.hh:98
    \n-
    Node makeNode() const
    Create tree node with given root tree path.
    Definition: transformedindexbasis.hh:113
    \n-
    const GridView & gridView() const
    Obtain the grid view that the basis is defined on.
    Definition: transformedindexbasis.hh:92
    \n-
    size_type size(const SizePrefix &prefix) const
    Return number of possible values for next position in multi index.
    Definition: transformedindexbasis.hh:126
    \n-
    RPB RawPreBasis
    Definition: transformedindexbasis.hh:59
    \n-
    size_type size() const
    Same as size(prefix) with empty prefix.
    Definition: transformedindexbasis.hh:119
    \n-
    size_type maxNodeSize() const
    Get the maximal number of DOFs associated to node for any element.
    Definition: transformedindexbasis.hh:138
    \n-
    std::size_t size_type
    Type used for indices and size information.
    Definition: transformedindexbasis.hh:65
    \n-
    static constexpr size_type multiIndexBufferSize
    Definition: transformedindexbasis.hh:72
    \n-
    size_type dimension() const
    Get the total dimension of the space spanned by this basis.
    Definition: transformedindexbasis.hh:132
    \n-
    const RawPreBasis & rawPreBasis() const
    Definition: transformedindexbasis.hh:143
    \n-
    static constexpr size_type minMultiIndexSize
    Definition: transformedindexbasis.hh:71
    \n-
    A generic implementation of a transformation.
    Definition: transformedindexbasis.hh:232
    \n-
    auto dimension(const PreBasis &preBasis) const
    Definition: transformedindexbasis.hh:257
    \n-
    GenericIndexingTransformation(IT_R &&indexTransformation, SI_R &&sizeImplementation)
    Definition: transformedindexbasis.hh:239
    \n-
    void transformIndex(MultiIndex &multiIndex, const PreBasis &preBasis) const
    Definition: transformedindexbasis.hh:245
    \n-
    static constexpr std::size_t maxIndexSize
    Definition: transformedindexbasis.hh:236
    \n-
    static constexpr std::size_t minIndexSize
    Definition: transformedindexbasis.hh:235
    \n-
    auto size(const Prefix &prefix, const PreBasis &preBasis) const
    Definition: transformedindexbasis.hh:251
    \n-\n+
    Dummy range class to be used if no proper type is available.
    Definition: defaultderivativetraits.hh:23
    \n+
    Derivative traits for local functions.
    Definition: localderivativetraits.hh:28
    \n+
    typename EntitySet::GlobalCoordinate Domain
    Definition: localderivativetraits.hh:30
    \n+
    typename EntitySet::LocalCoordinate LocalDomain
    Definition: localderivativetraits.hh:29
    \n+
    Definition: localderivativetraits.hh:34
    \n+
    InvalidRange Range
    Definition: localderivativetraits.hh:35
    \n+
    typename DerivativeTraits< R(Domain)>::Range Range
    Definition: localderivativetraits.hh:41
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,373 +4,73 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * functionspacebases\n-transformedindexbasis.hh\n+ * gridfunctions\n+localderivativetraits.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH\n+ 3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH\n+ 4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH\n 5\n- 6#include \n- 7#include \n+ 6\n+ 7#include \n 8\n- 9#include \n- 10#include \n- 11#include \n- 12#include \n- 13#include \n- 14\n- 15#include \n- 16#include \n- 17\n- 18#include \n- 19#include \n- 20#include \n- 21#include \n- 22#include \n- 23#include \n- 24#include \n- 25\n- 26\n- 27namespace Dune {\n- 28namespace Functions {\n-29namespace Experimental {\n- 30\n- 31/\n-/ *****************************************************************************\n- 32/\n-/ *****************************************************************************\n- 33\n- 50template\n-51class TransformedIndexPreBasis\n- 52{\n- 53 using Transformation = T;\n- 54\n- 55 using This = TransformedIndexPreBasis;\n- 56\n- 57public:\n- 58\n-59 using RawPreBasis = RPB;\n- 60\n-62 using GridView = typename RawPreBasis::GridView;\n- 63\n-65 using size_type = std::size_t;\n- 66\n-68 using Node = typename RawPreBasis::Node;\n- 69\n-70 static constexpr size_type maxMultiIndexSize = Transformation::maxIndexSize;\n-71 static constexpr size_type minMultiIndexSize = Transformation::minIndexSize;\n-72 static constexpr size_type multiIndexBufferSize = std::max(RawPreBasis::\n-multiIndexBufferSize, maxMultiIndexSize);\n- 73\n- 79 template\n-80 TransformedIndexPreBasis(RPB_R&& rawPreBasis, T_R&& transformation) :\n- 81 rawPreBasis_(std::forward(rawPreBasis)),\n- 82 transformation_(std::forward(transformation))\n- 83 {}\n- 84\n-86 void initializeIndices()\n- 87 {\n- 88 rawPreBasis_.initializeIndices();\n- 89 }\n- 90\n-92 const GridView& gridView() const\n- 93 {\n- 94 return rawPreBasis_.gridView();\n- 95 }\n- 96\n-98 void update(const GridView& gv)\n- 99 {\n- 100 rawPreBasis_.update(gv);\n- 101 }\n- 102\n-113 Node makeNode() const\n- 114 {\n- 115 return rawPreBasis_.makeNode();\n- 116 }\n- 117\n-119 size_type size() const\n- 120 {\n- 121 return size(Dune::ReservedVector{});\n- 122 }\n- 123\n- 125 template\n-126 size_type size(const SizePrefix& prefix) const\n- 127 {\n- 128 return transformation_.size(prefix, rawPreBasis_);\n- 129 }\n- 130\n-132 size_type dimension() const\n- 133 {\n- 134 return transformation_.dimension(rawPreBasis_);\n- 135 }\n- 136\n-138 size_type maxNodeSize() const\n- 139 {\n- 140 return rawPreBasis_.maxNodeSize();\n- 141 }\n- 142\n-143 const RawPreBasis& rawPreBasis() const\n- 144 {\n- 145 return rawPreBasis_;\n- 146 }\n- 147\n-148 RawPreBasis& rawPreBasis()\n- 149 {\n- 150 return rawPreBasis_;\n- 151 }\n- 152\n- 153 template\n-154 void transformIndex(MultiIndex& multiIndex) const\n- 155 {\n- 156 transformation_.transformIndex(multiIndex, rawPreBasis_);\n- 157 }\n- 158\n- 159 template\n-160 It indices(const Node& node, It it) const\n- 161 {\n- 162 rawPreBasis().indices(node, it);\n- 163 for(std::size_t i=0; i\n-177TransformedIndexPreBasis(RPB&&, T&&) -> TransformedIndexPreBasis, std::decay_t>;\n- 178\n- 179\n- 180} // end namespace Experimental\n- 181\n- 182\n- 183namespace BasisFactory {\n- 184namespace Experimental {\n- 185\n- 197template\n-198auto transformIndices(\n- 199 RawPreBasisFactory&& preBasisFactory,\n- 200 Transformation&& transformation)\n- 201{\n- 202 return [\n- 203 preBasisFactory=std::forward(preBasisFactory),\n- 204 transformation =std::forward(transformation)\n- 205 ](const auto& gridView) {\n- 206 return Dune::Functions::Experimental::TransformedIndexPreBasis\n-(preBasisFactory(gridView), std::move(transformation));\n- 207 };\n- 208}\n- 209\n- 210\n- 211\n- 230template\n-231class GenericIndexingTransformation\n- 232{\n- 233public:\n- 234\n-235 static constexpr std::size_t minIndexSize = minIS;\n-236 static constexpr std::size_t maxIndexSize = maxIS;\n- 237\n- 238 template\n-239 GenericIndexingTransformation(IT_R&& indexTransformation, SI_R&&\n-sizeImplementation) :\n- 240 indexTransformation_(std::forward(indexTransformation)),\n- 241 sizeImplementation_(std::forward(sizeImplementation))\n- 242 {}\n- 243\n- 244 template\n-245 void transformIndex(MultiIndex& multiIndex, const PreBasis& preBasis) const\n- 246 {\n- 247 indexTransformation_(multiIndex, preBasis);\n- 248 }\n- 249\n- 250 template\n-251 auto size(const Prefix& prefix, const PreBasis& preBasis) const\n- 252 {\n- 253 return sizeImplementation_(prefix, preBasis);\n- 254 }\n- 255\n- 256 template\n-257 auto dimension(const PreBasis& preBasis) const\n- 258 {\n- 259 return preBasis.dimension();\n- 260 }\n- 261\n- 262private:\n- 263 IndexTransformation indexTransformation_;\n- 264 SizeImplementation sizeImplementation_;\n- 265};\n- 266\n- 267\n- 268\n- 287template\n-288auto indexTransformation(IndexTransformation&& indexTransformation,\n-SizeImplementation&& sizeImplementation, Dune::index_constant,\n-Dune::index_constant)\n- 289{\n- 290 return GenericIndexingTransformation<\n- 291 std::decay_t,\n- 292 std::decay_t,\n- 293 minIndexSize, maxIndexSize>(\n- 294 std::forward(indexTransformation),\n- 295 std::forward(sizeImplementation));\n- 296}\n- 297\n- 298\n- 299} // end namespace Experimental\n- 300} // end namespace BasisFactory\n- 301} // end namespace Functions\n- 302} // end namespace Dune\n- 303\n- 304\n- 305#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_TRANSFORMEDINDEXBASIS_HH\n-type_traits.hh\n-staticforloop.hh\n-utility.hh\n-nodes.hh\n-defaultglobalbasis.hh\n-basistags.hh\n+ 9\n+ 10namespace Dune {\n+ 11namespace Functions {\n+ 12\n+ 13\n+ 26template class\n+DerivativeTraits=DefaultDerivativeTraits>\n+27struct LocalDerivativeTraits\n+ 28{\n+29 using LocalDomain = typename EntitySet::LocalCoordinate;\n+30 using Domain = typename EntitySet::GlobalCoordinate;\n+ 31\n+ 32 template\n+33 struct Traits\n+ 34 {\n+35 typedef InvalidRange Range;\n+ 36 };\n+ 37\n+ 38 template\n+39 struct Traits\n+ 40 {\n+41 using Range = typename DerivativeTraits::Range;\n+ 42 };\n+ 43};\n+ 44\n+ 45\n+ 46}} // namespace Dune::Functions\n+ 47\n+ 48#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_LOCALDERIVATIVE_TRAITS_HH\n+defaultderivativetraits.hh\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::BasisFactory::Experimental::transformIndices\n-auto transformIndices(RawPreBasisFactory &&preBasisFactory, Transformation\n-&&transformation)\n-Create a TransformedIndexPreBasisFactory.\n-Definition: transformedindexbasis.hh:198\n-Dune::Functions::BasisFactory::Experimental::indexTransformation\n-auto indexTransformation(IndexTransformation &&indexTransformation,\n-SizeImplementation &&sizeImplementation, Dune::index_constant< minIndexSize >,\n-Dune::index_constant< maxIndexSize >)\n-A generic implementation of a transformation.\n-Definition: transformedindexbasis.hh:288\n-Dune::Functions::Experimental::TransformedIndexPreBasis\n-TransformedIndexPreBasis(RPB &&, T &&) -> TransformedIndexPreBasis< std::\n-decay_t< RPB >, std::decay_t< T > >\n-Dune::Functions::Experimental::TransformedIndexPreBasis\n-A pre-basis transforming multi-indices.\n-Definition: transformedindexbasis.hh:52\n-Dune::Functions::Experimental::TransformedIndexPreBasis::indices\n-It indices(const Node &node, It it) const\n-Definition: transformedindexbasis.hh:160\n-Dune::Functions::Experimental::TransformedIndexPreBasis::transformation_\n-Transformation transformation_\n-Definition: transformedindexbasis.hh:173\n-Dune::Functions::Experimental::TransformedIndexPreBasis::initializeIndices\n-void initializeIndices()\n-Initialize the global indices.\n-Definition: transformedindexbasis.hh:86\n-Dune::Functions::Experimental::TransformedIndexPreBasis::GridView\n-typename RawPreBasis::GridView GridView\n-The grid view that the FE basis is defined on.\n-Definition: transformedindexbasis.hh:62\n-Dune::Functions::Experimental::TransformedIndexPreBasis::transformIndex\n-void transformIndex(MultiIndex &multiIndex) const\n-Definition: transformedindexbasis.hh:154\n-Dune::Functions::Experimental::TransformedIndexPreBasis::rawPreBasis_\n-RawPreBasis rawPreBasis_\n-Definition: transformedindexbasis.hh:172\n-Dune::Functions::Experimental::TransformedIndexPreBasis::Node\n-typename RawPreBasis::Node Node\n-Template mapping root tree path to type of created tree node.\n-Definition: transformedindexbasis.hh:68\n-Dune::Functions::Experimental::TransformedIndexPreBasis::\n-TransformedIndexPreBasis\n-TransformedIndexPreBasis(RPB_R &&rawPreBasis, T_R &&transformation)\n-Constructor for given child pre-basis objects.\n-Definition: transformedindexbasis.hh:80\n-Dune::Functions::Experimental::TransformedIndexPreBasis::rawPreBasis\n-RawPreBasis & rawPreBasis()\n-Definition: transformedindexbasis.hh:148\n-Dune::Functions::Experimental::TransformedIndexPreBasis::maxMultiIndexSize\n-static constexpr size_type maxMultiIndexSize\n-Definition: transformedindexbasis.hh:70\n-Dune::Functions::Experimental::TransformedIndexPreBasis::update\n-void update(const GridView &gv)\n-Update the stored grid view, to be called if the grid has changed.\n-Definition: transformedindexbasis.hh:98\n-Dune::Functions::Experimental::TransformedIndexPreBasis::makeNode\n-Node makeNode() const\n-Create tree node with given root tree path.\n-Definition: transformedindexbasis.hh:113\n-Dune::Functions::Experimental::TransformedIndexPreBasis::gridView\n-const GridView & gridView() const\n-Obtain the grid view that the basis is defined on.\n-Definition: transformedindexbasis.hh:92\n-Dune::Functions::Experimental::TransformedIndexPreBasis::size\n-size_type size(const SizePrefix &prefix) const\n-Return number of possible values for next position in multi index.\n-Definition: transformedindexbasis.hh:126\n-Dune::Functions::Experimental::TransformedIndexPreBasis::RawPreBasis\n-RPB RawPreBasis\n-Definition: transformedindexbasis.hh:59\n-Dune::Functions::Experimental::TransformedIndexPreBasis::size\n-size_type size() const\n-Same as size(prefix) with empty prefix.\n-Definition: transformedindexbasis.hh:119\n-Dune::Functions::Experimental::TransformedIndexPreBasis::maxNodeSize\n-size_type maxNodeSize() const\n-Get the maximal number of DOFs associated to node for any element.\n-Definition: transformedindexbasis.hh:138\n-Dune::Functions::Experimental::TransformedIndexPreBasis::size_type\n-std::size_t size_type\n-Type used for indices and size information.\n-Definition: transformedindexbasis.hh:65\n-Dune::Functions::Experimental::TransformedIndexPreBasis::multiIndexBufferSize\n-static constexpr size_type multiIndexBufferSize\n-Definition: transformedindexbasis.hh:72\n-Dune::Functions::Experimental::TransformedIndexPreBasis::dimension\n-size_type dimension() const\n-Get the total dimension of the space spanned by this basis.\n-Definition: transformedindexbasis.hh:132\n-Dune::Functions::Experimental::TransformedIndexPreBasis::rawPreBasis\n-const RawPreBasis & rawPreBasis() const\n-Definition: transformedindexbasis.hh:143\n-Dune::Functions::Experimental::TransformedIndexPreBasis::minMultiIndexSize\n-static constexpr size_type minMultiIndexSize\n-Definition: transformedindexbasis.hh:71\n-Dune::Functions::BasisFactory::Experimental::GenericIndexingTransformation\n-A generic implementation of a transformation.\n-Definition: transformedindexbasis.hh:232\n-Dune::Functions::BasisFactory::Experimental::GenericIndexingTransformation::\n-dimension\n-auto dimension(const PreBasis &preBasis) const\n-Definition: transformedindexbasis.hh:257\n-Dune::Functions::BasisFactory::Experimental::GenericIndexingTransformation::\n-GenericIndexingTransformation\n-GenericIndexingTransformation(IT_R &&indexTransformation, SI_R\n-&&sizeImplementation)\n-Definition: transformedindexbasis.hh:239\n-Dune::Functions::BasisFactory::Experimental::GenericIndexingTransformation::\n-transformIndex\n-void transformIndex(MultiIndex &multiIndex, const PreBasis &preBasis) const\n-Definition: transformedindexbasis.hh:245\n-Dune::Functions::BasisFactory::Experimental::GenericIndexingTransformation::\n-maxIndexSize\n-static constexpr std::size_t maxIndexSize\n-Definition: transformedindexbasis.hh:236\n-Dune::Functions::BasisFactory::Experimental::GenericIndexingTransformation::\n-minIndexSize\n-static constexpr std::size_t minIndexSize\n-Definition: transformedindexbasis.hh:235\n-Dune::Functions::BasisFactory::Experimental::GenericIndexingTransformation::\n-size\n-auto size(const Prefix &prefix, const PreBasis &preBasis) const\n-Definition: transformedindexbasis.hh:251\n-concepts.hh\n+Dune::Functions::InvalidRange\n+Dummy range class to be used if no proper type is available.\n+Definition: defaultderivativetraits.hh:23\n+Dune::Functions::LocalDerivativeTraits\n+Derivative traits for local functions.\n+Definition: localderivativetraits.hh:28\n+Dune::Functions::LocalDerivativeTraits::Domain\n+typename EntitySet::GlobalCoordinate Domain\n+Definition: localderivativetraits.hh:30\n+Dune::Functions::LocalDerivativeTraits::LocalDomain\n+typename EntitySet::LocalCoordinate LocalDomain\n+Definition: localderivativetraits.hh:29\n+Dune::Functions::LocalDerivativeTraits::Traits\n+Definition: localderivativetraits.hh:34\n+Dune::Functions::LocalDerivativeTraits::Traits::Range\n+InvalidRange Range\n+Definition: localderivativetraits.hh:35\n+Dune::Functions::LocalDerivativeTraits::Traits<_R(LocalDomain)>::Range\n+typename DerivativeTraits< R(Domain)>::Range Range\n+Definition: localderivativetraits.hh:41\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00182.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00182.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: rannacherturekbasis.hh File Reference\n+dune-functions: gridviewfunction.hh File Reference\n \n \n \n \n \n \n \n@@ -58,66 +58,58 @@\n \n \n \n \n \n
    \n \n-
    rannacherturekbasis.hh File Reference
    \n+
    gridviewfunction.hh File Reference
    \n
    \n
    \n-
    #include <dune/common/exceptions.hh>
    \n-#include <dune/grid/common/capabilities.hh>
    \n-#include <dune/localfunctions/common/localfiniteelementvariant.hh>
    \n-#include <dune/localfunctions/rannacherturek.hh>
    \n-#include <dune/localfunctions/crouzeixraviart.hh>
    \n-#include <dune/functions/functionspacebases/nodes.hh>
    \n-#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
    \n+\n

    Go to the source code of this file.

    \n \n \n-\n-\n+\n \n-\n+\n+\n \n

    \n Classes

    class  Dune::Functions::RannacherTurekPreBasis< GV >
     Pre-basis for a Rannacher-Turek basis. More...
    class  Dune::Functions::GridViewFunction< Signature, GridView, DerivativeTraits, bufferSize >
     
    class  Dune::Functions::RannacherTurekNode< GV >
    class  Dune::Functions::GridViewFunction< Range(Domain), GV, DerivativeTraits, bufferSize >
     Wrapper class for functions defined on a GridView. More...
     
    \n \n \n \n \n \n-\n-\n-

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    namespace  Dune::Functions::BasisFactory
     
    \n-\n-\n-\n-\n-\n

    \n-Typedefs

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

    \n Functions

    template<class Dummy = void>
    auto Dune::Functions::BasisFactory::rannacherTurek ()
     Create a pre-basis factory that can create a Rannacher-Turek pre-basis. More...
     
    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. More...
     
    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. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,46 +4,49 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * functionspacebases\n-Classes | Namespaces | Typedefs | Functions\n-rannacherturekbasis.hh File Reference\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+ * gridfunctions\n+Classes | Namespaces | Functions\n+gridviewfunction.hh File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::Functions::RannacherTurekPreBasis<_GV_>\n-\u00a0 Pre-basis for a Rannacher-Turek basis. More...\n+class \u00a0Dune::Functions::GridViewFunction<_Signature,_GridView,\n+ DerivativeTraits,_bufferSize_>\n \u00a0\n-class \u00a0Dune::Functions::RannacherTurekNode<_GV_>\n+class \u00a0Dune::Functions::GridViewFunction<_Range(Domain),_GV,_DerivativeTraits,\n+ bufferSize_>\n+\u00a0 Wrapper class for functions defined on a GridView. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n-namespace \u00a0Dune::Functions::BasisFactory\n-\u00a0\n- Typedefs\n-template\n-using\u00a0Dune::Functions::RannacherTurekBasis = DefaultGlobalBasis<\n- RannacherTurekPreBasis< GV > >\n-\u00a0 Rannacher-Turek basis. More...\n-\u00a0\n Functions\n-template\n-auto\u00a0Dune::Functions::BasisFactory::rannacherTurek ()\n-\u00a0 Create a pre-basis factory that can create a Rannacher-Turek pre-basis.\n- More...\n+template(), int >::type = 0>\n+std::decay< F >::type\u00a0Dune::Functions::makeGridViewFunction (F &&f, const\n+ GridView &gridView)\n+\u00a0 Construct a function modeling GridViewFunction from\n+ function and grid view. More...\n+\u00a0\n+template()), int >::type = 0>\n+ auto\u00a0Dune::Functions::makeGridViewFunction (F &&f, const\n+ GridView &gridView) -> decltype\n+ (makeAnalyticGridViewFunction(std::forward< F >(f),\n+ gridView))\n+\u00a0 Construct a function modeling GridViewFunction from\n+ function and grid view. More...\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00182_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00182_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: rannacherturekbasis.hh Source File\n+dune-functions: gridviewfunction.hh Source File\n \n \n \n \n \n \n \n@@ -58,255 +58,95 @@\n \n
    \n \n \n \n
    \n-
    rannacherturekbasis.hh
    \n+
    gridviewfunction.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
    \n+
    4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
    \n
    5
    \n-
    6#include <dune/common/exceptions.hh>
    \n+
    6#include <memory>
    \n
    7
    \n-
    8#include <dune/grid/common/capabilities.hh>
    \n+
    8#include <dune/common/concept.hh>
    \n
    9
    \n-
    10#include <dune/localfunctions/common/localfiniteelementvariant.hh>
    \n-
    11#include <dune/localfunctions/rannacherturek.hh>
    \n-
    12#include <dune/localfunctions/crouzeixraviart.hh>
    \n+\n+\n+\n
    13
    \n-\n-\n-
    16
    \n+
    14
    \n+
    15namespace Dune {
    \n+
    16namespace Functions {
    \n
    17
    \n-
    18namespace Dune {
    \n-
    19namespace Functions {
    \n-
    20
    \n-
    21// *****************************************************************************
    \n-
    22// This is the reusable part of the basis. It contains
    \n-
    23//
    \n-
    24// RannacherTurekPreBasis
    \n-
    25// RannacherTurekNode
    \n-
    26//
    \n-
    27// The pre-basis allows to create the others and is the owner of possible shared
    \n-
    28// state. These components do _not_ depend on the global basis and local view
    \n-
    29// and can be used without a global basis.
    \n-
    30// *****************************************************************************
    \n-
    31
    \n-
    32template<typename GV>
    \n-
    33class RannacherTurekNode;
    \n-
    34
    \n-
    35template<typename GV>
    \n-
    36class RannacherTurekPreBasis;
    \n-
    37
    \n-
    50template<typename GV>
    \n-\n-
    52{
    \n-
    53 static const int dim = GV::dimension;
    \n-
    54
    \n-
    55public:
    \n-
    56
    \n-
    58 using GridView = GV;
    \n-
    59
    \n-
    61 using size_type = std::size_t;
    \n-
    62
    \n-\n-
    65
    \n-
    66 static constexpr size_type maxMultiIndexSize = 1;
    \n-
    67 static constexpr size_type minMultiIndexSize = 1;
    \n-
    68 static constexpr size_type multiIndexBufferSize = 1;
    \n-
    69
    \n-\n-
    72 gridView_(gv)
    \n-
    73 {
    \n-
    74 for(auto type : gv.indexSet().types(0))
    \n-
    75 if (!type.isSimplex() && !type.isCube())
    \n-
    76 DUNE_THROW(Dune::NotImplemented, "Rannacher-Turek or Crouzeix-Raviart elements are only implemented for grids with simplex or cube elements.");
    \n-
    77 }
    \n-
    78
    \n-\n-
    81 {}
    \n-
    82
    \n-
    84 const GridView& gridView() const
    \n-
    85 {
    \n-
    86 return gridView_;
    \n-
    87 }
    \n-
    88
    \n-
    90 void update (const GridView& gv)
    \n-
    91 {
    \n-
    92 gridView_ = gv;
    \n-
    93 }
    \n-
    94
    \n-
    98 Node makeNode() const
    \n-
    99 {
    \n-
    100 return Node{};
    \n-
    101 }
    \n-
    102
    \n-\n-
    105 {
    \n-
    106 return (size_type)(gridView_.size(1));
    \n-
    107 }
    \n-
    108
    \n-
    110 template<class SizePrefix>
    \n-
    111 size_type size(const SizePrefix prefix) const
    \n-
    112 {
    \n-
    113 assert(prefix.size() == 0 || prefix.size() == 1);
    \n-
    114 return (prefix.size() == 0) ? size() : 0;
    \n-
    115 }
    \n-
    116
    \n-\n-
    119 {
    \n-
    120 return size();
    \n-
    121 }
    \n-
    122
    \n-\n-
    125 {
    \n-
    126 return 2*GV::dimension;
    \n-
    127 }
    \n-
    128
    \n-
    129 template<typename It>
    \n-
    130 It indices(const Node& node, It it) const
    \n-
    131 {
    \n-
    132 for (size_type i = 0, end = node.size() ; i < end ; ++i, ++it)
    \n-
    133 {
    \n-
    134 Dune::LocalKey localKey = node.finiteElement().localCoefficients().localKey(i);
    \n-
    135 const auto& gridIndexSet = gridView().indexSet();
    \n-
    136 const auto& element = node.element();
    \n-
    137
    \n-
    138 *it = {{ (size_type)(gridIndexSet.subIndex(element,localKey.subEntity(),1)) }};
    \n-
    139 }
    \n-
    140 return it;
    \n-
    141 }
    \n-
    142
    \n-
    143protected:
    \n-\n-
    145};
    \n-
    146
    \n-
    147
    \n-
    148
    \n-
    149template<typename GV>
    \n-\n-
    151 public LeafBasisNode
    \n-
    152{
    \n-
    153 static const int dim = GV::dimension;
    \n-
    154 static const int maxSize = 2*dim;
    \n-
    155
    \n-
    156 constexpr static bool hasFixedElementType = Capabilities::hasSingleGeometryType<typename GV::Grid>::v;
    \n-
    157
    \n-
    158 using CubeFiniteElement = RannacherTurekLocalFiniteElement<typename GV::ctype,double,dim>;
    \n-
    159 using SimplexFiniteElement = CrouzeixRaviartLocalFiniteElement<typename GV::ctype,double,dim>;
    \n-
    160
    \n-
    161 constexpr static unsigned int topologyId = Capabilities::hasSingleGeometryType<typename GV::Grid>::topologyId; // meaningless if hasFixedElementType is false
    \n-
    162 constexpr static GeometryType type = GeometryType(topologyId, GV::dimension);
    \n-
    163
    \n-
    164public:
    \n-
    165
    \n-
    166 using size_type = std::size_t;
    \n-
    167 using Element = typename GV::template Codim<0>::Entity;
    \n-
    168 using FiniteElement = std::conditional_t<hasFixedElementType,
    \n-
    169 std::conditional_t<type.isCube(),CubeFiniteElement,SimplexFiniteElement>,
    \n-
    170 LocalFiniteElementVariant<CubeFiniteElement, SimplexFiniteElement> >;
    \n-
    171
    \n-\n-\n-
    174 element_(nullptr)
    \n-
    175 {}
    \n-
    176
    \n-
    178 const Element& element() const
    \n-
    179 {
    \n-
    180 return *element_;
    \n-
    181 }
    \n-
    182
    \n-\n-
    188 {
    \n-
    189 return finiteElement_;
    \n-
    190 }
    \n-
    191
    \n-
    193 void bind(const Element& e)
    \n-
    194 {
    \n-
    195 element_ = &e;
    \n-
    196 if constexpr (!hasFixedElementType)
    \n-
    197 finiteElement_ = e.type().isCube() ? static_cast<FiniteElement>(CubeFiniteElement())
    \n-
    198 : static_cast<FiniteElement>(SimplexFiniteElement()) ;
    \n-
    199 this->setSize(finiteElement_.size());
    \n-
    200 }
    \n-
    201
    \n-
    202protected:
    \n-
    203
    \n-\n-\n-
    206};
    \n-
    207
    \n-
    208
    \n-
    209
    \n-
    210namespace BasisFactory {
    \n-
    211
    \n-
    217template<class Dummy=void>
    \n-\n-
    219{
    \n-
    220 return [](const auto& gridView) {
    \n-
    221 return RannacherTurekPreBasis<std::decay_t<decltype(gridView)>>(gridView);
    \n-
    222 };
    \n-
    223}
    \n-
    224
    \n-
    225} // end namespace BasisFactory
    \n-
    226
    \n-
    227
    \n-
    228
    \n-
    229
    \n-
    241template<typename GV>
    \n-\n-
    243
    \n-
    244} // end namespace Functions
    \n-
    245} // end namespace Dune
    \n-
    246
    \n-
    247#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH
    \n-\n-\n-
    auto rannacherTurek()
    Create a pre-basis factory that can create a Rannacher-Turek pre-basis.
    Definition: rannacherturekbasis.hh:218
    \n+
    18
    \n+
    19
    \n+
    20template<class Signature, class GridView, template<class> class DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>
    \n+\n+
    22{};
    \n+
    23
    \n+
    24
    \n+
    25
    \n+
    40template<class Range, class Domain, class GV, template<class> class DerivativeTraits, size_t bufferSize>
    \n+
    41class GridViewFunction<Range(Domain), GV, DerivativeTraits, bufferSize> :
    \n+
    42 public GridFunction<Range(Domain), GridViewEntitySet<GV, 0>, DerivativeTraits, bufferSize>
    \n+
    43{
    \n+
    44 using Base = GridFunction<Range(Domain), GridViewEntitySet<GV, 0>, DerivativeTraits, bufferSize>;
    \n+
    45public:
    \n+
    46 using GridView = GV;
    \n+
    47
    \n+
    48 using Base::Base;
    \n+
    49};
    \n+
    50
    \n+
    51
    \n+
    52
    \n+
    64template<class F, class GridView,
    \n+
    65 typename std::enable_if<
    \n+
    66 models< Imp::HasFreeLocalFunction, F>() , int>::type = 0>
    \n+
    67typename std::decay<F>::type
    \n+
    68 makeGridViewFunction(F&& f, const GridView& gridView)
    \n+
    69{
    \n+
    70 return std::forward<F>(f);
    \n+
    71}
    \n+
    72
    \n+
    73
    \n+
    74
    \n+
    90template<class F, class GridView,
    \n+
    91 typename std::enable_if<
    \n+
    92 not(models< Imp::HasFreeLocalFunction, F>()) , int>::type = 0>
    \n+
    93auto makeGridViewFunction(F&& f, const GridView& gridView)
    \n+
    94 -> decltype(makeAnalyticGridViewFunction(std::forward<F>(f), gridView))
    \n+
    95{
    \n+
    96 return makeAnalyticGridViewFunction(std::forward<F>(f), gridView);
    \n+
    97}
    \n+
    98
    \n+
    99
    \n+
    100
    \n+
    101} // end of namespace Dune::Functions
    \n+
    102} // end of namespace Dune
    \n+
    103
    \n+
    104#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH
    \n+\n+\n+\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.
    Definition: analyticgridviewfunction.hh:230
    \n
    Definition: polynomial.hh:10
    \n-
    Global basis for given pre-basis.
    Definition: defaultglobalbasis.hh:46
    \n-
    size_type size() const
    Definition: nodes.hh:142
    \n-
    std::size_t size_type
    Definition: nodes.hh:128
    \n-
    void setSize(const size_type size)
    Definition: nodes.hh:164
    \n-
    Definition: nodes.hh:186
    \n-
    Definition: rannacherturekbasis.hh:152
    \n-
    std::conditional_t< hasFixedElementType, std::conditional_t< type.isCube(), CubeFiniteElement, SimplexFiniteElement >, LocalFiniteElementVariant< CubeFiniteElement, SimplexFiniteElement > > FiniteElement
    Definition: rannacherturekbasis.hh:170
    \n-
    void bind(const Element &e)
    Bind to element.
    Definition: rannacherturekbasis.hh:193
    \n-
    FiniteElement finiteElement_
    Definition: rannacherturekbasis.hh:204
    \n-
    typename GV::template Codim< 0 >::Entity Element
    Definition: rannacherturekbasis.hh:167
    \n-
    RannacherTurekNode()
    Definition: rannacherturekbasis.hh:172
    \n-
    const Element * element_
    Definition: rannacherturekbasis.hh:205
    \n-
    const FiniteElement & finiteElement() const
    Return the LocalFiniteElement for the element we are bound to.
    Definition: rannacherturekbasis.hh:187
    \n-
    const Element & element() const
    Return current element, throw if unbound.
    Definition: rannacherturekbasis.hh:178
    \n-
    Pre-basis for a Rannacher-Turek basis.
    Definition: rannacherturekbasis.hh:52
    \n-
    static constexpr size_type multiIndexBufferSize
    Definition: rannacherturekbasis.hh:68
    \n-
    void initializeIndices()
    Initialize the global indices.
    Definition: rannacherturekbasis.hh:80
    \n-
    static constexpr size_type maxMultiIndexSize
    Definition: rannacherturekbasis.hh:66
    \n-
    static constexpr size_type minMultiIndexSize
    Definition: rannacherturekbasis.hh:67
    \n-
    size_type size(const SizePrefix prefix) const
    Return number of possible values for next position in multi index.
    Definition: rannacherturekbasis.hh:111
    \n-
    std::size_t size_type
    Type used for indices and size information.
    Definition: rannacherturekbasis.hh:61
    \n-
    Node makeNode() const
    Create tree node.
    Definition: rannacherturekbasis.hh:98
    \n-
    void update(const GridView &gv)
    Update the stored grid view, to be called if the grid has changed.
    Definition: rannacherturekbasis.hh:90
    \n-
    It indices(const Node &node, It it) const
    Definition: rannacherturekbasis.hh:130
    \n-
    GV GridView
    The grid view that the FE basis is defined on.
    Definition: rannacherturekbasis.hh:58
    \n-
    size_type dimension() const
    Get the total dimension of the space spanned by this basis.
    Definition: rannacherturekbasis.hh:118
    \n-
    RannacherTurekPreBasis(const GridView &gv)
    Constructor for a given grid view object.
    Definition: rannacherturekbasis.hh:71
    \n-
    size_type size() const
    Same as size(prefix) with empty prefix.
    Definition: rannacherturekbasis.hh:104
    \n-
    const GridView & gridView() const
    Obtain the grid view that the basis is defined on.
    Definition: rannacherturekbasis.hh:84
    \n-
    size_type maxNodeSize() const
    Get the maximal number of DOFs associated to node for any element.
    Definition: rannacherturekbasis.hh:124
    \n-
    GridView gridView_
    Definition: rannacherturekbasis.hh:144
    \n+
    std::decay< F >::type makeGridViewFunction(F &&f, const GridView &gridView)
    Construct a function modeling GridViewFunction from function and grid view.
    Definition: gridviewfunction.hh:68
    \n+
    Definition: gridfunction.hh:32
    \n+
    An entity set for all entities of given codim in a grid view.
    Definition: gridviewentityset.hh:23
    \n+
    Definition: gridviewfunction.hh:22
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,341 +4,109 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * functionspacebases\n-rannacherturekbasis.hh\n+ * gridfunctions\n+gridviewfunction.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH\n+ 3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH\n+ 4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH\n 5\n- 6#include \n+ 6#include \n 7\n- 8#include \n+ 8#include \n 9\n- 10#include \n- 11#include \n- 12#include \n+ 10#include \n+ 11#include \n+ 12#include \n 13\n- 14#include \n- 15#include \n- 16\n+ 14\n+ 15namespace Dune {\n+ 16namespace Functions {\n 17\n- 18namespace Dune {\n- 19namespace Functions {\n- 20\n- 21/\n-/ *****************************************************************************\n- 22// This is the reusable part of the basis. It contains\n- 23//\n- 24// RannacherTurekPreBasis\n- 25// RannacherTurekNode\n- 26//\n- 27// The pre-basis allows to create the others and is the owner of possible\n-shared\n- 28// state. These components do _not_ depend on the global basis and local\n-view\n- 29// and can be used without a global basis.\n- 30/\n-/ *****************************************************************************\n- 31\n- 32template\n- 33class RannacherTurekNode;\n- 34\n- 35template\n- 36class RannacherTurekPreBasis;\n- 37\n- 50template\n-51class RannacherTurekPreBasis\n- 52{\n- 53 static const int dim = GV::dimension;\n- 54\n- 55public:\n- 56\n-58 using GridView = GV;\n- 59\n-61 using size_type = std::size_t;\n- 62\n-64 using Node = RannacherTurekNode;\n- 65\n-66 static constexpr size_type maxMultiIndexSize = 1;\n-67 static constexpr size_type minMultiIndexSize = 1;\n-68 static constexpr size_type multiIndexBufferSize = 1;\n- 69\n-71 RannacherTurekPreBasis(const GridView& gv) :\n- 72 gridView_(gv)\n- 73 {\n- 74 for(auto type : gv.indexSet().types(0))\n- 75 if (!type.isSimplex() && !type.isCube())\n- 76 DUNE_THROW(Dune::NotImplemented, \"Rannacher-Turek or Crouzeix-Raviart\n-elements are only implemented for grids with simplex or cube elements.\");\n- 77 }\n- 78\n-80 void initializeIndices()\n- 81 {}\n- 82\n-84 const GridView& gridView() const\n- 85 {\n- 86 return gridView_;\n- 87 }\n- 88\n-90 void update (const GridView& gv)\n- 91 {\n- 92 gridView_ = gv;\n- 93 }\n- 94\n-98 Node makeNode() const\n- 99 {\n- 100 return Node{};\n- 101 }\n- 102\n-104 size_type size() const\n- 105 {\n- 106 return (size_type)(gridView_.size(1));\n- 107 }\n- 108\n- 110 template\n-111 size_type size(const SizePrefix prefix) const\n- 112 {\n- 113 assert(prefix.size() == 0 || prefix.size() == 1);\n- 114 return (prefix.size() == 0) ? size() : 0;\n- 115 }\n- 116\n-118 size_type dimension() const\n- 119 {\n- 120 return size();\n- 121 }\n- 122\n-124 size_type maxNodeSize() const\n- 125 {\n- 126 return 2*GV::dimension;\n- 127 }\n- 128\n- 129 template\n-130 It indices(const Node& node, It it) const\n- 131 {\n- 132 for (size_type i = 0, end = node.size() ; i < end ; ++i, ++it)\n- 133 {\n- 134 Dune::LocalKey localKey = node.finiteElement().localCoefficients\n-().localKey(i);\n- 135 const auto& gridIndexSet = gridView().indexSet();\n- 136 const auto& element = node.element();\n- 137\n- 138 *it = {{ (size_type)(gridIndexSet.subIndex(element,localKey.subEntity\n-(),1)) }};\n- 139 }\n- 140 return it;\n- 141 }\n- 142\n- 143protected:\n-144 GridView gridView_;\n- 145};\n- 146\n- 147\n- 148\n- 149template\n-150class RannacherTurekNode :\n- 151 public LeafBasisNode\n- 152{\n- 153 static const int dim = GV::dimension;\n- 154 static const int maxSize = 2*dim;\n- 155\n- 156 constexpr static bool hasFixedElementType = Capabilities::\n-hasSingleGeometryType::v;\n- 157\n- 158 using CubeFiniteElement = RannacherTurekLocalFiniteElement;\n- 159 using SimplexFiniteElement = CrouzeixRaviartLocalFiniteElement;\n- 160\n- 161 constexpr static unsigned int topologyId = Capabilities::\n-hasSingleGeometryType::topologyId; // meaningless if\n-hasFixedElementType is false\n- 162 constexpr static GeometryType type = GeometryType(topologyId, GV::\n-dimension);\n- 163\n- 164public:\n- 165\n-166 using size_type = std::size_t;\n-167 using Element = typename GV::template Codim<0>::Entity;\n-168 using FiniteElement = std::conditional_t,\n- 170 LocalFiniteElementVariant >;\n- 171\n-172 RannacherTurekNode() :\n- 173 finiteElement_(),\n- 174 element_(nullptr)\n- 175 {}\n- 176\n-178 const Element& element() const\n- 179 {\n- 180 return *element_;\n- 181 }\n- 182\n-187 const FiniteElement& finiteElement() const\n- 188 {\n- 189 return finiteElement_;\n- 190 }\n- 191\n-193 void bind(const Element& e)\n- 194 {\n- 195 element_ = &e;\n- 196 if constexpr (!hasFixedElementType)\n- 197 finiteElement_ = e.type().isCube() ? static_cast\n-(CubeFiniteElement())\n- 198 : static_cast(SimplexFiniteElement()) ;\n- 199 this->setSize(finiteElement_.size());\n- 200 }\n- 201\n- 202protected:\n- 203\n-204 FiniteElement finiteElement_;\n-205 const Element* element_;\n- 206};\n- 207\n- 208\n- 209\n- 210namespace BasisFactory {\n- 211\n- 217template\n-218auto rannacherTurek()\n- 219{\n- 220 return [](const auto& gridView) {\n- 221 return RannacherTurekPreBasis>(gridView);\n- 222 };\n- 223}\n- 224\n- 225} // end namespace BasisFactory\n- 226\n- 227\n- 228\n- 229\n- 241template\n-242using RannacherTurekBasis = DefaultGlobalBasis >;\n- 243\n- 244} // end namespace Functions\n- 245} // end namespace Dune\n- 246\n- 247#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_RANNACHERTUREKBASIS_HH\n-nodes.hh\n-defaultglobalbasis.hh\n-Dune::Functions::BasisFactory::rannacherTurek\n-auto rannacherTurek()\n-Create a pre-basis factory that can create a Rannacher-Turek pre-basis.\n-Definition: rannacherturekbasis.hh:218\n+ 18\n+ 19\n+ 20template class\n+DerivativeTraits=DefaultDerivativeTraits, size_t bufferSize=56>\n+21class GridViewFunction\n+ 22{};\n+ 23\n+ 24\n+ 25\n+ 40template class\n+DerivativeTraits, size_t bufferSize>\n+41class GridViewFunction :\n+ 42 public GridFunction,\n+DerivativeTraits, bufferSize>\n+ 43{\n+ 44 using Base = GridFunction,\n+DerivativeTraits, bufferSize>;\n+ 45public:\n+46 using GridView = GV;\n+ 47\n+ 48 using Base::Base;\n+ 49};\n+ 50\n+ 51\n+ 52\n+ 64template() , int>::type = 0>\n+ 67typename std::decay::type\n+68 makeGridViewFunction(F&& f, const GridView& gridView)\n+ 69{\n+ 70 return std::forward(f);\n+ 71}\n+ 72\n+ 73\n+ 74\n+ 90template()) , int>::type = 0>\n+93auto makeGridViewFunction(F&& f, const GridView& gridView)\n+ 94 -> decltype(makeAnalyticGridViewFunction(std::forward(f), gridView))\n+ 95{\n+ 96 return makeAnalyticGridViewFunction(std::forward(f), gridView);\n+ 97}\n+ 98\n+ 99\n+ 100\n+ 101} // end of namespace Dune::Functions\n+ 102} // end of namespace Dune\n+ 103\n+ 104#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRIDVIEWFUNCTION_HH\n+gridfunction.hh\n+gridviewentityset.hh\n+analyticgridviewfunction.hh\n+Dune::Functions::makeAnalyticGridViewFunction\n+AnalyticGridViewFunction< typename std::invoke_result< F, typename GridView::\n+template Codim< 0 >::Geometry::GlobalCoordinate >::type(typename GridView::\n+template Codim< 0 >::Geometry::GlobalCoordinate), GridView, typename std::\n+decay< F >::type > makeAnalyticGridViewFunction(F &&f, const GridView\n+&gridView)\n+Create an AnalyticGridViewFunction from a function and a grid view.\n+Definition: analyticgridviewfunction.hh:230\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::DefaultGlobalBasis\n-Global basis for given pre-basis.\n-Definition: defaultglobalbasis.hh:46\n-Dune::Functions::BasisNodeMixin::size\n-size_type size() const\n-Definition: nodes.hh:142\n-Dune::Functions::BasisNodeMixin::size_type\n-std::size_t size_type\n-Definition: nodes.hh:128\n-Dune::Functions::BasisNodeMixin::setSize\n-void setSize(const size_type size)\n-Definition: nodes.hh:164\n-Dune::Functions::LeafBasisNode\n-Definition: nodes.hh:186\n-Dune::Functions::RannacherTurekNode\n-Definition: rannacherturekbasis.hh:152\n-Dune::Functions::RannacherTurekNode::FiniteElement\n-std::conditional_t< hasFixedElementType, std::conditional_t< type.isCube(),\n-CubeFiniteElement, SimplexFiniteElement >, LocalFiniteElementVariant<\n-CubeFiniteElement, SimplexFiniteElement > > FiniteElement\n-Definition: rannacherturekbasis.hh:170\n-Dune::Functions::RannacherTurekNode::bind\n-void bind(const Element &e)\n-Bind to element.\n-Definition: rannacherturekbasis.hh:193\n-Dune::Functions::RannacherTurekNode::finiteElement_\n-FiniteElement finiteElement_\n-Definition: rannacherturekbasis.hh:204\n-Dune::Functions::RannacherTurekNode::Element\n-typename GV::template Codim< 0 >::Entity Element\n-Definition: rannacherturekbasis.hh:167\n-Dune::Functions::RannacherTurekNode::RannacherTurekNode\n-RannacherTurekNode()\n-Definition: rannacherturekbasis.hh:172\n-Dune::Functions::RannacherTurekNode::element_\n-const Element * element_\n-Definition: rannacherturekbasis.hh:205\n-Dune::Functions::RannacherTurekNode::finiteElement\n-const FiniteElement & finiteElement() const\n-Return the LocalFiniteElement for the element we are bound to.\n-Definition: rannacherturekbasis.hh:187\n-Dune::Functions::RannacherTurekNode::element\n-const Element & element() const\n-Return current element, throw if unbound.\n-Definition: rannacherturekbasis.hh:178\n-Dune::Functions::RannacherTurekPreBasis\n-Pre-basis for a Rannacher-Turek basis.\n-Definition: rannacherturekbasis.hh:52\n-Dune::Functions::RannacherTurekPreBasis::multiIndexBufferSize\n-static constexpr size_type multiIndexBufferSize\n-Definition: rannacherturekbasis.hh:68\n-Dune::Functions::RannacherTurekPreBasis::initializeIndices\n-void initializeIndices()\n-Initialize the global indices.\n-Definition: rannacherturekbasis.hh:80\n-Dune::Functions::RannacherTurekPreBasis::maxMultiIndexSize\n-static constexpr size_type maxMultiIndexSize\n-Definition: rannacherturekbasis.hh:66\n-Dune::Functions::RannacherTurekPreBasis::minMultiIndexSize\n-static constexpr size_type minMultiIndexSize\n-Definition: rannacherturekbasis.hh:67\n-Dune::Functions::RannacherTurekPreBasis::size\n-size_type size(const SizePrefix prefix) const\n-Return number of possible values for next position in multi index.\n-Definition: rannacherturekbasis.hh:111\n-Dune::Functions::RannacherTurekPreBasis::size_type\n-std::size_t size_type\n-Type used for indices and size information.\n-Definition: rannacherturekbasis.hh:61\n-Dune::Functions::RannacherTurekPreBasis::makeNode\n-Node makeNode() const\n-Create tree node.\n-Definition: rannacherturekbasis.hh:98\n-Dune::Functions::RannacherTurekPreBasis::update\n-void update(const GridView &gv)\n-Update the stored grid view, to be called if the grid has changed.\n-Definition: rannacherturekbasis.hh:90\n-Dune::Functions::RannacherTurekPreBasis::indices\n-It indices(const Node &node, It it) const\n-Definition: rannacherturekbasis.hh:130\n-Dune::Functions::RannacherTurekPreBasis::GridView\n+Dune::Functions::makeGridViewFunction\n+std::decay< F >::type makeGridViewFunction(F &&f, const GridView &gridView)\n+Construct a function modeling GridViewFunction from function and grid view.\n+Definition: gridviewfunction.hh:68\n+Dune::Functions::GridFunction\n+Definition: gridfunction.hh:32\n+Dune::Functions::GridViewEntitySet\n+An entity set for all entities of given codim in a grid view.\n+Definition: gridviewentityset.hh:23\n+Dune::Functions::GridViewFunction\n+Definition: gridviewfunction.hh:22\n+Dune::Functions::GridViewFunction<_Range(Domain),_GV,_DerivativeTraits,\n+bufferSize_>::GridView\n GV GridView\n-The grid view that the FE basis is defined on.\n-Definition: rannacherturekbasis.hh:58\n-Dune::Functions::RannacherTurekPreBasis::dimension\n-size_type dimension() const\n-Get the total dimension of the space spanned by this basis.\n-Definition: rannacherturekbasis.hh:118\n-Dune::Functions::RannacherTurekPreBasis::RannacherTurekPreBasis\n-RannacherTurekPreBasis(const GridView &gv)\n-Constructor for a given grid view object.\n-Definition: rannacherturekbasis.hh:71\n-Dune::Functions::RannacherTurekPreBasis::size\n-size_type size() const\n-Same as size(prefix) with empty prefix.\n-Definition: rannacherturekbasis.hh:104\n-Dune::Functions::RannacherTurekPreBasis::gridView\n-const GridView & gridView() const\n-Obtain the grid view that the basis is defined on.\n-Definition: rannacherturekbasis.hh:84\n-Dune::Functions::RannacherTurekPreBasis::maxNodeSize\n-size_type maxNodeSize() const\n-Get the maximal number of DOFs associated to node for any element.\n-Definition: rannacherturekbasis.hh:124\n-Dune::Functions::RannacherTurekPreBasis::gridView_\n-GridView gridView_\n-Definition: rannacherturekbasis.hh:144\n+Definition: gridviewfunction.hh:46\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00185.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00185.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: hierarchicnodetorangemap.hh File Reference\n+dune-functions: analyticgridviewfunction.hh File Reference\n \n \n \n \n \n \n \n@@ -58,44 +58,56 @@\n \n \n \n \n \n
    \n \n-
    hierarchicnodetorangemap.hh File Reference
    \n+Namespaces |\n+Functions
    \n+
    analyticgridviewfunction.hh File Reference
    \n \n
    \n-
    #include <utility>
    \n-#include <type_traits>
    \n-#include <dune/common/concept.hh>
    \n-#include <dune/functions/functionspacebases/concepts.hh>
    \n-#include <dune/functions/common/indexaccess.hh>
    \n+\n

    Go to the source code of this file.

    \n \n \n-\n-\n+\n+\n \n

    \n Classes

    struct  Dune::Functions::HierarchicNodeToRangeMap
     A simple node to range map using the nested tree indices. More...
    class  Dune::Functions::AnalyticGridViewFunction< Range(Domain), GV, F, DerivativeTraits >
     Class wrapping any differentiable function as grid function. More...
     
    \n \n \n \n \n \n+

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n+\n+\n+\n+\n+\n

    \n+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. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,28 +4,46 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * functionspacebases\n-Classes | Namespaces\n-hierarchicnodetorangemap.hh File Reference\n-#include \n+ * gridfunctions\n+Classes | Namespaces | Functions\n+analyticgridviewfunction.hh File Reference\n #include \n-#include \n-#include \n-#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0Dune::Functions::HierarchicNodeToRangeMap\n-\u00a0 A simple node to range map using the nested tree indices. More...\n+class \u00a0Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n+ DerivativeTraits_>\n+\u00a0 Class wrapping any differentiable function as grid function. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n+ Functions\n+template\n+ AnalyticGridViewFunction< typename\n+ std::invoke_result< F, typename\n+ GridView::template Codim< 0 >::\n+ Geometry::GlobalCoordinate >::type\n+(typename GridView::template Codim< 0\n+ >::Geometry::GlobalCoordinate), Dune::Functions::\n+ GridView, typename std::decay< F >:: makeAnalyticGridViewFunction (F &&f,\n+ type >\u00a0const GridView &gridView)\n+\u00a0 Create an AnalyticGridViewFunction from\n+ a function and a grid view. More...\n+\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00185_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00185_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: hierarchicnodetorangemap.hh Source File\n+dune-functions: analyticgridviewfunction.hh Source File\n \n \n \n \n \n \n \n@@ -58,71 +58,239 @@\n \n
    \n \n \n \n
    \n-
    hierarchicnodetorangemap.hh
    \n+
    analyticgridviewfunction.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH
    \n+
    4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH
    \n
    5
    \n-
    6
    \n-
    7#include <utility>
    \n-
    8#include <type_traits>
    \n-
    9
    \n-
    10#include <dune/common/concept.hh>
    \n-
    11
    \n-\n-\n-
    14
    \n-
    15namespace Dune {
    \n-
    16namespace Functions {
    \n+
    6#include <type_traits>
    \n+
    7#include <optional>
    \n+
    8
    \n+
    9#include <dune/common/typeutilities.hh>
    \n+
    10
    \n+\n+\n+\n+\n+\n+\n
    17
    \n
    18
    \n-
    19
    \n-\n-
    30{
    \n-
    31 template<class Node, class TreePath, class Range,
    \n-
    32 std::enable_if_t< models<Concept::HasIndexAccess, Range, Dune::index_constant<0>>(), int> = 0>
    \n-
    33 decltype(auto) operator()(const Node&, const TreePath& treePath, Range&& y) const
    \n-
    34 {
    \n-
    35 return resolveStaticMultiIndex(y, treePath);
    \n-
    36 }
    \n-
    37
    \n-
    38 template<class Node, class TreePath, class Range,
    \n-
    39 std::enable_if_t<not models<Concept::HasIndexAccess, Range, Dune::index_constant<0>>(), int> = 0>
    \n-
    40 decltype(auto) operator()(const Node&, const TreePath&, Range&& y) const
    \n-
    41 {
    \n-
    42 return std::forward<Range>(y);
    \n-
    43 }
    \n-
    44};
    \n-
    45
    \n-
    46
    \n-
    47
    \n-
    48} // namespace Dune::Functions
    \n-
    49} // namespace Dune
    \n-
    50
    \n-
    51
    \n-
    52#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH
    \n-\n-
    constexpr decltype(auto) resolveStaticMultiIndex(C &&c, const MultiIndex &multiIndex)
    Provide multi-index access by chaining operator[].
    Definition: indexaccess.hh:398
    \n+
    19namespace Dune {
    \n+
    20namespace Functions {
    \n+
    21
    \n+
    22namespace Imp {
    \n+
    23
    \n+
    24template<class Signature, class GV, class FLocal, template<class> class DerivativeTraits=DefaultDerivativeTraits>
    \n+
    25class LocalAnalyticGridViewFunction;
    \n+
    26
    \n+
    27template<class Range, class LocalDomain, class GV, class F, template<class> class DerivativeTraits>
    \n+
    28class LocalAnalyticGridViewFunction<Range(LocalDomain), GV, F, DerivativeTraits>
    \n+
    29{
    \n+
    30public:
    \n+
    31 using Signature = Range(LocalDomain);
    \n+
    32 using RawSignature = typename SignatureTraits<Signature>::RawSignature;
    \n+
    33 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(LocalDomain);
    \n+
    34
    \n+
    35 using GridView = GV;
    \n+
    36 using EntitySet = GridViewEntitySet<GridView, 0>;
    \n+
    37 using Element = typename EntitySet::Element;
    \n+
    38// using Geometry = typename Element::Geometry;
    \n+
    39 using Geometry = typename std::decay<typename Element::Geometry>::type;
    \n+
    40
    \n+
    41 // Use the indirection via derivativeIfImplemented to also support
    \n+
    42 // function types F that do not implement derivative. In this case
    \n+
    43 // the interface type DifferentiableFunction is using a dummy for
    \n+
    44 // the derivative type
    \n+
    45 using DerivativeDummy = DifferentiableFunction<DerivativeSignature>;
    \n+
    46 using GlobalRawDerivative = decltype(Imp::derivativeIfImplemented<DerivativeDummy, F>(std::declval<F>()));
    \n+
    47 using LocalDerivative = LocalAnalyticGridViewFunction<DerivativeSignature, GridView, GlobalRawDerivative, DerivativeTraits>;
    \n+
    48
    \n+
    50 template<class FT, disableCopyMove<LocalAnalyticGridViewFunction, FT> = 0>
    \n+
    51 LocalAnalyticGridViewFunction(FT&& f) :
    \n+
    52 f_(std::forward<FT>(f))
    \n+
    53 {}
    \n+
    54
    \n+
    56 template<class FT>
    \n+
    57 LocalAnalyticGridViewFunction(FT&& f, const Element& element, const std::optional<Geometry>& geometry) :
    \n+
    58 f_(std::forward<FT>(f)),
    \n+
    59 element_(element),
    \n+
    60 geometry_(geometry)
    \n+
    61 {}
    \n+
    62
    \n+
    63
    \n+
    72 void bind(const Element& element)
    \n+
    73 {
    \n+
    74 element_ = element;
    \n+
    75 geometry_.emplace(element_.geometry());
    \n+
    76 }
    \n+
    77
    \n+
    79 void unbind()
    \n+
    80 {
    \n+
    81 geometry_.reset();
    \n+
    82 }
    \n+
    83
    \n+
    86 bool bound() const
    \n+
    87 {
    \n+
    88 return static_cast<bool>(geometry_);
    \n+
    89 }
    \n+
    90
    \n+
    100 Range operator()(const LocalDomain& x) const
    \n+
    101 {
    \n+
    102 assert(!!geometry_);
    \n+
    103 return f_(geometry_->global(x));
    \n+
    104 }
    \n+
    105
    \n+
    107 const Element& localContext() const
    \n+
    108 {
    \n+
    109 assert(!!geometry_);
    \n+
    110 return element_;
    \n+
    111 }
    \n+
    112
    \n+
    121 friend LocalDerivative derivative(const LocalAnalyticGridViewFunction& t)
    \n+
    122 {
    \n+
    123 return LocalDerivative(Imp::derivativeIfImplemented<DerivativeDummy, F>(t.f_), t.element_, t.geometry_);
    \n+
    124 }
    \n+
    125
    \n+
    126private:
    \n+
    127 F f_;
    \n+
    128 Element element_;
    \n+
    129 std::optional<Geometry> geometry_ = std::nullopt;
    \n+
    130};
    \n+
    131
    \n+
    132} // end namespace Imp
    \n+
    133
    \n+
    134
    \n+
    135
    \n+
    136
    \n+
    137template<class Signature, class GV, class F, template<class> class DerivativeTraits=DefaultDerivativeTraits>
    \n+\n+
    139
    \n+
    140
    \n+
    146template<class Range, class Domain, class GV, class F, template<class> class DerivativeTraits>
    \n+
    147class AnalyticGridViewFunction<Range(Domain), GV, F, DerivativeTraits>
    \n+
    148{
    \n+
    149public:
    \n+
    150 using Signature = Range(Domain);
    \n+\n+
    152 using DerivativeSignature = typename DerivativeTraits<RawSignature>::Range(Domain);
    \n+
    153
    \n+
    154 using GridView = GV;
    \n+\n+
    156 using Element = typename EntitySet::Element;
    \n+
    157 using Geometry = typename Element::Geometry;
    \n+
    158
    \n+
    159 // Use the indirection via derivativeIfImplemented to also support
    \n+
    160 // function types F that do not implement derivative. In this case
    \n+
    161 // the interface type DifferentiableFunction is used a dummy for
    \n+
    162 // the derivative type
    \n+\n+
    164 using GlobalRawDerivative = decltype(Imp::derivativeIfImplemented<DerivativeDummy, F>(std::declval<F>()));
    \n+\n+
    166
    \n+\n+
    168 using LocalFunction = typename Imp::LocalAnalyticGridViewFunction<Range(LocalDomain), GridView, F, LocalDerivativeTraits<EntitySet, DerivativeTraits>::template Traits>;
    \n+
    169
    \n+
    171 template<class FT>
    \n+
    172 AnalyticGridViewFunction(FT&& f, const GridView& gridView) :
    \n+
    173 f_(std::forward<FT>(f)),
    \n+
    174 entitySet_(gridView)
    \n+
    175 {}
    \n+
    176
    \n+
    178 Range operator()(const Domain& x) const
    \n+
    179 {
    \n+
    180 return f_(x);
    \n+
    181 }
    \n+
    182
    \n+\n+
    185 {
    \n+
    186 return Derivative(Imp::derivativeIfImplemented<DerivativeDummy, F>(t.f_), t.entitySet_.gridView());
    \n+
    187 }
    \n+
    188
    \n+\n+
    191 {
    \n+
    192 return LocalFunction(t.f_);
    \n+
    193 }
    \n+
    194
    \n+
    196 const EntitySet& entitySet() const
    \n+
    197 {
    \n+
    198 return entitySet_;
    \n+
    199 }
    \n+
    200
    \n+
    201private:
    \n+
    202 F f_;
    \n+
    203 EntitySet entitySet_;
    \n+
    204};
    \n+
    205
    \n+
    206
    \n+
    207
    \n+
    224template<class F, class GridView>
    \n+
    225AnalyticGridViewFunction<
    \n+
    226 typename std::invoke_result<F, typename GridView::template Codim<0>::Geometry::GlobalCoordinate>::type // Range
    \n+
    227 (typename GridView::template Codim<0>::Geometry::GlobalCoordinate), // Domain
    \n+
    228 GridView,
    \n+
    229 typename std::decay<F>::type > // Raw type of F (without & or &&)
    \n+
    230 makeAnalyticGridViewFunction(F&& f, const GridView& gridView)
    \n+
    231{
    \n+
    232 using Domain = typename GridView::template Codim<0>::Geometry::GlobalCoordinate;
    \n+
    233 using Range = typename std::invoke_result<F, Domain>::type;
    \n+
    234 using FRaw = typename std::decay<F>::type;
    \n+
    235
    \n+
    236 return AnalyticGridViewFunction<Range(Domain), GridView, FRaw>(std::forward<F>(f), gridView);
    \n+
    237}
    \n+
    238
    \n+
    239
    \n+
    240
    \n+
    241}} // namespace Dune::Functions
    \n+
    242
    \n+
    243
    \n+
    244
    \n+
    245#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH
    \n+\n+\n+\n+\n+\n+\n+
    TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const TrigonometricFunction< K, sinFactor, cosFactor > &f)
    Obtain derivative of TrigonometricFunction function.
    Definition: trigonometricfunction.hh:39
    \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.
    Definition: analyticgridviewfunction.hh:230
    \n
    Definition: polynomial.hh:10
    \n-
    A simple node to range map using the nested tree indices.
    Definition: hierarchicnodetorangemap.hh:30
    \n-
    decltype(auto) operator()(const Node &, const TreePath &treePath, Range &&y) const
    Definition: hierarchicnodetorangemap.hh:33
    \n-
    decltype(auto) operator()(const Node &, const TreePath &, Range &&y) const
    Definition: hierarchicnodetorangemap.hh:40
    \n-\n+
    Definition: differentiablefunction.hh:29
    \n+
    Helper class to deduce the signature of a callable.
    Definition: signature.hh:56
    \n+
    Definition: analyticgridviewfunction.hh:138
    \n+
    Range operator()(const Domain &x) const
    Evaluate the wrapped function f directly in global coordinates x.
    Definition: analyticgridviewfunction.hh:178
    \n+
    typename EntitySet::LocalCoordinate LocalDomain
    Definition: analyticgridviewfunction.hh:167
    \n+
    friend Derivative derivative(const AnalyticGridViewFunction &t)
    Create a derivative grid-function by wrapping the derivative of f.
    Definition: analyticgridviewfunction.hh:184
    \n+
    typename Element::Geometry Geometry
    Definition: analyticgridviewfunction.hh:157
    \n+
    typename EntitySet::Element Element
    Definition: analyticgridviewfunction.hh:156
    \n+\n+
    decltype(Imp::derivativeIfImplemented< DerivativeDummy, F >(std::declval< F >())) GlobalRawDerivative
    Definition: analyticgridviewfunction.hh:164
    \n+
    Range(Domain) Signature
    Definition: analyticgridviewfunction.hh:150
    \n+
    AnalyticGridViewFunction(FT &&f, const GridView &gridView)
    Create the grid-function by wrapping a function f and create a GridViewEntitySet.
    Definition: analyticgridviewfunction.hh:172
    \n+
    friend LocalFunction localFunction(const AnalyticGridViewFunction &t)
    Construct the associated local-function.
    Definition: analyticgridviewfunction.hh:190
    \n+
    typename Imp::LocalAnalyticGridViewFunction< Range(LocalDomain), GridView, F, LocalDerivativeTraits< EntitySet, DerivativeTraits >::template Traits > LocalFunction
    Definition: analyticgridviewfunction.hh:168
    \n+
    typename SignatureTraits< Signature >::RawSignature RawSignature
    Definition: analyticgridviewfunction.hh:151
    \n+
    const EntitySet & entitySet() const
    Return the set of entities this local-function can be bound to.
    Definition: analyticgridviewfunction.hh:196
    \n+
    typename DerivativeTraits< RawSignature >::Range(Domain) DerivativeSignature
    Definition: analyticgridviewfunction.hh:152
    \n+\n+
    GridView::template Codim< codim >::Entity Element
    Type of Elements contained in this EntitySet.
    Definition: gridviewentityset.hh:32
    \n+
    Element::Geometry::LocalCoordinate LocalCoordinate
    Type of local coordinates with respect to the Element.
    Definition: gridviewentityset.hh:35
    \n+
    Derivative traits for local functions.
    Definition: localderivativetraits.hh:28
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,78 +4,326 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * functionspacebases\n-hierarchicnodetorangemap.hh\n+ * gridfunctions\n+analyticgridviewfunction.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH\n+ 3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH\n+ 4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH\n 5\n- 6\n- 7#include \n- 8#include \n- 9\n- 10#include \n- 11\n- 12#include \n- 13#include \n- 14\n- 15namespace Dune {\n- 16namespace Functions {\n+ 6#include \n+ 7#include \n+ 8\n+ 9#include \n+ 10\n+ 11#include \n+ 12#include \n+ 13#include \n+ 14#include \n+ 15#include \n+ 16#include \n 17\n 18\n- 19\n-29struct HierarchicNodeToRangeMap\n- 30{\n- 31 template>(), int> = 0>\n-33 decltype(auto) operator()(const Node&, const TreePath& treePath, Range&& y)\n-const\n- 34 {\n- 35 return resolveStaticMultiIndex(y, treePath);\n- 36 }\n- 37\n- 38 template>(), int> = 0>\n-40 decltype(auto) operator()(const Node&, const TreePath&, Range&& y) const\n- 41 {\n- 42 return std::forward(y);\n- 43 }\n- 44};\n- 45\n- 46\n- 47\n- 48} // namespace Dune::Functions\n- 49} // namespace Dune\n- 50\n- 51\n- 52#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_HIERARCHICNODETORANGEMAP_HH\n-indexaccess.hh\n-Dune::Functions::resolveStaticMultiIndex\n-constexpr decltype(auto) resolveStaticMultiIndex(C &&c, const MultiIndex\n-&multiIndex)\n-Provide multi-index access by chaining operator[].\n-Definition: indexaccess.hh:398\n+ 19namespace Dune {\n+ 20namespace Functions {\n+ 21\n+ 22namespace Imp {\n+ 23\n+ 24template class\n+DerivativeTraits=DefaultDerivativeTraits>\n+ 25class LocalAnalyticGridViewFunction;\n+ 26\n+ 27template\n+class DerivativeTraits>\n+ 28class LocalAnalyticGridViewFunction\n+ 29{\n+ 30public:\n+ 31 using Signature = Range(LocalDomain);\n+ 32 using RawSignature = typename SignatureTraits::RawSignature;\n+ 33 using DerivativeSignature = typename DerivativeTraits::Range\n+(LocalDomain);\n+ 34\n+ 35 using GridView = GV;\n+ 36 using EntitySet = GridViewEntitySet;\n+ 37 using Element = typename EntitySet::Element;\n+ 38// using Geometry = typename Element::Geometry;\n+ 39 using Geometry = typename std::decay::type;\n+ 40\n+ 41 // Use the indirection via derivativeIfImplemented to also support\n+ 42 // function types F that do not implement derivative. In this case\n+ 43 // the interface type DifferentiableFunction is using a dummy for\n+ 44 // the derivative type\n+ 45 using DerivativeDummy = DifferentiableFunction;\n+ 46 using GlobalRawDerivative = decltype(Imp::\n+derivativeIfImplemented(std::declval()));\n+ 47 using LocalDerivative = LocalAnalyticGridViewFunction;\n+ 48\n+ 50 template = 0>\n+ 51 LocalAnalyticGridViewFunction(FT&& f) :\n+ 52 f_(std::forward(f))\n+ 53 {}\n+ 54\n+ 56 template\n+ 57 LocalAnalyticGridViewFunction(FT&& f, const Element& element, const std::\n+optional& geometry) :\n+ 58 f_(std::forward(f)),\n+ 59 element_(element),\n+ 60 geometry_(geometry)\n+ 61 {}\n+ 62\n+ 63\n+ 72 void bind(const Element& element)\n+ 73 {\n+ 74 element_ = element;\n+ 75 geometry_.emplace(element_.geometry());\n+ 76 }\n+ 77\n+ 79 void unbind()\n+ 80 {\n+ 81 geometry_.reset();\n+ 82 }\n+ 83\n+ 86 bool bound() const\n+ 87 {\n+ 88 return static_cast(geometry_);\n+ 89 }\n+ 90\n+ 100 Range operator()(const LocalDomain& x) const\n+ 101 {\n+ 102 assert(!!geometry_);\n+ 103 return f_(geometry_->global(x));\n+ 104 }\n+ 105\n+ 107 const Element& localContext() const\n+ 108 {\n+ 109 assert(!!geometry_);\n+ 110 return element_;\n+ 111 }\n+ 112\n+ 121 friend LocalDerivative derivative(const LocalAnalyticGridViewFunction& t)\n+ 122 {\n+ 123 return LocalDerivative(Imp::derivativeIfImplemented\n+(t.f_), t.element_, t.geometry_);\n+ 124 }\n+ 125\n+ 126private:\n+ 127 F f_;\n+ 128 Element element_;\n+ 129 std::optional geometry_ = std::nullopt;\n+ 130};\n+ 131\n+ 132} // end namespace Imp\n+ 133\n+ 134\n+ 135\n+ 136\n+ 137template class\n+DerivativeTraits=DefaultDerivativeTraits>\n+138class AnalyticGridViewFunction;\n+ 139\n+ 140\n+ 146template\n+class DerivativeTraits>\n+147class AnalyticGridViewFunction\n+ 148{\n+ 149public:\n+150 using Signature = Range(Domain);\n+151 using RawSignature = typename SignatureTraits::RawSignature;\n+152 using DerivativeSignature = typename DerivativeTraits::Range\n+(Domain);\n+ 153\n+154 using GridView = GV;\n+155 using EntitySet = GridViewEntitySet;\n+156 using Element = typename EntitySet::Element;\n+157 using Geometry = typename Element::Geometry;\n+ 158\n+ 159 // Use the indirection via derivativeIfImplemented to also support\n+ 160 // function types F that do not implement derivative. In this case\n+ 161 // the interface type DifferentiableFunction is used a dummy for\n+ 162 // the derivative type\n+163 using DerivativeDummy = DifferentiableFunction;\n+164 using GlobalRawDerivative = decltype(Imp::\n+derivativeIfImplemented(std::declval()));\n+165 using Derivative = AnalyticGridViewFunction;\n+ 166\n+167 using LocalDomain = typename EntitySet::LocalCoordinate;\n+168 using LocalFunction = typename Imp::LocalAnalyticGridViewFunction::template Traits>;\n+ 169\n+ 171 template\n+172 AnalyticGridViewFunction(FT&& f, const GridView& gridView) :\n+ 173 f_(std::forward(f)),\n+ 174 entitySet_(gridView)\n+ 175 {}\n+ 176\n+178 Range operator()(const Domain& x) const\n+ 179 {\n+ 180 return f_(x);\n+ 181 }\n+ 182\n+184 friend Derivative derivative(const AnalyticGridViewFunction& t)\n+ 185 {\n+ 186 return Derivative(Imp::derivativeIfImplemented(t.f_),\n+t.entitySet_.gridView());\n+ 187 }\n+ 188\n+190 friend LocalFunction localFunction(const AnalyticGridViewFunction& t)\n+ 191 {\n+ 192 return LocalFunction(t.f_);\n+ 193 }\n+ 194\n+196 const EntitySet& entitySet() const\n+ 197 {\n+ 198 return entitySet_;\n+ 199 }\n+ 200\n+ 201private:\n+ 202 F f_;\n+ 203 EntitySet entitySet_;\n+ 204};\n+ 205\n+ 206\n+ 207\n+ 224template\n+ 225AnalyticGridViewFunction<\n+ 226 typename std::invoke_result::\n+Geometry::GlobalCoordinate>::type // Range\n+ 227 (typename GridView::template Codim<0>::Geometry::GlobalCoordinate), /\n+/ Domain\n+ 228 GridView,\n+ 229 typename std::decay::type > // Raw type of F (without & or &&)\n+230 makeAnalyticGridViewFunction(F&& f, const GridView& gridView)\n+ 231{\n+ 232 using Domain = typename GridView::template Codim<0>::Geometry::\n+GlobalCoordinate;\n+ 233 using Range = typename std::invoke_result::type;\n+ 234 using FRaw = typename std::decay::type;\n+ 235\n+ 236 return AnalyticGridViewFunction(std::\n+forward(f), gridView);\n+ 237}\n+ 238\n+ 239\n+ 240\n+ 241}} // namespace Dune::Functions\n+ 242\n+ 243\n+ 244\n+ 245#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_ANALYTICGRIDVIEWFUNCTION_HH\n+signature.hh\n+differentiablefunction_imp.hh\n+defaultderivativetraits.hh\n+differentiablefunction.hh\n+gridviewentityset.hh\n+localderivativetraits.hh\n+Dune::Functions::derivative\n+TrigonometricFunction< K, -cosFactor, sinFactor > derivative(const\n+TrigonometricFunction< K, sinFactor, cosFactor > &f)\n+Obtain derivative of TrigonometricFunction function.\n+Definition: trigonometricfunction.hh:39\n+Dune::Functions::AnalyticGridViewFunction::makeAnalyticGridViewFunction\n+AnalyticGridViewFunction< typename std::invoke_result< F, typename GridView::\n+template Codim< 0 >::Geometry::GlobalCoordinate >::type(typename GridView::\n+template Codim< 0 >::Geometry::GlobalCoordinate), GridView, typename std::\n+decay< F >::type > makeAnalyticGridViewFunction(F &&f, const GridView\n+&gridView)\n+Create an AnalyticGridViewFunction from a function and a grid view.\n+Definition: analyticgridviewfunction.hh:230\n Dune\n Definition: polynomial.hh:10\n-Dune::Functions::HierarchicNodeToRangeMap\n-A simple node to range map using the nested tree indices.\n-Definition: hierarchicnodetorangemap.hh:30\n-Dune::Functions::HierarchicNodeToRangeMap::operator()\n-decltype(auto) operator()(const Node &, const TreePath &treePath, Range &&y)\n-const\n-Definition: hierarchicnodetorangemap.hh:33\n-Dune::Functions::HierarchicNodeToRangeMap::operator()\n-decltype(auto) operator()(const Node &, const TreePath &, Range &&y) const\n-Definition: hierarchicnodetorangemap.hh:40\n-concepts.hh\n+Dune::Functions::DifferentiableFunction\n+Definition: differentiablefunction.hh:29\n+Dune::Functions::SignatureTraits\n+Helper class to deduce the signature of a callable.\n+Definition: signature.hh:56\n+Dune::Functions::AnalyticGridViewFunction\n+Definition: analyticgridviewfunction.hh:138\n+Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n+DerivativeTraits_>::operator()\n+Range operator()(const Domain &x) const\n+Evaluate the wrapped function f directly in global coordinates x.\n+Definition: analyticgridviewfunction.hh:178\n+Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n+DerivativeTraits_>::LocalDomain\n+typename EntitySet::LocalCoordinate LocalDomain\n+Definition: analyticgridviewfunction.hh:167\n+Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n+DerivativeTraits_>::derivative\n+friend Derivative derivative(const AnalyticGridViewFunction &t)\n+Create a derivative grid-function by wrapping the derivative of f.\n+Definition: analyticgridviewfunction.hh:184\n+Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n+DerivativeTraits_>::Geometry\n+typename Element::Geometry Geometry\n+Definition: analyticgridviewfunction.hh:157\n+Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n+DerivativeTraits_>::Element\n+typename EntitySet::Element Element\n+Definition: analyticgridviewfunction.hh:156\n+Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n+DerivativeTraits_>::GridView\n+GV GridView\n+Definition: analyticgridviewfunction.hh:154\n+Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n+DerivativeTraits_>::GlobalRawDerivative\n+decltype(Imp::derivativeIfImplemented< DerivativeDummy, F >(std::declval< F >\n+())) GlobalRawDerivative\n+Definition: analyticgridviewfunction.hh:164\n+Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n+DerivativeTraits_>::Signature\n+Range(Domain) Signature\n+Definition: analyticgridviewfunction.hh:150\n+Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n+DerivativeTraits_>::AnalyticGridViewFunction\n+AnalyticGridViewFunction(FT &&f, const GridView &gridView)\n+Create the grid-function by wrapping a function f and create a\n+GridViewEntitySet.\n+Definition: analyticgridviewfunction.hh:172\n+Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n+DerivativeTraits_>::localFunction\n+friend LocalFunction localFunction(const AnalyticGridViewFunction &t)\n+Construct the associated local-function.\n+Definition: analyticgridviewfunction.hh:190\n+Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n+DerivativeTraits_>::LocalFunction\n+typename Imp::LocalAnalyticGridViewFunction< Range(LocalDomain), GridView, F,\n+LocalDerivativeTraits< EntitySet, DerivativeTraits >::template Traits >\n+LocalFunction\n+Definition: analyticgridviewfunction.hh:168\n+Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n+DerivativeTraits_>::RawSignature\n+typename SignatureTraits< Signature >::RawSignature RawSignature\n+Definition: analyticgridviewfunction.hh:151\n+Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n+DerivativeTraits_>::entitySet\n+const EntitySet & entitySet() const\n+Return the set of entities this local-function can be bound to.\n+Definition: analyticgridviewfunction.hh:196\n+Dune::Functions::AnalyticGridViewFunction<_Range(Domain),_GV,_F,\n+DerivativeTraits_>::DerivativeSignature\n+typename DerivativeTraits< RawSignature >::Range(Domain) DerivativeSignature\n+Definition: analyticgridviewfunction.hh:152\n+Dune::Functions::GridViewEntitySet<_GridView,_0_>\n+Dune::Functions::GridViewEntitySet<_GridView,_0_>::Element\n+GridView::template Codim< codim >::Entity Element\n+Type of Elements contained in this EntitySet.\n+Definition: gridviewentityset.hh:32\n+Dune::Functions::GridViewEntitySet<_GridView,_0_>::LocalCoordinate\n+Element::Geometry::LocalCoordinate LocalCoordinate\n+Type of local coordinates with respect to the Element.\n+Definition: gridviewentityset.hh:35\n+Dune::Functions::LocalDerivativeTraits\n+Derivative traits for local functions.\n+Definition: localderivativetraits.hh:28\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00188.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00188.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: interpolate.hh File Reference\n+dune-functions: facenormalgridfunction.hh File Reference\n \n \n \n \n \n \n \n@@ -58,62 +58,47 @@\n \n \n \n \n \n
    \n \n-
    interpolate.hh File Reference
    \n+Classes |\n+Namespaces
    \n+
    facenormalgridfunction.hh File Reference
    \n \n
    \n-
    #include <memory>
    \n-#include <vector>
    \n+
    #include <type_traits>
    \n+#include <optional>
    \n #include <dune/common/exceptions.hh>
    \n-#include <dune/common/bitsetvector.hh>
    \n-#include <dune/typetree/childextraction.hh>
    \n-#include <dune/functions/gridfunctions/gridviewfunction.hh>
    \n-#include <dune/functions/common/functionconcepts.hh>
    \n-#include <dune/functions/backends/concepts.hh>
    \n-#include <dune/functions/backends/istlvectorbackend.hh>
    \n-#include <dune/functions/functionspacebases/sizeinfo.hh>
    \n-#include <dune/functions/functionspacebases/flatvectorview.hh>
    \n-#include <dune/functions/functionspacebases/hierarchicnodetorangemap.hh>
    \n-#include <dune/typetree/traversal.hh>
    \n-#include <dune/typetree/visitor.hh>
    \n+#include <dune/common/typeutilities.hh>
    \n+#include <dune/common/rangeutilities.hh>
    \n+#include <dune/geometry/referenceelements.hh>
    \n+#include <dune/functions/gridfunctions/gridfunction.hh>
    \n+#include <dune/functions/gridfunctions/gridviewentityset.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n+\n+\n+\n+\n+

    \n+Classes

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n

    \n-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. More...
     
    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. More...
     
    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. More...
     
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,48 +4,31 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * functionspacebases\n-Namespaces | Functions\n-interpolate.hh File Reference\n-#include \n-#include \n+ * gridfunctions\n+Classes | Namespaces\n+facenormalgridfunction.hh File Reference\n+#include \n+#include \n #include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+#include \n+#include \n+#include \n+#include \n+#include \n Go_to_the_source_code_of_this_file.\n+ Classes\n+class \u00a0Dune::Functions::FaceNormalGridFunction<_GV_>\n+\u00a0 Grid function implementing the piecewise element face normal. More...\n+\u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Functions\n \u00a0\n- Functions\n-template\n-void\u00a0Dune::Functions::interpolate (const B &basis, C &&coeff, const F &f,\n- const BV &bv, const NTRE &nodeToRangeEntry)\n-\u00a0 Interpolate given function in discrete function space. More...\n-\u00a0\n-template\n-void\u00a0Dune::Functions::interpolate (const B &basis, C &&coeff, const F &f,\n- const BV &bitVector)\n-\u00a0 Interpolate given function in discrete function space. More...\n-\u00a0\n-template\n-void\u00a0Dune::Functions::interpolate (const B &basis, C &&coeff, const F &f)\n-\u00a0 Interpolate given function in discrete function space. More...\n-\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00188_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00188_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: interpolate.hh Source File\n+dune-functions: facenormalgridfunction.hh Source File\n \n \n \n \n \n \n \n@@ -58,290 +58,195 @@\n \n
    \n \n \n \n
    \n-
    interpolate.hh
    \n+
    facenormalgridfunction.hh
    \n
    \n
    \n Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH
    \n-
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH
    \n+
    3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH
    \n+
    4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH
    \n
    5
    \n-
    6#include <memory>
    \n-
    7#include <vector>
    \n+
    6#include <type_traits>
    \n+
    7#include <optional>
    \n
    8
    \n
    9#include <dune/common/exceptions.hh>
    \n-
    10#include <dune/common/bitsetvector.hh>
    \n-
    11
    \n-
    12#include <dune/typetree/childextraction.hh>
    \n+
    10#include <dune/common/typeutilities.hh>
    \n+
    11#include <dune/common/rangeutilities.hh>
    \n+
    12#include <dune/geometry/referenceelements.hh>
    \n
    13
    \n-\n-\n+\n+\n
    16
    \n-\n-\n-\n-\n-\n-
    22
    \n-
    23#include <dune/typetree/traversal.hh>
    \n-
    24#include <dune/typetree/visitor.hh>
    \n-
    25
    \n-
    26namespace Dune {
    \n-
    27namespace Functions {
    \n-
    28
    \n-
    29namespace Imp {
    \n-
    30
    \n-
    31struct AllTrueBitSetVector
    \n-
    32{
    \n-
    33 struct AllTrueBitSet
    \n-
    34 {
    \n-
    35 bool test(int) const { return true; }
    \n-
    36 } allTrue_;
    \n-
    37
    \n-
    38 operator bool() const
    \n-
    39 {
    \n-
    40 return true;
    \n-
    41 }
    \n-
    42
    \n-
    43 template<class I>
    \n-
    44 const AllTrueBitSetVector& operator[](const I&) const
    \n-
    45 {
    \n-
    46 return *this;
    \n-
    47 }
    \n+
    17
    \n+
    18namespace Dune::Functions {
    \n+
    19
    \n+
    20namespace Impl {
    \n+
    21
    \n+
    22// Compute closest face to point
    \n+
    23template<class ReferenceElement, class Coordinate>
    \n+
    24auto closestFaceIndex(const ReferenceElement& re, const Coordinate& x)
    \n+
    25{
    \n+
    26 auto closestFaceIndex = decltype(re.subEntity(0,1,0,1)){};
    \n+
    27 double closestFaceDistance = std::numeric_limits<double>::max();
    \n+
    28 for(auto&& faceIndex : Dune::range(re.size(1)))
    \n+
    29 {
    \n+
    30 // For a face unit outer normal consider the orthogonal projection
    \n+
    31 // Px = x + <c-x,n>*n into the face. Then the distance to the face
    \n+
    32 // is given by |x-Px| = |<c-x,n>||n| = <c-x,n>.
    \n+
    33 auto normal = re.integrationOuterNormal(faceIndex);
    \n+
    34 normal /= normal.two_norm();
    \n+
    35 auto c = re.position(faceIndex,1);
    \n+
    36 c -= x;
    \n+
    37 auto faceDistance = (c*normal);
    \n+
    38 if (faceDistance<closestFaceDistance)
    \n+
    39 {
    \n+
    40 closestFaceDistance = faceDistance;
    \n+
    41 closestFaceIndex = faceIndex;
    \n+
    42 }
    \n+
    43 }
    \n+
    44 return closestFaceIndex;
    \n+
    45}
    \n+
    46
    \n+
    47} // end namespace Impl
    \n
    48
    \n-
    49 template<class SP>
    \n-
    50 void resize(const SP&) const
    \n-
    51 {}
    \n-
    52
    \n-
    53};
    \n-
    54
    \n-
    55
    \n-
    56
    \n-
    57template <class B, class T, class NTRE, class HV, class LF, class HBV>
    \n-
    58class LocalInterpolateVisitor
    \n-
    59 : public TypeTree::TreeVisitor
    \n-
    60 , public TypeTree::DynamicTraversal
    \n-
    61{
    \n-
    62
    \n-
    63public:
    \n-
    64
    \n-
    65 using Basis = B;
    \n-
    66 using LocalView = typename B::LocalView;
    \n-
    67 using MultiIndex = typename LocalView::MultiIndex;
    \n-
    68
    \n-
    69 using LocalFunction = LF;
    \n-
    70
    \n-
    71 using Tree = T;
    \n-
    72
    \n-
    73 using VectorBackend = HV;
    \n-
    74 using BitVectorBackend = HBV;
    \n+
    49
    \n+
    50
    \n+
    51
    \n+
    64template<class GV>
    \n+\n+
    66{
    \n+
    67public:
    \n+
    68 using GridView = GV;
    \n+\n+
    70 using Element = typename EntitySet::Element;
    \n+
    71
    \n+\n+\n+\n
    75
    \n-
    76 using NodeToRangeEntry = NTRE;
    \n+
    76private:
    \n
    77
    \n-
    78 using GridView = typename Basis::GridView;
    \n-
    79 using Element = typename GridView::template Codim<0>::Entity;
    \n-
    80
    \n-
    81 using LocalDomain = typename Element::Geometry::LocalCoordinate;
    \n-
    82
    \n-
    83 using GlobalDomain = typename Element::Geometry::GlobalCoordinate;
    \n-
    84
    \n-
    85 LocalInterpolateVisitor(const B& /*basis*/, HV& coeff, const HBV& bitVector, const LF& localF, const LocalView& localView, const NodeToRangeEntry& nodeToRangeEntry) :
    \n-
    86 vector_(coeff),
    \n-
    87 localF_(localF),
    \n-
    88 bitVector_(bitVector),
    \n-
    89 localView_(localView),
    \n-
    90 nodeToRangeEntry_(nodeToRangeEntry)
    \n-
    91 {
    \n-
    92 static_assert(Dune::Functions::Concept::isCallable<LocalFunction, LocalDomain>(), "Function passed to LocalInterpolateVisitor does not model the Callable<LocalCoordinate> concept");
    \n-
    93 }
    \n-
    94
    \n-
    95 template<typename Node, typename TreePath>
    \n-
    96 void pre(Node&, TreePath)
    \n-
    97 {}
    \n-
    98
    \n-
    99 template<typename Node, typename TreePath>
    \n-
    100 void post(Node&, TreePath)
    \n-
    101 {}
    \n+
    78 using Traits = Imp::GridFunctionTraits<Range(Domain), EntitySet, DefaultDerivativeTraits, 16>;
    \n+
    79
    \n+
    80 class LocalFunction
    \n+
    81 {
    \n+
    82 using Geometry = typename Element::Geometry;
    \n+
    83 static const int dimension = GV::dimension;
    \n+
    84 public:
    \n+
    85
    \n+
    97 void bind(const Element& element)
    \n+
    98 {
    \n+
    99 element_ = element;
    \n+
    100 geometry_.emplace(element_.geometry());
    \n+
    101 }
    \n
    102
    \n-
    103 template<typename Node, typename TreePath>
    \n-
    104 void leaf(Node& node, TreePath treePath)
    \n-
    105 {
    \n-
    106 using FiniteElement = typename Node::FiniteElement;
    \n-
    107 using FiniteElementRange = typename FiniteElement::Traits::LocalBasisType::Traits::RangeType;
    \n-
    108 using FiniteElementRangeField = typename FiniteElement::Traits::LocalBasisType::Traits::RangeFieldType;
    \n-
    109
    \n-
    110 auto interpolationCoefficients = std::vector<FiniteElementRangeField>();
    \n-
    111 auto&& fe = node.finiteElement();
    \n-
    112
    \n-
    113 // backward compatibility: for scalar basis functions and possibly vector valued coefficients
    \n-
    114 // (like used in dune-fufem for power bases) loop over the components
    \n-
    115 // of the coefficients
    \n-
    116 if constexpr ( FiniteElement::Traits::LocalBasisType::Traits::dimRange == 1 )
    \n-
    117 {
    \n-
    118 // Note that we capture j by reference. Hence we can switch
    \n-
    119 // the selected component later on by modifying j. Maybe we
    \n-
    120 // should avoid this naughty statefull lambda hack in favor
    \n-
    121 // of a separate helper class.
    \n-
    122 std::size_t j=0;
    \n-
    123 auto localFj = [&](const LocalDomain& x){
    \n-
    124 const auto& y = localF_(x);
    \n-
    125 return FiniteElementRange(flatVectorView(nodeToRangeEntry_(node, treePath, y))[j]);
    \n-
    126 };
    \n-
    127
    \n-
    128 // We loop over j defined above and thus over the components of the
    \n-
    129 // range type of localF_.
    \n+
    103 void unbind()
    \n+
    104 {
    \n+
    105 geometry_.reset();
    \n+
    106 }
    \n+
    107
    \n+
    110 bool bound() const
    \n+
    111 {
    \n+
    112 return static_cast<bool>(geometry_);
    \n+
    113 }
    \n+
    114
    \n+
    124 Range operator()(const LocalDomain& x) const
    \n+
    125 {
    \n+
    126 auto&& re = Dune::referenceElement(*geometry_);
    \n+
    127 // Compute reference normal of closest face to given point
    \n+
    128 auto face = Impl::closestFaceIndex(re, x);
    \n+
    129 auto localNormal = re.integrationOuterNormal(face);
    \n
    130
    \n-
    131 auto blockSize = flatVectorView(vector_[localView_.index(0)]).size();
    \n-
    132
    \n-
    133 for(j=0; j<blockSize; ++j)
    \n-
    134 {
    \n-
    135 fe.localInterpolation().interpolate(localFj, interpolationCoefficients);
    \n-
    136 for (size_t i=0; i<fe.localBasis().size(); ++i)
    \n-
    137 {
    \n-
    138 auto multiIndex = localView_.index(node.localIndex(i));
    \n-
    139 auto bitVectorBlock = flatVectorView(bitVector_[multiIndex]);
    \n-
    140 if (bitVectorBlock[j])
    \n-
    141 {
    \n-
    142 auto vectorBlock = flatVectorView(vector_[multiIndex]);
    \n-
    143 vectorBlock[j] = interpolationCoefficients[i];
    \n-
    144 }
    \n-
    145 }
    \n-
    146 }
    \n-
    147 }
    \n-
    148 else // ( FiniteElement::Traits::LocalBasisType::Traits::dimRange != 1 )
    \n-
    149 {
    \n-
    150 // for all other finite elements: use the FiniteElementRange directly for the interpolation
    \n-
    151 auto localF = [&](const LocalDomain& x){
    \n-
    152 const auto& y = localF_(x);
    \n-
    153 return FiniteElementRange(nodeToRangeEntry_(node, treePath, y));
    \n-
    154 };
    \n+
    131 // Transform reference normal into global unit outer normal using
    \n+
    132 // covariant Piola transformation
    \n+
    133 auto normal = Range{};
    \n+
    134 geometry_->jacobianInverseTransposed(x).mv(localNormal, normal);
    \n+
    135 normal /= normal.two_norm();
    \n+
    136 return normal;
    \n+
    137 }
    \n+
    138
    \n+
    140 const Element& localContext() const
    \n+
    141 {
    \n+
    142 return element_;
    \n+
    143 }
    \n+
    144
    \n+
    146 friend typename Traits::LocalFunctionTraits::DerivativeInterface derivative(const LocalFunction& t)
    \n+
    147 {
    \n+
    148 DUNE_THROW(NotImplemented,"not implemented");
    \n+
    149 }
    \n+
    150
    \n+
    151 private:
    \n+
    152 std::optional<Geometry> geometry_;
    \n+
    153 Element element_;
    \n+
    154 };
    \n
    155
    \n-
    156 fe.localInterpolation().interpolate(localF, interpolationCoefficients);
    \n-
    157 for (size_t i=0; i<fe.localBasis().size(); ++i)
    \n-
    158 {
    \n-
    159 auto multiIndex = localView_.index(node.localIndex(i));
    \n-
    160 if ( bitVector_[multiIndex] )
    \n-
    161 {
    \n-
    162 vector_[multiIndex] = interpolationCoefficients[i];
    \n-
    163 }
    \n-
    164 }
    \n-
    165 }
    \n+
    156public:
    \n+\n+
    159 entitySet_(gridView)
    \n+
    160 {}
    \n+
    161
    \n+
    163 Range operator()(const Domain& x) const
    \n+
    164 {
    \n+
    165 DUNE_THROW(NotImplemented,"not implemented");
    \n
    166 }
    \n
    167
    \n-
    168
    \n-
    169protected:
    \n-
    170
    \n-
    171 VectorBackend& vector_;
    \n-
    172 const LocalFunction& localF_;
    \n-
    173 const BitVectorBackend& bitVector_;
    \n-
    174 const LocalView& localView_;
    \n-
    175 const NodeToRangeEntry& nodeToRangeEntry_;
    \n-
    176};
    \n-
    177
    \n-
    178
    \n-
    179} // namespace Imp
    \n-
    180
    \n-
    181
    \n-
    182
    \n-
    183
    \n-
    201template <class B, class C, class F, class BV, class NTRE>
    \n-
    202void interpolate(const B& basis, C&& coeff, const F& f, const BV& bv, const NTRE& nodeToRangeEntry)
    \n-
    203{
    \n-
    204 using GridView = typename B::GridView;
    \n-
    205 using Element = typename GridView::template Codim<0>::Entity;
    \n-
    206
    \n-
    207 using Tree = typename B::LocalView::Tree;
    \n-
    208
    \n-
    209 using GlobalDomain = typename Element::Geometry::GlobalCoordinate;
    \n-
    210
    \n-
    211 static_assert(Dune::Functions::Concept::isCallable<F, GlobalDomain>(), "Function passed to interpolate does not model the Callable<GlobalCoordinate> concept");
    \n-
    212
    \n-
    213 auto&& gridView = basis.gridView();
    \n-
    214
    \n-
    215 // Small helper functions to wrap vectors using istlVectorBackend
    \n-
    216 // if they do not already satisfy the VectorBackend interface.
    \n-
    217 auto toVectorBackend = [&](auto& v) -> decltype(auto) {
    \n-
    218 if constexpr (models<Concept::VectorBackend<B>, decltype(v)>()) {
    \n-
    219 return v;
    \n-
    220 } else {
    \n-
    221 return istlVectorBackend(v);
    \n-
    222 }
    \n-
    223 };
    \n-
    224
    \n-
    225 auto toConstVectorBackend = [&](auto& v) -> decltype(auto) {
    \n-
    226 if constexpr (models<Concept::ConstVectorBackend<B>, decltype(v)>()) {
    \n-
    227 return v;
    \n-
    228 } else {
    \n-
    229 return istlVectorBackend(v);
    \n-
    230 }
    \n-
    231 };
    \n-
    232
    \n-
    233 auto&& bitVector = toConstVectorBackend(bv);
    \n-
    234 auto&& vector = toVectorBackend(coeff);
    \n-
    235 vector.resize(sizeInfo(basis));
    \n-
    236
    \n-
    237
    \n-
    238
    \n-
    239 // Make a grid function supporting local evaluation out of f
    \n-
    240 auto gf = makeGridViewFunction(f, gridView);
    \n-
    241
    \n-
    242 // Obtain a local view of f
    \n-
    243 auto localF = localFunction(gf);
    \n-
    244
    \n-
    245 auto localView = basis.localView();
    \n-
    246
    \n-
    247 for (const auto& e : elements(gridView))
    \n-
    248 {
    \n-
    249 localView.bind(e);
    \n-
    250 localF.bind(e);
    \n-
    251
    \n-
    252 Imp::LocalInterpolateVisitor<B, Tree, NTRE, decltype(vector), decltype(localF), decltype(bitVector)> localInterpolateVisitor(basis, vector, bitVector, localF, localView, nodeToRangeEntry);
    \n-
    253 TypeTree::applyToTree(localView.tree(),localInterpolateVisitor);
    \n-
    254 }
    \n-
    255}
    \n-
    256
    \n-
    273template <class B, class C, class F, class BV>
    \n-
    274void interpolate(const B& basis, C&& coeff, const F& f, const BV& bitVector)
    \n-
    275{
    \n-
    276 interpolate(basis, coeff, f, bitVector, HierarchicNodeToRangeMap());
    \n-
    277}
    \n-
    278
    \n-
    293template <class B, class C, class F>
    \n-
    294void interpolate(const B& basis, C&& coeff, const F& f)
    \n-
    295{
    \n-
    296 interpolate (basis, coeff, f, Imp::AllTrueBitSetVector(), HierarchicNodeToRangeMap());
    \n-
    297}
    \n-
    298
    \n-
    299} // namespace Functions
    \n-
    300} // namespace Dune
    \n-
    301
    \n-
    302#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH
    \n-\n-\n-\n-\n-\n-\n-
    auto istlVectorBackend(Vector &v)
    Return a vector backend wrapping non-const ISTL like containers.
    Definition: istlvectorbackend.hh:346
    \n-
    Definition: polynomial.hh:10
    \n-
    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
    \n-
    std::decay< F >::type makeGridViewFunction(F &&f, const GridView &gridView)
    Construct a function modeling GridViewFunction from function and grid view.
    Definition: gridviewfunction.hh:68
    \n-
    SizeInfo< Basis > sizeInfo(const Basis &basis)
    Definition: sizeinfo.hh:69
    \n-
    auto flatVectorView(T &t)
    Create flat vector view of passed mutable container.
    Definition: flatvectorview.hh:179
    \n-
    A simple node to range map using the nested tree indices.
    Definition: hierarchicnodetorangemap.hh:30
    \n-\n+\n+
    170 {
    \n+
    171 DUNE_THROW(NotImplemented,"not implemented");
    \n+
    172 }
    \n+
    173
    \n+
    175 friend LocalFunction localFunction(const FaceNormalGridFunction& t)
    \n+
    176 {
    \n+
    177 return LocalFunction{};
    \n+
    178 }
    \n+
    179
    \n+
    181 const EntitySet& entitySet() const
    \n+
    182 {
    \n+
    183 return entitySet_;
    \n+
    184 }
    \n+
    185
    \n+
    186private:
    \n+
    187 EntitySet entitySet_;
    \n+
    188};
    \n+
    189
    \n+
    190
    \n+
    191
    \n+
    192} // namespace Dune::Functions
    \n+
    193
    \n+
    194#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH
    \n+\n+\n+
    Definition: polynomial.hh:11
    \n+
    Default implementation for derivative traits.
    Definition: defaultderivativetraits.hh:37
    \n+
    Grid function implementing the piecewise element face normal.
    Definition: facenormalgridfunction.hh:66
    \n+
    GridViewEntitySet< GridView, 0 > EntitySet
    Definition: facenormalgridfunction.hh:69
    \n+
    typename EntitySet::LocalCoordinate LocalDomain
    Definition: facenormalgridfunction.hh:72
    \n+
    typename EntitySet::GlobalCoordinate Domain
    Definition: facenormalgridfunction.hh:73
    \n+
    typename EntitySet::GlobalCoordinate Range
    Definition: facenormalgridfunction.hh:74
    \n+
    const EntitySet & entitySet() const
    Return the stored GridViewEntitySet.
    Definition: facenormalgridfunction.hh:181
    \n+
    friend Traits::DerivativeInterface derivative(const FaceNormalGridFunction &t)
    Not implemented.
    Definition: facenormalgridfunction.hh:169
    \n+
    GV GridView
    Definition: facenormalgridfunction.hh:68
    \n+
    friend LocalFunction localFunction(const FaceNormalGridFunction &t)
    Return a local-function associated to FaceNormalGridFunction.
    Definition: facenormalgridfunction.hh:175
    \n+
    FaceNormalGridFunction(const GridView &gridView)
    Construct the FaceNormalGridFunction.
    Definition: facenormalgridfunction.hh:158
    \n+
    typename EntitySet::Element Element
    Definition: facenormalgridfunction.hh:70
    \n+
    Range operator()(const Domain &x) const
    Not implemented.
    Definition: facenormalgridfunction.hh:163
    \n+
    Definition: gridfunction.hh:32
    \n+\n+
    GridView::template Codim< codim >::Entity Element
    Type of Elements contained in this EntitySet.
    Definition: gridviewentityset.hh:32
    \n+
    Element::Geometry::LocalCoordinate LocalCoordinate
    Type of local coordinates with respect to the Element.
    Definition: gridviewentityset.hh:35
    \n+
    Element::Geometry::GlobalCoordinate GlobalCoordinate
    Definition: gridviewentityset.hh:36
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,316 +4,231 @@\n \n \n dune-functions\u00a02.9.0\n \n \n * dune\n * functions\n- * functionspacebases\n-interpolate.hh\n+ * gridfunctions\n+facenormalgridfunction.hh\n Go_to_the_documentation_of_this_file.\n 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n 2// vi: set et ts=4 sw=2 sts=2:\n- 3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH\n- 4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH\n+ 3#ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH\n+ 4#define DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH\n 5\n- 6#include \n- 7#include \n+ 6#include \n+ 7#include \n 8\n 9#include \n- 10#include \n- 11\n- 12#include \n+ 10#include \n+ 11#include \n+ 12#include \n 13\n- 14#include \n- 15#include \n+ 14#include \n+ 15#include \n 16\n- 17#include \n- 18#include \n- 19#include \n- 20#include \n- 21#include \n- 22\n- 23#include \n- 24#include \n- 25\n- 26namespace Dune {\n- 27namespace Functions {\n- 28\n- 29namespace Imp {\n- 30\n- 31struct AllTrueBitSetVector\n- 32{\n- 33 struct AllTrueBitSet\n- 34 {\n- 35 bool test(int) const { return true; }\n- 36 } allTrue_;\n- 37\n- 38 operator bool() const\n+ 17\n+ 18namespace Dune::Functions {\n+ 19\n+ 20namespace Impl {\n+ 21\n+ 22// Compute closest face to point\n+ 23template\n+ 24auto closestFaceIndex(const ReferenceElement& re, const Coordinate& x)\n+ 25{\n+ 26 auto closestFaceIndex = decltype(re.subEntity(0,1,0,1)){};\n+ 27 double closestFaceDistance = std::numeric_limits::max();\n+ 28 for(auto&& faceIndex : Dune::range(re.size(1)))\n+ 29 {\n+ 30 // For a face unit outer normal consider the orthogonal projection\n+ 31 // Px = x + *n into the face. Then the distance to the face\n+ 32 // is given by |x-Px| = |||n| = .\n+ 33 auto normal = re.integrationOuterNormal(faceIndex);\n+ 34 normal /= normal.two_norm();\n+ 35 auto c = re.position(faceIndex,1);\n+ 36 c -= x;\n+ 37 auto faceDistance = (c*normal);\n+ 38 if (faceDistance\n- 44 const AllTrueBitSetVector& operator[](const I&) const\n- 45 {\n- 46 return *this;\n- 47 }\n+ 40 closestFaceDistance = faceDistance;\n+ 41 closestFaceIndex = faceIndex;\n+ 42 }\n+ 43 }\n+ 44 return closestFaceIndex;\n+ 45}\n+ 46\n+ 47} // end namespace Impl\n 48\n- 49 template\n- 50 void resize(const SP&) const\n- 51 {}\n- 52\n- 53};\n- 54\n- 55\n- 56\n- 57template \n- 58class LocalInterpolateVisitor\n- 59 : public TypeTree::TreeVisitor\n- 60 , public TypeTree::DynamicTraversal\n- 61{\n- 62\n- 63public:\n- 64\n- 65 using Basis = B;\n- 66 using LocalView = typename B::LocalView;\n- 67 using MultiIndex = typename LocalView::MultiIndex;\n- 68\n- 69 using LocalFunction = LF;\n- 70\n- 71 using Tree = T;\n- 72\n- 73 using VectorBackend = HV;\n- 74 using BitVectorBackend = HBV;\n+ 49\n+ 50\n+ 51\n+ 64template\n+65class FaceNormalGridFunction\n+ 66{\n+ 67public:\n+68 using GridView = GV;\n+69 using EntitySet = GridViewEntitySet;\n+70 using Element = typename EntitySet::Element;\n+ 71\n+72 using LocalDomain = typename EntitySet::LocalCoordinate;\n+73 using Domain = typename EntitySet::GlobalCoordinate;\n+74 using Range = typename EntitySet::GlobalCoordinate;\n 75\n- 76 using NodeToRangeEntry = NTRE;\n+ 76private:\n 77\n- 78 using GridView = typename Basis::GridView;\n- 79 using Element = typename GridView::template Codim<0>::Entity;\n- 80\n- 81 using LocalDomain = typename Element::Geometry::LocalCoordinate;\n- 82\n- 83 using GlobalDomain = typename Element::Geometry::GlobalCoordinate;\n- 84\n- 85 LocalInterpolateVisitor(const B& /*basis*/, HV& coeff, const HBV&\n-bitVector, const LF& localF, const LocalView& localView, const\n-NodeToRangeEntry& nodeToRangeEntry) :\n- 86 vector_(coeff),\n- 87 localF_(localF),\n- 88 bitVector_(bitVector),\n- 89 localView_(localView),\n- 90 nodeToRangeEntry_(nodeToRangeEntry)\n- 91 {\n- 92 static_assert(Dune::Functions::Concept::isCallable(), \"Function passed to LocalInterpolateVisitor does not model the\n-Callable concept\");\n- 93 }\n- 94\n- 95 template\n- 96 void pre(Node&, TreePath)\n- 97 {}\n- 98\n- 99 template\n- 100 void post(Node&, TreePath)\n- 101 {}\n+ 78 using Traits = Imp::GridFunctionTraits;\n+ 79\n+ 80 class LocalFunction\n+ 81 {\n+ 82 using Geometry = typename Element::Geometry;\n+ 83 static const int dimension = GV::dimension;\n+ 84 public:\n+ 85\n+ 97 void bind(const Element& element)\n+ 98 {\n+ 99 element_ = element;\n+ 100 geometry_.emplace(element_.geometry());\n+ 101 }\n 102\n- 103 template\n- 104 void leaf(Node& node, TreePath treePath)\n- 105 {\n- 106 using FiniteElement = typename Node::FiniteElement;\n- 107 using FiniteElementRange = typename FiniteElement::Traits::\n-LocalBasisType::Traits::RangeType;\n- 108 using FiniteElementRangeField = typename FiniteElement::Traits::\n-LocalBasisType::Traits::RangeFieldType;\n- 109\n- 110 auto interpolationCoefficients = std::vector();\n- 111 auto&& fe = node.finiteElement();\n- 112\n- 113 // backward compatibility: for scalar basis functions and possibly vector\n-valued coefficients\n- 114 // (like used in dune-fufem for power bases) loop over the components\n- 115 // of the coefficients\n- 116 if constexpr ( FiniteElement::Traits::LocalBasisType::Traits::dimRange ==\n-1 )\n- 117 {\n- 118 // Note that we capture j by reference. Hence we can switch\n- 119 // the selected component later on by modifying j. Maybe we\n- 120 // should avoid this naughty statefull lambda hack in favor\n- 121 // of a separate helper class.\n- 122 std::size_t j=0;\n- 123 auto localFj = [&](const LocalDomain& x){\n- 124 const auto& y = localF_(x);\n- 125 return FiniteElementRange(flatVectorView(nodeToRangeEntry_(node, treePath,\n-y))[j]);\n- 126 };\n- 127\n- 128 // We loop over j defined above and thus over the components of the\n- 129 // range type of localF_.\n+ 103 void unbind()\n+ 104 {\n+ 105 geometry_.reset();\n+ 106 }\n+ 107\n+ 110 bool bound() const\n+ 111 {\n+ 112 return static_cast(geometry_);\n+ 113 }\n+ 114\n+ 124 Range operator()(const LocalDomain& x) const\n+ 125 {\n+ 126 auto&& re = Dune::referenceElement(*geometry_);\n+ 127 // Compute reference normal of closest face to given point\n+ 128 auto face = Impl::closestFaceIndex(re, x);\n+ 129 auto localNormal = re.integrationOuterNormal(face);\n 130\n- 131 auto blockSize = flatVectorView(vector_[localView_.index(0)]).size();\n- 132\n- 133 for(j=0; jjacobianInverseTransposed(x).mv(localNormal, normal);\n+ 135 normal /= normal.two_norm();\n+ 136 return normal;\n+ 137 }\n+ 138\n+ 140 const Element& localContext() const\n 141 {\n- 142 auto vectorBlock = flatVectorView(vector_[multiIndex]);\n- 143 vectorBlock[j] = interpolationCoefficients[i];\n- 144 }\n- 145 }\n- 146 }\n- 147 }\n- 148 else // ( FiniteElement::Traits::LocalBasisType::Traits::dimRange != 1 )\n- 149 {\n- 150 // for all other finite elements: use the FiniteElementRange directly for\n-the interpolation\n- 151 auto localF = [&](const LocalDomain& x){\n- 152 const auto& y = localF_(x);\n- 153 return FiniteElementRange(nodeToRangeEntry_(node, treePath, y));\n+ 142 return element_;\n+ 143 }\n+ 144\n+ 146 friend typename Traits::LocalFunctionTraits::DerivativeInterface\n+derivative(const LocalFunction& t)\n+ 147 {\n+ 148 DUNE_THROW(NotImplemented,\"not implemented\");\n+ 149 }\n+ 150\n+ 151 private:\n+ 152 std::optional geometry_;\n+ 153 Element element_;\n 154 };\n 155\n- 156 fe.localInterpolation().interpolate(localF, interpolationCoefficients);\n- 157 for (size_t i=0; i\n-202void interpolate(const B& basis, C&& coeff, const F& f, const BV& bv, const\n-NTRE& nodeToRangeEntry)\n- 203{\n- 204 using GridView = typename B::GridView;\n- 205 using Element = typename GridView::template Codim<0>::Entity;\n- 206\n- 207 using Tree = typename B::LocalView::Tree;\n- 208\n- 209 using GlobalDomain = typename Element::Geometry::GlobalCoordinate;\n- 210\n- 211 static_assert(Dune::Functions::Concept::isCallable(),\n-\"Function passed to interpolate does not model the Callable\n-concept\");\n- 212\n- 213 auto&& gridView = basis.gridView();\n- 214\n- 215 // Small helper functions to wrap vectors using istlVectorBackend\n- 216 // if they do not already satisfy the VectorBackend interface.\n- 217 auto toVectorBackend = [&](auto& v) -> decltype(auto) {\n- 218 if constexpr (models, decltype(v)>()) {\n- 219 return v;\n- 220 } else {\n- 221 return istlVectorBackend(v);\n- 222 }\n- 223 };\n- 224\n- 225 auto toConstVectorBackend = [&](auto& v) -> decltype(auto) {\n- 226 if constexpr (models, decltype(v)>()) {\n- 227 return v;\n- 228 } else {\n- 229 return istlVectorBackend(v);\n- 230 }\n- 231 };\n- 232\n- 233 auto&& bitVector = toConstVectorBackend(bv);\n- 234 auto&& vector = toVectorBackend(coeff);\n- 235 vector.resize(sizeInfo(basis));\n- 236\n- 237\n- 238\n- 239 // Make a grid function supporting local evaluation out of f\n- 240 auto gf = makeGridViewFunction(f, gridView);\n- 241\n- 242 // Obtain a local view of f\n- 243 auto localF = localFunction(gf);\n- 244\n- 245 auto localView = basis.localView();\n- 246\n- 247 for (const auto& e : elements(gridView))\n- 248 {\n- 249 localView.bind(e);\n- 250 localF.bind(e);\n- 251\n- 252 Imp::LocalInterpolateVisitor localInterpolateVisitor(basis, vector,\n-bitVector, localF, localView, nodeToRangeEntry);\n- 253 TypeTree::applyToTree(localView.tree(),localInterpolateVisitor);\n- 254 }\n- 255}\n- 256\n- 273template \n-274void interpolate(const B& basis, C&& coeff, const F& f, const BV& bitVector)\n- 275{\n- 276 interpolate(basis, coeff, f, bitVector, HierarchicNodeToRangeMap());\n- 277}\n- 278\n- 293template \n-294void interpolate(const B& basis, C&& coeff, const F& f)\n- 295{\n- 296 interpolate (basis, coeff, f, Imp::AllTrueBitSetVector(),\n-HierarchicNodeToRangeMap());\n- 297}\n- 298\n- 299} // namespace Functions\n- 300} // namespace Dune\n- 301\n- 302#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_INTERPOLATE_HH\n-functionconcepts.hh\n-istlvectorbackend.hh\n-gridviewfunction.hh\n-sizeinfo.hh\n-flatvectorview.hh\n-hierarchicnodetorangemap.hh\n-Dune::Functions::istlVectorBackend\n-auto istlVectorBackend(Vector &v)\n-Return a vector backend wrapping non-const ISTL like containers.\n-Definition: istlvectorbackend.hh:346\n-Dune\n-Definition: polynomial.hh:10\n-Dune::Functions::interpolate\n-void interpolate(const B &basis, C &&coeff, const F &f, const BV &bv, const\n-NTRE &nodeToRangeEntry)\n-Interpolate given function in discrete function space.\n-Definition: interpolate.hh:202\n-Dune::Functions::makeGridViewFunction\n-std::decay< F >::type makeGridViewFunction(F &&f, const GridView &gridView)\n-Construct a function modeling GridViewFunction from function and grid view.\n-Definition: gridviewfunction.hh:68\n-Dune::Functions::sizeInfo\n-SizeInfo< Basis > sizeInfo(const Basis &basis)\n-Definition: sizeinfo.hh:69\n-Dune::Functions::flatVectorView\n-auto flatVectorView(T &t)\n-Create flat vector view of passed mutable container.\n-Definition: flatvectorview.hh:179\n-Dune::Functions::HierarchicNodeToRangeMap\n-A simple node to range map using the nested tree indices.\n-Definition: hierarchicnodetorangemap.hh:30\n-concepts.hh\n+169 friend typename Traits::DerivativeInterface derivative(const\n+FaceNormalGridFunction& t)\n+ 170 {\n+ 171 DUNE_THROW(NotImplemented,\"not implemented\");\n+ 172 }\n+ 173\n+175 friend LocalFunction localFunction(const FaceNormalGridFunction& t)\n+ 176 {\n+ 177 return LocalFunction{};\n+ 178 }\n+ 179\n+181 const EntitySet& entitySet() const\n+ 182 {\n+ 183 return entitySet_;\n+ 184 }\n+ 185\n+ 186private:\n+ 187 EntitySet entitySet_;\n+ 188};\n+ 189\n+ 190\n+ 191\n+ 192} // namespace Dune::Functions\n+ 193\n+ 194#endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_FACENORMALGRIDFUNCTION_HH\n+gridfunction.hh\n+gridviewentityset.hh\n+Dune::Functions\n+Definition: polynomial.hh:11\n+Dune::Functions::DefaultDerivativeTraits\n+Default implementation for derivative traits.\n+Definition: defaultderivativetraits.hh:37\n+Dune::Functions::FaceNormalGridFunction\n+Grid function implementing the piecewise element face normal.\n+Definition: facenormalgridfunction.hh:66\n+Dune::Functions::FaceNormalGridFunction::EntitySet\n+GridViewEntitySet< GridView, 0 > EntitySet\n+Definition: facenormalgridfunction.hh:69\n+Dune::Functions::FaceNormalGridFunction::LocalDomain\n+typename EntitySet::LocalCoordinate LocalDomain\n+Definition: facenormalgridfunction.hh:72\n+Dune::Functions::FaceNormalGridFunction::Domain\n+typename EntitySet::GlobalCoordinate Domain\n+Definition: facenormalgridfunction.hh:73\n+Dune::Functions::FaceNormalGridFunction::Range\n+typename EntitySet::GlobalCoordinate Range\n+Definition: facenormalgridfunction.hh:74\n+Dune::Functions::FaceNormalGridFunction::entitySet\n+const EntitySet & entitySet() const\n+Return the stored GridViewEntitySet.\n+Definition: facenormalgridfunction.hh:181\n+Dune::Functions::FaceNormalGridFunction::derivative\n+friend Traits::DerivativeInterface derivative(const FaceNormalGridFunction &t)\n+Not implemented.\n+Definition: facenormalgridfunction.hh:169\n+Dune::Functions::FaceNormalGridFunction::GridView\n+GV GridView\n+Definition: facenormalgridfunction.hh:68\n+Dune::Functions::FaceNormalGridFunction::localFunction\n+friend LocalFunction localFunction(const FaceNormalGridFunction &t)\n+Return a local-function associated to FaceNormalGridFunction.\n+Definition: facenormalgridfunction.hh:175\n+Dune::Functions::FaceNormalGridFunction::FaceNormalGridFunction\n+FaceNormalGridFunction(const GridView &gridView)\n+Construct the FaceNormalGridFunction.\n+Definition: facenormalgridfunction.hh:158\n+Dune::Functions::FaceNormalGridFunction::Element\n+typename EntitySet::Element Element\n+Definition: facenormalgridfunction.hh:70\n+Dune::Functions::FaceNormalGridFunction::operator()\n+Range operator()(const Domain &x) const\n+Not implemented.\n+Definition: facenormalgridfunction.hh:163\n+Dune::Functions::GridFunction\n+Definition: gridfunction.hh:32\n+Dune::Functions::GridViewEntitySet<_GridView,_0_>\n+Dune::Functions::GridViewEntitySet<_GridView,_0_>::Element\n+GridView::template Codim< codim >::Entity Element\n+Type of Elements contained in this EntitySet.\n+Definition: gridviewentityset.hh:32\n+Dune::Functions::GridViewEntitySet<_GridView,_0_>::LocalCoordinate\n+Element::Geometry::LocalCoordinate LocalCoordinate\n+Type of local coordinates with respect to the Element.\n+Definition: gridviewentityset.hh:35\n+Dune::Functions::GridViewEntitySet<_GridView,_0_>::GlobalCoordinate\n+Element::Geometry::GlobalCoordinate GlobalCoordinate\n+Definition: gridviewentityset.hh:36\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a00191.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a00191.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-functions: periodicbasis.hh File Reference\n+dune-functions: discreteglobalbasisfunction.hh File Reference\n \n \n \n \n \n \n \n@@ -58,58 +58,73 @@\n \n \n \n \n \n
    \n \n-
    periodicbasis.hh File Reference
    \n+
    discreteglobalbasisfunction.hh File Reference
    \n
    \n
    \n-
    #include <utility>
    \n-#include <type_traits>
    \n-#include <limits>
    \n-#include <set>
    \n-#include <vector>
    \n-#include <dune/functions/functionspacebases/concepts.hh>
    \n-#include <dune/functions/functionspacebases/transformedindexbasis.hh>
    \n+
    #include <memory>
    \n+#include <optional>
    \n+#include <dune/common/typetraits.hh>
    \n+#include <dune/typetree/treecontainer.hh>
    \n+#include <dune/functions/functionspacebases/hierarchicnodetorangemap.hh>
    \n+#include <dune/functions/functionspacebases/flatvectorview.hh>
    \n+#include <dune/functions/gridfunctions/gridviewentityset.hh>
    \n+#include <dune/functions/gridfunctions/gridfunction.hh>
    \n+#include <dune/functions/backends/concepts.hh>
    \n+#include <dune/functions/backends/istlvectorbackend.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n

    \n Classes

    class  Dune::Functions::BasisFactory::Experimental::PeriodicIndexSet
     Container storing identified indices for a periodic basis. More...
    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...
     
    \n \n \n \n \n \n-\n-\n-\n+\n \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Functions
     
    namespace  Dune::Functions::BasisFactory
     
    namespace  Dune::Functions::BasisFactory::Experimental
    namespace  Dune::Functions::ImplDoc
     
    \n \n-\n-\n-\n-\n+\n+\n+\n+\n

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

    A scalar polynomial implementation. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -428,15 +428,15 @@\n
    \n \n

    Move-assignment operator.

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01051.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01051.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::TrigonometricFunction< K, sinFactor, cosFactor > Class Template Reference
    \n \n
    \n \n

    A linear combination of trigonomic functions. \n More...

    \n \n-

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

    \n+

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

    \n

    \n Public Member Functions

     Polynomial ()=default
     Default constructor. More...
     
     Polynomial (const Polynomial &other)=default
    \n \n \n \n \n

    \n Public Member Functions

    operator() (const K &x) const
     Evaluate function. More...
     
    \n@@ -124,15 +124,15 @@\n
    \n \n

    Evaluate function.

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01067.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01067.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::CallableFunctionWrapper< F > Class Template Reference
    \n \n
    \n \n

    Wrap a Dune::VirtualFunction into a callable object. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -194,15 +194,15 @@\n \n

    Forward operator() to F::evaluate()

    \n

    This uses the default constructor of F::RangeType

    \n \n \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01071.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01071.html", "unified_diff": "@@ -69,19 +69,19 @@\n
    Dune::Functions::InvalidRange Class Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n

    Detailed Description

    \n

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

    \n

    The documentation for this class was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01075.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01075.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::DefaultDerivativeTraits< Signature > Struct Template Reference
    \n \n
    \n \n

    Default implementation for derivative traits. \n More...

    \n \n-

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

    \n+

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

    \n

    \n Public Member Functions

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

    \n Public Types

    typedef InvalidRange Range
     Range of derivative for function with given signature. More...
     
    \n@@ -104,15 +104,15 @@\n
    \n \n

    Range of derivative for function with given signature.

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01079.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01079.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::DefaultDerivativeTraits< double(double) > Struct Reference
    \n \n
    \n \n

    Default implementation for derivative traits. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n

    \n Public Types

    typedef double Range
     Range of derivative for function with given signature. More...
     
    \n@@ -101,15 +101,15 @@\n
    \n \n

    Range of derivative for function with given signature.

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01083.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01083.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::DefaultDerivativeTraits< K(FieldVector< K, n >)> Struct Template Reference
    \n \n
    \n \n

    Default implementation for derivative traits. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n

    \n Public Types

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

    Range of derivative for function with given signature.

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01087.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01087.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::DefaultDerivativeTraits< FieldVector< K, m >(FieldVector< K, n >)> Struct Template Reference
    \n \n
    \n \n

    Default implementation for derivative traits. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n

    \n Public Types

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

    Range of derivative for function with given signature.

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01091.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01091.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::DefaultDerivativeTraits< FieldMatrix< K, 1, m >(FieldVector< K, n >)> Struct Template Reference
    \n \n
    \n \n

    Default implementation for derivative traits. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n

    \n Public Types

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

    Range of derivative for function with given signature.

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01095.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01095.html", "unified_diff": "@@ -66,17 +66,17 @@\n \n \n
    \n
    Dune::Functions::DifferentiableFunction< Signature, DerivativeTraits, bufferSize > Class Template Reference
    \n
    \n
    \n \n-

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

    \n+

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

    \n
    The documentation for this class was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01103.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01103.html", "unified_diff": "@@ -73,15 +73,15 @@\n
    Dune::Functions::DifferentiableFunction< Range(Domain), DerivativeTraits, bufferSize > Class Template Reference
    \n \n
    \n \n

    Class storing differentiable functions using type erasure. \n More...

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::DifferentiableFunction< Range(Domain), DerivativeTraits, bufferSize >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -224,15 +224,15 @@\n
    \n \n

    Evaluation of wrapped function.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01127.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01127.html", "unified_diff": "@@ -75,15 +75,15 @@\n
    \"Inheritance
    \n \n \"\"\n \"\"\n \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01131.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01131.html", "unified_diff": "@@ -74,15 +74,15 @@\n
    Dune::Functions::DifferentiableFunctionFromCallables< Range(Domain), DerivativeTraits, F > Class Template Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -255,15 +255,15 @@\n
    \n \n

    Evaluate function.

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01135.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01135.html", "unified_diff": "@@ -74,15 +74,15 @@\n
    Dune::Functions::DifferentiableFunctionFromCallables< Range(Domain), DerivativeTraits, F, DF, Derivatives... > Class Template Reference
    \n \n

    \n Public Types

    using Signature = Range(Domain)
     Signature of function. More...
     
    using RawSignature = typename SignatureTraits< Signature >::RawSignature
    \n \n \n \n \n \n@@ -263,15 +263,15 @@\n
    \n \n

    Evaluate function.

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01139.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01139.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::Concept::Callable< Args > Struct Template Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n

    \n Public Types

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

    \n Public Member Functions

    template<class F >
    auto require (F &&f) -> decltype(f(std::declval< Args >()...))
     
    \n@@ -113,15 +113,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01143.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01143.html", "unified_diff": "@@ -66,15 +66,15 @@\n \n \n
    \n
    Dune::Functions::Concept::Function< Signature > Struct Template Reference
    \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01147.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01147.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::Concept::Function< Range(Domain)> Struct Template Reference
    \n \n
    \n \n

    Concept for a function mapping Domain to Range. \n More...

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::Concept::Function< Range(Domain)>:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -123,15 +123,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01151.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01151.html", "unified_diff": "@@ -66,15 +66,15 @@\n \n \n
    \n
    Dune::Functions::Concept::DifferentiableFunction< Signature, DerivativeTraits > Struct Template Reference
    \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01155.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01155.html", "unified_diff": "@@ -73,15 +73,15 @@\n
    Dune::Functions::Concept::DifferentiableFunction< Range(Domain), DerivativeTraits > Struct Template Reference
    \n \n
    \n \n

    Concept for a differentiable function mapping Domain to Range. \n More...

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::Concept::DifferentiableFunction< Range(Domain), DerivativeTraits >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -148,15 +148,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01159.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01159.html", "unified_diff": "@@ -66,15 +66,15 @@\n \n \n
    \n
    Dune::Functions::Concept::LocalFunction< Signature, LocalContext > Struct Template Reference
    \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01163.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01163.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::Concept::LocalFunction< Range(Domain), LocalContext > Struct Template Reference
    \n \n
    \n \n

    Concept for a local function mapping Domain to Range. \n More...

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::Concept::LocalFunction< Range(Domain), LocalContext >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -124,15 +124,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01167.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01167.html", "unified_diff": "@@ -66,15 +66,15 @@\n \n \n
    \n
    Dune::Functions::Concept::DifferentiableLocalFunction< Signature, LocalContext, DerivativeTraits > Struct Template Reference
    \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01171.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01171.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::Concept::DifferentiableLocalFunction< Range(Domain), LocalContext, DerivativeTraits > Struct Template Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::Concept::DifferentiableLocalFunction< Range(Domain), LocalContext, DerivativeTraits >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -126,15 +126,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01175.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01175.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::Concept::EntitySet Struct Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n

    \n Public Member Functions

    template<class E >
    auto require (E &&f) -> decltype(requireType< typename E::Element >(), requireType< typename E::LocalCoordinate >(), requireType< typename E::GlobalCoordinate >())
     
    \n@@ -105,15 +105,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01179.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01179.html", "unified_diff": "@@ -66,15 +66,15 @@\n \n \n
    \n
    Dune::Functions::Concept::GridFunction< Signature, EntitySet > Struct Template Reference
    \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01183.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01183.html", "unified_diff": "@@ -73,15 +73,15 @@\n
    Dune::Functions::Concept::GridFunction< Range(Domain), EntitySet > Struct Template Reference
    \n \n
    \n \n

    Concept for a grid function mapping Domain to Range. \n More...

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::Concept::GridFunction< Range(Domain), EntitySet >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -165,15 +165,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01187.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01187.html", "unified_diff": "@@ -66,15 +66,15 @@\n \n \n
    \n
    Dune::Functions::Concept::DifferentiableGridFunction< Signature, EntitySet, DerivativeTraits > Struct Template Reference
    \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01191.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01191.html", "unified_diff": "@@ -73,15 +73,15 @@\n
    Dune::Functions::Concept::DifferentiableGridFunction< Range(Domain), EntitySet, DerivativeTraits > Struct Template Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::Concept::DifferentiableGridFunction< Range(Domain), EntitySet, DerivativeTraits >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -188,15 +188,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01195.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01195.html", "unified_diff": "@@ -66,15 +66,15 @@\n \n \n
    \n
    Dune::Functions::Concept::GridViewFunction< Signature, GridView > Struct Template Reference
    \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01199.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01199.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::Concept::GridViewFunction< Range(Domain), GridView > Struct Template Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::Concept::GridViewFunction< Range(Domain), GridView >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -125,15 +125,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01203.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01203.html", "unified_diff": "@@ -66,15 +66,15 @@\n \n \n
    \n
    Dune::Functions::Concept::DifferentiableGridViewFunction< Signature, GridView, DerivativeTraits > Struct Template Reference
    \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01207.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01207.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::Concept::DifferentiableGridViewFunction< Range(Domain), GridView, DerivativeTraits > Struct Template Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::Concept::DifferentiableGridViewFunction< Range(Domain), GridView, DerivativeTraits >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -126,15 +126,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01211.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01211.html", "unified_diff": "@@ -66,15 +66,15 @@\n \n \n
    \n
    Dune::Functions::FunctionFromCallable< Signature, F, FunctionInterface > Class Template Reference
    \n
    \n
    \n
    The documentation for this class was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01215.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01215.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::FunctionFromCallable< Range(Domain), F, FunctionInterface > Class Template Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::FunctionFromCallable< Range(Domain), F, FunctionInterface >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -226,15 +226,15 @@\n \n

    Evaluate function.

    \n

    This call is passed to the function

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01239.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01239.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::PolymorphicType< Interface > Class Template Referenceabstract
    \n \n
    \n \n

    Base class with polymorphic type boiler plate code. \n More...

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::PolymorphicType< Interface >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -234,15 +234,15 @@\n \n

    Move object into buffer.

    \n

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

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01243.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01243.html", "unified_diff": "@@ -66,17 +66,17 @@\n \n \n
    \n
    Dune::Functions::LocalFunction< Signature, LocalContext, DerivativeTraits, bufferSize > Class Template Reference
    \n
    \n
    \n \n-

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

    \n+

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

    \n
    The documentation for this class was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01251.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01251.html", "unified_diff": "@@ -73,15 +73,15 @@\n
    Dune::Functions::LocalFunction< Range(Domain), LocalContext, DerivativeTraits, bufferSize > Class Template Reference
    \n \n
    \n \n

    Class storing local functions using type erasure. \n More...

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::LocalFunction< Range(Domain), LocalContext, DerivativeTraits, bufferSize >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -352,15 +352,15 @@\n
    \n \n

    Unbind from local context.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01263.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01263.html", "unified_diff": "@@ -74,15 +74,15 @@\n
    Dune::Functions::StaticMultiIndex< size_type, n > Class Template Reference
    \n \n
    \n \n

    A statically sized MultiIndex type. \n More...

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::StaticMultiIndex< size_type, n >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -188,15 +188,15 @@\n
    \n \n

    STL member.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01267.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01267.html", "unified_diff": "@@ -75,15 +75,15 @@\n
    Dune::Functions::StaticMultiIndex< size_type, 1 > Class Template Reference
    \n \n
    \n \n

    A statically sized MultiIndex type. \n More...

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::StaticMultiIndex< size_type, 1 >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -251,15 +251,15 @@\n
    \n \n

    STL member.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01271.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01271.html", "unified_diff": "@@ -66,26 +66,26 @@\n \n \n
    \n
    std::tuple_size< Dune::Functions::StaticMultiIndex< size_type, n > > Struct Template Reference
    \n
    \n
    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for std::tuple_size< Dune::Functions::StaticMultiIndex< size_type, n > >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01275.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01275.html", "unified_diff": "@@ -75,15 +75,15 @@\n
    Dune::Functions::OverflowArray< BA, maxSize > Class Template Reference
    \n \n
    \n \n

    A dynamically sized array-like class with overflow. \n More...

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::OverflowArray< BA, maxSize >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -1059,15 +1059,15 @@\n
    \n \n

    Write container to an output stream.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01279.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01279.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::PolymorphicSmallObject< Base, bufferSize > Class Template Reference
    \n \n
    \n \n

    A wrapper providing small object optimization with polymorphic types. \n More...

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::PolymorphicSmallObject< Base, bufferSize >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -479,15 +479,15 @@\n
    \n \n

    Move assignment from other PolymorphicSmallObject.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01283.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01283.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::ReservedDeque< T, n > Class Template Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -1025,15 +1025,15 @@\n
    \n \n

    Send ReservedDeque to an output stream.

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01287.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01287.html", "unified_diff": "@@ -72,15 +72,15 @@\n \n

    Helper class to check that F is callable. \n More...

    \n

    Detailed Description

    \n
    template<typename F>
    \n struct Dune::Functions::IsCallable< F >

    Helper class to check that F is callable.

    \n

    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01291.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01291.html", "unified_diff": "@@ -69,20 +69,20 @@\n
    Dune::Functions::SignatureTraits< Signature, isCallable > Struct Template Reference
    \n \n
    \n \n

    Helper class to deduce the signature of a callable. \n More...

    \n \n-

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

    \n+

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

    \n

    Detailed Description

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

    Helper class to deduce the signature of a callable.

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01295.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01295.html", "unified_diff": "@@ -66,15 +66,15 @@\n \n \n
    \n
    Dune::Functions::SignatureTag< Signature, DerivativeTraits > Struct Template Reference
    \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01299.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01299.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::SignatureTag< Range(Domain), DerivativeTraitsT > Struct Template Reference
    \n \n
    \n \n

    Tag-class to encapsulate signature information. \n More...

    \n \n-

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

    \n+

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

    \n

    \n Public Types

    typedef T value_type
     The type of object, T, stored in the vector. More...
     
    \n \n \n \n \n \n@@ -129,15 +129,15 @@\n \n

    \n Public Types

    using Signature = Range(Domain)
     
    template<class T >
    using DerivativeTraits = DerivativeTraitsT< T >
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01311.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01311.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::UniformNodeVisitor< SimpleNodeVisitorImp, leafOnly > Struct Template Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::UniformNodeVisitor< SimpleNodeVisitorImp, leafOnly >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -236,15 +236,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01315.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01315.html", "unified_diff": "@@ -77,15 +77,15 @@\n
    Dune::Functions::TreeData< T, ND, LO > Class Template Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -564,15 +564,15 @@\n \n

    \n Classes

    struct  CopyVisitor
     
    struct  DestroyVisitor
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01319.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01319.html", "unified_diff": "@@ -70,15 +70,15 @@\n Public Member Functions |\n Public Attributes |\n List of all members \n
    Dune::Functions::TreeData< T, ND, LO >::InitVisitor Struct Reference
    \n \n
    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::TreeData< T, ND, LO >::InitVisitor:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -299,15 +299,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01323.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01323.html", "unified_diff": "@@ -70,15 +70,15 @@\n Public Member Functions |\n Public Attributes |\n List of all members \n
    Dune::Functions::TreeData< T, ND, LO >::DestroyVisitor Struct Reference
    \n \n
    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::TreeData< T, ND, LO >::DestroyVisitor:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -299,15 +299,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01327.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01327.html", "unified_diff": "@@ -70,15 +70,15 @@\n Public Member Functions |\n Public Attributes |\n List of all members \n
    Dune::Functions::TreeData< T, ND, LO >::CopyVisitor Struct Reference
    \n \n
    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::TreeData< T, ND, LO >::CopyVisitor:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -327,15 +327,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01331.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01331.html", "unified_diff": "@@ -69,15 +69,15 @@\n
    Dune::Functions::HasStaticSize< T > Struct Template Reference
    \n \n
    \n \n

    Check if type is a statically sized container. \n More...

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::HasStaticSize< T >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -85,15 +85,15 @@\n \n
    \n

    Detailed Description

    \n
    template<class T>
    \n struct Dune::Functions::HasStaticSize< T >

    Check if type is a statically sized container.

    \n

    Derives from std::true_type or std::false_type

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01335.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01335.html", "unified_diff": "@@ -69,15 +69,15 @@\n
    Dune::Functions::StaticSize< T > Struct Template Reference
    \n \n
    \n \n

    Obtain size of statically sized container. \n More...

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::StaticSize< T >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -85,15 +85,15 @@\n \n
    \n

    Detailed Description

    \n
    template<class T>
    \n struct Dune::Functions::StaticSize< T >

    Obtain size of statically sized container.

    \n

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

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01351.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01351.html", "unified_diff": "@@ -73,15 +73,15 @@\n
    Dune::Functions::TypeErasureBase< Interface, Implementation, bufferSize > Class Template Reference
    \n \n
    \n \n

    Base class for type-erased interface wrapper. \n More...

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::TypeErasureBase< Interface, Implementation, bufferSize >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -293,15 +293,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01383.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01383.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::LastType< T > Struct Template Reference
    \n \n
    \n \n

    Get last entry of type list. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n

    \n Public Types

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

    Detailed Description

    \n@@ -100,15 +100,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01395.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01395.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::RotateTuple< T > Struct Template Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n \n \n \n \n

    \n Public Types

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

    Detailed Description

    \n@@ -101,15 +101,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01411.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01411.html", "unified_diff": "@@ -69,15 +69,15 @@\n \n
    Dune::Functions::Concept::IndexMergingStrategy Struct Reference
    \n \n
    \n \n-

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

    \n+

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

    \n \n \n \n \n \n

    \n Public Member Functions

    template<typename T >
    auto require (T &&t) -> decltype(registerIndexMergingStrategy(t))
     
    \n@@ -99,15 +99,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01415.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01415.html", "unified_diff": "@@ -69,15 +69,15 @@\n
    Dune::Functions::BasisFactory::IndexMergingStrategy Struct Reference
    \n \n
    \n \n

    Base class for index merging strategies to simplify detection. \n More...

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::BasisFactory::IndexMergingStrategy:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -85,15 +85,15 @@\n \"\"\n \"\"\n \n
    \n

    Detailed Description

    \n

    Base class for index merging strategies to simplify detection.

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01419.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01419.html", "unified_diff": "@@ -69,15 +69,15 @@\n
    Dune::Functions::BasisFactory::FlatLexicographic Struct Reference
    \n \n
    \n \n

    Lexicographic merging of direct children without blocking. \n More...

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::BasisFactory::FlatLexicographic:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -120,15 +120,15 @@\n g_0 (2,k0) \n \n g_1 (3,k1) \n \n g_2 (4,k2) \n \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01423.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01423.html", "unified_diff": "@@ -69,15 +69,15 @@\n
    Dune::Functions::BasisFactory::FlatInterleaved Struct Reference
    \n \n
    \n \n

    Interleaved merging of direct children without blocking. \n More...

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::BasisFactory::FlatInterleaved:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -120,15 +120,15 @@\n g_1 (3,i1) \n \n f_2 (4,i2) \n \n g_2 (5,i2) \n \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01427.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01427.html", "unified_diff": "@@ -69,15 +69,15 @@\n
    Dune::Functions::BasisFactory::BlockedLexicographic Struct Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::BasisFactory::BlockedLexicographic:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -120,15 +120,15 @@\n g_0 (1,k0) \n \n g_1 (1,k1) \n \n g_2 (1,k2) \n \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01431.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01431.html", "unified_diff": "@@ -69,15 +69,15 @@\n
    Dune::Functions::BasisFactory::BlockedInterleaved Struct Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::BasisFactory::BlockedInterleaved:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -120,15 +120,15 @@\n g_1 (i1,1) \n \n f_2 (i2,0) \n \n g_2 (i2,1) \n \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01467.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01467.html", "unified_diff": "@@ -72,15 +72,15 @@\n Protected Member Functions |\n Protected Attributes |\n List of all members \n
    Dune::Functions::BrezziDouglasMariniNode< GV, k > Class Template Reference
    \n \n
    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::BrezziDouglasMariniNode< GV, k >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -573,15 +573,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01471.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01471.html", "unified_diff": "@@ -72,15 +72,15 @@\n Static Public Attributes |\n Protected Attributes |\n List of all members \n
    Dune::Functions::BrezziDouglasMariniPreBasis< GV, k > Class Template Reference
    \n \n
    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -657,15 +657,15 @@\n \n

    \n Public Types

    using GridView = GV
     The grid view that the FE space is defined on. More...
     
    using size_type = std::size_t
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01475.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01475.html", "unified_diff": "@@ -75,15 +75,15 @@\n
    Dune::Functions::BSplineLocalFiniteElement< GV, R > Class Template Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::BSplineLocalFiniteElement< GV, R >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -551,15 +551,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01479.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01479.html", "unified_diff": "@@ -77,15 +77,15 @@\n
    Dune::Functions::BSplinePreBasis< GV > Class Template Reference
    \n \n
    \n \n

    Pre-basis for B-spline basis. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -1276,15 +1276,15 @@\n
    \n \n

    Order of the B-spline for each space dimension.

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01483.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01483.html", "unified_diff": "@@ -74,15 +74,15 @@\n
    Dune::Functions::BSplineLocalBasis< GV, R > Class Template Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::BSplineLocalBasis< GV, R >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -415,15 +415,15 @@\n \n

    \n Public Types

    using GridView = GV
     The grid view that the FE space is defined on. More...
     
    using size_type = std::size_t
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01487.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01487.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::BSplineLocalCoefficients< dim > Class Template Reference
    \n \n
    \n \n

    Attaches a shape function to an entity. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -185,15 +185,15 @@\n
    \n \n

    number of coefficients

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01491.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01491.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::BSplineLocalInterpolation< dim, LB > Class Template Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::BSplineLocalInterpolation< dim, LB >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -138,15 +138,15 @@\n
    \n \n

    Local interpolation of a function.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01495.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01495.html", "unified_diff": "@@ -72,15 +72,15 @@\n Protected Member Functions |\n Protected Attributes |\n List of all members\n
    Dune::Functions::BSplineNode< GV > Class Template Reference
    \n \n
    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::BSplineNode< GV >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -555,15 +555,15 @@\n \n

    \n Public Member Functions

    void init (const std::array< unsigned, dim > &sizes)
     
    std::size_t size () const
     number of coefficients More...
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01503.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01503.html", "unified_diff": "@@ -76,15 +76,15 @@\n
    Dune::Functions::CompositePreBasis< IMS, SPB > Class Template Reference
    \n \n
    \n \n

    A pre-basis for composite bases. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -821,15 +821,15 @@\n \n

    \n Public Types

    using SubPreBases = std::tuple< SPB... >
     Tuple of child pre-bases. More...
     
    template<std::size_t i>
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01555.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01555.html", "unified_diff": "@@ -74,15 +74,15 @@\n
    Dune::Functions::DefaultGlobalBasis< PB > Class Template Reference
    \n \n
    \n \n

    Global basis for given pre-basis. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -725,15 +725,15 @@\n \n

    \n Public Types

    using PreBasis = PB
     Pre-basis providing the implementation details. More...
     
    using PrefixPath = TypeTree::HybridTreePath<>
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01559.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01559.html", "unified_diff": "@@ -75,15 +75,15 @@\n
    Dune::Functions::DefaultLocalView< GB > Class Template Reference
    \n \n
    \n \n

    The restriction of a finite element basis to a single element. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -773,15 +773,15 @@\n \n

    \n Public Types

    using GlobalBasis = GB
     The global FE basis that this is a view on. More...
     
    using GridView = typename GlobalBasis::GridView
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01563.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01563.html", "unified_diff": "@@ -74,15 +74,15 @@\n
    Dune::Functions::DefaultNodeToRangeMap< Tree > Struct Template Reference
    \n \n
    \n \n

    A simple node to range map using lexicographic ordering. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n

    \n Classes

    struct  Visitor
     
    \n \n

    \n@@ -253,15 +253,15 @@\n

    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01567.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01567.html", "unified_diff": "@@ -70,15 +70,15 @@\n Public Member Functions |\n Public Attributes |\n List of all members \n
    Dune::Functions::DefaultNodeToRangeMap< Tree >::Visitor Struct Reference
    \n \n
    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::DefaultNodeToRangeMap< Tree >::Visitor:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -201,15 +201,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01619.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01619.html", "unified_diff": "@@ -72,15 +72,15 @@\n Protected Member Functions |\n Protected Attributes |\n List of all members \n
    Dune::Functions::HierarchicalLagrangeNode< GV, k, R > Class Template Reference
    \n \n
    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::HierarchicalLagrangeNode< GV, k, R >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -557,15 +557,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01623.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01623.html", "unified_diff": "@@ -76,15 +76,15 @@\n
    Dune::Functions::HierarchicalLagrangePreBasis< GV, k, R > Class Template Reference
    \n \n
    \n \n

    A pre-basis for a hierarchical basis. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -670,15 +670,15 @@\n \n

    \n Public Types

    using GridView = GV
     The grid view that the FE basis is defined on. More...
     
    using size_type = std::size_t
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01627.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01627.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::HierarchicNodeToRangeMap Struct Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -177,15 +177,15 @@\n \n

    \n 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>
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01647.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01647.html", "unified_diff": "@@ -74,15 +74,15 @@\n
    Dune::Functions::HierarchicVectorWrapper< V, CO > Class Template Reference
    \n \n
    \n \n

    A wrapper providing multiindex access to vector entries. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -390,15 +390,15 @@\n \n

    \n Public Types

    using Vector = V
     
    template<class MultiIndex >
    using Entry = Coefficient< MultiIndex >
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01667.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01667.html", "unified_diff": "@@ -73,15 +73,15 @@\n Protected Member Functions |\n Protected Attributes |\n List of all members \n
    Dune::Functions::LagrangeNode< GV, k, R > Class Template Reference
    \n \n
    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::LagrangeNode< GV, k, R >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -646,15 +646,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01671.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01671.html", "unified_diff": "@@ -76,15 +76,15 @@\n
    Dune::Functions::LagrangePreBasis< GV, k, R > Class Template Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::LagrangePreBasis< GV, k, R >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -1290,15 +1290,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01679.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01679.html", "unified_diff": "@@ -72,15 +72,15 @@\n Static Public Attributes |\n Protected Attributes |\n List of all members \n
    Dune::Functions::LagrangeDGPreBasis< GV, k > Class Template Reference
    \n \n
    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -893,15 +893,15 @@\n \n

    \n Public Types

    using GridView = GV
     The grid view that the FE space is defined on. More...
     
    using size_type = std::size_t
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01687.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01687.html", "unified_diff": "@@ -72,15 +72,15 @@\n Protected Member Functions |\n Protected Attributes |\n List of all members \n
    Dune::Functions::NedelecNode< GV, Range, kind, order > Class Template Reference
    \n \n
    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::NedelecNode< GV, Range, kind, order >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -573,15 +573,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01691.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01691.html", "unified_diff": "@@ -72,15 +72,15 @@\n Static Public Attributes |\n Protected Attributes |\n List of all members \n
    Dune::Functions::NedelecPreBasis< GV, Range, kind, order > Class Template Reference
    \n \n
    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -629,15 +629,15 @@\n \n

    \n Public Types

    using GridView = GV
     The grid view that the FE space is defined on. More...
     
    using size_type = std::size_t
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01707.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01707.html", "unified_diff": "@@ -71,15 +71,15 @@\n Public Member Functions |\n Protected Member Functions |\n List of all members \n
    Dune::Functions::BasisNodeMixin Class Reference
    \n \n
    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::BasisNodeMixin:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -344,15 +344,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01711.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01711.html", "unified_diff": "@@ -71,15 +71,15 @@\n Public Member Functions |\n Protected Member Functions |\n List of all members \n
    Dune::Functions::LeafBasisNode Class Reference
    \n \n
    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::LeafBasisNode:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -319,15 +319,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01715.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01715.html", "unified_diff": "@@ -71,15 +71,15 @@\n Public Member Functions |\n Protected Member Functions |\n List of all members \n
    Dune::Functions::PowerBasisNode< T, n > Class Template Reference
    \n \n
    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::PowerBasisNode< T, n >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -421,15 +421,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01719.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01719.html", "unified_diff": "@@ -71,15 +71,15 @@\n Public Member Functions |\n Protected Member Functions |\n List of all members \n
    Dune::Functions::CompositeBasisNode< T > Class Template Reference
    \n \n
    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::CompositeBasisNode< T >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -454,15 +454,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01723.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01723.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::BasisFactory::Experimental::PeriodicIndexSet Class Reference
    \n \n
    \n \n

    Container storing identified indices for a periodic basis. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -151,15 +151,15 @@\n \n

    Insert a pair of indices.

    \n

    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.

    \n \n \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01735.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01735.html", "unified_diff": "@@ -74,15 +74,15 @@\n
    Dune::Functions::PowerPreBasis< IMS, SPB, C > Class Template Reference
    \n \n
    \n \n

    A pre-basis for power bases. \n More...

    \n \n-

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

    \n+

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

    \n

    \n Public Member Functions

    void unifyIndexPair (std::size_t a, std::size_t b)
     Insert a pair of indices. More...
     
    const auto & indexPairSet () const
    \n \n \n \n \n \n@@ -711,15 +711,15 @@\n \n

    \n Public Types

    using SubPreBasis = SPB
     The child pre-basis. More...
     
    using GridView = typename SPB::GridView
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01739.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01739.html", "unified_diff": "@@ -72,15 +72,15 @@\n Protected Member Functions |\n Protected Attributes |\n List of all members \n
    Dune::Functions::RannacherTurekNode< GV > Class Template Reference
    \n \n
    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::RannacherTurekNode< GV >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -528,15 +528,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01743.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01743.html", "unified_diff": "@@ -75,15 +75,15 @@\n
    Dune::Functions::RannacherTurekPreBasis< GV > Class Template Reference
    \n \n
    \n \n

    Pre-basis for a Rannacher-Turek basis. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -608,15 +608,15 @@\n \n

    \n Public Types

    using GridView = GV
     The grid view that the FE basis is defined on. More...
     
    using size_type = std::size_t
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01791.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01791.html", "unified_diff": "@@ -72,15 +72,15 @@\n Protected Member Functions |\n Protected Attributes |\n List of all members \n
    Dune::Functions::RaviartThomasNode< GV, k > Class Template Reference
    \n \n
    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::RaviartThomasNode< GV, k >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -573,15 +573,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01795.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01795.html", "unified_diff": "@@ -72,15 +72,15 @@\n Static Public Attributes |\n Protected Attributes |\n List of all members \n
    Dune::Functions::RaviartThomasPreBasis< GV, k > Class Template Reference
    \n \n
    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -657,15 +657,15 @@\n \n

    \n Public Types

    using GridView = GV
     The grid view that the FE space is defined on. More...
     
    using size_type = std::size_t
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01799.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01799.html", "unified_diff": "@@ -74,15 +74,15 @@\n
    Dune::Functions::SizeInfo< B > Class Template Reference
    \n \n
    \n \n

    A class encapsulating size information. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -304,15 +304,15 @@\n \n

    \n Public Types

    using Basis = B
     
    using size_type = typename Basis::size_type
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01803.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01803.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::SubEntityDOFs< GridView > Class Template Reference
    \n \n
    \n \n

    Range of DOFs associated to sub-entity. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -370,15 +370,15 @@\n
    \n \n

    Return number of contained DOFs.

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01807.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01807.html", "unified_diff": "@@ -71,15 +71,15 @@\n Public Member Functions |\n Protected Attributes |\n List of all members\n
    Dune::Functions::SubspaceBasis< RB, TP > Class Template Reference
    \n \n

    \n 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. More...
     
    \n \n \n \n \n \n@@ -599,15 +599,15 @@\n \n

    \n Public Types

    using RootBasis = RB
     
    using RootLocalView = typename RootBasis::LocalView
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01811.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01811.html", "unified_diff": "@@ -74,15 +74,15 @@\n
    Dune::Functions::SubspaceLocalView< RLV, PP > Class Template Reference
    \n \n
    \n \n

    The restriction of a finite element basis to a single element. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -682,15 +682,15 @@\n \n

    \n Public Types

    using RootLocalView = RLV
     
    using GlobalBasis = SubspaceBasis< typename RootLocalView::GlobalBasis, PrefixPath >
     The global FE basis that this is a view on. More...
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01815.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01815.html", "unified_diff": "@@ -71,15 +71,15 @@\n Public Member Functions |\n Protected Member Functions |\n List of all members \n
    Dune::Functions::TaylorHoodVelocityTree< GV > Class Template Reference
    \n \n
    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::TaylorHoodVelocityTree< GV >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -396,15 +396,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01819.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01819.html", "unified_diff": "@@ -71,15 +71,15 @@\n Public Member Functions |\n Protected Member Functions |\n List of all members \n
    Dune::Functions::TaylorHoodBasisTree< GV > Class Template Reference
    \n \n
    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::TaylorHoodBasisTree< GV >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -395,15 +395,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01823.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01823.html", "unified_diff": "@@ -77,15 +77,15 @@\n
    Dune::Functions::TaylorHoodPreBasis< GV, HI > Class Template Reference
    \n \n
    \n \n

    Pre-basis for lowest order Taylor-Hood basis. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -805,15 +805,15 @@\n \n

    \n Public Types

    using GridView = GV
     The grid view that the FE basis is defined on. More...
     
    using size_type = std::size_t
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01827.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01827.html", "unified_diff": "@@ -75,15 +75,15 @@\n
    Dune::Functions::Experimental::TransformedIndexPreBasis< RPB, T > Class Template Reference
    \n \n
    \n \n

    A pre-basis transforming multi-indices. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -772,15 +772,15 @@\n \n

    \n Public Types

    using RawPreBasis = RPB
     
    using GridView = typename RawPreBasis::GridView
     The grid view that the FE basis is defined on. More...
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01831.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01831.html", "unified_diff": "@@ -73,15 +73,15 @@\n
    Dune::Functions::BasisFactory::Experimental::GenericIndexingTransformation< IndexTransformation, SizeImplementation, minIS, maxIS > Class Template Reference
    \n \n
    \n \n

    A generic implementation of a transformation. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -313,15 +313,15 @@\n \n

    \n Public Member Functions

    template<class IT_R , class SI_R >
     GenericIndexingTransformation (IT_R &&indexTransformation, SI_R &&sizeImplementation)
     
    template<class MultiIndex , class PreBasis >
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01843.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01843.html", "unified_diff": "@@ -79,15 +79,15 @@\n \n template<class F , class GridView > \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)\n  Create an AnalyticGridViewFunction from a function and a grid view. More...
    \n  \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01847.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01847.html", "unified_diff": "@@ -74,15 +74,15 @@\n
    Dune::Functions::AnalyticGridViewFunction< Range(Domain), GV, F, DerivativeTraits > Class Template Reference
    \n \n
    \n \n

    Class wrapping any differentiable function as grid function. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -486,15 +486,15 @@\n
    \n \n

    Construct the associated local-function.

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01851.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01851.html", "unified_diff": "@@ -78,15 +78,15 @@\n
    Dune::Functions::ComposedGridFunction< OF, IF > Class Template Reference
    \n \n
    \n \n

    Composition of grid functions with another function. \n More...

    \n \n-

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

    \n+

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

    \n

    \n Public Types

    using Signature = Range(Domain)
     
    using RawSignature = typename SignatureTraits< Signature >::RawSignature
     
    \n \n \n \n \n \n@@ -483,15 +483,15 @@\n \n

    \n Public Types

    using EntitySet = typename InnerFunction< 0 >::EntitySet
     
    using Element = typename EntitySet::Element
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01859.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01859.html", "unified_diff": "@@ -73,15 +73,15 @@\n Protected Member Functions |\n Protected Attributes |\n List of all members \n
    Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE > Class Template Reference
    \n \n
    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -475,15 +475,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01863.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01863.html", "unified_diff": "@@ -69,15 +69,15 @@\n \n
    Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >::Data Struct Reference
    \n \n
    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -148,15 +148,15 @@\n \n

    \n Public Attributes

    EntitySet entitySet
     
    std::shared_ptr< const Basisbasis
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01867.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01867.html", "unified_diff": "@@ -72,15 +72,15 @@\n Protected Member Functions |\n Protected Attributes |\n List of all members \n
    Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >::LocalFunctionBase Class Reference
    \n \n
    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase< B, V, NTRE >::LocalFunctionBase:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -535,15 +535,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01871.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01871.html", "unified_diff": "@@ -76,15 +76,15 @@\n
    Dune::Functions::DiscreteGlobalBasisFunctionDerivative< DGBF > Class Template Reference
    \n \n
    \n \n

    Derivative of a DiscreteGlobalBasisFunction \n More...

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::DiscreteGlobalBasisFunctionDerivative< DGBF >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -673,15 +673,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01875.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01875.html", "unified_diff": "@@ -77,15 +77,15 @@\n
    Dune::Functions::DiscreteGlobalBasisFunction< B, V, NTRE, R > Class Template Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::DiscreteGlobalBasisFunction< B, V, NTRE, R >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -742,15 +742,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01879.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01879.html", "unified_diff": "@@ -73,15 +73,15 @@\n Protected Attributes |\n Friends |\n List of all members \n
    Dune::Functions::DiscreteGlobalBasisFunction< B, V, NTRE, R >::LocalFunction Class Reference
    \n \n
    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::DiscreteGlobalBasisFunction< B, V, NTRE, R >::LocalFunction:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -577,15 +577,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01883.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01883.html", "unified_diff": "@@ -76,15 +76,15 @@\n
    Dune::Functions::DiscreteGlobalBasisFunctionDerivative< DGBF >::LocalFunction Class Reference
    \n \n
    \n \n

    local function evaluating the derivative in reference coordinates \n More...

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::DiscreteGlobalBasisFunctionDerivative< DGBF >::LocalFunction:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -585,15 +585,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01887.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01887.html", "unified_diff": "@@ -75,15 +75,15 @@\n
    Dune::Functions::FaceNormalGridFunction< GV > Class Template Reference
    \n \n
    \n \n

    Grid function implementing the piecewise element face normal. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -373,15 +373,15 @@\n
    \n \n

    Return a local-function associated to FaceNormalGridFunction.

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01895.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01895.html", "unified_diff": "@@ -66,27 +66,27 @@\n \n \n
    \n
    Dune::Functions::GridFunction< Signature, EntitySet, DerivativeTraits, bufferSize > Class Template Reference
    \n
    \n
    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::GridFunction< Signature, EntitySet, DerivativeTraits, bufferSize >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n \"\"\n \n
    \n
    The documentation for this class was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01903.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01903.html", "unified_diff": "@@ -73,15 +73,15 @@\n
    Dune::Functions::GridFunction< Range(Domain), ES, DerivativeTraits, bufferSize > Class Template Reference
    \n \n
    \n \n

    Wrapper class for functions defined on a Grid. \n More...

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::GridFunction< Range(Domain), ES, DerivativeTraits, bufferSize >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -317,15 +317,15 @@\n

    Get local function of wrapped function.

    \n

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

    \n

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

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01919.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01919.html", "unified_diff": "@@ -73,15 +73,15 @@\n
    Dune::Functions::GridViewEntitySet< GV, cd > Class Template Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::GridViewEntitySet< GV, cd >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -453,15 +453,15 @@\n
    \n \n

    Return number of Elements visited by an iterator.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01923.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01923.html", "unified_diff": "@@ -66,17 +66,17 @@\n \n \n
    \n
    Dune::Functions::GridViewFunction< Signature, GridView, DerivativeTraits, bufferSize > Class Template Reference
    \n
    \n
    \n \n-

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

    \n+

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

    \n
    The documentation for this class was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01927.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01927.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::Functions::GridViewFunction< Range(Domain), GV, DerivativeTraits, bufferSize > Class Template Reference
    \n \n
    \n \n

    Wrapper class for functions defined on a GridView. \n More...

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::Functions::GridViewFunction< Range(Domain), GV, DerivativeTraits, bufferSize >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -120,15 +120,15 @@\n \n

    \n Public Types

    using GridView = GV
     
    using EntitySet = GridViewEntitySet< GridView, 0 >
     
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01931.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01931.html", "unified_diff": "@@ -73,15 +73,15 @@\n
    Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits > Struct Template Reference
    \n \n
    \n \n

    Derivative traits for local functions. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -128,15 +128,15 @@\n \n

    \n Classes

    struct  Traits
     
    struct  Traits< R(LocalDomain)>
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01935.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01935.html", "unified_diff": "@@ -69,15 +69,15 @@\n \n
    Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits >::Traits< Signature > Struct Template Reference
    \n \n
    \n \n-

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

    \n+

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

    \n \n \n \n \n

    \n Public Types

    typedef InvalidRange Range
     
    \n

    Member Typedef Documentation

    \n@@ -96,15 +96,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a01939.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a01939.html", "unified_diff": "@@ -69,15 +69,15 @@\n \n
    Dune::Functions::LocalDerivativeTraits< EntitySet, DerivativeTraits >::Traits< R(LocalDomain)> Struct Template Reference
    \n \n
    \n \n-

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

    \n+

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

    \n \n \n \n \n

    \n Public Types

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

    Member Typedef Documentation

    \n@@ -96,15 +96,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a02876.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a02876.html", "unified_diff": "@@ -70,16 +70,16 @@\n Classes |\n Namespaces \n
    functionspacebases/concepts.hh File Reference
    \n \n
    \n
    #include <dune/common/concept.hh>
    \n #include <dune/common/reservedvector.hh>
    \n-#include <dune/functions/common/utility.hh>
    \n-#include <dune/functions/functionspacebases/nodes.hh>
    \n+#include <dune/functions/common/utility.hh>
    \n+#include <dune/functions/functionspacebases/nodes.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/a02876_source.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/a02876_source.html", "unified_diff": "@@ -74,17 +74,17 @@\n
    3#ifndef DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CONCEPTS_HH
    \n
    4#define DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CONCEPTS_HH
    \n
    5
    \n
    6
    \n
    7#include <dune/common/concept.hh>
    \n
    8#include <dune/common/reservedvector.hh>
    \n
    9
    \n-\n+\n
    11
    \n-\n+\n
    13
    \n
    14
    \n
    15namespace Dune {
    \n
    16namespace Functions {
    \n
    17namespace Concept {
    \n
    18
    \n
    19using namespace Dune::Concept;
    \n@@ -285,16 +285,16 @@\n
    214
    \n
    215} // namespace Dune::Functions::Concept
    \n
    216} // namespace Dune::Functions
    \n
    217} // namespace Dune
    \n
    218
    \n
    219
    \n
    220#endif // DUNE_FUNCTIONS_FUNCTIONSPACEBASES_CONCEPTS_HH
    \n-\n-\n+\n+\n
    Definition: polynomial.hh:10
    \n
    Definition: functionspacebases/concepts.hh:23
    \n
    auto require(C &&c) -> decltype(c.resize(0))
    \n
    Definition: functionspacebases/concepts.hh:33
    \n
    auto require(C &&c) -> decltype(c.size())
    \n
    Definition: functionspacebases/concepts.hh:43
    \n
    auto require(C &&c, I &&i) -> decltype(c[i])
    \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/dir_000001_000002.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/dir_000001_000002.html", "unified_diff": "@@ -62,14 +62,14 @@\n \n \n \n
    \n-

    backends → common Relation

    \n Classes

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

    backends → common Relation

    File in dune/functions/backendsIncludes file in dune/functions/common
    istlvectorbackend.hhindexaccess.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/dir_000001_000007.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/dir_000001_000007.html", "unified_diff": "@@ -62,14 +62,14 @@\n \n \n \n
    \n-

    backends → functionspacebases Relation

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

    backends → functionspacebases Relation

    File in dune/functions/backendsIncludes file in dune/functions/functionspacebases
    istlvectorbackend.hhfunctionspacebases/concepts.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/dir_000002_000007.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/dir_000002_000007.html", "unified_diff": "@@ -62,14 +62,14 @@\n \n \n \n
    \n-

    common → functionspacebases Relation

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

    common → functionspacebases Relation

    File in dune/functions/commonIncludes file in dune/functions/functionspacebases
    staticforloop.hhfunctionspacebases/concepts.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/dir_000002_000008.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/dir_000002_000008.html", "unified_diff": "@@ -62,14 +62,14 @@\n \n \n \n
    \n-

    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
    \n+

    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
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/dir_000007_000001.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/dir_000007_000001.html", "unified_diff": "@@ -62,14 +62,14 @@\n \n \n \n
    \n-

    functionspacebases → backends Relation

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

    functionspacebases → backends Relation

    File in dune/functions/functionspacebasesIncludes file in dune/functions/backends
    interpolate.hhbackends/concepts.hh
    interpolate.hhistlvectorbackend.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/dir_000007_000002.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/dir_000007_000002.html", "unified_diff": "@@ -62,14 +62,14 @@\n \n \n \n \n+

    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
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/dir_000007_000008.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/dir_000007_000008.html", "unified_diff": "@@ -62,14 +62,14 @@\n \n \n \n
    \n-

    functionspacebases → gridfunctions Relation

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

    functionspacebases → gridfunctions Relation

    File in dune/functions/functionspacebasesIncludes file in dune/functions/gridfunctions
    interpolate.hhgridviewfunction.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/dir_000008_000001.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/dir_000008_000001.html", "unified_diff": "@@ -62,14 +62,14 @@\n \n \n \n
    \n-

    gridfunctions → backends Relation

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

    gridfunctions → backends Relation

    File in dune/functions/gridfunctionsIncludes file in dune/functions/backends
    discreteglobalbasisfunction.hhbackends/concepts.hh
    discreteglobalbasisfunction.hhistlvectorbackend.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/dir_000008_000002.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/dir_000008_000002.html", "unified_diff": "@@ -62,14 +62,14 @@\n \n \n \n \n+

    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
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/dir_000008_000007.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/dir_000008_000007.html", "unified_diff": "@@ -62,14 +62,14 @@\n \n \n \n
    \n-

    gridfunctions → functionspacebases Relation

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

    gridfunctions → functionspacebases Relation

    File in dune/functions/gridfunctionsIncludes file in dune/functions/functionspacebases
    discreteglobalbasisfunction.hhflatvectorview.hh
    discreteglobalbasisfunction.hhhierarchicnodetorangemap.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/dir_14cf9ce796563c596e9b8f0f574fe0cc.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/dir_14cf9ce796563c596e9b8f0f574fe0cc.html", "unified_diff": "@@ -81,58 +81,58 @@\n \"\"\n \"\"\n \n \n \n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n-\n+\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n

    \n Files

    file  callable.hh [code]
    file  callable.hh [code]
     
    file  defaultderivativetraits.hh [code]
    file  defaultderivativetraits.hh [code]
     
    file  differentiablefunction.hh [code]
    file  differentiablefunction.hh [code]
     
    file  differentiablefunction_imp.hh [code]
    file  differentiablefunction_imp.hh [code]
     
    file  differentiablefunctionfromcallables.hh [code]
    file  differentiablefunctionfromcallables.hh [code]
     
    file  functionconcepts.hh [code]
    file  functionconcepts.hh [code]
     
    file  functionfromcallable.hh [code]
    file  functionfromcallable.hh [code]
     
    file  indexaccess.hh [code]
    file  indexaccess.hh [code]
     
    file  interfaces.hh [code]
    file  interfaces.hh [code]
     
    file  localfunction.hh [code]
    file  localfunction.hh [code]
     
    file  localfunction_imp.hh [code]
    file  localfunction_imp.hh [code]
     
    file  multiindex.hh [code]
    file  multiindex.hh [code]
     
    file  overflowarray.hh [code]
    file  overflowarray.hh [code]
     
    file  polymorphicsmallobject.hh [code]
    file  polymorphicsmallobject.hh [code]
     
    file  referencehelper.hh [code]
    file  referencehelper.hh [code]
     
    file  reserveddeque.hh [code]
     An stl-compliant double-ended queue which stores everything on the stack.
    file  reserveddeque.hh [code]
     An stl-compliant double-ended queue which stores everything on the stack.
     
    file  signature.hh [code]
    file  signature.hh [code]
     
    file  staticforloop.hh [code]
    file  staticforloop.hh [code]
     
    file  treedata.hh [code]
    file  treedata.hh [code]
     
    file  type_traits.hh [code]
    file  type_traits.hh [code]
     
    file  typeerasure.hh [code]
    file  typeerasure.hh [code]
     
    file  utility.hh [code]
    file  utility.hh [code]
     
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/dir_55b300d561fb400353f8dbad76da65d6.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/dir_55b300d561fb400353f8dbad76da65d6.html", "unified_diff": "@@ -83,31 +83,31 @@\n \"\"\n \"\"\n \n \n \n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n

    \n Files

    file  analyticgridviewfunction.hh [code]
    file  analyticgridviewfunction.hh [code]
     
    file  composedgridfunction.hh [code]
    file  composedgridfunction.hh [code]
     
    file  discreteglobalbasisfunction.hh [code]
    file  discreteglobalbasisfunction.hh [code]
     
    file  facenormalgridfunction.hh [code]
    file  facenormalgridfunction.hh [code]
     
    file  gridfunction.hh [code]
    file  gridfunction.hh [code]
     
    file  gridfunction_imp.hh [code]
    file  gridfunction_imp.hh [code]
     
    file  gridviewentityset.hh [code]
    file  gridviewentityset.hh [code]
     
    file  gridviewfunction.hh [code]
    file  gridviewfunction.hh [code]
     
    file  localderivativetraits.hh [code]
    file  localderivativetraits.hh [code]
     
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/dir_8457ebf380090bd61e5d3eab5b7eb9a1.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/dir_8457ebf380090bd61e5d3eab5b7eb9a1.html", "unified_diff": "@@ -83,15 +83,15 @@\n \n \n \n \n \n \n-\n+\n \n

    \n Files

    file  backends/concepts.hh [code]
     
    file  istlvectorbackend.hh [code]
    file  istlvectorbackend.hh [code]
     
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/dir_a2250aba7ee066a4c694d7c3cf43d078.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/dir_a2250aba7ee066a4c694d7c3cf43d078.html", "unified_diff": "@@ -83,74 +83,74 @@\n \"\"\n \"\"\n \n \n \n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n-\n+\n+\n \n-\n+\n \n \n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n

    \n Files

    file  basistags.hh [code]
    file  basistags.hh [code]
     
    file  boundarydofs.hh [code]
    file  boundarydofs.hh [code]
     
    file  brezzidouglasmarinibasis.hh [code]
    file  brezzidouglasmarinibasis.hh [code]
     
    file  bsplinebasis.hh [code]
     The B-spline global function space basis.
    file  bsplinebasis.hh [code]
     The B-spline global function space basis.
     
    file  compositebasis.hh [code]
    file  compositebasis.hh [code]
     
    file  functionspacebases/concepts.hh [code]
     
    file  defaultglobalbasis.hh [code]
    file  defaultglobalbasis.hh [code]
     
    file  defaultlocalview.hh [code]
    file  defaultlocalview.hh [code]
     
    file  defaultnodetorangemap.hh [code]
    file  defaultnodetorangemap.hh [code]
     
    file  flatmultiindex.hh [code]
    file  flatmultiindex.hh [code]
     
    file  flatvectorview.hh [code]
    file  flatvectorview.hh [code]
     
    file  globalvaluedlocalfiniteelement.hh [code]
    file  globalvaluedlocalfiniteelement.hh [code]
     
    file  hierarchicallagrangebasis.hh [code]
    file  hierarchicallagrangebasis.hh [code]
     
    file  hierarchicnodetorangemap.hh [code]
    file  hierarchicnodetorangemap.hh [code]
     
    file  hierarchicvectorwrapper.hh [code]
    file  hierarchicvectorwrapper.hh [code]
     
    file  interpolate.hh [code]
    file  interpolate.hh [code]
     
    file  lagrangebasis.hh [code]
    file  lagrangebasis.hh [code]
     
    file  lagrangedgbasis.hh [code]
    file  lagrangedgbasis.hh [code]
     
    file  nedelecbasis.hh [code]
    file  nedelecbasis.hh [code]
     
    file  nodes.hh [code]
    file  nodes.hh [code]
     
    file  periodicbasis.hh [code]
    file  periodicbasis.hh [code]
     
    file  powerbasis.hh [code]
    file  powerbasis.hh [code]
     
    file  rannacherturekbasis.hh [code]
    file  rannacherturekbasis.hh [code]
     
    file  raviartthomasbasis.hh [code]
    file  raviartthomasbasis.hh [code]
     
    file  sizeinfo.hh [code]
    file  sizeinfo.hh [code]
     
    file  subentitydofs.hh [code]
    file  subentitydofs.hh [code]
     
    file  subspacebasis.hh [code]
    file  subspacebasis.hh [code]
     
    file  subspacelocalview.hh [code]
    file  subspacelocalview.hh [code]
     
    file  taylorhoodbasis.hh [code]
    file  taylorhoodbasis.hh [code]
     
    file  transformedindexbasis.hh [code]
    file  transformedindexbasis.hh [code]
     
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/dir_e22f2c69b2799e923164d7b2e4fa3f8c.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/dir_e22f2c69b2799e923164d7b2e4fa3f8c.html", "unified_diff": "@@ -77,17 +77,17 @@\n \"\"\n \"\"\n \n \n \n \n-\n+\n \n-\n+\n \n

    \n Files

    file  polynomial.hh [code]
    file  polynomial.hh [code]
     
    file  trigonometricfunction.hh [code]
    file  trigonometricfunction.hh [code]
     
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/dune-functions.tag.gz", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/dune-functions.tag.gz", "unified_diff": null, "details": [{"source1": "dune-functions.tag", "source2": "dune-functions.tag", "unified_diff": null, "details": [{"source1": "dune-functions.tag", "source2": "dune-functions.tag", "unified_diff": "@@ -4,70 +4,39 @@\n mainpage.md\n /build/reproducible-path/dune-functions-2.9.0/doc/doxygen/\n a00197.html\n \n \n polynomial.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/analyticfunctions/\n- a00071.html\n+ a00161.html\n Dune::Functions::Polynomial\n Dune\n Dune::Functions\n \n \n trigonometricfunction.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/analyticfunctions/\n- a00068.html\n+ a00164.html\n Dune::Functions::TrigonometricFunction\n Dune\n Dune::Functions\n \n TrigonometricFunction< K, -cosFactor, sinFactor >\n derivative\n a00209.html\n ga7ec424ff4be740ad675bd85750940472\n (const TrigonometricFunction< K, sinFactor, cosFactor > &f)\n \n \n \n- backends/concepts.hh\n- /build/reproducible-path/dune-functions-2.9.0/dune/functions/backends/\n- a02873.html\n- Dune::Functions::Concept::ConstVectorBackend\n- Dune::Functions::Concept::VectorBackend\n- Dune\n- Dune::Functions\n- Dune::Functions::Concept\n- \n- \n- functionspacebases/concepts.hh\n- /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a02876.html\n- dune/functions/common/utility.hh\n- dune/functions/functionspacebases/nodes.hh\n- Dune::Functions::Concept::HasResize\n- Dune::Functions::Concept::HasSizeMethod\n- Dune::Functions::Concept::HasIndexAccess\n- Dune::Functions::Concept::BasisNode\n- Dune::Functions::Concept::LeafBasisNode\n- Dune::Functions::Concept::PowerBasisNode\n- Dune::Functions::Concept::CompositeBasisNode\n- Dune::Functions::Concept::BasisTree\n- Dune::Functions::Concept::PreBasis\n- Dune::Functions::Concept::LocalView\n- Dune::Functions::Concept::GlobalBasis\n- Dune\n- Dune::Functions\n- Dune::Functions::Concept\n- \n- \n istlvectorbackend.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/backends/\n- a00074.html\n- dune/functions/common/indexaccess.hh\n+ a00158.html\n+ dune/functions/common/indexaccess.hh\n dune/functions/functionspacebases/concepts.hh\n Dune\n Dune::Functions\n \n constexpr auto\n fieldTypes\n a00219.html\n@@ -95,15 +64,15 @@\n ga50a181637103e7abc011235a9fd30611\n (const Vector &v)\n \n \n \n callable.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/\n- a00056.html\n+ a00023.html\n Dune::Functions::CallableFunctionWrapper\n Dune\n Dune::Functions\n \n CallableFunctionWrapper< F >\n callable\n a00209.html\n@@ -117,54 +86,54 @@\n ga5831245ed303c2103ab06af079cb8cf9\n (const std::shared_ptr< F > &fp)\n \n \n \n defaultderivativetraits.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/\n- a00029.html\n+ a00035.html\n Dune::Functions::InvalidRange\n Dune::Functions::DefaultDerivativeTraits\n Dune::Functions::DefaultDerivativeTraits< double(double) >\n Dune::Functions::DefaultDerivativeTraits< K(FieldVector< K, n >)>\n Dune::Functions::DefaultDerivativeTraits< FieldVector< K, m >(FieldVector< K, n >)>\n Dune::Functions::DefaultDerivativeTraits< FieldMatrix< K, 1, m >(FieldVector< K, n >)>\n Dune\n Dune::Functions\n \n \n differentiablefunction.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/\n- a00050.html\n- dune/functions/common/type_traits.hh\n- dune/functions/common/defaultderivativetraits.hh\n- dune/functions/common/differentiablefunction_imp.hh\n- dune/functions/common/signature.hh\n- dune/functions/common/typeerasure.hh\n- dune/functions/common/functionconcepts.hh\n+ a00038.html\n+ dune/functions/common/type_traits.hh\n+ dune/functions/common/defaultderivativetraits.hh\n+ dune/functions/common/differentiablefunction_imp.hh\n+ dune/functions/common/signature.hh\n+ dune/functions/common/typeerasure.hh\n+ dune/functions/common/functionconcepts.hh\n Dune::Functions::DifferentiableFunction\n Dune::Functions::DifferentiableFunction< Range(Domain), DerivativeTraits, bufferSize >\n Dune\n Dune::Functions\n \n \n differentiablefunction_imp.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/\n- a00008.html\n- dune/functions/common/type_traits.hh\n+ a00020.html\n+ dune/functions/common/type_traits.hh\n Dune\n Dune::Functions\n \n \n differentiablefunctionfromcallables.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/\n- a00011.html\n- dune/functions/common/signature.hh\n- dune/functions/common/differentiablefunction.hh\n- dune/functions/common/functionconcepts.hh\n+ a00014.html\n+ dune/functions/common/signature.hh\n+ dune/functions/common/differentiablefunction.hh\n+ dune/functions/common/functionconcepts.hh\n Dune::Functions::DifferentiableFunctionFromCallables< Range(Domain), DerivativeTraits, F >\n Dune::Functions::DifferentiableFunctionFromCallables< Range(Domain), DerivativeTraits, F, DF, Derivatives... >\n Dune\n Dune::Functions\n \n DifferentiableFunctionFromCallables< Signature, DerivativeTraits, F... >\n makeDifferentiableFunctionFromCallables\n@@ -172,18 +141,18 @@\n gad3bb1b3fe74c7f750a3980f4c0ce0449\n (const SignatureTag< Signature, DerivativeTraits > &signatureTag, F &&... f)\n \n \n \n functionconcepts.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/\n- a00026.html\n- dune/functions/common/signature.hh\n- dune/functions/gridfunctions/localderivativetraits.hh\n- dune/functions/gridfunctions/gridviewentityset.hh\n+ a00005.html\n+ dune/functions/common/signature.hh\n+ dune/functions/gridfunctions/localderivativetraits.hh\n+ dune/functions/gridfunctions/gridviewentityset.hh\n Dune::Functions::Concept::Callable\n Dune::Functions::Concept::Function< Range(Domain)>\n Dune::Functions::Concept::DifferentiableFunction< Range(Domain), DerivativeTraits >\n Dune::Functions::Concept::LocalFunction< Range(Domain), LocalContext >\n Dune::Functions::Concept::DifferentiableLocalFunction< Range(Domain), LocalContext, DerivativeTraits >\n Dune::Functions::Concept::EntitySet\n Dune::Functions::Concept::GridFunction< Range(Domain), EntitySet >\n@@ -284,25 +253,25 @@\n ga5fe279401b9387533b85b085d6d521cc\n ()\n \n \n \n functionfromcallable.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/\n- a00041.html\n- dune/functions/common/signature.hh\n+ a00059.html\n+ dune/functions/common/signature.hh\n Dune::Functions::FunctionFromCallable< Range(Domain), F, FunctionInterface >\n Dune\n Dune::Functions\n \n \n indexaccess.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/\n- a00017.html\n- dune/functions/common/utility.hh\n+ a00032.html\n+ dune/functions/common/utility.hh\n Dune\n Dune::Functions\n \n auto\n hybridIndexAccess\n a00215.html\n ga2226fe3a86eb176df27c9801a98a10ae\n@@ -343,46 +312,46 @@\n ga4cc6af2842348271c242c048e0411637\n (C &&c, const MultiIndex &multiIndex)\n \n \n \n interfaces.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/\n- a00047.html\n+ a00053.html\n Dune::Functions::PolymorphicType\n Dune\n Dune::Functions\n \n \n localfunction.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/\n- a00062.html\n- dune/functions/common/defaultderivativetraits.hh\n- dune/functions/common/differentiablefunction.hh\n- dune/functions/common/localfunction_imp.hh\n- dune/functions/common/typeerasure.hh\n- dune/functions/common/functionconcepts.hh\n+ a00002.html\n+ dune/functions/common/defaultderivativetraits.hh\n+ dune/functions/common/differentiablefunction.hh\n+ dune/functions/common/localfunction_imp.hh\n+ dune/functions/common/typeerasure.hh\n+ dune/functions/common/functionconcepts.hh\n Dune::Functions::LocalFunction\n Dune::Functions::LocalFunction< Range(Domain), LocalContext, DerivativeTraits, bufferSize >\n Dune\n Dune::Functions\n \n \n localfunction_imp.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/\n- a00023.html\n- dune/functions/common/type_traits.hh\n- dune/functions/common/differentiablefunction_imp.hh\n+ a00011.html\n+ dune/functions/common/type_traits.hh\n+ dune/functions/common/differentiablefunction_imp.hh\n Dune\n Dune::Functions\n \n \n multiindex.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/\n- a00059.html\n+ a00056.html\n Dune::Functions::StaticMultiIndex\n Dune::Functions::StaticMultiIndex< size_type, 1 >\n std::tuple_size< Dune::Functions::StaticMultiIndex< size_type, n > >\n Dune\n Dune::Functions\n \n Stream &\n@@ -391,31 +360,31 @@\n af1c4bfbe0c688f745e4731c519db55dd\n (Stream &stream, const StaticMultiIndex< size_type, n > &c)\n \n \n \n overflowarray.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/\n- a00038.html\n+ a00065.html\n Dune::Functions::OverflowArray\n Dune\n Dune::Functions\n \n \n polymorphicsmallobject.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/\n- a00035.html\n+ a00062.html\n Dune::Functions::PolymorphicSmallObject\n Dune\n Dune::Functions\n \n \n referencehelper.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/\n- a00032.html\n+ a00008.html\n Dune\n Dune::Functions\n \n Dune::ResolveRef_t< T >\n ResolveRef_t\n a00219.html\n a51755a2fa6d9e5737a8e2b32cbe3cc15\n@@ -435,31 +404,31 @@\n a432dd9531e141b59ba6b90a6104f2cb7\n \n \n \n \n reserveddeque.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/\n- a00065.html\n+ a00026.html\n Dune::Functions::ReservedDeque\n Dune\n Dune::Functions\n \n #define\n CHECKSIZE\n- a00065.html\n+ a00026.html\n a65543e75bc949ecdb95a25b1f4e11675\n (X)\n \n \n \n signature.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/\n- a00020.html\n- dune/functions/common/defaultderivativetraits.hh\n+ a00017.html\n+ dune/functions/common/defaultderivativetraits.hh\n Dune::Functions::SignatureTraits\n Dune::Functions::SignatureTag< Range(Domain), DerivativeTraitsT >\n Dune\n Dune::Functions\n \n auto\n derivativeSignatureTag\n@@ -474,45 +443,45 @@\n ga95d38d90c6b8ee6d3a2a0202cb80b56d\n (Dune::Functions::SignatureTag< Signature, DerivativeTraits > tag)\n \n \n \n staticforloop.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/\n- a00014.html\n- dune/functions/common/type_traits.hh\n+ a00050.html\n+ dune/functions/common/type_traits.hh\n dune/functions/functionspacebases/concepts.hh\n Dune\n Dune::Functions\n \n void\n staticFindInRange\n a00215.html\n gaa625ea93bc3285b8a09c9267302386ec\n (F &&f, Args &&... args)\n \n \n \n treedata.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/\n- a00053.html\n- dune/functions/gridfunctions/gridviewentityset.hh\n- dune/functions/gridfunctions/gridfunction.hh\n+ a00041.html\n+ dune/functions/gridfunctions/gridviewentityset.hh\n+ dune/functions/gridfunctions/gridfunction.hh\n Dune::Functions::UniformNodeVisitor\n Dune::Functions::TreeData\n Dune::Functions::TreeData::InitVisitor\n Dune::Functions::TreeData::DestroyVisitor\n Dune::Functions::TreeData::CopyVisitor\n Dune\n Dune::Functions\n \n \n type_traits.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/\n- a00005.html\n+ a00044.html\n Dune::Functions::HasStaticSize\n Dune::Functions::StaticSize\n Dune\n Dune::Functions\n \n typename std::enable_if< std::is_constructible< T, Args... >::value, int >::type\n enableIfConstructible\n@@ -520,27 +489,27 @@\n ga673247dd74bcdd9e5acfc7735faf8a5b\n \n \n \n \n typeerasure.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/\n- a00002.html\n- dune/functions/common/type_traits.hh\n- dune/functions/common/interfaces.hh\n- dune/functions/common/polymorphicsmallobject.hh\n+ a00029.html\n+ dune/functions/common/type_traits.hh\n+ dune/functions/common/interfaces.hh\n+ dune/functions/common/polymorphicsmallobject.hh\n Dune::Functions::TypeErasureBase\n Dune\n Dune::Functions\n \n \n utility.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/common/\n- a00044.html\n- dune/functions/common/functionconcepts.hh\n+ a00047.html\n+ dune/functions/common/functionconcepts.hh\n Dune::Functions::LastType\n Dune::Functions::RotateTuple\n Dune\n Dune::Functions\n \n typename Imp::ExpandTupleHelper< T, ArgTuple >::Type\n ExpandTuple\n@@ -618,15 +587,15 @@\n a6bb3a351c2ab1b4eb46d4ba1ec3d95a0\n (T &&t)\n \n \n \n basistags.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00161.html\n+ a00092.html\n Dune::Functions::Concept::IndexMergingStrategy\n Dune::Functions::BasisFactory::IndexMergingStrategy\n Dune::Functions::BasisFactory::FlatLexicographic\n Dune::Functions::BasisFactory::FlatInterleaved\n Dune::Functions::BasisFactory::BlockedLexicographic\n Dune::Functions::BasisFactory::BlockedInterleaved\n Dune\n@@ -683,33 +652,33 @@\n ga649b67336300e9f05e38b5479ca21a24\n ()\n \n \n \n boundarydofs.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00116.html\n- dune/functions/functionspacebases/subentitydofs.hh\n+ a00074.html\n+ dune/functions/functionspacebases/subentitydofs.hh\n Dune\n Dune::Functions\n \n void\n forEachBoundaryDOF\n a00214.html\n gaa60b94e3da01aa62a555f6955a7f09e5\n (const Basis &basis, F &&f)\n \n \n \n brezzidouglasmarinibasis.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00146.html\n- dune/functions/functionspacebases/globalvaluedlocalfiniteelement.hh\n- dune/functions/functionspacebases/nodes.hh\n- dune/functions/functionspacebases/defaultglobalbasis.hh\n+ a00098.html\n+ dune/functions/functionspacebases/globalvaluedlocalfiniteelement.hh\n+ dune/functions/functionspacebases/nodes.hh\n+ dune/functions/functionspacebases/defaultglobalbasis.hh\n Dune::Functions::BrezziDouglasMariniPreBasis\n Dune::Functions::BrezziDouglasMariniNode\n Dune\n Dune::Functions\n Dune::Functions::BasisFactory\n \n DefaultGlobalBasis< BrezziDouglasMariniPreBasis< GV, k > >\n@@ -725,17 +694,17 @@\n ga72847f418332ba3d5444a7f153776610\n ()\n \n \n \n bsplinebasis.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00167.html\n- dune/functions/functionspacebases/nodes.hh\n- dune/functions/functionspacebases/defaultglobalbasis.hh\n+ a00083.html\n+ dune/functions/functionspacebases/nodes.hh\n+ dune/functions/functionspacebases/defaultglobalbasis.hh\n Dune::Functions::BSplineLocalBasis\n Dune::Functions::BSplineLocalCoefficients\n Dune::Functions::BSplineLocalInterpolation\n Dune::Functions::BSplineLocalFiniteElement\n Dune::Functions::BSplinePreBasis\n Dune::Functions::BSplineNode\n Dune\n@@ -755,41 +724,72 @@\n ga63a9701af71fffbbb851a38cb8cf886f\n (const std::vector< double > &knotVector, unsigned int order, bool makeOpen=true)\n \n \n \n compositebasis.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00107.html\n- dune/functions/common/staticforloop.hh\n- dune/functions/common/type_traits.hh\n- dune/functions/common/utility.hh\n- dune/functions/functionspacebases/basistags.hh\n- dune/functions/functionspacebases/nodes.hh\n+ a00125.html\n+ dune/functions/common/staticforloop.hh\n+ dune/functions/common/type_traits.hh\n+ dune/functions/common/utility.hh\n+ dune/functions/functionspacebases/basistags.hh\n+ dune/functions/functionspacebases/nodes.hh\n dune/functions/functionspacebases/concepts.hh\n- dune/functions/functionspacebases/defaultglobalbasis.hh\n+ dune/functions/functionspacebases/defaultglobalbasis.hh\n Dune::Functions::CompositePreBasis\n Dune\n Dune::Functions\n Dune::Functions::BasisFactory\n Dune::Functions::BasisBuilder\n \n auto\n composite\n a00213.html\n ga0ee62f9744ec8ba58fdfc4c68df34449\n (Args &&... args)\n \n \n \n+ backends/concepts.hh\n+ /build/reproducible-path/dune-functions-2.9.0/dune/functions/backends/\n+ a02873.html\n+ Dune::Functions::Concept::ConstVectorBackend\n+ Dune::Functions::Concept::VectorBackend\n+ Dune\n+ Dune::Functions\n+ Dune::Functions::Concept\n+ \n+ \n+ functionspacebases/concepts.hh\n+ /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n+ a02876.html\n+ dune/functions/common/utility.hh\n+ dune/functions/functionspacebases/nodes.hh\n+ Dune::Functions::Concept::HasResize\n+ Dune::Functions::Concept::HasSizeMethod\n+ Dune::Functions::Concept::HasIndexAccess\n+ Dune::Functions::Concept::BasisNode\n+ Dune::Functions::Concept::LeafBasisNode\n+ Dune::Functions::Concept::PowerBasisNode\n+ Dune::Functions::Concept::CompositeBasisNode\n+ Dune::Functions::Concept::BasisTree\n+ Dune::Functions::Concept::PreBasis\n+ Dune::Functions::Concept::LocalView\n+ Dune::Functions::Concept::GlobalBasis\n+ Dune\n+ Dune::Functions\n+ Dune::Functions::Concept\n+ \n+ \n defaultglobalbasis.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00128.html\n- dune/functions/common/type_traits.hh\n- dune/functions/functionspacebases/defaultlocalview.hh\n+ a00149.html\n+ dune/functions/common/type_traits.hh\n+ dune/functions/functionspacebases/defaultlocalview.hh\n dune/functions/functionspacebases/concepts.hh\n Dune::Functions::DefaultGlobalBasis\n Dune\n Dune::Functions\n Dune::Functions::BasisFactory\n Dune::Functions::BasisBuilder\n \n@@ -813,26 +813,26 @@\n a1f0dc55c03c3a9862c76456d5574abe2\n (const GridView &gridView, PreBasisFactory &&preBasisFactory)\n \n \n \n defaultlocalview.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00131.html\n- dune/functions/common/overflowarray.hh\n- dune/functions/common/multiindex.hh\n+ a00143.html\n+ dune/functions/common/overflowarray.hh\n+ dune/functions/common/multiindex.hh\n dune/functions/functionspacebases/concepts.hh\n Dune::Functions::DefaultLocalView\n Dune\n Dune::Functions\n \n \n defaultnodetorangemap.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00170.html\n+ a00068.html\n dune/functions/functionspacebases/concepts.hh\n Dune::Functions::DefaultNodeToRangeMap\n Dune::Functions::DefaultNodeToRangeMap::Visitor\n Dune\n Dune::Functions\n \n DefaultNodeToRangeMap< Tree >\n@@ -848,30 +848,30 @@\n ad5971c4cc40d4d8a400ef5fe9e596350\n (const Basis &basis, TreePath &&treePath) -> decltype(makeDefaultNodeToRangeMap(TypeTree::child(basis.localView().tree(), treePath)))\n \n \n \n flatmultiindex.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00113.html\n- dune/functions/common/multiindex.hh\n+ a00122.html\n+ dune/functions/common/multiindex.hh\n Dune\n Dune::Functions\n \n StaticMultiIndex< size_type, 1 >\n FlatMultiIndex\n a00214.html\n ga6b523ca86bfec2581ea9c173a722f8f3\n \n \n \n \n flatvectorview.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00140.html\n+ a00095.html\n dune/functions/functionspacebases/concepts.hh\n Dune\n Dune::Functions\n \n auto\n flatVectorView\n a00219.html\n@@ -892,24 +892,24 @@\n a4fac6802f21000f59e52aade3cd47b08\n (T &&t)\n \n \n \n globalvaluedlocalfiniteelement.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00173.html\n+ a00155.html\n Dune\n Dune::Functions\n \n \n hierarchicallagrangebasis.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00119.html\n- dune/functions/functionspacebases/nodes.hh\n- dune/functions/functionspacebases/defaultglobalbasis.hh\n+ a00128.html\n+ dune/functions/functionspacebases/nodes.hh\n+ dune/functions/functionspacebases/defaultglobalbasis.hh\n Dune::Functions::HierarchicalLagrangePreBasis\n Dune::Functions::HierarchicalLagrangeNode\n Dune\n Dune::Functions\n Dune::Functions::BasisFactory\n \n DefaultGlobalBasis< HierarchicalLagrangePreBasis< GV, k, R > >\n@@ -925,28 +925,28 @@\n gae1668779c06b647fd909294cbedf28cf\n ()\n \n \n \n hierarchicnodetorangemap.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00185.html\n+ a00134.html\n dune/functions/functionspacebases/concepts.hh\n- dune/functions/common/indexaccess.hh\n+ dune/functions/common/indexaccess.hh\n Dune::Functions::HierarchicNodeToRangeMap\n Dune\n Dune::Functions\n \n \n hierarchicvectorwrapper.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00176.html\n- dune/functions/common/indexaccess.hh\n- dune/functions/common/utility.hh\n- dune/functions/common/type_traits.hh\n+ a00131.html\n+ dune/functions/common/indexaccess.hh\n+ dune/functions/common/utility.hh\n+ dune/functions/common/type_traits.hh\n dune/functions/functionspacebases/concepts.hh\n Dune::Functions::HierarchicVectorWrapper\n Dune\n Dune::Functions\n \n HierarchicVectorWrapper< V >\n hierarchicVector\n@@ -968,22 +968,22 @@\n ae48bf799daaf0751086b47457350675e\n (V &v)\n \n \n \n interpolate.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00188.html\n- dune/functions/gridfunctions/gridviewfunction.hh\n- dune/functions/common/functionconcepts.hh\n+ a00080.html\n+ dune/functions/gridfunctions/gridviewfunction.hh\n+ dune/functions/common/functionconcepts.hh\n dune/functions/backends/concepts.hh\n- dune/functions/backends/istlvectorbackend.hh\n- dune/functions/functionspacebases/sizeinfo.hh\n- dune/functions/functionspacebases/flatvectorview.hh\n- dune/functions/functionspacebases/hierarchicnodetorangemap.hh\n+ dune/functions/backends/istlvectorbackend.hh\n+ dune/functions/functionspacebases/sizeinfo.hh\n+ dune/functions/functionspacebases/flatvectorview.hh\n+ dune/functions/functionspacebases/hierarchicnodetorangemap.hh\n Dune\n Dune::Functions\n \n void\n interpolate\n a00219.html\n a13b0c6bf02d744e7b2078d1a535b5211\n@@ -1003,17 +1003,17 @@\n a2e34859322800ae26a292903910ef9f7\n (const B &basis, C &&coeff, const F &f)\n \n \n \n lagrangebasis.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00134.html\n- dune/functions/functionspacebases/nodes.hh\n- dune/functions/functionspacebases/defaultglobalbasis.hh\n+ a00119.html\n+ dune/functions/functionspacebases/nodes.hh\n+ dune/functions/functionspacebases/defaultglobalbasis.hh\n Dune::Functions::LagrangePreBasis\n Dune::Functions::LagrangeNode\n Dune\n Dune::Functions\n Dune::Functions::BasisFactory\n \n DefaultGlobalBasis< LagrangePreBasis< GV, k, R > >\n@@ -1036,18 +1036,18 @@\n ga177b4e1b21990d7fc9350ac0caeb3c6c\n (int order)\n \n \n \n lagrangedgbasis.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00155.html\n- dune/functions/functionspacebases/nodes.hh\n- dune/functions/functionspacebases/defaultglobalbasis.hh\n- dune/functions/functionspacebases/lagrangebasis.hh\n+ a00146.html\n+ dune/functions/functionspacebases/nodes.hh\n+ dune/functions/functionspacebases/defaultglobalbasis.hh\n+ dune/functions/functionspacebases/lagrangebasis.hh\n Dune::Functions::LagrangeDGPreBasis\n Dune\n Dune::Functions\n Dune::Functions::BasisFactory\n \n LagrangeNode< GV, k >\n LagrangeDGNode\n@@ -1069,18 +1069,18 @@\n gae7dbc0c4e48b9cf3da63d6ef431b3481\n ()\n \n \n \n nedelecbasis.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00143.html\n- dune/functions/functionspacebases/defaultglobalbasis.hh\n- dune/functions/functionspacebases/globalvaluedlocalfiniteelement.hh\n- dune/functions/functionspacebases/nodes.hh\n+ a00152.html\n+ dune/functions/functionspacebases/defaultglobalbasis.hh\n+ dune/functions/functionspacebases/globalvaluedlocalfiniteelement.hh\n+ dune/functions/functionspacebases/nodes.hh\n Dune::Functions::NedelecPreBasis\n Dune::Functions::NedelecNode\n Dune\n Dune::Functions\n Dune::Functions::BasisFactory\n \n DefaultGlobalBasis< NedelecPreBasis< GV, Range, kind, order > >\n@@ -1096,15 +1096,15 @@\n gafe0fe439067c288f197101b8686223e8\n ()\n \n \n \n nodes.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00110.html\n+ a00116.html\n Dune::Functions::BasisNodeMixin\n Dune::Functions::LeafBasisNode\n Dune::Functions::PowerBasisNode\n Dune::Functions::CompositeBasisNode\n Dune\n Dune::Functions\n \n@@ -1128,17 +1128,17 @@\n a5e19b913a34ad68144f4fd873c51b977\n (Tree &tree, std::size_t treeIndexOffset=0)\n \n \n \n periodicbasis.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00191.html\n+ a00107.html\n dune/functions/functionspacebases/concepts.hh\n- dune/functions/functionspacebases/transformedindexbasis.hh\n+ dune/functions/functionspacebases/transformedindexbasis.hh\n Dune::Functions::BasisFactory::Experimental::PeriodicIndexSet\n Dune\n Dune::Functions\n Dune::Functions::BasisFactory\n Dune::Functions::BasisFactory::Experimental\n \n auto\n@@ -1147,21 +1147,21 @@\n ga797d4c1dfcfe6b0a98de9284c4f6b5e3\n (RawPreBasisIndicator &&rawPreBasisIndicator, PIS &&periodicIndexSet)\n \n \n \n powerbasis.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00152.html\n- dune/functions/common/utility.hh\n- dune/functions/common/type_traits.hh\n- dune/functions/functionspacebases/basistags.hh\n- dune/functions/functionspacebases/nodes.hh\n+ a00086.html\n+ dune/functions/common/utility.hh\n+ dune/functions/common/type_traits.hh\n+ dune/functions/functionspacebases/basistags.hh\n+ dune/functions/functionspacebases/nodes.hh\n dune/functions/functionspacebases/concepts.hh\n- dune/functions/functionspacebases/defaultglobalbasis.hh\n+ dune/functions/functionspacebases/defaultglobalbasis.hh\n Dune::Functions::PowerPreBasis\n Dune\n Dune::Functions\n Dune::Functions::BasisFactory\n Dune::Functions::BasisBuilder\n \n auto\n@@ -1177,17 +1177,17 @@\n gab84b622cf7be16d0373640b6f0478eb0\n (ChildPreBasisFactory &&childPreBasisFactory)\n \n \n \n rannacherturekbasis.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00182.html\n- dune/functions/functionspacebases/nodes.hh\n- dune/functions/functionspacebases/defaultglobalbasis.hh\n+ a00113.html\n+ dune/functions/functionspacebases/nodes.hh\n+ dune/functions/functionspacebases/defaultglobalbasis.hh\n Dune::Functions::RannacherTurekPreBasis\n Dune::Functions::RannacherTurekNode\n Dune\n Dune::Functions\n Dune::Functions::BasisFactory\n \n DefaultGlobalBasis< RannacherTurekPreBasis< GV > >\n@@ -1203,18 +1203,18 @@\n ga366449c1a41fc29ff55fed0c1485f60b\n ()\n \n \n \n raviartthomasbasis.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00149.html\n- dune/functions/functionspacebases/globalvaluedlocalfiniteelement.hh\n- dune/functions/functionspacebases/nodes.hh\n- dune/functions/functionspacebases/defaultglobalbasis.hh\n+ a00140.html\n+ dune/functions/functionspacebases/globalvaluedlocalfiniteelement.hh\n+ dune/functions/functionspacebases/nodes.hh\n+ dune/functions/functionspacebases/defaultglobalbasis.hh\n Dune::Functions::RaviartThomasPreBasis\n Dune::Functions::RaviartThomasNode\n Dune\n Dune::Functions\n Dune::Functions::BasisFactory\n \n DefaultGlobalBasis< RaviartThomasPreBasis< GV, k > >\n@@ -1230,30 +1230,30 @@\n gac7c656af99728aa385381f5d78ae0b98\n ()\n \n \n \n sizeinfo.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00137.html\n+ a00110.html\n Dune::Functions::SizeInfo\n Dune\n Dune::Functions\n \n SizeInfo< Basis >\n sizeInfo\n a00219.html\n abd7e25a89325dbe2232b17308dae45f2\n (const Basis &basis)\n \n \n \n subentitydofs.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00164.html\n+ a00089.html\n Dune::Functions::SubEntityDOFs\n Dune\n Dune::Functions\n \n auto\n subEntityDOFs\n a00214.html\n@@ -1274,17 +1274,17 @@\n ga09ad7987f85909bfcf269a0de9c652d8\n (const LocalView &localView, const Intersection &intersection)\n \n \n \n subspacebasis.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00158.html\n- dune/functions/common/type_traits.hh\n- dune/functions/functionspacebases/subspacelocalview.hh\n+ a00104.html\n+ dune/functions/common/type_traits.hh\n+ dune/functions/functionspacebases/subspacelocalview.hh\n dune/functions/functionspacebases/concepts.hh\n Dune::Functions::SubspaceBasis\n Dune\n Dune::Functions\n \n \n SubspaceBasis\n@@ -1313,27 +1313,27 @@\n abb8781cf3fb98ca29446be66bcf65ac4\n (const RootBasis &rootBasis, const PrefixTreeIndices &... prefixTreeIndices)\n \n \n \n subspacelocalview.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00122.html\n+ a00101.html\n dune/functions/functionspacebases/concepts.hh\n Dune::Functions::SubspaceLocalView\n Dune\n Dune::Functions\n \n \n taylorhoodbasis.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00125.html\n- dune/functions/functionspacebases/nodes.hh\n- dune/functions/functionspacebases/lagrangebasis.hh\n- dune/functions/functionspacebases/defaultglobalbasis.hh\n+ a00077.html\n+ dune/functions/functionspacebases/nodes.hh\n+ dune/functions/functionspacebases/lagrangebasis.hh\n+ dune/functions/functionspacebases/defaultglobalbasis.hh\n Dune::Functions::TaylorHoodPreBasis\n Dune::Functions::TaylorHoodVelocityTree\n Dune::Functions::TaylorHoodBasisTree\n Dune\n Dune::Functions\n Dune::Functions::BasisFactory\n \n@@ -1350,22 +1350,22 @@\n ga2384fc6a8ee2005fb29adb7221609ce3\n ()\n \n \n \n transformedindexbasis.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/functionspacebases/\n- a00179.html\n- dune/functions/common/staticforloop.hh\n- dune/functions/common/type_traits.hh\n- dune/functions/common/utility.hh\n- dune/functions/functionspacebases/basistags.hh\n- dune/functions/functionspacebases/nodes.hh\n+ a00137.html\n+ dune/functions/common/staticforloop.hh\n+ dune/functions/common/type_traits.hh\n+ dune/functions/common/utility.hh\n+ dune/functions/functionspacebases/basistags.hh\n+ dune/functions/functionspacebases/nodes.hh\n dune/functions/functionspacebases/concepts.hh\n- dune/functions/functionspacebases/defaultglobalbasis.hh\n+ dune/functions/functionspacebases/defaultglobalbasis.hh\n Dune::Functions::Experimental::TransformedIndexPreBasis\n Dune::Functions::BasisFactory::Experimental::GenericIndexingTransformation\n Dune\n Dune::Functions\n Dune::Functions::Experimental\n Dune::Functions::BasisFactory\n Dune::Functions::BasisFactory::Experimental\n@@ -1390,60 +1390,60 @@\n af76509ea5d22293cf990c33c3306992f\n (IndexTransformation &&indexTransformation, SizeImplementation &&sizeImplementation, Dune::index_constant< minIndexSize >, Dune::index_constant< maxIndexSize >)\n \n \n \n analyticgridviewfunction.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/gridfunctions/\n- a00092.html\n- dune/functions/common/signature.hh\n- dune/functions/common/defaultderivativetraits.hh\n- dune/functions/common/differentiablefunction_imp.hh\n- dune/functions/common/differentiablefunction.hh\n- dune/functions/gridfunctions/gridviewentityset.hh\n- dune/functions/gridfunctions/localderivativetraits.hh\n+ a00185.html\n+ dune/functions/common/signature.hh\n+ dune/functions/common/defaultderivativetraits.hh\n+ dune/functions/common/differentiablefunction_imp.hh\n+ dune/functions/common/differentiablefunction.hh\n+ dune/functions/gridfunctions/gridviewentityset.hh\n+ dune/functions/gridfunctions/localderivativetraits.hh\n Dune::Functions::AnalyticGridViewFunction< Range(Domain), GV, F, DerivativeTraits >\n Dune\n Dune::Functions\n \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 >\n makeAnalyticGridViewFunction\n a00209.html\n gafe8f06fb6d4027bfaf39e0971d8eb3c6\n (F &&f, const GridView &gridView)\n \n \n \n composedgridfunction.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/gridfunctions/\n- a00089.html\n- dune/functions/common/defaultderivativetraits.hh\n- dune/functions/common/differentiablefunction.hh\n- dune/functions/gridfunctions/gridfunction.hh\n+ a00167.html\n+ dune/functions/common/defaultderivativetraits.hh\n+ dune/functions/common/differentiablefunction.hh\n+ dune/functions/gridfunctions/gridfunction.hh\n Dune::Functions::ComposedGridFunction\n Dune\n Dune::Functions\n \n auto\n makeComposedGridFunction\n a00209.html\n ga9e5ac1cc0fdfb7d7a0e937f58aff21fd\n (OF &&outerFunction, IF &&... innerFunction)\n \n \n \n discreteglobalbasisfunction.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/gridfunctions/\n- a00101.html\n- dune/functions/functionspacebases/hierarchicnodetorangemap.hh\n- dune/functions/functionspacebases/flatvectorview.hh\n- dune/functions/gridfunctions/gridviewentityset.hh\n- dune/functions/gridfunctions/gridfunction.hh\n+ a00191.html\n+ dune/functions/functionspacebases/hierarchicnodetorangemap.hh\n+ dune/functions/functionspacebases/flatvectorview.hh\n+ dune/functions/gridfunctions/gridviewentityset.hh\n+ dune/functions/gridfunctions/gridfunction.hh\n dune/functions/backends/concepts.hh\n- dune/functions/backends/istlvectorbackend.hh\n+ dune/functions/backends/istlvectorbackend.hh\n Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase\n Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::Data\n Dune::Functions::ImplDoc::DiscreteGlobalBasisFunctionBase::LocalFunctionBase\n Dune::Functions::DiscreteGlobalBasisFunction\n Dune::Functions::DiscreteGlobalBasisFunction::LocalFunction\n Dune::Functions::DiscreteGlobalBasisFunctionDerivative\n Dune::Functions::DiscreteGlobalBasisFunctionDerivative::LocalFunction\n@@ -1457,62 +1457,62 @@\n ga9f1a8d6ac1558adad6150feb9b4e3168\n (B &&basis, V &&vector)\n \n \n \n facenormalgridfunction.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/gridfunctions/\n- a00086.html\n- dune/functions/gridfunctions/gridfunction.hh\n- dune/functions/gridfunctions/gridviewentityset.hh\n+ a00188.html\n+ dune/functions/gridfunctions/gridfunction.hh\n+ dune/functions/gridfunctions/gridviewentityset.hh\n Dune::Functions::FaceNormalGridFunction\n Dune\n Dune::Functions\n \n \n gridfunction.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/gridfunctions/\n- a00098.html\n- dune/functions/common/typeerasure.hh\n- dune/functions/common/defaultderivativetraits.hh\n- dune/functions/common/differentiablefunction.hh\n- dune/functions/common/localfunction.hh\n- dune/functions/common/functionconcepts.hh\n- dune/functions/gridfunctions/localderivativetraits.hh\n- dune/functions/gridfunctions/gridfunction_imp.hh\n+ a00170.html\n+ dune/functions/common/typeerasure.hh\n+ dune/functions/common/defaultderivativetraits.hh\n+ dune/functions/common/differentiablefunction.hh\n+ dune/functions/common/localfunction.hh\n+ dune/functions/common/functionconcepts.hh\n+ dune/functions/gridfunctions/localderivativetraits.hh\n+ dune/functions/gridfunctions/gridfunction_imp.hh\n Dune::Functions::GridFunction\n Dune::Functions::GridFunction< Range(Domain), ES, DerivativeTraits, bufferSize >\n Dune\n Dune::Functions\n \n \n gridfunction_imp.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/gridfunctions/\n- a00083.html\n- dune/functions/common/type_traits.hh\n- dune/functions/common/interfaces.hh\n- dune/functions/common/differentiablefunction_imp.hh\n+ a00173.html\n+ dune/functions/common/type_traits.hh\n+ dune/functions/common/interfaces.hh\n+ dune/functions/common/differentiablefunction_imp.hh\n Dune\n Dune::Functions\n \n \n gridviewentityset.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/gridfunctions/\n- a00080.html\n+ a00176.html\n Dune::Functions::GridViewEntitySet\n Dune\n Dune::Functions\n \n \n gridviewfunction.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/gridfunctions/\n- a00095.html\n- dune/functions/gridfunctions/gridfunction.hh\n- dune/functions/gridfunctions/gridviewentityset.hh\n- dune/functions/gridfunctions/analyticgridviewfunction.hh\n+ a00182.html\n+ dune/functions/gridfunctions/gridfunction.hh\n+ dune/functions/gridfunctions/gridviewentityset.hh\n+ dune/functions/gridfunctions/analyticgridviewfunction.hh\n Dune::Functions::GridViewFunction\n Dune::Functions::GridViewFunction< Range(Domain), GV, DerivativeTraits, bufferSize >\n Dune\n Dune::Functions\n \n std::decay< F >::type\n makeGridViewFunction\n@@ -1527,16 +1527,16 @@\n a34f2d140a1fed46862286f68d26c9975\n (F &&f, const GridView &gridView) -> decltype(makeAnalyticGridViewFunction(std::forward< F >(f), gridView))\n \n \n \n localderivativetraits.hh\n /build/reproducible-path/dune-functions-2.9.0/dune/functions/gridfunctions/\n- a00104.html\n- dune/functions/common/defaultderivativetraits.hh\n+ a00179.html\n+ dune/functions/common/defaultderivativetraits.hh\n Dune::Functions::LocalDerivativeTraits\n Dune::Functions::LocalDerivativeTraits::Traits\n Dune::Functions::LocalDerivativeTraits::Traits< R(LocalDomain)>\n Dune\n Dune::Functions\n \n \n"}]}]}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/files.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/files.html", "unified_diff": "@@ -68,83 +68,83 @@\n
    Here is a list of all files with brief descriptions:
    \n
    [detail level 1234]
    \n \n \n \n \n \n-\n-\n+\n+\n \n \n-\n+\n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n
      doc
     doxygen
      dune
      functions
      analyticfunctions
     polynomial.hh
     trigonometricfunction.hh
     polynomial.hh
     trigonometricfunction.hh
      backends
     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
     functionspacebases/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
    \n
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/globals.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/globals.html", "unified_diff": "@@ -59,15 +59,15 @@\n \n \n \n
    \n
    Here is a list of all file members with links to the files they belong to:
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-functions-doc/doxygen/globals_defs.html", "source2": "./usr/share/doc/libdune-functions-doc/doxygen/globals_defs.html", "unified_diff": "@@ -59,15 +59,15 @@\n \n \n \n
    \n  \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}]}]}]}]}