{"diffoscope-json-version": 1, "source1": "/srv/reproducible-results/rbuild-debian/r-b-build.RnqwmQQJ/b1/dune-geometry_2.9.0-4_i386.changes", "source2": "/srv/reproducible-results/rbuild-debian/r-b-build.RnqwmQQJ/b2/dune-geometry_2.9.0-4_i386.changes", "unified_diff": null, "details": [{"source1": "Files", "source2": "Files", "unified_diff": "@@ -1,4 +1,4 @@\n \n 334baa9530131d0c237122f0394b9b02 361600 debug optional libdune-geometry-dev-dbgsym_2.9.0-4_i386.deb\n 02d86eb6e3e68dd955fe251162a00e76 294904 libdevel optional libdune-geometry-dev_2.9.0-4_i386.deb\n- 42f465fdad2b6ee6d190e1faf1f13e00 1525672 doc optional libdune-geometry-doc_2.9.0-4_all.deb\n+ 2bf1f1b082324d68d930d8f946b36dfa 1525716 doc optional libdune-geometry-doc_2.9.0-4_all.deb\n"}, {"source1": "libdune-geometry-doc_2.9.0-4_all.deb", "source2": "libdune-geometry-doc_2.9.0-4_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-07-15 14:03:47.000000 debian-binary\n--rw-r--r-- 0 0 0 15876 2023-07-15 14:03:47.000000 control.tar.xz\n--rw-r--r-- 0 0 0 1509604 2023-07-15 14:03:47.000000 data.tar.xz\n+-rw-r--r-- 0 0 0 15872 2023-07-15 14:03:47.000000 control.tar.xz\n+-rw-r--r-- 0 0 0 1509652 2023-07-15 14:03:47.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": "@@ -8,28 +8,29 @@\n usr/share/doc/libdune-geometry-doc/appl/refelements/gg_quadrilateral.png\n usr/share/doc/libdune-geometry-doc/appl/refelements/gg_tetrahedron.png\n usr/share/doc/libdune-geometry-doc/appl/refelements/gg_tetrahedron_edges.png\n usr/share/doc/libdune-geometry-doc/appl/refelements/gg_triangle.png\n usr/share/doc/libdune-geometry-doc/changelog.Debian.gz\n usr/share/doc/libdune-geometry-doc/changelog.gz\n usr/share/doc/libdune-geometry-doc/copyright\n-usr/share/doc/libdune-geometry-doc/doxygen/a00107.html\n+usr/share/doc/libdune-geometry-doc/doxygen/a00110.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00164.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00167.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00170.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00170_source.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00173.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00173_source.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00176.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00176_source.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00179.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00179_source.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00182.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00182_source.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00185.html\n+usr/share/doc/libdune-geometry-doc/doxygen/a00185_source.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00188.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00188_source.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00191.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00191_source.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00194.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00194_source.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00197.html\n@@ -57,15 +58,14 @@\n usr/share/doc/libdune-geometry-doc/doxygen/a00230.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00230_source.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00233.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00233_source.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00236.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00236_source.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00239.html\n-usr/share/doc/libdune-geometry-doc/doxygen/a00239_source.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00242.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00243.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00243.png\n usr/share/doc/libdune-geometry-doc/doxygen/a00244.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00244.png\n usr/share/doc/libdune-geometry-doc/doxygen/a00245.html\n usr/share/doc/libdune-geometry-doc/doxygen/a00245.png\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": "@@ -16,64 +16,64 @@\n -rw-r--r-- 0 root (0) root (0) 29836 2022-10-20 18:03:11.000000 ./usr/share/doc/libdune-geometry-doc/appl/refelements/gg_tetrahedron.png\n -rw-r--r-- 0 root (0) root (0) 22586 2022-10-20 18:03:11.000000 ./usr/share/doc/libdune-geometry-doc/appl/refelements/gg_tetrahedron_edges.png\n -rw-r--r-- 0 root (0) root (0) 6480 2022-10-20 18:03:11.000000 ./usr/share/doc/libdune-geometry-doc/appl/refelements/gg_triangle.png\n -rw-r--r-- 0 root (0) root (0) 845 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/changelog.Debian.gz\n -rw-r--r-- 0 root (0) root (0) 3307 2022-10-20 18:03:11.000000 ./usr/share/doc/libdune-geometry-doc/changelog.gz\n -rw-r--r-- 0 root (0) root (0) 2567 2023-01-12 15:07:27.000000 ./usr/share/doc/libdune-geometry-doc/copyright\n drwxr-xr-x 0 root (0) root (0) 0 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/\n--rw-r--r-- 0 root (0) root (0) 3075 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00107.html\n+-rw-r--r-- 0 root (0) root (0) 3075 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00110.html\n -rw-r--r-- 0 root (0) root (0) 3049 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00164.html\n -rw-r--r-- 0 root (0) root (0) 3047 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00167.html\n--rw-r--r-- 0 root (0) root (0) 7986 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00170.html\n--rw-r--r-- 0 root (0) root (0) 171806 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00170_source.html\n--rw-r--r-- 0 root (0) root (0) 4510 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00173.html\n--rw-r--r-- 0 root (0) root (0) 8120 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00173_source.html\n--rw-r--r-- 0 root (0) root (0) 3400 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00176.html\n--rw-r--r-- 0 root (0) root (0) 26542 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00176_source.html\n--rw-r--r-- 0 root (0) root (0) 10165 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00179.html\n--rw-r--r-- 0 root (0) root (0) 66730 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00179_source.html\n--rw-r--r-- 0 root (0) root (0) 7240 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00182.html\n--rw-r--r-- 0 root (0) root (0) 29452 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00182_source.html\n--rw-r--r-- 0 root (0) root (0) 4352 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00185.html\n--rw-r--r-- 0 root (0) root (0) 11783 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00188.html\n--rw-r--r-- 0 root (0) root (0) 156234 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00188_source.html\n--rw-r--r-- 0 root (0) root (0) 5592 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00191.html\n--rw-r--r-- 0 root (0) root (0) 44620 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00191_source.html\n--rw-r--r-- 0 root (0) root (0) 6690 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00194.html\n--rw-r--r-- 0 root (0) root (0) 35007 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00194_source.html\n+-rw-r--r-- 0 root (0) root (0) 5299 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00170.html\n+-rw-r--r-- 0 root (0) root (0) 112512 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00170_source.html\n+-rw-r--r-- 0 root (0) root (0) 5096 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00173.html\n+-rw-r--r-- 0 root (0) root (0) 9368 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00173_source.html\n+-rw-r--r-- 0 root (0) root (0) 5394 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00176.html\n+-rw-r--r-- 0 root (0) root (0) 66962 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00176_source.html\n+-rw-r--r-- 0 root (0) root (0) 7986 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00179.html\n+-rw-r--r-- 0 root (0) root (0) 171806 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00179_source.html\n+-rw-r--r-- 0 root (0) root (0) 6690 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00182.html\n+-rw-r--r-- 0 root (0) root (0) 35007 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00182_source.html\n+-rw-r--r-- 0 root (0) root (0) 5567 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00185.html\n+-rw-r--r-- 0 root (0) root (0) 117778 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00185_source.html\n+-rw-r--r-- 0 root (0) root (0) 7240 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00188.html\n+-rw-r--r-- 0 root (0) root (0) 29452 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00188_source.html\n+-rw-r--r-- 0 root (0) root (0) 13461 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00191.html\n+-rw-r--r-- 0 root (0) root (0) 94629 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00191_source.html\n+-rw-r--r-- 0 root (0) root (0) 11783 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00194.html\n+-rw-r--r-- 0 root (0) root (0) 156234 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00194_source.html\n -rw-r--r-- 0 root (0) root (0) 6873 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00197.html\n -rw-r--r-- 0 root (0) root (0) 85999 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00197_source.html\n--rw-r--r-- 0 root (0) root (0) 5394 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00200.html\n--rw-r--r-- 0 root (0) root (0) 66962 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00200_source.html\n--rw-r--r-- 0 root (0) root (0) 5567 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00203.html\n--rw-r--r-- 0 root (0) root (0) 117778 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00203_source.html\n+-rw-r--r-- 0 root (0) root (0) 5671 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00200.html\n+-rw-r--r-- 0 root (0) root (0) 29350 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00200_source.html\n+-rw-r--r-- 0 root (0) root (0) 10165 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00203.html\n+-rw-r--r-- 0 root (0) root (0) 66730 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00203_source.html\n -rw-r--r-- 0 root (0) root (0) 5862 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00206.html\n -rw-r--r-- 0 root (0) root (0) 36535 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00206_source.html\n--rw-r--r-- 0 root (0) root (0) 5299 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00209.html\n--rw-r--r-- 0 root (0) root (0) 112512 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00209_source.html\n--rw-r--r-- 0 root (0) root (0) 5096 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00212.html\n--rw-r--r-- 0 root (0) root (0) 9368 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00212_source.html\n+-rw-r--r-- 0 root (0) root (0) 10618 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00209.html\n+-rw-r--r-- 0 root (0) root (0) 34670 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00209_source.html\n+-rw-r--r-- 0 root (0) root (0) 10328 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00212.html\n+-rw-r--r-- 0 root (0) root (0) 99226 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00212_source.html\n -rw-r--r-- 0 root (0) root (0) 10134 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00215.html\n -rw-r--r-- 0 root (0) root (0) 86047 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00215_source.html\n--rw-r--r-- 0 root (0) root (0) 10328 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00218.html\n--rw-r--r-- 0 root (0) root (0) 99226 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00218_source.html\n+-rw-r--r-- 0 root (0) root (0) 14353 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00218.html\n+-rw-r--r-- 0 root (0) root (0) 118175 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00218_source.html\n -rw-r--r-- 0 root (0) root (0) 10293 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00221.html\n -rw-r--r-- 0 root (0) root (0) 98931 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00221_source.html\n -rw-r--r-- 0 root (0) root (0) 9692 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00224.html\n -rw-r--r-- 0 root (0) root (0) 96784 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00224_source.html\n--rw-r--r-- 0 root (0) root (0) 10618 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00227.html\n--rw-r--r-- 0 root (0) root (0) 34670 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00227_source.html\n--rw-r--r-- 0 root (0) root (0) 14353 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00230.html\n--rw-r--r-- 0 root (0) root (0) 118175 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00230_source.html\n--rw-r--r-- 0 root (0) root (0) 5106 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00233.html\n--rw-r--r-- 0 root (0) root (0) 12688 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00233_source.html\n--rw-r--r-- 0 root (0) root (0) 5671 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00236.html\n--rw-r--r-- 0 root (0) root (0) 29350 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00236_source.html\n--rw-r--r-- 0 root (0) root (0) 13461 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00239.html\n--rw-r--r-- 0 root (0) root (0) 94629 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00239_source.html\n+-rw-r--r-- 0 root (0) root (0) 5592 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00227.html\n+-rw-r--r-- 0 root (0) root (0) 44620 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00227_source.html\n+-rw-r--r-- 0 root (0) root (0) 3400 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00230.html\n+-rw-r--r-- 0 root (0) root (0) 26542 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00230_source.html\n+-rw-r--r-- 0 root (0) root (0) 4510 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00233.html\n+-rw-r--r-- 0 root (0) root (0) 8120 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00233_source.html\n+-rw-r--r-- 0 root (0) root (0) 5106 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00236.html\n+-rw-r--r-- 0 root (0) root (0) 12688 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00236_source.html\n+-rw-r--r-- 0 root (0) root (0) 4352 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00239.html\n -rw-r--r-- 0 root (0) root (0) 5813 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00242.html\n -rw-r--r-- 0 root (0) root (0) 5068 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00243.html\n -rw-r--r-- 0 root (0) root (0) 11280 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00243.png\n -rw-r--r-- 0 root (0) root (0) 5016 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00244.html\n -rw-r--r-- 0 root (0) root (0) 3926 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00244.png\n -rw-r--r-- 0 root (0) root (0) 62508 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00245.html\n -rw-r--r-- 0 root (0) root (0) 3734 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00245.png\n@@ -302,15 +302,15 @@\n -rw-r--r-- 0 root (0) root (0) 3162 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/dir_8c28f2953344a167049ba6db5a27148a_dep.png\n -rw-r--r-- 0 root (0) root (0) 7099 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/dir_b609f53bbb5e26b8e9292001c59476a3.html\n -rw-r--r-- 0 root (0) root (0) 2470 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/dir_b609f53bbb5e26b8e9292001c59476a3_dep.png\n -rw-r--r-- 0 root (0) root (0) 4026 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/dir_de8ef2d1b4283b99fcb86ec9d2fa66db.html\n -rw-r--r-- 0 root (0) root (0) 1956 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/dir_de8ef2d1b4283b99fcb86ec9d2fa66db_dep.png\n -rw-r--r-- 0 root (0) root (0) 3989 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/dir_e68e8157741866f444e17edd764ebbae.html\n -rw-r--r-- 0 root (0) root (0) 45631 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/doxygen.css\n--rw-r--r-- 0 root (0) root (0) 26053 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/dune-geometry.tag.gz\n+-rw-r--r-- 0 root (0) root (0) 26055 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/dune-geometry.tag.gz\n -rw-r--r-- 0 root (0) root (0) 7704 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/dynsections.js\n -rw-r--r-- 0 root (0) root (0) 13979 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/files.html\n -rw-r--r-- 0 root (0) root (0) 836 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/form_0.png\n -rw-r--r-- 0 root (0) root (0) 929 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/form_0_dark.png\n -rw-r--r-- 0 root (0) root (0) 2566 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/form_1.png\n -rw-r--r-- 0 root (0) root (0) 536 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/form_10.png\n -rw-r--r-- 0 root (0) root (0) 917 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/form_100.png\n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00170.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00170.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: multilineargeometry.hh File Reference\n+dune-geometry: referenceelementimplementation.hh File Reference\n \n \n \n \n \n \n \n@@ -70,57 +70,44 @@\n
\n \n
\n \n
\n
\n-Classes |\n Namespaces
\n-
multilineargeometry.hh File Reference
\n+
referenceelementimplementation.hh File Reference
\n
\n
\n
#include <cassert>
\n-#include <functional>
\n-#include <iterator>
\n+#include <algorithm>
\n #include <limits>
\n+#include <tuple>
\n+#include <utility>
\n #include <vector>
\n+#include <array>
\n+#include <bitset>
\n #include <dune/common/fmatrix.hh>
\n #include <dune/common/fvector.hh>
\n+#include <dune/common/hybridutilities.hh>
\n #include <dune/common/typetraits.hh>
\n-#include <dune/geometry/affinegeometry.hh>
\n-#include <dune/geometry/referenceelements.hh>
\n+#include <dune/common/iteratorrange.hh>
\n+#include <dune/common/math.hh>
\n+#include <dune/geometry/referenceelement.hh>
\n+#include <dune/geometry/affinegeometry.hh>
\n #include <dune/geometry/type.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

struct  Dune::MultiLinearGeometryTraits< ct >
 default traits class for MultiLinearGeometry More...
 
struct  Dune::MultiLinearGeometryTraits< ct >::CornerStorage< mydim, cdim >
 template specifying the storage for the corners More...
 
struct  Dune::MultiLinearGeometryTraits< ct >::hasSingleGeometryType< dim >
 will there be only one geometry type for a dimension? More...
 
class  Dune::MultiLinearGeometry< ct, mydim, cdim, Traits >
 generic geometry implementation based on corner coordinates More...
 
class  Dune::MultiLinearGeometry< ct, mydim, cdim, Traits >::JacobianInverseTransposed
 
class  Dune::CachedMultiLinearGeometry< ct, mydim, cdim, Traits >
 Implement a MultiLinearGeometry with additional caching. More...
 
\n \n \n \n+\n+\n

\n Namespaces

namespace  Dune
 
namespace  Dune::Geo
 
\n
\n \n
\n Generated by \"doxygen\"/ 1.9.8\n
\n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,46 +6,35 @@\n dune-geometry\u00a02.9.0\n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n-Classes | Namespaces\n-multilineargeometry.hh File Reference\n+Namespaces\n+referenceelementimplementation.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 Go_to_the_source_code_of_this_file.\n- Classes\n-struct \u00a0Dune::MultiLinearGeometryTraits<_ct_>\n-\u00a0 default traits class for MultiLinearGeometry More...\n-\u00a0\n-struct \u00a0Dune::MultiLinearGeometryTraits<_ct_>::CornerStorage<_mydim,_cdim_>\n-\u00a0 template specifying the storage for the corners More...\n-\u00a0\n-struct \u00a0Dune::MultiLinearGeometryTraits<_ct_>::hasSingleGeometryType<_dim_>\n-\u00a0 will there be only one geometry type for a dimension? More...\n-\u00a0\n- class \u00a0Dune::MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_>\n-\u00a0 generic geometry implementation based on corner coordinates More...\n-\u00a0\n- class \u00a0Dune::MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_>::\n- JacobianInverseTransposed\n-\u00a0\n- class \u00a0Dune::CachedMultiLinearGeometry<_ct,_mydim,_cdim,_Traits_>\n-\u00a0 Implement a MultiLinearGeometry with additional caching. More...\n-\u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n+namespace \u00a0Dune::Geo\n+\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00170_source.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00170_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: multilineargeometry.hh Source File\n+dune-geometry: referenceelementimplementation.hh Source File\n \n \n \n \n \n \n \n@@ -74,840 +74,721 @@\n \n
\n \n
\n \n
\n-
multilineargeometry.hh
\n+
referenceelementimplementation.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
\n
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
\n-
5#ifndef DUNE_GEOMETRY_MULTILINEARGEOMETRY_HH
\n-
6#define DUNE_GEOMETRY_MULTILINEARGEOMETRY_HH
\n+
5#ifndef DUNE_GEOMETRY_REFERENCEELEMENTIMPLEMENTATION_HH
\n+
6#define DUNE_GEOMETRY_REFERENCEELEMENTIMPLEMENTATION_HH
\n
7
\n
8#include <cassert>
\n-
9#include <functional>
\n-
10#include <iterator>
\n+
9
\n+
10#include <algorithm>
\n
11#include <limits>
\n-
12#include <vector>
\n-
13
\n-
14#include <dune/common/fmatrix.hh>
\n-
15#include <dune/common/fvector.hh>
\n-
16#include <dune/common/typetraits.hh>
\n+
12#include <tuple>
\n+
13#include <utility>
\n+
14#include <vector>
\n+
15#include <array>
\n+
16#include <bitset>
\n
17
\n-\n-\n-
20#include <dune/geometry/type.hh>
\n-
21
\n-
22namespace Dune
\n-
23{
\n+
18#include <dune/common/fmatrix.hh>
\n+
19#include <dune/common/fvector.hh>
\n+
20#include <dune/common/hybridutilities.hh>
\n+
21#include <dune/common/typetraits.hh>
\n+
22#include <dune/common/iteratorrange.hh>
\n+
23#include <dune/common/math.hh>
\n
24
\n-
25 // MultiLinearGeometryTraits
\n-
26 // -------------------------
\n-
27
\n-
37 template< class ct >
\n-
\n-\n-
39 {
\n-
58 typedef Impl::FieldMatrixHelper< ct > MatrixHelper;
\n-
59
\n-
61 static ct tolerance () { return ct( 16 ) * std::numeric_limits< ct >::epsilon(); }
\n-
62
\n-
127 template< int mydim, int cdim >
\n-
\n-\n-
129 {
\n-
130 typedef std::vector< FieldVector< ct, cdim > > Type;
\n-
131 };
\n-
\n-
132
\n-
146 template< int dim >
\n-
\n-\n-
148 {
\n-
149 static const bool v = false;
\n-
150 static const unsigned int topologyId = ~0u;
\n-
151 };
\n-
\n-
152 };
\n-
\n-
153
\n-
154
\n-
155
\n-
156 // MultiLinearGeometry
\n-
157 // -------------------
\n+\n+\n+
27#include <dune/geometry/type.hh>
\n+
28
\n+
29namespace Dune
\n+
30{
\n+
31
\n+
32 namespace Geo
\n+
33 {
\n+
34
\n+
35#ifndef DOXYGEN
\n+
36
\n+
37 // Internal Forward Declarations
\n+
38 // -----------------------------
\n+
39
\n+
40 namespace Impl
\n+
41 {
\n+
42 template< class ctype, int dim >
\n+
43 class ReferenceElementContainer;
\n+
44 }
\n+
45
\n+
46 template< class ctype, int dim >
\n+
47 struct ReferenceElements;
\n+
48
\n+
49
\n+
50
\n+
51 namespace Impl
\n+
52 {
\n+
53
\n+
54 using Dune::Impl::isPrism;
\n+
55 using Dune::Impl::isPyramid;
\n+
56 using Dune::Impl::baseTopologyId;
\n+
57 using Dune::Impl::prismConstruction;
\n+
58 using Dune::Impl::pyramidConstruction;
\n+
59 using Dune::Impl::numTopologies;
\n+
60
\n+
62 unsigned int size ( unsigned int topologyId, int dim, int codim );
\n+
63
\n+
64
\n+
65
\n+
73 unsigned int subTopologyId ( unsigned int topologyId, int dim, int codim, unsigned int i );
\n+
74
\n+
75
\n+
76
\n+
77 // subTopologyNumbering
\n+
78 // --------------------
\n+
79
\n+
80 void subTopologyNumbering ( unsigned int topologyId, int dim, int codim, unsigned int i, int subcodim,
\n+
81 unsigned int *beginOut, unsigned int *endOut );
\n+
82
\n+
83
\n+
84
\n+
85
\n+
86 // checkInside
\n+
87 // -----------
\n+
88
\n+
89 template< class ct, int cdim >
\n+
90 inline bool
\n+
91 checkInside ( unsigned int topologyId, int dim, const FieldVector< ct, cdim > &x, ct tolerance, ct factor = ct( 1 ) )
\n+
92 {
\n+
93 assert( (dim >= 0) && (dim <= cdim) );
\n+
94 assert( topologyId < numTopologies( dim ) );
\n+
95
\n+
96 if( dim > 0 )
\n+
97 {
\n+
98 const ct baseFactor = (isPrism( topologyId, dim ) ? factor : factor - x[ dim-1 ]);
\n+
99 if( (x[ dim-1 ] > -tolerance) && (factor - x[ dim-1 ] > -tolerance) )
\n+
100 return checkInside< ct, cdim >( baseTopologyId( topologyId, dim ), dim-1, x, tolerance, baseFactor );
\n+
101 else
\n+
102 return false;
\n+
103 }
\n+
104 else
\n+
105 return true;
\n+
106 }
\n+
107
\n+
108
\n+
109
\n+
110 // referenceCorners
\n+
111 // ----------------
\n+
112
\n+
113 template< class ct, int cdim >
\n+
114 inline unsigned int
\n+
115 referenceCorners ( unsigned int topologyId, int dim, FieldVector< ct, cdim > *corners )
\n+
116 {
\n+
117 assert( (dim >= 0) && (dim <= cdim) );
\n+
118 assert( topologyId < numTopologies( dim ) );
\n+
119
\n+
120 if( dim > 0 )
\n+
121 {
\n+
122 const unsigned int nBaseCorners
\n+
123 = referenceCorners( baseTopologyId( topologyId, dim ), dim-1, corners );
\n+
124 assert( nBaseCorners == size( baseTopologyId( topologyId, dim ), dim-1, dim-1 ) );
\n+
125 if( isPrism( topologyId, dim ) )
\n+
126 {
\n+
127 std::copy( corners, corners + nBaseCorners, corners + nBaseCorners );
\n+
128 for( unsigned int i = 0; i < nBaseCorners; ++i )
\n+
129 corners[ i+nBaseCorners ][ dim-1 ] = ct( 1 );
\n+
130 return 2*nBaseCorners;
\n+
131 }
\n+
132 else
\n+
133 {
\n+
134 corners[ nBaseCorners ] = FieldVector< ct, cdim >( ct( 0 ) );
\n+
135 corners[ nBaseCorners ][ dim-1 ] = ct( 1 );
\n+
136 return nBaseCorners+1;
\n+
137 }
\n+
138 }
\n+
139 else
\n+
140 {
\n+
141 *corners = FieldVector< ct, cdim >( ct( 0 ) );
\n+
142 return 1;
\n+
143 }
\n+
144 }
\n+
145
\n+
146
\n+
147
\n+
148 // referenceVolume
\n+
149 // ---------------
\n+
150
\n+
151 unsigned long referenceVolumeInverse ( unsigned int topologyId, int dim );
\n+
152
\n+
153 template< class ct >
\n+
154 inline ct referenceVolume ( unsigned int topologyId, int dim )
\n+
155 {
\n+
156 return ct( 1 ) / ct( referenceVolumeInverse( topologyId, dim ) );
\n+
157 }
\n
158
\n-
179 template< class ct, int mydim, int cdim, class Traits = MultiLinearGeometryTraits< ct > >
\n-
\n-\n-
181 {
\n-\n-
183
\n-
184 public:
\n-
186 typedef ct ctype;
\n-
187
\n-
189 static const int mydimension= mydim;
\n-
191 static const int coorddimension = cdim;
\n-
192
\n-
194 typedef FieldVector< ctype, mydimension > LocalCoordinate;
\n-
196 typedef FieldVector< ctype, coorddimension > GlobalCoordinate;
\n-
198 typedef ctype Volume;
\n-
199
\n-
201 typedef FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed;
\n-
202
\n-\n+
159
\n+
160
\n+
161 // referenceOrigins
\n+
162 // ----------------
\n+
163
\n+
164 template< class ct, int cdim >
\n+
165 inline unsigned int
\n+
166 referenceOrigins ( unsigned int topologyId, int dim, int codim, FieldVector< ct, cdim > *origins )
\n+
167 {
\n+
168 assert( (dim >= 0) && (dim <= cdim) );
\n+
169 assert( topologyId < numTopologies( dim ) );
\n+
170 assert( (codim >= 0) && (codim <= dim) );
\n+
171
\n+
172 if( codim > 0 )
\n+
173 {
\n+
174 const unsigned int baseId = baseTopologyId( topologyId, dim );
\n+
175 if( isPrism( topologyId, dim ) )
\n+
176 {
\n+
177 const unsigned int n = (codim < dim ? referenceOrigins( baseId, dim-1, codim, origins ) : 0);
\n+
178 const unsigned int m = referenceOrigins( baseId, dim-1, codim-1, origins+n );
\n+
179 for( unsigned int i = 0; i < m; ++i )
\n+
180 {
\n+
181 origins[ n+m+i ] = origins[ n+i ];
\n+
182 origins[ n+m+i ][ dim-1 ] = ct( 1 );
\n+
183 }
\n+
184 return n+2*m;
\n+
185 }
\n+
186 else
\n+
187 {
\n+
188 const unsigned int m = referenceOrigins( baseId, dim-1, codim-1, origins );
\n+
189 if( codim == dim )
\n+
190 {
\n+
191 origins[ m ] = FieldVector< ct, cdim >( ct( 0 ) );
\n+
192 origins[ m ][ dim-1 ] = ct( 1 );
\n+
193 return m+1;
\n+
194 }
\n+
195 else
\n+
196 return m+referenceOrigins( baseId, dim-1, codim, origins+m );
\n+
197 }
\n+
198 }
\n+
199 else
\n+
200 {
\n+
201 origins[ 0 ] = FieldVector< ct, cdim >( ct( 0 ) );
\n+
202 return 1;
\n+
203 }
\n+
204 }
\n
205
\n-
207 typedef FieldMatrix< ctype, coorddimension, mydimension > Jacobian;
\n-
208
\n-
210 typedef FieldMatrix< ctype, mydimension, coorddimension > JacobianInverse;
\n-
211
\n-
212 protected:
\n-
213
\n-\n-
215
\n-
216 public:
\n-
217
\n-\n+
206
\n+
207
\n+
208 // referenceEmbeddings
\n+
209 // -------------------
\n+
210
\n+
211 template< class ct, int cdim, int mydim >
\n+
212 inline unsigned int
\n+
213 referenceEmbeddings ( unsigned int topologyId, int dim, int codim,
\n+
214 FieldVector< ct, cdim > *origins,
\n+
215 FieldMatrix< ct, mydim, cdim > *jacobianTransposeds )
\n+
216 {
\n+
217 assert( (0 <= codim) && (codim <= dim) && (dim <= cdim) );
\n+
218 assert( (dim - codim <= mydim) && (mydim <= cdim) );
\n+
219 assert( topologyId < numTopologies( dim ) );
\n
220
\n-
221 private:
\n-
222 static const bool hasSingleGeometryType = Traits::template hasSingleGeometryType< mydimension >::v;
\n-
223
\n-
224 protected:
\n-
225 typedef typename Traits::MatrixHelper MatrixHelper;
\n-
226 typedef typename std::conditional< hasSingleGeometryType, std::integral_constant< unsigned int, Traits::template hasSingleGeometryType< mydimension >::topologyId >, unsigned int >::type TopologyId;
\n-
227
\n-
228 public:
\n-
238 template< class Corners >
\n-
\n-\n-
240 const Corners &corners )
\n-
241 : refElement_( refElement ),
\n-
242 corners_( corners )
\n-
243 {}
\n-
\n-
244
\n-
254 template< class Corners >
\n-
\n-\n-
256 const Corners &corners )
\n-
257 : refElement_( ReferenceElements::general( gt ) ),
\n-
258 corners_( corners )
\n-
259 {}
\n-
\n-
260
\n-
\n-
262 bool affine () const
\n-
263 {
\n-\n-
265 return affine( jt );
\n-
266 }
\n-
\n-
267
\n-
269 Dune::GeometryType type () const { return GeometryType( toUnsignedInt(topologyId()), mydimension ); }
\n+
221 if( codim > 0 )
\n+
222 {
\n+
223 const unsigned int baseId = baseTopologyId( topologyId, dim );
\n+
224 if( isPrism( topologyId, dim ) )
\n+
225 {
\n+
226 const unsigned int n = (codim < dim ? referenceEmbeddings( baseId, dim-1, codim, origins, jacobianTransposeds ) : 0);
\n+
227 for( unsigned int i = 0; i < n; ++i )
\n+
228 jacobianTransposeds[ i ][ dim-codim-1 ][ dim-1 ] = ct( 1 );
\n+
229
\n+
230 const unsigned int m = referenceEmbeddings( baseId, dim-1, codim-1, origins+n, jacobianTransposeds+n );
\n+
231 std::copy( origins+n, origins+n+m, origins+n+m );
\n+
232 std::copy( jacobianTransposeds+n, jacobianTransposeds+n+m, jacobianTransposeds+n+m );
\n+
233 for( unsigned int i = 0; i < m; ++i )
\n+
234 origins[ n+m+i ][ dim-1 ] = ct( 1 );
\n+
235
\n+
236 return n+2*m;
\n+
237 }
\n+
238 else
\n+
239 {
\n+
240 const unsigned int m = referenceEmbeddings( baseId, dim-1, codim-1, origins, jacobianTransposeds );
\n+
241 if( codim == dim )
\n+
242 {
\n+
243 origins[ m ] = FieldVector< ct, cdim >( ct( 0 ) );
\n+
244 origins[ m ][ dim-1 ] = ct( 1 );
\n+
245 jacobianTransposeds[ m ] = FieldMatrix< ct, mydim, cdim >( ct( 0 ) );
\n+
246 return m+1;
\n+
247 }
\n+
248 else
\n+
249 {
\n+
250 const unsigned int n = referenceEmbeddings( baseId, dim-1, codim, origins+m, jacobianTransposeds+m );
\n+
251 for( unsigned int i = 0; i < n; ++i )
\n+
252 {
\n+
253 for( int k = 0; k < dim-1; ++k )
\n+
254 jacobianTransposeds[ m+i ][ dim-codim-1 ][ k ] = -origins[ m+i ][ k ];
\n+
255 jacobianTransposeds[ m+i ][ dim-codim-1 ][ dim-1 ] = ct( 1 );
\n+
256 }
\n+
257 return m+n;
\n+
258 }
\n+
259 }
\n+
260 }
\n+
261 else
\n+
262 {
\n+
263 origins[ 0 ] = FieldVector< ct, cdim >( ct( 0 ) );
\n+
264 jacobianTransposeds[ 0 ] = FieldMatrix< ct, mydim, cdim >( ct( 0 ) );
\n+
265 for( int k = 0; k < dim; ++k )
\n+
266 jacobianTransposeds[ 0 ][ k ][ k ] = ct( 1 );
\n+
267 return 1;
\n+
268 }
\n+
269 }
\n
270
\n-
272 int corners () const { return refElement().size( mydimension ); }
\n-
273
\n-
\n-
275 GlobalCoordinate corner ( int i ) const
\n-
276 {
\n-
277 assert( (i >= 0) && (i < corners()) );
\n-
278 return std::cref(corners_).get()[ i ];
\n-
279 }
\n-
\n-
280
\n-
282 GlobalCoordinate center () const { return global( refElement().position( 0, 0 ) ); }
\n-
283
\n-
\n-\n-
291 {
\n-
292 using std::begin;
\n-
293
\n-
294 auto cit = begin(std::cref(corners_).get());
\n-\n-
296 global< false >( topologyId(), std::integral_constant< int, mydimension >(), cit, ctype( 1 ), local, ctype( 1 ), y );
\n-
297 return y;
\n-
298 }
\n-
\n-
299
\n-
\n-
312 LocalCoordinate local ( const GlobalCoordinate &globalCoord ) const
\n-
313 {
\n-
314 const ctype tolerance = Traits::tolerance();
\n-
315 LocalCoordinate x = refElement().position( 0, 0 );
\n-\n-
317 const bool affineMapping = this->affine();
\n-
318 do
\n-
319 {
\n-
320 // Newton's method: DF^n dx^n = F^n, x^{n+1} -= dx^n
\n-
321 const GlobalCoordinate dglobal = (*this).global( x ) - globalCoord;
\n-
322 const bool invertible =
\n-
323 MatrixHelper::template xTRightInvA< mydimension, coorddimension >( jacobianTransposed( x ), dglobal, dx );
\n-
324 if( ! invertible )
\n-
325 return LocalCoordinate( std::numeric_limits< ctype > :: max() );
\n-
326
\n-
327 // update x with correction
\n-
328 x -= dx;
\n-
329
\n-
330 // for affine mappings only one iteration is needed
\n-
331 if ( affineMapping ) break;
\n-
332 } while( dx.two_norm2() > tolerance );
\n-
333 return x;
\n-
334 }
\n-
\n-
335
\n-
\n-\n-
351 {
\n-
352 return MatrixHelper::template sqrtDetAAT< mydimension, coorddimension >( jacobianTransposed( local ) );
\n-
353 }
\n-
\n-
354
\n-
\n-
363 Volume volume () const
\n-
364 {
\n-
365 return integrationElement( refElement().position( 0, 0 ) ) * refElement().volume();
\n-
366 }
\n-
\n-
367
\n-
\n-\n-
378 {
\n-
379 using std::begin;
\n-
380
\n-\n-
382 auto cit = begin(std::cref(corners_).get());
\n-
383 jacobianTransposed< false >( topologyId(), std::integral_constant< int, mydimension >(), cit, ctype( 1 ), local, ctype( 1 ), jt );
\n-
384 return jt;
\n-
385 }
\n-
\n-
386
\n-
\n-
393 JacobianInverseTransposed jacobianInverseTransposed ( const LocalCoordinate &local ) const;
\n-
394
\n-
\n-\n-
396 {
\n-
397 return geometry.refElement();
\n-
398 }
\n-
\n+
271
\n+
272
\n+
273 // referenceIntegrationOuterNormals
\n+
274 // --------------------------------
\n+
275
\n+
276 template< class ct, int cdim >
\n+
277 inline unsigned int
\n+
278 referenceIntegrationOuterNormals ( unsigned int topologyId, int dim,
\n+
279 const FieldVector< ct, cdim > *origins,
\n+
280 FieldVector< ct, cdim > *normals )
\n+
281 {
\n+
282 assert( (dim > 0) && (dim <= cdim) );
\n+
283 assert( topologyId < numTopologies( dim ) );
\n+
284
\n+
285 if( dim > 1 )
\n+
286 {
\n+
287 const unsigned int baseId = baseTopologyId( topologyId, dim );
\n+
288 if( isPrism( topologyId, dim ) )
\n+
289 {
\n+
290 const unsigned int numBaseFaces
\n+
291 = referenceIntegrationOuterNormals( baseId, dim-1, origins, normals );
\n+
292
\n+
293 for( unsigned int i = 0; i < 2; ++i )
\n+
294 {
\n+
295 normals[ numBaseFaces+i ] = FieldVector< ct, cdim >( ct( 0 ) );
\n+
296 normals[ numBaseFaces+i ][ dim-1 ] = ct( 2*int( i )-1 );
\n+
297 }
\n+
298
\n+
299 return numBaseFaces+2;
\n+
300 }
\n+
301 else
\n+
302 {
\n+
303 normals[ 0 ] = FieldVector< ct, cdim >( ct( 0 ) );
\n+
304 normals[ 0 ][ dim-1 ] = ct( -1 );
\n+
305
\n+
306 const unsigned int numBaseFaces
\n+
307 = referenceIntegrationOuterNormals( baseId, dim-1, origins+1, normals+1 );
\n+
308 for( unsigned int i = 1; i <= numBaseFaces; ++i )
\n+
309 normals[ i ][ dim-1 ] = normals[ i ]*origins[ i ];
\n+
310
\n+
311 return numBaseFaces+1;
\n+
312 }
\n+
313 }
\n+
314 else
\n+
315 {
\n+
316 for( unsigned int i = 0; i < 2; ++i )
\n+
317 {
\n+
318 normals[ i ] = FieldVector< ct, cdim >( ct( 0 ) );
\n+
319 normals[ i ][ 0 ] = ct( 2*int( i )-1 );
\n+
320 }
\n+
321
\n+
322 return 2;
\n+
323 }
\n+
324 }
\n+
325
\n+
326 template< class ct, int cdim >
\n+
327 inline unsigned int
\n+
328 referenceIntegrationOuterNormals ( unsigned int topologyId, int dim,
\n+
329 FieldVector< ct, cdim > *normals )
\n+
330 {
\n+
331 assert( (dim > 0) && (dim <= cdim) );
\n+
332
\n+
333 FieldVector< ct, cdim > *origins
\n+
334 = new FieldVector< ct, cdim >[ size( topologyId, dim, 1 ) ];
\n+
335 referenceOrigins( topologyId, dim, 1, origins );
\n+
336
\n+
337 const unsigned int numFaces
\n+
338 = referenceIntegrationOuterNormals( topologyId, dim, origins, normals );
\n+
339 assert( numFaces == size( topologyId, dim, 1 ) );
\n+
340
\n+
341 delete[] origins;
\n+
342
\n+
343 return numFaces;
\n+
344 }
\n+
345
\n+
346 } // namespace Impl
\n+
347
\n+
348
\n+
349
\n+
350 // ReferenceElement
\n+
351 // ----------------
\n+
352
\n+
371 template< class ctype_, int dim >
\n+
372 class ReferenceElementImplementation
\n+
373 {
\n+
374
\n+
375 public:
\n+
376
\n+
378 using ctype = ctype_;
\n+
379
\n+
381 using CoordinateField = ctype;
\n+
382
\n+
384 using Coordinate = Dune::FieldVector<ctype,dim>;
\n+
385
\n+
387 static constexpr int dimension = dim;
\n+
388
\n+
390 typedef ctype Volume;
\n+
391
\n+
392 private:
\n+
393
\n+
394 friend class Impl::ReferenceElementContainer< ctype, dim >;
\n+
395
\n+
396 struct SubEntityInfo;
\n+
397
\n+
398 template< int codim > struct CreateGeometries;
\n
399
\n-
400
\n-
\n-\n-
408 {
\n-
409 return jacobianTransposed(local).transposed();
\n-
410 }
\n-
\n+
400 public:
\n+
402 template< int codim >
\n+
403 struct Codim
\n+
404 {
\n+
406 typedef AffineGeometry< ctype, dim-codim, dim > Geometry;
\n+
407 };
\n+
408
\n+
409 // ReferenceElement cannot be copied.
\n+
410 ReferenceElementImplementation ( const ReferenceElementImplementation& ) = delete;
\n
411
\n-
\n-\n-
419 {
\n-
420 return jacobianInverseTransposed(local).transposed();
\n-
421 }
\n-
\n-
422
\n-
423 protected:
\n-
424
\n-
\n-\n-
426 {
\n-
427 return refElement_;
\n-
428 }
\n-
\n-
429
\n-
\n-\n-
431 {
\n-
432 return topologyId( std::integral_constant< bool, hasSingleGeometryType >() );
\n-
433 }
\n-
\n-
434
\n-
435 template< bool add, int dim, class CornerIterator >
\n-
\n-
436 static void global ( TopologyId topologyId, std::integral_constant< int, dim >,
\n-
437 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,
\n-
438 const ctype &rf, GlobalCoordinate &y );
\n-
439 template< bool add, class CornerIterator >
\n-
\n-
440 static void global ( TopologyId topologyId, std::integral_constant< int, 0 >,
\n-
441 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,
\n-
442 const ctype &rf, GlobalCoordinate &y );
\n-
443
\n-
444 template< bool add, int rows, int dim, class CornerIterator >
\n-
\n-
445 static void jacobianTransposed ( TopologyId topologyId, std::integral_constant< int, dim >,
\n-
446 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,
\n-
447 const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt );
\n-
448 template< bool add, int rows, class CornerIterator >
\n-
\n-
449 static void jacobianTransposed ( TopologyId topologyId, std::integral_constant< int, 0 >,
\n-
450 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,
\n-
451 const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt );
\n-
452
\n-
453 template< int dim, class CornerIterator >
\n-
\n-
454 static bool affine ( TopologyId topologyId, std::integral_constant< int, dim >, CornerIterator &cit, JacobianTransposed &jt );
\n-
455 template< class CornerIterator >
\n-
\n-
456 static bool affine ( TopologyId topologyId, std::integral_constant< int, 0 >, CornerIterator &cit, JacobianTransposed &jt );
\n-
457
\n-
\n-
458 bool affine ( JacobianTransposed &jacobianT ) const
\n-
459 {
\n-
460 using std::begin;
\n-
461
\n-
462 auto cit = begin(std::cref(corners_).get());
\n-
463 return affine( topologyId(), std::integral_constant< int, mydimension >(), cit, jacobianT );
\n-
464 }
\n-
\n-
465
\n-
466 private:
\n-
467 // The following methods are needed to convert the return type of topologyId to
\n-
468 // unsigned int with g++-4.4. It has problems casting integral_constant to the
\n-
469 // integral type.
\n-
470 static unsigned int toUnsignedInt(unsigned int i) { return i; }
\n-
471 template<unsigned int v>
\n-
472 static unsigned int toUnsignedInt(std::integral_constant<unsigned int,v> ) { return v; }
\n-
473 TopologyId topologyId ( std::integral_constant< bool, true > ) const { return TopologyId(); }
\n-
474 unsigned int topologyId ( std::integral_constant< bool, false > ) const { return refElement().type().id(); }
\n-
475
\n-
476 ReferenceElement refElement_;
\n-
477 typename Traits::template CornerStorage< mydimension, coorddimension >::Type corners_;
\n-
478 };
\n-
479
\n-
480
\n-
481
\n-
482 // MultiLinearGeometry::JacobianInverseTransposed
\n-
483 // ----------------------------------------------
\n+
412 // ReferenceElementImplementation cannot be copied.
\n+
413 ReferenceElementImplementation& operator= ( const ReferenceElementImplementation& ) = delete;
\n+
414
\n+
415 // ReferenceElementImplementation is default-constructible (required for storage in std::array)
\n+
416 ReferenceElementImplementation () = default;
\n+
417
\n+
422 int size ( int c ) const
\n+
423 {
\n+
424 assert( (c >= 0) && (c <= dim) );
\n+
425 return info_[ c ].size();
\n+
426 }
\n+
427
\n+
439 int size ( int i, int c, int cc ) const
\n+
440 {
\n+
441 assert( (i >= 0) && (i < size( c )) );
\n+
442 return info_[ c ][ i ].size( cc );
\n+
443 }
\n+
444
\n+
458 int subEntity ( int i, int c, int ii, int cc ) const
\n+
459 {
\n+
460 assert( (i >= 0) && (i < size( c )) );
\n+
461 return info_[ c ][ i ].number( ii, cc );
\n+
462 }
\n+
463
\n+
479 auto subEntities ( int i, int c, int cc ) const
\n+
480 {
\n+
481 assert( (i >= 0) && (i < size( c )) );
\n+
482 return info_[ c ][ i ].numbers( cc );
\n+
483 }
\n
484
\n-
485 template< class ct, int mydim, int cdim, class Traits >
\n-
\n-
486 class MultiLinearGeometry< ct, mydim, cdim, Traits >::JacobianInverseTransposed
\n-
487 : public FieldMatrix< ctype, coorddimension, mydimension >
\n-
488 {
\n-
489 typedef FieldMatrix< ctype, coorddimension, mydimension > Base;
\n-
490
\n-
491 public:
\n-
\n-
492 void setup ( const JacobianTransposed &jt )
\n-
493 {
\n-
494 detInv_ = MatrixHelper::template rightInvA< mydimension, coorddimension >( jt, static_cast< Base & >( *this ) );
\n-
495 }
\n-
\n-
496
\n-
\n-\n-
498 {
\n-
499 detInv_ = MatrixHelper::template sqrtDetAAT< mydimension, coorddimension >( jt );
\n-
500 }
\n-
\n+
493 const GeometryType &type ( int i, int c ) const
\n+
494 {
\n+
495 assert( (i >= 0) && (i < size( c )) );
\n+
496 return info_[ c ][ i ].type();
\n+
497 }
\n+
498
\n+
500 const GeometryType &type () const { return type( 0, 0 ); }
\n
501
\n-
502 ctype det () const { return ctype( 1 ) / detInv_; }
\n-
503 ctype detInv () const { return detInv_; }
\n-
504
\n-
505 private:
\n-
506 ctype detInv_;
\n-
507 };
\n-
\n-
508
\n-
509
\n-
510
\n-
523 template< class ct, int mydim, int cdim, class Traits = MultiLinearGeometryTraits< ct > >
\n-
\n-\n-
525 : public MultiLinearGeometry< ct, mydim, cdim, Traits >
\n-
526 {
\n-\n-\n+
511 const Coordinate &position( int i, int c ) const
\n+
512 {
\n+
513 assert( (c >= 0) && (c <= dim) );
\n+
514 return baryCenters_[ c ][ i ];
\n+
515 }
\n+
516
\n+
524 bool checkInside ( const Coordinate &local ) const
\n+
525 {
\n+
526 const ctype tolerance = ctype( 64 ) * std::numeric_limits< ctype >::epsilon();
\n+
527 return Impl::template checkInside< ctype, dim >( type().id(), dim, local, tolerance );
\n+
528 }
\n
529
\n-
530 protected:
\n-\n-
532
\n-
533 public:
\n-\n-
535
\n-
536 typedef typename Base::ctype ctype;
\n-
537
\n-
538 using Base::mydimension;
\n-\n-
540
\n-\n-\n-
543 typedef typename Base::Volume Volume;
\n-
544
\n-\n-\n-
547 typedef typename Base::Jacobian Jacobian;
\n-\n-
549
\n-
550 template< class CornerStorage >
\n-
\n-
551 CachedMultiLinearGeometry ( const ReferenceElement &referenceElement, const CornerStorage &cornerStorage )
\n-
552 : Base( referenceElement, cornerStorage ),
\n-
553 affine_( Base::affine( jacobianTransposed_ ) ),
\n-
554 jacobianInverseTransposedComputed_( false ),
\n-
555 integrationElementComputed_( false )
\n-
556 {}
\n-
\n-
557
\n-
558 template< class CornerStorage >
\n-
\n-
559 CachedMultiLinearGeometry ( Dune::GeometryType gt, const CornerStorage &cornerStorage )
\n-
560 : Base( gt, cornerStorage ),
\n-
561 affine_( Base::affine( jacobianTransposed_ ) ),
\n-
562 jacobianInverseTransposedComputed_( false ),
\n-
563 integrationElementComputed_( false )
\n-
564 {}
\n-
\n+
541 template< int codim >
\n+
542 typename Codim< codim >::Geometry geometry ( int i ) const
\n+
543 {
\n+
544 return std::get< codim >( geometries_ )[ i ];
\n+
545 }
\n+
546
\n+
548 Volume volume () const
\n+
549 {
\n+
550 return volume_;
\n+
551 }
\n+
552
\n+
560 const Coordinate &integrationOuterNormal ( int face ) const
\n+
561 {
\n+
562 assert( (face >= 0) && (face < int( integrationNormals_.size() )) );
\n+
563 return integrationNormals_[ face ];
\n+
564 }
\n
565
\n-
567 bool affine () const { return affine_; }
\n-
568
\n-
569 using Base::corner;
\n+
566 private:
\n+
567 void initialize ( unsigned int topologyId )
\n+
568 {
\n+
569 assert( topologyId < Impl::numTopologies( dim ) );
\n
570
\n-
572 GlobalCoordinate center () const { return global( refElement().position( 0, 0 ) ); }
\n-
573
\n-
\n-\n-
581 {
\n-
582 if( affine() )
\n-
583 {
\n-\n-
585 jacobianTransposed_.umtv( local, global );
\n-
586 return global;
\n-
587 }
\n-
588 else
\n-
589 return Base::global( local );
\n-
590 }
\n-
\n-
591
\n-
\n-\n-
605 {
\n-
606 if( affine() )
\n-
607 {
\n-\n-
609 if( jacobianInverseTransposedComputed_ )
\n-
610 jacobianInverseTransposed_.mtv( global - corner( 0 ), local );
\n-
611 else
\n-
612 MatrixHelper::template xTRightInvA< mydimension, coorddimension >( jacobianTransposed_, global - corner( 0 ), local );
\n-
613 return local;
\n-
614 }
\n-
615 else
\n-
616 return Base::local( global );
\n-
617 }
\n-
\n-
618
\n-
\n-\n-
634 {
\n-
635 if( affine() )
\n-
636 {
\n-
637 if( !integrationElementComputed_ )
\n-
638 {
\n-
639 jacobianInverseTransposed_.setupDeterminant( jacobianTransposed_ );
\n-
640 integrationElementComputed_ = true;
\n-
641 }
\n-
642 return jacobianInverseTransposed_.detInv();
\n-
643 }
\n-
644 else
\n-\n-
646 }
\n-
\n-
647
\n-
\n-
649 Volume volume () const
\n-
650 {
\n-
651 if( affine() )
\n-
652 return integrationElement( refElement().position( 0, 0 ) ) * refElement().volume();
\n-
653 else
\n-
654 return Base::volume();
\n-
655 }
\n-
\n-
656
\n-
\n-\n-
667 {
\n-
668 if( affine() )
\n-
669 return jacobianTransposed_;
\n-
670 else
\n-\n-
672 }
\n-
\n-
673
\n-
\n-\n-
681 {
\n-
682 if( affine() )
\n-
683 {
\n-
684 if( !jacobianInverseTransposedComputed_ )
\n-
685 {
\n-
686 jacobianInverseTransposed_.setup( jacobianTransposed_ );
\n-
687 jacobianInverseTransposedComputed_ = true;
\n-
688 integrationElementComputed_ = true;
\n-
689 }
\n-
690 return jacobianInverseTransposed_;
\n-
691 }
\n-
692 else
\n-\n-
694 }
\n-
\n-
695
\n-
\n-\n-
703 {
\n-
704 return jacobianTransposed(local).transposed();
\n-
705 }
\n-
\n-
706
\n-
\n-\n-
714 {
\n-
715 return jacobianInverseTransposed(local).transposed();
\n-
716 }
\n-
\n-
717
\n-
718 protected:
\n-
719 using Base::refElement;
\n-
720
\n-
721 private:
\n-
722 mutable JacobianTransposed jacobianTransposed_;
\n-
723 mutable JacobianInverseTransposed jacobianInverseTransposed_;
\n-
724
\n-
725 mutable bool affine_ : 1;
\n-
726
\n-
727 mutable bool jacobianInverseTransposedComputed_ : 1;
\n-
728 mutable bool integrationElementComputed_ : 1;
\n-
729 };
\n-
\n-
730
\n+
571 // set up subentities
\n+
572 for( int codim = 0; codim <= dim; ++codim )
\n+
573 {
\n+
574 const unsigned int size = Impl::size( topologyId, dim, codim );
\n+
575 info_[ codim ].resize( size );
\n+
576 for( unsigned int i = 0; i < size; ++i )
\n+
577 info_[ codim ][ i ].initialize( topologyId, codim, i );
\n+
578 }
\n+
579
\n+
580 // compute corners
\n+
581 const unsigned int numVertices = size( dim );
\n+
582 baryCenters_[ dim ].resize( numVertices );
\n+
583 Impl::referenceCorners( topologyId, dim, &(baryCenters_[ dim ][ 0 ]) );
\n+
584
\n+
585 // compute barycenters
\n+
586 for( int codim = 0; codim < dim; ++codim )
\n+
587 {
\n+
588 baryCenters_[ codim ].resize( size(codim) );
\n+
589 for( int i = 0; i < size( codim ); ++i )
\n+
590 {
\n+
591 baryCenters_[ codim ][ i ] = Coordinate( ctype( 0 ) );
\n+
592 const unsigned int numCorners = size( i, codim, dim );
\n+
593 for( unsigned int j = 0; j < numCorners; ++j )
\n+
594 baryCenters_[ codim ][ i ] += baryCenters_[ dim ][ subEntity( i, codim, j, dim ) ];
\n+
595 baryCenters_[ codim ][ i ] *= ctype( 1 ) / ctype( numCorners );
\n+
596 }
\n+
597 }
\n+
598
\n+
599 // compute reference element volume
\n+
600 volume_ = Impl::template referenceVolume< ctype >( topologyId, dim );
\n+
601
\n+
602 // compute integration outer normals
\n+
603 if( dim > 0 )
\n+
604 {
\n+
605 integrationNormals_.resize( size( 1 ) );
\n+
606 Impl::referenceIntegrationOuterNormals( topologyId, dim, &(integrationNormals_[ 0 ]) );
\n+
607 }
\n+
608
\n+
609 // set up geometries
\n+
610 Hybrid::forEach( std::make_index_sequence< dim+1 >{}, [ & ]( auto i ){ CreateGeometries< i >::apply( *this, geometries_ ); } );
\n+
611 }
\n+
612
\n+
613 template< int... codim >
\n+
614 static std::tuple< std::vector< typename Codim< codim >::Geometry >... >
\n+
615 makeGeometryTable ( std::integer_sequence< int, codim... > );
\n+
616
\n+
618 typedef decltype( makeGeometryTable( std::make_integer_sequence< int, dim+1 >() ) ) GeometryTable;
\n+
619
\n+
621 ctype volume_;
\n+
622
\n+
623 std::vector< Coordinate > baryCenters_[ dim+1 ];
\n+
624 std::vector< Coordinate > integrationNormals_;
\n+
625
\n+
627 GeometryTable geometries_;
\n+
628
\n+
629 std::vector< SubEntityInfo > info_[ dim+1 ];
\n+
630 };
\n+
631
\n+
633 template< class ctype, int dim >
\n+
634 struct ReferenceElementImplementation< ctype, dim >::SubEntityInfo
\n+
635 {
\n+
636 // Compute upper bound for the number of subsentities.
\n+
637 // If someone knows an explicit formal feel free to
\n+
638 // implement it here.
\n+
639 static constexpr std::size_t maxSubEntityCount()
\n+
640 {
\n+
641 std::size_t maxCount=0;
\n+
642 for(std::size_t codim=0; codim<=dim; ++codim)
\n+
643 maxCount = std::max(maxCount, binomial(std::size_t(dim),codim)*(1 << codim));
\n+
644 return maxCount;
\n+
645 }
\n+
646
\n+
647 using SubEntityFlags = std::bitset<maxSubEntityCount()>;
\n+
648
\n+
649 class SubEntityRange
\n+
650 : public Dune::IteratorRange<const unsigned int*>
\n+
651 {
\n+
652 using Base = typename Dune::IteratorRange<const unsigned int*>;
\n+
653
\n+
654 public:
\n+
655
\n+
656 using iterator = Base::iterator;
\n+
657 using const_iterator = Base::const_iterator;
\n+
658
\n+
659 SubEntityRange(const iterator& begin, const iterator& end, const SubEntityFlags& contains) :
\n+
660 Base(begin, end),
\n+
661 containsPtr_(&contains),
\n+
662 size_(end-begin)
\n+
663 {}
\n+
664
\n+
665 SubEntityRange() :
\n+
666 Base(),
\n+
667 containsPtr_(nullptr),
\n+
668 size_(0)
\n+
669 {}
\n+
670
\n+
671 std::size_t size() const
\n+
672 {
\n+
673 return size_;
\n+
674 }
\n+
675
\n+
676 bool contains(std::size_t i) const
\n+
677 {
\n+
678 return (*containsPtr_)[i];
\n+
679 }
\n+
680
\n+
681 private:
\n+
682 const SubEntityFlags* containsPtr_;
\n+
683 std::size_t size_;
\n+
684 std::size_t offset_;
\n+
685 };
\n+
686
\n+
687 using NumberRange = typename Dune::IteratorRange<const unsigned int*>;
\n+
688
\n+
689 SubEntityInfo ()
\n+
690 : numbering_( nullptr )
\n+
691 {
\n+
692 std::fill( offset_.begin(), offset_.end(), 0 );
\n+
693 }
\n+
694
\n+
695 SubEntityInfo ( const SubEntityInfo &other )
\n+
696 : offset_( other.offset_ ),
\n+
697 type_( other.type_ ),
\n+
698 containsSubentity_( other.containsSubentity_ )
\n+
699 {
\n+
700 numbering_ = allocate();
\n+
701 std::copy( other.numbering_, other.numbering_ + capacity(), numbering_ );
\n+
702 }
\n+
703
\n+
704 ~SubEntityInfo () { deallocate( numbering_ ); }
\n+
705
\n+
706 const SubEntityInfo &operator= ( const SubEntityInfo &other )
\n+
707 {
\n+
708 type_ = other.type_;
\n+
709 offset_ = other.offset_;
\n+
710
\n+
711 deallocate( numbering_ );
\n+
712 numbering_ = allocate();
\n+
713 std::copy( other.numbering_, other.numbering_ + capacity(), numbering_ );
\n+
714
\n+
715 containsSubentity_ = other.containsSubentity_;
\n+
716
\n+
717 return *this;
\n+
718 }
\n+
719
\n+
720 int size ( int cc ) const
\n+
721 {
\n+
722 assert( (cc >= 0) && (cc <= dim) );
\n+
723 return (offset_[ cc+1 ] - offset_[ cc ]);
\n+
724 }
\n+
725
\n+
726 int number ( int ii, int cc ) const
\n+
727 {
\n+
728 assert( (ii >= 0) && (ii < size( cc )) );
\n+
729 return numbering_[ offset_[ cc ] + ii ];
\n+
730 }
\n
731
\n-
732
\n-
733 // Implementation of MultiLinearGeometry
\n-
734 // -------------------------------------
\n-
735
\n-
736 template< class ct, int mydim, int cdim, class Traits >
\n-
737 inline typename MultiLinearGeometry< ct, mydim, cdim, Traits >::JacobianInverseTransposed
\n-
\n-\n-
739 {
\n-\n-
741 jit.setup( jacobianTransposed( local ) );
\n-
742 return jit;
\n-
743 }
\n-
\n-
744
\n-
745
\n-
746 template< class ct, int mydim, int cdim, class Traits >
\n-
747 template< bool add, int dim, class CornerIterator >
\n-\n-
\n-
749 ::global ( TopologyId topologyId, std::integral_constant< int, dim >,
\n-
750 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,
\n-
751 const ctype &rf, GlobalCoordinate &y )
\n-
752 {
\n-
753 const ctype xn = df*x[ dim-1 ];
\n-
754 const ctype cxn = ctype( 1 ) - xn;
\n+
732 auto numbers ( int cc ) const
\n+
733 {
\n+
734 return SubEntityRange( numbering_ + offset_[ cc ], numbering_ + offset_[ cc+1 ], containsSubentity_[cc]);
\n+
735 }
\n+
736
\n+
737 const GeometryType &type () const { return type_; }
\n+
738
\n+
739 void initialize ( unsigned int topologyId, int codim, unsigned int i )
\n+
740 {
\n+
741 const unsigned int subId = Impl::subTopologyId( topologyId, dim, codim, i );
\n+
742 type_ = GeometryType( subId, dim-codim );
\n+
743
\n+
744 // compute offsets
\n+
745 for( int cc = 0; cc <= codim; ++cc )
\n+
746 offset_[ cc ] = 0;
\n+
747 for( int cc = codim; cc <= dim; ++cc )
\n+
748 offset_[ cc+1 ] = offset_[ cc ] + Impl::size( subId, dim-codim, cc-codim );
\n+
749
\n+
750 // compute subnumbering
\n+
751 deallocate( numbering_ );
\n+
752 numbering_ = allocate();
\n+
753 for( int cc = codim; cc <= dim; ++cc )
\n+
754 Impl::subTopologyNumbering( topologyId, dim, codim, i, cc-codim, numbering_+offset_[ cc ], numbering_+offset_[ cc+1 ] );
\n
755
\n-
756 if( Impl::isPrism( toUnsignedInt(topologyId), mydimension, mydimension-dim ) )
\n-
757 {
\n-
758 // apply (1-xn) times mapping for bottom
\n-
759 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit, df, x, rf*cxn, y );
\n-
760 // apply xn times mapping for top
\n-
761 global< true >( topologyId, std::integral_constant< int, dim-1 >(), cit, df, x, rf*xn, y );
\n-
762 }
\n-
763 else
\n-
764 {
\n-
765 assert( Impl::isPyramid( toUnsignedInt(topologyId), mydimension, mydimension-dim ) );
\n-
766 // apply (1-xn) times mapping for bottom (with argument x/(1-xn))
\n-
767 if( cxn > Traits::tolerance() || cxn < -Traits::tolerance() )
\n-
768 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit, df/cxn, x, rf*cxn, y );
\n-
769 else
\n-
770 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit, df, x, ctype( 0 ), y );
\n-
771 // apply xn times the tip
\n-
772 y.axpy( rf*xn, *cit );
\n-
773 ++cit;
\n-
774 }
\n-
775 }
\n-
\n-
776
\n-
777 template< class ct, int mydim, int cdim, class Traits >
\n-
778 template< bool add, class CornerIterator >
\n-\n-
\n-
780 ::global ( TopologyId, std::integral_constant< int, 0 >,
\n-
781 CornerIterator &cit, const ctype &, const LocalCoordinate &,
\n-
782 const ctype &rf, GlobalCoordinate &y )
\n-
783 {
\n-
784 const GlobalCoordinate &origin = *cit;
\n-
785 ++cit;
\n-
786 for( int i = 0; i < coorddimension; ++i )
\n-
787 y[ i ] = (add ? y[ i ] + rf*origin[ i ] : rf*origin[ i ]);
\n-
788 }
\n-
\n-
789
\n+
756 // initialize containsSubentity lookup-table
\n+
757 for(std::size_t cc=0; cc<= dim; ++cc)
\n+
758 {
\n+
759 containsSubentity_[cc].reset();
\n+
760 for(std::size_t idx=0; idx<std::size_t(size(cc)); ++idx)
\n+
761 containsSubentity_[cc][number(idx,cc)] = true;
\n+
762 }
\n+
763 }
\n+
764
\n+
765 protected:
\n+
766 int codim () const { return dim - type().dim(); }
\n+
767
\n+
768 unsigned int *allocate () { return (capacity() != 0 ? new unsigned int[ capacity() ] : nullptr); }
\n+
769 void deallocate ( unsigned int *ptr ) { delete[] ptr; }
\n+
770 unsigned int capacity () const { return offset_[ dim+1 ]; }
\n+
771
\n+
772 private:
\n+
773 unsigned int *numbering_;
\n+
774 std::array< unsigned int, dim+2 > offset_;
\n+
775 GeometryType type_;
\n+
776 std::array< SubEntityFlags, dim+1> containsSubentity_;
\n+
777 };
\n+
778
\n+
779
\n+
780 template< class ctype, int dim >
\n+
781 template< int codim >
\n+
782 struct ReferenceElementImplementation< ctype, dim >::CreateGeometries
\n+
783 {
\n+
784 template< int cc >
\n+
785 static typename ReferenceElements< ctype, dim-cc >::ReferenceElement
\n+
786 subRefElement( const ReferenceElementImplementation< ctype, dim > &refElement, int i, std::integral_constant< int, cc > )
\n+
787 {
\n+
788 return ReferenceElements< ctype, dim-cc >::general( refElement.type( i, cc ) );
\n+
789 }
\n
790
\n-
791 template< class ct, int mydim, int cdim, class Traits >
\n-
792 template< bool add, int rows, int dim, class CornerIterator >
\n-\n-
\n-
794 ::jacobianTransposed ( TopologyId topologyId, std::integral_constant< int, dim >,
\n-
795 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,
\n-
796 const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt )
\n-
797 {
\n-
798 assert( rows >= dim );
\n-
799
\n-
800 const ctype xn = df*x[ dim-1 ];
\n-
801 const ctype cxn = ctype( 1 ) - xn;
\n-
802
\n-
803 auto cit2( cit );
\n-
804 if( Impl::isPrism( toUnsignedInt(topologyId), mydimension, mydimension-dim ) )
\n-
805 {
\n-
806 // apply (1-xn) times Jacobian for bottom
\n-
807 jacobianTransposed< add >( topologyId, std::integral_constant< int, dim-1 >(), cit2, df, x, rf*cxn, jt );
\n-
808 // apply xn times Jacobian for top
\n-
809 jacobianTransposed< true >( topologyId, std::integral_constant< int, dim-1 >(), cit2, df, x, rf*xn, jt );
\n-
810 // compute last row as difference between top value and bottom value
\n-
811 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit, df, x, -rf, jt[ dim-1 ] );
\n-
812 global< true >( topologyId, std::integral_constant< int, dim-1 >(), cit, df, x, rf, jt[ dim-1 ] );
\n-
813 }
\n-
814 else
\n-
815 {
\n-
816 assert( Impl::isPyramid( toUnsignedInt(topologyId), mydimension, mydimension-dim ) );
\n-
817 /*
\n-
818 * In the pyramid case, we need a transformation Tb: B -> R^n for the
\n-
819 * base B \\subset R^{n-1}. The pyramid transformation is then defined as
\n-
820 * T: P \\subset R^n -> R^n
\n-
821 * (x, xn) |-> (1-xn) Tb(x*) + xn t (x \\in R^{n-1}, xn \\in R)
\n-
822 * with the tip of the pyramid mapped to t and x* = x/(1-xn)
\n-
823 * the projection of (x,xn) onto the base.
\n-
824 *
\n-
825 * For the Jacobi matrix DT we get
\n-
826 * DT = ( A | b )
\n-
827 * with A = DTb(x*) (n x n-1 matrix)
\n-
828 * and b = dT/dxn (n-dim column vector).
\n-
829 * Furthermore
\n-
830 * b = -Tb(x*) + t + \\sum_i dTb/dx_i(x^*) x_i/(1-xn)
\n-
831 *
\n-
832 * Note that both A and b are not defined in the pyramid tip (x=0, xn=1)!
\n-
833 * Indeed for B the unit square, Tb mapping B to the quadrilateral given
\n-
834 * by the vertices (0,0,0), (2,0,0), (0,1,0), (1,1,0) and t=(0,0,1), we get
\n-
835 *
\n-
836 * T(x,y,xn) = ( x(2-y/(1-xn)), y, xn )
\n-
837 * / 2-y/(1-xn) -x 0 \\
\n-
838 * DT(x,y,xn) = | 0 1 0 |
\n-
839 * \\ 0 0 1 /
\n-
840 * which is not continuous for xn -> 1, choose for example
\n-
841 * x=0, y=1-xn, xn -> 1 --> DT -> diag(1,1,1)
\n-
842 * x=1-xn, y=0, xn -> 1 --> DT -> diag(2,1,1)
\n-
843 *
\n-
844 * However, for Tb affine-linear, Tb(y) = My + y0, DTb = M:
\n-
845 * A = M
\n-
846 * b = -M x* - y0 + t + \\sum_i M_i x_i/(1-xn)
\n-
847 * = -M x* - y0 + t + M x*
\n-
848 * = -y0 + t
\n-
849 * which is continuous for xn -> 1. Note that this b is also given by
\n-
850 * b = -Tb(0) + t + \\sum_i dTb/dx_i(0) x_i/1
\n-
851 * that is replacing x* by 1 and 1-xn by 1 in the formular above.
\n-
852 *
\n-
853 * For xn -> 1, we can thus set x*=0, "1-xn"=1 (or anything != 0) and get
\n-
854 * the right result in case Tb is affine-linear.
\n-
855 */
\n-
856
\n-
857 /* The second case effectively results in x* = 0 */
\n-
858 ctype dfcxn = (cxn > Traits::tolerance() || cxn < -Traits::tolerance()) ? ctype(df / cxn) : ctype(0);
\n-
859
\n-
860 // initialize last row
\n-
861 // b = -Tb(x*)
\n-
862 // (b = -Tb(0) = -y0 in case xn -> 1 and Tb affine-linear)
\n-
863 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit, dfcxn, x, -rf, jt[ dim-1 ] );
\n-
864 // b += t
\n-
865 jt[ dim-1 ].axpy( rf, *cit );
\n-
866 ++cit;
\n-
867 // apply Jacobian for bottom (with argument x/(1-xn)) and correct last row
\n-
868 if( add )
\n-
869 {
\n-
870 FieldMatrix< ctype, dim-1, coorddimension > jt2;
\n-
871 // jt2 = dTb/dx_i(x*)
\n-
872 jacobianTransposed< false >( topologyId, std::integral_constant< int, dim-1 >(), cit2, dfcxn, x, rf, jt2 );
\n-
873 // A = dTb/dx_i(x*) (jt[j], j=0..dim-1)
\n-
874 // b += \\sum_i dTb/dx_i(x*) x_i/(1-xn) (jt[dim-1])
\n-
875 // (b += 0 in case xn -> 1)
\n-
876 for( int j = 0; j < dim-1; ++j )
\n-
877 {
\n-
878 jt[ j ] += jt2[ j ];
\n-
879 jt[ dim-1 ].axpy( dfcxn*x[ j ], jt2[ j ] );
\n-
880 }
\n-
881 }
\n-
882 else
\n-
883 {
\n-
884 // jt = dTb/dx_i(x*)
\n-
885 jacobianTransposed< false >( topologyId, std::integral_constant< int, dim-1 >(), cit2, dfcxn, x, rf, jt );
\n-
886 // b += \\sum_i dTb/dx_i(x*) x_i/(1-xn)
\n-
887 for( int j = 0; j < dim-1; ++j )
\n-
888 jt[ dim-1 ].axpy( dfcxn*x[ j ], jt[ j ] );
\n-
889 }
\n-
890 }
\n-
891 }
\n-
\n-
892
\n-
893 template< class ct, int mydim, int cdim, class Traits >
\n-
894 template< bool add, int rows, class CornerIterator >
\n-\n-
\n-
896 ::jacobianTransposed ( TopologyId, std::integral_constant< int, 0 >,
\n-
897 CornerIterator &cit, const ctype &, const LocalCoordinate &,
\n-
898 const ctype &, FieldMatrix< ctype, rows, cdim > & )
\n-
899 {
\n-
900 ++cit;
\n-
901 }
\n-
\n-
902
\n-
903
\n-
904
\n-
905 template< class ct, int mydim, int cdim, class Traits >
\n-
906 template< int dim, class CornerIterator >
\n-\n-
\n-
908 ::affine ( TopologyId topologyId, std::integral_constant< int, dim >, CornerIterator &cit, JacobianTransposed &jt )
\n-
909 {
\n-
910 const GlobalCoordinate &orgBottom = *cit;
\n-
911 if( !affine( topologyId, std::integral_constant< int, dim-1 >(), cit, jt ) )
\n-
912 return false;
\n-
913 const GlobalCoordinate &orgTop = *cit;
\n-
914
\n-
915 if( Impl::isPrism( toUnsignedInt(topologyId), mydimension, mydimension-dim ) )
\n-
916 {
\n-
917 JacobianTransposed jtTop;
\n-
918 if( !affine( topologyId, std::integral_constant< int, dim-1 >(), cit, jtTop ) )
\n-
919 return false;
\n-
920
\n-
921 // check whether both jacobians are identical
\n-
922 ctype norm( 0 );
\n-
923 for( int i = 0; i < dim-1; ++i )
\n-
924 norm += (jtTop[ i ] - jt[ i ]).two_norm2();
\n-
925 if( norm >= Traits::tolerance() )
\n-
926 return false;
\n-
927 }
\n-
928 else
\n-
929 ++cit;
\n-
930 jt[ dim-1 ] = orgTop - orgBottom;
\n-
931 return true;
\n-
932 }
\n-
\n-
933
\n-
934 template< class ct, int mydim, int cdim, class Traits >
\n-
935 template< class CornerIterator >
\n-\n-
\n-
937 ::affine ( TopologyId, std::integral_constant< int, 0 >, CornerIterator &cit, JacobianTransposed & )
\n-
938 {
\n-
939 ++cit;
\n-
940 return true;
\n-
941 }
\n-
\n-
\n-
942
\n-
943} // namespace Dune
\n-
944
\n-
945#endif // #ifndef DUNE_GEOMETRY_MULTILINEARGEOMETRY_HH
\n-
\n-
\n-
\n-
\n-
\n-
\n-
\n-\n+\n+
792 subRefElement(const ReferenceElementImplementation< ctype, dim > &refElement,
\n+
793 [[maybe_unused]] int i, std::integral_constant<int, 0>)
\n+
794 {
\n+
795 return refElement;
\n+
796 }
\n+
797
\n+
798 static void apply ( const ReferenceElementImplementation< ctype, dim > &refElement, GeometryTable &geometries )
\n+
799 {
\n+
800 const int size = refElement.size( codim );
\n+
801 std::vector< FieldVector< ctype, dim > > origins( size );
\n+
802 std::vector< FieldMatrix< ctype, dim - codim, dim > > jacobianTransposeds( size );
\n+
803 Impl::referenceEmbeddings( refElement.type().id(), dim, codim, &(origins[ 0 ]), &(jacobianTransposeds[ 0 ]) );
\n+
804
\n+
805 std::get< codim >( geometries ).reserve( size );
\n+
806 for( int i = 0; i < size; ++i )
\n+
807 {
\n+
808 typename Codim< codim >::Geometry geometry( subRefElement( refElement, i, std::integral_constant< int, codim >() ), origins[ i ], jacobianTransposeds[ i ] );
\n+
809 std::get< codim >( geometries ).push_back( geometry );
\n+
810 }
\n+
811 }
\n+
812 };
\n+
813
\n+
814#endif // DOXYGEN
\n+
815
\n+
816 } // namespace Geo
\n+
817
\n+
818} // namespace Dune
\n+
819
\n+
820#endif // #ifndef DUNE_GEOMETRY_REFERENCEELEMENTIMPLEMENTATION_HH
\n+
An implementation of the Geometry interface for affine geometries.
\n
A unique label for each type of element that can occur in a grid.
\n-
An implementation of the Geometry interface for affine geometries.
\n+\n
Definition affinegeometry.hh:21
\n-
Class providing access to the singletons of the reference elements.
Definition referenceelements.hh:170
\n+
@ size
Definition quadraturerules.hh:145
\n+
int binomial(int upper, int lower)
calculate
Definition simplex.cc:305
\n
typename Container::ReferenceElement ReferenceElement
The reference element type.
Definition referenceelements.hh:188
\n-
default traits class for MultiLinearGeometry
Definition multilineargeometry.hh:39
\n-
Impl::FieldMatrixHelper< ct > MatrixHelper
helper structure containing some matrix routines
Definition multilineargeometry.hh:58
\n-
static ct tolerance()
tolerance to numerical algorithms
Definition multilineargeometry.hh:61
\n-
template specifying the storage for the corners
Definition multilineargeometry.hh:129
\n-
std::vector< FieldVector< ct, cdim > > Type
Definition multilineargeometry.hh:130
\n-
will there be only one geometry type for a dimension?
Definition multilineargeometry.hh:148
\n-
static const unsigned int topologyId
Definition multilineargeometry.hh:150
\n-
static const bool v
Definition multilineargeometry.hh:149
\n-
generic geometry implementation based on corner coordinates
Definition multilineargeometry.hh:181
\n-
static void global(TopologyId topologyId, std::integral_constant< int, dim >, CornerIterator &cit, const ctype &df, const LocalCoordinate &x, const ctype &rf, GlobalCoordinate &y)
Definition multilineargeometry.hh:749
\n-
static const int mydimension
geometry dimension
Definition multilineargeometry.hh:189
\n-
Dune::GeometryType type() const
obtain the name of the reference element
Definition multilineargeometry.hh:269
\n-
Traits::MatrixHelper MatrixHelper
Definition multilineargeometry.hh:225
\n-
FieldVector< ctype, coorddimension > GlobalCoordinate
type of global coordinates
Definition multilineargeometry.hh:196
\n-
static void jacobianTransposed(TopologyId topologyId, std::integral_constant< int, 0 >, CornerIterator &cit, const ctype &df, const LocalCoordinate &x, const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt)
Definition multilineargeometry.hh:896
\n-
JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const
obtain the transposed of the Jacobian
Definition multilineargeometry.hh:377
\n-
ReferenceElement refElement() const
Definition multilineargeometry.hh:425
\n-
GlobalCoordinate global(const LocalCoordinate &local) const
evaluate the mapping
Definition multilineargeometry.hh:290
\n-
GlobalCoordinate center() const
obtain the centroid of the mapping's image
Definition multilineargeometry.hh:282
\n-
GlobalCoordinate corner(int i) const
obtain coordinates of the i-th corner
Definition multilineargeometry.hh:275
\n-
Dune::ReferenceElements< ctype, mydimension > ReferenceElements
Definition multilineargeometry.hh:214
\n-
ct ctype
coordinate type
Definition multilineargeometry.hh:186
\n-
static void jacobianTransposed(TopologyId topologyId, std::integral_constant< int, dim >, CornerIterator &cit, const ctype &df, const LocalCoordinate &x, const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt)
Definition multilineargeometry.hh:794
\n-
static const int coorddimension
coordinate dimension
Definition multilineargeometry.hh:191
\n-
int corners() const
obtain number of corners of the corresponding reference element
Definition multilineargeometry.hh:272
\n-
TopologyId topologyId() const
Definition multilineargeometry.hh:430
\n-
friend ReferenceElement referenceElement(const MultiLinearGeometry &geometry)
Definition multilineargeometry.hh:395
\n-
LocalCoordinate local(const GlobalCoordinate &globalCoord) const
evaluate the inverse mapping
Definition multilineargeometry.hh:312
\n-
static void global(TopologyId topologyId, std::integral_constant< int, 0 >, CornerIterator &cit, const ctype &df, const LocalCoordinate &x, const ctype &rf, GlobalCoordinate &y)
Definition multilineargeometry.hh:780
\n-
Volume volume() const
obtain the volume of the mapping's image
Definition multilineargeometry.hh:363
\n-
FieldVector< ctype, mydimension > LocalCoordinate
type of local coordinates
Definition multilineargeometry.hh:194
\n-
MultiLinearGeometry(const ReferenceElement &refElement, const Corners &corners)
constructor
Definition multilineargeometry.hh:239
\n-
static bool affine(TopologyId topologyId, std::integral_constant< int, 0 >, CornerIterator &cit, JacobianTransposed &jt)
Definition multilineargeometry.hh:937
\n-
std::conditional< hasSingleGeometryType, std::integral_constant< unsignedint, Traits::templatehasSingleGeometryType< mydimension >::topologyId >, unsignedint >::type TopologyId
Definition multilineargeometry.hh:226
\n-
ctype Volume
type of volume
Definition multilineargeometry.hh:198
\n-
static bool affine(TopologyId topologyId, std::integral_constant< int, dim >, CornerIterator &cit, JacobianTransposed &jt)
Definition multilineargeometry.hh:908
\n-
JacobianInverse jacobianInverse(const LocalCoordinate &local) const
Obtain the Jacobian's inverse.
Definition multilineargeometry.hh:418
\n-
MultiLinearGeometry(Dune::GeometryType gt, const Corners &corners)
constructor
Definition multilineargeometry.hh:255
\n-
FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed
type of jacobian transposed
Definition multilineargeometry.hh:201
\n-
ReferenceElements::ReferenceElement ReferenceElement
type of reference element
Definition multilineargeometry.hh:219
\n-
JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate &local) const
obtain the transposed of the Jacobian's inverse
Definition multilineargeometry.hh:738
\n-
FieldMatrix< ctype, coorddimension, mydimension > Jacobian
Type for the Jacobian matrix.
Definition multilineargeometry.hh:207
\n-
bool affine() const
is this mapping affine?
Definition multilineargeometry.hh:262
\n-
FieldMatrix< ctype, mydimension, coorddimension > JacobianInverse
Type for the inverse Jacobian matrix.
Definition multilineargeometry.hh:210
\n-
bool affine(JacobianTransposed &jacobianT) const
Definition multilineargeometry.hh:458
\n-
Volume integrationElement(const LocalCoordinate &local) const
obtain the integration element
Definition multilineargeometry.hh:350
\n-
Jacobian jacobian(const LocalCoordinate &local) const
Obtain the Jacobian.
Definition multilineargeometry.hh:407
\n-
Definition multilineargeometry.hh:488
\n-
void setup(const JacobianTransposed &jt)
Definition multilineargeometry.hh:492
\n-
ctype det() const
Definition multilineargeometry.hh:502
\n-
ctype detInv() const
Definition multilineargeometry.hh:503
\n-
void setupDeterminant(const JacobianTransposed &jt)
Definition multilineargeometry.hh:497
\n-
Implement a MultiLinearGeometry with additional caching.
Definition multilineargeometry.hh:526
\n-
GlobalCoordinate global(const LocalCoordinate &local) const
evaluate the mapping
Definition multilineargeometry.hh:580
\n-
Base::ReferenceElement ReferenceElement
Definition multilineargeometry.hh:534
\n-
bool affine() const
is this mapping affine?
Definition multilineargeometry.hh:567
\n-
CachedMultiLinearGeometry(const ReferenceElement &referenceElement, const CornerStorage &cornerStorage)
Definition multilineargeometry.hh:551
\n-
ReferenceElement refElement() const
Definition multilineargeometry.hh:425
\n-
LocalCoordinate local(const GlobalCoordinate &global) const
evaluate the inverse mapping
Definition multilineargeometry.hh:604
\n-
Base::MatrixHelper MatrixHelper
Definition multilineargeometry.hh:531
\n-
Base::LocalCoordinate LocalCoordinate
Definition multilineargeometry.hh:541
\n-
JacobianInverse jacobianInverse(const LocalCoordinate &local) const
Obtain the Jacobian's inverse.
Definition multilineargeometry.hh:713
\n-
JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const
obtain the transposed of the Jacobian
Definition multilineargeometry.hh:666
\n-
GlobalCoordinate corner(int i) const
obtain coordinates of the i-th corner
Definition multilineargeometry.hh:275
\n-
Volume volume() const
obtain the volume of the mapping's image
Definition multilineargeometry.hh:649
\n-
CachedMultiLinearGeometry(Dune::GeometryType gt, const CornerStorage &cornerStorage)
Definition multilineargeometry.hh:559
\n-
ctype integrationElement(const LocalCoordinate &local) const
obtain the integration element
Definition multilineargeometry.hh:633
\n-
Base::ctype ctype
Definition multilineargeometry.hh:536
\n-
Jacobian jacobian(const LocalCoordinate &local) const
Obtain the Jacobian.
Definition multilineargeometry.hh:702
\n-
Base::JacobianInverseTransposed JacobianInverseTransposed
Definition multilineargeometry.hh:546
\n-
Base::JacobianTransposed JacobianTransposed
Definition multilineargeometry.hh:545
\n-
Base::JacobianInverse JacobianInverse
Definition multilineargeometry.hh:548
\n-
Base::Jacobian Jacobian
Definition multilineargeometry.hh:547
\n-
Base::Volume Volume
Definition multilineargeometry.hh:543
\n-
Base::GlobalCoordinate GlobalCoordinate
Definition multilineargeometry.hh:542
\n-
GlobalCoordinate center() const
obtain the centroid of the mapping's image
Definition multilineargeometry.hh:572
\n-
JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate &local) const
obtain the transposed of the Jacobian's inverse
Definition multilineargeometry.hh:680
\n-
Unique label for each type of entities that can occur in DUNE grids.
Definition type.hh:126
\n+
static const ReferenceElement & general(const GeometryType &type)
get general reference elements
Definition referenceelements.hh:198
\n
\n \n
\n Generated by \"doxygen\"/ 1.9.8\n
\n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,1024 +7,771 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n-multilineargeometry.hh\n+referenceelementimplementation.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file\n LICENSE.md in module root\n 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n- 5#ifndef DUNE_GEOMETRY_MULTILINEARGEOMETRY_HH\n- 6#define DUNE_GEOMETRY_MULTILINEARGEOMETRY_HH\n+ 5#ifndef DUNE_GEOMETRY_REFERENCEELEMENTIMPLEMENTATION_HH\n+ 6#define DUNE_GEOMETRY_REFERENCEELEMENTIMPLEMENTATION_HH\n 7\n 8#include \n- 9#include \n- 10#include \n+ 9\n+ 10#include \n 11#include \n- 12#include \n- 13\n- 14#include \n- 15#include \n- 16#include \n+ 12#include \n+ 13#include \n+ 14#include \n+ 15#include \n+ 16#include \n 17\n- 18#include \n- 19#include \n- 20#include \n- 21\n- 22namespace Dune\n- 23{\n+ 18#include \n+ 19#include \n+ 20#include \n+ 21#include \n+ 22#include \n+ 23#include \n 24\n- 25 // MultiLinearGeometryTraits\n- 26 // -------------------------\n- 27\n- 37 template< class ct >\n-38 struct MultiLinearGeometryTraits\n- 39 {\n-58 typedef Impl::FieldMatrixHelper< ct > MatrixHelper;\n- 59\n-61 static ct tolerance () { return ct( 16 ) * std::numeric_limits< ct >::\n-epsilon(); }\n- 62\n- 127 template< int mydim, int cdim >\n-128 struct CornerStorage\n- 129 {\n-130 typedef std::vector< FieldVector< ct, cdim > > Type;\n- 131 };\n- 132\n- 146 template< int dim >\n-147 struct hasSingleGeometryType\n- 148 {\n-149 static const bool v = false;\n-150 static const unsigned int topologyId = ~0u;\n- 151 };\n- 152 };\n- 153\n- 154\n- 155\n- 156 // MultiLinearGeometry\n- 157 // -------------------\n+ 25#include \n+ 26#include \n+ 27#include \n+ 28\n+ 29namespace Dune\n+ 30{\n+ 31\n+ 32 namespace Geo\n+ 33 {\n+ 34\n+ 35#ifndef DOXYGEN\n+ 36\n+ 37 // Internal Forward Declarations\n+ 38 // -----------------------------\n+ 39\n+ 40 namespace Impl\n+ 41 {\n+ 42 template< class ctype, int dim >\n+ 43 class ReferenceElementContainer;\n+ 44 }\n+ 45\n+ 46 template< class ctype, int dim >\n+ 47 struct ReferenceElements;\n+ 48\n+ 49\n+ 50\n+ 51 namespace Impl\n+ 52 {\n+ 53\n+ 54 using Dune::Impl::isPrism;\n+ 55 using Dune::Impl::isPyramid;\n+ 56 using Dune::Impl::baseTopologyId;\n+ 57 using Dune::Impl::prismConstruction;\n+ 58 using Dune::Impl::pyramidConstruction;\n+ 59 using Dune::Impl::numTopologies;\n+ 60\n+ 62 unsigned int size ( unsigned int topologyId, int dim, int codim );\n+ 63\n+ 64\n+ 65\n+ 73 unsigned int subTopologyId ( unsigned int topologyId, int dim, int codim,\n+unsigned int i );\n+ 74\n+ 75\n+ 76\n+ 77 // subTopologyNumbering\n+ 78 // --------------------\n+ 79\n+ 80 void subTopologyNumbering ( unsigned int topologyId, int dim, int codim,\n+unsigned int i, int subcodim,\n+ 81 unsigned int *beginOut, unsigned int *endOut );\n+ 82\n+ 83\n+ 84\n+ 85\n+ 86 // checkInside\n+ 87 // -----------\n+ 88\n+ 89 template< class ct, int cdim >\n+ 90 inline bool\n+ 91 checkInside ( unsigned int topologyId, int dim, const FieldVector< ct, cdim\n+> &x, ct tolerance, ct factor = ct( 1 ) )\n+ 92 {\n+ 93 assert( (dim >= 0) && (dim <= cdim) );\n+ 94 assert( topologyId < numTopologies( dim ) );\n+ 95\n+ 96 if( dim > 0 )\n+ 97 {\n+ 98 const ct baseFactor = (isPrism( topologyId, dim ) ? factor : factor - x\n+[ dim-1 ]);\n+ 99 if( (x[ dim-1 ] > -tolerance) && (factor - x[ dim-1 ] > -tolerance) )\n+ 100 return checkInside< ct, cdim >( baseTopologyId( topologyId, dim ), dim-1,\n+x, tolerance, baseFactor );\n+ 101 else\n+ 102 return false;\n+ 103 }\n+ 104 else\n+ 105 return true;\n+ 106 }\n+ 107\n+ 108\n+ 109\n+ 110 // referenceCorners\n+ 111 // ----------------\n+ 112\n+ 113 template< class ct, int cdim >\n+ 114 inline unsigned int\n+ 115 referenceCorners ( unsigned int topologyId, int dim, FieldVector< ct, cdim\n+> *corners )\n+ 116 {\n+ 117 assert( (dim >= 0) && (dim <= cdim) );\n+ 118 assert( topologyId < numTopologies( dim ) );\n+ 119\n+ 120 if( dim > 0 )\n+ 121 {\n+ 122 const unsigned int nBaseCorners\n+ 123 = referenceCorners( baseTopologyId( topologyId, dim ), dim-1, corners );\n+ 124 assert( nBaseCorners == size( baseTopologyId( topologyId, dim ), dim-1,\n+dim-1 ) );\n+ 125 if( isPrism( topologyId, dim ) )\n+ 126 {\n+ 127 std::copy( corners, corners + nBaseCorners, corners + nBaseCorners );\n+ 128 for( unsigned int i = 0; i < nBaseCorners; ++i )\n+ 129 corners[ i+nBaseCorners ][ dim-1 ] = ct( 1 );\n+ 130 return 2*nBaseCorners;\n+ 131 }\n+ 132 else\n+ 133 {\n+ 134 corners[ nBaseCorners ] = FieldVector< ct, cdim >( ct( 0 ) );\n+ 135 corners[ nBaseCorners ][ dim-1 ] = ct( 1 );\n+ 136 return nBaseCorners+1;\n+ 137 }\n+ 138 }\n+ 139 else\n+ 140 {\n+ 141 *corners = FieldVector< ct, cdim >( ct( 0 ) );\n+ 142 return 1;\n+ 143 }\n+ 144 }\n+ 145\n+ 146\n+ 147\n+ 148 // referenceVolume\n+ 149 // ---------------\n+ 150\n+ 151 unsigned long referenceVolumeInverse ( unsigned int topologyId, int dim );\n+ 152\n+ 153 template< class ct >\n+ 154 inline ct referenceVolume ( unsigned int topologyId, int dim )\n+ 155 {\n+ 156 return ct( 1 ) / ct( referenceVolumeInverse( topologyId, dim ) );\n+ 157 }\n 158\n- 179 template< class ct, int mydim, int cdim, class Traits =\n-MultiLinearGeometryTraits< ct > >\n-180 class MultiLinearGeometry\n- 181 {\n- 182 typedef MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_> This;\n- 183\n- 184 public:\n-186 typedef ct ctype;\n- 187\n-189 static const int mydimension= mydim;\n-191 static const int coorddimension = cdim;\n- 192\n-194 typedef FieldVector< ctype, mydimension > LocalCoordinate;\n-196 typedef FieldVector< ctype, coorddimension > GlobalCoordinate;\n-198 typedef ctype Volume;\n- 199\n-201 typedef FieldMatrix< ctype, mydimension, coorddimension >\n-JacobianTransposed;\n- 202\n- 204 class JacobianInverseTransposed;\n+ 159\n+ 160\n+ 161 // referenceOrigins\n+ 162 // ----------------\n+ 163\n+ 164 template< class ct, int cdim >\n+ 165 inline unsigned int\n+ 166 referenceOrigins ( unsigned int topologyId, int dim, int codim,\n+FieldVector< ct, cdim > *origins )\n+ 167 {\n+ 168 assert( (dim >= 0) && (dim <= cdim) );\n+ 169 assert( topologyId < numTopologies( dim ) );\n+ 170 assert( (codim >= 0) && (codim <= dim) );\n+ 171\n+ 172 if( codim > 0 )\n+ 173 {\n+ 174 const unsigned int baseId = baseTopologyId( topologyId, dim );\n+ 175 if( isPrism( topologyId, dim ) )\n+ 176 {\n+ 177 const unsigned int n = (codim < dim ? referenceOrigins( baseId, dim-1,\n+codim, origins ) : 0);\n+ 178 const unsigned int m = referenceOrigins( baseId, dim-1, codim-1, origins+n\n+);\n+ 179 for( unsigned int i = 0; i < m; ++i )\n+ 180 {\n+ 181 origins[ n+m+i ] = origins[ n+i ];\n+ 182 origins[ n+m+i ][ dim-1 ] = ct( 1 );\n+ 183 }\n+ 184 return n+2*m;\n+ 185 }\n+ 186 else\n+ 187 {\n+ 188 const unsigned int m = referenceOrigins( baseId, dim-1, codim-1, origins\n+);\n+ 189 if( codim == dim )\n+ 190 {\n+ 191 origins[ m ] = FieldVector< ct, cdim >( ct( 0 ) );\n+ 192 origins[ m ][ dim-1 ] = ct( 1 );\n+ 193 return m+1;\n+ 194 }\n+ 195 else\n+ 196 return m+referenceOrigins( baseId, dim-1, codim, origins+m );\n+ 197 }\n+ 198 }\n+ 199 else\n+ 200 {\n+ 201 origins[ 0 ] = FieldVector< ct, cdim >( ct( 0 ) );\n+ 202 return 1;\n+ 203 }\n+ 204 }\n 205\n-207 typedef FieldMatrix< ctype, coorddimension, mydimension > Jacobian;\n- 208\n-210 typedef FieldMatrix< ctype, mydimension, coorddimension > JacobianInverse;\n- 211\n- 212 protected:\n- 213\n-214 typedef Dune::ReferenceElements<_ctype,_mydimension_> ReferenceElements;\n- 215\n- 216 public:\n- 217\n-219 typedef typename ReferenceElements::ReferenceElement ReferenceElement;\n+ 206\n+ 207\n+ 208 // referenceEmbeddings\n+ 209 // -------------------\n+ 210\n+ 211 template< class ct, int cdim, int mydim >\n+ 212 inline unsigned int\n+ 213 referenceEmbeddings ( unsigned int topologyId, int dim, int codim,\n+ 214 FieldVector< ct, cdim > *origins,\n+ 215 FieldMatrix< ct, mydim, cdim > *jacobianTransposeds )\n+ 216 {\n+ 217 assert( (0 <= codim) && (codim <= dim) && (dim <= cdim) );\n+ 218 assert( (dim - codim <= mydim) && (mydim <= cdim) );\n+ 219 assert( topologyId < numTopologies( dim ) );\n 220\n- 221 private:\n- 222 static const bool hasSingleGeometryType = Traits::template\n-hasSingleGeometryType< mydimension >::v;\n- 223\n- 224 protected:\n-225 typedef typename Traits::MatrixHelper MatrixHelper;\n-226 typedef typename std::conditional< hasSingleGeometryType, std::\n-integral_constant< unsigned int, Traits::template hasSingleGeometryType<\n-mydimension >::topologyId >, unsigned int >::type TopologyId;\n- 227\n- 228 public:\n- 238 template< class Corners >\n-239 MultiLinearGeometry ( const ReferenceElement &refElement,\n- 240 const Corners &corners )\n- 241 : refElement_( refElement ),\n- 242 corners_( corners )\n- 243 {}\n- 244\n- 254 template< class Corners >\n-255 MultiLinearGeometry ( Dune::GeometryType gt,\n- 256 const Corners &corners )\n- 257 : refElement_( ReferenceElements::general( gt ) ),\n- 258 corners_( corners )\n- 259 {}\n- 260\n-262 bool affine () const\n- 263 {\n- 264 JacobianTransposed jt;\n- 265 return affine( jt );\n- 266 }\n- 267\n-269 Dune::GeometryType type () const { return GeometryType( toUnsignedInt\n-(topologyId()), mydimension ); }\n+ 221 if( codim > 0 )\n+ 222 {\n+ 223 const unsigned int baseId = baseTopologyId( topologyId, dim );\n+ 224 if( isPrism( topologyId, dim ) )\n+ 225 {\n+ 226 const unsigned int n = (codim < dim ? referenceEmbeddings( baseId, dim-1,\n+codim, origins, jacobianTransposeds ) : 0);\n+ 227 for( unsigned int i = 0; i < n; ++i )\n+ 228 jacobianTransposeds[ i ][ dim-codim-1 ][ dim-1 ] = ct( 1 );\n+ 229\n+ 230 const unsigned int m = referenceEmbeddings( baseId, dim-1, codim-1,\n+origins+n, jacobianTransposeds+n );\n+ 231 std::copy( origins+n, origins+n+m, origins+n+m );\n+ 232 std::copy( jacobianTransposeds+n, jacobianTransposeds+n+m,\n+jacobianTransposeds+n+m );\n+ 233 for( unsigned int i = 0; i < m; ++i )\n+ 234 origins[ n+m+i ][ dim-1 ] = ct( 1 );\n+ 235\n+ 236 return n+2*m;\n+ 237 }\n+ 238 else\n+ 239 {\n+ 240 const unsigned int m = referenceEmbeddings( baseId, dim-1, codim-1,\n+origins, jacobianTransposeds );\n+ 241 if( codim == dim )\n+ 242 {\n+ 243 origins[ m ] = FieldVector< ct, cdim >( ct( 0 ) );\n+ 244 origins[ m ][ dim-1 ] = ct( 1 );\n+ 245 jacobianTransposeds[ m ] = FieldMatrix< ct, mydim, cdim >( ct( 0 ) );\n+ 246 return m+1;\n+ 247 }\n+ 248 else\n+ 249 {\n+ 250 const unsigned int n = referenceEmbeddings( baseId, dim-1, codim,\n+origins+m, jacobianTransposeds+m );\n+ 251 for( unsigned int i = 0; i < n; ++i )\n+ 252 {\n+ 253 for( int k = 0; k < dim-1; ++k )\n+ 254 jacobianTransposeds[ m+i ][ dim-codim-1 ][ k ] = -origins[ m+i ][ k ];\n+ 255 jacobianTransposeds[ m+i ][ dim-codim-1 ][ dim-1 ] = ct( 1 );\n+ 256 }\n+ 257 return m+n;\n+ 258 }\n+ 259 }\n+ 260 }\n+ 261 else\n+ 262 {\n+ 263 origins[ 0 ] = FieldVector< ct, cdim >( ct( 0 ) );\n+ 264 jacobianTransposeds[ 0 ] = FieldMatrix< ct, mydim, cdim >( ct( 0 ) );\n+ 265 for( int k = 0; k < dim; ++k )\n+ 266 jacobianTransposeds[ 0 ][ k ][ k ] = ct( 1 );\n+ 267 return 1;\n+ 268 }\n+ 269 }\n 270\n-272 int corners () const { return refElement().size( mydimension ); }\n- 273\n-275 GlobalCoordinate corner ( int i ) const\n- 276 {\n- 277 assert( (i >= 0) && (i < corners()) );\n- 278 return std::cref(corners_).get()[ i ];\n- 279 }\n- 280\n-282 GlobalCoordinate center () const { return global( refElement().position( 0,\n-0 ) ); }\n- 283\n-290 GlobalCoordinate global ( const LocalCoordinate &local ) const\n- 291 {\n- 292 using std::begin;\n- 293\n- 294 auto cit = begin(std::cref(corners_).get());\n- 295 GlobalCoordinate y;\n- 296 global< false >( topologyId(), std::integral_constant< int, mydimension >\n-(), cit, ctype( 1 ), local, ctype( 1 ), y );\n- 297 return y;\n- 298 }\n- 299\n-312 LocalCoordinate local ( const GlobalCoordinate &globalCoord ) const\n- 313 {\n- 314 const ctype tolerance = Traits::tolerance();\n- 315 LocalCoordinate x = refElement().position( 0, 0 );\n- 316 LocalCoordinate dx;\n- 317 const bool affineMapping = this->affine();\n- 318 do\n- 319 {\n- 320 // Newton's method: DF^n dx^n = F^n, x^{n+1} -= dx^n\n- 321 const GlobalCoordinate dglobal = (*this).global( x ) - globalCoord;\n- 322 const bool invertible =\n- 323 MatrixHelper::template xTRightInvA< mydimension, coorddimension >\n-( jacobianTransposed( x ), dglobal, dx );\n- 324 if( ! invertible )\n- 325 return LocalCoordinate( std::numeric_limits< ctype > :: max() );\n- 326\n- 327 // update x with correction\n- 328 x -= dx;\n- 329\n- 330 // for affine mappings only one iteration is needed\n- 331 if ( affineMapping ) break;\n- 332 } while( dx.two_norm2() > tolerance );\n- 333 return x;\n- 334 }\n- 335\n-350 Volume integrationElement ( const LocalCoordinate &local ) const\n- 351 {\n- 352 return MatrixHelper::template sqrtDetAAT< mydimension, coorddimension >\n-( jacobianTransposed( local ) );\n- 353 }\n- 354\n-363 Volume volume () const\n- 364 {\n- 365 return integrationElement( refElement().position( 0, 0 ) ) * refElement\n-().volume();\n- 366 }\n- 367\n-377 JacobianTransposed jacobianTransposed ( const LocalCoordinate &local )\n-const\n- 378 {\n- 379 using std::begin;\n- 380\n- 381 JacobianTransposed jt;\n- 382 auto cit = begin(std::cref(corners_).get());\n- 383 jacobianTransposed< false >( topologyId(), std::integral_constant< int,\n-mydimension >(), cit, ctype( 1 ), local, ctype( 1 ), jt );\n- 384 return jt;\n- 385 }\n- 386\n-393 JacobianInverseTransposed jacobianInverseTransposed ( const LocalCoordinate\n-&local ) const;\n- 394\n-395 friend ReferenceElement referenceElement ( const MultiLinearGeometry\n-&geometry )\n- 396 {\n- 397 return geometry.refElement();\n- 398 }\n+ 271\n+ 272\n+ 273 // referenceIntegrationOuterNormals\n+ 274 // --------------------------------\n+ 275\n+ 276 template< class ct, int cdim >\n+ 277 inline unsigned int\n+ 278 referenceIntegrationOuterNormals ( unsigned int topologyId, int dim,\n+ 279 const FieldVector< ct, cdim > *origins,\n+ 280 FieldVector< ct, cdim > *normals )\n+ 281 {\n+ 282 assert( (dim > 0) && (dim <= cdim) );\n+ 283 assert( topologyId < numTopologies( dim ) );\n+ 284\n+ 285 if( dim > 1 )\n+ 286 {\n+ 287 const unsigned int baseId = baseTopologyId( topologyId, dim );\n+ 288 if( isPrism( topologyId, dim ) )\n+ 289 {\n+ 290 const unsigned int numBaseFaces\n+ 291 = referenceIntegrationOuterNormals( baseId, dim-1, origins, normals );\n+ 292\n+ 293 for( unsigned int i = 0; i < 2; ++i )\n+ 294 {\n+ 295 normals[ numBaseFaces+i ] = FieldVector< ct, cdim >( ct( 0 ) );\n+ 296 normals[ numBaseFaces+i ][ dim-1 ] = ct( 2*int( i )-1 );\n+ 297 }\n+ 298\n+ 299 return numBaseFaces+2;\n+ 300 }\n+ 301 else\n+ 302 {\n+ 303 normals[ 0 ] = FieldVector< ct, cdim >( ct( 0 ) );\n+ 304 normals[ 0 ][ dim-1 ] = ct( -1 );\n+ 305\n+ 306 const unsigned int numBaseFaces\n+ 307 = referenceIntegrationOuterNormals( baseId, dim-1, origins+1, normals+1 );\n+ 308 for( unsigned int i = 1; i <= numBaseFaces; ++i )\n+ 309 normals[ i ][ dim-1 ] = normals[ i ]*origins[ i ];\n+ 310\n+ 311 return numBaseFaces+1;\n+ 312 }\n+ 313 }\n+ 314 else\n+ 315 {\n+ 316 for( unsigned int i = 0; i < 2; ++i )\n+ 317 {\n+ 318 normals[ i ] = FieldVector< ct, cdim >( ct( 0 ) );\n+ 319 normals[ i ][ 0 ] = ct( 2*int( i )-1 );\n+ 320 }\n+ 321\n+ 322 return 2;\n+ 323 }\n+ 324 }\n+ 325\n+ 326 template< class ct, int cdim >\n+ 327 inline unsigned int\n+ 328 referenceIntegrationOuterNormals ( unsigned int topologyId, int dim,\n+ 329 FieldVector< ct, cdim > *normals )\n+ 330 {\n+ 331 assert( (dim > 0) && (dim <= cdim) );\n+ 332\n+ 333 FieldVector< ct, cdim > *origins\n+ 334 = new FieldVector< ct, cdim >[ size( topologyId, dim, 1 ) ];\n+ 335 referenceOrigins( topologyId, dim, 1, origins );\n+ 336\n+ 337 const unsigned int numFaces\n+ 338 = referenceIntegrationOuterNormals( topologyId, dim, origins, normals );\n+ 339 assert( numFaces == size( topologyId, dim, 1 ) );\n+ 340\n+ 341 delete[] origins;\n+ 342\n+ 343 return numFaces;\n+ 344 }\n+ 345\n+ 346 } // namespace Impl\n+ 347\n+ 348\n+ 349\n+ 350 // ReferenceElement\n+ 351 // ----------------\n+ 352\n+ 371 template< class ctype_, int dim >\n+ 372 class ReferenceElementImplementation\n+ 373 {\n+ 374\n+ 375 public:\n+ 376\n+ 378 using ctype = ctype_;\n+ 379\n+ 381 using CoordinateField = ctype;\n+ 382\n+ 384 using Coordinate = Dune::FieldVector;\n+ 385\n+ 387 static constexpr int dimension = dim;\n+ 388\n+ 390 typedef ctype Volume;\n+ 391\n+ 392 private:\n+ 393\n+ 394 friend class Impl::ReferenceElementContainer< ctype, dim >;\n+ 395\n+ 396 struct SubEntityInfo;\n+ 397\n+ 398 template< int codim > struct CreateGeometries;\n 399\n- 400\n-407 Jacobian jacobian (const LocalCoordinate &local) const\n- 408 {\n- 409 return jacobianTransposed(local).transposed();\n- 410 }\n+ 400 public:\n+ 402 template< int codim >\n+ 403 struct Codim\n+ 404 {\n+ 406 typedef AffineGeometry< ctype, dim-codim, dim > Geometry;\n+ 407 };\n+ 408\n+ 409 // ReferenceElement cannot be copied.\n+ 410 ReferenceElementImplementation ( const ReferenceElementImplementation& ) =\n+delete;\n 411\n-418 JacobianInverse jacobianInverse (const LocalCoordinate &local) const\n- 419 {\n- 420 return jacobianInverseTransposed(local).transposed();\n- 421 }\n- 422\n- 423 protected:\n- 424\n-425 ReferenceElement refElement () const\n- 426 {\n- 427 return refElement_;\n- 428 }\n- 429\n-430 TopologyId topologyId () const\n- 431 {\n- 432 return topologyId( std::integral_constant< bool, hasSingleGeometryType >()\n-);\n- 433 }\n- 434\n- 435 template< bool add, int dim, class CornerIterator >\n-436 static void global ( TopologyId topologyId, std::integral_constant< int,\n-dim >,\n- 437 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,\n- 438 const ctype &rf, GlobalCoordinate &y );\n- 439 template< bool add, class CornerIterator >\n-440 static void global ( TopologyId topologyId, std::integral_constant< int, 0\n->,\n- 441 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,\n- 442 const ctype &rf, GlobalCoordinate &y );\n- 443\n- 444 template< bool add, int rows, int dim, class CornerIterator >\n-445 static void jacobianTransposed ( TopologyId topologyId, std::\n-integral_constant< int, dim >,\n- 446 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,\n- 447 const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt );\n- 448 template< bool add, int rows, class CornerIterator >\n-449 static void jacobianTransposed ( TopologyId topologyId, std::\n-integral_constant< int, 0 >,\n- 450 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,\n- 451 const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt );\n- 452\n- 453 template< int dim, class CornerIterator >\n-454 static bool affine ( TopologyId topologyId, std::integral_constant< int,\n-dim >, CornerIterator &cit, JacobianTransposed &jt );\n- 455 template< class CornerIterator >\n-456 static bool affine ( TopologyId topologyId, std::integral_constant< int, 0\n->, CornerIterator &cit, JacobianTransposed &jt );\n- 457\n-458 bool affine ( JacobianTransposed &jacobianT ) const\n+ 412 // ReferenceElementImplementation cannot be copied.\n+ 413 ReferenceElementImplementation& operator= ( const\n+ReferenceElementImplementation& ) = delete;\n+ 414\n+ 415 // ReferenceElementImplementation is default-constructible (required for\n+storage in std::array)\n+ 416 ReferenceElementImplementation () = default;\n+ 417\n+ 422 int size ( int c ) const\n+ 423 {\n+ 424 assert( (c >= 0) && (c <= dim) );\n+ 425 return info_[ c ].size();\n+ 426 }\n+ 427\n+ 439 int size ( int i, int c, int cc ) const\n+ 440 {\n+ 441 assert( (i >= 0) && (i < size( c )) );\n+ 442 return info_[ c ][ i ].size( cc );\n+ 443 }\n+ 444\n+ 458 int subEntity ( int i, int c, int ii, int cc ) const\n 459 {\n- 460 using std::begin;\n- 461\n- 462 auto cit = begin(std::cref(corners_).get());\n- 463 return affine( topologyId(), std::integral_constant< int, mydimension >(),\n-cit, jacobianT );\n- 464 }\n- 465\n- 466 private:\n- 467 // The following methods are needed to convert the return type of\n-topologyId to\n- 468 // unsigned int with g++-4.4. It has problems casting integral_constant to\n-the\n- 469 // integral type.\n- 470 static unsigned int toUnsignedInt(unsigned int i) { return i; }\n- 471 template\n- 472 static unsigned int toUnsignedInt(std::integral_constant )\n-{ return v; }\n- 473 TopologyId topologyId ( std::integral_constant< bool, true > ) const\n-{ return TopologyId(); }\n- 474 unsigned int topologyId ( std::integral_constant< bool, false > ) const\n-{ return refElement().type().id(); }\n- 475\n- 476 ReferenceElement refElement_;\n- 477 typename Traits::template CornerStorage< mydimension, coorddimension >::\n-Type corners_;\n- 478 };\n- 479\n- 480\n- 481\n- 482 // MultiLinearGeometry::JacobianInverseTransposed\n- 483 // ----------------------------------------------\n+ 460 assert( (i >= 0) && (i < size( c )) );\n+ 461 return info_[ c ][ i ].number( ii, cc );\n+ 462 }\n+ 463\n+ 479 auto subEntities ( int i, int c, int cc ) const\n+ 480 {\n+ 481 assert( (i >= 0) && (i < size( c )) );\n+ 482 return info_[ c ][ i ].numbers( cc );\n+ 483 }\n 484\n- 485 template< class ct, int mydim, int cdim, class Traits >\n-486 class MultiLinearGeometry< ct, mydim, cdim, Traits >::\n-JacobianInverseTransposed\n- 487 : public FieldMatrix< ctype, coorddimension, mydimension >\n- 488 {\n- 489 typedef FieldMatrix< ctype, coorddimension, mydimension > Base;\n- 490\n- 491 public:\n-492 void setup ( const JacobianTransposed &jt )\n- 493 {\n- 494 detInv_ = MatrixHelper::template rightInvA< mydimension, coorddimension >\n-( jt, static_cast< Base & >( *this ) );\n- 495 }\n- 496\n-497 void setupDeterminant ( const JacobianTransposed &jt )\n- 498 {\n- 499 detInv_ = MatrixHelper::template sqrtDetAAT< mydimension, coorddimension >\n-( jt );\n- 500 }\n+ 493 const GeometryType &type ( int i, int c ) const\n+ 494 {\n+ 495 assert( (i >= 0) && (i < size( c )) );\n+ 496 return info_[ c ][ i ].type();\n+ 497 }\n+ 498\n+ 500 const GeometryType &type () const { return type( 0, 0 ); }\n 501\n-502 ctype det () const { return ctype( 1 ) / detInv_; }\n-503 ctype detInv () const { return detInv_; }\n- 504\n- 505 private:\n- 506 ctype detInv_;\n- 507 };\n- 508\n- 509\n- 510\n- 523 template< class ct, int mydim, int cdim, class Traits =\n-MultiLinearGeometryTraits< ct > >\n-524 class CachedMultiLinearGeometry\n- 525 : public MultiLinearGeometry< ct, mydim, cdim, Traits >\n- 526 {\n- 527 typedef CachedMultiLinearGeometry<_ct,_mydim,_cdim,_Traits_> This;\n- 528 typedef MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_> Base;\n+ 511 const Coordinate &position( int i, int c ) const\n+ 512 {\n+ 513 assert( (c >= 0) && (c <= dim) );\n+ 514 return baryCenters_[ c ][ i ];\n+ 515 }\n+ 516\n+ 524 bool checkInside ( const Coordinate &local ) const\n+ 525 {\n+ 526 const ctype tolerance = ctype( 64 ) * std::numeric_limits< ctype >::\n+epsilon();\n+ 527 return Impl::template checkInside< ctype, dim >( type().id(), dim, local,\n+tolerance );\n+ 528 }\n 529\n- 530 protected:\n-531 typedef typename Base::MatrixHelper MatrixHelper;\n- 532\n- 533 public:\n-534 typedef typename Base::ReferenceElement ReferenceElement;\n- 535\n-536 typedef typename Base::ctype ctype;\n- 537\n- 538 using Base::mydimension;\n- 539 using Base::coorddimension;\n- 540\n-541 typedef typename Base::LocalCoordinate LocalCoordinate;\n-542 typedef typename Base::GlobalCoordinate GlobalCoordinate;\n-543 typedef typename Base::Volume Volume;\n- 544\n-545 typedef typename Base::JacobianTransposed JacobianTransposed;\n-546 typedef typename Base::JacobianInverseTransposed JacobianInverseTransposed;\n-547 typedef typename Base::Jacobian Jacobian;\n-548 typedef typename Base::JacobianInverse JacobianInverse;\n- 549\n- 550 template< class CornerStorage >\n-551 CachedMultiLinearGeometry ( const ReferenceElement &referenceElement, const\n-CornerStorage &cornerStorage )\n- 552 : Base( referenceElement, cornerStorage ),\n- 553 affine_( Base::affine( jacobianTransposed_ ) ),\n- 554 jacobianInverseTransposedComputed_( false ),\n- 555 integrationElementComputed_( false )\n- 556 {}\n- 557\n- 558 template< class CornerStorage >\n-559 CachedMultiLinearGeometry ( Dune::GeometryType gt, const CornerStorage\n-&cornerStorage )\n- 560 : Base( gt, cornerStorage ),\n- 561 affine_( Base::affine( jacobianTransposed_ ) ),\n- 562 jacobianInverseTransposedComputed_( false ),\n- 563 integrationElementComputed_( false )\n- 564 {}\n+ 541 template< int codim >\n+ 542 typename Codim< codim >::Geometry geometry ( int i ) const\n+ 543 {\n+ 544 return std::get< codim >( geometries_ )[ i ];\n+ 545 }\n+ 546\n+ 548 Volume volume () const\n+ 549 {\n+ 550 return volume_;\n+ 551 }\n+ 552\n+ 560 const Coordinate &integrationOuterNormal ( int face ) const\n+ 561 {\n+ 562 assert( (face >= 0) && (face < int( integrationNormals_.size() )) );\n+ 563 return integrationNormals_[ face ];\n+ 564 }\n 565\n-567 bool affine () const { return affine_; }\n- 568\n- 569 using Base::corner;\n+ 566 private:\n+ 567 void initialize ( unsigned int topologyId )\n+ 568 {\n+ 569 assert( topologyId < Impl::numTopologies( dim ) );\n 570\n-572 GlobalCoordinate center () const { return global( refElement().position( 0,\n-0 ) ); }\n- 573\n-580 GlobalCoordinate global ( const LocalCoordinate &local ) const\n- 581 {\n- 582 if( affine() )\n- 583 {\n- 584 GlobalCoordinate global( corner( 0 ) );\n- 585 jacobianTransposed_.umtv( local, global );\n- 586 return global;\n- 587 }\n- 588 else\n- 589 return Base::global( local );\n- 590 }\n- 591\n-604 LocalCoordinate local ( const GlobalCoordinate &global ) const\n- 605 {\n- 606 if( affine() )\n- 607 {\n- 608 LocalCoordinate local;\n- 609 if( jacobianInverseTransposedComputed_ )\n- 610 jacobianInverseTransposed_.mtv( global - corner( 0 ), local );\n- 611 else\n- 612 MatrixHelper::template xTRightInvA< mydimension, coorddimension >\n-( jacobianTransposed_, global - corner( 0 ), local );\n- 613 return local;\n- 614 }\n- 615 else\n- 616 return Base::local( global );\n- 617 }\n- 618\n-633 ctype integrationElement ( const LocalCoordinate &local ) const\n- 634 {\n- 635 if( affine() )\n- 636 {\n- 637 if( !integrationElementComputed_ )\n- 638 {\n- 639 jacobianInverseTransposed_.setupDeterminant( jacobianTransposed_ );\n- 640 integrationElementComputed_ = true;\n- 641 }\n- 642 return jacobianInverseTransposed_.detInv();\n- 643 }\n- 644 else\n- 645 return Base::integrationElement( local );\n- 646 }\n- 647\n-649 Volume volume () const\n- 650 {\n- 651 if( affine() )\n- 652 return integrationElement( refElement().position( 0, 0 ) ) * refElement\n-().volume();\n- 653 else\n- 654 return Base::volume();\n- 655 }\n- 656\n-666 JacobianTransposed jacobianTransposed ( const LocalCoordinate &local )\n-const\n- 667 {\n- 668 if( affine() )\n- 669 return jacobianTransposed_;\n- 670 else\n- 671 return Base::jacobianTransposed( local );\n- 672 }\n- 673\n-680 JacobianInverseTransposed jacobianInverseTransposed ( const LocalCoordinate\n-&local ) const\n- 681 {\n- 682 if( affine() )\n- 683 {\n- 684 if( !jacobianInverseTransposedComputed_ )\n- 685 {\n- 686 jacobianInverseTransposed_.setup( jacobianTransposed_ );\n- 687 jacobianInverseTransposedComputed_ = true;\n- 688 integrationElementComputed_ = true;\n- 689 }\n- 690 return jacobianInverseTransposed_;\n- 691 }\n- 692 else\n- 693 return Base::jacobianInverseTransposed( local );\n- 694 }\n- 695\n-702 Jacobian jacobian (const LocalCoordinate &local) const\n- 703 {\n- 704 return jacobianTransposed(local).transposed();\n- 705 }\n- 706\n-713 JacobianInverse jacobianInverse (const LocalCoordinate &local) const\n- 714 {\n- 715 return jacobianInverseTransposed(local).transposed();\n- 716 }\n- 717\n- 718 protected:\n- 719 using Base::refElement;\n- 720\n- 721 private:\n- 722 mutable JacobianTransposed jacobianTransposed_;\n- 723 mutable JacobianInverseTransposed jacobianInverseTransposed_;\n- 724\n- 725 mutable bool affine_ : 1;\n- 726\n- 727 mutable bool jacobianInverseTransposedComputed_ : 1;\n- 728 mutable bool integrationElementComputed_ : 1;\n- 729 };\n- 730\n+ 571 // set up subentities\n+ 572 for( int codim = 0; codim <= dim; ++codim )\n+ 573 {\n+ 574 const unsigned int size = Impl::size( topologyId, dim, codim );\n+ 575 info_[ codim ].resize( size );\n+ 576 for( unsigned int i = 0; i < size; ++i )\n+ 577 info_[ codim ][ i ].initialize( topologyId, codim, i );\n+ 578 }\n+ 579\n+ 580 // compute corners\n+ 581 const unsigned int numVertices = size( dim );\n+ 582 baryCenters_[ dim ].resize( numVertices );\n+ 583 Impl::referenceCorners( topologyId, dim, &(baryCenters_[ dim ][ 0 ]) );\n+ 584\n+ 585 // compute barycenters\n+ 586 for( int codim = 0; codim < dim; ++codim )\n+ 587 {\n+ 588 baryCenters_[ codim ].resize( size(codim) );\n+ 589 for( int i = 0; i < size( codim ); ++i )\n+ 590 {\n+ 591 baryCenters_[ codim ][ i ] = Coordinate( ctype( 0 ) );\n+ 592 const unsigned int numCorners = size( i, codim, dim );\n+ 593 for( unsigned int j = 0; j < numCorners; ++j )\n+ 594 baryCenters_[ codim ][ i ] += baryCenters_[ dim ][ subEntity( i, codim, j,\n+dim ) ];\n+ 595 baryCenters_[ codim ][ i ] *= ctype( 1 ) / ctype( numCorners );\n+ 596 }\n+ 597 }\n+ 598\n+ 599 // compute reference element volume\n+ 600 volume_ = Impl::template referenceVolume< ctype >( topologyId, dim );\n+ 601\n+ 602 // compute integration outer normals\n+ 603 if( dim > 0 )\n+ 604 {\n+ 605 integrationNormals_.resize( size( 1 ) );\n+ 606 Impl::referenceIntegrationOuterNormals( topologyId, dim, &\n+(integrationNormals_[ 0 ]) );\n+ 607 }\n+ 608\n+ 609 // set up geometries\n+ 610 Hybrid::forEach( std::make_index_sequence< dim+1 >{}, [ & ]( auto i )\n+{ CreateGeometries< i >::apply( *this, geometries_ ); } );\n+ 611 }\n+ 612\n+ 613 template< int... codim >\n+ 614 static std::tuple< std::vector< typename Codim< codim >::Geometry >... >\n+ 615 makeGeometryTable ( std::integer_sequence< int, codim... > );\n+ 616\n+ 618 typedef decltype( makeGeometryTable( std::make_integer_sequence< int,\n+dim+1 >() ) ) GeometryTable;\n+ 619\n+ 621 ctype volume_;\n+ 622\n+ 623 std::vector< Coordinate > baryCenters_[ dim+1 ];\n+ 624 std::vector< Coordinate > integrationNormals_;\n+ 625\n+ 627 GeometryTable geometries_;\n+ 628\n+ 629 std::vector< SubEntityInfo > info_[ dim+1 ];\n+ 630 };\n+ 631\n+ 633 template< class ctype, int dim >\n+ 634 struct ReferenceElementImplementation< ctype, dim >::SubEntityInfo\n+ 635 {\n+ 636 // Compute upper bound for the number of subsentities.\n+ 637 // If someone knows an explicit formal feel free to\n+ 638 // implement it here.\n+ 639 static constexpr std::size_t maxSubEntityCount()\n+ 640 {\n+ 641 std::size_t maxCount=0;\n+ 642 for(std::size_t codim=0; codim<=dim; ++codim)\n+ 643 maxCount = std::max(maxCount, binomial(std::size_t(dim),codim)*(1 <<\n+codim));\n+ 644 return maxCount;\n+ 645 }\n+ 646\n+ 647 using SubEntityFlags = std::bitset;\n+ 648\n+ 649 class SubEntityRange\n+ 650 : public Dune::IteratorRange\n+ 651 {\n+ 652 using Base = typename Dune::IteratorRange;\n+ 653\n+ 654 public:\n+ 655\n+ 656 using iterator = Base::iterator;\n+ 657 using const_iterator = Base::const_iterator;\n+ 658\n+ 659 SubEntityRange(const iterator& begin, const iterator& end, const\n+SubEntityFlags& contains) :\n+ 660 Base(begin, end),\n+ 661 containsPtr_(&contains),\n+ 662 size_(end-begin)\n+ 663 {}\n+ 664\n+ 665 SubEntityRange() :\n+ 666 Base(),\n+ 667 containsPtr_(nullptr),\n+ 668 size_(0)\n+ 669 {}\n+ 670\n+ 671 std::size_t size() const\n+ 672 {\n+ 673 return size_;\n+ 674 }\n+ 675\n+ 676 bool contains(std::size_t i) const\n+ 677 {\n+ 678 return (*containsPtr_)[i];\n+ 679 }\n+ 680\n+ 681 private:\n+ 682 const SubEntityFlags* containsPtr_;\n+ 683 std::size_t size_;\n+ 684 std::size_t offset_;\n+ 685 };\n+ 686\n+ 687 using NumberRange = typename Dune::IteratorRange;\n+ 688\n+ 689 SubEntityInfo ()\n+ 690 : numbering_( nullptr )\n+ 691 {\n+ 692 std::fill( offset_.begin(), offset_.end(), 0 );\n+ 693 }\n+ 694\n+ 695 SubEntityInfo ( const SubEntityInfo &other )\n+ 696 : offset_( other.offset_ ),\n+ 697 type_( other.type_ ),\n+ 698 containsSubentity_( other.containsSubentity_ )\n+ 699 {\n+ 700 numbering_ = allocate();\n+ 701 std::copy( other.numbering_, other.numbering_ + capacity(), numbering_ );\n+ 702 }\n+ 703\n+ 704 ~SubEntityInfo () { deallocate( numbering_ ); }\n+ 705\n+ 706 const SubEntityInfo &operator= ( const SubEntityInfo &other )\n+ 707 {\n+ 708 type_ = other.type_;\n+ 709 offset_ = other.offset_;\n+ 710\n+ 711 deallocate( numbering_ );\n+ 712 numbering_ = allocate();\n+ 713 std::copy( other.numbering_, other.numbering_ + capacity(), numbering_ );\n+ 714\n+ 715 containsSubentity_ = other.containsSubentity_;\n+ 716\n+ 717 return *this;\n+ 718 }\n+ 719\n+ 720 int size ( int cc ) const\n+ 721 {\n+ 722 assert( (cc >= 0) && (cc <= dim) );\n+ 723 return (offset_[ cc+1 ] - offset_[ cc ]);\n+ 724 }\n+ 725\n+ 726 int number ( int ii, int cc ) const\n+ 727 {\n+ 728 assert( (ii >= 0) && (ii < size( cc )) );\n+ 729 return numbering_[ offset_[ cc ] + ii ];\n+ 730 }\n 731\n- 732\n- 733 // Implementation of MultiLinearGeometry\n- 734 // -------------------------------------\n- 735\n- 736 template< class ct, int mydim, int cdim, class Traits >\n- 737 inline typename MultiLinearGeometry< ct, mydim, cdim, Traits >::\n-JacobianInverseTransposed\n-738 MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_>::jacobianInverseTransposed\n-( const LocalCoordinate &local ) const\n- 739 {\n- 740 JacobianInverseTransposed jit;\n- 741 jit.setup( jacobianTransposed( local ) );\n- 742 return jit;\n- 743 }\n- 744\n- 745\n- 746 template< class ct, int mydim, int cdim, class Traits >\n- 747 template< bool add, int dim, class CornerIterator >\n- 748 inline void MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_>\n-749::global ( TopologyId topologyId, std::integral_constant< int, dim >,\n- 750 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,\n- 751 const ctype &rf, GlobalCoordinate &y )\n- 752 {\n- 753 const ctype xn = df*x[ dim-1 ];\n- 754 const ctype cxn = ctype( 1 ) - xn;\n+ 732 auto numbers ( int cc ) const\n+ 733 {\n+ 734 return SubEntityRange( numbering_ + offset_[ cc ], numbering_ + offset_\n+[ cc+1 ], containsSubentity_[cc]);\n+ 735 }\n+ 736\n+ 737 const GeometryType &type () const { return type_; }\n+ 738\n+ 739 void initialize ( unsigned int topologyId, int codim, unsigned int i )\n+ 740 {\n+ 741 const unsigned int subId = Impl::subTopologyId( topologyId, dim, codim, i\n+);\n+ 742 type_ = GeometryType( subId, dim-codim );\n+ 743\n+ 744 // compute offsets\n+ 745 for( int cc = 0; cc <= codim; ++cc )\n+ 746 offset_[ cc ] = 0;\n+ 747 for( int cc = codim; cc <= dim; ++cc )\n+ 748 offset_[ cc+1 ] = offset_[ cc ] + Impl::size( subId, dim-codim, cc-codim\n+);\n+ 749\n+ 750 // compute subnumbering\n+ 751 deallocate( numbering_ );\n+ 752 numbering_ = allocate();\n+ 753 for( int cc = codim; cc <= dim; ++cc )\n+ 754 Impl::subTopologyNumbering( topologyId, dim, codim, i, cc-codim,\n+numbering_+offset_[ cc ], numbering_+offset_[ cc+1 ] );\n 755\n- 756 if( Impl::isPrism( toUnsignedInt(topologyId), mydimension, mydimension-dim\n-) )\n- 757 {\n- 758 // apply (1-xn) times mapping for bottom\n- 759 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit,\n-df, x, rf*cxn, y );\n- 760 // apply xn times mapping for top\n- 761 global< true >( topologyId, std::integral_constant< int, dim-1 >(), cit,\n-df, x, rf*xn, y );\n+ 756 // initialize containsSubentity lookup-table\n+ 757 for(std::size_t cc=0; cc<= dim; ++cc)\n+ 758 {\n+ 759 containsSubentity_[cc].reset();\n+ 760 for(std::size_t idx=0; idx Traits::tolerance() || cxn < -Traits::tolerance() )\n- 768 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit,\n-df/cxn, x, rf*cxn, y );\n- 769 else\n- 770 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit,\n-df, x, ctype( 0 ), y );\n- 771 // apply xn times the tip\n- 772 y.axpy( rf*xn, *cit );\n- 773 ++cit;\n- 774 }\n- 775 }\n- 776\n- 777 template< class ct, int mydim, int cdim, class Traits >\n- 778 template< bool add, class CornerIterator >\n- 779 inline void MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_>\n-780::global ( TopologyId, std::integral_constant< int, 0 >,\n- 781 CornerIterator &cit, const ctype &, const LocalCoordinate &,\n- 782 const ctype &rf, GlobalCoordinate &y )\n+ 763 }\n+ 764\n+ 765 protected:\n+ 766 int codim () const { return dim - type().dim(); }\n+ 767\n+ 768 unsigned int *allocate () { return (capacity() != 0 ? new unsigned int\n+[ capacity() ] : nullptr); }\n+ 769 void deallocate ( unsigned int *ptr ) { delete[] ptr; }\n+ 770 unsigned int capacity () const { return offset_[ dim+1 ]; }\n+ 771\n+ 772 private:\n+ 773 unsigned int *numbering_;\n+ 774 std::array< unsigned int, dim+2 > offset_;\n+ 775 GeometryType type_;\n+ 776 std::array< SubEntityFlags, dim+1> containsSubentity_;\n+ 777 };\n+ 778\n+ 779\n+ 780 template< class ctype, int dim >\n+ 781 template< int codim >\n+ 782 struct ReferenceElementImplementation< ctype, dim >::CreateGeometries\n 783 {\n- 784 const GlobalCoordinate &origin = *cit;\n- 785 ++cit;\n- 786 for( int i = 0; i < coorddimension; ++i )\n- 787 y[ i ] = (add ? y[ i ] + rf*origin[ i ] : rf*origin[ i ]);\n- 788 }\n- 789\n+ 784 template< int cc >\n+ 785 static typename ReferenceElements< ctype, dim-cc >::ReferenceElement\n+ 786 subRefElement( const ReferenceElementImplementation< ctype, dim >\n+&refElement, int i, std::integral_constant< int, cc > )\n+ 787 {\n+ 788 return ReferenceElements<_ctype,_dim-cc_>::general( refElement.type( i, cc\n+) );\n+ 789 }\n 790\n- 791 template< class ct, int mydim, int cdim, class Traits >\n- 792 template< bool add, int rows, int dim, class CornerIterator >\n- 793 inline void MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_>\n-794::jacobianTransposed ( TopologyId topologyId, std::integral_constant< int,\n-dim >,\n- 795 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,\n- 796 const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt )\n- 797 {\n- 798 assert( rows >= dim );\n- 799\n- 800 const ctype xn = df*x[ dim-1 ];\n- 801 const ctype cxn = ctype( 1 ) - xn;\n- 802\n- 803 auto cit2( cit );\n- 804 if( Impl::isPrism( toUnsignedInt(topologyId), mydimension, mydimension-dim\n-) )\n- 805 {\n- 806 // apply (1-xn) times Jacobian for bottom\n- 807 jacobianTransposed< add >( topologyId, std::integral_constant< int, dim-\n-1 >(), cit2, df, x, rf*cxn, jt );\n- 808 // apply xn times Jacobian for top\n- 809 jacobianTransposed< true >( topologyId, std::integral_constant< int, dim-\n-1 >(), cit2, df, x, rf*xn, jt );\n- 810 // compute last row as difference between top value and bottom value\n- 811 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit,\n-df, x, -rf, jt[ dim-1 ] );\n- 812 global< true >( topologyId, std::integral_constant< int, dim-1 >(), cit,\n-df, x, rf, jt[ dim-1 ] );\n- 813 }\n- 814 else\n- 815 {\n- 816 assert( Impl::isPyramid( toUnsignedInt(topologyId), mydimension,\n-mydimension-dim ) );\n- 817 /*\n- 818 * In the pyramid case, we need a transformation Tb: B -> R^n for the\n- 819 * base B \\subset R^{n-1}. The pyramid transformation is then defined as\n- 820 * T: P \\subset R^n -> R^n\n- 821 * (x, xn) |-> (1-xn) Tb(x*) + xn t (x \\in R^{n-1}, xn \\in R)\n- 822 * with the tip of the pyramid mapped to t and x* = x/(1-xn)\n- 823 * the projection of (x,xn) onto the base.\n- 824 *\n- 825 * For the Jacobi matrix DT we get\n- 826 * DT = ( A | b )\n- 827 * with A = DTb(x*) (n x n-1 matrix)\n- 828 * and b = dT/dxn (n-dim column vector).\n- 829 * Furthermore\n- 830 * b = -Tb(x*) + t + \\sum_i dTb/dx_i(x^*) x_i/(1-xn)\n- 831 *\n- 832 * Note that both A and b are not defined in the pyramid tip (x=0, xn=1)!\n- 833 * Indeed for B the unit square, Tb mapping B to the quadrilateral given\n- 834 * by the vertices (0,0,0), (2,0,0), (0,1,0), (1,1,0) and t=(0,0,1), we get\n- 835 *\n- 836 * T(x,y,xn) = ( x(2-y/(1-xn)), y, xn )\n- 837 * / 2-y/(1-xn) -x 0 \\\n- 838 * DT(x,y,xn) = | 0 1 0 |\n- 839 * \\ 0 0 1 /\n- 840 * which is not continuous for xn -> 1, choose for example\n- 841 * x=0, y=1-xn, xn -> 1 --> DT -> diag(1,1,1)\n- 842 * x=1-xn, y=0, xn -> 1 --> DT -> diag(2,1,1)\n- 843 *\n- 844 * However, for Tb affine-linear, Tb(y) = My + y0, DTb = M:\n- 845 * A = M\n- 846 * b = -M x* - y0 + t + \\sum_i M_i x_i/(1-xn)\n- 847 * = -M x* - y0 + t + M x*\n- 848 * = -y0 + t\n- 849 * which is continuous for xn -> 1. Note that this b is also given by\n- 850 * b = -Tb(0) + t + \\sum_i dTb/dx_i(0) x_i/1\n- 851 * that is replacing x* by 1 and 1-xn by 1 in the formular above.\n- 852 *\n- 853 * For xn -> 1, we can thus set x*=0, \"1-xn\"=1 (or anything != 0) and get\n- 854 * the right result in case Tb is affine-linear.\n- 855 */\n- 856\n- 857 /* The second case effectively results in x* = 0 */\n- 858 ctype dfcxn = (cxn > Traits::tolerance() || cxn < -Traits::tolerance()) ?\n-ctype(df / cxn) : ctype(0);\n- 859\n- 860 // initialize last row\n- 861 // b = -Tb(x*)\n- 862 // (b = -Tb(0) = -y0 in case xn -> 1 and Tb affine-linear)\n- 863 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit,\n-dfcxn, x, -rf, jt[ dim-1 ] );\n- 864 // b += t\n- 865 jt[ dim-1 ].axpy( rf, *cit );\n- 866 ++cit;\n- 867 // apply Jacobian for bottom (with argument x/(1-xn)) and correct last row\n- 868 if( add )\n- 869 {\n- 870 FieldMatrix< ctype, dim-1, coorddimension > jt2;\n- 871 // jt2 = dTb/dx_i(x*)\n- 872 jacobianTransposed< false >( topologyId, std::integral_constant< int, dim-\n-1 >(), cit2, dfcxn, x, rf, jt2 );\n- 873 // A = dTb/dx_i(x*) (jt[j], j=0..dim-1)\n- 874 // b += \\sum_i dTb/dx_i(x*) x_i/(1-xn) (jt[dim-1])\n- 875 // (b += 0 in case xn -> 1)\n- 876 for( int j = 0; j < dim-1; ++j )\n- 877 {\n- 878 jt[ j ] += jt2[ j ];\n- 879 jt[ dim-1 ].axpy( dfcxn*x[ j ], jt2[ j ] );\n- 880 }\n- 881 }\n- 882 else\n- 883 {\n- 884 // jt = dTb/dx_i(x*)\n- 885 jacobianTransposed< false >( topologyId, std::integral_constant< int, dim-\n-1 >(), cit2, dfcxn, x, rf, jt );\n- 886 // b += \\sum_i dTb/dx_i(x*) x_i/(1-xn)\n- 887 for( int j = 0; j < dim-1; ++j )\n- 888 jt[ dim-1 ].axpy( dfcxn*x[ j ], jt[ j ] );\n- 889 }\n- 890 }\n- 891 }\n- 892\n- 893 template< class ct, int mydim, int cdim, class Traits >\n- 894 template< bool add, int rows, class CornerIterator >\n- 895 inline void MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_>\n-896::jacobianTransposed ( TopologyId, std::integral_constant< int, 0 >,\n- 897 CornerIterator &cit, const ctype &, const LocalCoordinate &,\n- 898 const ctype &, FieldMatrix< ctype, rows, cdim > & )\n- 899 {\n- 900 ++cit;\n- 901 }\n- 902\n- 903\n- 904\n- 905 template< class ct, int mydim, int cdim, class Traits >\n- 906 template< int dim, class CornerIterator >\n- 907 inline bool MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_>\n-908::affine ( TopologyId topologyId, std::integral_constant< int, dim >,\n-CornerIterator &cit, JacobianTransposed &jt )\n- 909 {\n- 910 const GlobalCoordinate &orgBottom = *cit;\n- 911 if( !affine( topologyId, std::integral_constant< int, dim-1 >(), cit, jt )\n-)\n- 912 return false;\n- 913 const GlobalCoordinate &orgTop = *cit;\n- 914\n- 915 if( Impl::isPrism( toUnsignedInt(topologyId), mydimension, mydimension-dim\n-) )\n- 916 {\n- 917 JacobianTransposed jtTop;\n- 918 if( !affine( topologyId, std::integral_constant< int, dim-1 >(), cit,\n-jtTop ) )\n- 919 return false;\n- 920\n- 921 // check whether both jacobians are identical\n- 922 ctype norm( 0 );\n- 923 for( int i = 0; i < dim-1; ++i )\n- 924 norm += (jtTop[ i ] - jt[ i ]).two_norm2();\n- 925 if( norm >= Traits::tolerance() )\n- 926 return false;\n- 927 }\n- 928 else\n- 929 ++cit;\n- 930 jt[ dim-1 ] = orgTop - orgBottom;\n- 931 return true;\n- 932 }\n- 933\n- 934 template< class ct, int mydim, int cdim, class Traits >\n- 935 template< class CornerIterator >\n- 936 inline bool MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_>\n-937::affine ( TopologyId, std::integral_constant< int, 0 >, CornerIterator\n-&cit, JacobianTransposed & )\n- 938 {\n- 939 ++cit;\n- 940 return true;\n- 941 }\n- 942\n- 943} // namespace Dune\n- 944\n- 945#endif // #ifndef DUNE_GEOMETRY_MULTILINEARGEOMETRY_HH\n-referenceelements.hh\n-type.hh\n-A unique label for each type of element that can occur in a grid.\n+ 791 static typename ReferenceElements<_ctype,_dim_>::ReferenceElement\n+ 792 subRefElement(const ReferenceElementImplementation< ctype, dim >\n+&refElement,\n+ 793 [[maybe_unused]] int i, std::integral_constant)\n+ 794 {\n+ 795 return refElement;\n+ 796 }\n+ 797\n+ 798 static void apply ( const ReferenceElementImplementation< ctype, dim >\n+&refElement, GeometryTable &geometries )\n+ 799 {\n+ 800 const int size = refElement.size( codim );\n+ 801 std::vector< FieldVector< ctype, dim > > origins( size );\n+ 802 std::vector< FieldMatrix< ctype, dim - codim, dim > > jacobianTransposeds\n+( size );\n+ 803 Impl::referenceEmbeddings( refElement.type().id(), dim, codim, &(origins\n+[ 0 ]), &(jacobianTransposeds[ 0 ]) );\n+ 804\n+ 805 std::get< codim >( geometries ).reserve( size );\n+ 806 for( int i = 0; i < size; ++i )\n+ 807 {\n+ 808 typename Codim< codim >::Geometry geometry( subRefElement( refElement, i,\n+std::integral_constant< int, codim >() ), origins[ i ], jacobianTransposeds[ i\n+] );\n+ 809 std::get< codim >( geometries ).push_back( geometry );\n+ 810 }\n+ 811 }\n+ 812 };\n+ 813\n+ 814#endif // DOXYGEN\n+ 815\n+ 816 } // namespace Geo\n+ 817\n+ 818} // namespace Dune\n+ 819\n+ 820#endif // #ifndef DUNE_GEOMETRY_REFERENCEELEMENTIMPLEMENTATION_HH\n affinegeometry.hh\n An implementation of the Geometry interface for affine geometries.\n+type.hh\n+A unique label for each type of element that can occur in a grid.\n+referenceelement.hh\n Dune\n Definition affinegeometry.hh:21\n-Dune::Geo::ReferenceElements\n-Class providing access to the singletons of the reference elements.\n-Definition referenceelements.hh:170\n+Dune::QuadratureType::size\n+@ size\n+Definition quadraturerules.hh:145\n+Dune::RefinementImp::Simplex::binomial\n+int binomial(int upper, int lower)\n+calculate\n+Definition simplex.cc:305\n Dune::Geo::ReferenceElements::ReferenceElement\n typename Container::ReferenceElement ReferenceElement\n The reference element type.\n Definition referenceelements.hh:188\n-Dune::MultiLinearGeometryTraits\n-default traits class for MultiLinearGeometry\n-Definition multilineargeometry.hh:39\n-Dune::MultiLinearGeometryTraits::MatrixHelper\n-Impl::FieldMatrixHelper< ct > MatrixHelper\n-helper structure containing some matrix routines\n-Definition multilineargeometry.hh:58\n-Dune::MultiLinearGeometryTraits::tolerance\n-static ct tolerance()\n-tolerance to numerical algorithms\n-Definition multilineargeometry.hh:61\n-Dune::MultiLinearGeometryTraits::CornerStorage\n-template specifying the storage for the corners\n-Definition multilineargeometry.hh:129\n-Dune::MultiLinearGeometryTraits::CornerStorage::Type\n-std::vector< FieldVector< ct, cdim > > Type\n-Definition multilineargeometry.hh:130\n-Dune::MultiLinearGeometryTraits::hasSingleGeometryType\n-will there be only one geometry type for a dimension?\n-Definition multilineargeometry.hh:148\n-Dune::MultiLinearGeometryTraits::hasSingleGeometryType::topologyId\n-static const unsigned int topologyId\n-Definition multilineargeometry.hh:150\n-Dune::MultiLinearGeometryTraits::hasSingleGeometryType::v\n-static const bool v\n-Definition multilineargeometry.hh:149\n-Dune::MultiLinearGeometry\n-generic geometry implementation based on corner coordinates\n-Definition multilineargeometry.hh:181\n-Dune::MultiLinearGeometry::global\n-static void global(TopologyId topologyId, std::integral_constant< int, dim >,\n-CornerIterator &cit, const ctype &df, const LocalCoordinate &x, const ctype\n-&rf, GlobalCoordinate &y)\n-Definition multilineargeometry.hh:749\n-Dune::MultiLinearGeometry::mydimension\n-static const int mydimension\n-geometry dimension\n-Definition multilineargeometry.hh:189\n-Dune::MultiLinearGeometry::type\n-Dune::GeometryType type() const\n-obtain the name of the reference element\n-Definition multilineargeometry.hh:269\n-Dune::MultiLinearGeometry::MatrixHelper\n-Traits::MatrixHelper MatrixHelper\n-Definition multilineargeometry.hh:225\n-Dune::MultiLinearGeometry::GlobalCoordinate\n-FieldVector< ctype, coorddimension > GlobalCoordinate\n-type of global coordinates\n-Definition multilineargeometry.hh:196\n-Dune::MultiLinearGeometry::jacobianTransposed\n-static void jacobianTransposed(TopologyId topologyId, std::integral_constant<\n-int, 0 >, CornerIterator &cit, const ctype &df, const LocalCoordinate &x, const\n-ctype &rf, FieldMatrix< ctype, rows, cdim > &jt)\n-Definition multilineargeometry.hh:896\n-Dune::MultiLinearGeometry::jacobianTransposed\n-JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const\n-obtain the transposed of the Jacobian\n-Definition multilineargeometry.hh:377\n-Dune::MultiLinearGeometry::refElement\n-ReferenceElement refElement() const\n-Definition multilineargeometry.hh:425\n-Dune::MultiLinearGeometry::global\n-GlobalCoordinate global(const LocalCoordinate &local) const\n-evaluate the mapping\n-Definition multilineargeometry.hh:290\n-Dune::MultiLinearGeometry::center\n-GlobalCoordinate center() const\n-obtain the centroid of the mapping's image\n-Definition multilineargeometry.hh:282\n-Dune::MultiLinearGeometry::corner\n-GlobalCoordinate corner(int i) const\n-obtain coordinates of the i-th corner\n-Definition multilineargeometry.hh:275\n-Dune::MultiLinearGeometry::ReferenceElements\n-Dune::ReferenceElements< ctype, mydimension > ReferenceElements\n-Definition multilineargeometry.hh:214\n-Dune::MultiLinearGeometry::ctype\n-ct ctype\n-coordinate type\n-Definition multilineargeometry.hh:186\n-Dune::MultiLinearGeometry::jacobianTransposed\n-static void jacobianTransposed(TopologyId topologyId, std::integral_constant<\n-int, dim >, CornerIterator &cit, const ctype &df, const LocalCoordinate &x,\n-const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt)\n-Definition multilineargeometry.hh:794\n-Dune::MultiLinearGeometry::coorddimension\n-static const int coorddimension\n-coordinate dimension\n-Definition multilineargeometry.hh:191\n-Dune::MultiLinearGeometry::corners\n-int corners() const\n-obtain number of corners of the corresponding reference element\n-Definition multilineargeometry.hh:272\n-Dune::MultiLinearGeometry::topologyId\n-TopologyId topologyId() const\n-Definition multilineargeometry.hh:430\n-Dune::MultiLinearGeometry::referenceElement\n-friend ReferenceElement referenceElement(const MultiLinearGeometry &geometry)\n-Definition multilineargeometry.hh:395\n-Dune::MultiLinearGeometry::local\n-LocalCoordinate local(const GlobalCoordinate &globalCoord) const\n-evaluate the inverse mapping\n-Definition multilineargeometry.hh:312\n-Dune::MultiLinearGeometry::global\n-static void global(TopologyId topologyId, std::integral_constant< int, 0 >,\n-CornerIterator &cit, const ctype &df, const LocalCoordinate &x, const ctype\n-&rf, GlobalCoordinate &y)\n-Definition multilineargeometry.hh:780\n-Dune::MultiLinearGeometry::volume\n-Volume volume() const\n-obtain the volume of the mapping's image\n-Definition multilineargeometry.hh:363\n-Dune::MultiLinearGeometry::LocalCoordinate\n-FieldVector< ctype, mydimension > LocalCoordinate\n-type of local coordinates\n-Definition multilineargeometry.hh:194\n-Dune::MultiLinearGeometry::MultiLinearGeometry\n-MultiLinearGeometry(const ReferenceElement &refElement, const Corners &corners)\n-constructor\n-Definition multilineargeometry.hh:239\n-Dune::MultiLinearGeometry::affine\n-static bool affine(TopologyId topologyId, std::integral_constant< int, 0 >,\n-CornerIterator &cit, JacobianTransposed &jt)\n-Definition multilineargeometry.hh:937\n-Dune::MultiLinearGeometry::TopologyId\n-std::conditional< hasSingleGeometryType, std::integral_constant< unsignedint,\n-Traits::templatehasSingleGeometryType< mydimension >::topologyId >, unsignedint\n->::type TopologyId\n-Definition multilineargeometry.hh:226\n-Dune::MultiLinearGeometry::Volume\n-ctype Volume\n-type of volume\n-Definition multilineargeometry.hh:198\n-Dune::MultiLinearGeometry::affine\n-static bool affine(TopologyId topologyId, std::integral_constant< int, dim >,\n-CornerIterator &cit, JacobianTransposed &jt)\n-Definition multilineargeometry.hh:908\n-Dune::MultiLinearGeometry::jacobianInverse\n-JacobianInverse jacobianInverse(const LocalCoordinate &local) const\n-Obtain the Jacobian's inverse.\n-Definition multilineargeometry.hh:418\n-Dune::MultiLinearGeometry::MultiLinearGeometry\n-MultiLinearGeometry(Dune::GeometryType gt, const Corners &corners)\n-constructor\n-Definition multilineargeometry.hh:255\n-Dune::MultiLinearGeometry::JacobianTransposed\n-FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed\n-type of jacobian transposed\n-Definition multilineargeometry.hh:201\n-Dune::MultiLinearGeometry::ReferenceElement\n-ReferenceElements::ReferenceElement ReferenceElement\n-type of reference element\n-Definition multilineargeometry.hh:219\n-Dune::MultiLinearGeometry::jacobianInverseTransposed\n-JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate\n-&local) const\n-obtain the transposed of the Jacobian's inverse\n-Definition multilineargeometry.hh:738\n-Dune::MultiLinearGeometry::Jacobian\n-FieldMatrix< ctype, coorddimension, mydimension > Jacobian\n-Type for the Jacobian matrix.\n-Definition multilineargeometry.hh:207\n-Dune::MultiLinearGeometry::affine\n-bool affine() const\n-is this mapping affine?\n-Definition multilineargeometry.hh:262\n-Dune::MultiLinearGeometry::JacobianInverse\n-FieldMatrix< ctype, mydimension, coorddimension > JacobianInverse\n-Type for the inverse Jacobian matrix.\n-Definition multilineargeometry.hh:210\n-Dune::MultiLinearGeometry::affine\n-bool affine(JacobianTransposed &jacobianT) const\n-Definition multilineargeometry.hh:458\n-Dune::MultiLinearGeometry::integrationElement\n-Volume integrationElement(const LocalCoordinate &local) const\n-obtain the integration element\n-Definition multilineargeometry.hh:350\n-Dune::MultiLinearGeometry::jacobian\n-Jacobian jacobian(const LocalCoordinate &local) const\n-Obtain the Jacobian.\n-Definition multilineargeometry.hh:407\n-Dune::MultiLinearGeometry::JacobianInverseTransposed\n-Definition multilineargeometry.hh:488\n-Dune::MultiLinearGeometry::JacobianInverseTransposed::setup\n-void setup(const JacobianTransposed &jt)\n-Definition multilineargeometry.hh:492\n-Dune::MultiLinearGeometry::JacobianInverseTransposed::det\n-ctype det() const\n-Definition multilineargeometry.hh:502\n-Dune::MultiLinearGeometry::JacobianInverseTransposed::detInv\n-ctype detInv() const\n-Definition multilineargeometry.hh:503\n-Dune::MultiLinearGeometry::JacobianInverseTransposed::setupDeterminant\n-void setupDeterminant(const JacobianTransposed &jt)\n-Definition multilineargeometry.hh:497\n-Dune::CachedMultiLinearGeometry\n-Implement a MultiLinearGeometry with additional caching.\n-Definition multilineargeometry.hh:526\n-Dune::CachedMultiLinearGeometry::global\n-GlobalCoordinate global(const LocalCoordinate &local) const\n-evaluate the mapping\n-Definition multilineargeometry.hh:580\n-Dune::CachedMultiLinearGeometry::ReferenceElement\n-Base::ReferenceElement ReferenceElement\n-Definition multilineargeometry.hh:534\n-Dune::CachedMultiLinearGeometry::affine\n-bool affine() const\n-is this mapping affine?\n-Definition multilineargeometry.hh:567\n-Dune::CachedMultiLinearGeometry::CachedMultiLinearGeometry\n-CachedMultiLinearGeometry(const ReferenceElement &referenceElement, const\n-CornerStorage &cornerStorage)\n-Definition multilineargeometry.hh:551\n-Dune::CachedMultiLinearGeometry::refElement\n-ReferenceElement refElement() const\n-Definition multilineargeometry.hh:425\n-Dune::CachedMultiLinearGeometry::local\n-LocalCoordinate local(const GlobalCoordinate &global) const\n-evaluate the inverse mapping\n-Definition multilineargeometry.hh:604\n-Dune::CachedMultiLinearGeometry::MatrixHelper\n-Base::MatrixHelper MatrixHelper\n-Definition multilineargeometry.hh:531\n-Dune::CachedMultiLinearGeometry::LocalCoordinate\n-Base::LocalCoordinate LocalCoordinate\n-Definition multilineargeometry.hh:541\n-Dune::CachedMultiLinearGeometry::jacobianInverse\n-JacobianInverse jacobianInverse(const LocalCoordinate &local) const\n-Obtain the Jacobian's inverse.\n-Definition multilineargeometry.hh:713\n-Dune::CachedMultiLinearGeometry::jacobianTransposed\n-JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const\n-obtain the transposed of the Jacobian\n-Definition multilineargeometry.hh:666\n-Dune::CachedMultiLinearGeometry::corner\n-GlobalCoordinate corner(int i) const\n-obtain coordinates of the i-th corner\n-Definition multilineargeometry.hh:275\n-Dune::CachedMultiLinearGeometry::volume\n-Volume volume() const\n-obtain the volume of the mapping's image\n-Definition multilineargeometry.hh:649\n-Dune::CachedMultiLinearGeometry::CachedMultiLinearGeometry\n-CachedMultiLinearGeometry(Dune::GeometryType gt, const CornerStorage\n-&cornerStorage)\n-Definition multilineargeometry.hh:559\n-Dune::CachedMultiLinearGeometry::integrationElement\n-ctype integrationElement(const LocalCoordinate &local) const\n-obtain the integration element\n-Definition multilineargeometry.hh:633\n-Dune::CachedMultiLinearGeometry::ctype\n-Base::ctype ctype\n-Definition multilineargeometry.hh:536\n-Dune::CachedMultiLinearGeometry::jacobian\n-Jacobian jacobian(const LocalCoordinate &local) const\n-Obtain the Jacobian.\n-Definition multilineargeometry.hh:702\n-Dune::CachedMultiLinearGeometry::JacobianInverseTransposed\n-Base::JacobianInverseTransposed JacobianInverseTransposed\n-Definition multilineargeometry.hh:546\n-Dune::CachedMultiLinearGeometry::JacobianTransposed\n-Base::JacobianTransposed JacobianTransposed\n-Definition multilineargeometry.hh:545\n-Dune::CachedMultiLinearGeometry::JacobianInverse\n-Base::JacobianInverse JacobianInverse\n-Definition multilineargeometry.hh:548\n-Dune::CachedMultiLinearGeometry::Jacobian\n-Base::Jacobian Jacobian\n-Definition multilineargeometry.hh:547\n-Dune::CachedMultiLinearGeometry::Volume\n-Base::Volume Volume\n-Definition multilineargeometry.hh:543\n-Dune::CachedMultiLinearGeometry::GlobalCoordinate\n-Base::GlobalCoordinate GlobalCoordinate\n-Definition multilineargeometry.hh:542\n-Dune::CachedMultiLinearGeometry::center\n-GlobalCoordinate center() const\n-obtain the centroid of the mapping's image\n-Definition multilineargeometry.hh:572\n-Dune::CachedMultiLinearGeometry::jacobianInverseTransposed\n-JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate\n-&local) const\n-obtain the transposed of the Jacobian's inverse\n-Definition multilineargeometry.hh:680\n-Dune::GeometryType\n-Unique label for each type of entities that can occur in DUNE grids.\n-Definition type.hh:126\n+Dune::Geo::ReferenceElements::general\n+static const ReferenceElement & general(const GeometryType &type)\n+get general reference elements\n+Definition referenceelements.hh:198\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00173.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00173.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: refinement.hh File Reference\n+dune-geometry: dimension.hh File Reference\n \n \n \n \n \n \n \n@@ -69,30 +69,38 @@\n \n
\n \n
\n \n
\n-
refinement.hh File Reference
\n+ \n+
dimension.hh File Reference
\n
\n
\n-\n-

This file simply includes all Refinement implementations so you don't have to do them separately. \n-More...

\n-
#include "refinement/base.cc"
\n-#include "refinement/hcube.cc"
\n-#include "refinement/simplex.cc"
\n-#include "refinement/hcubetriangulation.cc"
\n-#include "refinement/prismtriangulation.cc"
\n-#include "refinement/pyramidtriangulation.cc"
\n+
#include <type_traits>
\n
\n

Go to the source code of this file.

\n-

Detailed Description

\n-

This file simply includes all Refinement implementations so you don't have to do them separately.

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

\n+Classes

struct  Dune::Dim< dim >
 Static tag representing a dimension. More...
 
struct  Dune::Codim< codim >
 Static tag representing a codimension. More...
 
\n+\n+\n+\n+

\n+Namespaces

namespace  Dune
 
\n+
\n \n
\n Generated by \"doxygen\"/ 1.9.8\n
\n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,23 +6,24 @@\n dune-geometry\u00a02.9.0\n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n-refinement.hh File Reference\n-This file simply includes all Refinement implementations so you don't have to\n-do them separately. More...\n-#include \"refinement/base.cc\"\n-#include \"refinement/hcube.cc\"\n-#include \"refinement/simplex.cc\"\n-#include \"refinement/hcubetriangulation.cc\"\n-#include \"refinement/prismtriangulation.cc\"\n-#include \"refinement/pyramidtriangulation.cc\"\n+Classes | Namespaces\n+dimension.hh File Reference\n+#include \n Go_to_the_source_code_of_this_file.\n-***** Detailed Description *****\n-This file simply includes all Refinement implementations so you don't have to\n-do them separately.\n+ Classes\n+struct \u00a0Dune::Dim<_dim_>\n+\u00a0 Static tag representing a dimension. More...\n+\u00a0\n+struct \u00a0Dune::Codim<_codim_>\n+\u00a0 Static tag representing a codimension. More...\n+\u00a0\n+ Namespaces\n+namespace \u00a0Dune\n+\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00173_source.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00173_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: refinement.hh Source File\n+dune-geometry: dimension.hh Source File\n \n \n \n \n \n \n \n@@ -74,42 +74,54 @@\n \n
\n \n
\n \n
\n-
refinement.hh
\n+
dimension.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
\n
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
\n-
5#ifndef DUNE_GEOMETRY_REFINEMENT_HH
\n-
6#define DUNE_GEOMETRY_REFINEMENT_HH
\n+
5#ifndef DUNE_GEOMETRY_DIMENSION_HH
\n+
6#define DUNE_GEOMETRY_DIMENSION_HH
\n
7
\n-
250// The interface (template<...> class StaticRefinement) is not included here
\n-
251// since it derives from parts which I consider implementation. Look
\n-
252// into refinement/base.cc if the documentation is above is not enough.
\n-
253#include "refinement/base.cc"
\n-
254
\n-
255#include "refinement/hcube.cc"
\n-
256#include "refinement/simplex.cc"
\n-\n-\n-\n-
260
\n-
261#endif // DUNE_GEOMETRY_REFINEMENT_HH
\n-
This file contains the Refinement implementation for hypercubes (quadrilaterals, hexahedrons,...
\n-\n-\n-
This file contains the Refinement implementation for triangulating hypercubes (quadrilateral -> trian...
\n-
This file contains the parts independent of a particular Refinement implementation.
\n-
This file contains the Refinement implementation for simplices (triangles, tetrahedrons....
\n+
8#include <type_traits>
\n+
9
\n+
10namespace Dune {
\n+
11
\n+
13 template<int dim>
\n+
\n+
14 struct Dim
\n+
15 : public std::integral_constant<int,dim>
\n+
16 {
\n+
17 typedef Dim type;
\n+
18 };
\n+
\n+
19
\n+
21 template<int codim>
\n+
\n+
22 struct Codim
\n+
23 : public std::integral_constant<int,codim>
\n+
24 {
\n+
25 typedef Codim type;
\n+
26 };
\n+
\n+
27
\n+
28}
\n+
29
\n+
30#endif // DUNE_GEOMETRY_DIMENSION_HH
\n+
Definition affinegeometry.hh:21
\n+
Static tag representing a dimension.
Definition dimension.hh:16
\n+
Dim type
Definition dimension.hh:17
\n+
Static tag representing a codimension.
Definition dimension.hh:24
\n+
Codim type
Definition dimension.hh:25
\n
\n \n
\n Generated by \"doxygen\"/ 1.9.8\n
\n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,47 +7,55 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n-refinement.hh\n+dimension.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file\n LICENSE.md in module root\n 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n- 5#ifndef DUNE_GEOMETRY_REFINEMENT_HH\n- 6#define DUNE_GEOMETRY_REFINEMENT_HH\n+ 5#ifndef DUNE_GEOMETRY_DIMENSION_HH\n+ 6#define DUNE_GEOMETRY_DIMENSION_HH\n 7\n- 250// The interface (template<...> class StaticRefinement) is not included\n-here\n- 251// since it derives from parts which I consider implementation. Look\n- 252// into refinement/base.cc if the documentation is above is not enough.\n- 253#include \"refinement/base.cc\"\n- 254\n- 255#include \"refinement/hcube.cc\"\n- 256#include \"refinement/simplex.cc\"\n- 257#include \"refinement/hcubetriangulation.cc\"\n- 258#include \"refinement/prismtriangulation.cc\"\n- 259#include \"refinement/pyramidtriangulation.cc\"\n- 260\n- 261#endif // DUNE_GEOMETRY_REFINEMENT_HH\n-hcube.cc\n-This file contains the Refinement implementation for hypercubes\n-(quadrilaterals, hexahedrons,...\n-pyramidtriangulation.cc\n-prismtriangulation.cc\n-hcubetriangulation.cc\n-This file contains the Refinement implementation for triangulating hypercubes\n-(quadrilateral -> trian...\n-base.cc\n-This file contains the parts independent of a particular Refinement\n-implementation.\n-simplex.cc\n-This file contains the Refinement implementation for simplices (triangles,\n-tetrahedrons....\n+ 8#include \n+ 9\n+ 10namespace Dune {\n+ 11\n+ 13 template\n+14 struct Dim\n+ 15 : public std::integral_constant\n+ 16 {\n+17 typedef Dim type;\n+ 18 };\n+ 19\n+ 21 template\n+22 struct Codim\n+ 23 : public std::integral_constant\n+ 24 {\n+25 typedef Codim type;\n+ 26 };\n+ 27\n+ 28}\n+ 29\n+ 30#endif // DUNE_GEOMETRY_DIMENSION_HH\n+Dune\n+Definition affinegeometry.hh:21\n+Dune::Dim\n+Static tag representing a dimension.\n+Definition dimension.hh:16\n+Dune::Dim::type\n+Dim type\n+Definition dimension.hh:17\n+Dune::Codim\n+Static tag representing a codimension.\n+Definition dimension.hh:24\n+Dune::Codim::type\n+Codim type\n+Definition dimension.hh:25\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00176.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00176.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: deprecated_topology.hh File Reference\n+dune-geometry: axisalignedcubegeometry.hh File Reference\n \n \n \n \n \n \n \n@@ -69,19 +69,45 @@\n \n
\n \n
\n \n
\n-
deprecated_topology.hh File Reference
\n+ \n+
axisalignedcubegeometry.hh File Reference
\n
\n
\n \n+

A geometry implementation for axis-aligned hypercubes. \n+More...

\n+
#include <bitset>
\n+#include <dune/common/fvector.hh>
\n+#include <dune/common/fmatrix.hh>
\n+#include <dune/common/diagonalmatrix.hh>
\n+#include <dune/geometry/referenceelements.hh>
\n+#include <dune/geometry/type.hh>
\n+
\n

Go to the source code of this file.

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

\n+Classes

class  Dune::AxisAlignedCubeGeometry< CoordType, dim, coorddim >
 A geometry implementation for axis-aligned hypercubes. More...
 
\n+\n+\n+\n+

\n+Namespaces

namespace  Dune
 
\n+

Detailed Description

\n+

A geometry implementation for axis-aligned hypercubes.

\n+
\n \n
\n Generated by \"doxygen\"/ 1.9.8\n
\n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,12 +6,29 @@\n dune-geometry\u00a02.9.0\n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n-deprecated_topology.hh File Reference\n+Classes | Namespaces\n+axisalignedcubegeometry.hh File Reference\n+A geometry implementation for axis-aligned hypercubes. More...\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::AxisAlignedCubeGeometry<_CoordType,_dim,_coorddim_>\n+\u00a0 A geometry implementation for axis-aligned hypercubes. More...\n+\u00a0\n+ Namespaces\n+namespace \u00a0Dune\n+\u00a0\n+***** Detailed Description *****\n+A geometry implementation for axis-aligned hypercubes.\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00176_source.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00176_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: deprecated_topology.hh Source File\n+dune-geometry: axisalignedcubegeometry.hh Source File\n \n \n \n \n \n \n \n@@ -74,176 +74,356 @@\n \n
\n \n
\n \n
\n-
deprecated_topology.hh
\n+
axisalignedcubegeometry.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
\n
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
\n-
5#ifndef DUNE_DEPRECATED_TOPOLOGY_HH
\n-
6#define DUNE_DEPRECATED_TOPOLOGY_HH
\n-
7
\n-
8 namespace Impl
\n-
9 {
\n-
10
\n-
11 // Basic Topology Types
\n-
12 // --------------------
\n-
13
\n-
14 // PointDeprecationHelper can be used to prevent a deprecation warning for Point
\n-
15 struct PointDeprecationHelper
\n-
16 {
\n-
17 static const unsigned int dimension = 0;
\n-
18 static const unsigned int numCorners = 1;
\n-
19
\n-
20 static const unsigned int id = 0;
\n+
5
\n+
6#ifndef DUNE_GEOMETRY_AXISALIGNED_CUBE_GEOMETRY_HH
\n+
7#define DUNE_GEOMETRY_AXISALIGNED_CUBE_GEOMETRY_HH
\n+
8
\n+
13#include <bitset>
\n+
14
\n+
15#include <dune/common/fvector.hh>
\n+
16#include <dune/common/fmatrix.hh>
\n+
17#include <dune/common/diagonalmatrix.hh>
\n+
18
\n+\n+
20#include <dune/geometry/type.hh>
\n
21
\n-
22 static std::string name () { return "p"; }
\n-
23 };
\n+
22
\n+
23namespace Dune {
\n
24
\n-
25 using Point [[deprecated("Use GeometryTypes::vertex instead.")]] = PointDeprecationHelper;
\n-
26
\n-
27
\n-
28 template< class BaseTopology >
\n-
29 struct [[deprecated("Use GeometryTypes::prismaticExtension(GeometryType gt) instead.")]] Prism
\n-
30 {
\n-
31 static const unsigned int dimension = BaseTopology::dimension + 1;
\n-
32 static const unsigned int numCorners = 2 * BaseTopology::numCorners;
\n-
33
\n-
34 static const unsigned int id = BaseTopology::id | ((unsigned int)prismConstruction << (dimension-1));
\n-
35
\n-
36 static std::string name () { return BaseTopology::name() + "l"; }
\n-
37 };
\n-
38
\n-
39
\n-
40 template< class BaseTopology >
\n-
41 struct [[deprecated("Use GeometryTypes::conicalExtension(GeometryType gt) instead.")]] Pyramid
\n-
42 {
\n-
43 static const unsigned int dimension = BaseTopology::dimension + 1;
\n-
44 static const unsigned int numCorners = BaseTopology::numCorners + 1;
\n-
45
\n-
46 static const unsigned int id = BaseTopology::id | ((unsigned int)pyramidConstruction << (dimension-1));
\n-
47
\n-
48 static std::string name () { return BaseTopology::name() + "o"; }
\n-
49 };
\n-
50
\n+
48 template <class CoordType, unsigned int dim, unsigned int coorddim>
\n+
\n+\n+
50 {
\n
51
\n
52
\n-
53 // Properties of Topologies
\n-
54 // ------------------------
\n-
55
\n-
56 template< class Topology >
\n-
57 struct [[deprecated("Use GeometryType::isSimplex() instead.")]] IsSimplex
\n-
58 : public std::integral_constant< bool, (Topology::id >> 1) == 0 >
\n-
59 {};
\n+
53 public:
\n+
54
\n+
56 constexpr static int mydimension = dim;
\n+
57
\n+
59 constexpr static int coorddimension = coorddim;
\n
60
\n-
61 template< class Topology >
\n-
62 struct [[deprecated("Use GeometryType::isCube() instead.")]] IsCube
\n-
63 : public std::integral_constant< bool, (Topology::id | 1) == (1 << Topology::dimension) - 1 >
\n-
64 {};
\n-
65
\n-
78 [[deprecated("Use GeometryType::isPrismatic() or GeometryType::isConical() instead.")]]
\n-
79 inline static bool isTopology ( TopologyConstruction construction, unsigned int topologyId, int dim, int codim = 0 ) noexcept
\n-
80 {
\n-
81 assert( (dim > 0) && (topologyId < numTopologies( dim )) );
\n-
82 assert( (0 <= codim) && (codim <= dim) );
\n-
83 return (codim >= (dim-1)) || (((topologyId >> (dim-codim-1)) & 1) == (unsigned int)construction);
\n-
84 }
\n-
85
\n-
86
\n-
87 // SimplexTopology
\n-
88 // ---------------
\n-
89
\n-
90 template< unsigned int dim >
\n-
91 struct [[deprecated("Use GeometryTypes::simplex(dim) instead.")]] SimplexTopology
\n-
92 {
\n-
93 typedef Pyramid< typename SimplexTopology< dim-1 >::type > type;
\n-
94 };
\n-
95
\n-
96 template<>
\n-
97 struct [[deprecated("Use GeometryTypes::simplex(dim) instead.")]] SimplexTopology< 0 >
\n-
98 {
\n-
99 typedef Point type;
\n-
100 };
\n+
62 typedef CoordType ctype;
\n+
63
\n+
65 typedef FieldVector<ctype,dim> LocalCoordinate;
\n+
66
\n+
68 typedef FieldVector<ctype,coorddim> GlobalCoordinate;
\n+
69
\n+
71 typedef ctype Volume;
\n+
72
\n+
79 typedef typename std::conditional<dim==coorddim,
\n+
80 DiagonalMatrix<ctype,dim>,
\n+
81 FieldMatrix<ctype,dim,coorddim> >::type JacobianTransposed;
\n+
82
\n+
89 typedef typename std::conditional<dim==coorddim,
\n+
90 DiagonalMatrix<ctype,dim>,
\n+
91 FieldMatrix<ctype,coorddim,dim> >::type JacobianInverseTransposed;
\n+
92
\n+
100 using Jacobian = std::conditional_t<dim==coorddim, DiagonalMatrix<ctype,dim>, FieldMatrix<ctype,coorddim,dim> >;
\n
101
\n-
102
\n-
103
\n-
104 // CubeTopology
\n-
105 // ------------
\n-
106
\n-
107 template< unsigned int dim >
\n-
108 struct [[deprecated("Use GeometryTypes::cube(dim) instead.")]] CubeTopology
\n-
109 {
\n-
110 typedef Prism< typename CubeTopology< dim-1 >::type > type;
\n-
111 };
\n-
112
\n-
113 template<>
\n-
114 struct [[deprecated("Use GeometryTypes::simplex(dim) instead.")]] CubeTopology< 0 >
\n-
115 {
\n-
116 typedef Point type;
\n-
117 };
\n-
118
\n-
119
\n-
120
\n-
121 // PyramidTopology
\n-
122 // ---------------
\n-
123
\n-
124 template< unsigned int dim >
\n-
125 struct [[deprecated]] PyramidTopology
\n-
126 {
\n-
127 typedef Pyramid< typename CubeTopology< dim-1 >::type > type;
\n-
128 };
\n-
129
\n-
130
\n-
131
\n-
132 // PrismTopology
\n-
133 // -------------
\n-
134
\n-
135 template< unsigned int dim >
\n-
136 struct [[deprecated]] PrismTopology
\n-
137 {
\n-
138 typedef Prism< typename SimplexTopology< dim-1 >::type > type;
\n-
139 };
\n-
140
\n-
141
\n-
142
\n-
143
\n-
144 // IfTopology
\n-
145 // ----------
\n-
146
\n-
147 template< template< class > class Operation, int dim, class Topology = PointDeprecationHelper >
\n-
148 struct [[deprecated("Use IfGeometryType instead.")]] IfTopology
\n-
149 {
\n-
150 template< class... Args >
\n-
151 static auto apply ( unsigned int topologyId, Args &&... args )
\n-
152 {
\n-
153 if( topologyId & 1 )
\n-
154 return IfTopology< Operation, dim-1, Prism< Topology > >::apply( topologyId >> 1, std::forward< Args >( args )... );
\n-
155 else
\n-
156 return IfTopology< Operation, dim-1, Pyramid< Topology > >::apply( topologyId >> 1, std::forward< Args >( args )... );
\n-
157 }
\n-
158 };
\n+
109 using JacobianInverse = std::conditional_t<dim==coorddim, DiagonalMatrix<ctype,dim>, FieldMatrix<ctype,dim,coorddim> >;
\n+
110
\n+
\n+
115 AxisAlignedCubeGeometry(const Dune::FieldVector<ctype,coorddim> lower,
\n+
116 const Dune::FieldVector<ctype,coorddim> upper)
\n+
117 : lower_(lower),
\n+
118 upper_(upper),
\n+
119 axes_()
\n+
120 {
\n+
121 static_assert(dim==coorddim, "Use this constructor only if dim==coorddim!");
\n+
122 // all 'true', but is never actually used
\n+
123 axes_ = (1<<coorddim)-1;
\n+
124 }
\n+
\n+
125
\n+
\n+
133 AxisAlignedCubeGeometry(const Dune::FieldVector<ctype,coorddim> lower,
\n+
134 const Dune::FieldVector<ctype,coorddim> upper,
\n+
135 const std::bitset<coorddim>& axes)
\n+
136 : lower_(lower),
\n+
137 upper_(upper),
\n+
138 axes_(axes)
\n+
139 {
\n+
140 assert(axes.count()==dim);
\n+
141 for (size_t i=0; i<coorddim; i++)
\n+
142 if (not axes_[i])
\n+
143 upper_[i] = lower_[i];
\n+
144 }
\n+
\n+
145
\n+
\n+
150 AxisAlignedCubeGeometry(const Dune::FieldVector<ctype,coorddim> lower)
\n+
151 : lower_(lower)
\n+
152 {}
\n+
\n+
153
\n+
\n+\n+
156 {
\n+
157 return GeometryTypes::cube(dim);
\n+
158 }
\n+
\n
159
\n-
160 template< template< class > class Operation, class Topology >
\n-
161 struct [[deprecated("Use IfGeometryType instead.")]] IfTopology< Operation, 0, Topology >
\n-
162 {
\n-
163 template< class... Args >
\n-
164 static auto apply ([[maybe_unused]] unsigned int topologyId, Args &&... args)
\n-
165 {
\n-
166 return Operation< Topology >::apply( std::forward< Args >( args )... );
\n-
167 }
\n-
168 };
\n-
169
\n-
170 } // namespace Impl
\n-
171#endif
\n+
\n+\n+
162 {
\n+
163 GlobalCoordinate result;
\n+
164 if (dim == coorddim) { // fast case
\n+
165 for (size_t i=0; i<coorddim; i++)
\n+
166 result[i] = lower_[i] + local[i]*(upper_[i] - lower_[i]);
\n+
167 } else if (dim == 0) { // a vertex -- the other fast case
\n+
168 result = lower_; // hope for named-return-type-optimization
\n+
169 } else { // slow case
\n+
170 size_t lc=0;
\n+
171 for (size_t i=0; i<coorddim; i++)
\n+
172 result[i] = (axes_[i])
\n+
173 ? lower_[i] + local[lc++]*(upper_[i] - lower_[i])
\n+
174 : lower_[i];
\n+
175 }
\n+
176 return result;
\n+
177 }
\n+
\n+
178
\n+
\n+\n+
181 {
\n+
182 LocalCoordinate result;
\n+
183 if (dim == coorddim) { // fast case
\n+
184 for (size_t i=0; i<dim; i++)
\n+
185 result[i] = (global[i] - lower_[i]) / (upper_[i] - lower_[i]);
\n+
186 } else if (dim != 0) { // slow case
\n+
187 size_t lc=0;
\n+
188 for (size_t i=0; i<coorddim; i++)
\n+
189 if (axes_[i])
\n+
190 result[lc++] = (global[i] - lower_[i]) / (upper_[i] - lower_[i]);
\n+
191 }
\n+
192 return result;
\n+
193 }
\n+
\n+
194
\n+
\n+\n+
197 {
\n+
198 JacobianTransposed result;
\n+
199
\n+
200 // Actually compute the result. Uses different methods depending
\n+
201 // on what kind of matrix JacobianTransposed is.
\n+
202 jacobianTransposed(result);
\n+
203
\n+
204 return result;
\n+
205 }
\n+
\n+
206
\n+
\n+\n+
209 {
\n+\n+
211
\n+
212 // Actually compute the result. Uses different methods depending
\n+
213 // on what kind of matrix JacobianTransposed is.
\n+\n+
215
\n+
216 return result;
\n+
217 }
\n+
\n+
218
\n+
\n+
220 Jacobian jacobian([[maybe_unused]] const LocalCoordinate& local) const
\n+
221 {
\n+
222 return jacobianTransposed(local).transposed();
\n+
223 }
\n+
\n+
224
\n+
\n+\n+
227 {
\n+
228 return jacobianInverseTransposed(local).transposed();
\n+
229 }
\n+
\n+
230
\n+
\n+
234 Volume integrationElement([[maybe_unused]] const LocalCoordinate& local) const
\n+
235 {
\n+
236 return volume();
\n+
237 }
\n+
\n+
238
\n+
\n+\n+
241 {
\n+
242 GlobalCoordinate result;
\n+
243 if (dim==0)
\n+
244 result = lower_;
\n+
245 else {
\n+
246 // Since lower_==upper_ for unused coordinates, this always does the right thing
\n+
247 for (size_t i=0; i<coorddim; i++)
\n+
248 result[i] = CoordType(0.5) * (lower_[i] + upper_[i]);
\n+
249 }
\n+
250 return result;
\n+
251 }
\n+
\n+
252
\n+
\n+
254 int corners() const
\n+
255 {
\n+
256 return 1<<dim;
\n+
257 }
\n+
\n+
258
\n+
\n+\n+
261 {
\n+
262 GlobalCoordinate result;
\n+
263 if (dim == coorddim) { // fast case
\n+
264 for (size_t i=0; i<coorddim; i++)
\n+
265 result[i] = (k & (1<<i)) ? upper_[i] : lower_[i];
\n+
266 } else if (dim == 0) { // vertex
\n+
267 result = lower_; // rely on named return-type optimization
\n+
268 } else { // slow case
\n+
269 unsigned int mask = 1;
\n+
270
\n+
271 for (size_t i=0; i<coorddim; i++) {
\n+
272 if (not axes_[i])
\n+
273 result[i] = lower_[i];
\n+
274 else {
\n+
275 result[i] = (k & mask) ? upper_[i] : lower_[i];
\n+
276 mask = (mask<<1);
\n+
277 }
\n+
278 }
\n+
279 }
\n+
280
\n+
281
\n+
282 return result;
\n+
283 }
\n+
\n+
284
\n+
\n+\n+
287 {
\n+
288 ctype vol = 1;
\n+
289 if (dim == coorddim) { // fast case
\n+
290 for (size_t i=0; i<dim; i++)
\n+
291 vol *= upper_[i] - lower_[i];
\n+
292 // do nothing if dim == 0
\n+
293 } else if (dim != 0) { // slow case
\n+
294 for (size_t i=0; i<coorddim; i++)
\n+
295 if (axes_[i])
\n+
296 vol *= upper_[i] - lower_[i];
\n+
297 }
\n+
298 return vol;
\n+
299 }
\n+
\n+
300
\n+
\n+
302 bool affine() const
\n+
303 {
\n+
304 return true;
\n+
305 }
\n+
\n+
306
\n+
\n+
307 friend Dune::Transitional::ReferenceElement< ctype, Dim<dim> > referenceElement ( const AxisAlignedCubeGeometry & /* geometry */ )
\n+
308 {
\n+\n+
310 }
\n+
\n+
311
\n+
312 private:
\n+
313 // jacobianTransposed: fast case --> diagonal matrix
\n+
314 void jacobianTransposed ( DiagonalMatrix<ctype,dim> &jacobianTransposed ) const
\n+
315 {
\n+
316 for (size_t i=0; i<dim; i++)
\n+
317 jacobianTransposed.diagonal()[i] = upper_[i] - lower_[i];
\n+
318 }
\n+
319
\n+
320 // jacobianTransposed: slow case --> dense matrix
\n+
321 void jacobianTransposed ( FieldMatrix<ctype,dim,coorddim> &jacobianTransposed ) const
\n+
322 {
\n+
323 if (dim==0)
\n+
324 return;
\n+
325
\n+
326 size_t lc = 0;
\n+
327 for (size_t i=0; i<coorddim; i++)
\n+
328 if (axes_[i])
\n+
329 jacobianTransposed[lc++][i] = upper_[i] - lower_[i];
\n+
330 }
\n+
331
\n+
332 // jacobianInverseTransposed: fast case --> diagonal matrix
\n+
333 void jacobianInverseTransposed ( DiagonalMatrix<ctype,dim> &jacobianInverseTransposed ) const
\n+
334 {
\n+
335 for (size_t i=0; i<dim; i++)
\n+
336 jacobianInverseTransposed.diagonal()[i] = CoordType(1.0) / (upper_[i] - lower_[i]);
\n+
337 }
\n+
338
\n+
339 // jacobianInverseTransposed: slow case --> dense matrix
\n+
340 void jacobianInverseTransposed ( FieldMatrix<ctype,coorddim,dim> &jacobianInverseTransposed ) const
\n+
341 {
\n+
342 if (dim==0)
\n+
343 return;
\n+
344
\n+
345 size_t lc = 0;
\n+
346 for (size_t i=0; i<coorddim; i++)
\n+
347 if (axes_[i])
\n+
348 jacobianInverseTransposed[i][lc++] = CoordType(1.0) / (upper_[i] - lower_[i]);
\n+
349 }
\n+
350
\n+
351 Dune::FieldVector<ctype,coorddim> lower_;
\n+
352
\n+
353 Dune::FieldVector<ctype,coorddim> upper_;
\n+
354
\n+
355 std::bitset<coorddim> axes_;
\n+
356 };
\n+
\n+
357
\n+
358} // namespace Dune
\n+
359#endif
\n+
A unique label for each type of element that can occur in a grid.
\n+\n+
Definition affinegeometry.hh:21
\n+
static const ReferenceElement & cube()
get hypercube reference elements
Definition referenceelements.hh:210
\n+
A geometry implementation for axis-aligned hypercubes.
Definition axisalignedcubegeometry.hh:50
\n+
Volume volume() const
Return the element volume.
Definition axisalignedcubegeometry.hh:286
\n+
AxisAlignedCubeGeometry(const Dune::FieldVector< ctype, coorddim > lower, const Dune::FieldVector< ctype, coorddim > upper, const std::bitset< coorddim > &axes)
Constructor from a lower left and an upper right corner.
Definition axisalignedcubegeometry.hh:133
\n+
AxisAlignedCubeGeometry(const Dune::FieldVector< ctype, coorddim > lower, const Dune::FieldVector< ctype, coorddim > upper)
Constructor from a lower left and an upper right corner.
Definition axisalignedcubegeometry.hh:115
\n+
JacobianInverse jacobianInverse(const LocalCoordinate &local) const
Inverse Jacobian of the transformation from local to global coordinates.
Definition axisalignedcubegeometry.hh:226
\n+
JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate &local) const
Inverse Jacobian transposed of the transformation from local to global coordinates.
Definition axisalignedcubegeometry.hh:208
\n+
std::conditional< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< ctype, dim, coorddim > >::type JacobianTransposed
Return type of jacobianTransposed.
Definition axisalignedcubegeometry.hh:81
\n+
AxisAlignedCubeGeometry(const Dune::FieldVector< ctype, coorddim > lower)
Constructor from a single point only.
Definition axisalignedcubegeometry.hh:150
\n+
static constexpr int mydimension
Dimension of the cube element.
Definition axisalignedcubegeometry.hh:56
\n+
static constexpr int coorddimension
Dimension of the world space that the cube element is embedded in.
Definition axisalignedcubegeometry.hh:59
\n+
GlobalCoordinate corner(int k) const
Return world coordinates of the k-th corner of the element.
Definition axisalignedcubegeometry.hh:260
\n+
ctype Volume
Type used for volume.
Definition axisalignedcubegeometry.hh:71
\n+
FieldVector< ctype, dim > LocalCoordinate
Type used for a vector of element coordinates.
Definition axisalignedcubegeometry.hh:65
\n+
friend Dune::Transitional::ReferenceElement< ctype, Dim< dim > > referenceElement(const AxisAlignedCubeGeometry &)
Definition axisalignedcubegeometry.hh:307
\n+
JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const
Jacobian transposed of the transformation from local to global coordinates.
Definition axisalignedcubegeometry.hh:196
\n+
FieldVector< ctype, coorddim > GlobalCoordinate
Type used for a vector of world coordinates.
Definition axisalignedcubegeometry.hh:68
\n+
LocalCoordinate local(const GlobalCoordinate &global) const
Map a point in global (world) coordinates to element coordinates.
Definition axisalignedcubegeometry.hh:180
\n+
CoordType ctype
Type used for single coordinate coefficients.
Definition axisalignedcubegeometry.hh:62
\n+
std::conditional_t< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< ctype, coorddim, dim > > Jacobian
Return type of jacobian.
Definition axisalignedcubegeometry.hh:100
\n+
GeometryType type() const
Type of the cube. Here: a hypercube of the correct dimension.
Definition axisalignedcubegeometry.hh:155
\n+
int corners() const
Return the number of corners of the element.
Definition axisalignedcubegeometry.hh:254
\n+
Jacobian jacobian(const LocalCoordinate &local) const
Jacobian of the transformation from local to global coordinates.
Definition axisalignedcubegeometry.hh:220
\n+
std::conditional< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< ctype, coorddim, dim > >::type JacobianInverseTransposed
Return type of jacobianInverseTransposed.
Definition axisalignedcubegeometry.hh:91
\n+
Volume integrationElement(const LocalCoordinate &local) const
Return the integration element, i.e., the determinant term in the integral transformation formula.
Definition axisalignedcubegeometry.hh:234
\n+
GlobalCoordinate center() const
Return center of mass of the element.
Definition axisalignedcubegeometry.hh:240
\n+
bool affine() const
Return if the element is affine. Here: yes.
Definition axisalignedcubegeometry.hh:302
\n+
std::conditional_t< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< ctype, dim, coorddim > > JacobianInverse
Return type of jacobianInverse.
Definition axisalignedcubegeometry.hh:109
\n+
GlobalCoordinate global(const LocalCoordinate &local) const
Map a point in local (element) coordinates to world coordinates.
Definition axisalignedcubegeometry.hh:161
\n+
Unique label for each type of entities that can occur in DUNE grids.
Definition type.hh:126
\n
\n \n
\n Generated by \"doxygen\"/ 1.9.8\n
\n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,191 +7,431 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n-deprecated_topology.hh\n+axisalignedcubegeometry.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file\n LICENSE.md in module root\n 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n- 5#ifndef DUNE_DEPRECATED_TOPOLOGY_HH\n- 6#define DUNE_DEPRECATED_TOPOLOGY_HH\n- 7\n- 8 namespace Impl\n- 9 {\n- 10\n- 11 // Basic Topology Types\n- 12 // --------------------\n- 13\n- 14 // PointDeprecationHelper can be used to prevent a deprecation warning for\n-Point\n- 15 struct PointDeprecationHelper\n- 16 {\n- 17 static const unsigned int dimension = 0;\n- 18 static const unsigned int numCorners = 1;\n- 19\n- 20 static const unsigned int id = 0;\n+ 5\n+ 6#ifndef DUNE_GEOMETRY_AXISALIGNED_CUBE_GEOMETRY_HH\n+ 7#define DUNE_GEOMETRY_AXISALIGNED_CUBE_GEOMETRY_HH\n+ 8\n+ 13#include \n+ 14\n+ 15#include \n+ 16#include \n+ 17#include \n+ 18\n+ 19#include \n+ 20#include \n 21\n- 22 static std::string name () { return \"p\"; }\n- 23 };\n+ 22\n+ 23namespace Dune {\n 24\n- 25 using Point [[deprecated(\"Use GeometryTypes::vertex instead.\")]] =\n-PointDeprecationHelper;\n- 26\n- 27\n- 28 template< class BaseTopology >\n- 29 struct [[deprecated(\"Use GeometryTypes::prismaticExtension(GeometryType gt)\n-instead.\")]] Prism\n- 30 {\n- 31 static const unsigned int dimension = BaseTopology::dimension + 1;\n- 32 static const unsigned int numCorners = 2 * BaseTopology::numCorners;\n- 33\n- 34 static const unsigned int id = BaseTopology::id | ((unsigned\n-int)prismConstruction << (dimension-1));\n- 35\n- 36 static std::string name () { return BaseTopology::name() + \"l\"; }\n- 37 };\n- 38\n- 39\n- 40 template< class BaseTopology >\n- 41 struct [[deprecated(\"Use GeometryTypes::conicalExtension(GeometryType gt)\n-instead.\")]] Pyramid\n- 42 {\n- 43 static const unsigned int dimension = BaseTopology::dimension + 1;\n- 44 static const unsigned int numCorners = BaseTopology::numCorners + 1;\n- 45\n- 46 static const unsigned int id = BaseTopology::id | ((unsigned\n-int)pyramidConstruction << (dimension-1));\n- 47\n- 48 static std::string name () { return BaseTopology::name() + \"o\"; }\n- 49 };\n- 50\n+ 48 template \n+49 class AxisAlignedCubeGeometry\n+ 50 {\n 51\n 52\n- 53 // Properties of Topologies\n- 54 // ------------------------\n- 55\n- 56 template< class Topology >\n- 57 struct [[deprecated(\"Use GeometryType::isSimplex() instead.\")]] IsSimplex\n- 58 : public std::integral_constant< bool, (Topology::id >> 1) == 0 >\n- 59 {};\n+ 53 public:\n+ 54\n+56 constexpr static int mydimension = dim;\n+ 57\n+59 constexpr static int coorddimension = coorddim;\n 60\n- 61 template< class Topology >\n- 62 struct [[deprecated(\"Use GeometryType::isCube() instead.\")]] IsCube\n- 63 : public std::integral_constant< bool, (Topology::id | 1) == (1 <<\n-Topology::dimension) - 1 >\n- 64 {};\n- 65\n- 78 [[deprecated(\"Use GeometryType::isPrismatic() or GeometryType::isConical()\n-instead.\")]]\n- 79 inline static bool isTopology ( TopologyConstruction construction, unsigned\n-int topologyId, int dim, int codim = 0 ) noexcept\n- 80 {\n- 81 assert( (dim > 0) && (topologyId < numTopologies( dim )) );\n- 82 assert( (0 <= codim) && (codim <= dim) );\n- 83 return (codim >= (dim-1)) || (((topologyId >> (dim-codim-1)) & 1) ==\n-(unsigned int)construction);\n- 84 }\n- 85\n- 86\n- 87 // SimplexTopology\n- 88 // ---------------\n- 89\n- 90 template< unsigned int dim >\n- 91 struct [[deprecated(\"Use GeometryTypes::simplex(dim) instead.\")]]\n-SimplexTopology\n- 92 {\n- 93 typedef Pyramid< typename SimplexTopology< dim-1 >::type > type;\n- 94 };\n- 95\n- 96 template<>\n- 97 struct [[deprecated(\"Use GeometryTypes::simplex(dim) instead.\")]]\n-SimplexTopology< 0 >\n- 98 {\n- 99 typedef Point type;\n- 100 };\n+62 typedef CoordType ctype;\n+ 63\n+65 typedef FieldVector LocalCoordinate;\n+ 66\n+68 typedef FieldVector GlobalCoordinate;\n+ 69\n+71 typedef ctype Volume;\n+ 72\n+ 79 typedef typename std::conditional,\n+81 FieldMatrix >::type JacobianTransposed;\n+ 82\n+ 89 typedef typename std::conditional,\n+91 FieldMatrix >::type JacobianInverseTransposed;\n+ 92\n+100 using Jacobian = std::conditional_t, FieldMatrix >;\n 101\n- 102\n- 103\n- 104 // CubeTopology\n- 105 // ------------\n- 106\n- 107 template< unsigned int dim >\n- 108 struct [[deprecated(\"Use GeometryTypes::cube(dim) instead.\")]]\n-CubeTopology\n- 109 {\n- 110 typedef Prism< typename CubeTopology< dim-1 >::type > type;\n- 111 };\n- 112\n- 113 template<>\n- 114 struct [[deprecated(\"Use GeometryTypes::simplex(dim) instead.\")]]\n-CubeTopology< 0 >\n- 115 {\n- 116 typedef Point type;\n- 117 };\n- 118\n- 119\n- 120\n- 121 // PyramidTopology\n- 122 // ---------------\n- 123\n- 124 template< unsigned int dim >\n- 125 struct [[deprecated]] PyramidTopology\n- 126 {\n- 127 typedef Pyramid< typename CubeTopology< dim-1 >::type > type;\n- 128 };\n- 129\n- 130\n- 131\n- 132 // PrismTopology\n- 133 // -------------\n- 134\n- 135 template< unsigned int dim >\n- 136 struct [[deprecated]] PrismTopology\n- 137 {\n- 138 typedef Prism< typename SimplexTopology< dim-1 >::type > type;\n- 139 };\n- 140\n- 141\n- 142\n- 143\n- 144 // IfTopology\n- 145 // ----------\n- 146\n- 147 template< template< class > class Operation, int dim, class Topology =\n-PointDeprecationHelper >\n- 148 struct [[deprecated(\"Use IfGeometryType instead.\")]] IfTopology\n- 149 {\n- 150 template< class... Args >\n- 151 static auto apply ( unsigned int topologyId, Args &&... args )\n- 152 {\n- 153 if( topologyId & 1 )\n- 154 return IfTopology< Operation, dim-1, Prism< Topology > >::apply\n-( topologyId >> 1, std::forward< Args >( args )... );\n- 155 else\n- 156 return IfTopology< Operation, dim-1, Pyramid< Topology > >::apply\n-( topologyId >> 1, std::forward< Args >( args )... );\n- 157 }\n- 158 };\n+109 using JacobianInverse = std::conditional_t, FieldMatrix >;\n+ 110\n+115 AxisAlignedCubeGeometry(const Dune::FieldVector lower,\n+ 116 const Dune::FieldVector upper)\n+ 117 : lower_(lower),\n+ 118 upper_(upper),\n+ 119 axes_()\n+ 120 {\n+ 121 static_assert(dim==coorddim, \"Use this constructor only if\n+dim==coorddim!\");\n+ 122 // all 'true', but is never actually used\n+ 123 axes_ = (1< lower,\n+ 134 const Dune::FieldVector upper,\n+ 135 const std::bitset& axes)\n+ 136 : lower_(lower),\n+ 137 upper_(upper),\n+ 138 axes_(axes)\n+ 139 {\n+ 140 assert(axes.count()==dim);\n+ 141 for (size_t i=0; i lower)\n+ 151 : lower_(lower)\n+ 152 {}\n+ 153\n+155 GeometryType type() const\n+ 156 {\n+ 157 return GeometryTypes::cube(dim);\n+ 158 }\n 159\n- 160 template< template< class > class Operation, class Topology >\n- 161 struct [[deprecated(\"Use IfGeometryType instead.\")]] IfTopology<\n-Operation, 0, Topology >\n+161 GlobalCoordinate global(const LocalCoordinate& local) const\n 162 {\n- 163 template< class... Args >\n- 164 static auto apply ([[maybe_unused]] unsigned int topologyId, Args &&...\n-args)\n- 165 {\n- 166 return Operation< Topology >::apply( std::forward< Args >( args )... );\n- 167 }\n- 168 };\n- 169\n- 170 } // namespace Impl\n- 171#endif\n+ 163 GlobalCoordinate result;\n+ 164 if (dim == coorddim) { // fast case\n+ 165 for (size_t i=0; i >\n+referenceElement ( const AxisAlignedCubeGeometry & /* geometry */ )\n+ 308 {\n+ 309 return ReferenceElements<_ctype,_dim_>::cube();\n+ 310 }\n+ 311\n+ 312 private:\n+ 313 // jacobianTransposed: fast case --> diagonal matrix\n+ 314 void jacobianTransposed ( DiagonalMatrix &jacobianTransposed )\n+const\n+ 315 {\n+ 316 for (size_t i=0; i dense matrix\n+ 321 void jacobianTransposed ( FieldMatrix\n+&jacobianTransposed ) const\n+ 322 {\n+ 323 if (dim==0)\n+ 324 return;\n+ 325\n+ 326 size_t lc = 0;\n+ 327 for (size_t i=0; i diagonal matrix\n+ 333 void jacobianInverseTransposed ( DiagonalMatrix\n+&jacobianInverseTransposed ) const\n+ 334 {\n+ 335 for (size_t i=0; i dense matrix\n+ 340 void jacobianInverseTransposed ( FieldMatrix\n+&jacobianInverseTransposed ) const\n+ 341 {\n+ 342 if (dim==0)\n+ 343 return;\n+ 344\n+ 345 size_t lc = 0;\n+ 346 for (size_t i=0; i lower_;\n+ 352\n+ 353 Dune::FieldVector upper_;\n+ 354\n+ 355 std::bitset axes_;\n+ 356 };\n+ 357\n+ 358} // namespace Dune\n+ 359#endif\n+type.hh\n+A unique label for each type of element that can occur in a grid.\n+referenceelements.hh\n+Dune\n+Definition affinegeometry.hh:21\n+Dune::Geo::ReferenceElements::cube\n+static const ReferenceElement & cube()\n+get hypercube reference elements\n+Definition referenceelements.hh:210\n+Dune::AxisAlignedCubeGeometry\n+A geometry implementation for axis-aligned hypercubes.\n+Definition axisalignedcubegeometry.hh:50\n+Dune::AxisAlignedCubeGeometry::volume\n+Volume volume() const\n+Return the element volume.\n+Definition axisalignedcubegeometry.hh:286\n+Dune::AxisAlignedCubeGeometry::AxisAlignedCubeGeometry\n+AxisAlignedCubeGeometry(const Dune::FieldVector< ctype, coorddim > lower, const\n+Dune::FieldVector< ctype, coorddim > upper, const std::bitset< coorddim >\n+&axes)\n+Constructor from a lower left and an upper right corner.\n+Definition axisalignedcubegeometry.hh:133\n+Dune::AxisAlignedCubeGeometry::AxisAlignedCubeGeometry\n+AxisAlignedCubeGeometry(const Dune::FieldVector< ctype, coorddim > lower, const\n+Dune::FieldVector< ctype, coorddim > upper)\n+Constructor from a lower left and an upper right corner.\n+Definition axisalignedcubegeometry.hh:115\n+Dune::AxisAlignedCubeGeometry::jacobianInverse\n+JacobianInverse jacobianInverse(const LocalCoordinate &local) const\n+Inverse Jacobian of the transformation from local to global coordinates.\n+Definition axisalignedcubegeometry.hh:226\n+Dune::AxisAlignedCubeGeometry::jacobianInverseTransposed\n+JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate\n+&local) const\n+Inverse Jacobian transposed of the transformation from local to global\n+coordinates.\n+Definition axisalignedcubegeometry.hh:208\n+Dune::AxisAlignedCubeGeometry::JacobianTransposed\n+std::conditional< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix<\n+ctype, dim, coorddim > >::type JacobianTransposed\n+Return type of jacobianTransposed.\n+Definition axisalignedcubegeometry.hh:81\n+Dune::AxisAlignedCubeGeometry::AxisAlignedCubeGeometry\n+AxisAlignedCubeGeometry(const Dune::FieldVector< ctype, coorddim > lower)\n+Constructor from a single point only.\n+Definition axisalignedcubegeometry.hh:150\n+Dune::AxisAlignedCubeGeometry::mydimension\n+static constexpr int mydimension\n+Dimension of the cube element.\n+Definition axisalignedcubegeometry.hh:56\n+Dune::AxisAlignedCubeGeometry::coorddimension\n+static constexpr int coorddimension\n+Dimension of the world space that the cube element is embedded in.\n+Definition axisalignedcubegeometry.hh:59\n+Dune::AxisAlignedCubeGeometry::corner\n+GlobalCoordinate corner(int k) const\n+Return world coordinates of the k-th corner of the element.\n+Definition axisalignedcubegeometry.hh:260\n+Dune::AxisAlignedCubeGeometry::Volume\n+ctype Volume\n+Type used for volume.\n+Definition axisalignedcubegeometry.hh:71\n+Dune::AxisAlignedCubeGeometry::LocalCoordinate\n+FieldVector< ctype, dim > LocalCoordinate\n+Type used for a vector of element coordinates.\n+Definition axisalignedcubegeometry.hh:65\n+Dune::AxisAlignedCubeGeometry::referenceElement\n+friend Dune::Transitional::ReferenceElement< ctype, Dim< dim > >\n+referenceElement(const AxisAlignedCubeGeometry &)\n+Definition axisalignedcubegeometry.hh:307\n+Dune::AxisAlignedCubeGeometry::jacobianTransposed\n+JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const\n+Jacobian transposed of the transformation from local to global coordinates.\n+Definition axisalignedcubegeometry.hh:196\n+Dune::AxisAlignedCubeGeometry::GlobalCoordinate\n+FieldVector< ctype, coorddim > GlobalCoordinate\n+Type used for a vector of world coordinates.\n+Definition axisalignedcubegeometry.hh:68\n+Dune::AxisAlignedCubeGeometry::local\n+LocalCoordinate local(const GlobalCoordinate &global) const\n+Map a point in global (world) coordinates to element coordinates.\n+Definition axisalignedcubegeometry.hh:180\n+Dune::AxisAlignedCubeGeometry::ctype\n+CoordType ctype\n+Type used for single coordinate coefficients.\n+Definition axisalignedcubegeometry.hh:62\n+Dune::AxisAlignedCubeGeometry::Jacobian\n+std::conditional_t< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix<\n+ctype, coorddim, dim > > Jacobian\n+Return type of jacobian.\n+Definition axisalignedcubegeometry.hh:100\n+Dune::AxisAlignedCubeGeometry::type\n+GeometryType type() const\n+Type of the cube. Here: a hypercube of the correct dimension.\n+Definition axisalignedcubegeometry.hh:155\n+Dune::AxisAlignedCubeGeometry::corners\n+int corners() const\n+Return the number of corners of the element.\n+Definition axisalignedcubegeometry.hh:254\n+Dune::AxisAlignedCubeGeometry::jacobian\n+Jacobian jacobian(const LocalCoordinate &local) const\n+Jacobian of the transformation from local to global coordinates.\n+Definition axisalignedcubegeometry.hh:220\n+Dune::AxisAlignedCubeGeometry::JacobianInverseTransposed\n+std::conditional< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix<\n+ctype, coorddim, dim > >::type JacobianInverseTransposed\n+Return type of jacobianInverseTransposed.\n+Definition axisalignedcubegeometry.hh:91\n+Dune::AxisAlignedCubeGeometry::integrationElement\n+Volume integrationElement(const LocalCoordinate &local) const\n+Return the integration element, i.e., the determinant term in the integral\n+transformation formula.\n+Definition axisalignedcubegeometry.hh:234\n+Dune::AxisAlignedCubeGeometry::center\n+GlobalCoordinate center() const\n+Return center of mass of the element.\n+Definition axisalignedcubegeometry.hh:240\n+Dune::AxisAlignedCubeGeometry::affine\n+bool affine() const\n+Return if the element is affine. Here: yes.\n+Definition axisalignedcubegeometry.hh:302\n+Dune::AxisAlignedCubeGeometry::JacobianInverse\n+std::conditional_t< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix<\n+ctype, dim, coorddim > > JacobianInverse\n+Return type of jacobianInverse.\n+Definition axisalignedcubegeometry.hh:109\n+Dune::AxisAlignedCubeGeometry::global\n+GlobalCoordinate global(const LocalCoordinate &local) const\n+Map a point in local (element) coordinates to world coordinates.\n+Definition axisalignedcubegeometry.hh:161\n+Dune::GeometryType\n+Unique label for each type of entities that can occur in DUNE grids.\n+Definition type.hh:126\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00179.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00179.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: referenceelements.hh File Reference\n+dune-geometry: multilineargeometry.hh File Reference\n \n \n \n \n \n \n \n@@ -71,73 +71,56 @@\n \n \n \n
\n \n-
referenceelements.hh File Reference
\n+Namespaces
\n+
multilineargeometry.hh File Reference
\n \n
\n
#include <cassert>
\n-#include <algorithm>
\n+#include <functional>
\n+#include <iterator>
\n #include <limits>
\n-#include <tuple>
\n-#include <utility>
\n #include <vector>
\n-#include <array>
\n+#include <dune/common/fmatrix.hh>
\n+#include <dune/common/fvector.hh>
\n #include <dune/common/typetraits.hh>
\n-#include <dune/common/std/type_traits.hh>
\n-#include <dune/common/visibility.hh>
\n-#include <dune/geometry/dimension.hh>
\n+#include <dune/geometry/affinegeometry.hh>
\n+#include <dune/geometry/referenceelements.hh>
\n #include <dune/geometry/type.hh>
\n-#include <dune/geometry/referenceelement.hh>
\n-#include <dune/geometry/referenceelementimplementation.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

struct  Dune::Geo::ReferenceElements< ctype_, dim >
 Class providing access to the singletons of the reference elements. More...
struct  Dune::MultiLinearGeometryTraits< ct >
 default traits class for MultiLinearGeometry More...
 
struct  Dune::MultiLinearGeometryTraits< ct >::CornerStorage< mydim, cdim >
 template specifying the storage for the corners More...
 
struct  Dune::MultiLinearGeometryTraits< ct >::hasSingleGeometryType< dim >
 will there be only one geometry type for a dimension? More...
 
class  Dune::MultiLinearGeometry< ct, mydim, cdim, Traits >
 generic geometry implementation based on corner coordinates More...
 
class  Dune::MultiLinearGeometry< ct, mydim, cdim, Traits >::JacobianInverseTransposed
 
class  Dune::CachedMultiLinearGeometry< ct, mydim, cdim, Traits >
 Implement a MultiLinearGeometry with additional caching. More...
 
\n \n \n \n-\n-\n-\n-\n-

\n Namespaces

namespace  Dune
 
namespace  Dune::Geo
 
namespace  Dune::Transitional
 
\n-\n-\n-\n-\n-\n-

\n-Typedefs

template<typename T , int dim>
using Dune::ReferenceElement = unspecified-type
 Returns the type of reference element for the argument type T.
 
\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n

\n-Functions

template<typename... T>
unspecified value type Dune::referenceElement (T &&... t)
 Returns a reference element for the objects t....
 
template<typename T , int dim>
auto Dune::referenceElement (const Dune::GeometryType &gt, Dune::Dim< dim >={})
 Returns a reference element of dimension dim for the given geometry type and coordinate field type.
 
template<typename T , int dim, std::enable_if_t< IsNumber< std::decay_t< T > >::value, int > = 0>
auto Dune::referenceElement (const T &, const Dune::GeometryType &gt, Dune::Dim< dim >)
 Returns a reference element of dimension dim for the given geometry type and coordinate field type.
 
\n
\n \n
\n Generated by \"doxygen\"/ 1.9.8\n
\n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,62 +6,46 @@\n dune-geometry\u00a02.9.0\n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n-Classes | Namespaces | Typedefs | Functions\n-referenceelements.hh File Reference\n+Classes | Namespaces\n+multilineargeometry.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 Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0Dune::Geo::ReferenceElements<_ctype_,_dim_>\n-\u00a0 Class providing access to the singletons of the reference elements.\n- More...\n+struct \u00a0Dune::MultiLinearGeometryTraits<_ct_>\n+\u00a0 default traits class for MultiLinearGeometry More...\n \u00a0\n- Namespaces\n-namespace \u00a0Dune\n+struct \u00a0Dune::MultiLinearGeometryTraits<_ct_>::CornerStorage<_mydim,_cdim_>\n+\u00a0 template specifying the storage for the corners More...\n+\u00a0\n+struct \u00a0Dune::MultiLinearGeometryTraits<_ct_>::hasSingleGeometryType<_dim_>\n+\u00a0 will there be only one geometry type for a dimension? More...\n \u00a0\n-namespace \u00a0Dune::Geo\n+ class \u00a0Dune::MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_>\n+\u00a0 generic geometry implementation based on corner coordinates More...\n \u00a0\n-namespace \u00a0Dune::Transitional\n+ class \u00a0Dune::MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_>::\n+ JacobianInverseTransposed\n \u00a0\n- Typedefs\n-template\n-using\u00a0Dune::ReferenceElement = unspecified-type\n-\u00a0 Returns the type of reference element for the argument type T.\n-\u00a0\n- Functions\n-template\n-unspecified value type\u00a0Dune::referenceElement (T &&... t)\n-\u00a0 Returns a reference element for the objects t....\n-\u00a0\n-template\n- auto\u00a0Dune::referenceElement (const Dune::GeometryType >,\n- Dune::Dim< dim >={})\n-\u00a0 Returns a reference element of dimension dim for the\n- given geometry type and coordinate field type.\n-\u00a0\n-template\n->::value, int > = 0>\n- auto\u00a0Dune::referenceElement (const T &, const Dune::\n- GeometryType >, Dune::Dim< dim >)\n-\u00a0 Returns a reference element of dimension dim for the\n- given geometry type and coordinate field type.\n+ class \u00a0Dune::CachedMultiLinearGeometry<_ct,_mydim,_cdim,_Traits_>\n+\u00a0 Implement a MultiLinearGeometry with additional caching. More...\n+\u00a0\n+ Namespaces\n+namespace \u00a0Dune\n \u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00179_source.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00179_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: referenceelements.hh Source File\n+dune-geometry: multilineargeometry.hh Source File\n \n \n \n \n \n \n \n@@ -74,421 +74,840 @@\n \n
\n \n
\n \n
\n-
referenceelements.hh
\n+
multilineargeometry.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
\n
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
\n-
5#ifndef DUNE_GEOMETRY_REFERENCEELEMENTS_HH
\n-
6#define DUNE_GEOMETRY_REFERENCEELEMENTS_HH
\n+
5#ifndef DUNE_GEOMETRY_MULTILINEARGEOMETRY_HH
\n+
6#define DUNE_GEOMETRY_MULTILINEARGEOMETRY_HH
\n
7
\n
8#include <cassert>
\n-
9
\n-
10#include <algorithm>
\n+
9#include <functional>
\n+
10#include <iterator>
\n
11#include <limits>
\n-
12#include <tuple>
\n-
13#include <utility>
\n-
14#include <vector>
\n-
15#include <array>
\n-
16
\n-
17#include <dune/common/typetraits.hh>
\n-
18#include <dune/common/std/type_traits.hh>
\n-
19#include <dune/common/visibility.hh>
\n-
20
\n-\n-
22#include <dune/geometry/type.hh>
\n-\n-\n-
25
\n-
26namespace Dune
\n-
27{
\n-
28
\n-
29 namespace Geo
\n-
30 {
\n-
31
\n-
32#ifndef DOXYGEN
\n-
33
\n-
34
\n-
35 template<typename ctype, int dim>
\n-
36 class DeprecatedReferenceElement
\n-
37 : public ReferenceElement<ReferenceElementImplementation<ctype,dim>>
\n-
38 {
\n-
39
\n-
40 protected:
\n-
41
\n-
42 DeprecatedReferenceElement() = default;
\n-
43
\n-
44 public:
\n-
45
\n-
46 DeprecatedReferenceElement(const DeprecatedReferenceElement&) = delete;
\n-
47 DeprecatedReferenceElement& operator=(const DeprecatedReferenceElement&) = delete;
\n-
48
\n-
49 DeprecatedReferenceElement(const ReferenceElementImplementation<ctype,dim>& impl)
\n-
50 : ReferenceElement<ReferenceElementImplementation<ctype,dim>>(impl)
\n-
51 {}
\n-
52
\n-
53 };
\n-
54
\n-
55
\n-
56 template<typename ctype, int dim>
\n-
57 class ConstructibleDeprecatedReferenceElement
\n-
58 : public DeprecatedReferenceElement<ctype,dim>
\n-
59 {
\n-
60 public:
\n-
61 ConstructibleDeprecatedReferenceElement() = default;
\n-
62 };
\n-
63
\n-
64
\n-
65 namespace Impl
\n-
66 {
\n-
67
\n-
68 // ReferenceElementContainer
\n-
69 // -------------------------
\n-
70
\n-
71 template< class ctype, int dim >
\n-
72 class ReferenceElementContainer
\n-
73 {
\n-
74 static const unsigned int numTopologies = dim >= 0 ? (1u << dim) : 0;
\n-
75
\n-
76 using Implementation = ReferenceElementImplementation< ctype, dim >;
\n-
77 using ConstructibleDeprecatedReferenceElement = Dune::Geo::ConstructibleDeprecatedReferenceElement<ctype,dim>;
\n-
78
\n-
79 public:
\n-
80
\n-
81 using DeprecatedReferenceElement = Dune::Geo::DeprecatedReferenceElement<ctype,dim>;
\n-
82
\n-
83 using ReferenceElement = Dune::Geo::ReferenceElement< Implementation >;
\n-
84 using value_type = ReferenceElement;
\n-
85 using const_iterator = const value_type*;
\n-
86
\n-
87 ReferenceElementContainer ()
\n-
88 {
\n-
89 for( unsigned int topologyId = 0; topologyId < numTopologies; ++topologyId )
\n-
90 {
\n-
91 implementations_[ topologyId ].initialize( topologyId );
\n-
92 reference_elements_[ topologyId ].setImplementation( implementations_[ topologyId ] );
\n-
93 }
\n-
94 }
\n-
95
\n-
96 const ReferenceElement& operator() ( const GeometryType &type ) const
\n-
97 {
\n-
98 assert( type.dim() == dim );
\n-
99 return reference_elements_[ type.id() ];
\n-
100 }
\n-
101
\n-
102 const ReferenceElement& simplex () const
\n-
103 {
\n-
104 return reference_elements_[ Dune::GeometryTypes::simplex(dim).id() ];
\n-
105 }
\n-
106
\n-
107 const ReferenceElement& cube () const
\n-
108 {
\n-
109 return reference_elements_[ Dune::GeometryTypes::cube(dim).id() ];
\n-
110 }
\n-
111
\n-
112 const ReferenceElement& pyramid () const
\n-
113 {
\n-
114 return reference_elements_[ Dune::GeometryTypes::pyramid.id() ];
\n-
115 }
\n-
116
\n-
117 const ReferenceElement& prism () const
\n-
118 {
\n-
119 return reference_elements_[ Dune::GeometryTypes::prism.id() ];
\n-
120 }
\n-
121
\n-
122 const_iterator begin () const
\n-
123 {
\n-
124 return reference_elements_.data();
\n-
125 }
\n-
126
\n-
127 const_iterator end () const
\n-
128 {
\n-
129 return reference_elements_.data() + numTopologies;
\n-
130 }
\n-
131
\n-
132 // here, we make sure to actually return a const reference to something
\n-
133 // that is guaranteed not to become invalid, as otherwise, we might run
\n-
134 // straight into debugging hell when a user binds the return value to a
\n-
135 // const ref and the temporary goes out of scope.
\n-
136 const DeprecatedReferenceElement& deprecated(const ReferenceElement& v) const
\n-
137 {
\n-
138 return reference_elements_[v.impl().type(0,0).id()];
\n-
139 }
\n-
140
\n-
141 private:
\n-
142
\n-
143 std::array<Implementation,numTopologies> implementations_;
\n-
144 std::array<ConstructibleDeprecatedReferenceElement,numTopologies> reference_elements_;
\n-
145
\n-
146 };
\n-
147
\n-
148
\n-
149 } // namespace Impl
\n-
150
\n-
151
\n-
152#endif // DOXYGEN
\n+
12#include <vector>
\n+
13
\n+
14#include <dune/common/fmatrix.hh>
\n+
15#include <dune/common/fvector.hh>
\n+
16#include <dune/common/typetraits.hh>
\n+
17
\n+\n+\n+
20#include <dune/geometry/type.hh>
\n+
21
\n+
22namespace Dune
\n+
23{
\n+
24
\n+
25 // MultiLinearGeometryTraits
\n+
26 // -------------------------
\n+
27
\n+
37 template< class ct >
\n+
\n+\n+
39 {
\n+
58 typedef Impl::FieldMatrixHelper< ct > MatrixHelper;
\n+
59
\n+
61 static ct tolerance () { return ct( 16 ) * std::numeric_limits< ct >::epsilon(); }
\n+
62
\n+
127 template< int mydim, int cdim >
\n+
\n+\n+
129 {
\n+
130 typedef std::vector< FieldVector< ct, cdim > > Type;
\n+
131 };
\n+
\n+
132
\n+
146 template< int dim >
\n+
\n+\n+
148 {
\n+
149 static const bool v = false;
\n+
150 static const unsigned int topologyId = ~0u;
\n+
151 };
\n+
\n+
152 };
\n+
\n
153
\n
154
\n-
155 // ReferenceElements
\n-
156 // ------------------------
\n-
157
\n-
168 template< class ctype_, int dim >
\n-
\n-\n-
170 {
\n-
171
\n-
173 using ctype = ctype_;
\n-
174
\n-\n-
177
\n-
179 static constexpr int dimension = dim;
\n-
180
\n-
181 private:
\n-
182
\n-
183 using Container = Impl::ReferenceElementContainer< ctype, dim >;
\n-
184
\n-
185 public:
\n-
186
\n-
188 using ReferenceElement = typename Container::ReferenceElement;
\n-
189
\n-
191 using Iterator = typename Container::const_iterator;
\n+
155
\n+
156 // MultiLinearGeometry
\n+
157 // -------------------
\n+
158
\n+
179 template< class ct, int mydim, int cdim, class Traits = MultiLinearGeometryTraits< ct > >
\n+
\n+\n+
181 {
\n+\n+
183
\n+
184 public:
\n+
186 typedef ct ctype;
\n+
187
\n+
189 static const int mydimension= mydim;
\n+
191 static const int coorddimension = cdim;
\n
192
\n-\n-
195
\n-
197 static const ReferenceElement&
\n-
\n-
198 general ( const GeometryType& type )
\n-
199 {
\n-
200 return container() ( type );
\n-
201 }
\n-
\n+
194 typedef FieldVector< ctype, mydimension > LocalCoordinate;
\n+
196 typedef FieldVector< ctype, coorddimension > GlobalCoordinate;
\n+
198 typedef ctype Volume;
\n+
199
\n+
201 typedef FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed;
\n
202
\n-
\n-
204 static const ReferenceElement& simplex ()
\n-
205 {
\n-
206 return container().simplex();
\n-
207 }
\n-
\n+\n+
205
\n+
207 typedef FieldMatrix< ctype, coorddimension, mydimension > Jacobian;
\n
208
\n-
\n-
210 static const ReferenceElement& cube ()
\n-
211 {
\n-
212 return container().cube();
\n-
213 }
\n-
\n-
214
\n-
\n-
215 static Iterator begin ()
\n-
216 {
\n-
217 return container().begin();
\n-
218 }
\n-
\n-
219
\n-
\n-
220 static Iterator end ()
\n-
221 {
\n-
222 return container().end();
\n-
223 }
\n-
\n-
224
\n-
225#ifndef DOXYGEN
\n-
226 static const typename Container::DeprecatedReferenceElement&
\n-
227 deprecated(const ReferenceElement& v)
\n-
228 {
\n-
229 return container().deprecated(v);
\n-
230 }
\n-
231#endif // DOXYGEN
\n-
232
\n-
233 private:
\n-
234
\n-
235 DUNE_EXPORT static const Container& container ()
\n-
236 {
\n-
237 static Container container;
\n-
238 return container;
\n-
239 }
\n-
240 };
\n-
\n-
241
\n-
242 } // namespace Geo
\n-
243
\n-
245 using Geo::ReferenceElements;
\n-
246
\n-
247
\n-
248#ifdef DOXYGEN
\n-
249
\n-
251
\n-
294 template<typename... T>
\n-
295 unspecified-value-type referenceElement(T&&... t);
\n-
296
\n-
297#endif
\n-
298
\n+
210 typedef FieldMatrix< ctype, mydimension, coorddimension > JacobianInverse;
\n+
211
\n+
212 protected:
\n+
213
\n+\n+
215
\n+
216 public:
\n+
217
\n+\n+
220
\n+
221 private:
\n+
222 static const bool hasSingleGeometryType = Traits::template hasSingleGeometryType< mydimension >::v;
\n+
223
\n+
224 protected:
\n+
225 typedef typename Traits::MatrixHelper MatrixHelper;
\n+
226 typedef typename std::conditional< hasSingleGeometryType, std::integral_constant< unsigned int, Traits::template hasSingleGeometryType< mydimension >::topologyId >, unsigned int >::type TopologyId;
\n+
227
\n+
228 public:
\n+
238 template< class Corners >
\n+
\n+\n+
240 const Corners &corners )
\n+
241 : refElement_( refElement ),
\n+
242 corners_( corners )
\n+
243 {}
\n+
\n+
244
\n+
254 template< class Corners >
\n+
\n+\n+
256 const Corners &corners )
\n+
257 : refElement_( ReferenceElements::general( gt ) ),
\n+
258 corners_( corners )
\n+
259 {}
\n+
\n+
260
\n+
\n+
262 bool affine () const
\n+
263 {
\n+\n+
265 return affine( jt );
\n+
266 }
\n+
\n+
267
\n+
269 Dune::GeometryType type () const { return GeometryType( toUnsignedInt(topologyId()), mydimension ); }
\n+
270
\n+
272 int corners () const { return refElement().size( mydimension ); }
\n+
273
\n+
\n+
275 GlobalCoordinate corner ( int i ) const
\n+
276 {
\n+
277 assert( (i >= 0) && (i < corners()) );
\n+
278 return std::cref(corners_).get()[ i ];
\n+
279 }
\n+
\n+
280
\n+
282 GlobalCoordinate center () const { return global( refElement().position( 0, 0 ) ); }
\n+
283
\n+
\n+\n+
291 {
\n+
292 using std::begin;
\n+
293
\n+
294 auto cit = begin(std::cref(corners_).get());
\n+\n+
296 global< false >( topologyId(), std::integral_constant< int, mydimension >(), cit, ctype( 1 ), local, ctype( 1 ), y );
\n+
297 return y;
\n+
298 }
\n+
\n
299
\n-
301
\n-
314 template<typename T, int dim>
\n-
\n-\n-
316 {
\n-\n-
318 }
\n-
\n-
319
\n-
320
\n-
322
\n-
334 template<typename T, int dim, std::enable_if_t<IsNumber<std::decay_t<T>>::value, int> = 0>
\n-
\n-\n-
336 {
\n-\n-
338 }
\n-
\n-
339
\n-
340
\n-
341#ifndef DOXYGEN
\n-
342
\n-
343 // helpers for the ReferenceElement<> meta function
\n-
344
\n-
345 namespace Impl {
\n-
346
\n-
347 // Evaluates to the correct reference element iff <T...> matches the pattern <number_type,Dim<int>>
\n-
348 // otherwise, it's ill-formed. Should be used with detected_or and friends.
\n-
349
\n-
350 template<typename... T>
\n-
351 struct DefaultReferenceElementExtractor;
\n-
352
\n-
353 template<typename T, typename std::enable_if<IsNumber<T>::value,int>::type dim>
\n-
354 struct DefaultReferenceElementExtractor<T,Dim<dim>>
\n-
355 {
\n-\n-
357 };
\n-
358
\n-
359 template<typename... T>
\n-
360 using DefaultReferenceElement = typename DefaultReferenceElementExtractor<T...>::type;
\n-
361
\n-
362 }
\n-
363
\n-
364 // looks up the type of a reference element by trying to instantiate the correct overload
\n-
365 // of referenceElement() for the given arguments. This will fail if there is no valid
\n-
366 // overload and should be used with detected_or or some other utility that places the
\n-
367 // instantiation in SFINAE context.
\n-
368 //
\n-
369 // this is placed directly in namespace Dune to avoid any weird surprises
\n-
370
\n-
371 template<typename... T>
\n-
372 using LookupReferenceElement = decltype(referenceElement(std::declval<T>()...));
\n-
373
\n-
374#endif // DOXYGEN
\n-
375
\n-
\n-
376 namespace Transitional {
\n-
377
\n-
378#ifndef DOXYGEN
\n-
379
\n-
380 // this abomination checks whether the template signature matches the special case
\n-
381 // ReferenceElement<number_type,Dune::Dim<int>> and otherwise defers the type lookup
\n-
382 // to a decltype on a call to referenceElement(std::declval<T>())
\n-
383
\n-
384 template<typename... T>
\n-
385 using ReferenceElement = Std::detected_or_t<
\n-
386 Std::detected_t<LookupReferenceElement,T...>,
\n-
387 Impl::DefaultReferenceElement,
\n-
388 T...
\n-
389 >;
\n-
390
\n-
391#else // DOXYGEN
\n-
392
\n+
\n+
312 LocalCoordinate local ( const GlobalCoordinate &globalCoord ) const
\n+
313 {
\n+
314 const ctype tolerance = Traits::tolerance();
\n+
315 LocalCoordinate x = refElement().position( 0, 0 );
\n+\n+
317 const bool affineMapping = this->affine();
\n+
318 do
\n+
319 {
\n+
320 // Newton's method: DF^n dx^n = F^n, x^{n+1} -= dx^n
\n+
321 const GlobalCoordinate dglobal = (*this).global( x ) - globalCoord;
\n+
322 const bool invertible =
\n+
323 MatrixHelper::template xTRightInvA< mydimension, coorddimension >( jacobianTransposed( x ), dglobal, dx );
\n+
324 if( ! invertible )
\n+
325 return LocalCoordinate( std::numeric_limits< ctype > :: max() );
\n+
326
\n+
327 // update x with correction
\n+
328 x -= dx;
\n+
329
\n+
330 // for affine mappings only one iteration is needed
\n+
331 if ( affineMapping ) break;
\n+
332 } while( dx.two_norm2() > tolerance );
\n+
333 return x;
\n+
334 }
\n+
\n+
335
\n+
\n+\n+
351 {
\n+
352 return MatrixHelper::template sqrtDetAAT< mydimension, coorddimension >( jacobianTransposed( local ) );
\n+
353 }
\n+
\n+
354
\n+
\n+
363 Volume volume () const
\n+
364 {
\n+
365 return integrationElement( refElement().position( 0, 0 ) ) * refElement().volume();
\n+
366 }
\n+
\n+
367
\n+
\n+\n+
378 {
\n+
379 using std::begin;
\n+
380
\n+\n+
382 auto cit = begin(std::cref(corners_).get());
\n+
383 jacobianTransposed< false >( topologyId(), std::integral_constant< int, mydimension >(), cit, ctype( 1 ), local, ctype( 1 ), jt );
\n+
384 return jt;
\n+
385 }
\n+
\n+
386
\n+
\n+
393 JacobianInverseTransposed jacobianInverseTransposed ( const LocalCoordinate &local ) const;
\n
394
\n-
416 template<typename... T>
\n-
417 using ReferenceElement = unspecified-type;
\n-
418
\n-
419#endif //DOXYGEN
\n-
420
\n-
421 }
\n+
\n+\n+
396 {
\n+
397 return geometry.refElement();
\n+
398 }
\n+
\n+
399
\n+
400
\n+
\n+\n+
408 {
\n+
409 return jacobianTransposed(local).transposed();
\n+
410 }
\n+
\n+
411
\n+
\n+\n+
419 {
\n+
420 return jacobianInverseTransposed(local).transposed();
\n+
421 }
\n
\n
422
\n-
423#ifndef DOXYGEN
\n+
423 protected:
\n
424
\n-
425 namespace Impl {
\n-
426
\n-
427 // helpers for triggering a deprecation warning for occurrences of the old
\n-
428 // ReferenceElement syntax (Dune::ReferenceElement<T,int>)
\n+
\n+\n+
426 {
\n+
427 return refElement_;
\n+
428 }
\n+
\n
429
\n-
430 // this looks a little weird, encoding the type in the return type of a nested function,
\n-
431 // but it was the only reliable way to trigger the warning iff the compiler encounters
\n-
432 // an invalid use. Other solutions either miss some (or all) uses or trigger false alarms.
\n-
433
\n-
434 template<typename T>
\n-
435 struct ValidReferenceElementTypeSignature
\n-
436 {
\n-
437 Transitional::ReferenceElement<T> check();
\n-
438 };
\n-
439
\n-
440 template<typename T>
\n-
441 struct DeprecatedReferenceElementTypeSignature
\n-
442 {
\n-
443 [[deprecated("Dune::ReferenceElement<T,int> is deprecated, please use Dune::ReferenceElement<Geometry> (if you have a geometry), Dune::ReferenceElements<T,int>::ReferenceElement or Dune::Transitional::ReferenceElement<T,Dune::Dim<int>> instead. After Dune 2.6, you will be able to use Dune::ReferenceElement<T,Dune::Dim<int>>.")]] T check();
\n-
444 };
\n-
445
\n-
446 } // namespace Impl
\n-
447
\n-
448 // This just makes sure the user doesn't use invalid syntax (by checking against the -1 default for
\n-
449 // the dimension, and then either hands back the old-style type along with a deprecation warning or
\n-
450 // forwards to the transitional version
\n-
451 template<typename T, int dim = -1>
\n-
452 using ReferenceElement = decltype(
\n-
453 std::declval<
\n-
454 typename std::conditional<
\n-
455 dim == -1,
\n-
456 Impl::ValidReferenceElementTypeSignature<T>,
\n-
457 Impl::DeprecatedReferenceElementTypeSignature<Geo::DeprecatedReferenceElement<T,dim>>
\n-
458 >::type
\n-
459 >().check());
\n-
460
\n-
461#else // DOXYGEN
\n-
462
\n-
464
\n-
496 template<typename T, int dim>
\n-
497 using ReferenceElement = unspecified-type;
\n-
498
\n-
499#endif // DOXYGEN
\n-
500
\n+
\n+\n+
431 {
\n+
432 return topologyId( std::integral_constant< bool, hasSingleGeometryType >() );
\n+
433 }
\n+
\n+
434
\n+
435 template< bool add, int dim, class CornerIterator >
\n+
\n+
436 static void global ( TopologyId topologyId, std::integral_constant< int, dim >,
\n+
437 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,
\n+
438 const ctype &rf, GlobalCoordinate &y );
\n+
439 template< bool add, class CornerIterator >
\n+
\n+
440 static void global ( TopologyId topologyId, std::integral_constant< int, 0 >,
\n+
441 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,
\n+
442 const ctype &rf, GlobalCoordinate &y );
\n+
443
\n+
444 template< bool add, int rows, int dim, class CornerIterator >
\n+
\n+
445 static void jacobianTransposed ( TopologyId topologyId, std::integral_constant< int, dim >,
\n+
446 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,
\n+
447 const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt );
\n+
448 template< bool add, int rows, class CornerIterator >
\n+
\n+
449 static void jacobianTransposed ( TopologyId topologyId, std::integral_constant< int, 0 >,
\n+
450 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,
\n+
451 const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt );
\n+
452
\n+
453 template< int dim, class CornerIterator >
\n+
\n+
454 static bool affine ( TopologyId topologyId, std::integral_constant< int, dim >, CornerIterator &cit, JacobianTransposed &jt );
\n+
455 template< class CornerIterator >
\n+
\n+
456 static bool affine ( TopologyId topologyId, std::integral_constant< int, 0 >, CornerIterator &cit, JacobianTransposed &jt );
\n+
457
\n+
\n+
458 bool affine ( JacobianTransposed &jacobianT ) const
\n+
459 {
\n+
460 using std::begin;
\n+
461
\n+
462 auto cit = begin(std::cref(corners_).get());
\n+
463 return affine( topologyId(), std::integral_constant< int, mydimension >(), cit, jacobianT );
\n+
464 }
\n+
\n+
465
\n+
466 private:
\n+
467 // The following methods are needed to convert the return type of topologyId to
\n+
468 // unsigned int with g++-4.4. It has problems casting integral_constant to the
\n+
469 // integral type.
\n+
470 static unsigned int toUnsignedInt(unsigned int i) { return i; }
\n+
471 template<unsigned int v>
\n+
472 static unsigned int toUnsignedInt(std::integral_constant<unsigned int,v> ) { return v; }
\n+
473 TopologyId topologyId ( std::integral_constant< bool, true > ) const { return TopologyId(); }
\n+
474 unsigned int topologyId ( std::integral_constant< bool, false > ) const { return refElement().type().id(); }
\n+
475
\n+
476 ReferenceElement refElement_;
\n+
477 typename Traits::template CornerStorage< mydimension, coorddimension >::Type corners_;
\n+
478 };
\n+
479
\n+
480
\n+
481
\n+
482 // MultiLinearGeometry::JacobianInverseTransposed
\n+
483 // ----------------------------------------------
\n+
484
\n+
485 template< class ct, int mydim, int cdim, class Traits >
\n+
\n+
486 class MultiLinearGeometry< ct, mydim, cdim, Traits >::JacobianInverseTransposed
\n+
487 : public FieldMatrix< ctype, coorddimension, mydimension >
\n+
488 {
\n+
489 typedef FieldMatrix< ctype, coorddimension, mydimension > Base;
\n+
490
\n+
491 public:
\n+
\n+
492 void setup ( const JacobianTransposed &jt )
\n+
493 {
\n+
494 detInv_ = MatrixHelper::template rightInvA< mydimension, coorddimension >( jt, static_cast< Base & >( *this ) );
\n+
495 }
\n+
\n+
496
\n+
\n+\n+
498 {
\n+
499 detInv_ = MatrixHelper::template sqrtDetAAT< mydimension, coorddimension >( jt );
\n+
500 }
\n+
\n
501
\n-
502
\n-
503} // namespace Dune
\n+
502 ctype det () const { return ctype( 1 ) / detInv_; }
\n+
503 ctype detInv () const { return detInv_; }
\n
504
\n-
505#endif // #ifndef DUNE_GEOMETRY_REFERENCEELEMENTS_HH
\n-\n+
505 private:
\n+
506 ctype detInv_;
\n+
507 };
\n+
\n+
508
\n+
509
\n+
510
\n+
523 template< class ct, int mydim, int cdim, class Traits = MultiLinearGeometryTraits< ct > >
\n+
\n+\n+
525 : public MultiLinearGeometry< ct, mydim, cdim, Traits >
\n+
526 {
\n+\n+\n+
529
\n+
530 protected:
\n+\n+
532
\n+
533 public:
\n+\n+
535
\n+
536 typedef typename Base::ctype ctype;
\n+
537
\n+
538 using Base::mydimension;
\n+\n+
540
\n+\n+\n+
543 typedef typename Base::Volume Volume;
\n+
544
\n+\n+\n+
547 typedef typename Base::Jacobian Jacobian;
\n+\n+
549
\n+
550 template< class CornerStorage >
\n+
\n+
551 CachedMultiLinearGeometry ( const ReferenceElement &referenceElement, const CornerStorage &cornerStorage )
\n+
552 : Base( referenceElement, cornerStorage ),
\n+
553 affine_( Base::affine( jacobianTransposed_ ) ),
\n+
554 jacobianInverseTransposedComputed_( false ),
\n+
555 integrationElementComputed_( false )
\n+
556 {}
\n+
\n+
557
\n+
558 template< class CornerStorage >
\n+
\n+
559 CachedMultiLinearGeometry ( Dune::GeometryType gt, const CornerStorage &cornerStorage )
\n+
560 : Base( gt, cornerStorage ),
\n+
561 affine_( Base::affine( jacobianTransposed_ ) ),
\n+
562 jacobianInverseTransposedComputed_( false ),
\n+
563 integrationElementComputed_( false )
\n+
564 {}
\n+
\n+
565
\n+
567 bool affine () const { return affine_; }
\n+
568
\n+
569 using Base::corner;
\n+
570
\n+
572 GlobalCoordinate center () const { return global( refElement().position( 0, 0 ) ); }
\n+
573
\n+
\n+\n+
581 {
\n+
582 if( affine() )
\n+
583 {
\n+\n+
585 jacobianTransposed_.umtv( local, global );
\n+
586 return global;
\n+
587 }
\n+
588 else
\n+
589 return Base::global( local );
\n+
590 }
\n+
\n+
591
\n+
\n+\n+
605 {
\n+
606 if( affine() )
\n+
607 {
\n+\n+
609 if( jacobianInverseTransposedComputed_ )
\n+
610 jacobianInverseTransposed_.mtv( global - corner( 0 ), local );
\n+
611 else
\n+
612 MatrixHelper::template xTRightInvA< mydimension, coorddimension >( jacobianTransposed_, global - corner( 0 ), local );
\n+
613 return local;
\n+
614 }
\n+
615 else
\n+
616 return Base::local( global );
\n+
617 }
\n+
\n+
618
\n+
\n+\n+
634 {
\n+
635 if( affine() )
\n+
636 {
\n+
637 if( !integrationElementComputed_ )
\n+
638 {
\n+
639 jacobianInverseTransposed_.setupDeterminant( jacobianTransposed_ );
\n+
640 integrationElementComputed_ = true;
\n+
641 }
\n+
642 return jacobianInverseTransposed_.detInv();
\n+
643 }
\n+
644 else
\n+\n+
646 }
\n+
\n+
647
\n+
\n+
649 Volume volume () const
\n+
650 {
\n+
651 if( affine() )
\n+
652 return integrationElement( refElement().position( 0, 0 ) ) * refElement().volume();
\n+
653 else
\n+
654 return Base::volume();
\n+
655 }
\n+
\n+
656
\n+
\n+\n+
667 {
\n+
668 if( affine() )
\n+
669 return jacobianTransposed_;
\n+
670 else
\n+\n+
672 }
\n+
\n+
673
\n+
\n+\n+
681 {
\n+
682 if( affine() )
\n+
683 {
\n+
684 if( !jacobianInverseTransposedComputed_ )
\n+
685 {
\n+
686 jacobianInverseTransposed_.setup( jacobianTransposed_ );
\n+
687 jacobianInverseTransposedComputed_ = true;
\n+
688 integrationElementComputed_ = true;
\n+
689 }
\n+
690 return jacobianInverseTransposed_;
\n+
691 }
\n+
692 else
\n+\n+
694 }
\n+
\n+
695
\n+
\n+\n+
703 {
\n+
704 return jacobianTransposed(local).transposed();
\n+
705 }
\n+
\n+
706
\n+
\n+\n+
714 {
\n+
715 return jacobianInverseTransposed(local).transposed();
\n+
716 }
\n+
\n+
717
\n+
718 protected:
\n+
719 using Base::refElement;
\n+
720
\n+
721 private:
\n+
722 mutable JacobianTransposed jacobianTransposed_;
\n+
723 mutable JacobianInverseTransposed jacobianInverseTransposed_;
\n+
724
\n+
725 mutable bool affine_ : 1;
\n+
726
\n+
727 mutable bool jacobianInverseTransposedComputed_ : 1;
\n+
728 mutable bool integrationElementComputed_ : 1;
\n+
729 };
\n+
\n+
730
\n+
731
\n+
732
\n+
733 // Implementation of MultiLinearGeometry
\n+
734 // -------------------------------------
\n+
735
\n+
736 template< class ct, int mydim, int cdim, class Traits >
\n+
737 inline typename MultiLinearGeometry< ct, mydim, cdim, Traits >::JacobianInverseTransposed
\n+
\n+\n+
739 {
\n+\n+
741 jit.setup( jacobianTransposed( local ) );
\n+
742 return jit;
\n+
743 }
\n+
\n+
744
\n+
745
\n+
746 template< class ct, int mydim, int cdim, class Traits >
\n+
747 template< bool add, int dim, class CornerIterator >
\n+\n+
\n+
749 ::global ( TopologyId topologyId, std::integral_constant< int, dim >,
\n+
750 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,
\n+
751 const ctype &rf, GlobalCoordinate &y )
\n+
752 {
\n+
753 const ctype xn = df*x[ dim-1 ];
\n+
754 const ctype cxn = ctype( 1 ) - xn;
\n+
755
\n+
756 if( Impl::isPrism( toUnsignedInt(topologyId), mydimension, mydimension-dim ) )
\n+
757 {
\n+
758 // apply (1-xn) times mapping for bottom
\n+
759 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit, df, x, rf*cxn, y );
\n+
760 // apply xn times mapping for top
\n+
761 global< true >( topologyId, std::integral_constant< int, dim-1 >(), cit, df, x, rf*xn, y );
\n+
762 }
\n+
763 else
\n+
764 {
\n+
765 assert( Impl::isPyramid( toUnsignedInt(topologyId), mydimension, mydimension-dim ) );
\n+
766 // apply (1-xn) times mapping for bottom (with argument x/(1-xn))
\n+
767 if( cxn > Traits::tolerance() || cxn < -Traits::tolerance() )
\n+
768 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit, df/cxn, x, rf*cxn, y );
\n+
769 else
\n+
770 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit, df, x, ctype( 0 ), y );
\n+
771 // apply xn times the tip
\n+
772 y.axpy( rf*xn, *cit );
\n+
773 ++cit;
\n+
774 }
\n+
775 }
\n+
\n+
776
\n+
777 template< class ct, int mydim, int cdim, class Traits >
\n+
778 template< bool add, class CornerIterator >
\n+\n+
\n+
780 ::global ( TopologyId, std::integral_constant< int, 0 >,
\n+
781 CornerIterator &cit, const ctype &, const LocalCoordinate &,
\n+
782 const ctype &rf, GlobalCoordinate &y )
\n+
783 {
\n+
784 const GlobalCoordinate &origin = *cit;
\n+
785 ++cit;
\n+
786 for( int i = 0; i < coorddimension; ++i )
\n+
787 y[ i ] = (add ? y[ i ] + rf*origin[ i ] : rf*origin[ i ]);
\n+
788 }
\n+
\n+
789
\n+
790
\n+
791 template< class ct, int mydim, int cdim, class Traits >
\n+
792 template< bool add, int rows, int dim, class CornerIterator >
\n+\n+
\n+
794 ::jacobianTransposed ( TopologyId topologyId, std::integral_constant< int, dim >,
\n+
795 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,
\n+
796 const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt )
\n+
797 {
\n+
798 assert( rows >= dim );
\n+
799
\n+
800 const ctype xn = df*x[ dim-1 ];
\n+
801 const ctype cxn = ctype( 1 ) - xn;
\n+
802
\n+
803 auto cit2( cit );
\n+
804 if( Impl::isPrism( toUnsignedInt(topologyId), mydimension, mydimension-dim ) )
\n+
805 {
\n+
806 // apply (1-xn) times Jacobian for bottom
\n+
807 jacobianTransposed< add >( topologyId, std::integral_constant< int, dim-1 >(), cit2, df, x, rf*cxn, jt );
\n+
808 // apply xn times Jacobian for top
\n+
809 jacobianTransposed< true >( topologyId, std::integral_constant< int, dim-1 >(), cit2, df, x, rf*xn, jt );
\n+
810 // compute last row as difference between top value and bottom value
\n+
811 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit, df, x, -rf, jt[ dim-1 ] );
\n+
812 global< true >( topologyId, std::integral_constant< int, dim-1 >(), cit, df, x, rf, jt[ dim-1 ] );
\n+
813 }
\n+
814 else
\n+
815 {
\n+
816 assert( Impl::isPyramid( toUnsignedInt(topologyId), mydimension, mydimension-dim ) );
\n+
817 /*
\n+
818 * In the pyramid case, we need a transformation Tb: B -> R^n for the
\n+
819 * base B \\subset R^{n-1}. The pyramid transformation is then defined as
\n+
820 * T: P \\subset R^n -> R^n
\n+
821 * (x, xn) |-> (1-xn) Tb(x*) + xn t (x \\in R^{n-1}, xn \\in R)
\n+
822 * with the tip of the pyramid mapped to t and x* = x/(1-xn)
\n+
823 * the projection of (x,xn) onto the base.
\n+
824 *
\n+
825 * For the Jacobi matrix DT we get
\n+
826 * DT = ( A | b )
\n+
827 * with A = DTb(x*) (n x n-1 matrix)
\n+
828 * and b = dT/dxn (n-dim column vector).
\n+
829 * Furthermore
\n+
830 * b = -Tb(x*) + t + \\sum_i dTb/dx_i(x^*) x_i/(1-xn)
\n+
831 *
\n+
832 * Note that both A and b are not defined in the pyramid tip (x=0, xn=1)!
\n+
833 * Indeed for B the unit square, Tb mapping B to the quadrilateral given
\n+
834 * by the vertices (0,0,0), (2,0,0), (0,1,0), (1,1,0) and t=(0,0,1), we get
\n+
835 *
\n+
836 * T(x,y,xn) = ( x(2-y/(1-xn)), y, xn )
\n+
837 * / 2-y/(1-xn) -x 0 \\
\n+
838 * DT(x,y,xn) = | 0 1 0 |
\n+
839 * \\ 0 0 1 /
\n+
840 * which is not continuous for xn -> 1, choose for example
\n+
841 * x=0, y=1-xn, xn -> 1 --> DT -> diag(1,1,1)
\n+
842 * x=1-xn, y=0, xn -> 1 --> DT -> diag(2,1,1)
\n+
843 *
\n+
844 * However, for Tb affine-linear, Tb(y) = My + y0, DTb = M:
\n+
845 * A = M
\n+
846 * b = -M x* - y0 + t + \\sum_i M_i x_i/(1-xn)
\n+
847 * = -M x* - y0 + t + M x*
\n+
848 * = -y0 + t
\n+
849 * which is continuous for xn -> 1. Note that this b is also given by
\n+
850 * b = -Tb(0) + t + \\sum_i dTb/dx_i(0) x_i/1
\n+
851 * that is replacing x* by 1 and 1-xn by 1 in the formular above.
\n+
852 *
\n+
853 * For xn -> 1, we can thus set x*=0, "1-xn"=1 (or anything != 0) and get
\n+
854 * the right result in case Tb is affine-linear.
\n+
855 */
\n+
856
\n+
857 /* The second case effectively results in x* = 0 */
\n+
858 ctype dfcxn = (cxn > Traits::tolerance() || cxn < -Traits::tolerance()) ? ctype(df / cxn) : ctype(0);
\n+
859
\n+
860 // initialize last row
\n+
861 // b = -Tb(x*)
\n+
862 // (b = -Tb(0) = -y0 in case xn -> 1 and Tb affine-linear)
\n+
863 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit, dfcxn, x, -rf, jt[ dim-1 ] );
\n+
864 // b += t
\n+
865 jt[ dim-1 ].axpy( rf, *cit );
\n+
866 ++cit;
\n+
867 // apply Jacobian for bottom (with argument x/(1-xn)) and correct last row
\n+
868 if( add )
\n+
869 {
\n+
870 FieldMatrix< ctype, dim-1, coorddimension > jt2;
\n+
871 // jt2 = dTb/dx_i(x*)
\n+
872 jacobianTransposed< false >( topologyId, std::integral_constant< int, dim-1 >(), cit2, dfcxn, x, rf, jt2 );
\n+
873 // A = dTb/dx_i(x*) (jt[j], j=0..dim-1)
\n+
874 // b += \\sum_i dTb/dx_i(x*) x_i/(1-xn) (jt[dim-1])
\n+
875 // (b += 0 in case xn -> 1)
\n+
876 for( int j = 0; j < dim-1; ++j )
\n+
877 {
\n+
878 jt[ j ] += jt2[ j ];
\n+
879 jt[ dim-1 ].axpy( dfcxn*x[ j ], jt2[ j ] );
\n+
880 }
\n+
881 }
\n+
882 else
\n+
883 {
\n+
884 // jt = dTb/dx_i(x*)
\n+
885 jacobianTransposed< false >( topologyId, std::integral_constant< int, dim-1 >(), cit2, dfcxn, x, rf, jt );
\n+
886 // b += \\sum_i dTb/dx_i(x*) x_i/(1-xn)
\n+
887 for( int j = 0; j < dim-1; ++j )
\n+
888 jt[ dim-1 ].axpy( dfcxn*x[ j ], jt[ j ] );
\n+
889 }
\n+
890 }
\n+
891 }
\n+
\n+
892
\n+
893 template< class ct, int mydim, int cdim, class Traits >
\n+
894 template< bool add, int rows, class CornerIterator >
\n+\n+
\n+
896 ::jacobianTransposed ( TopologyId, std::integral_constant< int, 0 >,
\n+
897 CornerIterator &cit, const ctype &, const LocalCoordinate &,
\n+
898 const ctype &, FieldMatrix< ctype, rows, cdim > & )
\n+
899 {
\n+
900 ++cit;
\n+
901 }
\n+
\n+
902
\n+
903
\n+
904
\n+
905 template< class ct, int mydim, int cdim, class Traits >
\n+
906 template< int dim, class CornerIterator >
\n+\n+
\n+
908 ::affine ( TopologyId topologyId, std::integral_constant< int, dim >, CornerIterator &cit, JacobianTransposed &jt )
\n+
909 {
\n+
910 const GlobalCoordinate &orgBottom = *cit;
\n+
911 if( !affine( topologyId, std::integral_constant< int, dim-1 >(), cit, jt ) )
\n+
912 return false;
\n+
913 const GlobalCoordinate &orgTop = *cit;
\n+
914
\n+
915 if( Impl::isPrism( toUnsignedInt(topologyId), mydimension, mydimension-dim ) )
\n+
916 {
\n+
917 JacobianTransposed jtTop;
\n+
918 if( !affine( topologyId, std::integral_constant< int, dim-1 >(), cit, jtTop ) )
\n+
919 return false;
\n+
920
\n+
921 // check whether both jacobians are identical
\n+
922 ctype norm( 0 );
\n+
923 for( int i = 0; i < dim-1; ++i )
\n+
924 norm += (jtTop[ i ] - jt[ i ]).two_norm2();
\n+
925 if( norm >= Traits::tolerance() )
\n+
926 return false;
\n+
927 }
\n+
928 else
\n+
929 ++cit;
\n+
930 jt[ dim-1 ] = orgTop - orgBottom;
\n+
931 return true;
\n+
932 }
\n+
\n+
933
\n+
934 template< class ct, int mydim, int cdim, class Traits >
\n+
935 template< class CornerIterator >
\n+\n+
\n+
937 ::affine ( TopologyId, std::integral_constant< int, 0 >, CornerIterator &cit, JacobianTransposed & )
\n+
938 {
\n+
939 ++cit;
\n+
940 return true;
\n+
941 }
\n+
\n+
\n+
942
\n+
943} // namespace Dune
\n+
944
\n+
945#endif // #ifndef DUNE_GEOMETRY_MULTILINEARGEOMETRY_HH
\n+
\n+
\n+
\n+
\n+
\n+
\n+
\n+
An implementation of the Geometry interface for affine geometries.
\n
A unique label for each type of element that can occur in a grid.
\n-\n-\n-
unspecified value type referenceElement(T &&... t)
Returns a reference element for the objects t....
\n-
unspecified-type ReferenceElement
Returns the type of reference element for the argument type T.
Definition referenceelements.hh:497
\n+\n
Definition affinegeometry.hh:21
\n-
This class provides access to geometric and topological properties of a reference element.
Definition referenceelement.hh:52
\n
Class providing access to the singletons of the reference elements.
Definition referenceelements.hh:170
\n-
static Iterator begin()
Definition referenceelements.hh:215
\n-
Iterator iterator
Iterator over available reference elements.
Definition referenceelements.hh:194
\n
typename Container::ReferenceElement ReferenceElement
The reference element type.
Definition referenceelements.hh:188
\n-
static const ReferenceElement & cube()
get hypercube reference elements
Definition referenceelements.hh:210
\n-
static Iterator end()
Definition referenceelements.hh:220
\n-
ctype_ ctype
The coordinate field type of the contained reference elements.
Definition referenceelements.hh:173
\n-
static const ReferenceElement & general(const GeometryType &type)
get general reference elements
Definition referenceelements.hh:198
\n-
static const ReferenceElement & simplex()
get simplex reference elements
Definition referenceelements.hh:204
\n-
typename Container::const_iterator Iterator
Iterator over available reference elements.
Definition referenceelements.hh:191
\n-
static constexpr int dimension
The dimension of the contained reference elements.
Definition referenceelements.hh:179
\n-
ctype CoordinateField
The coordinate field type of the contained reference elements.
Definition referenceelements.hh:176
\n-
Static tag representing a dimension.
Definition dimension.hh:16
\n+
default traits class for MultiLinearGeometry
Definition multilineargeometry.hh:39
\n+
Impl::FieldMatrixHelper< ct > MatrixHelper
helper structure containing some matrix routines
Definition multilineargeometry.hh:58
\n+
static ct tolerance()
tolerance to numerical algorithms
Definition multilineargeometry.hh:61
\n+
template specifying the storage for the corners
Definition multilineargeometry.hh:129
\n+
std::vector< FieldVector< ct, cdim > > Type
Definition multilineargeometry.hh:130
\n+
will there be only one geometry type for a dimension?
Definition multilineargeometry.hh:148
\n+
static const unsigned int topologyId
Definition multilineargeometry.hh:150
\n+
static const bool v
Definition multilineargeometry.hh:149
\n+
generic geometry implementation based on corner coordinates
Definition multilineargeometry.hh:181
\n+
static void global(TopologyId topologyId, std::integral_constant< int, dim >, CornerIterator &cit, const ctype &df, const LocalCoordinate &x, const ctype &rf, GlobalCoordinate &y)
Definition multilineargeometry.hh:749
\n+
static const int mydimension
geometry dimension
Definition multilineargeometry.hh:189
\n+
Dune::GeometryType type() const
obtain the name of the reference element
Definition multilineargeometry.hh:269
\n+
Traits::MatrixHelper MatrixHelper
Definition multilineargeometry.hh:225
\n+
FieldVector< ctype, coorddimension > GlobalCoordinate
type of global coordinates
Definition multilineargeometry.hh:196
\n+
static void jacobianTransposed(TopologyId topologyId, std::integral_constant< int, 0 >, CornerIterator &cit, const ctype &df, const LocalCoordinate &x, const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt)
Definition multilineargeometry.hh:896
\n+
JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const
obtain the transposed of the Jacobian
Definition multilineargeometry.hh:377
\n+
ReferenceElement refElement() const
Definition multilineargeometry.hh:425
\n+
GlobalCoordinate global(const LocalCoordinate &local) const
evaluate the mapping
Definition multilineargeometry.hh:290
\n+
GlobalCoordinate center() const
obtain the centroid of the mapping's image
Definition multilineargeometry.hh:282
\n+
GlobalCoordinate corner(int i) const
obtain coordinates of the i-th corner
Definition multilineargeometry.hh:275
\n+
Dune::ReferenceElements< ctype, mydimension > ReferenceElements
Definition multilineargeometry.hh:214
\n+
ct ctype
coordinate type
Definition multilineargeometry.hh:186
\n+
static void jacobianTransposed(TopologyId topologyId, std::integral_constant< int, dim >, CornerIterator &cit, const ctype &df, const LocalCoordinate &x, const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt)
Definition multilineargeometry.hh:794
\n+
static const int coorddimension
coordinate dimension
Definition multilineargeometry.hh:191
\n+
int corners() const
obtain number of corners of the corresponding reference element
Definition multilineargeometry.hh:272
\n+
TopologyId topologyId() const
Definition multilineargeometry.hh:430
\n+
friend ReferenceElement referenceElement(const MultiLinearGeometry &geometry)
Definition multilineargeometry.hh:395
\n+
LocalCoordinate local(const GlobalCoordinate &globalCoord) const
evaluate the inverse mapping
Definition multilineargeometry.hh:312
\n+
static void global(TopologyId topologyId, std::integral_constant< int, 0 >, CornerIterator &cit, const ctype &df, const LocalCoordinate &x, const ctype &rf, GlobalCoordinate &y)
Definition multilineargeometry.hh:780
\n+
Volume volume() const
obtain the volume of the mapping's image
Definition multilineargeometry.hh:363
\n+
FieldVector< ctype, mydimension > LocalCoordinate
type of local coordinates
Definition multilineargeometry.hh:194
\n+
MultiLinearGeometry(const ReferenceElement &refElement, const Corners &corners)
constructor
Definition multilineargeometry.hh:239
\n+
static bool affine(TopologyId topologyId, std::integral_constant< int, 0 >, CornerIterator &cit, JacobianTransposed &jt)
Definition multilineargeometry.hh:937
\n+
std::conditional< hasSingleGeometryType, std::integral_constant< unsignedint, Traits::templatehasSingleGeometryType< mydimension >::topologyId >, unsignedint >::type TopologyId
Definition multilineargeometry.hh:226
\n+
ctype Volume
type of volume
Definition multilineargeometry.hh:198
\n+
static bool affine(TopologyId topologyId, std::integral_constant< int, dim >, CornerIterator &cit, JacobianTransposed &jt)
Definition multilineargeometry.hh:908
\n+
JacobianInverse jacobianInverse(const LocalCoordinate &local) const
Obtain the Jacobian's inverse.
Definition multilineargeometry.hh:418
\n+
MultiLinearGeometry(Dune::GeometryType gt, const Corners &corners)
constructor
Definition multilineargeometry.hh:255
\n+
FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed
type of jacobian transposed
Definition multilineargeometry.hh:201
\n+
ReferenceElements::ReferenceElement ReferenceElement
type of reference element
Definition multilineargeometry.hh:219
\n+
JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate &local) const
obtain the transposed of the Jacobian's inverse
Definition multilineargeometry.hh:738
\n+
FieldMatrix< ctype, coorddimension, mydimension > Jacobian
Type for the Jacobian matrix.
Definition multilineargeometry.hh:207
\n+
bool affine() const
is this mapping affine?
Definition multilineargeometry.hh:262
\n+
FieldMatrix< ctype, mydimension, coorddimension > JacobianInverse
Type for the inverse Jacobian matrix.
Definition multilineargeometry.hh:210
\n+
bool affine(JacobianTransposed &jacobianT) const
Definition multilineargeometry.hh:458
\n+
Volume integrationElement(const LocalCoordinate &local) const
obtain the integration element
Definition multilineargeometry.hh:350
\n+
Jacobian jacobian(const LocalCoordinate &local) const
Obtain the Jacobian.
Definition multilineargeometry.hh:407
\n+
Definition multilineargeometry.hh:488
\n+
void setup(const JacobianTransposed &jt)
Definition multilineargeometry.hh:492
\n+
ctype det() const
Definition multilineargeometry.hh:502
\n+
ctype detInv() const
Definition multilineargeometry.hh:503
\n+
void setupDeterminant(const JacobianTransposed &jt)
Definition multilineargeometry.hh:497
\n+
Implement a MultiLinearGeometry with additional caching.
Definition multilineargeometry.hh:526
\n+
GlobalCoordinate global(const LocalCoordinate &local) const
evaluate the mapping
Definition multilineargeometry.hh:580
\n+
Base::ReferenceElement ReferenceElement
Definition multilineargeometry.hh:534
\n+
bool affine() const
is this mapping affine?
Definition multilineargeometry.hh:567
\n+
CachedMultiLinearGeometry(const ReferenceElement &referenceElement, const CornerStorage &cornerStorage)
Definition multilineargeometry.hh:551
\n+
ReferenceElement refElement() const
Definition multilineargeometry.hh:425
\n+
LocalCoordinate local(const GlobalCoordinate &global) const
evaluate the inverse mapping
Definition multilineargeometry.hh:604
\n+
Base::MatrixHelper MatrixHelper
Definition multilineargeometry.hh:531
\n+
Base::LocalCoordinate LocalCoordinate
Definition multilineargeometry.hh:541
\n+
JacobianInverse jacobianInverse(const LocalCoordinate &local) const
Obtain the Jacobian's inverse.
Definition multilineargeometry.hh:713
\n+
JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const
obtain the transposed of the Jacobian
Definition multilineargeometry.hh:666
\n+
GlobalCoordinate corner(int i) const
obtain coordinates of the i-th corner
Definition multilineargeometry.hh:275
\n+
Volume volume() const
obtain the volume of the mapping's image
Definition multilineargeometry.hh:649
\n+
CachedMultiLinearGeometry(Dune::GeometryType gt, const CornerStorage &cornerStorage)
Definition multilineargeometry.hh:559
\n+
ctype integrationElement(const LocalCoordinate &local) const
obtain the integration element
Definition multilineargeometry.hh:633
\n+
Base::ctype ctype
Definition multilineargeometry.hh:536
\n+
Jacobian jacobian(const LocalCoordinate &local) const
Obtain the Jacobian.
Definition multilineargeometry.hh:702
\n+
Base::JacobianInverseTransposed JacobianInverseTransposed
Definition multilineargeometry.hh:546
\n+
Base::JacobianTransposed JacobianTransposed
Definition multilineargeometry.hh:545
\n+
Base::JacobianInverse JacobianInverse
Definition multilineargeometry.hh:548
\n+
Base::Jacobian Jacobian
Definition multilineargeometry.hh:547
\n+
Base::Volume Volume
Definition multilineargeometry.hh:543
\n+
Base::GlobalCoordinate GlobalCoordinate
Definition multilineargeometry.hh:542
\n+
GlobalCoordinate center() const
obtain the centroid of the mapping's image
Definition multilineargeometry.hh:572
\n+
JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate &local) const
obtain the transposed of the Jacobian's inverse
Definition multilineargeometry.hh:680
\n
Unique label for each type of entities that can occur in DUNE grids.
Definition type.hh:126
\n-
constexpr unsigned int id() const
Return the topology id of the type.
Definition type.hh:377
\n
\n \n
\n Generated by \"doxygen\"/ 1.9.8\n
\n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,480 +7,1024 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n-referenceelements.hh\n+multilineargeometry.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file\n LICENSE.md in module root\n 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n- 5#ifndef DUNE_GEOMETRY_REFERENCEELEMENTS_HH\n- 6#define DUNE_GEOMETRY_REFERENCEELEMENTS_HH\n+ 5#ifndef DUNE_GEOMETRY_MULTILINEARGEOMETRY_HH\n+ 6#define DUNE_GEOMETRY_MULTILINEARGEOMETRY_HH\n 7\n 8#include \n- 9\n- 10#include \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\n- 21#include \n- 22#include \n- 23#include \n- 24#include \n- 25\n- 26namespace Dune\n- 27{\n- 28\n- 29 namespace Geo\n- 30 {\n- 31\n- 32#ifndef DOXYGEN\n- 33\n- 34\n- 35 template\n- 36 class DeprecatedReferenceElement\n- 37 : public ReferenceElement>\n- 38 {\n- 39\n- 40 protected:\n- 41\n- 42 DeprecatedReferenceElement() = default;\n- 43\n- 44 public:\n- 45\n- 46 DeprecatedReferenceElement(const DeprecatedReferenceElement&) = delete;\n- 47 DeprecatedReferenceElement& operator=(const DeprecatedReferenceElement&) =\n-delete;\n- 48\n- 49 DeprecatedReferenceElement(const ReferenceElementImplementation&\n-impl)\n- 50 : ReferenceElement>(impl)\n- 51 {}\n- 52\n- 53 };\n- 54\n- 55\n- 56 template\n- 57 class ConstructibleDeprecatedReferenceElement\n- 58 : public DeprecatedReferenceElement\n- 59 {\n- 60 public:\n- 61 ConstructibleDeprecatedReferenceElement() = default;\n- 62 };\n- 63\n- 64\n- 65 namespace Impl\n- 66 {\n- 67\n- 68 // ReferenceElementContainer\n- 69 // -------------------------\n- 70\n- 71 template< class ctype, int dim >\n- 72 class ReferenceElementContainer\n- 73 {\n- 74 static const unsigned int numTopologies = dim >= 0 ? (1u << dim) : 0;\n- 75\n- 76 using Implementation = ReferenceElementImplementation< ctype, dim >;\n- 77 using ConstructibleDeprecatedReferenceElement = Dune::Geo::\n-ConstructibleDeprecatedReferenceElement;\n- 78\n- 79 public:\n- 80\n- 81 using DeprecatedReferenceElement = Dune::Geo::\n-DeprecatedReferenceElement;\n- 82\n- 83 using ReferenceElement = Dune::Geo::ReferenceElement<_Implementation_>;\n- 84 using value_type = ReferenceElement;\n- 85 using const_iterator = const value_type*;\n- 86\n- 87 ReferenceElementContainer ()\n- 88 {\n- 89 for( unsigned int topologyId = 0; topologyId < numTopologies; ++topologyId\n-)\n- 90 {\n- 91 implementations_[ topologyId ].initialize( topologyId );\n- 92 reference_elements_[ topologyId ].setImplementation( implementations_\n-[ topologyId ] );\n- 93 }\n- 94 }\n- 95\n- 96 const ReferenceElement& operator() ( const GeometryType &type ) const\n- 97 {\n- 98 assert( type.dim() == dim );\n- 99 return reference_elements_[ type.id() ];\n- 100 }\n- 101\n- 102 const ReferenceElement& simplex () const\n- 103 {\n- 104 return reference_elements_[ Dune::GeometryTypes::simplex(dim).id() ];\n- 105 }\n- 106\n- 107 const ReferenceElement& cube () const\n- 108 {\n- 109 return reference_elements_[ Dune::GeometryTypes::cube(dim).id() ];\n- 110 }\n- 111\n- 112 const ReferenceElement& pyramid () const\n- 113 {\n- 114 return reference_elements_[ Dune::GeometryTypes::pyramid.id() ];\n- 115 }\n- 116\n- 117 const ReferenceElement& prism () const\n- 118 {\n- 119 return reference_elements_[ Dune::GeometryTypes::prism.id() ];\n- 120 }\n- 121\n- 122 const_iterator begin () const\n- 123 {\n- 124 return reference_elements_.data();\n- 125 }\n- 126\n- 127 const_iterator end () const\n- 128 {\n- 129 return reference_elements_.data() + numTopologies;\n- 130 }\n- 131\n- 132 // here, we make sure to actually return a const reference to something\n- 133 // that is guaranteed not to become invalid, as otherwise, we might run\n- 134 // straight into debugging hell when a user binds the return value to a\n- 135 // const ref and the temporary goes out of scope.\n- 136 const DeprecatedReferenceElement& deprecated(const ReferenceElement& v)\n-const\n- 137 {\n- 138 return reference_elements_[v.impl().type(0,0).id()];\n- 139 }\n- 140\n- 141 private:\n- 142\n- 143 std::array implementations_;\n- 144 std::array\n-reference_elements_;\n- 145\n- 146 };\n- 147\n- 148\n- 149 } // namespace Impl\n- 150\n- 151\n- 152#endif // DOXYGEN\n+ 12#include \n+ 13\n+ 14#include \n+ 15#include \n+ 16#include \n+ 17\n+ 18#include \n+ 19#include \n+ 20#include \n+ 21\n+ 22namespace Dune\n+ 23{\n+ 24\n+ 25 // MultiLinearGeometryTraits\n+ 26 // -------------------------\n+ 27\n+ 37 template< class ct >\n+38 struct MultiLinearGeometryTraits\n+ 39 {\n+58 typedef Impl::FieldMatrixHelper< ct > MatrixHelper;\n+ 59\n+61 static ct tolerance () { return ct( 16 ) * std::numeric_limits< ct >::\n+epsilon(); }\n+ 62\n+ 127 template< int mydim, int cdim >\n+128 struct CornerStorage\n+ 129 {\n+130 typedef std::vector< FieldVector< ct, cdim > > Type;\n+ 131 };\n+ 132\n+ 146 template< int dim >\n+147 struct hasSingleGeometryType\n+ 148 {\n+149 static const bool v = false;\n+150 static const unsigned int topologyId = ~0u;\n+ 151 };\n+ 152 };\n 153\n 154\n- 155 // ReferenceElements\n- 156 // ------------------------\n- 157\n- 168 template< class ctype_, int dim >\n-169 struct ReferenceElements\n- 170 {\n- 171\n-173 using ctype = ctype_;\n- 174\n-176 using CoordinateField = ctype;\n- 177\n-179 static constexpr int dimension = dim;\n- 180\n- 181 private:\n- 182\n- 183 using Container = Impl::ReferenceElementContainer< ctype, dim >;\n- 184\n- 185 public:\n- 186\n-188 using ReferenceElement = typename Container::ReferenceElement;\n- 189\n-191 using Iterator = typename Container::const_iterator;\n+ 155\n+ 156 // MultiLinearGeometry\n+ 157 // -------------------\n+ 158\n+ 179 template< class ct, int mydim, int cdim, class Traits =\n+MultiLinearGeometryTraits< ct > >\n+180 class MultiLinearGeometry\n+ 181 {\n+ 182 typedef MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_> This;\n+ 183\n+ 184 public:\n+186 typedef ct ctype;\n+ 187\n+189 static const int mydimension= mydim;\n+191 static const int coorddimension = cdim;\n 192\n-194 using iterator = Iterator;\n- 195\n- 197 static const ReferenceElement&\n-198 general ( const GeometryType& type )\n- 199 {\n- 200 return container() ( type );\n- 201 }\n+194 typedef FieldVector< ctype, mydimension > LocalCoordinate;\n+196 typedef FieldVector< ctype, coorddimension > GlobalCoordinate;\n+198 typedef ctype Volume;\n+ 199\n+201 typedef FieldMatrix< ctype, mydimension, coorddimension >\n+JacobianTransposed;\n 202\n-204 static const ReferenceElement& simplex ()\n- 205 {\n- 206 return container().simplex();\n- 207 }\n+ 204 class JacobianInverseTransposed;\n+ 205\n+207 typedef FieldMatrix< ctype, coorddimension, mydimension > Jacobian;\n 208\n-210 static const ReferenceElement& cube ()\n- 211 {\n- 212 return container().cube();\n- 213 }\n- 214\n-215 static Iterator begin ()\n- 216 {\n- 217 return container().begin();\n- 218 }\n- 219\n-220 static Iterator end ()\n- 221 {\n- 222 return container().end();\n- 223 }\n- 224\n- 225#ifndef DOXYGEN\n- 226 static const typename Container::DeprecatedReferenceElement&\n- 227 deprecated(const ReferenceElement& v)\n- 228 {\n- 229 return container().deprecated(v);\n- 230 }\n- 231#endif // DOXYGEN\n- 232\n- 233 private:\n- 234\n- 235 DUNE_EXPORT static const Container& container ()\n- 236 {\n- 237 static Container container;\n- 238 return container;\n- 239 }\n- 240 };\n- 241\n- 242 } // namespace Geo\n- 243\n- 245 using Geo::ReferenceElements;\n- 246\n- 247\n- 248#ifdef DOXYGEN\n- 249\n- 251\n- 294 template\n-295 unspecified-value-type referenceElement(T&&... t);\n- 296\n- 297#endif\n- 298\n+210 typedef FieldMatrix< ctype, mydimension, coorddimension > JacobianInverse;\n+ 211\n+ 212 protected:\n+ 213\n+214 typedef Dune::ReferenceElements<_ctype,_mydimension_> ReferenceElements;\n+ 215\n+ 216 public:\n+ 217\n+219 typedef typename ReferenceElements::ReferenceElement ReferenceElement;\n+ 220\n+ 221 private:\n+ 222 static const bool hasSingleGeometryType = Traits::template\n+hasSingleGeometryType< mydimension >::v;\n+ 223\n+ 224 protected:\n+225 typedef typename Traits::MatrixHelper MatrixHelper;\n+226 typedef typename std::conditional< hasSingleGeometryType, std::\n+integral_constant< unsigned int, Traits::template hasSingleGeometryType<\n+mydimension >::topologyId >, unsigned int >::type TopologyId;\n+ 227\n+ 228 public:\n+ 238 template< class Corners >\n+239 MultiLinearGeometry ( const ReferenceElement &refElement,\n+ 240 const Corners &corners )\n+ 241 : refElement_( refElement ),\n+ 242 corners_( corners )\n+ 243 {}\n+ 244\n+ 254 template< class Corners >\n+255 MultiLinearGeometry ( Dune::GeometryType gt,\n+ 256 const Corners &corners )\n+ 257 : refElement_( ReferenceElements::general( gt ) ),\n+ 258 corners_( corners )\n+ 259 {}\n+ 260\n+262 bool affine () const\n+ 263 {\n+ 264 JacobianTransposed jt;\n+ 265 return affine( jt );\n+ 266 }\n+ 267\n+269 Dune::GeometryType type () const { return GeometryType( toUnsignedInt\n+(topologyId()), mydimension ); }\n+ 270\n+272 int corners () const { return refElement().size( mydimension ); }\n+ 273\n+275 GlobalCoordinate corner ( int i ) const\n+ 276 {\n+ 277 assert( (i >= 0) && (i < corners()) );\n+ 278 return std::cref(corners_).get()[ i ];\n+ 279 }\n+ 280\n+282 GlobalCoordinate center () const { return global( refElement().position( 0,\n+0 ) ); }\n+ 283\n+290 GlobalCoordinate global ( const LocalCoordinate &local ) const\n+ 291 {\n+ 292 using std::begin;\n+ 293\n+ 294 auto cit = begin(std::cref(corners_).get());\n+ 295 GlobalCoordinate y;\n+ 296 global< false >( topologyId(), std::integral_constant< int, mydimension >\n+(), cit, ctype( 1 ), local, ctype( 1 ), y );\n+ 297 return y;\n+ 298 }\n 299\n- 301\n- 314 template\n-315 auto referenceElement(const Dune::GeometryType& gt, Dune::Dim = {})\n- 316 {\n- 317 return ReferenceElements::general(gt);\n- 318 }\n- 319\n- 320\n- 322\n- 334 template>::\n-value, int> = 0>\n-335 auto referenceElement(const T&, const Dune::GeometryType& gt, Dune::\n-Dim)\n- 336 {\n- 337 return ReferenceElements::general(gt);\n- 338 }\n- 339\n- 340\n- 341#ifndef DOXYGEN\n- 342\n- 343 // helpers for the ReferenceElement<> meta function\n- 344\n- 345 namespace Impl {\n- 346\n- 347 // Evaluates to the correct reference element iff matches the\n-pattern >\n- 348 // otherwise, it's ill-formed. Should be used with detected_or and\n-friends.\n- 349\n- 350 template\n- 351 struct DefaultReferenceElementExtractor;\n- 352\n- 353 template::value,int>::type\n-dim>\n- 354 struct DefaultReferenceElementExtractor>\n- 355 {\n- 356 using type = typename Dune::Geo::ReferenceElements::\n-ReferenceElement;\n- 357 };\n- 358\n- 359 template\n- 360 using DefaultReferenceElement = typename\n-DefaultReferenceElementExtractor::type;\n- 361\n- 362 }\n- 363\n- 364 // looks up the type of a reference element by trying to instantiate the\n-correct overload\n- 365 // of referenceElement() for the given arguments. This will fail if there\n-is no valid\n- 366 // overload and should be used with detected_or or some other utility that\n-places the\n- 367 // instantiation in SFINAE context.\n- 368 //\n- 369 // this is placed directly in namespace Dune to avoid any weird surprises\n- 370\n- 371 template\n- 372 using LookupReferenceElement = decltype(referenceElement(std::declval\n-()...));\n- 373\n- 374#endif // DOXYGEN\n- 375\n-376 namespace Transitional {\n- 377\n- 378#ifndef DOXYGEN\n- 379\n- 380 // this abomination checks whether the template signature matches the\n-special case\n- 381 // ReferenceElement> and otherwise defers the\n-type lookup\n- 382 // to a decltype on a call to referenceElement(std::declval())\n- 383\n- 384 template\n- 385 using ReferenceElement = Std::detected_or_t<\n- 386 Std::detected_t,\n- 387 Impl::DefaultReferenceElement,\n- 388 T...\n- 389 >;\n- 390\n- 391#else // DOXYGEN\n- 392\n+312 LocalCoordinate local ( const GlobalCoordinate &globalCoord ) const\n+ 313 {\n+ 314 const ctype tolerance = Traits::tolerance();\n+ 315 LocalCoordinate x = refElement().position( 0, 0 );\n+ 316 LocalCoordinate dx;\n+ 317 const bool affineMapping = this->affine();\n+ 318 do\n+ 319 {\n+ 320 // Newton's method: DF^n dx^n = F^n, x^{n+1} -= dx^n\n+ 321 const GlobalCoordinate dglobal = (*this).global( x ) - globalCoord;\n+ 322 const bool invertible =\n+ 323 MatrixHelper::template xTRightInvA< mydimension, coorddimension >\n+( jacobianTransposed( x ), dglobal, dx );\n+ 324 if( ! invertible )\n+ 325 return LocalCoordinate( std::numeric_limits< ctype > :: max() );\n+ 326\n+ 327 // update x with correction\n+ 328 x -= dx;\n+ 329\n+ 330 // for affine mappings only one iteration is needed\n+ 331 if ( affineMapping ) break;\n+ 332 } while( dx.two_norm2() > tolerance );\n+ 333 return x;\n+ 334 }\n+ 335\n+350 Volume integrationElement ( const LocalCoordinate &local ) const\n+ 351 {\n+ 352 return MatrixHelper::template sqrtDetAAT< mydimension, coorddimension >\n+( jacobianTransposed( local ) );\n+ 353 }\n+ 354\n+363 Volume volume () const\n+ 364 {\n+ 365 return integrationElement( refElement().position( 0, 0 ) ) * refElement\n+().volume();\n+ 366 }\n+ 367\n+377 JacobianTransposed jacobianTransposed ( const LocalCoordinate &local )\n+const\n+ 378 {\n+ 379 using std::begin;\n+ 380\n+ 381 JacobianTransposed jt;\n+ 382 auto cit = begin(std::cref(corners_).get());\n+ 383 jacobianTransposed< false >( topologyId(), std::integral_constant< int,\n+mydimension >(), cit, ctype( 1 ), local, ctype( 1 ), jt );\n+ 384 return jt;\n+ 385 }\n+ 386\n+393 JacobianInverseTransposed jacobianInverseTransposed ( const LocalCoordinate\n+&local ) const;\n 394\n- 416 template\n- 417 using ReferenceElement = unspecified-type;\n- 418\n- 419#endif //DOXYGEN\n- 420\n+395 friend ReferenceElement referenceElement ( const MultiLinearGeometry\n+&geometry )\n+ 396 {\n+ 397 return geometry.refElement();\n+ 398 }\n+ 399\n+ 400\n+407 Jacobian jacobian (const LocalCoordinate &local) const\n+ 408 {\n+ 409 return jacobianTransposed(local).transposed();\n+ 410 }\n+ 411\n+418 JacobianInverse jacobianInverse (const LocalCoordinate &local) const\n+ 419 {\n+ 420 return jacobianInverseTransposed(local).transposed();\n 421 }\n 422\n- 423#ifndef DOXYGEN\n+ 423 protected:\n 424\n- 425 namespace Impl {\n- 426\n- 427 // helpers for triggering a deprecation warning for occurrences of the old\n- 428 // ReferenceElement syntax (Dune::ReferenceElement)\n+425 ReferenceElement refElement () const\n+ 426 {\n+ 427 return refElement_;\n+ 428 }\n 429\n- 430 // this looks a little weird, encoding the type in the return type of a\n-nested function,\n- 431 // but it was the only reliable way to trigger the warning iff the\n-compiler encounters\n- 432 // an invalid use. Other solutions either miss some (or all) uses or\n-trigger false alarms.\n- 433\n- 434 template\n- 435 struct ValidReferenceElementTypeSignature\n- 436 {\n- 437 Transitional::ReferenceElement check();\n- 438 };\n- 439\n- 440 template\n- 441 struct DeprecatedReferenceElementTypeSignature\n- 442 {\n- 443 [[deprecated(\"Dune::ReferenceElement is deprecated, please use\n-Dune::ReferenceElement (if you have a geometry), Dune::\n-ReferenceElements::ReferenceElement or Dune::Transitional::\n-ReferenceElement> instead. After Dune 2.6, you will be able to\n-use Dune::ReferenceElement>.\")]] T check();\n- 444 };\n- 445\n- 446 } // namespace Impl\n- 447\n- 448 // This just makes sure the user doesn't use invalid syntax (by checking\n-against the -1 default for\n- 449 // the dimension, and then either hands back the old-style type along with\n-a deprecation warning or\n- 450 // forwards to the transitional version\n- 451 template\n- 452 using ReferenceElement = decltype(\n- 453 std::declval<\n- 454 typename std::conditional<\n- 455 dim == -1,\n- 456 Impl::ValidReferenceElementTypeSignature,\n- 457 Impl::DeprecatedReferenceElementTypeSignature>\n- 458 >::type\n- 459 >().check());\n- 460\n- 461#else // DOXYGEN\n- 462\n- 464\n- 496 template\n-497 using ReferenceElement = unspecified-type;\n- 498\n- 499#endif // DOXYGEN\n- 500\n+430 TopologyId topologyId () const\n+ 431 {\n+ 432 return topologyId( std::integral_constant< bool, hasSingleGeometryType >()\n+);\n+ 433 }\n+ 434\n+ 435 template< bool add, int dim, class CornerIterator >\n+436 static void global ( TopologyId topologyId, std::integral_constant< int,\n+dim >,\n+ 437 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,\n+ 438 const ctype &rf, GlobalCoordinate &y );\n+ 439 template< bool add, class CornerIterator >\n+440 static void global ( TopologyId topologyId, std::integral_constant< int, 0\n+>,\n+ 441 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,\n+ 442 const ctype &rf, GlobalCoordinate &y );\n+ 443\n+ 444 template< bool add, int rows, int dim, class CornerIterator >\n+445 static void jacobianTransposed ( TopologyId topologyId, std::\n+integral_constant< int, dim >,\n+ 446 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,\n+ 447 const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt );\n+ 448 template< bool add, int rows, class CornerIterator >\n+449 static void jacobianTransposed ( TopologyId topologyId, std::\n+integral_constant< int, 0 >,\n+ 450 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,\n+ 451 const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt );\n+ 452\n+ 453 template< int dim, class CornerIterator >\n+454 static bool affine ( TopologyId topologyId, std::integral_constant< int,\n+dim >, CornerIterator &cit, JacobianTransposed &jt );\n+ 455 template< class CornerIterator >\n+456 static bool affine ( TopologyId topologyId, std::integral_constant< int, 0\n+>, CornerIterator &cit, JacobianTransposed &jt );\n+ 457\n+458 bool affine ( JacobianTransposed &jacobianT ) const\n+ 459 {\n+ 460 using std::begin;\n+ 461\n+ 462 auto cit = begin(std::cref(corners_).get());\n+ 463 return affine( topologyId(), std::integral_constant< int, mydimension >(),\n+cit, jacobianT );\n+ 464 }\n+ 465\n+ 466 private:\n+ 467 // The following methods are needed to convert the return type of\n+topologyId to\n+ 468 // unsigned int with g++-4.4. It has problems casting integral_constant to\n+the\n+ 469 // integral type.\n+ 470 static unsigned int toUnsignedInt(unsigned int i) { return i; }\n+ 471 template\n+ 472 static unsigned int toUnsignedInt(std::integral_constant )\n+{ return v; }\n+ 473 TopologyId topologyId ( std::integral_constant< bool, true > ) const\n+{ return TopologyId(); }\n+ 474 unsigned int topologyId ( std::integral_constant< bool, false > ) const\n+{ return refElement().type().id(); }\n+ 475\n+ 476 ReferenceElement refElement_;\n+ 477 typename Traits::template CornerStorage< mydimension, coorddimension >::\n+Type corners_;\n+ 478 };\n+ 479\n+ 480\n+ 481\n+ 482 // MultiLinearGeometry::JacobianInverseTransposed\n+ 483 // ----------------------------------------------\n+ 484\n+ 485 template< class ct, int mydim, int cdim, class Traits >\n+486 class MultiLinearGeometry< ct, mydim, cdim, Traits >::\n+JacobianInverseTransposed\n+ 487 : public FieldMatrix< ctype, coorddimension, mydimension >\n+ 488 {\n+ 489 typedef FieldMatrix< ctype, coorddimension, mydimension > Base;\n+ 490\n+ 491 public:\n+492 void setup ( const JacobianTransposed &jt )\n+ 493 {\n+ 494 detInv_ = MatrixHelper::template rightInvA< mydimension, coorddimension >\n+( jt, static_cast< Base & >( *this ) );\n+ 495 }\n+ 496\n+497 void setupDeterminant ( const JacobianTransposed &jt )\n+ 498 {\n+ 499 detInv_ = MatrixHelper::template sqrtDetAAT< mydimension, coorddimension >\n+( jt );\n+ 500 }\n 501\n- 502\n- 503} // namespace Dune\n+502 ctype det () const { return ctype( 1 ) / detInv_; }\n+503 ctype detInv () const { return detInv_; }\n 504\n- 505#endif // #ifndef DUNE_GEOMETRY_REFERENCEELEMENTS_HH\n-referenceelement.hh\n+ 505 private:\n+ 506 ctype detInv_;\n+ 507 };\n+ 508\n+ 509\n+ 510\n+ 523 template< class ct, int mydim, int cdim, class Traits =\n+MultiLinearGeometryTraits< ct > >\n+524 class CachedMultiLinearGeometry\n+ 525 : public MultiLinearGeometry< ct, mydim, cdim, Traits >\n+ 526 {\n+ 527 typedef CachedMultiLinearGeometry<_ct,_mydim,_cdim,_Traits_> This;\n+ 528 typedef MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_> Base;\n+ 529\n+ 530 protected:\n+531 typedef typename Base::MatrixHelper MatrixHelper;\n+ 532\n+ 533 public:\n+534 typedef typename Base::ReferenceElement ReferenceElement;\n+ 535\n+536 typedef typename Base::ctype ctype;\n+ 537\n+ 538 using Base::mydimension;\n+ 539 using Base::coorddimension;\n+ 540\n+541 typedef typename Base::LocalCoordinate LocalCoordinate;\n+542 typedef typename Base::GlobalCoordinate GlobalCoordinate;\n+543 typedef typename Base::Volume Volume;\n+ 544\n+545 typedef typename Base::JacobianTransposed JacobianTransposed;\n+546 typedef typename Base::JacobianInverseTransposed JacobianInverseTransposed;\n+547 typedef typename Base::Jacobian Jacobian;\n+548 typedef typename Base::JacobianInverse JacobianInverse;\n+ 549\n+ 550 template< class CornerStorage >\n+551 CachedMultiLinearGeometry ( const ReferenceElement &referenceElement, const\n+CornerStorage &cornerStorage )\n+ 552 : Base( referenceElement, cornerStorage ),\n+ 553 affine_( Base::affine( jacobianTransposed_ ) ),\n+ 554 jacobianInverseTransposedComputed_( false ),\n+ 555 integrationElementComputed_( false )\n+ 556 {}\n+ 557\n+ 558 template< class CornerStorage >\n+559 CachedMultiLinearGeometry ( Dune::GeometryType gt, const CornerStorage\n+&cornerStorage )\n+ 560 : Base( gt, cornerStorage ),\n+ 561 affine_( Base::affine( jacobianTransposed_ ) ),\n+ 562 jacobianInverseTransposedComputed_( false ),\n+ 563 integrationElementComputed_( false )\n+ 564 {}\n+ 565\n+567 bool affine () const { return affine_; }\n+ 568\n+ 569 using Base::corner;\n+ 570\n+572 GlobalCoordinate center () const { return global( refElement().position( 0,\n+0 ) ); }\n+ 573\n+580 GlobalCoordinate global ( const LocalCoordinate &local ) const\n+ 581 {\n+ 582 if( affine() )\n+ 583 {\n+ 584 GlobalCoordinate global( corner( 0 ) );\n+ 585 jacobianTransposed_.umtv( local, global );\n+ 586 return global;\n+ 587 }\n+ 588 else\n+ 589 return Base::global( local );\n+ 590 }\n+ 591\n+604 LocalCoordinate local ( const GlobalCoordinate &global ) const\n+ 605 {\n+ 606 if( affine() )\n+ 607 {\n+ 608 LocalCoordinate local;\n+ 609 if( jacobianInverseTransposedComputed_ )\n+ 610 jacobianInverseTransposed_.mtv( global - corner( 0 ), local );\n+ 611 else\n+ 612 MatrixHelper::template xTRightInvA< mydimension, coorddimension >\n+( jacobianTransposed_, global - corner( 0 ), local );\n+ 613 return local;\n+ 614 }\n+ 615 else\n+ 616 return Base::local( global );\n+ 617 }\n+ 618\n+633 ctype integrationElement ( const LocalCoordinate &local ) const\n+ 634 {\n+ 635 if( affine() )\n+ 636 {\n+ 637 if( !integrationElementComputed_ )\n+ 638 {\n+ 639 jacobianInverseTransposed_.setupDeterminant( jacobianTransposed_ );\n+ 640 integrationElementComputed_ = true;\n+ 641 }\n+ 642 return jacobianInverseTransposed_.detInv();\n+ 643 }\n+ 644 else\n+ 645 return Base::integrationElement( local );\n+ 646 }\n+ 647\n+649 Volume volume () const\n+ 650 {\n+ 651 if( affine() )\n+ 652 return integrationElement( refElement().position( 0, 0 ) ) * refElement\n+().volume();\n+ 653 else\n+ 654 return Base::volume();\n+ 655 }\n+ 656\n+666 JacobianTransposed jacobianTransposed ( const LocalCoordinate &local )\n+const\n+ 667 {\n+ 668 if( affine() )\n+ 669 return jacobianTransposed_;\n+ 670 else\n+ 671 return Base::jacobianTransposed( local );\n+ 672 }\n+ 673\n+680 JacobianInverseTransposed jacobianInverseTransposed ( const LocalCoordinate\n+&local ) const\n+ 681 {\n+ 682 if( affine() )\n+ 683 {\n+ 684 if( !jacobianInverseTransposedComputed_ )\n+ 685 {\n+ 686 jacobianInverseTransposed_.setup( jacobianTransposed_ );\n+ 687 jacobianInverseTransposedComputed_ = true;\n+ 688 integrationElementComputed_ = true;\n+ 689 }\n+ 690 return jacobianInverseTransposed_;\n+ 691 }\n+ 692 else\n+ 693 return Base::jacobianInverseTransposed( local );\n+ 694 }\n+ 695\n+702 Jacobian jacobian (const LocalCoordinate &local) const\n+ 703 {\n+ 704 return jacobianTransposed(local).transposed();\n+ 705 }\n+ 706\n+713 JacobianInverse jacobianInverse (const LocalCoordinate &local) const\n+ 714 {\n+ 715 return jacobianInverseTransposed(local).transposed();\n+ 716 }\n+ 717\n+ 718 protected:\n+ 719 using Base::refElement;\n+ 720\n+ 721 private:\n+ 722 mutable JacobianTransposed jacobianTransposed_;\n+ 723 mutable JacobianInverseTransposed jacobianInverseTransposed_;\n+ 724\n+ 725 mutable bool affine_ : 1;\n+ 726\n+ 727 mutable bool jacobianInverseTransposedComputed_ : 1;\n+ 728 mutable bool integrationElementComputed_ : 1;\n+ 729 };\n+ 730\n+ 731\n+ 732\n+ 733 // Implementation of MultiLinearGeometry\n+ 734 // -------------------------------------\n+ 735\n+ 736 template< class ct, int mydim, int cdim, class Traits >\n+ 737 inline typename MultiLinearGeometry< ct, mydim, cdim, Traits >::\n+JacobianInverseTransposed\n+738 MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_>::jacobianInverseTransposed\n+( const LocalCoordinate &local ) const\n+ 739 {\n+ 740 JacobianInverseTransposed jit;\n+ 741 jit.setup( jacobianTransposed( local ) );\n+ 742 return jit;\n+ 743 }\n+ 744\n+ 745\n+ 746 template< class ct, int mydim, int cdim, class Traits >\n+ 747 template< bool add, int dim, class CornerIterator >\n+ 748 inline void MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_>\n+749::global ( TopologyId topologyId, std::integral_constant< int, dim >,\n+ 750 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,\n+ 751 const ctype &rf, GlobalCoordinate &y )\n+ 752 {\n+ 753 const ctype xn = df*x[ dim-1 ];\n+ 754 const ctype cxn = ctype( 1 ) - xn;\n+ 755\n+ 756 if( Impl::isPrism( toUnsignedInt(topologyId), mydimension, mydimension-dim\n+) )\n+ 757 {\n+ 758 // apply (1-xn) times mapping for bottom\n+ 759 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit,\n+df, x, rf*cxn, y );\n+ 760 // apply xn times mapping for top\n+ 761 global< true >( topologyId, std::integral_constant< int, dim-1 >(), cit,\n+df, x, rf*xn, y );\n+ 762 }\n+ 763 else\n+ 764 {\n+ 765 assert( Impl::isPyramid( toUnsignedInt(topologyId), mydimension,\n+mydimension-dim ) );\n+ 766 // apply (1-xn) times mapping for bottom (with argument x/(1-xn))\n+ 767 if( cxn > Traits::tolerance() || cxn < -Traits::tolerance() )\n+ 768 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit,\n+df/cxn, x, rf*cxn, y );\n+ 769 else\n+ 770 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit,\n+df, x, ctype( 0 ), y );\n+ 771 // apply xn times the tip\n+ 772 y.axpy( rf*xn, *cit );\n+ 773 ++cit;\n+ 774 }\n+ 775 }\n+ 776\n+ 777 template< class ct, int mydim, int cdim, class Traits >\n+ 778 template< bool add, class CornerIterator >\n+ 779 inline void MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_>\n+780::global ( TopologyId, std::integral_constant< int, 0 >,\n+ 781 CornerIterator &cit, const ctype &, const LocalCoordinate &,\n+ 782 const ctype &rf, GlobalCoordinate &y )\n+ 783 {\n+ 784 const GlobalCoordinate &origin = *cit;\n+ 785 ++cit;\n+ 786 for( int i = 0; i < coorddimension; ++i )\n+ 787 y[ i ] = (add ? y[ i ] + rf*origin[ i ] : rf*origin[ i ]);\n+ 788 }\n+ 789\n+ 790\n+ 791 template< class ct, int mydim, int cdim, class Traits >\n+ 792 template< bool add, int rows, int dim, class CornerIterator >\n+ 793 inline void MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_>\n+794::jacobianTransposed ( TopologyId topologyId, std::integral_constant< int,\n+dim >,\n+ 795 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,\n+ 796 const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt )\n+ 797 {\n+ 798 assert( rows >= dim );\n+ 799\n+ 800 const ctype xn = df*x[ dim-1 ];\n+ 801 const ctype cxn = ctype( 1 ) - xn;\n+ 802\n+ 803 auto cit2( cit );\n+ 804 if( Impl::isPrism( toUnsignedInt(topologyId), mydimension, mydimension-dim\n+) )\n+ 805 {\n+ 806 // apply (1-xn) times Jacobian for bottom\n+ 807 jacobianTransposed< add >( topologyId, std::integral_constant< int, dim-\n+1 >(), cit2, df, x, rf*cxn, jt );\n+ 808 // apply xn times Jacobian for top\n+ 809 jacobianTransposed< true >( topologyId, std::integral_constant< int, dim-\n+1 >(), cit2, df, x, rf*xn, jt );\n+ 810 // compute last row as difference between top value and bottom value\n+ 811 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit,\n+df, x, -rf, jt[ dim-1 ] );\n+ 812 global< true >( topologyId, std::integral_constant< int, dim-1 >(), cit,\n+df, x, rf, jt[ dim-1 ] );\n+ 813 }\n+ 814 else\n+ 815 {\n+ 816 assert( Impl::isPyramid( toUnsignedInt(topologyId), mydimension,\n+mydimension-dim ) );\n+ 817 /*\n+ 818 * In the pyramid case, we need a transformation Tb: B -> R^n for the\n+ 819 * base B \\subset R^{n-1}. The pyramid transformation is then defined as\n+ 820 * T: P \\subset R^n -> R^n\n+ 821 * (x, xn) |-> (1-xn) Tb(x*) + xn t (x \\in R^{n-1}, xn \\in R)\n+ 822 * with the tip of the pyramid mapped to t and x* = x/(1-xn)\n+ 823 * the projection of (x,xn) onto the base.\n+ 824 *\n+ 825 * For the Jacobi matrix DT we get\n+ 826 * DT = ( A | b )\n+ 827 * with A = DTb(x*) (n x n-1 matrix)\n+ 828 * and b = dT/dxn (n-dim column vector).\n+ 829 * Furthermore\n+ 830 * b = -Tb(x*) + t + \\sum_i dTb/dx_i(x^*) x_i/(1-xn)\n+ 831 *\n+ 832 * Note that both A and b are not defined in the pyramid tip (x=0, xn=1)!\n+ 833 * Indeed for B the unit square, Tb mapping B to the quadrilateral given\n+ 834 * by the vertices (0,0,0), (2,0,0), (0,1,0), (1,1,0) and t=(0,0,1), we get\n+ 835 *\n+ 836 * T(x,y,xn) = ( x(2-y/(1-xn)), y, xn )\n+ 837 * / 2-y/(1-xn) -x 0 \\\n+ 838 * DT(x,y,xn) = | 0 1 0 |\n+ 839 * \\ 0 0 1 /\n+ 840 * which is not continuous for xn -> 1, choose for example\n+ 841 * x=0, y=1-xn, xn -> 1 --> DT -> diag(1,1,1)\n+ 842 * x=1-xn, y=0, xn -> 1 --> DT -> diag(2,1,1)\n+ 843 *\n+ 844 * However, for Tb affine-linear, Tb(y) = My + y0, DTb = M:\n+ 845 * A = M\n+ 846 * b = -M x* - y0 + t + \\sum_i M_i x_i/(1-xn)\n+ 847 * = -M x* - y0 + t + M x*\n+ 848 * = -y0 + t\n+ 849 * which is continuous for xn -> 1. Note that this b is also given by\n+ 850 * b = -Tb(0) + t + \\sum_i dTb/dx_i(0) x_i/1\n+ 851 * that is replacing x* by 1 and 1-xn by 1 in the formular above.\n+ 852 *\n+ 853 * For xn -> 1, we can thus set x*=0, \"1-xn\"=1 (or anything != 0) and get\n+ 854 * the right result in case Tb is affine-linear.\n+ 855 */\n+ 856\n+ 857 /* The second case effectively results in x* = 0 */\n+ 858 ctype dfcxn = (cxn > Traits::tolerance() || cxn < -Traits::tolerance()) ?\n+ctype(df / cxn) : ctype(0);\n+ 859\n+ 860 // initialize last row\n+ 861 // b = -Tb(x*)\n+ 862 // (b = -Tb(0) = -y0 in case xn -> 1 and Tb affine-linear)\n+ 863 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit,\n+dfcxn, x, -rf, jt[ dim-1 ] );\n+ 864 // b += t\n+ 865 jt[ dim-1 ].axpy( rf, *cit );\n+ 866 ++cit;\n+ 867 // apply Jacobian for bottom (with argument x/(1-xn)) and correct last row\n+ 868 if( add )\n+ 869 {\n+ 870 FieldMatrix< ctype, dim-1, coorddimension > jt2;\n+ 871 // jt2 = dTb/dx_i(x*)\n+ 872 jacobianTransposed< false >( topologyId, std::integral_constant< int, dim-\n+1 >(), cit2, dfcxn, x, rf, jt2 );\n+ 873 // A = dTb/dx_i(x*) (jt[j], j=0..dim-1)\n+ 874 // b += \\sum_i dTb/dx_i(x*) x_i/(1-xn) (jt[dim-1])\n+ 875 // (b += 0 in case xn -> 1)\n+ 876 for( int j = 0; j < dim-1; ++j )\n+ 877 {\n+ 878 jt[ j ] += jt2[ j ];\n+ 879 jt[ dim-1 ].axpy( dfcxn*x[ j ], jt2[ j ] );\n+ 880 }\n+ 881 }\n+ 882 else\n+ 883 {\n+ 884 // jt = dTb/dx_i(x*)\n+ 885 jacobianTransposed< false >( topologyId, std::integral_constant< int, dim-\n+1 >(), cit2, dfcxn, x, rf, jt );\n+ 886 // b += \\sum_i dTb/dx_i(x*) x_i/(1-xn)\n+ 887 for( int j = 0; j < dim-1; ++j )\n+ 888 jt[ dim-1 ].axpy( dfcxn*x[ j ], jt[ j ] );\n+ 889 }\n+ 890 }\n+ 891 }\n+ 892\n+ 893 template< class ct, int mydim, int cdim, class Traits >\n+ 894 template< bool add, int rows, class CornerIterator >\n+ 895 inline void MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_>\n+896::jacobianTransposed ( TopologyId, std::integral_constant< int, 0 >,\n+ 897 CornerIterator &cit, const ctype &, const LocalCoordinate &,\n+ 898 const ctype &, FieldMatrix< ctype, rows, cdim > & )\n+ 899 {\n+ 900 ++cit;\n+ 901 }\n+ 902\n+ 903\n+ 904\n+ 905 template< class ct, int mydim, int cdim, class Traits >\n+ 906 template< int dim, class CornerIterator >\n+ 907 inline bool MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_>\n+908::affine ( TopologyId topologyId, std::integral_constant< int, dim >,\n+CornerIterator &cit, JacobianTransposed &jt )\n+ 909 {\n+ 910 const GlobalCoordinate &orgBottom = *cit;\n+ 911 if( !affine( topologyId, std::integral_constant< int, dim-1 >(), cit, jt )\n+)\n+ 912 return false;\n+ 913 const GlobalCoordinate &orgTop = *cit;\n+ 914\n+ 915 if( Impl::isPrism( toUnsignedInt(topologyId), mydimension, mydimension-dim\n+) )\n+ 916 {\n+ 917 JacobianTransposed jtTop;\n+ 918 if( !affine( topologyId, std::integral_constant< int, dim-1 >(), cit,\n+jtTop ) )\n+ 919 return false;\n+ 920\n+ 921 // check whether both jacobians are identical\n+ 922 ctype norm( 0 );\n+ 923 for( int i = 0; i < dim-1; ++i )\n+ 924 norm += (jtTop[ i ] - jt[ i ]).two_norm2();\n+ 925 if( norm >= Traits::tolerance() )\n+ 926 return false;\n+ 927 }\n+ 928 else\n+ 929 ++cit;\n+ 930 jt[ dim-1 ] = orgTop - orgBottom;\n+ 931 return true;\n+ 932 }\n+ 933\n+ 934 template< class ct, int mydim, int cdim, class Traits >\n+ 935 template< class CornerIterator >\n+ 936 inline bool MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_>\n+937::affine ( TopologyId, std::integral_constant< int, 0 >, CornerIterator\n+&cit, JacobianTransposed & )\n+ 938 {\n+ 939 ++cit;\n+ 940 return true;\n+ 941 }\n+ 942\n+ 943} // namespace Dune\n+ 944\n+ 945#endif // #ifndef DUNE_GEOMETRY_MULTILINEARGEOMETRY_HH\n+affinegeometry.hh\n+An implementation of the Geometry interface for affine geometries.\n type.hh\n A unique label for each type of element that can occur in a grid.\n-referenceelementimplementation.hh\n-dimension.hh\n-Dune::referenceElement\n-unspecified value type referenceElement(T &&... t)\n-Returns a reference element for the objects t....\n-Dune::ReferenceElement\n-unspecified-type ReferenceElement\n-Returns the type of reference element for the argument type T.\n-Definition referenceelements.hh:497\n+referenceelements.hh\n Dune\n Definition affinegeometry.hh:21\n-Dune::Geo::ReferenceElement\n-This class provides access to geometric and topological properties of a\n-reference element.\n-Definition referenceelement.hh:52\n Dune::Geo::ReferenceElements\n Class providing access to the singletons of the reference elements.\n Definition referenceelements.hh:170\n-Dune::Geo::ReferenceElements::begin\n-static Iterator begin()\n-Definition referenceelements.hh:215\n-Dune::Geo::ReferenceElements::iterator\n-Iterator iterator\n-Iterator over available reference elements.\n-Definition referenceelements.hh:194\n Dune::Geo::ReferenceElements::ReferenceElement\n typename Container::ReferenceElement ReferenceElement\n The reference element type.\n Definition referenceelements.hh:188\n-Dune::Geo::ReferenceElements::cube\n-static const ReferenceElement & cube()\n-get hypercube reference elements\n-Definition referenceelements.hh:210\n-Dune::Geo::ReferenceElements::end\n-static Iterator end()\n-Definition referenceelements.hh:220\n-Dune::Geo::ReferenceElements::ctype\n-ctype_ ctype\n-The coordinate field type of the contained reference elements.\n-Definition referenceelements.hh:173\n-Dune::Geo::ReferenceElements::general\n-static const ReferenceElement & general(const GeometryType &type)\n-get general reference elements\n-Definition referenceelements.hh:198\n-Dune::Geo::ReferenceElements::simplex\n-static const ReferenceElement & simplex()\n-get simplex reference elements\n-Definition referenceelements.hh:204\n-Dune::Geo::ReferenceElements::Iterator\n-typename Container::const_iterator Iterator\n-Iterator over available reference elements.\n-Definition referenceelements.hh:191\n-Dune::Geo::ReferenceElements::dimension\n-static constexpr int dimension\n-The dimension of the contained reference elements.\n-Definition referenceelements.hh:179\n-Dune::Geo::ReferenceElements::CoordinateField\n-ctype CoordinateField\n-The coordinate field type of the contained reference elements.\n-Definition referenceelements.hh:176\n-Dune::Dim\n-Static tag representing a dimension.\n-Definition dimension.hh:16\n+Dune::MultiLinearGeometryTraits\n+default traits class for MultiLinearGeometry\n+Definition multilineargeometry.hh:39\n+Dune::MultiLinearGeometryTraits::MatrixHelper\n+Impl::FieldMatrixHelper< ct > MatrixHelper\n+helper structure containing some matrix routines\n+Definition multilineargeometry.hh:58\n+Dune::MultiLinearGeometryTraits::tolerance\n+static ct tolerance()\n+tolerance to numerical algorithms\n+Definition multilineargeometry.hh:61\n+Dune::MultiLinearGeometryTraits::CornerStorage\n+template specifying the storage for the corners\n+Definition multilineargeometry.hh:129\n+Dune::MultiLinearGeometryTraits::CornerStorage::Type\n+std::vector< FieldVector< ct, cdim > > Type\n+Definition multilineargeometry.hh:130\n+Dune::MultiLinearGeometryTraits::hasSingleGeometryType\n+will there be only one geometry type for a dimension?\n+Definition multilineargeometry.hh:148\n+Dune::MultiLinearGeometryTraits::hasSingleGeometryType::topologyId\n+static const unsigned int topologyId\n+Definition multilineargeometry.hh:150\n+Dune::MultiLinearGeometryTraits::hasSingleGeometryType::v\n+static const bool v\n+Definition multilineargeometry.hh:149\n+Dune::MultiLinearGeometry\n+generic geometry implementation based on corner coordinates\n+Definition multilineargeometry.hh:181\n+Dune::MultiLinearGeometry::global\n+static void global(TopologyId topologyId, std::integral_constant< int, dim >,\n+CornerIterator &cit, const ctype &df, const LocalCoordinate &x, const ctype\n+&rf, GlobalCoordinate &y)\n+Definition multilineargeometry.hh:749\n+Dune::MultiLinearGeometry::mydimension\n+static const int mydimension\n+geometry dimension\n+Definition multilineargeometry.hh:189\n+Dune::MultiLinearGeometry::type\n+Dune::GeometryType type() const\n+obtain the name of the reference element\n+Definition multilineargeometry.hh:269\n+Dune::MultiLinearGeometry::MatrixHelper\n+Traits::MatrixHelper MatrixHelper\n+Definition multilineargeometry.hh:225\n+Dune::MultiLinearGeometry::GlobalCoordinate\n+FieldVector< ctype, coorddimension > GlobalCoordinate\n+type of global coordinates\n+Definition multilineargeometry.hh:196\n+Dune::MultiLinearGeometry::jacobianTransposed\n+static void jacobianTransposed(TopologyId topologyId, std::integral_constant<\n+int, 0 >, CornerIterator &cit, const ctype &df, const LocalCoordinate &x, const\n+ctype &rf, FieldMatrix< ctype, rows, cdim > &jt)\n+Definition multilineargeometry.hh:896\n+Dune::MultiLinearGeometry::jacobianTransposed\n+JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const\n+obtain the transposed of the Jacobian\n+Definition multilineargeometry.hh:377\n+Dune::MultiLinearGeometry::refElement\n+ReferenceElement refElement() const\n+Definition multilineargeometry.hh:425\n+Dune::MultiLinearGeometry::global\n+GlobalCoordinate global(const LocalCoordinate &local) const\n+evaluate the mapping\n+Definition multilineargeometry.hh:290\n+Dune::MultiLinearGeometry::center\n+GlobalCoordinate center() const\n+obtain the centroid of the mapping's image\n+Definition multilineargeometry.hh:282\n+Dune::MultiLinearGeometry::corner\n+GlobalCoordinate corner(int i) const\n+obtain coordinates of the i-th corner\n+Definition multilineargeometry.hh:275\n+Dune::MultiLinearGeometry::ReferenceElements\n+Dune::ReferenceElements< ctype, mydimension > ReferenceElements\n+Definition multilineargeometry.hh:214\n+Dune::MultiLinearGeometry::ctype\n+ct ctype\n+coordinate type\n+Definition multilineargeometry.hh:186\n+Dune::MultiLinearGeometry::jacobianTransposed\n+static void jacobianTransposed(TopologyId topologyId, std::integral_constant<\n+int, dim >, CornerIterator &cit, const ctype &df, const LocalCoordinate &x,\n+const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt)\n+Definition multilineargeometry.hh:794\n+Dune::MultiLinearGeometry::coorddimension\n+static const int coorddimension\n+coordinate dimension\n+Definition multilineargeometry.hh:191\n+Dune::MultiLinearGeometry::corners\n+int corners() const\n+obtain number of corners of the corresponding reference element\n+Definition multilineargeometry.hh:272\n+Dune::MultiLinearGeometry::topologyId\n+TopologyId topologyId() const\n+Definition multilineargeometry.hh:430\n+Dune::MultiLinearGeometry::referenceElement\n+friend ReferenceElement referenceElement(const MultiLinearGeometry &geometry)\n+Definition multilineargeometry.hh:395\n+Dune::MultiLinearGeometry::local\n+LocalCoordinate local(const GlobalCoordinate &globalCoord) const\n+evaluate the inverse mapping\n+Definition multilineargeometry.hh:312\n+Dune::MultiLinearGeometry::global\n+static void global(TopologyId topologyId, std::integral_constant< int, 0 >,\n+CornerIterator &cit, const ctype &df, const LocalCoordinate &x, const ctype\n+&rf, GlobalCoordinate &y)\n+Definition multilineargeometry.hh:780\n+Dune::MultiLinearGeometry::volume\n+Volume volume() const\n+obtain the volume of the mapping's image\n+Definition multilineargeometry.hh:363\n+Dune::MultiLinearGeometry::LocalCoordinate\n+FieldVector< ctype, mydimension > LocalCoordinate\n+type of local coordinates\n+Definition multilineargeometry.hh:194\n+Dune::MultiLinearGeometry::MultiLinearGeometry\n+MultiLinearGeometry(const ReferenceElement &refElement, const Corners &corners)\n+constructor\n+Definition multilineargeometry.hh:239\n+Dune::MultiLinearGeometry::affine\n+static bool affine(TopologyId topologyId, std::integral_constant< int, 0 >,\n+CornerIterator &cit, JacobianTransposed &jt)\n+Definition multilineargeometry.hh:937\n+Dune::MultiLinearGeometry::TopologyId\n+std::conditional< hasSingleGeometryType, std::integral_constant< unsignedint,\n+Traits::templatehasSingleGeometryType< mydimension >::topologyId >, unsignedint\n+>::type TopologyId\n+Definition multilineargeometry.hh:226\n+Dune::MultiLinearGeometry::Volume\n+ctype Volume\n+type of volume\n+Definition multilineargeometry.hh:198\n+Dune::MultiLinearGeometry::affine\n+static bool affine(TopologyId topologyId, std::integral_constant< int, dim >,\n+CornerIterator &cit, JacobianTransposed &jt)\n+Definition multilineargeometry.hh:908\n+Dune::MultiLinearGeometry::jacobianInverse\n+JacobianInverse jacobianInverse(const LocalCoordinate &local) const\n+Obtain the Jacobian's inverse.\n+Definition multilineargeometry.hh:418\n+Dune::MultiLinearGeometry::MultiLinearGeometry\n+MultiLinearGeometry(Dune::GeometryType gt, const Corners &corners)\n+constructor\n+Definition multilineargeometry.hh:255\n+Dune::MultiLinearGeometry::JacobianTransposed\n+FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed\n+type of jacobian transposed\n+Definition multilineargeometry.hh:201\n+Dune::MultiLinearGeometry::ReferenceElement\n+ReferenceElements::ReferenceElement ReferenceElement\n+type of reference element\n+Definition multilineargeometry.hh:219\n+Dune::MultiLinearGeometry::jacobianInverseTransposed\n+JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate\n+&local) const\n+obtain the transposed of the Jacobian's inverse\n+Definition multilineargeometry.hh:738\n+Dune::MultiLinearGeometry::Jacobian\n+FieldMatrix< ctype, coorddimension, mydimension > Jacobian\n+Type for the Jacobian matrix.\n+Definition multilineargeometry.hh:207\n+Dune::MultiLinearGeometry::affine\n+bool affine() const\n+is this mapping affine?\n+Definition multilineargeometry.hh:262\n+Dune::MultiLinearGeometry::JacobianInverse\n+FieldMatrix< ctype, mydimension, coorddimension > JacobianInverse\n+Type for the inverse Jacobian matrix.\n+Definition multilineargeometry.hh:210\n+Dune::MultiLinearGeometry::affine\n+bool affine(JacobianTransposed &jacobianT) const\n+Definition multilineargeometry.hh:458\n+Dune::MultiLinearGeometry::integrationElement\n+Volume integrationElement(const LocalCoordinate &local) const\n+obtain the integration element\n+Definition multilineargeometry.hh:350\n+Dune::MultiLinearGeometry::jacobian\n+Jacobian jacobian(const LocalCoordinate &local) const\n+Obtain the Jacobian.\n+Definition multilineargeometry.hh:407\n+Dune::MultiLinearGeometry::JacobianInverseTransposed\n+Definition multilineargeometry.hh:488\n+Dune::MultiLinearGeometry::JacobianInverseTransposed::setup\n+void setup(const JacobianTransposed &jt)\n+Definition multilineargeometry.hh:492\n+Dune::MultiLinearGeometry::JacobianInverseTransposed::det\n+ctype det() const\n+Definition multilineargeometry.hh:502\n+Dune::MultiLinearGeometry::JacobianInverseTransposed::detInv\n+ctype detInv() const\n+Definition multilineargeometry.hh:503\n+Dune::MultiLinearGeometry::JacobianInverseTransposed::setupDeterminant\n+void setupDeterminant(const JacobianTransposed &jt)\n+Definition multilineargeometry.hh:497\n+Dune::CachedMultiLinearGeometry\n+Implement a MultiLinearGeometry with additional caching.\n+Definition multilineargeometry.hh:526\n+Dune::CachedMultiLinearGeometry::global\n+GlobalCoordinate global(const LocalCoordinate &local) const\n+evaluate the mapping\n+Definition multilineargeometry.hh:580\n+Dune::CachedMultiLinearGeometry::ReferenceElement\n+Base::ReferenceElement ReferenceElement\n+Definition multilineargeometry.hh:534\n+Dune::CachedMultiLinearGeometry::affine\n+bool affine() const\n+is this mapping affine?\n+Definition multilineargeometry.hh:567\n+Dune::CachedMultiLinearGeometry::CachedMultiLinearGeometry\n+CachedMultiLinearGeometry(const ReferenceElement &referenceElement, const\n+CornerStorage &cornerStorage)\n+Definition multilineargeometry.hh:551\n+Dune::CachedMultiLinearGeometry::refElement\n+ReferenceElement refElement() const\n+Definition multilineargeometry.hh:425\n+Dune::CachedMultiLinearGeometry::local\n+LocalCoordinate local(const GlobalCoordinate &global) const\n+evaluate the inverse mapping\n+Definition multilineargeometry.hh:604\n+Dune::CachedMultiLinearGeometry::MatrixHelper\n+Base::MatrixHelper MatrixHelper\n+Definition multilineargeometry.hh:531\n+Dune::CachedMultiLinearGeometry::LocalCoordinate\n+Base::LocalCoordinate LocalCoordinate\n+Definition multilineargeometry.hh:541\n+Dune::CachedMultiLinearGeometry::jacobianInverse\n+JacobianInverse jacobianInverse(const LocalCoordinate &local) const\n+Obtain the Jacobian's inverse.\n+Definition multilineargeometry.hh:713\n+Dune::CachedMultiLinearGeometry::jacobianTransposed\n+JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const\n+obtain the transposed of the Jacobian\n+Definition multilineargeometry.hh:666\n+Dune::CachedMultiLinearGeometry::corner\n+GlobalCoordinate corner(int i) const\n+obtain coordinates of the i-th corner\n+Definition multilineargeometry.hh:275\n+Dune::CachedMultiLinearGeometry::volume\n+Volume volume() const\n+obtain the volume of the mapping's image\n+Definition multilineargeometry.hh:649\n+Dune::CachedMultiLinearGeometry::CachedMultiLinearGeometry\n+CachedMultiLinearGeometry(Dune::GeometryType gt, const CornerStorage\n+&cornerStorage)\n+Definition multilineargeometry.hh:559\n+Dune::CachedMultiLinearGeometry::integrationElement\n+ctype integrationElement(const LocalCoordinate &local) const\n+obtain the integration element\n+Definition multilineargeometry.hh:633\n+Dune::CachedMultiLinearGeometry::ctype\n+Base::ctype ctype\n+Definition multilineargeometry.hh:536\n+Dune::CachedMultiLinearGeometry::jacobian\n+Jacobian jacobian(const LocalCoordinate &local) const\n+Obtain the Jacobian.\n+Definition multilineargeometry.hh:702\n+Dune::CachedMultiLinearGeometry::JacobianInverseTransposed\n+Base::JacobianInverseTransposed JacobianInverseTransposed\n+Definition multilineargeometry.hh:546\n+Dune::CachedMultiLinearGeometry::JacobianTransposed\n+Base::JacobianTransposed JacobianTransposed\n+Definition multilineargeometry.hh:545\n+Dune::CachedMultiLinearGeometry::JacobianInverse\n+Base::JacobianInverse JacobianInverse\n+Definition multilineargeometry.hh:548\n+Dune::CachedMultiLinearGeometry::Jacobian\n+Base::Jacobian Jacobian\n+Definition multilineargeometry.hh:547\n+Dune::CachedMultiLinearGeometry::Volume\n+Base::Volume Volume\n+Definition multilineargeometry.hh:543\n+Dune::CachedMultiLinearGeometry::GlobalCoordinate\n+Base::GlobalCoordinate GlobalCoordinate\n+Definition multilineargeometry.hh:542\n+Dune::CachedMultiLinearGeometry::center\n+GlobalCoordinate center() const\n+obtain the centroid of the mapping's image\n+Definition multilineargeometry.hh:572\n+Dune::CachedMultiLinearGeometry::jacobianInverseTransposed\n+JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate\n+&local) const\n+obtain the transposed of the Jacobian's inverse\n+Definition multilineargeometry.hh:680\n Dune::GeometryType\n Unique label for each type of entities that can occur in DUNE grids.\n Definition type.hh:126\n-Dune::GeometryType::id\n-constexpr unsigned int id() const\n-Return the topology id of the type.\n-Definition type.hh:377\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00182.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00182.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: virtualrefinement.hh File Reference\n+dune-geometry: generalvertexorder.hh File Reference\n \n \n \n \n \n \n \n@@ -73,51 +73,49 @@\n
\n \n
\n \n-
virtualrefinement.hh File Reference
\n+
generalvertexorder.hh File Reference
\n
\n
\n-\n-

This file contains the virtual wrapper around refinement. \n-More...

\n-
#include <vector>
\n-#include <dune/common/fvector.hh>
\n-#include "refinement.hh"
\n+
#include <algorithm>
\n+#include <cassert>
\n+#include <cstddef>
\n+#include <iterator>
\n+#include <vector>
\n+#include <dune/common/iteratorfacades.hh>
\n #include "type.hh"
\n-#include "virtualrefinement.cc"
\n+#include <dune/geometry/referenceelements.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::VirtualRefinement< dimension, CoordType >
 VirtualRefinement base class. More...
class  Dune::GeneralVertexOrder< dim, Index_ >
 Class providing information on the ordering of vertices. More...
 
struct  Dune::VirtualRefinement< dimension, CoordType >::Codim< codimension >
 codim database of VirtualRefinement More...
class  Dune::GeneralVertexOrder< dim, Index_ >::iterator
 Iterate over the vertex indices of some sub-entity. More...
 
\n \n \n \n

\n Namespaces

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

\n Functions

template<int dimension, class CoordType >
VirtualRefinement< dimension, CoordType > & Dune::buildRefinement (GeometryType geometryType, GeometryType coerceTo)
 return a reference to the VirtualRefinement according to the parameters
 
template<class InIterator , class OutIterator >
void Dune::reduceOrder (const InIterator &inBegin, const InIterator &inEnd, OutIterator outIt)
 Algorithm to reduce vertex order information.
 
\n-

Detailed Description

\n-

This file contains the virtual wrapper around refinement.

\n-
\n+
\n \n
\n Generated by \"doxygen\"/ 1.9.8\n
\n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,38 +7,36 @@\n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n Classes | Namespaces | Functions\n-virtualrefinement.hh File Reference\n-This file contains the virtual wrapper around refinement. More...\n+generalvertexorder.hh File Reference\n+#include \n+#include \n+#include \n+#include \n #include \n-#include \n-#include \"refinement.hh\"\n+#include \n #include \"type.hh\"\n-#include \"virtualrefinement.cc\"\n+#include \n Go_to_the_source_code_of_this_file.\n Classes\n- class \u00a0Dune::VirtualRefinement<_dimension,_CoordType_>\n-\u00a0 VirtualRefinement base class. More...\n+class \u00a0Dune::GeneralVertexOrder<_dim,_Index__>\n+\u00a0 Class providing information on the ordering of vertices. More...\n \u00a0\n-struct \u00a0Dune::VirtualRefinement<_dimension,_CoordType_>::Codim<_codimension_>\n-\u00a0 codim database of VirtualRefinement More...\n+class \u00a0Dune::GeneralVertexOrder<_dim,_Index__>::iterator\n+\u00a0 Iterate over the vertex indices of some sub-entity. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n Functions\n-template\n-VirtualRefinement< dimension, CoordType > Dune::buildRefinement (GeometryType\n- &\u00a0geometryType, GeometryType coerceTo)\n- return a reference to the\n-\u00a0 VirtualRefinement according to the\n- parameters\n+template\n+void\u00a0Dune::reduceOrder (const InIterator &inBegin, const InIterator &inEnd,\n+ OutIterator outIt)\n+\u00a0 Algorithm to reduce vertex order information.\n \u00a0\n-***** Detailed Description *****\n-This file contains the virtual wrapper around refinement.\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00182_source.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00182_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: virtualrefinement.hh Source File\n+dune-geometry: generalvertexorder.hh Source File\n \n \n \n \n \n \n \n@@ -74,135 +74,187 @@\n \n
\n \n
\n \n
\n-
virtualrefinement.hh
\n+
generalvertexorder.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
\n
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
\n-
5#ifndef DUNE_GEOMETRY_VIRTUALREFINEMENT_HH
\n-
6#define DUNE_GEOMETRY_VIRTUALREFINEMENT_HH
\n-
7
\n-
268#include <vector>
\n-
269
\n-
270#include <dune/common/fvector.hh>
\n-
271
\n-
272#include "refinement.hh"
\n-
273#include "type.hh"
\n-
274
\n-
275namespace Dune
\n-
276{
\n-
277 // //////////////////////////////////////////
\n-
278 //
\n-
279 // The virtual base class and its iterators
\n-
280 //
\n-
281
\n-
282 //
\n-
283 // Refinement
\n-
284 //
\n-
285
\n-
292 template<int dimension, class CoordType>
\n-
\n-\n-
294 {
\n-
295 public:
\n-
296 template<int codimension>
\n-
297 struct Codim;
\n-\n-\n-
302
\n-
308 typedef FieldVector<CoordType, dimension> CoordVector;
\n-
314 typedef std::vector<int> IndexVector;
\n-
315
\n-
316 template<int codimension>
\n-\n-\n-\n-
320
\n-
326 virtual int nVertices(Dune::RefinementIntervals tag) const = 0;
\n-
327
\n-\n-
334
\n-\n-
341
\n-
347 virtual int nElements(Dune::RefinementIntervals tag) const = 0;
\n-
348
\n-\n-
355
\n-\n-
362
\n-
\n-\n-
365 {}
\n-
\n-
366
\n-
367 protected:
\n-\n-\n-\n-\n-
372 };
\n-
\n-
373
\n-
375 template<int dimension, class CoordType>
\n-
376 template<int codimension>
\n-
\n-
377 struct VirtualRefinement<dimension, CoordType>::Codim
\n-
378 {
\n-
379 class SubEntityIterator;
\n-
380 };
\n-
\n-
381
\n-
382 // ////////////////////////
\n-
383 //
\n-
384 // The refinement builder
\n-
385 //
\n-
386
\n-
387 template<int dimension, class CoordType>
\n-\n-
389 buildRefinement(GeometryType geometryType, GeometryType coerceTo);
\n-
390
\n-
391} // namespace Dune
\n-
392
\n-
393#include "virtualrefinement.cc"
\n-
394
\n-
395#endif // DUNE_GEOMETRY_VIRTUALREFINEMENT_HH
\n-
This file simply includes all Refinement implementations so you don't have to do them separately.
\n-
This file contains the virtual wrapper around refinement.
\n+
5
\n+
6#ifndef DUNE_GEOMETRY_GENERALVERTEXORDER_HH
\n+
7#define DUNE_GEOMETRY_GENERALVERTEXORDER_HH
\n+
8
\n+
9#include <algorithm>
\n+
10#include <cassert>
\n+
11#include <cstddef>
\n+
12#include <iterator>
\n+
13#include <vector>
\n+
14
\n+
15#include <dune/common/iteratorfacades.hh>
\n+
16
\n+
17#include "type.hh"
\n+\n+
19
\n+
20namespace Dune {
\n+
21
\n+
39 template<class InIterator, class OutIterator>
\n+
\n+
40 void reduceOrder(const InIterator& inBegin, const InIterator& inEnd,
\n+
41 OutIterator outIt)
\n+
42 {
\n+
43 for(InIterator inIt = inBegin; inIt != inEnd; ++inIt, ++outIt)
\n+
44 *outIt = std::count_if(inBegin, inEnd, [&](const auto& v)
\n+
45 {
\n+
46 return v < *inIt;
\n+
47 });
\n+
48 }
\n+
\n+
49
\n+
51
\n+
66 template<std::size_t dim, class Index_ = std::size_t>
\n+
\n+\n+
68 typedef ReferenceElements<double, dim> RefElems;
\n+
69 typedef typename RefElems::ReferenceElement RefElem;
\n+
70
\n+
71 RefElem refelem;
\n+
72 GeometryType gt;
\n+
73 std::vector<Index_> vertexOrder;
\n+
74
\n+
75 public:
\n+
77 typedef Index_ Index;
\n+
78
\n+
80 class iterator;
\n+
81
\n+
83 static const std::size_t dimension = dim;
\n+
85 const GeometryType &type() const { return gt; }
\n+
86
\n+
88
\n+
96 template<class InIterator>
\n+
\n+
97 GeneralVertexOrder(const GeometryType& gt_, const InIterator &inBegin,
\n+
98 const InIterator &inEnd) :
\n+
99 refelem(RefElems::general(gt_)), gt(gt_),
\n+
100 vertexOrder(refelem.size(dim))
\n+
101 { reduceOrder(inBegin, inEnd, vertexOrder.begin()); }
\n+
\n+
102
\n+
104
\n+
\n+
108 iterator begin(std::size_t codim, std::size_t subEntity) const
\n+
109 { return iterator(*this, codim, subEntity); }
\n+
\n+
111
\n+
\n+
115 iterator end(std::size_t codim, std::size_t subEntity) const {
\n+
116 return iterator(*this, codim, subEntity,
\n+
117 refelem.size(subEntity, codim, dim));
\n+
118 }
\n+
\n+
119
\n+
121
\n+
\n+
128 void getReduced(std::size_t codim, std::size_t subEntity,
\n+
129 std::vector<Index>& order) const
\n+
130 {
\n+
131 order.resize(refelem.size(subEntity, codim, dim));
\n+
132 reduceOrder(begin(codim, subEntity), end(codim, subEntity),
\n+
133 order.begin());
\n+
134 }
\n+
\n+
135 };
\n+
\n+
136
\n+
138
\n+
141 template<std::size_t dim, class Index_>
\n+
\n+
142 class GeneralVertexOrder<dim, Index_>::iterator :
\n+
143 public Dune::RandomAccessIteratorFacade<iterator, const Index_>
\n+
144 {
\n+
145 const GeneralVertexOrder *order;
\n+
146 std::size_t codim;
\n+
147 std::size_t subEntity;
\n+
148 std::size_t vertex;
\n+
149
\n+
150 iterator(const GeneralVertexOrder &order_, std::size_t codim_,
\n+
151 std::size_t subEntity_, std::size_t vertex_ = 0) :
\n+
152 order(&order_), codim(codim_), subEntity(subEntity_), vertex(vertex_)
\n+
153 { }
\n+
154
\n+
155 public:
\n+
\n+
156 const Index &dereference() const {
\n+
157 return order->vertexOrder[order->refelem.subEntity(subEntity, codim,
\n+
158 vertex, dim)];
\n+
159 }
\n+
\n+
\n+
160 const Index &elementAt(std::ptrdiff_t n) const {
\n+
161 return order->vertexOrder[order->refelem.subEntity(subEntity, codim,
\n+
162 vertex+n, dim)];
\n+
163 }
\n+
\n+
\n+
164 bool equals(const iterator &other) const {
\n+
165 return order == other.order && codim == other.codim &&
\n+
166 subEntity == other.subEntity && vertex == other.vertex;
\n+
167 }
\n+
\n+
168 void increment() { ++vertex; }
\n+
169 void decrement() { --vertex; }
\n+
170 void advance(std::ptrdiff_t n) { vertex += n; }
\n+
\n+
171 std::ptrdiff_t distanceTo(const iterator &other) const {
\n+
172 // make sure we reference the same container
\n+
173 assert(order == other.order && codim == other.codim &&
\n+
174 subEntity == other.subEntity);
\n+
175 if(vertex < other.vertex) return other.vertex - vertex;
\n+
176 else return -static_cast<std::ptrdiff_t>(vertex - other.vertex);
\n+
177 }
\n+
\n+
178
\n+
179 friend class GeneralVertexOrder<dim, Index>;
\n+
180
\n+
182
\n+\n+
188 };
\n+
\n+
189} // namespace Dune
\n+
190
\n+
191#endif // DUNE_GEOMETRY_GENERALVERTEXORDER_HH
\n
A unique label for each type of element that can occur in a grid.
\n+\n
Definition affinegeometry.hh:21
\n-
VirtualRefinement< dimension, CoordType > & buildRefinement(GeometryType geometryType, GeometryType coerceTo)
return a reference to the VirtualRefinement according to the parameters
Definition virtualrefinement.cc:503
\n-
Holds the number of refined intervals per axis needed for virtual and static refinement.
Definition base.cc:94
\n+
void reduceOrder(const InIterator &inBegin, const InIterator &inEnd, OutIterator outIt)
Algorithm to reduce vertex order information.
Definition generalvertexorder.hh:40
\n+
Class providing access to the singletons of the reference elements.
Definition referenceelements.hh:170
\n+
typename Container::ReferenceElement ReferenceElement
The reference element type.
Definition referenceelements.hh:188
\n+
Class providing information on the ordering of vertices.
Definition generalvertexorder.hh:67
\n+
Index_ Index
Type of indices.
Definition generalvertexorder.hh:77
\n+
const GeometryType & type() const
get type of the entity's geometry
Definition generalvertexorder.hh:85
\n+
static const std::size_t dimension
export the dimension of the entity we provide information for
Definition generalvertexorder.hh:83
\n+
void getReduced(std::size_t codim, std::size_t subEntity, std::vector< Index > &order) const
get a vector of reduced indices for some sub-entity
Definition generalvertexorder.hh:128
\n+
iterator end(std::size_t codim, std::size_t subEntity) const
get end iterator for the vertex indices of some sub-entity
Definition generalvertexorder.hh:115
\n+
GeneralVertexOrder(const GeometryType &gt_, const InIterator &inBegin, const InIterator &inEnd)
construct a GeneralVertexOrder
Definition generalvertexorder.hh:97
\n+
iterator begin(std::size_t codim, std::size_t subEntity) const
get begin iterator for the vertex indices of some sub-entity
Definition generalvertexorder.hh:108
\n+
Iterate over the vertex indices of some sub-entity.
Definition generalvertexorder.hh:144
\n+
iterator()
public default constructor
Definition generalvertexorder.hh:187
\n+
void decrement()
Definition generalvertexorder.hh:169
\n+
void advance(std::ptrdiff_t n)
Definition generalvertexorder.hh:170
\n+
const Index & dereference() const
Definition generalvertexorder.hh:156
\n+
void increment()
Definition generalvertexorder.hh:168
\n+
bool equals(const iterator &other) const
Definition generalvertexorder.hh:164
\n+
std::ptrdiff_t distanceTo(const iterator &other) const
Definition generalvertexorder.hh:171
\n+
const Index & elementAt(std::ptrdiff_t n) const
Definition generalvertexorder.hh:160
\n
Unique label for each type of entities that can occur in DUNE grids.
Definition type.hh:126
\n-
Definition virtualrefinement.cc:231
\n-
VirtualRefinement base class.
Definition virtualrefinement.hh:294
\n-
SubEntityIteratorBack< dimension > VertexIteratorBack
Definition virtualrefinement.hh:318
\n-
virtual ElementIteratorBack * eEndBack(Dune::RefinementIntervals tag) const =0
\n-
VertexIterator vBegin(Dune::RefinementIntervals tag) const
Get an VertexIterator.
Definition virtualrefinement.cc:38
\n-
ElementIterator eBegin(Dune::RefinementIntervals tag) const
Get an ElementIterator.
Definition virtualrefinement.cc:54
\n-
virtual int nElements(Dune::RefinementIntervals tag) const =0
Get the number of Elements.
\n-
ElementIterator eEnd(Dune::RefinementIntervals tag) const
Get an ElementIterator.
Definition virtualrefinement.cc:62
\n-
Codim< 0 >::SubEntityIterator ElementIterator
The ElementIterator of the VirtualRefinement.
Definition virtualrefinement.hh:301
\n-
virtual ~VirtualRefinement()
Destructor.
Definition virtualrefinement.hh:364
\n-
VertexIterator vEnd(Dune::RefinementIntervals tag) const
Get an VertexIterator.
Definition virtualrefinement.cc:46
\n-
FieldVector< CoordType, dimension > CoordVector
The CoordVector of the VirtualRefinement.
Definition virtualrefinement.hh:308
\n-
virtual int nVertices(Dune::RefinementIntervals tag) const =0
Get the number of Vertices.
\n-
std::vector< int > IndexVector
The IndexVector of the VirtualRefinement.
Definition virtualrefinement.hh:314
\n-
Codim< dimension >::SubEntityIterator VertexIterator
The VertexIterator of the VirtualRefinement.
Definition virtualrefinement.hh:299
\n-
virtual VertexIteratorBack * vEndBack(Dune::RefinementIntervals tag) const =0
\n-
SubEntityIteratorBack< 0 > ElementIteratorBack
Definition virtualrefinement.hh:319
\n-
virtual ElementIteratorBack * eBeginBack(Dune::RefinementIntervals tag) const =0
\n-
virtual VertexIteratorBack * vBeginBack(Dune::RefinementIntervals tag) const =0
\n-
codim database of VirtualRefinement
Definition virtualrefinement.hh:378
\n
\n \n
\n Generated by \"doxygen\"/ 1.9.8\n
\n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,188 +7,218 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n-virtualrefinement.hh\n+generalvertexorder.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file\n LICENSE.md in module root\n 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n- 5#ifndef DUNE_GEOMETRY_VIRTUALREFINEMENT_HH\n- 6#define DUNE_GEOMETRY_VIRTUALREFINEMENT_HH\n- 7\n- 268#include \n- 269\n- 270#include \n- 271\n- 272#include \"refinement.hh\"\n- 273#include \"type.hh\"\n- 274\n- 275namespace Dune\n- 276{\n- 277 // //////////////////////////////////////////\n- 278 //\n- 279 // The virtual base class and its iterators\n- 280 //\n- 281\n- 282 //\n- 283 // Refinement\n- 284 //\n- 285\n- 292 template\n-293 class VirtualRefinement\n- 294 {\n- 295 public:\n- 296 template\n- 297 struct Codim;\n-299 typedef typename Codim::SubEntityIterator VertexIterator;\n-301 typedef typename Codim<0>::SubEntityIterator ElementIterator;\n- 302\n-308 typedef FieldVector CoordVector;\n-314 typedef std::vector IndexVector;\n- 315\n- 316 template\n- 317 class SubEntityIteratorBack;\n-318 typedef SubEntityIteratorBack VertexIteratorBack;\n-319 typedef SubEntityIteratorBack<0> ElementIteratorBack;\n- 320\n-326 virtual int nVertices(Dune::RefinementIntervals tag) const = 0;\n- 327\n- 333 VertexIterator vBegin(Dune::RefinementIntervals tag) const;\n- 334\n- 340 VertexIterator vEnd(Dune::RefinementIntervals tag) const;\n- 341\n-347 virtual int nElements(Dune::RefinementIntervals tag) const = 0;\n- 348\n- 354 ElementIterator eBegin(Dune::RefinementIntervals tag) const;\n- 355\n- 361 ElementIterator eEnd(Dune::RefinementIntervals tag) const;\n- 362\n-364 virtual ~VirtualRefinement()\n- 365 {}\n- 366\n- 367 protected:\n-368 virtual VertexIteratorBack *vBeginBack(Dune::RefinementIntervals tag) const\n-= 0;\n-369 virtual VertexIteratorBack *vEndBack(Dune::RefinementIntervals tag) const =\n-0;\n-370 virtual ElementIteratorBack *eBeginBack(Dune::RefinementIntervals tag)\n-const = 0;\n-371 virtual ElementIteratorBack *eEndBack(Dune::RefinementIntervals tag) const\n-= 0;\n- 372 };\n- 373\n- 375 template\n- 376 template\n-377 struct VirtualRefinement::Codim\n- 378 {\n- 379 class SubEntityIterator;\n- 380 };\n- 381\n- 382 // ////////////////////////\n- 383 //\n- 384 // The refinement builder\n- 385 //\n- 386\n- 387 template\n- 388 VirtualRefinement &\n- 389 buildRefinement(GeometryType geometryType, GeometryType coerceTo);\n- 390\n- 391} // namespace Dune\n- 392\n- 393#include \"virtualrefinement.cc\"\n- 394\n- 395#endif // DUNE_GEOMETRY_VIRTUALREFINEMENT_HH\n-refinement.hh\n-This file simply includes all Refinement implementations so you don't have to\n-do them separately.\n-virtualrefinement.cc\n-This file contains the virtual wrapper around refinement.\n+ 5\n+ 6#ifndef DUNE_GEOMETRY_GENERALVERTEXORDER_HH\n+ 7#define DUNE_GEOMETRY_GENERALVERTEXORDER_HH\n+ 8\n+ 9#include \n+ 10#include \n+ 11#include \n+ 12#include \n+ 13#include \n+ 14\n+ 15#include \n+ 16\n+ 17#include \"type.hh\"\n+ 18#include \n+ 19\n+ 20namespace Dune {\n+ 21\n+ 39 template\n+40 void reduceOrder(const InIterator& inBegin, const InIterator& inEnd,\n+ 41 OutIterator outIt)\n+ 42 {\n+ 43 for(InIterator inIt = inBegin; inIt != inEnd; ++inIt, ++outIt)\n+ 44 *outIt = std::count_if(inBegin, inEnd, [&](const auto& v)\n+ 45 {\n+ 46 return v < *inIt;\n+ 47 });\n+ 48 }\n+ 49\n+ 51\n+ 66 template\n+67 class GeneralVertexOrder {\n+ 68 typedef ReferenceElements RefElems;\n+ 69 typedef typename RefElems::ReferenceElement RefElem;\n+ 70\n+ 71 RefElem refelem;\n+ 72 GeometryType gt;\n+ 73 std::vector vertexOrder;\n+ 74\n+ 75 public:\n+77 typedef Index_ Index;\n+ 78\n+ 80 class iterator;\n+ 81\n+83 static const std::size_t dimension = dim;\n+85 const GeometryType &type() const { return gt; }\n+ 86\n+ 88\n+ 96 template\n+97 GeneralVertexOrder(const GeometryType& gt_, const InIterator &inBegin,\n+ 98 const InIterator &inEnd) :\n+ 99 refelem(RefElems::general(gt_)), gt(gt_),\n+ 100 vertexOrder(refelem.size(dim))\n+ 101 { reduceOrder(inBegin, inEnd, vertexOrder.begin()); }\n+ 102\n+ 104\n+108 iterator begin(std::size_t codim, std::size_t subEntity) const\n+ 109 { return iterator(*this, codim, subEntity); }\n+ 111\n+115 iterator end(std::size_t codim, std::size_t subEntity) const {\n+ 116 return iterator(*this, codim, subEntity,\n+ 117 refelem.size(subEntity, codim, dim));\n+ 118 }\n+ 119\n+ 121\n+128 void getReduced(std::size_t codim, std::size_t subEntity,\n+ 129 std::vector& order) const\n+ 130 {\n+ 131 order.resize(refelem.size(subEntity, codim, dim));\n+ 132 reduceOrder(begin(codim, subEntity), end(codim, subEntity),\n+ 133 order.begin());\n+ 134 }\n+ 135 };\n+ 136\n+ 138\n+ 141 template\n+142 class GeneralVertexOrder::iterator :\n+ 143 public Dune::RandomAccessIteratorFacade\n+ 144 {\n+ 145 const GeneralVertexOrder *order;\n+ 146 std::size_t codim;\n+ 147 std::size_t subEntity;\n+ 148 std::size_t vertex;\n+ 149\n+ 150 iterator(const GeneralVertexOrder &order_, std::size_t codim_,\n+ 151 std::size_t subEntity_, std::size_t vertex_ = 0) :\n+ 152 order(&order_), codim(codim_), subEntity(subEntity_), vertex(vertex_)\n+ 153 { }\n+ 154\n+ 155 public:\n+156 const Index &dereference() const {\n+ 157 return order->vertexOrder[order->refelem.subEntity(subEntity, codim,\n+ 158 vertex, dim)];\n+ 159 }\n+160 const Index &elementAt(std::ptrdiff_t n) const {\n+ 161 return order->vertexOrder[order->refelem.subEntity(subEntity, codim,\n+ 162 vertex+n, dim)];\n+ 163 }\n+164 bool equals(const iterator &other) const {\n+ 165 return order == other.order && codim == other.codim &&\n+ 166 subEntity == other.subEntity && vertex == other.vertex;\n+ 167 }\n+168 void increment() { ++vertex; }\n+169 void decrement() { --vertex; }\n+170 void advance(std::ptrdiff_t n) { vertex += n; }\n+171 std::ptrdiff_t distanceTo(const iterator &other) const {\n+ 172 // make sure we reference the same container\n+ 173 assert(order == other.order && codim == other.codim &&\n+ 174 subEntity == other.subEntity);\n+ 175 if(vertex < other.vertex) return other.vertex - vertex;\n+ 176 else return -static_cast(vertex - other.vertex);\n+ 177 }\n+ 178\n+ 179 friend class GeneralVertexOrder;\n+ 180\n+ 182\n+187 iterator() { }\n+ 188 };\n+ 189} // namespace Dune\n+ 190\n+ 191#endif // DUNE_GEOMETRY_GENERALVERTEXORDER_HH\n type.hh\n A unique label for each type of element that can occur in a grid.\n+referenceelements.hh\n Dune\n Definition affinegeometry.hh:21\n-Dune::buildRefinement\n-VirtualRefinement< dimension, CoordType > & buildRefinement(GeometryType\n-geometryType, GeometryType coerceTo)\n-return a reference to the VirtualRefinement according to the parameters\n-Definition virtualrefinement.cc:503\n-Dune::RefinementIntervals\n-Holds the number of refined intervals per axis needed for virtual and static\n-refinement.\n-Definition base.cc:94\n+Dune::reduceOrder\n+void reduceOrder(const InIterator &inBegin, const InIterator &inEnd,\n+OutIterator outIt)\n+Algorithm to reduce vertex order information.\n+Definition generalvertexorder.hh:40\n+Dune::Geo::ReferenceElements\n+Class providing access to the singletons of the reference elements.\n+Definition referenceelements.hh:170\n+Dune::Geo::ReferenceElements::ReferenceElement\n+typename Container::ReferenceElement ReferenceElement\n+The reference element type.\n+Definition referenceelements.hh:188\n+Dune::GeneralVertexOrder\n+Class providing information on the ordering of vertices.\n+Definition generalvertexorder.hh:67\n+Dune::GeneralVertexOrder::Index\n+Index_ Index\n+Type of indices.\n+Definition generalvertexorder.hh:77\n+Dune::GeneralVertexOrder::type\n+const GeometryType & type() const\n+get type of the entity's geometry\n+Definition generalvertexorder.hh:85\n+Dune::GeneralVertexOrder::dimension\n+static const std::size_t dimension\n+export the dimension of the entity we provide information for\n+Definition generalvertexorder.hh:83\n+Dune::GeneralVertexOrder::getReduced\n+void getReduced(std::size_t codim, std::size_t subEntity, std::vector< Index >\n+&order) const\n+get a vector of reduced indices for some sub-entity\n+Definition generalvertexorder.hh:128\n+Dune::GeneralVertexOrder::end\n+iterator end(std::size_t codim, std::size_t subEntity) const\n+get end iterator for the vertex indices of some sub-entity\n+Definition generalvertexorder.hh:115\n+Dune::GeneralVertexOrder::GeneralVertexOrder\n+GeneralVertexOrder(const GeometryType >_, const InIterator &inBegin, const\n+InIterator &inEnd)\n+construct a GeneralVertexOrder\n+Definition generalvertexorder.hh:97\n+Dune::GeneralVertexOrder::begin\n+iterator begin(std::size_t codim, std::size_t subEntity) const\n+get begin iterator for the vertex indices of some sub-entity\n+Definition generalvertexorder.hh:108\n+Dune::GeneralVertexOrder::iterator\n+Iterate over the vertex indices of some sub-entity.\n+Definition generalvertexorder.hh:144\n+Dune::GeneralVertexOrder::iterator::iterator\n+iterator()\n+public default constructor\n+Definition generalvertexorder.hh:187\n+Dune::GeneralVertexOrder::iterator::decrement\n+void decrement()\n+Definition generalvertexorder.hh:169\n+Dune::GeneralVertexOrder::iterator::advance\n+void advance(std::ptrdiff_t n)\n+Definition generalvertexorder.hh:170\n+Dune::GeneralVertexOrder::iterator::dereference\n+const Index & dereference() const\n+Definition generalvertexorder.hh:156\n+Dune::GeneralVertexOrder::iterator::increment\n+void increment()\n+Definition generalvertexorder.hh:168\n+Dune::GeneralVertexOrder::iterator::equals\n+bool equals(const iterator &other) const\n+Definition generalvertexorder.hh:164\n+Dune::GeneralVertexOrder::iterator::distanceTo\n+std::ptrdiff_t distanceTo(const iterator &other) const\n+Definition generalvertexorder.hh:171\n+Dune::GeneralVertexOrder::iterator::elementAt\n+const Index & elementAt(std::ptrdiff_t n) const\n+Definition generalvertexorder.hh:160\n Dune::GeometryType\n Unique label for each type of entities that can occur in DUNE grids.\n Definition type.hh:126\n-Dune::VirtualRefinement::SubEntityIteratorBack\n-Definition virtualrefinement.cc:231\n-Dune::VirtualRefinement\n-VirtualRefinement base class.\n-Definition virtualrefinement.hh:294\n-Dune::VirtualRefinement::VertexIteratorBack\n-SubEntityIteratorBack< dimension > VertexIteratorBack\n-Definition virtualrefinement.hh:318\n-Dune::VirtualRefinement::eEndBack\n-virtual ElementIteratorBack * eEndBack(Dune::RefinementIntervals tag) const =0\n-Dune::VirtualRefinement::vBegin\n-VertexIterator vBegin(Dune::RefinementIntervals tag) const\n-Get an VertexIterator.\n-Definition virtualrefinement.cc:38\n-Dune::VirtualRefinement::eBegin\n-ElementIterator eBegin(Dune::RefinementIntervals tag) const\n-Get an ElementIterator.\n-Definition virtualrefinement.cc:54\n-Dune::VirtualRefinement::nElements\n-virtual int nElements(Dune::RefinementIntervals tag) const =0\n-Get the number of Elements.\n-Dune::VirtualRefinement::eEnd\n-ElementIterator eEnd(Dune::RefinementIntervals tag) const\n-Get an ElementIterator.\n-Definition virtualrefinement.cc:62\n-Dune::VirtualRefinement::ElementIterator\n-Codim< 0 >::SubEntityIterator ElementIterator\n-The ElementIterator of the VirtualRefinement.\n-Definition virtualrefinement.hh:301\n-Dune::VirtualRefinement::~VirtualRefinement\n-virtual ~VirtualRefinement()\n-Destructor.\n-Definition virtualrefinement.hh:364\n-Dune::VirtualRefinement::vEnd\n-VertexIterator vEnd(Dune::RefinementIntervals tag) const\n-Get an VertexIterator.\n-Definition virtualrefinement.cc:46\n-Dune::VirtualRefinement::CoordVector\n-FieldVector< CoordType, dimension > CoordVector\n-The CoordVector of the VirtualRefinement.\n-Definition virtualrefinement.hh:308\n-Dune::VirtualRefinement::nVertices\n-virtual int nVertices(Dune::RefinementIntervals tag) const =0\n-Get the number of Vertices.\n-Dune::VirtualRefinement::IndexVector\n-std::vector< int > IndexVector\n-The IndexVector of the VirtualRefinement.\n-Definition virtualrefinement.hh:314\n-Dune::VirtualRefinement::VertexIterator\n-Codim< dimension >::SubEntityIterator VertexIterator\n-The VertexIterator of the VirtualRefinement.\n-Definition virtualrefinement.hh:299\n-Dune::VirtualRefinement::vEndBack\n-virtual VertexIteratorBack * vEndBack(Dune::RefinementIntervals tag) const =0\n-Dune::VirtualRefinement::ElementIteratorBack\n-SubEntityIteratorBack< 0 > ElementIteratorBack\n-Definition virtualrefinement.hh:319\n-Dune::VirtualRefinement::eBeginBack\n-virtual ElementIteratorBack * eBeginBack(Dune::RefinementIntervals tag) const\n-=0\n-Dune::VirtualRefinement::vBeginBack\n-virtual VertexIteratorBack * vBeginBack(Dune::RefinementIntervals tag) const =0\n-Dune::VirtualRefinement::Codim\n-codim database of VirtualRefinement\n-Definition virtualrefinement.hh:378\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00185.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00185.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: referenceelementimplementation.cc File Reference\n+dune-geometry: affinegeometry.hh File Reference\n \n \n \n \n \n \n \n@@ -70,28 +70,45 @@\n
\n \n
\n \n
\n \n-
referenceelementimplementation.cc File Reference
\n+
affinegeometry.hh File Reference
\n
\n
\n-
#include <config.h>
\n-#include <dune/geometry/referenceelementimplementation.hh>
\n-
\n+\n+

An implementation of the Geometry interface for affine geometries. \n+More...

\n+
#include <cmath>
\n+#include <dune/common/fmatrix.hh>
\n+#include <dune/common/fvector.hh>
\n+#include <dune/geometry/type.hh>
\n+
\n+

Go to the source code of this file.

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

\n+Classes

class  Dune::AffineGeometry< ct, mydim, cdim >
 Implementation of the Geometry interface for affine geometries. More...
 
\n \n \n \n \n \n

\n Namespaces

namespace  Dune
 
namespace  Dune::Geo
 
\n-
\n+

Detailed Description

\n+

An implementation of the Geometry interface for affine geometries.

\n+
Author
Martin Nolte
\n+
\n \n
\n Generated by \"doxygen\"/ 1.9.8\n
\n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,19 +6,31 @@\n dune-geometry\u00a02.9.0\n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n-Namespaces\n-referenceelementimplementation.cc File Reference\n-#include \n-#include \n+Classes | Namespaces\n+affinegeometry.hh File Reference\n+An implementation of the Geometry interface for affine geometries. More...\n+#include \n+#include \n+#include \n+#include \n+Go_to_the_source_code_of_this_file.\n+ Classes\n+class \u00a0Dune::AffineGeometry<_ct,_mydim,_cdim_>\n+\u00a0 Implementation of the Geometry interface for affine geometries. More...\n+\u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Geo\n \u00a0\n+***** Detailed Description *****\n+An implementation of the Geometry interface for affine geometries.\n+ Author\n+ Martin Nolte\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00188.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00188.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: virtualrefinement.cc File Reference\n+dune-geometry: virtualrefinement.hh File Reference\n \n \n \n \n \n \n \n@@ -72,95 +72,52 @@\n
  • dune
  • geometry
  • \n \n \n
    \n \n-
    virtualrefinement.cc File Reference
    \n+
    virtualrefinement.hh File Reference
    \n
    \n
    \n \n

    This file contains the virtual wrapper around refinement. \n More...

    \n-
    #include <cassert>
    \n-#include <typeinfo>
    \n-#include <dune/common/exceptions.hh>
    \n+
    #include <vector>
    \n #include <dune/common/fvector.hh>
    \n-#include <dune/common/iteratorfacades.hh>
    \n+#include "refinement.hh"
    \n #include "type.hh"
    \n-#include "refinement.hh"
    \n+#include "virtualrefinement.cc"
    \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 Classes

    class  Dune::VirtualRefinementSubEntityIteratorSpecial< dimension, CoordType, dimension >
    class  Dune::VirtualRefinement< dimension, CoordType >
     VirtualRefinement base class. More...
     
    class  Dune::VirtualRefinementSubEntityIteratorSpecial< dimension, CoordType, 0 >
     
    class  Dune::VirtualRefinement< dimension, CoordType >::Codim< codimension >
     
    class  Dune::VirtualRefinementSubEntityIteratorBackSpecial< dimension, CoordType, dimension >
     
    class  Dune::VirtualRefinementSubEntityIteratorBackSpecial< dimension, CoordType, 0 >
     
    class  Dune::VirtualRefinement< dimension, CoordType >::SubEntityIteratorBack< dimension, CoordType >
     
    class  Dune::VirtualRefinementImp< topologyId, CoordType, coerceToId, dimension >
     
    class  Dune::VirtualRefinementImpSubEntityIteratorBackSpecial< topologyId, CoordType, coerceToId, dimension, dimension >
     
    class  Dune::VirtualRefinementImpSubEntityIteratorBackSpecial< topologyId, CoordType, coerceToId, dimension, 0 >
     
    class  Dune::VirtualRefinementImp< topologyId, CoordType, coerceToId, dimension >::SubEntityIteratorBack< codimension >
     
    class  Dune::RefinementBuilder< dimension, CoordType >
     
    class  Dune::RefinementBuilder< 1, CoordType >
     
    class  Dune::RefinementBuilder< 3, CoordType >
    struct  Dune::VirtualRefinement< dimension, CoordType >::Codim< codimension >
     codim database of VirtualRefinement More...
     
    \n \n \n \n

    \n Namespaces

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

    \n-Macros

    #define DUNE_GEOMETRY_VIRTUALREFINEMENT_CC
     
    \n \n \n \n \n \n

    \n Functions

    template<int dimension, class CoordType >
    VirtualRefinement< dimension, CoordType > & Dune::buildRefinement (GeometryType geometryType, GeometryType coerceTo)
     return a reference to the VirtualRefinement according to the parameters
     
    \n

    Detailed Description

    \n

    This file contains the virtual wrapper around refinement.

    \n-

    Macro Definition Documentation

    \n-\n-

    ◆ DUNE_GEOMETRY_VIRTUALREFINEMENT_CC

    \n-\n-
    \n-
    \n- \n- \n- \n- \n-
    #define DUNE_GEOMETRY_VIRTUALREFINEMENT_CC
    \n-
    \n-\n-
    \n-
    \n-
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,76 +6,39 @@\n dune-geometry\u00a02.9.0\n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n-Classes | Namespaces | Macros | Functions\n-virtualrefinement.cc File Reference\n+Classes | Namespaces | Functions\n+virtualrefinement.hh File Reference\n This file contains the virtual wrapper around refinement. More...\n-#include \n-#include \n-#include \n+#include \n #include \n-#include \n-#include \"type.hh\"\n #include \"refinement.hh\"\n+#include \"type.hh\"\n+#include \"virtualrefinement.cc\"\n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::VirtualRefinementSubEntityIteratorSpecial<_dimension,_CoordType,\n- dimension_>\n-\u00a0\n-class \u00a0Dune::VirtualRefinementSubEntityIteratorSpecial<_dimension,_CoordType,\n- 0_>\n-\u00a0\n-class \u00a0Dune::VirtualRefinement<_dimension,_CoordType_>::Codim<_codimension_>\n-\u00a0\n-class \u00a0Dune::VirtualRefinementSubEntityIteratorBackSpecial<_dimension,\n- CoordType,_dimension_>\n-\u00a0\n-class \u00a0Dune::VirtualRefinementSubEntityIteratorBackSpecial<_dimension,\n- CoordType,_0_>\n-\u00a0\n-class \u00a0Dune::VirtualRefinement<_dimension,_CoordType_>::SubEntityIteratorBack<\n- dimension,_CoordType_>\n+ class \u00a0Dune::VirtualRefinement<_dimension,_CoordType_>\n+\u00a0 VirtualRefinement base class. More...\n \u00a0\n-class \u00a0Dune::VirtualRefinementImp<_topologyId,_CoordType,_coerceToId,\n- dimension_>\n-\u00a0\n-class \u00a0Dune::VirtualRefinementImpSubEntityIteratorBackSpecial<_topologyId,\n- CoordType,_coerceToId,_dimension,_dimension_>\n-\u00a0\n-class \u00a0Dune::VirtualRefinementImpSubEntityIteratorBackSpecial<_topologyId,\n- CoordType,_coerceToId,_dimension,_0_>\n-\u00a0\n-class \u00a0Dune::VirtualRefinementImp<_topologyId,_CoordType,_coerceToId,\n- dimension_>::SubEntityIteratorBack<_codimension_>\n-\u00a0\n-class \u00a0Dune::RefinementBuilder<_dimension,_CoordType_>\n-\u00a0\n-class \u00a0Dune::RefinementBuilder<_1,_CoordType_>\n-\u00a0\n-class \u00a0Dune::RefinementBuilder<_3,_CoordType_>\n+struct \u00a0Dune::VirtualRefinement<_dimension,_CoordType_>::Codim<_codimension_>\n+\u00a0 codim database of VirtualRefinement More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n- Macros\n-#define\u00a0DUNE_GEOMETRY_VIRTUALREFINEMENT_CC\n-\u00a0\n Functions\n template\n VirtualRefinement< dimension, CoordType > Dune::buildRefinement (GeometryType\n &\u00a0geometryType, GeometryType coerceTo)\n return a reference to the\n \u00a0 VirtualRefinement according to the\n parameters\n \u00a0\n ***** Detailed Description *****\n This file contains the virtual wrapper around refinement.\n-***** Macro Definition Documentation *****\n-***** \u25c6\u00a0DUNE_GEOMETRY_VIRTUALREFINEMENT_CC *****\n-#define DUNE_GEOMETRY_VIRTUALREFINEMENT_CC\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00188_source.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00188_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: virtualrefinement.cc Source File\n+dune-geometry: virtualrefinement.hh Source File\n \n \n \n \n \n \n \n@@ -74,816 +74,134 @@\n \n
    \n \n
    \n \n
    \n-
    virtualrefinement.cc
    \n+
    virtualrefinement.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
    \n
    4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n-
    5
    \n-
    6#ifndef DUNE_GEOMETRY_VIRTUALREFINEMENT_CC
    \n-
    7#define DUNE_GEOMETRY_VIRTUALREFINEMENT_CC
    \n-
    8
    \n-
    14#include <cassert>
    \n-
    15#include <typeinfo>
    \n-
    16
    \n-
    17#include <dune/common/exceptions.hh>
    \n-
    18#include <dune/common/fvector.hh>
    \n-
    19#include <dune/common/iteratorfacades.hh>
    \n-
    20
    \n-
    21#include "type.hh"
    \n-
    22#include "refinement.hh"
    \n-
    23
    \n-
    24namespace Dune
    \n-
    25{
    \n-
    26 // //////////////////////////////////////////
    \n-
    27 //
    \n-
    28 // The virtual base class and its iterators
    \n-
    29 //
    \n-
    30
    \n-
    31 //
    \n-
    32 // Refinement
    \n-
    33 //
    \n-
    34
    \n-
    35 template<int dimension, class CoordType>
    \n-\n-
    \n-\n-\n-
    39 {
    \n-
    40 return VertexIterator(vBeginBack(tag));
    \n-
    41 }
    \n-
    \n-
    42
    \n-
    43 template<int dimension, class CoordType>
    \n-\n-
    \n-\n-\n-
    47 {
    \n-
    48 return VertexIterator(vEndBack(tag));
    \n-
    49 }
    \n-
    \n-
    50
    \n-
    51 template<int dimension, class CoordType>
    \n-\n-
    \n-\n-\n-
    55 {
    \n-
    56 return ElementIterator(eBeginBack(tag));
    \n-
    57 }
    \n-
    \n-
    58
    \n-
    59 template<int dimension, class CoordType>
    \n-\n-
    \n-\n-\n-
    63 {
    \n-
    64 return ElementIterator(eEndBack(tag));
    \n-
    65 }
    \n-
    \n-
    66
    \n-
    67 //
    \n-
    68 // The iterators
    \n-
    69 //
    \n-
    70
    \n-
    71 template<int dimension, class CoordType, int codimension>
    \n-\n-
    73
    \n-
    74 // The iterator for vertices
    \n-
    75 template<int dimension, class CoordType>
    \n-
    \n-
    76 class VirtualRefinementSubEntityIteratorSpecial<dimension, CoordType, dimension>
    \n-
    77 {};
    \n-
    \n-
    78
    \n-
    79 // The iterator for elements
    \n-
    80 template<int dimension, class CoordType>
    \n-
    \n-
    81 class VirtualRefinementSubEntityIteratorSpecial<dimension, CoordType, 0>
    \n-
    82 {
    \n-
    83 public:
    \n-\n-
    85 typedef typename Refinement::template Codim<0>::SubEntityIterator Common;
    \n-
    86 typedef typename Refinement::IndexVector IndexVector;
    \n-
    87
    \n-
    88 IndexVector vertexIndices() const;
    \n-
    89 };
    \n-
    \n-
    90
    \n-
    91 template<int dimension, class CoordType>
    \n-\n-
    \n-\n-
    94 vertexIndices() const
    \n-
    95 {
    \n-
    96 return static_cast<const Common *>(this)->backend->vertexIndices();
    \n-
    97 }
    \n-
    \n-
    98
    \n-
    99 // The iterator common stuff
    \n-
    100 template<int dimension, class CoordType>
    \n-
    101 template<int codimension>
    \n-
    \n-
    102 class VirtualRefinement<dimension, CoordType>::Codim<codimension>::SubEntityIterator
    \n-
    103 : public ForwardIteratorFacade<typename VirtualRefinement<dimension, CoordType>::template Codim<codimension>::SubEntityIterator, int>,
    \n-
    104 public VirtualRefinementSubEntityIteratorSpecial<dimension, CoordType, codimension>
    \n-
    105 {
    \n-
    106 public:
    \n-\n-
    108 typedef typename Refinement::template Codim<codimension>::SubEntityIterator This;
    \n-
    109 typedef typename Refinement::template SubEntityIteratorBack<codimension> IteratorBack;
    \n-
    110 typedef typename Refinement::CoordVector CoordVector;
    \n-
    111
    \n-\n-
    113 SubEntityIterator(const This &other);
    \n-\n-
    115
    \n-
    116 This &operator=(const This &other);
    \n-
    117
    \n-
    118 bool equals(const This &other) const;
    \n-
    119 void increment();
    \n-
    120
    \n-
    121 int index() const;
    \n-
    122
    \n-
    123 // If you simply use an unqualified CoordVector here g++-4.2 chokes
    \n-\n-
    125 CoordVector coords() const;
    \n-
    126 private:
    \n-
    127 friend class VirtualRefinementSubEntityIteratorSpecial<dimension, CoordType, codimension>;
    \n-
    128 IteratorBack *backend;
    \n-
    129 };
    \n-
    \n-
    130
    \n-
    131#ifndef DOXYGEN
    \n-
    132 template<int dimension, class CoordType>
    \n-
    133 template<int codimension>
    \n-\n-
    135 SubEntityIterator(IteratorBack *backend_)
    \n-
    136 : backend(backend_)
    \n-
    137 {}
    \n-
    138
    \n-
    139 template<int dimension, class CoordType>
    \n-
    140 template<int codimension>
    \n-\n-
    142 SubEntityIterator(const This &other)
    \n-
    143 : backend(other.backend->clone())
    \n-
    144 {}
    \n-
    145
    \n-
    146 template<int dimension, class CoordType>
    \n-
    147 template<int codimension>
    \n-
    148 VirtualRefinement<dimension, CoordType>::Codim<codimension>::SubEntityIterator::
    \n-
    149 ~SubEntityIterator()
    \n-
    150 {
    \n-
    151 delete backend;
    \n-
    152 }
    \n-
    153
    \n-
    154 template<int dimension, class CoordType>
    \n-
    155 template<int codimension>
    \n-
    156 typename VirtualRefinement<dimension, CoordType>::template Codim<codimension>::SubEntityIterator &
    \n-
    157 VirtualRefinement<dimension, CoordType>::Codim<codimension>::SubEntityIterator::
    \n-
    158 operator=(const This &other)
    \n-
    159 {
    \n-
    160 delete backend;
    \n-
    161 backend = other.backend->clone();
    \n-
    162 }
    \n-
    163
    \n-
    164 template<int dimension, class CoordType>
    \n-
    165 template<int codimension>
    \n-
    166 bool
    \n-
    167 VirtualRefinement<dimension, CoordType>::Codim<codimension>::SubEntityIterator::
    \n-
    168 equals(const This &other) const
    \n-
    169 { return *backend == *(other.backend); }
    \n-
    170
    \n-
    171 template<int dimension, class CoordType>
    \n-
    172 template<int codimension>
    \n-
    173 void
    \n-
    174 VirtualRefinement<dimension, CoordType>::Codim<codimension>::SubEntityIterator::
    \n-
    175 increment()
    \n-
    176 {
    \n-
    177 ++*backend;
    \n-
    178 }
    \n-
    179
    \n-
    180 template<int dimension, class CoordType>
    \n-
    181 template<int codimension>
    \n-
    182 int
    \n-
    183 VirtualRefinement<dimension, CoordType>::Codim<codimension>::SubEntityIterator::
    \n-
    184 index() const
    \n-
    185 { return backend->index(); }
    \n-
    186
    \n-
    187 template<int dimension, class CoordType>
    \n-
    188 template<int codimension>
    \n-
    189 typename VirtualRefinement<dimension, CoordType>::template Codim<codimension>::SubEntityIterator::CoordVector
    \n-
    190 VirtualRefinement<dimension, CoordType>::Codim<codimension>::SubEntityIterator::
    \n-
    191 coords() const
    \n-
    192 { return backend->coords(); }
    \n-
    193#endif // DOXYGEN
    \n-
    194
    \n-
    195 //
    \n-
    196 // The iterator backend
    \n-
    197 //
    \n-
    198
    \n-
    199 template<int dimension, class CoordType, int codimension>
    \n-\n-
    201
    \n-
    202 // The iterator backend for vertices
    \n-
    203 template<int dimension, class CoordType>
    \n-
    \n-
    204 class VirtualRefinementSubEntityIteratorBackSpecial<dimension, CoordType, dimension>
    \n-
    205 {
    \n-
    206 public:
    \n-
    207
    \n-\n-
    210 };
    \n-
    \n-
    211
    \n-
    212 // The iterator backend for elements
    \n-
    213 template<int dimension, class CoordType>
    \n-
    \n-\n-
    215 {
    \n-
    216 public:
    \n-\n-
    218 typedef typename Refinement::IndexVector IndexVector;
    \n-
    219
    \n-
    220 virtual IndexVector vertexIndices() const = 0;
    \n-
    221
    \n-\n-
    224 };
    \n-
    \n-
    225
    \n-
    226 // The iterator backend common stuff
    \n-
    227 template<int dimension, class CoordType>
    \n-
    228 template<int codimension>
    \n-
    \n-
    229 class VirtualRefinement<dimension, CoordType>::SubEntityIteratorBack
    \n-
    230 : public VirtualRefinementSubEntityIteratorBackSpecial<dimension, CoordType, codimension>
    \n-
    231 {
    \n-
    232 public:
    \n-\n-
    234 typedef typename Refinement::template SubEntityIteratorBack<codimension> This;
    \n-
    235 typedef typename Refinement::CoordVector CoordVector;
    \n-
    236
    \n-\n-
    238
    \n-
    239 virtual This *clone() const = 0;
    \n-
    240
    \n-
    241 virtual bool operator==(const This &other) const = 0;
    \n-
    242 virtual This &operator++() = 0;
    \n-
    243
    \n-
    244 virtual int index() const = 0;
    \n-
    245 virtual CoordVector coords() const = 0;
    \n-
    246 };
    \n-
    \n-
    247
    \n-
    248 // /////////////////////////////////////////////////
    \n-
    249 //
    \n-
    250 // The derived classes and their iterator backends
    \n-
    251 //
    \n-
    252
    \n-
    253 //
    \n-
    254 // The refinement implementation
    \n-
    255 //
    \n-
    256
    \n-
    257 template<unsigned topologyId, class CoordType,
    \n-
    258 unsigned coerceToId, int dimension>
    \n-
    \n-\n-
    260 : public Dune::VirtualRefinement<dimension, CoordType>
    \n-
    261 {
    \n-
    262 public:
    \n-\n-\n-
    265
    \n-
    266 template<int codimension>
    \n-\n-
    268
    \n-
    269 int nVertices(Dune::RefinementIntervals tag) const;
    \n-
    270
    \n-
    271 int nElements(Dune::RefinementIntervals tag) const;
    \n-
    272
    \n-\n-
    274 private:
    \n-\n-
    276
    \n-\n-\n-\n-\n-
    281 };
    \n-
    \n-
    282
    \n-
    283 template<unsigned topologyId, class CoordType,
    \n-
    284 unsigned coerceToId, int dimension>
    \n-
    285 VirtualRefinementImp<topologyId, CoordType, coerceToId, dimension> &
    \n-
    \n-\n-
    287 {
    \n-
    288 static VirtualRefinementImp instance_{};
    \n-
    289 return instance_;
    \n-
    290 }
    \n-
    \n-
    291
    \n-
    292 template<unsigned topologyId, class CoordType,
    \n-
    293 unsigned coerceToId, int dimension>
    \n-\n-
    299
    \n-
    300 template<unsigned topologyId, class CoordType,
    \n-
    301 unsigned coerceToId, int dimension>
    \n-\n-\n-\n-
    305 {
    \n-
    306 return new SubEntityIteratorBack<dimension>(StaticRefinement::vBegin(tag));
    \n-
    307 }
    \n-
    308
    \n-
    309 template<unsigned topologyId, class CoordType,
    \n-
    310 unsigned coerceToId, int dimension>
    \n-\n-
    312 VirtualRefinementImp<topologyId, CoordType, coerceToId, dimension>::
    \n-
    313 vEndBack(Dune::RefinementIntervals tag) const
    \n-
    314 {
    \n-
    315 return new SubEntityIteratorBack<dimension>(StaticRefinement::vEnd(tag));
    \n-
    316 }
    \n-
    317
    \n-
    318 template<unsigned topologyId, class CoordType,
    \n-
    319 unsigned coerceToId, int dimension>
    \n-\n-
    324
    \n-
    325 template<unsigned topologyId, class CoordType,
    \n-
    326 unsigned coerceToId, int dimension>
    \n-\n-\n-\n-
    330 {
    \n-
    331 return new SubEntityIteratorBack<0>(StaticRefinement::eBegin(tag));
    \n-
    332 }
    \n-
    333
    \n-
    334 template<unsigned topologyId, class CoordType,
    \n-
    335 unsigned coerceToId, int dimension>
    \n-\n-
    337 VirtualRefinementImp<topologyId, CoordType, coerceToId, dimension>::
    \n-
    338 eEndBack(Dune::RefinementIntervals tag) const
    \n-
    339 {
    \n-
    340 return new SubEntityIteratorBack<0>(StaticRefinement::eEnd(tag));
    \n-
    341 }
    \n-
    342
    \n-
    343 //
    \n-
    344 // The iterator backend implementation
    \n-
    345 //
    \n-
    346
    \n-
    347 // The iterator backend implementation specialties
    \n-
    348 template<unsigned topologyId, class CoordType,
    \n-
    349 unsigned coerceToId, int dimension, int codimension>
    \n-\n-
    351
    \n-
    352 // The iterator backend implementation specialties for vertices
    \n-
    353 template<unsigned topologyId, class CoordType,
    \n-
    354 unsigned coerceToId, int dimension>
    \n-
    \n-
    355 class VirtualRefinementImpSubEntityIteratorBackSpecial<topologyId, CoordType, coerceToId, dimension, dimension>
    \n-
    356 : public VirtualRefinement<dimension, CoordType>::template SubEntityIteratorBack<dimension>
    \n-
    357 {};
    \n-
    \n-
    358
    \n-
    359 // The iterator backend implementation specialties for elements
    \n-
    360
    \n-
    361 template<unsigned topologyId, class CoordType,
    \n-
    362 unsigned coerceToId, int dimension>
    \n-
    \n-
    363 class VirtualRefinementImpSubEntityIteratorBackSpecial<topologyId, CoordType, coerceToId, dimension, 0>
    \n-
    364 : public VirtualRefinement<dimension, CoordType>::template SubEntityIteratorBack<0>
    \n-
    365 {
    \n-
    366 public:
    \n-\n-
    368 typedef typename VirtualRefinementImp::template SubEntityIteratorBack<0> Common;
    \n-\n-\n-
    371 typedef typename RefinementBase::IndexVector IndexVector;
    \n-
    372
    \n-
    373 IndexVector vertexIndices() const;
    \n-
    374 };
    \n-
    \n-
    375
    \n-
    376 template<unsigned topologyId, class CoordType,
    \n-
    377 unsigned coerceToId, int dimension>
    \n-\n-
    \n-\n-
    380 vertexIndices() const
    \n-
    381 {
    \n-
    382 IndexVector vIndices;
    \n-
    383 vIndices.reserve(StaticRefinement::IndexVector::dimension);
    \n-
    384
    \n-
    385 typename StaticRefinement::IndexVector sIndices = static_cast<const Common *>(this)->backend.vertexIndices();
    \n-
    386 for(int i = 0; i < StaticRefinement::IndexVector::dimension; ++i)
    \n-
    387 vIndices.push_back(sIndices[i]);
    \n-
    388 return vIndices;
    \n-
    389 }
    \n-
    \n+
    5#ifndef DUNE_GEOMETRY_VIRTUALREFINEMENT_HH
    \n+
    6#define DUNE_GEOMETRY_VIRTUALREFINEMENT_HH
    \n+
    7
    \n+
    268#include <vector>
    \n+
    269
    \n+
    270#include <dune/common/fvector.hh>
    \n+
    271
    \n+
    272#include "refinement.hh"
    \n+
    273#include "type.hh"
    \n+
    274
    \n+
    275namespace Dune
    \n+
    276{
    \n+
    277 // //////////////////////////////////////////
    \n+
    278 //
    \n+
    279 // The virtual base class and its iterators
    \n+
    280 //
    \n+
    281
    \n+
    282 //
    \n+
    283 // Refinement
    \n+
    284 //
    \n+
    285
    \n+
    292 template<int dimension, class CoordType>
    \n+
    \n+\n+
    294 {
    \n+
    295 public:
    \n+
    296 template<int codimension>
    \n+
    297 struct Codim;
    \n+\n+\n+
    302
    \n+
    308 typedef FieldVector<CoordType, dimension> CoordVector;
    \n+
    314 typedef std::vector<int> IndexVector;
    \n+
    315
    \n+
    316 template<int codimension>
    \n+\n+\n+\n+
    320
    \n+
    326 virtual int nVertices(Dune::RefinementIntervals tag) const = 0;
    \n+
    327
    \n+\n+
    334
    \n+\n+
    341
    \n+
    347 virtual int nElements(Dune::RefinementIntervals tag) const = 0;
    \n+
    348
    \n+\n+
    355
    \n+\n+
    362
    \n+
    \n+\n+
    365 {}
    \n+
    \n+
    366
    \n+
    367 protected:
    \n+\n+\n+\n+\n+
    372 };
    \n+
    \n+
    373
    \n+
    375 template<int dimension, class CoordType>
    \n+
    376 template<int codimension>
    \n+
    \n+
    377 struct VirtualRefinement<dimension, CoordType>::Codim
    \n+
    378 {
    \n+
    379 class SubEntityIterator;
    \n+
    380 };
    \n+
    \n+
    381
    \n+
    382 // ////////////////////////
    \n+
    383 //
    \n+
    384 // The refinement builder
    \n+
    385 //
    \n+
    386
    \n+
    387 template<int dimension, class CoordType>
    \n+\n+
    389 buildRefinement(GeometryType geometryType, GeometryType coerceTo);
    \n
    390
    \n-
    391 // The shared iterator backend implementation
    \n-
    392 template<unsigned topologyId, class CoordType,
    \n-
    393 unsigned coerceToId, int dimension>
    \n-
    394 template<int codimension>
    \n-
    \n-
    395 class VirtualRefinementImp<topologyId, CoordType, coerceToId, dimension>::SubEntityIteratorBack
    \n-
    396 : public VirtualRefinementImpSubEntityIteratorBackSpecial<topologyId, CoordType, coerceToId, dimension, codimension>
    \n-
    397 {
    \n-
    398 public:
    \n-
    399 typedef typename StaticRefinement::template Codim<codimension>::SubEntityIterator BackendIterator;
    \n-\n-
    401 typedef typename VirtualRefinement::template SubEntityIteratorBack<codimension> Base;
    \n-\n-
    403
    \n-\n-
    405 SubEntityIteratorBack(const This &other);
    \n-
    406
    \n-
    407 Base *clone() const;
    \n-
    408
    \n-
    409 bool operator==(const Base &other) const;
    \n-
    410 Base &operator++();
    \n-
    411
    \n-
    412 int index() const;
    \n-
    413 CoordVector coords() const;
    \n-
    414
    \n-
    415 private:
    \n-
    416 friend class VirtualRefinementImpSubEntityIteratorBackSpecial<topologyId, CoordType, coerceToId, dimension, codimension>;
    \n-
    417 BackendIterator backend;
    \n-
    418 };
    \n-
    \n-
    419
    \n-
    420 template<unsigned topologyId, class CoordType,
    \n-
    421 unsigned coerceToId, int dimension>
    \n-
    422 template<int codimension>
    \n-\n-
    427
    \n-
    428 template<unsigned topologyId, class CoordType,
    \n-
    429 unsigned coerceToId, int dimension>
    \n-
    430 template<int codimension>
    \n-
    \n-\n-
    432 SubEntityIteratorBack(const This &other)
    \n-
    433 : VirtualRefinementImpSubEntityIteratorBackSpecial<topologyId, CoordType, coerceToId, dimension, codimension>(other),
    \n-
    434 backend(other.backend)
    \n-
    435 {}
    \n-
    \n-
    436
    \n-
    437 template<unsigned topologyId, class CoordType, unsigned coerceToId, int dimension>
    \n-
    438 template<int codimension>
    \n-\n-\n-
    443
    \n-
    444 template<unsigned topologyId, class CoordType, unsigned coerceToId, int dimension>
    \n-
    445 template<int codimension>
    \n-
    446 bool
    \n-
    \n-\n-
    448 operator==(const Base &other) const
    \n-
    449 {
    \n-
    450 try {
    \n-
    451 return backend == dynamic_cast<const This &>(other).backend;
    \n-
    452 }
    \n-
    453 catch(const std::bad_cast&)
    \n-
    454 {
    \n-
    455 return false;
    \n-
    456 }
    \n-
    457 }
    \n-
    \n-
    458
    \n-
    459 template<unsigned topologyId, class CoordType, unsigned coerceToId, int dimension>
    \n-
    460 template<int codimension>
    \n-\n-\n-
    468
    \n-
    469 template<unsigned topologyId, class CoordType, unsigned coerceToId, int dimension>
    \n-
    470 template<int codimension>
    \n-
    471 int
    \n-\n-
    475
    \n-
    476 template<unsigned topologyId, class CoordType, unsigned coerceToId, int dimension>
    \n-
    477 template<int codimension>
    \n-\n-\n-
    482
    \n-
    483 // ////////////////////////
    \n-
    484 //
    \n-
    485 // The refinement builder
    \n-
    486 //
    \n-
    487
    \n-
    488 template<int dimension, class CoordType>
    \n-
    489 class RefinementBuilder;
    \n-
    490
    \n-
    501 template<int dimension, class CoordType>
    \n-\n-
    \n-\n-
    504 GeometryType geometryType,
    \n-
    506 GeometryType coerceTo)
    \n-
    507 {
    \n-
    508 // Check that the user used valid geometry types
    \n-
    509 assert(geometryType.dim() == dimension && coerceTo.dim() == dimension);
    \n-
    510 return RefinementBuilder<dimension, CoordType>::build( geometryType.id(), coerceTo.id() );
    \n-
    511 }
    \n-
    \n-
    512
    \n-
    513 // In principle the trick with the class is no longer necessary,
    \n-
    514 // but I'm keeping it in here so it will be easier to specialize
    \n-
    515 // buildRefinement when someone implements pyramids and prisms
    \n-
    516 template<int dimension, class CoordType>
    \n-
    \n-\n-
    518 {
    \n-
    519 public:
    \n-
    520 static
    \n-\n-
    \n-
    522 build(unsigned topologyId, unsigned coerceToId)
    \n-
    523 {
    \n-
    524 topologyId &= ~1;
    \n-
    525 coerceToId &= ~1;
    \n-
    526
    \n-
    527 constexpr unsigned idSimplex = GeometryTypes::simplex(dimension).id() & ~1;
    \n-
    528 constexpr unsigned idCube = GeometryTypes::cube(dimension).id() & ~1;
    \n-
    529
    \n-
    530 switch( topologyId )
    \n-
    531 {
    \n-
    532 //case GeometryType::simplex:
    \n-
    533 case idSimplex :
    \n-
    534 //switch( coerceTo )
    \n-
    535 switch( coerceToId )
    \n-
    536 {
    \n-
    537 //case GeometryType::simplex:
    \n-
    538 case idSimplex :
    \n-\n-
    540 default :
    \n-
    541 break;
    \n-
    542 }
    \n-
    543 break;
    \n-
    544
    \n-
    545 //case GeometryType::cube:
    \n-
    546 case idCube :
    \n-
    547 switch( coerceToId )
    \n-
    548 {
    \n-
    549 case idSimplex :
    \n-\n-
    551 case idCube :
    \n-\n-
    553 default :
    \n-
    554 break;
    \n-
    555 }
    \n-
    556 break;
    \n-
    557
    \n-
    558 default :
    \n-
    559 break;
    \n-
    560 }
    \n-
    561 DUNE_THROW( NotImplemented, "No Refinement<" << topologyId << ", CoordType, "
    \n-
    562 << coerceToId << " >.");
    \n-
    563 }
    \n-
    \n-
    564 };
    \n-
    \n-
    565
    \n-
    566 template<class CoordType>
    \n-
    \n-
    567 class RefinementBuilder<1, CoordType>
    \n-
    568 {
    \n-
    569 static const std::size_t dimension = 1;
    \n-
    570 public:
    \n-
    571 static
    \n-\n-
    \n-
    573 build(unsigned topologyId, unsigned coerceToId)
    \n-
    574 {
    \n-
    575 topologyId &= ~1;
    \n-
    576 coerceToId &= ~1;
    \n-
    577
    \n-
    578 constexpr unsigned idSimplex = GeometryTypes::simplex(dimension).id() & ~1;
    \n-
    579
    \n-
    580 if (topologyId == 0 && coerceToId == 0)
    \n-\n-
    582
    \n-
    583 DUNE_THROW( NotImplemented, "No Refinement<" << topologyId << ", CoordType, "
    \n-
    584 << coerceToId << " >.");
    \n-
    585 }
    \n-
    \n-
    586 };
    \n-
    \n-
    587
    \n-
    588 template<class CoordType>
    \n-
    \n-
    589 class RefinementBuilder<3, CoordType>
    \n-
    590 {
    \n-
    591 static const std::size_t dimension = 3;
    \n-
    592 public:
    \n-
    593 static
    \n-\n-
    \n-
    595 build(unsigned topologyId, unsigned coerceToId)
    \n-
    596 {
    \n-
    597 topologyId &= ~1;
    \n-
    598 coerceToId &= ~1;
    \n-
    599
    \n-
    600 constexpr unsigned idSimplex = GeometryTypes::simplex(dimension).id() & ~1;
    \n-
    601 constexpr unsigned idCube = GeometryTypes::cube(dimension).id() & ~1;
    \n-
    602 constexpr unsigned idPrism = GeometryTypes::prism.id() & ~1;
    \n-
    603 constexpr unsigned idPyramid = GeometryTypes::pyramid.id() & ~1;
    \n-
    604
    \n-
    605 switch( topologyId )
    \n-
    606 {
    \n-
    607 //case GeometryType::simplex:
    \n-
    608 case idSimplex :
    \n-
    609 //switch( coerceTo )
    \n-
    610 switch( coerceToId )
    \n-
    611 {
    \n-
    612 //case GeometryType::simplex:
    \n-
    613 case idSimplex :
    \n-\n-
    615 default :
    \n-
    616 break;
    \n-
    617 }
    \n-
    618 break;
    \n-
    619
    \n-
    620 //case GeometryType::cube:
    \n-
    621 case idCube :
    \n-
    622 switch( coerceToId )
    \n-
    623 {
    \n-
    624 case idSimplex :
    \n-\n-
    626 case idCube :
    \n-\n-
    628 default :
    \n-
    629 break;
    \n-
    630 }
    \n-
    631 break;
    \n-
    632
    \n-
    633 //case GeometryType::prism:
    \n-
    634 case idPrism :
    \n-
    635 switch( coerceToId )
    \n-
    636 {
    \n-
    637 case idSimplex :
    \n-\n-
    639 default :
    \n-
    640 break;
    \n-
    641 }
    \n-
    642 break;
    \n-
    643
    \n-
    644 //case GeometryType::pyramid:
    \n-
    645 case idPyramid :
    \n-
    646 switch( coerceToId )
    \n-
    647 {
    \n-
    648 case idSimplex :
    \n-\n-
    650 default :
    \n-
    651 break;
    \n-
    652 }
    \n-
    653 break;
    \n-
    654
    \n-
    655 default :
    \n-
    656 break;
    \n-
    657 }
    \n-
    658 DUNE_THROW( NotImplemented, "No Refinement<" << topologyId << ", CoordType, "
    \n-
    659 << coerceToId << " >.");
    \n-
    660 }
    \n-
    \n-
    661 };
    \n-
    \n-
    662
    \n-
    663} // namespace Dune
    \n-
    664
    \n-
    665#endif // DUNE_GEOMETRY_VIRTUALREFINEMENT_CC
    \n-
    This file simply includes all Refinement implementations so you don't have to do them separately.
    \n+
    391} // namespace Dune
    \n+
    392
    \n+
    393#include "virtualrefinement.cc"
    \n+
    394
    \n+
    395#endif // DUNE_GEOMETRY_VIRTUALREFINEMENT_HH
    \n+
    This file contains the virtual wrapper around refinement.
    \n
    A unique label for each type of element that can occur in a grid.
    \n+
    This file simply includes all Refinement implementations so you don't have to do them separately.
    \n
    Definition affinegeometry.hh:21
    \n
    VirtualRefinement< dimension, CoordType > & buildRefinement(GeometryType geometryType, GeometryType coerceTo)
    return a reference to the VirtualRefinement according to the parameters
    Definition virtualrefinement.cc:503
    \n-
    Static tag representing a codimension.
    Definition dimension.hh:24
    \n
    Holds the number of refined intervals per axis needed for virtual and static refinement.
    Definition base.cc:94
    \n-
    Wrap each Refinement implementation to get a consistent interface.
    Definition base.cc:141
    \n-
    static ElementIterator eEnd(Dune::RefinementIntervals tag)
    Get an ElementIterator.
    Definition base.cc:247
    \n-
    static ElementIterator eBegin(Dune::RefinementIntervals tag)
    Get an ElementIterator.
    Definition base.cc:237
    \n-
    static int nElements(Dune::RefinementIntervals tag)
    Get the number of Elements.
    Definition base.cc:227
    \n-
    static int nVertices(Dune::RefinementIntervals tag)
    Get the number of Vertices.
    Definition base.cc:197
    \n-
    static VertexIterator vBegin(Dune::RefinementIntervals tag)
    Get a VertexIterator.
    Definition base.cc:207
    \n-
    typedef IndexVector
    The IndexVector of the Refinement.
    Definition base.cc:177
    \n-
    static VertexIterator vEnd(Dune::RefinementIntervals tag)
    Get a VertexIterator.
    Definition base.cc:217
    \n
    Unique label for each type of entities that can occur in DUNE grids.
    Definition type.hh:126
    \n-
    constexpr unsigned int dim() const
    Return dimension of the type.
    Definition type.hh:372
    \n-
    constexpr unsigned int id() const
    Return the topology id of the type.
    Definition type.hh:377
    \n-
    Definition virtualrefinement.cc:72
    \n-
    Refinement::template Codim< 0 >::SubEntityIterator Common
    Definition virtualrefinement.cc:85
    \n-
    VirtualRefinement< dimension, CoordType > Refinement
    Definition virtualrefinement.cc:84
    \n-
    Refinement::IndexVector IndexVector
    Definition virtualrefinement.cc:86
    \n-
    VirtualRefinement< dimension, CoordType >::template Codim< codimension >::SubEntityIterator::CoordVector coords() const
    \n-\n-\n-\n-\n-\n-
    Refinement::template SubEntityIteratorBack< codimension > IteratorBack
    Definition virtualrefinement.cc:109
    \n-
    Refinement::CoordVector CoordVector
    Definition virtualrefinement.cc:110
    \n-
    Refinement::template Codim< codimension >::SubEntityIterator This
    Definition virtualrefinement.cc:108
    \n-
    bool equals(const This &other) const
    \n-
    VirtualRefinement< dimension, CoordType > Refinement
    Definition virtualrefinement.cc:107
    \n-\n-
    Definition virtualrefinement.cc:200
    \n-
    virtual ~VirtualRefinementSubEntityIteratorBackSpecial()
    Definition virtualrefinement.cc:208
    \n-\n-
    VirtualRefinement< dimension, CoordType > Refinement
    Definition virtualrefinement.cc:217
    \n-
    Refinement::IndexVector IndexVector
    Definition virtualrefinement.cc:218
    \n-
    virtual ~VirtualRefinementSubEntityIteratorBackSpecial()
    Definition virtualrefinement.cc:222
    \n
    Definition virtualrefinement.cc:231
    \n-\n-
    Refinement::template SubEntityIteratorBack< codimension > This
    Definition virtualrefinement.cc:234
    \n-\n-
    Refinement::CoordVector CoordVector
    Definition virtualrefinement.cc:235
    \n-
    VirtualRefinement< dimension, CoordType > Refinement
    Definition virtualrefinement.cc:233
    \n-
    virtual bool operator==(const This &other) const =0
    \n-
    virtual CoordVector coords() const =0
    \n-
    virtual ~SubEntityIteratorBack()
    Definition virtualrefinement.cc:237
    \n-\n-
    Definition virtualrefinement.cc:261
    \n-
    int nVertices(Dune::RefinementIntervals tag) const
    Get the number of Vertices.
    Definition virtualrefinement.cc:295
    \n-
    Dune::VirtualRefinement< dimension, CoordType > VirtualRefinement
    Definition virtualrefinement.cc:264
    \n-
    int nElements(Dune::RefinementIntervals tag) const
    Get the number of Elements.
    Definition virtualrefinement.cc:320
    \n-
    static VirtualRefinementImp< topologyId, CoordType, coerceToId, dimension > & instance()
    Definition virtualrefinement.cc:286
    \n-
    Dune::StaticRefinement< topologyId, CoordType, coerceToId, dimension > StaticRefinement
    Definition virtualrefinement.cc:263
    \n-
    Definition virtualrefinement.cc:397
    \n-
    VirtualRefinement::template SubEntityIteratorBack< codimension > Base
    Definition virtualrefinement.cc:401
    \n-
    VirtualRefinementImp< topologyId, CoordType, coerceToId, dimension >::template SubEntityIteratorBack< codimension > This
    Definition virtualrefinement.cc:400
    \n-
    StaticRefinement::template Codim< codimension >::SubEntityIterator BackendIterator
    Definition virtualrefinement.cc:399
    \n-
    VirtualRefinement::CoordVector CoordVector
    Definition virtualrefinement.cc:402
    \n-\n-
    VirtualRefinementImp::template SubEntityIteratorBack< 0 > Common
    Definition virtualrefinement.cc:368
    \n-\n-
    VirtualRefinement< dimension, CoordType > RefinementBase
    Definition virtualrefinement.cc:370
    \n-
    Dune::VirtualRefinementImp< topologyId, CoordType, coerceToId, dimension > VirtualRefinementImp
    Definition virtualrefinement.cc:367
    \n-
    VirtualRefinementImp::StaticRefinement StaticRefinement
    Definition virtualrefinement.cc:369
    \n-
    Definition virtualrefinement.cc:518
    \n-
    static VirtualRefinement< dimension, CoordType > & build(unsigned topologyId, unsigned coerceToId)
    Definition virtualrefinement.cc:522
    \n-
    static VirtualRefinement< dimension, CoordType > & build(unsigned topologyId, unsigned coerceToId)
    Definition virtualrefinement.cc:573
    \n-
    static VirtualRefinement< dimension, CoordType > & build(unsigned topologyId, unsigned coerceToId)
    Definition virtualrefinement.cc:595
    \n
    VirtualRefinement base class.
    Definition virtualrefinement.hh:294
    \n
    SubEntityIteratorBack< dimension > VertexIteratorBack
    Definition virtualrefinement.hh:318
    \n+
    virtual ElementIteratorBack * eEndBack(Dune::RefinementIntervals tag) const =0
    \n
    VertexIterator vBegin(Dune::RefinementIntervals tag) const
    Get an VertexIterator.
    Definition virtualrefinement.cc:38
    \n
    ElementIterator eBegin(Dune::RefinementIntervals tag) const
    Get an ElementIterator.
    Definition virtualrefinement.cc:54
    \n+
    virtual int nElements(Dune::RefinementIntervals tag) const =0
    Get the number of Elements.
    \n
    ElementIterator eEnd(Dune::RefinementIntervals tag) const
    Get an ElementIterator.
    Definition virtualrefinement.cc:62
    \n
    Codim< 0 >::SubEntityIterator ElementIterator
    The ElementIterator of the VirtualRefinement.
    Definition virtualrefinement.hh:301
    \n+
    virtual ~VirtualRefinement()
    Destructor.
    Definition virtualrefinement.hh:364
    \n
    VertexIterator vEnd(Dune::RefinementIntervals tag) const
    Get an VertexIterator.
    Definition virtualrefinement.cc:46
    \n
    FieldVector< CoordType, dimension > CoordVector
    The CoordVector of the VirtualRefinement.
    Definition virtualrefinement.hh:308
    \n+
    virtual int nVertices(Dune::RefinementIntervals tag) const =0
    Get the number of Vertices.
    \n+
    std::vector< int > IndexVector
    The IndexVector of the VirtualRefinement.
    Definition virtualrefinement.hh:314
    \n
    Codim< dimension >::SubEntityIterator VertexIterator
    The VertexIterator of the VirtualRefinement.
    Definition virtualrefinement.hh:299
    \n+
    virtual VertexIteratorBack * vEndBack(Dune::RefinementIntervals tag) const =0
    \n
    SubEntityIteratorBack< 0 > ElementIteratorBack
    Definition virtualrefinement.hh:319
    \n+
    virtual ElementIteratorBack * eBeginBack(Dune::RefinementIntervals tag) const =0
    \n+
    virtual VertexIteratorBack * vBeginBack(Dune::RefinementIntervals tag) const =0
    \n
    codim database of VirtualRefinement
    Definition virtualrefinement.hh:378
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,1008 +7,188 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n-virtualrefinement.cc\n+virtualrefinement.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file\n LICENSE.md in module root\n 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n- 5\n- 6#ifndef DUNE_GEOMETRY_VIRTUALREFINEMENT_CC\n-7#define DUNE_GEOMETRY_VIRTUALREFINEMENT_CC\n- 8\n- 14#include \n- 15#include \n- 16\n- 17#include \n- 18#include \n- 19#include \n- 20\n- 21#include \"type.hh\"\n- 22#include \"refinement.hh\"\n- 23\n- 24namespace Dune\n- 25{\n- 26 // //////////////////////////////////////////\n- 27 //\n- 28 // The virtual base class and its iterators\n- 29 //\n- 30\n- 31 //\n- 32 // Refinement\n- 33 //\n- 34\n- 35 template\n- 36 typename VirtualRefinement::VertexIterator\n-37 VirtualRefinement::\n- 38vBegin(Dune::RefinementIntervals tag) const\n- 39 {\n- 40 return VertexIterator(vBeginBack(tag));\n- 41 }\n- 42\n- 43 template\n- 44 typename VirtualRefinement::VertexIterator\n-45 VirtualRefinement::\n- 46vEnd(Dune::RefinementIntervals tag) const\n- 47 {\n- 48 return VertexIterator(vEndBack(tag));\n- 49 }\n- 50\n- 51 template\n- 52 typename VirtualRefinement::ElementIterator\n-53 VirtualRefinement::\n- 54eBegin(Dune::RefinementIntervals tag) const\n- 55 {\n- 56 return ElementIterator(eBeginBack(tag));\n- 57 }\n- 58\n- 59 template\n- 60 typename VirtualRefinement::ElementIterator\n-61 VirtualRefinement::\n- 62eEnd(Dune::RefinementIntervals tag) const\n- 63 {\n- 64 return ElementIterator(eEndBack(tag));\n- 65 }\n- 66\n- 67 //\n- 68 // The iterators\n- 69 //\n- 70\n- 71 template\n-72 class VirtualRefinementSubEntityIteratorSpecial;\n- 73\n- 74 // The iterator for vertices\n- 75 template\n-76 class VirtualRefinementSubEntityIteratorSpecial\n- 77 {};\n- 78\n- 79 // The iterator for elements\n- 80 template\n-81 class VirtualRefinementSubEntityIteratorSpecial\n- 82 {\n- 83 public:\n-84 typedef VirtualRefinement Refinement;\n-85 typedef typename Refinement::template Codim<0>::SubEntityIterator Common;\n-86 typedef typename Refinement::IndexVector IndexVector;\n- 87\n- 88 IndexVector vertexIndices() const;\n- 89 };\n- 90\n- 91 template\n- 92 typename VirtualRefinementSubEntityIteratorSpecial::IndexVector\n-93 VirtualRefinementSubEntityIteratorSpecial::\n- 94vertexIndices() const\n- 95 {\n- 96 return static_cast(this)->backend->vertexIndices();\n- 97 }\n- 98\n- 99 // The iterator common stuff\n- 100 template\n- 101 template\n-102 class VirtualRefinement::Codim::\n-SubEntityIterator\n- 103 : public ForwardIteratorFacade::template Codim::SubEntityIterator, int>,\n- 104 public VirtualRefinementSubEntityIteratorSpecial\n- 105 {\n- 106 public:\n-107 typedef VirtualRefinement Refinement;\n-108 typedef typename Refinement::template Codim::SubEntityIterator\n-This;\n-109 typedef typename Refinement::template SubEntityIteratorBack\n-IteratorBack;\n-110 typedef typename Refinement::CoordVector CoordVector;\n- 111\n-112 SubEntityIterator(IteratorBack *backend);\n-113 SubEntityIterator(const This &other);\n-114 ~SubEntityIterator();\n- 115\n-116 This &operator=(const This &other);\n- 117\n-118 bool equals(const This &other) const;\n-119 void increment();\n- 120\n-121 int index() const;\n- 122\n- 123 // If you simply use an unqualified CoordVector here g++-4.2 chokes\n- 124 typename VirtualRefinement::template\n-Codim::SubEntityIterator::\n-125 CoordVector coords() const;\n- 126 private:\n- 127 friend class VirtualRefinementSubEntityIteratorSpecial;\n- 128 IteratorBack *backend;\n- 129 };\n- 130\n- 131#ifndef DOXYGEN\n- 132 template\n- 133 template\n- 134 VirtualRefinement::Codim::\n-SubEntityIterator::\n- 135SubEntityIterator(IteratorBack *backend_)\n- 136 : backend(backend_)\n- 137 {}\n- 138\n- 139 template\n- 140 template\n- 141 VirtualRefinement::Codim::\n-SubEntityIterator::\n- 142SubEntityIterator(const This &other)\n- 143 : backend(other.backend->clone())\n- 144 {}\n- 145\n- 146 template\n- 147 template\n- 148 VirtualRefinement::Codim::\n-SubEntityIterator::\n- 149 ~SubEntityIterator()\n- 150 {\n- 151 delete backend;\n- 152 }\n- 153\n- 154 template\n- 155 template\n- 156 typename VirtualRefinement::template\n-Codim::SubEntityIterator &\n- 157 VirtualRefinement::Codim::\n-SubEntityIterator::\n- 158 operator=(const This &other)\n- 159 {\n- 160 delete backend;\n- 161 backend = other.backend->clone();\n- 162 }\n- 163\n- 164 template\n- 165 template\n- 166 bool\n- 167 VirtualRefinement::Codim::\n-SubEntityIterator::\n- 168 equals(const This &other) const\n- 169 { return *backend == *(other.backend); }\n- 170\n- 171 template\n- 172 template\n- 173 void\n- 174 VirtualRefinement::Codim::\n-SubEntityIterator::\n- 175 increment()\n- 176 {\n- 177 ++*backend;\n- 178 }\n- 179\n- 180 template\n- 181 template\n- 182 int\n- 183 VirtualRefinement::Codim::\n-SubEntityIterator::\n- 184 index() const\n- 185 { return backend->index(); }\n- 186\n- 187 template\n- 188 template\n- 189 typename VirtualRefinement::template\n-Codim::SubEntityIterator::CoordVector\n- 190 VirtualRefinement::Codim::\n-SubEntityIterator::\n- 191 coords() const\n- 192 { return backend->coords(); }\n- 193#endif // DOXYGEN\n- 194\n- 195 //\n- 196 // The iterator backend\n- 197 //\n- 198\n- 199 template\n-200 class VirtualRefinementSubEntityIteratorBackSpecial;\n- 201\n- 202 // The iterator backend for vertices\n- 203 template\n-204 class VirtualRefinementSubEntityIteratorBackSpecial\n- 205 {\n- 206 public:\n- 207\n-208 virtual ~VirtualRefinementSubEntityIteratorBackSpecial()\n- 209 {}\n- 210 };\n- 211\n- 212 // The iterator backend for elements\n- 213 template\n-214 class VirtualRefinementSubEntityIteratorBackSpecial\n- 215 {\n- 216 public:\n-217 typedef VirtualRefinement Refinement;\n-218 typedef typename Refinement::IndexVector IndexVector;\n- 219\n-220 virtual IndexVector vertexIndices() const = 0;\n- 221\n-222 virtual ~VirtualRefinementSubEntityIteratorBackSpecial()\n- 223 {}\n- 224 };\n- 225\n- 226 // The iterator backend common stuff\n- 227 template\n- 228 template\n-229 class VirtualRefinement::SubEntityIteratorBack\n- 230 : public VirtualRefinementSubEntityIteratorBackSpecial\n- 231 {\n- 232 public:\n-233 typedef VirtualRefinement Refinement;\n-234 typedef typename Refinement::template SubEntityIteratorBack\n-This;\n-235 typedef typename Refinement::CoordVector CoordVector;\n- 236\n-237 virtual ~SubEntityIteratorBack() {}\n- 238\n-239 virtual This *clone() const = 0;\n- 240\n-241 virtual bool operator==(const This &other) const = 0;\n-242 virtual This &operator++() = 0;\n- 243\n-244 virtual int index() const = 0;\n-245 virtual CoordVector coords() const = 0;\n- 246 };\n- 247\n- 248 // /////////////////////////////////////////////////\n- 249 //\n- 250 // The derived classes and their iterator backends\n- 251 //\n- 252\n- 253 //\n- 254 // The refinement implementation\n- 255 //\n- 256\n- 257 template\n-259 class VirtualRefinementImp\n- 260 : public Dune::VirtualRefinement\n- 261 {\n- 262 public:\n-263 typedef Dune::StaticRefinement StaticRefinement;\n-264 typedef Dune::VirtualRefinement VirtualRefinement;\n- 265\n- 266 template\n- 267 class SubEntityIteratorBack;\n- 268\n- 269 int nVertices(Dune::RefinementIntervals tag) const;\n- 270\n- 271 int nElements(Dune::RefinementIntervals tag) const;\n- 272\n- 273 static VirtualRefinementImp\n-&instance();\n- 274 private:\n- 275 VirtualRefinementImp() {}\n- 276\n- 277 typename VirtualRefinement::VertexIteratorBack *vBeginBack(Dune::\n-RefinementIntervals tag) const;\n- 278 typename VirtualRefinement::VertexIteratorBack *vEndBack(Dune::\n-RefinementIntervals tag) const;\n- 279 typename VirtualRefinement::ElementIteratorBack *eBeginBack(Dune::\n-RefinementIntervals tag) const;\n- 280 typename VirtualRefinement::ElementIteratorBack *eEndBack(Dune::\n-RefinementIntervals tag) const;\n- 281 };\n- 282\n- 283 template\n- 285 VirtualRefinementImp &\n-286 VirtualRefinementImp::\n-instance()\n- 287 {\n- 288 static VirtualRefinementImp instance_{};\n- 289 return instance_;\n- 290 }\n- 291\n- 292 template\n-294 int VirtualRefinementImp::\n- 295nVertices(Dune::RefinementIntervals tag) const\n- 296 {\n- 297 return StaticRefinement::nVertices(tag);\n- 298 }\n- 299\n- 300 template\n- 302 typename VirtualRefinementImp::VirtualRefinement::VertexIteratorBack *\n- 303 VirtualRefinementImp::\n- 304vBeginBack(Dune::RefinementIntervals tag) const\n- 305 {\n- 306 return new SubEntityIteratorBack(StaticRefinement::vBegin\n-(tag));\n- 307 }\n- 308\n- 309 template\n- 311 typename VirtualRefinementImp::VirtualRefinement::VertexIteratorBack *\n- 312 VirtualRefinementImp::\n- 313 vEndBack(Dune::RefinementIntervals tag) const\n- 314 {\n- 315 return new SubEntityIteratorBack(StaticRefinement::vEnd(tag));\n- 316 }\n- 317\n- 318 template\n-320 int VirtualRefinementImp::\n-nElements(Dune::RefinementIntervals tag) const\n- 321 {\n- 322 return StaticRefinement::nElements(tag);\n- 323 }\n- 324\n- 325 template\n- 327 typename VirtualRefinementImp::VirtualRefinement::ElementIteratorBack *\n- 328 VirtualRefinementImp::\n- 329eBeginBack(Dune::RefinementIntervals tag) const\n- 330 {\n- 331 return new SubEntityIteratorBack<0>(StaticRefinement::eBegin(tag));\n- 332 }\n- 333\n- 334 template\n- 336 typename VirtualRefinementImp::VirtualRefinement::ElementIteratorBack *\n- 337 VirtualRefinementImp::\n- 338 eEndBack(Dune::RefinementIntervals tag) const\n- 339 {\n- 340 return new SubEntityIteratorBack<0>(StaticRefinement::eEnd(tag));\n- 341 }\n- 342\n- 343 //\n- 344 // The iterator backend implementation\n- 345 //\n- 346\n- 347 // The iterator backend implementation specialties\n- 348 template\n-350 class VirtualRefinementImpSubEntityIteratorBackSpecial;\n- 351\n- 352 // The iterator backend implementation specialties for vertices\n- 353 template\n-355 class VirtualRefinementImpSubEntityIteratorBackSpecial\n- 356 : public VirtualRefinement::template\n-SubEntityIteratorBack\n- 357 {};\n- 358\n- 359 // The iterator backend implementation specialties for elements\n- 360\n- 361 template\n-363 class VirtualRefinementImpSubEntityIteratorBackSpecial\n- 364 : public VirtualRefinement::template\n-SubEntityIteratorBack<0>\n- 365 {\n- 366 public:\n-367 typedef Dune::VirtualRefinementImp VirtualRefinementImp;\n-368 typedef typename VirtualRefinementImp::template SubEntityIteratorBack<0>\n-Common;\n-369 typedef typename VirtualRefinementImp::StaticRefinement StaticRefinement;\n-370 typedef VirtualRefinement RefinementBase;\n-371 typedef typename RefinementBase::IndexVector IndexVector;\n- 372\n- 373 IndexVector vertexIndices() const;\n- 374 };\n- 375\n- 376 template\n- 378 typename VirtualRefinementImpSubEntityIteratorBackSpecial::IndexVector\n-379 VirtualRefinementImpSubEntityIteratorBackSpecial::\n- 380vertexIndices() const\n- 381 {\n- 382 IndexVector vIndices;\n- 383 vIndices.reserve(StaticRefinement::IndexVector::dimension);\n- 384\n- 385 typename StaticRefinement::IndexVector sIndices = static_cast(this)->backend.vertexIndices();\n- 386 for(int i = 0; i < StaticRefinement::IndexVector::dimension; ++i)\n- 387 vIndices.push_back(sIndices[i]);\n- 388 return vIndices;\n- 389 }\n+ 5#ifndef DUNE_GEOMETRY_VIRTUALREFINEMENT_HH\n+ 6#define DUNE_GEOMETRY_VIRTUALREFINEMENT_HH\n+ 7\n+ 268#include \n+ 269\n+ 270#include \n+ 271\n+ 272#include \"refinement.hh\"\n+ 273#include \"type.hh\"\n+ 274\n+ 275namespace Dune\n+ 276{\n+ 277 // //////////////////////////////////////////\n+ 278 //\n+ 279 // The virtual base class and its iterators\n+ 280 //\n+ 281\n+ 282 //\n+ 283 // Refinement\n+ 284 //\n+ 285\n+ 292 template\n+293 class VirtualRefinement\n+ 294 {\n+ 295 public:\n+ 296 template\n+ 297 struct Codim;\n+299 typedef typename Codim::SubEntityIterator VertexIterator;\n+301 typedef typename Codim<0>::SubEntityIterator ElementIterator;\n+ 302\n+308 typedef FieldVector CoordVector;\n+314 typedef std::vector IndexVector;\n+ 315\n+ 316 template\n+ 317 class SubEntityIteratorBack;\n+318 typedef SubEntityIteratorBack VertexIteratorBack;\n+319 typedef SubEntityIteratorBack<0> ElementIteratorBack;\n+ 320\n+326 virtual int nVertices(Dune::RefinementIntervals tag) const = 0;\n+ 327\n+ 333 VertexIterator vBegin(Dune::RefinementIntervals tag) const;\n+ 334\n+ 340 VertexIterator vEnd(Dune::RefinementIntervals tag) const;\n+ 341\n+347 virtual int nElements(Dune::RefinementIntervals tag) const = 0;\n+ 348\n+ 354 ElementIterator eBegin(Dune::RefinementIntervals tag) const;\n+ 355\n+ 361 ElementIterator eEnd(Dune::RefinementIntervals tag) const;\n+ 362\n+364 virtual ~VirtualRefinement()\n+ 365 {}\n+ 366\n+ 367 protected:\n+368 virtual VertexIteratorBack *vBeginBack(Dune::RefinementIntervals tag) const\n+= 0;\n+369 virtual VertexIteratorBack *vEndBack(Dune::RefinementIntervals tag) const =\n+0;\n+370 virtual ElementIteratorBack *eBeginBack(Dune::RefinementIntervals tag)\n+const = 0;\n+371 virtual ElementIteratorBack *eEndBack(Dune::RefinementIntervals tag) const\n+= 0;\n+ 372 };\n+ 373\n+ 375 template\n+ 376 template\n+377 struct VirtualRefinement::Codim\n+ 378 {\n+ 379 class SubEntityIterator;\n+ 380 };\n+ 381\n+ 382 // ////////////////////////\n+ 383 //\n+ 384 // The refinement builder\n+ 385 //\n+ 386\n+ 387 template\n+ 388 VirtualRefinement &\n+ 389 buildRefinement(GeometryType geometryType, GeometryType coerceTo);\n 390\n- 391 // The shared iterator backend implementation\n- 392 template\n- 394 template\n-395 class VirtualRefinementImp::\n-SubEntityIteratorBack\n- 396 : public VirtualRefinementImpSubEntityIteratorBackSpecial\n- 397 {\n- 398 public:\n-399 typedef typename StaticRefinement::template Codim::\n-SubEntityIterator BackendIterator;\n-400 typedef typename VirtualRefinementImp::template SubEntityIteratorBack This;\n-401 typedef typename VirtualRefinement::template\n-SubEntityIteratorBack Base;\n-402 typedef typename VirtualRefinement::CoordVector CoordVector;\n- 403\n- 404 SubEntityIteratorBack(const BackendIterator &backend);\n- 405 SubEntityIteratorBack(const This &other);\n- 406\n- 407 Base *clone() const;\n- 408\n- 409 bool operator==(const Base &other) const;\n- 410 Base &operator++();\n- 411\n- 412 int index() const;\n-413 CoordVector coords() const;\n- 414\n- 415 private:\n- 416 friend class VirtualRefinementImpSubEntityIteratorBackSpecial;\n- 417 BackendIterator backend;\n- 418 };\n- 419\n- 420 template\n- 422 template\n-423 VirtualRefinementImp::\n-SubEntityIteratorBack::\n- 424SubEntityIteratorBack(const BackendIterator &backend_)\n- 425 : backend(backend_)\n- 426 {}\n- 427\n- 428 template\n- 430 template\n-431 VirtualRefinementImp::\n-SubEntityIteratorBack::\n- 432SubEntityIteratorBack(const This &other)\n- 433 : VirtualRefinementImpSubEntityIteratorBackSpecial(other),\n- 434 backend(other.backend)\n- 435 {}\n- 436\n- 437 template\n- 438 template\n- 439 typename VirtualRefinementImp::template SubEntityIteratorBack::Base *\n-440 VirtualRefinementImp::\n-SubEntityIteratorBack::\n- 441clone() const\n- 442 { return new This(*this); }\n- 443\n- 444 template\n- 445 template\n- 446 bool\n-447 VirtualRefinementImp::\n-SubEntityIteratorBack::\n- 448operator==(const Base &other) const\n- 449 {\n- 450 try {\n- 451 return backend == dynamic_cast(other).backend;\n- 452 }\n- 453 catch(const std::bad_cast&)\n- 454 {\n- 455 return false;\n- 456 }\n- 457 }\n- 458\n- 459 template\n- 460 template\n- 461 typename VirtualRefinementImp::template SubEntityIteratorBack::Base &\n-462 VirtualRefinementImp::\n-SubEntityIteratorBack::\n- 463operator++()\n- 464 {\n- 465 ++backend;\n- 466 return *this;\n- 467 }\n- 468\n- 469 template\n- 470 template\n- 471 int\n-472 VirtualRefinementImp::\n-SubEntityIteratorBack::\n- 473index() const\n- 474 { return backend.index(); }\n- 475\n- 476 template\n- 477 template\n- 478 typename VirtualRefinementImp::template SubEntityIteratorBack::CoordVector\n-479 VirtualRefinementImp::\n-SubEntityIteratorBack::\n- 480coords() const\n- 481 { return backend.coords(); }\n- 482\n- 483 // ////////////////////////\n- 484 //\n- 485 // The refinement builder\n- 486 //\n- 487\n- 488 template\n- 489 class RefinementBuilder;\n- 490\n- 501 template\n- 502 VirtualRefinement &\n-503 buildRefinement(\n- 504 GeometryType geometryType,\n- 506 GeometryType coerceTo)\n- 507 {\n- 508 // Check that the user used valid geometry types\n- 509 assert(geometryType.dim() == dimension && coerceTo.dim() == dimension);\n- 510 return RefinementBuilder::build( geometryType.id(),\n-coerceTo.id() );\n- 511 }\n- 512\n- 513 // In principle the trick with the class is no longer necessary,\n- 514 // but I'm keeping it in here so it will be easier to specialize\n- 515 // buildRefinement when someone implements pyramids and prisms\n- 516 template\n-517 class RefinementBuilder\n- 518 {\n- 519 public:\n- 520 static\n- 521 VirtualRefinement &\n-522 build(unsigned topologyId, unsigned coerceToId)\n- 523 {\n- 524 topologyId &= ~1;\n- 525 coerceToId &= ~1;\n- 526\n- 527 constexpr unsigned idSimplex = GeometryTypes::simplex(dimension).id() &\n-~1;\n- 528 constexpr unsigned idCube = GeometryTypes::cube(dimension).id() & ~1;\n- 529\n- 530 switch( topologyId )\n- 531 {\n- 532 //case GeometryType::simplex:\n- 533 case idSimplex :\n- 534 //switch( coerceTo )\n- 535 switch( coerceToId )\n- 536 {\n- 537 //case GeometryType::simplex:\n- 538 case idSimplex :\n- 539 return VirtualRefinementImp<_idSimplex,_CoordType,_idSimplex,_dimension>::\n-instance();\n- 540 default :\n- 541 break;\n- 542 }\n- 543 break;\n- 544\n- 545 //case GeometryType::cube:\n- 546 case idCube :\n- 547 switch( coerceToId )\n- 548 {\n- 549 case idSimplex :\n- 550 return VirtualRefinementImp<_idCube,_CoordType,_idSimplex,_dimension>::\n-instance();\n- 551 case idCube :\n- 552 return VirtualRefinementImp<_idCube,_CoordType,_idCube,_dimension>::\n-instance();\n- 553 default :\n- 554 break;\n- 555 }\n- 556 break;\n- 557\n- 558 default :\n- 559 break;\n- 560 }\n- 561 DUNE_THROW( NotImplemented, \"No Refinement<\" << topologyId << \",\n-CoordType, \"\n- 562 << coerceToId << \" >.\");\n- 563 }\n- 564 };\n- 565\n- 566 template\n-567 class RefinementBuilder<1, CoordType>\n- 568 {\n- 569 static const std::size_t dimension = 1;\n- 570 public:\n- 571 static\n- 572 VirtualRefinement &\n-573 build(unsigned topologyId, unsigned coerceToId)\n- 574 {\n- 575 topologyId &= ~1;\n- 576 coerceToId &= ~1;\n- 577\n- 578 constexpr unsigned idSimplex = GeometryTypes::simplex(dimension).id() &\n-~1;\n- 579\n- 580 if (topologyId == 0 && coerceToId == 0)\n- 581 return VirtualRefinementImp<_idSimplex,_CoordType,_idSimplex,_dimension>::\n-instance();\n- 582\n- 583 DUNE_THROW( NotImplemented, \"No Refinement<\" << topologyId << \",\n-CoordType, \"\n- 584 << coerceToId << \" >.\");\n- 585 }\n- 586 };\n- 587\n- 588 template\n-589 class RefinementBuilder<3, CoordType>\n- 590 {\n- 591 static const std::size_t dimension = 3;\n- 592 public:\n- 593 static\n- 594 VirtualRefinement &\n-595 build(unsigned topologyId, unsigned coerceToId)\n- 596 {\n- 597 topologyId &= ~1;\n- 598 coerceToId &= ~1;\n- 599\n- 600 constexpr unsigned idSimplex = GeometryTypes::simplex(dimension).id() &\n-~1;\n- 601 constexpr unsigned idCube = GeometryTypes::cube(dimension).id() & ~1;\n- 602 constexpr unsigned idPrism = GeometryTypes::prism.id() & ~1;\n- 603 constexpr unsigned idPyramid = GeometryTypes::pyramid.id() & ~1;\n- 604\n- 605 switch( topologyId )\n- 606 {\n- 607 //case GeometryType::simplex:\n- 608 case idSimplex :\n- 609 //switch( coerceTo )\n- 610 switch( coerceToId )\n- 611 {\n- 612 //case GeometryType::simplex:\n- 613 case idSimplex :\n- 614 return VirtualRefinementImp<_idSimplex,_CoordType,_idSimplex,_dimension>::\n-instance();\n- 615 default :\n- 616 break;\n- 617 }\n- 618 break;\n- 619\n- 620 //case GeometryType::cube:\n- 621 case idCube :\n- 622 switch( coerceToId )\n- 623 {\n- 624 case idSimplex :\n- 625 return VirtualRefinementImp<_idCube,_CoordType,_idSimplex,_dimension>::\n-instance();\n- 626 case idCube :\n- 627 return VirtualRefinementImp<_idCube,_CoordType,_idCube,_dimension>::\n-instance();\n- 628 default :\n- 629 break;\n- 630 }\n- 631 break;\n- 632\n- 633 //case GeometryType::prism:\n- 634 case idPrism :\n- 635 switch( coerceToId )\n- 636 {\n- 637 case idSimplex :\n- 638 return VirtualRefinementImp<_idPrism,_CoordType,_idSimplex,_dimension>::\n-instance();\n- 639 default :\n- 640 break;\n- 641 }\n- 642 break;\n- 643\n- 644 //case GeometryType::pyramid:\n- 645 case idPyramid :\n- 646 switch( coerceToId )\n- 647 {\n- 648 case idSimplex :\n- 649 return VirtualRefinementImp<_idPyramid,_CoordType,_idSimplex,_dimension>::\n-instance();\n- 650 default :\n- 651 break;\n- 652 }\n- 653 break;\n- 654\n- 655 default :\n- 656 break;\n- 657 }\n- 658 DUNE_THROW( NotImplemented, \"No Refinement<\" << topologyId << \",\n-CoordType, \"\n- 659 << coerceToId << \" >.\");\n- 660 }\n- 661 };\n- 662\n- 663} // namespace Dune\n- 664\n- 665#endif // DUNE_GEOMETRY_VIRTUALREFINEMENT_CC\n+ 391} // namespace Dune\n+ 392\n+ 393#include \"virtualrefinement.cc\"\n+ 394\n+ 395#endif // DUNE_GEOMETRY_VIRTUALREFINEMENT_HH\n+virtualrefinement.cc\n+This file contains the virtual wrapper around refinement.\n+type.hh\n+A unique label for each type of element that can occur in a grid.\n refinement.hh\n This file simply includes all Refinement implementations so you don't have to\n do them separately.\n-type.hh\n-A unique label for each type of element that can occur in a grid.\n Dune\n Definition affinegeometry.hh:21\n Dune::buildRefinement\n VirtualRefinement< dimension, CoordType > & buildRefinement(GeometryType\n geometryType, GeometryType coerceTo)\n return a reference to the VirtualRefinement according to the parameters\n Definition virtualrefinement.cc:503\n-Dune::Codim\n-Static tag representing a codimension.\n-Definition dimension.hh:24\n Dune::RefinementIntervals\n Holds the number of refined intervals per axis needed for virtual and static\n refinement.\n Definition base.cc:94\n-Dune::StaticRefinement\n-Wrap each Refinement implementation to get a consistent interface.\n-Definition base.cc:141\n-Dune::StaticRefinement::eEnd\n-static ElementIterator eEnd(Dune::RefinementIntervals tag)\n-Get an ElementIterator.\n-Definition base.cc:247\n-Dune::StaticRefinement::eBegin\n-static ElementIterator eBegin(Dune::RefinementIntervals tag)\n-Get an ElementIterator.\n-Definition base.cc:237\n-Dune::StaticRefinement::nElements\n-static int nElements(Dune::RefinementIntervals tag)\n-Get the number of Elements.\n-Definition base.cc:227\n-Dune::StaticRefinement::nVertices\n-static int nVertices(Dune::RefinementIntervals tag)\n-Get the number of Vertices.\n-Definition base.cc:197\n-Dune::StaticRefinement::vBegin\n-static VertexIterator vBegin(Dune::RefinementIntervals tag)\n-Get a VertexIterator.\n-Definition base.cc:207\n-Dune::StaticRefinement::IndexVector\n-typedef IndexVector\n-The IndexVector of the Refinement.\n-Definition base.cc:177\n-Dune::StaticRefinement::vEnd\n-static VertexIterator vEnd(Dune::RefinementIntervals tag)\n-Get a VertexIterator.\n-Definition base.cc:217\n Dune::GeometryType\n Unique label for each type of entities that can occur in DUNE grids.\n Definition type.hh:126\n-Dune::GeometryType::dim\n-constexpr unsigned int dim() const\n-Return dimension of the type.\n-Definition type.hh:372\n-Dune::GeometryType::id\n-constexpr unsigned int id() const\n-Return the topology id of the type.\n-Definition type.hh:377\n-Dune::VirtualRefinementSubEntityIteratorSpecial\n-Definition virtualrefinement.cc:72\n-Dune::VirtualRefinementSubEntityIteratorSpecial<_dimension,_CoordType,_0_>::\n-Common\n-Refinement::template Codim< 0 >::SubEntityIterator Common\n-Definition virtualrefinement.cc:85\n-Dune::VirtualRefinementSubEntityIteratorSpecial<_dimension,_CoordType,_0_>::\n-Refinement\n-VirtualRefinement< dimension, CoordType > Refinement\n-Definition virtualrefinement.cc:84\n-Dune::VirtualRefinementSubEntityIteratorSpecial<_dimension,_CoordType,_0_>::\n-IndexVector\n-Refinement::IndexVector IndexVector\n-Definition virtualrefinement.cc:86\n-Dune::VirtualRefinement::Codim<_codimension_>::coords\n-VirtualRefinement< dimension, CoordType >::template Codim< codimension >::\n-SubEntityIterator::CoordVector coords() const\n-Dune::VirtualRefinement::Codim<_codimension_>::SubEntityIterator\n-SubEntityIterator(const This &other)\n-Dune::VirtualRefinement::Codim<_codimension_>::operator=\n-This & operator=(const This &other)\n-Dune::VirtualRefinement::Codim<_codimension_>::index\n-int index() const\n-Dune::VirtualRefinement::Codim<_codimension_>::~SubEntityIterator\n-~SubEntityIterator()\n-Dune::VirtualRefinement::Codim<_codimension_>::SubEntityIterator\n-SubEntityIterator(IteratorBack *backend)\n-Dune::VirtualRefinement::Codim<_codimension_>::IteratorBack\n-Refinement::template SubEntityIteratorBack< codimension > IteratorBack\n-Definition virtualrefinement.cc:109\n-Dune::VirtualRefinement::Codim<_codimension_>::CoordVector\n-Refinement::CoordVector CoordVector\n-Definition virtualrefinement.cc:110\n-Dune::VirtualRefinement::Codim<_codimension_>::This\n-Refinement::template Codim< codimension >::SubEntityIterator This\n-Definition virtualrefinement.cc:108\n-Dune::VirtualRefinement::Codim<_codimension_>::equals\n-bool equals(const This &other) const\n-Dune::VirtualRefinement::Codim<_codimension_>::Refinement\n-VirtualRefinement< dimension, CoordType > Refinement\n-Definition virtualrefinement.cc:107\n-Dune::VirtualRefinement::Codim<_codimension_>::increment\n-void increment()\n-Dune::VirtualRefinementSubEntityIteratorBackSpecial\n-Definition virtualrefinement.cc:200\n-Dune::VirtualRefinementSubEntityIteratorBackSpecial<_dimension,_CoordType,\n-dimension_>::~VirtualRefinementSubEntityIteratorBackSpecial\n-virtual ~VirtualRefinementSubEntityIteratorBackSpecial()\n-Definition virtualrefinement.cc:208\n-Dune::VirtualRefinementSubEntityIteratorBackSpecial<_dimension,_CoordType,_0\n->::vertexIndices\n-virtual IndexVector vertexIndices() const =0\n-Dune::VirtualRefinementSubEntityIteratorBackSpecial<_dimension,_CoordType,_0\n->::Refinement\n-VirtualRefinement< dimension, CoordType > Refinement\n-Definition virtualrefinement.cc:217\n-Dune::VirtualRefinementSubEntityIteratorBackSpecial<_dimension,_CoordType,_0\n->::IndexVector\n-Refinement::IndexVector IndexVector\n-Definition virtualrefinement.cc:218\n-Dune::VirtualRefinementSubEntityIteratorBackSpecial<_dimension,_CoordType,_0\n->::~VirtualRefinementSubEntityIteratorBackSpecial\n-virtual ~VirtualRefinementSubEntityIteratorBackSpecial()\n-Definition virtualrefinement.cc:222\n Dune::VirtualRefinement::SubEntityIteratorBack\n Definition virtualrefinement.cc:231\n-Dune::VirtualRefinement::SubEntityIteratorBack::index\n-virtual int index() const =0\n-Dune::VirtualRefinement::SubEntityIteratorBack::This\n-Refinement::template SubEntityIteratorBack< codimension > This\n-Definition virtualrefinement.cc:234\n-Dune::VirtualRefinement::SubEntityIteratorBack::clone\n-virtual This * clone() const =0\n-Dune::VirtualRefinement::SubEntityIteratorBack::CoordVector\n-Refinement::CoordVector CoordVector\n-Definition virtualrefinement.cc:235\n-Dune::VirtualRefinement::SubEntityIteratorBack::Refinement\n-VirtualRefinement< dimension, CoordType > Refinement\n-Definition virtualrefinement.cc:233\n-Dune::VirtualRefinement::SubEntityIteratorBack::operator==\n-virtual bool operator==(const This &other) const =0\n-Dune::VirtualRefinement::SubEntityIteratorBack::coords\n-virtual CoordVector coords() const =0\n-Dune::VirtualRefinement::SubEntityIteratorBack::~SubEntityIteratorBack\n-virtual ~SubEntityIteratorBack()\n-Definition virtualrefinement.cc:237\n-Dune::VirtualRefinement::SubEntityIteratorBack::operator++\n-virtual This & operator++()=0\n-Dune::VirtualRefinementImp\n-Definition virtualrefinement.cc:261\n-Dune::VirtualRefinementImp::nVertices\n-int nVertices(Dune::RefinementIntervals tag) const\n-Get the number of Vertices.\n-Definition virtualrefinement.cc:295\n-Dune::VirtualRefinementImp::VirtualRefinement\n-Dune::VirtualRefinement< dimension, CoordType > VirtualRefinement\n-Definition virtualrefinement.cc:264\n-Dune::VirtualRefinementImp::nElements\n-int nElements(Dune::RefinementIntervals tag) const\n-Get the number of Elements.\n-Definition virtualrefinement.cc:320\n-Dune::VirtualRefinementImp::instance\n-static VirtualRefinementImp< topologyId, CoordType, coerceToId, dimension > &\n-instance()\n-Definition virtualrefinement.cc:286\n-Dune::VirtualRefinementImp::StaticRefinement\n-Dune::StaticRefinement< topologyId, CoordType, coerceToId, dimension >\n-StaticRefinement\n-Definition virtualrefinement.cc:263\n-Dune::VirtualRefinementImp::SubEntityIteratorBack\n-Definition virtualrefinement.cc:397\n-Dune::VirtualRefinementImp::SubEntityIteratorBack::Base\n-VirtualRefinement::template SubEntityIteratorBack< codimension > Base\n-Definition virtualrefinement.cc:401\n-Dune::VirtualRefinementImp::SubEntityIteratorBack::This\n-VirtualRefinementImp< topologyId, CoordType, coerceToId, dimension >::template\n-SubEntityIteratorBack< codimension > This\n-Definition virtualrefinement.cc:400\n-Dune::VirtualRefinementImp::SubEntityIteratorBack::BackendIterator\n-StaticRefinement::template Codim< codimension >::SubEntityIterator\n-BackendIterator\n-Definition virtualrefinement.cc:399\n-Dune::VirtualRefinementImp::SubEntityIteratorBack::CoordVector\n-VirtualRefinement::CoordVector CoordVector\n-Definition virtualrefinement.cc:402\n-Dune::VirtualRefinementImpSubEntityIteratorBackSpecial\n-Definition virtualrefinement.cc:350\n-Dune::VirtualRefinementImpSubEntityIteratorBackSpecial<_topologyId,_CoordType,\n-coerceToId,_dimension,_0_>::Common\n-VirtualRefinementImp::template SubEntityIteratorBack< 0 > Common\n-Definition virtualrefinement.cc:368\n-Dune::VirtualRefinementImpSubEntityIteratorBackSpecial<_topologyId,_CoordType,\n-coerceToId,_dimension,_0_>::IndexVector\n-RefinementBase::IndexVector IndexVector\n-Definition virtualrefinement.cc:371\n-Dune::VirtualRefinementImpSubEntityIteratorBackSpecial<_topologyId,_CoordType,\n-coerceToId,_dimension,_0_>::RefinementBase\n-VirtualRefinement< dimension, CoordType > RefinementBase\n-Definition virtualrefinement.cc:370\n-Dune::VirtualRefinementImpSubEntityIteratorBackSpecial<_topologyId,_CoordType,\n-coerceToId,_dimension,_0_>::VirtualRefinementImp\n-Dune::VirtualRefinementImp< topologyId, CoordType, coerceToId, dimension >\n-VirtualRefinementImp\n-Definition virtualrefinement.cc:367\n-Dune::VirtualRefinementImpSubEntityIteratorBackSpecial<_topologyId,_CoordType,\n-coerceToId,_dimension,_0_>::StaticRefinement\n-VirtualRefinementImp::StaticRefinement StaticRefinement\n-Definition virtualrefinement.cc:369\n-Dune::RefinementBuilder\n-Definition virtualrefinement.cc:518\n-Dune::RefinementBuilder::build\n-static VirtualRefinement< dimension, CoordType > & build(unsigned topologyId,\n-unsigned coerceToId)\n-Definition virtualrefinement.cc:522\n-Dune::RefinementBuilder<_1,_CoordType_>::build\n-static VirtualRefinement< dimension, CoordType > & build(unsigned topologyId,\n-unsigned coerceToId)\n-Definition virtualrefinement.cc:573\n-Dune::RefinementBuilder<_3,_CoordType_>::build\n-static VirtualRefinement< dimension, CoordType > & build(unsigned topologyId,\n-unsigned coerceToId)\n-Definition virtualrefinement.cc:595\n Dune::VirtualRefinement\n VirtualRefinement base class.\n Definition virtualrefinement.hh:294\n Dune::VirtualRefinement::VertexIteratorBack\n SubEntityIteratorBack< dimension > VertexIteratorBack\n Definition virtualrefinement.hh:318\n+Dune::VirtualRefinement::eEndBack\n+virtual ElementIteratorBack * eEndBack(Dune::RefinementIntervals tag) const =0\n Dune::VirtualRefinement::vBegin\n VertexIterator vBegin(Dune::RefinementIntervals tag) const\n Get an VertexIterator.\n Definition virtualrefinement.cc:38\n Dune::VirtualRefinement::eBegin\n ElementIterator eBegin(Dune::RefinementIntervals tag) const\n Get an ElementIterator.\n Definition virtualrefinement.cc:54\n+Dune::VirtualRefinement::nElements\n+virtual int nElements(Dune::RefinementIntervals tag) const =0\n+Get the number of Elements.\n Dune::VirtualRefinement::eEnd\n ElementIterator eEnd(Dune::RefinementIntervals tag) const\n Get an ElementIterator.\n Definition virtualrefinement.cc:62\n Dune::VirtualRefinement::ElementIterator\n Codim< 0 >::SubEntityIterator ElementIterator\n The ElementIterator of the VirtualRefinement.\n Definition virtualrefinement.hh:301\n+Dune::VirtualRefinement::~VirtualRefinement\n+virtual ~VirtualRefinement()\n+Destructor.\n+Definition virtualrefinement.hh:364\n Dune::VirtualRefinement::vEnd\n VertexIterator vEnd(Dune::RefinementIntervals tag) const\n Get an VertexIterator.\n Definition virtualrefinement.cc:46\n Dune::VirtualRefinement::CoordVector\n FieldVector< CoordType, dimension > CoordVector\n The CoordVector of the VirtualRefinement.\n Definition virtualrefinement.hh:308\n+Dune::VirtualRefinement::nVertices\n+virtual int nVertices(Dune::RefinementIntervals tag) const =0\n+Get the number of Vertices.\n+Dune::VirtualRefinement::IndexVector\n+std::vector< int > IndexVector\n+The IndexVector of the VirtualRefinement.\n+Definition virtualrefinement.hh:314\n Dune::VirtualRefinement::VertexIterator\n Codim< dimension >::SubEntityIterator VertexIterator\n The VertexIterator of the VirtualRefinement.\n Definition virtualrefinement.hh:299\n+Dune::VirtualRefinement::vEndBack\n+virtual VertexIteratorBack * vEndBack(Dune::RefinementIntervals tag) const =0\n Dune::VirtualRefinement::ElementIteratorBack\n SubEntityIteratorBack< 0 > ElementIteratorBack\n Definition virtualrefinement.hh:319\n+Dune::VirtualRefinement::eBeginBack\n+virtual ElementIteratorBack * eBeginBack(Dune::RefinementIntervals tag) const\n+=0\n+Dune::VirtualRefinement::vBeginBack\n+virtual VertexIteratorBack * vBeginBack(Dune::RefinementIntervals tag) const =0\n Dune::VirtualRefinement::Codim\n codim database of VirtualRefinement\n Definition virtualrefinement.hh:378\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00191.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00191.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: referenceelement.hh File Reference\n+dune-geometry: quadraturerules.hh File Reference\n \n \n \n \n \n \n \n@@ -71,38 +71,119 @@\n \n \n \n
    \n \n-
    referenceelement.hh File Reference
    \n+Namespaces |\n+Macros |\n+Enumerations
    \n+
    quadraturerules.hh File Reference
    \n \n
    \n-
    #include <dune/geometry/type.hh>
    \n+
    #include <algorithm>
    \n+#include <iostream>
    \n+#include <limits>
    \n+#include <mutex>
    \n+#include <utility>
    \n+#include <vector>
    \n+#include <dune/common/fvector.hh>
    \n+#include <dune/common/exceptions.hh>
    \n+#include <dune/common/stdstreams.hh>
    \n+#include <dune/common/stdthread.hh>
    \n+#include <dune/common/visibility.hh>
    \n+#include <dune/geometry/type.hh>
    \n+#include <dune/geometry/typeindex.hh>
    \n+#include "quadraturerules/pointquadrature.hh"
    \n+#include "quadraturerules/gausslobattoquadrature.hh"
    \n+#include "quadraturerules/gaussquadrature.hh"
    \n+#include "quadraturerules/gaussradauleftquadrature.hh"
    \n+#include "quadraturerules/gaussradaurightquadrature.hh"
    \n+#include "quadraturerules/jacobi1quadrature.hh"
    \n+#include "quadraturerules/jacobi2quadrature.hh"
    \n+#include "quadraturerules/jacobiNquadrature.hh"
    \n+#include "quadraturerules/prismquadrature.hh"
    \n+#include "quadraturerules/simplexquadrature.hh"
    \n+#include "quadraturerules/tensorproductquadrature.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 Classes

    class  Dune::Geo::ReferenceElement< Implementation >
     This class provides access to geometric and topological properties of a reference element. More...
    class  Dune::QuadratureOrderOutOfRange
     Exception thrown if a desired QuadratureRule is not available, because the requested order is to high. More...
     
    struct  Dune::Geo::ReferenceElement< Implementation >::Codim< codim >
     Collection of types depending on the codimension. More...
    class  Dune::QuadraturePoint< ct, dim >
     Single evaluation point in a quadrature rule. More...
     
    class  Dune::QuadratureRule< ct, dim >
     Abstract base class for quadrature rules. More...
     
    class  Dune::QuadratureRules< ctype, dim >
     A container for all quadrature rules of dimension dim More...
     
    class  Dune::QuadratureRuleFactory< ctype, dim >
     Factory class for creation of quadrature rules, depending on GeometryType, order and QuadratureType. More...
     
    class  Dune::QuadratureRuleFactory< ctype, 0 >
     
    class  Dune::QuadratureRuleFactory< ctype, 1 >
     
    class  Dune::QuadratureRuleFactory< ctype, 2 >
     
    class  Dune::QuadratureRuleFactory< ctype, 3 >
     
    \n \n \n \n-\n+\n+\n \n+

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Geo
    namespace  Dune::QuadratureType
     Defines an enum for currently available quadrature rules.
     
    \n+\n+\n+\n+

    \n+Macros

    #define DUNE_INCLUDING_IMPLEMENTATION
     
    \n+\n+\n+\n

    \n+Enumerations

    enum  Dune::QuadratureType::Enum {
    \n+  Dune::QuadratureType::GaussLegendre = 0\n+, Dune::QuadratureType::GaussJacobi_1_0 = 1\n+, Dune::QuadratureType::GaussJacobi_2_0 = 2\n+, Dune::QuadratureType::GaussJacobi_n_0 = 3\n+,
    \n+  Dune::QuadratureType::GaussLobatto = 4\n+, Dune::QuadratureType::GaussRadauLeft = 5\n+, Dune::QuadratureType::GaussRadauRight = 6\n+, Dune::QuadratureType::size\n+
    \n+ }
     
    \n+

    Detailed Description

    \n+

    Interface for quadrature points and rules

    \n+

    Macro Definition Documentation

    \n+\n+

    ◆ DUNE_INCLUDING_IMPLEMENTATION

    \n+\n+
    \n+
    \n+ \n+ \n+ \n+ \n+
    #define DUNE_INCLUDING_IMPLEMENTATION
    \n+
    \n+\n+
    \n+
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,27 +6,87 @@\n dune-geometry\u00a02.9.0\n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n-Classes | Namespaces\n-referenceelement.hh File Reference\n+Classes | Namespaces | Macros | Enumerations\n+quadraturerules.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 \"quadraturerules/pointquadrature.hh\"\n+#include \"quadraturerules/gausslobattoquadrature.hh\"\n+#include \"quadraturerules/gaussquadrature.hh\"\n+#include \"quadraturerules/gaussradauleftquadrature.hh\"\n+#include \"quadraturerules/gaussradaurightquadrature.hh\"\n+#include \"quadraturerules/jacobi1quadrature.hh\"\n+#include \"quadraturerules/jacobi2quadrature.hh\"\n+#include \"quadraturerules/jacobiNquadrature.hh\"\n+#include \"quadraturerules/prismquadrature.hh\"\n+#include \"quadraturerules/simplexquadrature.hh\"\n+#include \"quadraturerules/tensorproductquadrature.hh\"\n Go_to_the_source_code_of_this_file.\n Classes\n- class \u00a0Dune::Geo::ReferenceElement<_Implementation_>\n-\u00a0 This class provides access to geometric and topological properties of\n- a reference element. More...\n+class \u00a0Dune::QuadratureOrderOutOfRange\n+\u00a0 Exception thrown if a desired QuadratureRule is not available, because\n+ the requested order is to high. More...\n \u00a0\n-struct \u00a0Dune::Geo::ReferenceElement<_Implementation_>::Codim<_codim_>\n-\u00a0 Collection of types depending on the codimension. More...\n+class \u00a0Dune::QuadraturePoint<_ct,_dim_>\n+\u00a0 Single evaluation point in a quadrature rule. More...\n+\u00a0\n+class \u00a0Dune::QuadratureRule<_ct,_dim_>\n+\u00a0 Abstract base class for quadrature rules. More...\n+\u00a0\n+class \u00a0Dune::QuadratureRules<_ctype,_dim_>\n+\u00a0 A container for all quadrature rules of dimension dim More...\n+\u00a0\n+class \u00a0Dune::QuadratureRuleFactory<_ctype,_dim_>\n+\u00a0 Factory class for creation of quadrature rules, depending on\n+ GeometryType, order and QuadratureType. More...\n+\u00a0\n+class \u00a0Dune::QuadratureRuleFactory<_ctype,_0_>\n+\u00a0\n+class \u00a0Dune::QuadratureRuleFactory<_ctype,_1_>\n+\u00a0\n+class \u00a0Dune::QuadratureRuleFactory<_ctype,_2_>\n+\u00a0\n+class \u00a0Dune::QuadratureRuleFactory<_ctype,_3_>\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n-namespace \u00a0Dune::Geo\n+namespace \u00a0Dune::QuadratureType\n+\u00a0 Defines an enum for currently available quadrature rules.\n+\u00a0\n+ Macros\n+#define\u00a0DUNE_INCLUDING_IMPLEMENTATION\n+\u00a0\n+ Enumerations\n+enum \u00a0Dune::QuadratureType::Enum {\n+ \u00a0\u00a0Dune::QuadratureType::GaussLegendre = 0 , Dune::QuadratureType::\n+ GaussJacobi_1_0 = 1 , Dune::QuadratureType::GaussJacobi_2_0 = 2 , Dune::\n+ QuadratureType::GaussJacobi_n_0 = 3 ,\n+ \u00a0\u00a0Dune::QuadratureType::GaussLobatto = 4 , Dune::QuadratureType::\n+ GaussRadauLeft = 5 , Dune::QuadratureType::GaussRadauRight = 6 , Dune::\n+ QuadratureType::size\n+ }\n \u00a0\n+***** Detailed Description *****\n+Interface for quadrature points and rules\n+***** Macro Definition Documentation *****\n+***** \u25c6\u00a0DUNE_INCLUDING_IMPLEMENTATION *****\n+#define DUNE_INCLUDING_IMPLEMENTATION\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00191_source.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00191_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: referenceelement.hh Source File\n+dune-geometry: quadraturerules.hh Source File\n \n \n \n \n \n \n \n@@ -74,260 +74,474 @@\n \n
    \n \n
    \n
    \n
    \n-
    referenceelement.hh
    \n+
    quadraturerules.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
    \n
    4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n-
    5#ifndef DUNE_GEOMETRY_REFERENCEELEMENT_HH
    \n-
    6#define DUNE_GEOMETRY_REFERENCEELEMENT_HH
    \n-
    7
    \n-\n-
    9
    \n-
    10namespace Dune {
    \n-
    11 namespace Geo {
    \n-
    12
    \n-
    13 namespace Impl {
    \n-
    14
    \n-
    15 // forward declaration for friend declaration
    \n-
    16 template<typename ctype, int dim>
    \n-
    17 class ReferenceElementContainer;
    \n-
    18
    \n-
    19 }
    \n-
    20
    \n-
    21 // forward declaration for constructing default reference element type
    \n-
    22 template<typename ctype, int dim>
    \n-
    23 class ReferenceElementImplementation;
    \n+
    5
    \n+
    6#ifndef DUNE_GEOMETRY_QUADRATURERULES_HH
    \n+
    7#define DUNE_GEOMETRY_QUADRATURERULES_HH
    \n+
    8
    \n+
    9#include <algorithm>
    \n+
    10#include <iostream>
    \n+
    11#include <limits>
    \n+
    12#include <mutex>
    \n+
    13#include <utility>
    \n+
    14#include <vector>
    \n+
    15
    \n+
    16#include <dune/common/fvector.hh>
    \n+
    17#include <dune/common/exceptions.hh>
    \n+
    18#include <dune/common/stdstreams.hh>
    \n+
    19#include <dune/common/stdthread.hh>
    \n+
    20#include <dune/common/visibility.hh>
    \n+
    21
    \n+
    22#include <dune/geometry/type.hh>
    \n+\n
    24
    \n-
    25 // forward declaration for backwards compatibility conversion
    \n-
    26 template<typename ctype, int dim>
    \n-
    27 struct ReferenceElements;
    \n-
    28
    \n-
    29 // ReferenceElement
    \n-
    30 // ----------------
    \n+
    30namespace Dune {
    \n
    31
    \n-
    50 template<typename Implementation>
    \n-
    \n-\n-
    52 {
    \n-
    53
    \n-
    54 public:
    \n-
    55
    \n-
    56#ifndef DOXYGEN
    \n-
    57
    \n-
    59 template<int codim>
    \n-
    60 using Codim = typename Implementation::template Codim<codim>;
    \n-
    61
    \n-
    62#else
    \n-
    63
    \n-
    65 template< int codim >
    \n-
    \n-
    66 struct Codim
    \n-
    67 {
    \n-
    69 using Geometry = implementation-defined;
    \n-
    70 };
    \n-
    \n-
    71
    \n-
    72#endif // DOXYGEN
    \n-
    73
    \n-
    75 using ctype = typename Implementation::ctype;
    \n-
    76
    \n-\n-
    79
    \n-
    81 using Coordinate = typename Implementation::Coordinate;
    \n-
    82
    \n-
    84 typedef ctype Volume;
    \n-
    85
    \n-
    87 static constexpr int dimension = Implementation::dimension;
    \n-
    88
    \n-
    89
    \n-
    \n-
    94 int size(int c) const
    \n-
    95 {
    \n-
    96 return _impl->size(c);
    \n-
    97 }
    \n-
    \n-
    98
    \n-
    99
    \n-
    \n-
    111 int size(int i, int c, int cc) const
    \n-
    112 {
    \n-
    113 return _impl->size(i,c,cc);
    \n-
    114 }
    \n-
    \n-
    115
    \n-
    116
    \n-
    \n-
    130 int subEntity(int i, int c, int ii, int cc) const
    \n-
    131 {
    \n-
    132 return _impl->subEntity(i,c,ii,cc);
    \n-
    133 }
    \n-
    \n-
    134
    \n-
    \n-
    153 auto subEntities ( int i, int c, int cc ) const
    \n-
    154 {
    \n-
    155 return _impl->subEntities(i,c,cc);
    \n-
    156 }
    \n-
    \n-
    157
    \n-
    158
    \n-
    \n-
    171 decltype(auto) type(int i, int c) const
    \n-
    172 {
    \n-
    173 return _impl->type(i,c);
    \n-
    174 }
    \n-
    \n+
    36 class QuadratureOrderOutOfRange : public NotImplemented {};
    \n+
    37
    \n+
    43 template<typename ct, int dim>
    \n+
    \n+\n+
    45 public:
    \n+
    47 constexpr static int dimension = dim;
    \n+
    48
    \n+
    50 typedef ct Field;
    \n+
    51
    \n+
    53 typedef Dune::FieldVector<ct,dim> Vector;
    \n+
    54
    \n+
    \n+
    56 QuadraturePoint (const Vector& x, ct w) : local(x)
    \n+
    57 {
    \n+
    58 weight_ = w;
    \n+
    59 }
    \n+
    \n+
    60
    \n+
    \n+
    62 const Vector& position () const
    \n+
    63 {
    \n+
    64 return local;
    \n+
    65 }
    \n+
    \n+
    66
    \n+
    \n+
    68 const ct &weight () const
    \n+
    69 {
    \n+
    70 return weight_;
    \n+
    71 }
    \n+
    \n+
    72
    \n+
    73 protected:
    \n+
    74 FieldVector<ct, dim> local;
    \n+\n+
    76 };
    \n+
    \n+
    77
    \n+
    \n+
    81 namespace QuadratureType {
    \n+
    \n+
    82 enum Enum {
    \n+\n+
    93
    \n+\n+
    100
    \n+\n+
    107
    \n+\n+
    120
    \n+\n+
    128
    \n+\n+
    136
    \n+\n+
    145 size
    \n+
    146 };
    \n+
    \n+
    147 }
    \n+
    \n+
    148
    \n+
    152 template<typename ct, int dim>
    \n+
    \n+
    153 class QuadratureRule : public std::vector<QuadraturePoint<ct,dim> >
    \n+
    154 {
    \n+
    155 public:
    \n+\n+
    162
    \n+
    163 protected:
    \n+\n+
    166
    \n+\n+
    169 public:
    \n+
    171 constexpr static int d = dim;
    \n+
    172
    \n+
    174 typedef ct CoordType;
    \n
    175
    \n-
    176
    \n-
    \n-
    184 decltype(auto) type() const
    \n-
    185 {
    \n-
    186 return _impl->type();
    \n-
    187 }
    \n-
    \n-
    188
    \n-
    189
    \n-
    \n-
    203 decltype(auto) position(int i, int c) const
    \n-
    204 {
    \n-
    205 return _impl->position(i,c);
    \n-
    206 }
    \n-
    \n+
    177 virtual int order () const { return delivered_order; }
    \n+
    178
    \n+
    180 virtual GeometryType type () const { return geometry_type; }
    \n+
    181 virtual ~QuadratureRule(){}
    \n+
    182
    \n+
    185 typedef typename std::vector<QuadraturePoint<ct,dim> >::const_iterator iterator;
    \n+
    186
    \n+
    187 protected:
    \n+\n+\n+
    190 };
    \n+
    \n+
    191
    \n+
    192 // Forward declaration of the factory class,
    \n+
    193 // needed internally by the QuadratureRules container class.
    \n+
    194 template<typename ctype, int dim> class QuadratureRuleFactory;
    \n+
    195
    \n+
    199 template<typename ctype, int dim>
    \n+
    \n+\n+
    201
    \n+\n+
    204
    \n+
    205 // indexed by quadrature order
    \n+
    206 using QuadratureOrderVector = std::vector<std::pair<std::once_flag, QuadratureRule> >;
    \n
    207
    \n-
    208
    \n-
    \n-
    216 bool checkInside(const Coordinate& local) const
    \n-
    217 {
    \n-
    218 return _impl->checkInside(local);
    \n-
    219 }
    \n-
    \n+
    208 // indexed by geometry type
    \n+
    209 using GeometryTypeVector = std::vector<std::pair<std::once_flag, QuadratureOrderVector> >;
    \n+
    210
    \n+
    211 // indexed by quadrature type enum
    \n+
    212 using QuadratureCacheVector = std::vector<std::pair<std::once_flag, GeometryTypeVector> >;
    \n+
    213
    \n+
    215 DUNE_EXPORT const QuadratureRule& _rule(const GeometryType& t, int p, QuadratureType::Enum qt=QuadratureType::GaussLegendre) const
    \n+
    216 {
    \n+
    217 assert(t.dim()==dim);
    \n+
    218
    \n+
    219 DUNE_ASSERT_CALL_ONCE();
    \n
    220
    \n-
    221
    \n-
    233 template<int codim>
    \n-
    \n-
    234 typename Codim<codim>::Geometry geometry(int i) const
    \n-
    235 {
    \n-
    236 return _impl->template geometry<codim>(i);
    \n-
    237 }
    \n-
    \n-
    238
    \n-
    239
    \n-
    \n-\n-
    242 {
    \n-
    243 return _impl->volume();
    \n-
    244 }
    \n-
    \n-
    245
    \n+
    221 static QuadratureCacheVector quadratureCache(QuadratureType::size);
    \n+
    222
    \n+
    223 auto& [ onceFlagQuadratureType, geometryTypes ] = quadratureCache[qt];
    \n+
    224 // initialize geometry types for this quadrature type once
    \n+
    225 std::call_once(onceFlagQuadratureType, [&types = geometryTypes]{
    \n+
    226 types = GeometryTypeVector(LocalGeometryTypeIndex::size(dim));
    \n+
    227 });
    \n+
    228
    \n+
    229 auto& [ onceFlagGeometryType, quadratureOrders ] = geometryTypes[LocalGeometryTypeIndex::index(t)];
    \n+
    230 // initialize quadrature orders for this geometry type and quadrature type once
    \n+
    231 std::call_once(onceFlagGeometryType, [&, &orders = quadratureOrders]{
    \n+
    232 // we only need one quadrature rule for points, not maxint
    \n+
    233 const auto numRules = dim == 0 ? 1 : QuadratureRuleFactory<ctype,dim>::maxOrder(t, qt)+1;
    \n+
    234 orders = QuadratureOrderVector(numRules);
    \n+
    235 });
    \n+
    236
    \n+
    237 // we only have one quadrature rule for points
    \n+
    238 auto& [ onceFlagQuadratureOrder, quadratureRule ] = quadratureOrders[dim == 0 ? 0 : p];
    \n+
    239 // initialize quadrature rule once
    \n+
    240 std::call_once(onceFlagQuadratureOrder, [&, &rule = quadratureRule]{
    \n+\n+
    242 });
    \n+
    243
    \n+
    244 return quadratureRule;
    \n+
    245 }
    \n
    246
    \n-
    \n-
    258 decltype(auto) integrationOuterNormal(int face) const
    \n-
    259 {
    \n-
    260 return _impl->integrationOuterNormal(face);
    \n-
    261 }
    \n-
    \n-
    262
    \n-
    263
    \n-
    \n-\n-
    272 : _impl(nullptr)
    \n-
    273 {}
    \n-
    \n-
    274
    \n-
    \n-
    280 const Implementation& impl() const
    \n-
    281 {
    \n-
    282 return *_impl;
    \n-
    283 }
    \n-
    \n-
    284
    \n-
    \n-
    286 bool operator==(const ReferenceElement& r) const
    \n-
    287 {
    \n-
    288 return _impl == r._impl;
    \n-
    289 }
    \n-
    \n-
    290
    \n-
    \n-
    292 bool operator!=(const ReferenceElement& r) const
    \n-
    293 {
    \n-
    294 return not (*this == r);
    \n-
    295 }
    \n-
    \n-
    296
    \n-
    \n-
    298 friend std::size_t hash_value(const ReferenceElement& r)
    \n-
    299 {
    \n-
    300 return reinterpret_cast<std::size_t>(r._impl);
    \n-
    301 }
    \n-
    \n+
    248 DUNE_EXPORT static QuadratureRules& instance()
    \n+
    249 {
    \n+
    250 static QuadratureRules instance;
    \n+
    251 return instance;
    \n+
    252 }
    \n+
    253
    \n+
    255 QuadratureRules () = default;
    \n+
    256 public:
    \n+
    258 static unsigned
    \n+\n+
    264
    \n+
    \n+\n+
    267 {
    \n+
    268 return instance()._rule(t,p,qt);
    \n+
    269 }
    \n+
    \n+
    270
    \n+
    \n+\n+
    273 {
    \n+
    274 GeometryType gt(t,dim);
    \n+
    275 return instance()._rule(gt,p,qt);
    \n+
    276 }
    \n+
    \n+
    277 };
    \n+
    \n+
    278
    \n+
    279} // end namespace Dune
    \n+
    280
    \n+
    281#define DUNE_INCLUDING_IMPLEMENTATION
    \n+
    282
    \n+
    283// 0d rules
    \n+
    284#include "quadraturerules/pointquadrature.hh"
    \n+
    285// 1d rules
    \n+
    286#include "quadraturerules/gausslobattoquadrature.hh"
    \n+
    287#include "quadraturerules/gaussquadrature.hh"
    \n+
    288#include "quadraturerules/gaussradauleftquadrature.hh"
    \n+
    289#include "quadraturerules/gaussradaurightquadrature.hh"
    \n+
    290#include "quadraturerules/jacobi1quadrature.hh"
    \n+
    291#include "quadraturerules/jacobi2quadrature.hh"
    \n+
    292#include "quadraturerules/jacobiNquadrature.hh"
    \n+
    293// 3d rules
    \n+
    294#include "quadraturerules/prismquadrature.hh"
    \n+
    295// general rules
    \n+
    296#include "quadraturerules/simplexquadrature.hh"
    \n+
    297#include "quadraturerules/tensorproductquadrature.hh"
    \n+
    298
    \n+
    299#undef DUNE_INCLUDING_IMPLEMENTATION
    \n+
    300
    \n+
    301namespace Dune {
    \n
    302
    \n-
    303 private:
    \n-
    304
    \n-
    305 // The implementation must be a friend to construct a wrapper around itself.
    \n-
    306 friend Implementation;
    \n-
    307
    \n-
    308 // The reference container is a friend to be able to call setImplementation.
    \n-
    309 friend class Impl::ReferenceElementContainer<ctype,dimension>;
    \n-
    310
    \n-
    311 // Constructor for wrapping an implementation reference (required internally by the default implementation)
    \n-
    312 ReferenceElement(const Implementation& impl)
    \n-
    313 : _impl(&impl)
    \n-
    314 {}
    \n-
    315
    \n-
    316 void setImplementation(const Implementation& impl)
    \n-
    317 {
    \n-
    318 _impl = &impl;
    \n-
    319 }
    \n-
    320
    \n-
    321 const Implementation* _impl;
    \n-
    322
    \n-
    323 };
    \n+
    309 template<typename ctype, int dim>
    \n+
    \n+\n+
    311 private:
    \n+
    312 friend class QuadratureRules<ctype, dim>;
    \n+
    313 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum qt)
    \n+
    314 {
    \n+
    315 return TensorProductQuadratureRule<ctype,dim>::maxOrder(t.id(), qt);
    \n+
    316 }
    \n+
    317 static QuadratureRule<ctype, dim> rule(const GeometryType& t, int p, QuadratureType::Enum qt)
    \n+
    318 {
    \n+
    319 return TensorProductQuadratureRule<ctype,dim>(t.id(), p, qt);
    \n+
    320 }
    \n+
    321 };
    \n
    \n-
    324
    \n-
    325 }
    \n-
    326
    \n-
    327}
    \n-
    328
    \n-
    329
    \n-
    330#endif // DUNE_GEOMETRY_REFERENCEELEMENT_HH
    \n+
    322
    \n+
    323 template<typename ctype>
    \n+
    \n+
    324 class QuadratureRuleFactory<ctype, 0> {
    \n+
    325 private:
    \n+
    326 constexpr static int dim = 0;
    \n+
    327 friend class QuadratureRules<ctype, dim>;
    \n+
    328 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum)
    \n+
    329 {
    \n+
    330 if (t.isVertex())
    \n+
    331 {
    \n+
    332 return std::numeric_limits<int>::max();
    \n+
    333 }
    \n+
    334 DUNE_THROW(Exception, "Unknown GeometryType");
    \n+
    335 }
    \n+
    336 static QuadratureRule<ctype, dim> rule(const GeometryType& t, int , QuadratureType::Enum)
    \n+
    337 {
    \n+
    338 if (t.isVertex())
    \n+
    339 {
    \n+
    340 return PointQuadratureRule<ctype>();
    \n+
    341 }
    \n+
    342 DUNE_THROW(Exception, "Unknown GeometryType");
    \n+
    343 }
    \n+
    344 };
    \n+
    \n+
    345
    \n+
    346 template<typename ctype>
    \n+
    \n+
    347 class QuadratureRuleFactory<ctype, 1> {
    \n+
    348 private:
    \n+
    349 constexpr static int dim = 1;
    \n+
    350 friend class QuadratureRules<ctype, dim>;
    \n+
    351 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum qt)
    \n+
    352 {
    \n+
    353 if (t.isLine())
    \n+
    354 {
    \n+
    355 switch (qt) {
    \n+\n+
    357 return GaussQuadratureRule1D<ctype>::highest_order;
    \n+\n+
    359 return Jacobi1QuadratureRule1D<ctype>::highest_order;
    \n+\n+
    361 return Jacobi2QuadratureRule1D<ctype>::highest_order;
    \n+\n+
    363 return GaussLobattoQuadratureRule1D<ctype>::highest_order;
    \n+\n+
    365 return JacobiNQuadratureRule1D<ctype>::maxOrder();
    \n+\n+
    367 return GaussRadauLeftQuadratureRule1D<ctype>::highest_order;
    \n+\n+
    369 return GaussRadauRightQuadratureRule1D<ctype>::highest_order;
    \n+
    370 default :
    \n+
    371 DUNE_THROW(Exception, "Unknown QuadratureType");
    \n+
    372 }
    \n+
    373 }
    \n+
    374 DUNE_THROW(Exception, "Unknown GeometryType");
    \n+
    375 }
    \n+
    376 static QuadratureRule<ctype, dim> rule(const GeometryType& t, int p, QuadratureType::Enum qt)
    \n+
    377 {
    \n+
    378 if (t.isLine())
    \n+
    379 {
    \n+
    380 switch (qt) {
    \n+\n+
    382 return GaussQuadratureRule1D<ctype>(p);
    \n+\n+
    384 return Jacobi1QuadratureRule1D<ctype>(p);
    \n+\n+
    386 return Jacobi2QuadratureRule1D<ctype>(p);
    \n+\n+
    388 return GaussLobattoQuadratureRule1D<ctype>(p);
    \n+\n+
    390 return JacobiNQuadratureRule1D<ctype>(p);
    \n+\n+
    392 return GaussRadauLeftQuadratureRule1D<ctype>(p);
    \n+\n+
    394 return GaussRadauRightQuadratureRule1D<ctype>(p);
    \n+
    395 default :
    \n+
    396 DUNE_THROW(Exception, "Unknown QuadratureType");
    \n+
    397 }
    \n+
    398 }
    \n+
    399 DUNE_THROW(Exception, "Unknown GeometryType");
    \n+
    400 }
    \n+
    401 };
    \n+
    \n+
    402
    \n+
    403 template<typename ctype>
    \n+
    \n+
    404 class QuadratureRuleFactory<ctype, 2> {
    \n+
    405 private:
    \n+
    406 constexpr static int dim = 2;
    \n+
    407 friend class QuadratureRules<ctype, dim>;
    \n+
    408 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum qt)
    \n+
    409 {
    \n+
    410 unsigned order =
    \n+
    411 TensorProductQuadratureRule<ctype,dim>::maxOrder(t.id(), qt);
    \n+
    412 if (t.isSimplex())
    \n+
    413 order = std::max
    \n+
    414 (order, unsigned(SimplexQuadratureRule<ctype,dim>::highest_order));
    \n+
    415 return order;
    \n+
    416 }
    \n+
    417 static QuadratureRule<ctype, dim> rule(const GeometryType& t, int p, QuadratureType::Enum qt)
    \n+
    418 {
    \n+
    419 if (t.isSimplex()
    \n+\n+
    421 && p <= SimplexQuadratureRule<ctype,dim>::highest_order)
    \n+
    422 {
    \n+
    423 return SimplexQuadratureRule<ctype,dim>(p);
    \n+
    424 }
    \n+
    425 return TensorProductQuadratureRule<ctype,dim>(t.id(), p, qt);
    \n+
    426 }
    \n+
    427 };
    \n+
    \n+
    428
    \n+
    429 template<typename ctype>
    \n+
    \n+
    430 class QuadratureRuleFactory<ctype, 3> {
    \n+
    431 private:
    \n+
    432 constexpr static int dim = 3;
    \n+
    433 friend class QuadratureRules<ctype, dim>;
    \n+
    434 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum qt)
    \n+
    435 {
    \n+
    436 unsigned order =
    \n+
    437 TensorProductQuadratureRule<ctype,dim>::maxOrder(t.id(), qt);
    \n+
    438 if (t.isSimplex())
    \n+
    439 order = std::max
    \n+
    440 (order, unsigned(SimplexQuadratureRule<ctype,dim>::highest_order));
    \n+
    441 if (t.isPrism())
    \n+
    442 order = std::max
    \n+
    443 (order, unsigned(PrismQuadratureRule<ctype,dim>::highest_order));
    \n+
    444 return order;
    \n+
    445 }
    \n+
    446 static QuadratureRule<ctype, dim> rule(const GeometryType& t, int p, QuadratureType::Enum qt)
    \n+
    447 {
    \n+
    448
    \n+
    449 if (t.isSimplex()
    \n+\n+
    451 && p <= SimplexQuadratureRule<ctype,dim>::highest_order)
    \n+
    452 {
    \n+
    453 return SimplexQuadratureRule<ctype,dim>(p);
    \n+
    454 }
    \n+
    455 if (t.isPrism()
    \n+\n+
    457 && p <= PrismQuadratureRule<ctype,dim>::highest_order)
    \n+
    458 {
    \n+
    459 return PrismQuadratureRule<ctype,dim>(p);
    \n+
    460 }
    \n+
    461 return TensorProductQuadratureRule<ctype,dim>(t.id(), p, qt);
    \n+
    462 }
    \n+
    463 };
    \n+
    \n+
    464
    \n+
    465#ifndef DUNE_NO_EXTERN_QUADRATURERULES
    \n+
    466 extern template class GaussLobattoQuadratureRule<double, 1>;
    \n+
    467 extern template class GaussQuadratureRule<double, 1>;
    \n+
    468 extern template class GaussRadauLeftQuadratureRule<double, 1>;
    \n+
    469 extern template class GaussRadauRightQuadratureRule<double, 1>;
    \n+
    470 extern template class Jacobi1QuadratureRule<double, 1>;
    \n+
    471 extern template class Jacobi2QuadratureRule<double, 1>;
    \n+
    472 extern template class JacobiNQuadratureRule<double, 1>;
    \n+
    473 extern template class PrismQuadratureRule<double, 3>;
    \n+
    474 extern template class SimplexQuadratureRule<double, 2>;
    \n+
    475 extern template class SimplexQuadratureRule<double, 3>;
    \n+
    476#endif // !DUNE_NO_EXTERN_QUADRATURERULES
    \n+
    477
    \n+
    478} // end namespace
    \n+
    479
    \n+
    480#endif // DUNE_GEOMETRY_QUADRATURERULES_HH
    \n
    A unique label for each type of element that can occur in a grid.
    \n+
    Helper classes to provide indices for geometrytypes for use in a vector.
    \n
    Definition affinegeometry.hh:21
    \n-
    This class provides access to geometric and topological properties of a reference element.
    Definition referenceelement.hh:52
    \n-
    CoordinateField volume() const
    obtain the volume of the reference element
    Definition referenceelement.hh:241
    \n-
    ReferenceElement()
    Constructs an empty reference element.
    Definition referenceelement.hh:271
    \n-
    bool operator!=(const ReferenceElement &r) const
    Compares for inequality with another reference element.
    Definition referenceelement.hh:292
    \n-
    decltype(auto) type(int i, int c) const
    obtain the type of subentity (i,c)
    Definition referenceelement.hh:171
    \n-
    typename Implementation::Coordinate Coordinate
    The coordinate type.
    Definition referenceelement.hh:81
    \n-
    Codim< codim >::Geometry geometry(int i) const
    obtain the embedding of subentity (i,codim) into the reference element
    Definition referenceelement.hh:234
    \n-
    static constexpr int dimension
    The dimension of the reference element.
    Definition referenceelement.hh:87
    \n-
    int size(int i, int c, int cc) const
    number of subentities of codimension cc of subentity (i,c)
    Definition referenceelement.hh:111
    \n-
    int subEntity(int i, int c, int ii, int cc) const
    obtain number of ii-th subentity with codim cc of (i,c)
    Definition referenceelement.hh:130
    \n-
    typename Implementation::ctype ctype
    The coordinate field type.
    Definition referenceelement.hh:75
    \n-
    int size(int c) const
    number of subentities of codimension c
    Definition referenceelement.hh:94
    \n-
    decltype(auto) type() const
    obtain the type of this reference element
    Definition referenceelement.hh:184
    \n-
    const Implementation & impl() const
    Returns a reference to the internal implementation object.
    Definition referenceelement.hh:280
    \n-
    bool checkInside(const Coordinate &local) const
    check if a coordinate is in the reference element
    Definition referenceelement.hh:216
    \n-
    ctype CoordinateField
    The coordinate field type.
    Definition referenceelement.hh:78
    \n-
    bool operator==(const ReferenceElement &r) const
    Compares for equality with another reference element.
    Definition referenceelement.hh:286
    \n-
    decltype(auto) position(int i, int c) const
    position of the barycenter of entity (i,c)
    Definition referenceelement.hh:203
    \n-
    decltype(auto) integrationOuterNormal(int face) const
    obtain the integration outer normal of the reference element
    Definition referenceelement.hh:258
    \n-
    friend std::size_t hash_value(const ReferenceElement &r)
    Yields a hash value suitable for storing the reference element a in hash table.
    Definition referenceelement.hh:298
    \n-
    auto subEntities(int i, int c, int cc) const
    Obtain the range of numbers of subentities with codim cc of (i,c)
    Definition referenceelement.hh:153
    \n-
    ctype Volume
    Type used for volume.
    Definition referenceelement.hh:84
    \n-
    Collection of types depending on the codimension.
    Definition referenceelement.hh:67
    \n-
    implementation-defined Geometry
    type of geometry embedding a subentity into the reference element
    Definition referenceelement.hh:69
    \n+
    Enum
    Definition quadraturerules.hh:82
    \n+
    @ GaussJacobi_n_0
    Gauss-Legendre rules with .
    Definition quadraturerules.hh:119
    \n+
    @ GaussJacobi_2_0
    Gauss-Legendre rules with .
    Definition quadraturerules.hh:106
    \n+
    @ GaussRadauRight
    Gauss-Radau rules including the right endpoint.
    Definition quadraturerules.hh:144
    \n+
    @ GaussJacobi_1_0
    Gauss-Jacobi rules with .
    Definition quadraturerules.hh:99
    \n+
    @ size
    Definition quadraturerules.hh:145
    \n+
    @ GaussLobatto
    Gauss-Lobatto rules.
    Definition quadraturerules.hh:127
    \n+
    @ GaussRadauLeft
    Gauss-Radau rules including the left endpoint.
    Definition quadraturerules.hh:135
    \n+
    @ GaussLegendre
    Gauss-Legendre rules (default)
    Definition quadraturerules.hh:92
    \n+
    Exception thrown if a desired QuadratureRule is not available, because the requested order is to high...
    Definition quadraturerules.hh:36
    \n+
    Single evaluation point in a quadrature rule.
    Definition quadraturerules.hh:44
    \n+
    const Vector & position() const
    return local coordinates of integration point i
    Definition quadraturerules.hh:62
    \n+
    Dune::FieldVector< ct, dim > Vector
    Type used for the position of a quadrature point.
    Definition quadraturerules.hh:53
    \n+
    ct Field
    Number type used for coordinates and quadrature weights.
    Definition quadraturerules.hh:50
    \n+
    const ct & weight() const
    return weight associated with integration point i
    Definition quadraturerules.hh:68
    \n+
    ct weight_
    Definition quadraturerules.hh:75
    \n+
    static constexpr int dimension
    Dimension of the integration domain.
    Definition quadraturerules.hh:47
    \n+
    QuadraturePoint(const Vector &x, ct w)
    set up quadrature of given order in d dimensions
    Definition quadraturerules.hh:56
    \n+
    FieldVector< ct, dim > local
    Definition quadraturerules.hh:74
    \n+
    Abstract base class for quadrature rules.
    Definition quadraturerules.hh:154
    \n+
    virtual ~QuadratureRule()
    Definition quadraturerules.hh:181
    \n+
    static constexpr int d
    The space dimension.
    Definition quadraturerules.hh:171
    \n+
    virtual GeometryType type() const
    return type of element
    Definition quadraturerules.hh:180
    \n+
    int delivered_order
    Definition quadraturerules.hh:189
    \n+
    QuadratureRule(GeometryType t, int order)
    Constructor for a given geometry type and a given quadrature order.
    Definition quadraturerules.hh:168
    \n+
    GeometryType geometry_type
    Definition quadraturerules.hh:188
    \n+
    ct CoordType
    The type used for coordinates.
    Definition quadraturerules.hh:174
    \n+
    QuadratureRule()
    Default constructor.
    Definition quadraturerules.hh:161
    \n+
    virtual int order() const
    return order
    Definition quadraturerules.hh:177
    \n+
    QuadratureRule(GeometryType t)
    Constructor for a given geometry type. Leaves the quadrature order invalid
    Definition quadraturerules.hh:165
    \n+
    std::vector< QuadraturePoint< ct, dim > >::const_iterator iterator
    Definition quadraturerules.hh:185
    \n+
    Factory class for creation of quadrature rules, depending on GeometryType, order and QuadratureType.
    Definition quadraturerules.hh:310
    \n+
    A container for all quadrature rules of dimension dim
    Definition quadraturerules.hh:200
    \n+
    static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum qt=QuadratureType::GaussLegendre)
    maximum quadrature order for given geometry type and quadrature type
    Definition quadraturerules.hh:259
    \n+
    static const QuadratureRule & rule(const GeometryType::BasicType t, int p, QuadratureType::Enum qt=QuadratureType::GaussLegendre)
    select the appropriate QuadratureRule for GeometryType t and order p
    Definition quadraturerules.hh:272
    \n+
    static const QuadratureRule & rule(const GeometryType &t, int p, QuadratureType::Enum qt=QuadratureType::GaussLegendre)
    select the appropriate QuadratureRule for GeometryType t and order p
    Definition quadraturerules.hh:266
    \n+
    Unique label for each type of entities that can occur in DUNE grids.
    Definition type.hh:126
    \n+
    constexpr bool isPrism() const
    Return true if entity is a prism.
    Definition type.hh:321
    \n+
    constexpr bool isVertex() const
    Return true if entity is a vertex.
    Definition type.hh:291
    \n+
    constexpr unsigned int dim() const
    Return dimension of the type.
    Definition type.hh:372
    \n+
    BasicType
    Each entity can be tagged by one of these basic types plus its space dimension.
    Definition type.hh:132
    \n+
    constexpr bool isLine() const
    Return true if entity is a line segment.
    Definition type.hh:296
    \n+
    constexpr unsigned int id() const
    Return the topology id of the type.
    Definition type.hh:377
    \n+
    constexpr bool isSimplex() const
    Return true if entity is a simplex of any dimension.
    Definition type.hh:331
    \n+
    static constexpr std::size_t size(std::size_t dim)
    Compute total number of geometry types for the given dimension.
    Definition typeindex.hh:61
    \n+
    static constexpr std::size_t index(const GeometryType &gt)
    Compute the index for the given geometry type within its dimension.
    Definition typeindex.hh:73
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,296 +7,589 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n-referenceelement.hh\n+quadraturerules.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file\n LICENSE.md in module root\n 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n- 5#ifndef DUNE_GEOMETRY_REFERENCEELEMENT_HH\n- 6#define DUNE_GEOMETRY_REFERENCEELEMENT_HH\n- 7\n- 8#include \n- 9\n- 10namespace Dune {\n- 11 namespace Geo {\n- 12\n- 13 namespace Impl {\n- 14\n- 15 // forward declaration for friend declaration\n- 16 template\n- 17 class ReferenceElementContainer;\n- 18\n- 19 }\n- 20\n- 21 // forward declaration for constructing default reference element type\n- 22 template\n- 23 class ReferenceElementImplementation;\n+ 5\n+ 6#ifndef DUNE_GEOMETRY_QUADRATURERULES_HH\n+ 7#define DUNE_GEOMETRY_QUADRATURERULES_HH\n+ 8\n+ 9#include \n+ 10#include \n+ 11#include \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\n+ 22#include \n+ 23#include \n 24\n- 25 // forward declaration for backwards compatibility conversion\n- 26 template\n- 27 struct ReferenceElements;\n- 28\n- 29 // ReferenceElement\n- 30 // ----------------\n+ 30namespace Dune {\n 31\n- 50 template\n-51 class ReferenceElement\n- 52 {\n- 53\n- 54 public:\n- 55\n- 56#ifndef DOXYGEN\n- 57\n- 59 template\n- 60 using Codim = typename Implementation::template Codim;\n- 61\n- 62#else\n- 63\n- 65 template< int codim >\n-66 struct Codim\n- 67 {\n-69 using Geometry = implementation-defined;\n- 70 };\n- 71\n- 72#endif // DOXYGEN\n- 73\n-75 using ctype = typename Implementation::ctype;\n- 76\n-78 using CoordinateField = ctype;\n- 79\n-81 using Coordinate = typename Implementation::Coordinate;\n- 82\n-84 typedef ctype Volume;\n- 85\n-87 static constexpr int dimension = Implementation::dimension;\n- 88\n- 89\n-94 int size(int c) const\n- 95 {\n- 96 return _impl->size(c);\n- 97 }\n- 98\n- 99\n-111 int size(int i, int c, int cc) const\n- 112 {\n- 113 return _impl->size(i,c,cc);\n- 114 }\n- 115\n- 116\n-130 int subEntity(int i, int c, int ii, int cc) const\n- 131 {\n- 132 return _impl->subEntity(i,c,ii,cc);\n- 133 }\n- 134\n-153 auto subEntities ( int i, int c, int cc ) const\n+36 class QuadratureOrderOutOfRange : public NotImplemented {};\n+ 37\n+ 43 template\n+44 class QuadraturePoint {\n+ 45 public:\n+47 constexpr static int dimension = dim;\n+ 48\n+50 typedef ct Field;\n+ 51\n+53 typedef Dune::FieldVector Vector;\n+ 54\n+56 QuadraturePoint (const Vector& x, ct w) : local(x)\n+ 57 {\n+ 58 weight_ = w;\n+ 59 }\n+ 60\n+62 const Vector& position () const\n+ 63 {\n+ 64 return local;\n+ 65 }\n+ 66\n+68 const ct &weight () const\n+ 69 {\n+ 70 return weight_;\n+ 71 }\n+ 72\n+ 73 protected:\n+74 FieldVector local;\n+75 ct weight_;\n+ 76 };\n+ 77\n+81 namespace QuadratureType {\n+82 enum Enum {\n+92 GaussLegendre = 0,\n+ 93\n+99 GaussJacobi_1_0 = 1,\n+ 100\n+106 GaussJacobi_2_0 = 2,\n+ 107\n+119 GaussJacobi_n_0 = 3,\n+ 120\n+127 GaussLobatto = 4,\n+ 128\n+135 GaussRadauLeft = 5,\n+ 136\n+144 GaussRadauRight = 6,\n+ 145 size\n+146 };\n+ 147 }\n+ 148\n+ 152 template\n+153 class QuadratureRule : public std::vector >\n 154 {\n- 155 return _impl->subEntities(i,c,cc);\n- 156 }\n- 157\n- 158\n-171 decltype(auto) type(int i, int c) const\n- 172 {\n- 173 return _impl->type(i,c);\n- 174 }\n+ 155 public:\n+161 QuadratureRule() : delivered_order(-1) {}\n+ 162\n+ 163 protected:\n+165 QuadratureRule(GeometryType t) : geometry_type(t), delivered_order(-1) {}\n+ 166\n+168 QuadratureRule(GeometryType t, int order) : geometry_type(t),\n+delivered_order(order) {}\n+ 169 public:\n+171 constexpr static int d = dim;\n+ 172\n+174 typedef ct CoordType;\n 175\n- 176\n-184 decltype(auto) type() const\n- 185 {\n- 186 return _impl->type();\n- 187 }\n- 188\n- 189\n-203 decltype(auto) position(int i, int c) const\n- 204 {\n- 205 return _impl->position(i,c);\n- 206 }\n+177 virtual int order () const { return delivered_order; }\n+ 178\n+180 virtual GeometryType type () const { return geometry_type; }\n+181 virtual ~QuadratureRule(){}\n+ 182\n+185 typedef typename std::vector >::const_iterator\n+iterator;\n+ 186\n+ 187 protected:\n+188 GeometryType geometry_type;\n+189 int delivered_order;\n+ 190 };\n+ 191\n+ 192 // Forward declaration of the factory class,\n+ 193 // needed internally by the QuadratureRules container class.\n+ 194 template class QuadratureRuleFactory;\n+ 195\n+ 199 template\n+200 class QuadratureRules {\n+ 201\n+ 203 using QuadratureRule = Dune::QuadratureRule;\n+ 204\n+ 205 // indexed by quadrature order\n+ 206 using QuadratureOrderVector = std::vector >;\n 207\n- 208\n-216 bool checkInside(const Coordinate& local) const\n- 217 {\n- 218 return _impl->checkInside(local);\n- 219 }\n+ 208 // indexed by geometry type\n+ 209 using GeometryTypeVector = std::vector >;\n+ 210\n+ 211 // indexed by quadrature type enum\n+ 212 using QuadratureCacheVector = std::vector >;\n+ 213\n+ 215 DUNE_EXPORT const QuadratureRule& _rule(const GeometryType& t, int p,\n+QuadratureType::Enum qt=QuadratureType::GaussLegendre) const\n+ 216 {\n+ 217 assert(t.dim()==dim);\n+ 218\n+ 219 DUNE_ASSERT_CALL_ONCE();\n 220\n- 221\n- 233 template\n-234 typename Codim::Geometry geometry(int i) const\n- 235 {\n- 236 return _impl->template geometry(i);\n- 237 }\n- 238\n- 239\n-241 CoordinateField volume() const\n- 242 {\n- 243 return _impl->volume();\n- 244 }\n- 245\n+ 221 static QuadratureCacheVector quadratureCache(QuadratureType::size);\n+ 222\n+ 223 auto& [ onceFlagQuadratureType, geometryTypes ] = quadratureCache[qt];\n+ 224 // initialize geometry types for this quadrature type once\n+ 225 std::call_once(onceFlagQuadratureType, [&types = geometryTypes]{\n+ 226 types = GeometryTypeVector(LocalGeometryTypeIndex::size(dim));\n+ 227 });\n+ 228\n+ 229 auto& [ onceFlagGeometryType, quadratureOrders ] = geometryTypes\n+[LocalGeometryTypeIndex::index(t)];\n+ 230 // initialize quadrature orders for this geometry type and quadrature type\n+once\n+ 231 std::call_once(onceFlagGeometryType, [&, &orders = quadratureOrders]{\n+ 232 // we only need one quadrature rule for points, not maxint\n+ 233 const auto numRules = dim == 0 ? 1 : QuadratureRuleFactory::\n+maxOrder(t, qt)+1;\n+ 234 orders = QuadratureOrderVector(numRules);\n+ 235 });\n+ 236\n+ 237 // we only have one quadrature rule for points\n+ 238 auto& [ onceFlagQuadratureOrder, quadratureRule ] = quadratureOrders[dim\n+== 0 ? 0 : p];\n+ 239 // initialize quadrature rule once\n+ 240 std::call_once(onceFlagQuadratureOrder, [&, &rule = quadratureRule]{\n+ 241 rule = QuadratureRuleFactory::rule(t, p, qt);\n+ 242 });\n+ 243\n+ 244 return quadratureRule;\n+ 245 }\n 246\n-258 decltype(auto) integrationOuterNormal(int face) const\n- 259 {\n- 260 return _impl->integrationOuterNormal(face);\n- 261 }\n- 262\n- 263\n-271 ReferenceElement()\n- 272 : _impl(nullptr)\n- 273 {}\n- 274\n-280 const Implementation& impl() const\n- 281 {\n- 282 return *_impl;\n- 283 }\n- 284\n-286 bool operator==(const ReferenceElement& r) const\n- 287 {\n- 288 return _impl == r._impl;\n- 289 }\n- 290\n-292 bool operator!=(const ReferenceElement& r) const\n- 293 {\n- 294 return not (*this == r);\n- 295 }\n- 296\n-298 friend std::size_t hash_value(const ReferenceElement& r)\n- 299 {\n- 300 return reinterpret_cast(r._impl);\n- 301 }\n+ 248 DUNE_EXPORT static QuadratureRules& instance()\n+ 249 {\n+ 250 static QuadratureRules instance;\n+ 251 return instance;\n+ 252 }\n+ 253\n+ 255 QuadratureRules () = default;\n+ 256 public:\n+ 258 static unsigned\n+259 maxOrder(const GeometryType& t,\n+ 260 QuadratureType::Enum qt=QuadratureType::GaussLegendre)\n+ 261 {\n+ 262 return QuadratureRuleFactory::maxOrder(t,qt);\n+ 263 }\n+ 264\n+266 static const QuadratureRule& rule(const GeometryType& t, int p,\n+QuadratureType::Enum qt=QuadratureType::GaussLegendre)\n+ 267 {\n+ 268 return instance()._rule(t,p,qt);\n+ 269 }\n+ 270\n+272 static const QuadratureRule& rule(const GeometryType::BasicType t, int p,\n+QuadratureType::Enum qt=QuadratureType::GaussLegendre)\n+ 273 {\n+ 274 GeometryType gt(t,dim);\n+ 275 return instance()._rule(gt,p,qt);\n+ 276 }\n+ 277 };\n+ 278\n+ 279} // end namespace Dune\n+ 280\n+281#define DUNE_INCLUDING_IMPLEMENTATION\n+ 282\n+ 283// 0d rules\n+ 284#include \"quadraturerules/pointquadrature.hh\"\n+ 285// 1d rules\n+ 286#include \"quadraturerules/gausslobattoquadrature.hh\"\n+ 287#include \"quadraturerules/gaussquadrature.hh\"\n+ 288#include \"quadraturerules/gaussradauleftquadrature.hh\"\n+ 289#include \"quadraturerules/gaussradaurightquadrature.hh\"\n+ 290#include \"quadraturerules/jacobi1quadrature.hh\"\n+ 291#include \"quadraturerules/jacobi2quadrature.hh\"\n+ 292#include \"quadraturerules/jacobiNquadrature.hh\"\n+ 293// 3d rules\n+ 294#include \"quadraturerules/prismquadrature.hh\"\n+ 295// general rules\n+ 296#include \"quadraturerules/simplexquadrature.hh\"\n+ 297#include \"quadraturerules/tensorproductquadrature.hh\"\n+ 298\n+ 299#undef DUNE_INCLUDING_IMPLEMENTATION\n+ 300\n+ 301namespace Dune {\n 302\n- 303 private:\n- 304\n- 305 // The implementation must be a friend to construct a wrapper around\n-itself.\n- 306 friend Implementation;\n- 307\n- 308 // The reference container is a friend to be able to call\n-setImplementation.\n- 309 friend class Impl::ReferenceElementContainer;\n- 310\n- 311 // Constructor for wrapping an implementation reference (required\n-internally by the default implementation)\n- 312 ReferenceElement(const Implementation& impl)\n- 313 : _impl(&impl)\n- 314 {}\n- 315\n- 316 void setImplementation(const Implementation& impl)\n- 317 {\n- 318 _impl = &impl;\n- 319 }\n- 320\n- 321 const Implementation* _impl;\n+ 309 template\n+310 class QuadratureRuleFactory {\n+ 311 private:\n+ 312 friend class QuadratureRules;\n+ 313 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum qt)\n+ 314 {\n+ 315 return TensorProductQuadratureRule::maxOrder(t.id(), qt);\n+ 316 }\n+ 317 static QuadratureRule rule(const GeometryType& t, int p,\n+QuadratureType::Enum qt)\n+ 318 {\n+ 319 return TensorProductQuadratureRule(t.id(), p, qt);\n+ 320 }\n+ 321 };\n 322\n- 323 };\n- 324\n- 325 }\n- 326\n- 327}\n- 328\n- 329\n- 330#endif // DUNE_GEOMETRY_REFERENCEELEMENT_HH\n+ 323 template\n+324 class QuadratureRuleFactory {\n+ 325 private:\n+326 constexpr static int dim = 0;\n+ 327 friend class QuadratureRules;\n+ 328 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum)\n+ 329 {\n+ 330 if (t.isVertex())\n+ 331 {\n+ 332 return std::numeric_limits::max();\n+ 333 }\n+ 334 DUNE_THROW(Exception, \"Unknown GeometryType\");\n+ 335 }\n+ 336 static QuadratureRule rule(const GeometryType& t, int ,\n+QuadratureType::Enum)\n+ 337 {\n+ 338 if (t.isVertex())\n+ 339 {\n+ 340 return PointQuadratureRule();\n+ 341 }\n+ 342 DUNE_THROW(Exception, \"Unknown GeometryType\");\n+ 343 }\n+ 344 };\n+ 345\n+ 346 template\n+347 class QuadratureRuleFactory {\n+ 348 private:\n+349 constexpr static int dim = 1;\n+ 350 friend class QuadratureRules;\n+ 351 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum qt)\n+ 352 {\n+ 353 if (t.isLine())\n+ 354 {\n+ 355 switch (qt) {\n+ 356 case QuadratureType::GaussLegendre :\n+ 357 return GaussQuadratureRule1D::highest_order;\n+ 358 case QuadratureType::GaussJacobi_1_0 :\n+ 359 return Jacobi1QuadratureRule1D::highest_order;\n+ 360 case QuadratureType::GaussJacobi_2_0 :\n+ 361 return Jacobi2QuadratureRule1D::highest_order;\n+ 362 case QuadratureType::GaussLobatto :\n+ 363 return GaussLobattoQuadratureRule1D::highest_order;\n+ 364 case QuadratureType::GaussJacobi_n_0 :\n+ 365 return JacobiNQuadratureRule1D::maxOrder();\n+ 366 case QuadratureType::GaussRadauLeft :\n+ 367 return GaussRadauLeftQuadratureRule1D::highest_order;\n+ 368 case QuadratureType::GaussRadauRight :\n+ 369 return GaussRadauRightQuadratureRule1D::highest_order;\n+ 370 default :\n+ 371 DUNE_THROW(Exception, \"Unknown QuadratureType\");\n+ 372 }\n+ 373 }\n+ 374 DUNE_THROW(Exception, \"Unknown GeometryType\");\n+ 375 }\n+ 376 static QuadratureRule rule(const GeometryType& t, int p,\n+QuadratureType::Enum qt)\n+ 377 {\n+ 378 if (t.isLine())\n+ 379 {\n+ 380 switch (qt) {\n+ 381 case QuadratureType::GaussLegendre :\n+ 382 return GaussQuadratureRule1D(p);\n+ 383 case QuadratureType::GaussJacobi_1_0 :\n+ 384 return Jacobi1QuadratureRule1D(p);\n+ 385 case QuadratureType::GaussJacobi_2_0 :\n+ 386 return Jacobi2QuadratureRule1D(p);\n+ 387 case QuadratureType::GaussLobatto :\n+ 388 return GaussLobattoQuadratureRule1D(p);\n+ 389 case QuadratureType::GaussJacobi_n_0 :\n+ 390 return JacobiNQuadratureRule1D(p);\n+ 391 case QuadratureType::GaussRadauLeft :\n+ 392 return GaussRadauLeftQuadratureRule1D(p);\n+ 393 case QuadratureType::GaussRadauRight :\n+ 394 return GaussRadauRightQuadratureRule1D(p);\n+ 395 default :\n+ 396 DUNE_THROW(Exception, \"Unknown QuadratureType\");\n+ 397 }\n+ 398 }\n+ 399 DUNE_THROW(Exception, \"Unknown GeometryType\");\n+ 400 }\n+ 401 };\n+ 402\n+ 403 template\n+404 class QuadratureRuleFactory {\n+ 405 private:\n+406 constexpr static int dim = 2;\n+ 407 friend class QuadratureRules;\n+ 408 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum qt)\n+ 409 {\n+ 410 unsigned order =\n+ 411 TensorProductQuadratureRule::maxOrder(t.id(), qt);\n+ 412 if (t.isSimplex())\n+ 413 order = std::max\n+ 414 (order, unsigned(SimplexQuadratureRule::highest_order));\n+ 415 return order;\n+ 416 }\n+ 417 static QuadratureRule rule(const GeometryType& t, int p,\n+QuadratureType::Enum qt)\n+ 418 {\n+ 419 if (t.isSimplex()\n+ 420 && ( qt == QuadratureType::GaussLegendre || qt == QuadratureType::\n+GaussJacobi_n_0 )\n+ 421 && p <= SimplexQuadratureRule::highest_order)\n+ 422 {\n+ 423 return SimplexQuadratureRule(p);\n+ 424 }\n+ 425 return TensorProductQuadratureRule(t.id(), p, qt);\n+ 426 }\n+ 427 };\n+ 428\n+ 429 template\n+430 class QuadratureRuleFactory {\n+ 431 private:\n+432 constexpr static int dim = 3;\n+ 433 friend class QuadratureRules;\n+ 434 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum qt)\n+ 435 {\n+ 436 unsigned order =\n+ 437 TensorProductQuadratureRule::maxOrder(t.id(), qt);\n+ 438 if (t.isSimplex())\n+ 439 order = std::max\n+ 440 (order, unsigned(SimplexQuadratureRule::highest_order));\n+ 441 if (t.isPrism())\n+ 442 order = std::max\n+ 443 (order, unsigned(PrismQuadratureRule::highest_order));\n+ 444 return order;\n+ 445 }\n+ 446 static QuadratureRule rule(const GeometryType& t, int p,\n+QuadratureType::Enum qt)\n+ 447 {\n+ 448\n+ 449 if (t.isSimplex()\n+ 450 && ( qt == QuadratureType::GaussLegendre || qt == QuadratureType::\n+GaussJacobi_n_0 )\n+ 451 && p <= SimplexQuadratureRule::highest_order)\n+ 452 {\n+ 453 return SimplexQuadratureRule(p);\n+ 454 }\n+ 455 if (t.isPrism()\n+ 456 && qt == QuadratureType::GaussLegendre\n+ 457 && p <= PrismQuadratureRule::highest_order)\n+ 458 {\n+ 459 return PrismQuadratureRule(p);\n+ 460 }\n+ 461 return TensorProductQuadratureRule(t.id(), p, qt);\n+ 462 }\n+ 463 };\n+ 464\n+ 465#ifndef DUNE_NO_EXTERN_QUADRATURERULES\n+ 466 extern template class GaussLobattoQuadratureRule;\n+ 467 extern template class GaussQuadratureRule;\n+ 468 extern template class GaussRadauLeftQuadratureRule;\n+ 469 extern template class GaussRadauRightQuadratureRule;\n+ 470 extern template class Jacobi1QuadratureRule;\n+ 471 extern template class Jacobi2QuadratureRule;\n+ 472 extern template class JacobiNQuadratureRule;\n+ 473 extern template class PrismQuadratureRule;\n+ 474 extern template class SimplexQuadratureRule;\n+475 extern template class SimplexQuadratureRule;\n+ 476#endif // !DUNE_NO_EXTERN_QUADRATURERULES\n+ 477\n+ 478} // end namespace\n+ 479\n+ 480#endif // DUNE_GEOMETRY_QUADRATURERULES_HH\n type.hh\n A unique label for each type of element that can occur in a grid.\n+typeindex.hh\n+Helper classes to provide indices for geometrytypes for use in a vector.\n Dune\n Definition affinegeometry.hh:21\n-Dune::Geo::ReferenceElement\n-This class provides access to geometric and topological properties of a\n-reference element.\n-Definition referenceelement.hh:52\n-Dune::Geo::ReferenceElement::volume\n-CoordinateField volume() const\n-obtain the volume of the reference element\n-Definition referenceelement.hh:241\n-Dune::Geo::ReferenceElement::ReferenceElement\n-ReferenceElement()\n-Constructs an empty reference element.\n-Definition referenceelement.hh:271\n-Dune::Geo::ReferenceElement::operator!=\n-bool operator!=(const ReferenceElement &r) const\n-Compares for inequality with another reference element.\n-Definition referenceelement.hh:292\n-Dune::Geo::ReferenceElement::type\n-decltype(auto) type(int i, int c) const\n-obtain the type of subentity (i,c)\n-Definition referenceelement.hh:171\n-Dune::Geo::ReferenceElement::Coordinate\n-typename Implementation::Coordinate Coordinate\n-The coordinate type.\n-Definition referenceelement.hh:81\n-Dune::Geo::ReferenceElement::geometry\n-Codim< codim >::Geometry geometry(int i) const\n-obtain the embedding of subentity (i,codim) into the reference element\n-Definition referenceelement.hh:234\n-Dune::Geo::ReferenceElement::dimension\n+Dune::QuadratureType::Enum\n+Enum\n+Definition quadraturerules.hh:82\n+Dune::QuadratureType::GaussJacobi_n_0\n+@ GaussJacobi_n_0\n+Gauss-Legendre rules with .\n+Definition quadraturerules.hh:119\n+Dune::QuadratureType::GaussJacobi_2_0\n+@ GaussJacobi_2_0\n+Gauss-Legendre rules with .\n+Definition quadraturerules.hh:106\n+Dune::QuadratureType::GaussRadauRight\n+@ GaussRadauRight\n+Gauss-Radau rules including the right endpoint.\n+Definition quadraturerules.hh:144\n+Dune::QuadratureType::GaussJacobi_1_0\n+@ GaussJacobi_1_0\n+Gauss-Jacobi rules with .\n+Definition quadraturerules.hh:99\n+Dune::QuadratureType::size\n+@ size\n+Definition quadraturerules.hh:145\n+Dune::QuadratureType::GaussLobatto\n+@ GaussLobatto\n+Gauss-Lobatto rules.\n+Definition quadraturerules.hh:127\n+Dune::QuadratureType::GaussRadauLeft\n+@ GaussRadauLeft\n+Gauss-Radau rules including the left endpoint.\n+Definition quadraturerules.hh:135\n+Dune::QuadratureType::GaussLegendre\n+@ GaussLegendre\n+Gauss-Legendre rules (default)\n+Definition quadraturerules.hh:92\n+Dune::QuadratureOrderOutOfRange\n+Exception thrown if a desired QuadratureRule is not available, because the\n+requested order is to high...\n+Definition quadraturerules.hh:36\n+Dune::QuadraturePoint\n+Single evaluation point in a quadrature rule.\n+Definition quadraturerules.hh:44\n+Dune::QuadraturePoint::position\n+const Vector & position() const\n+return local coordinates of integration point i\n+Definition quadraturerules.hh:62\n+Dune::QuadraturePoint::Vector\n+Dune::FieldVector< ct, dim > Vector\n+Type used for the position of a quadrature point.\n+Definition quadraturerules.hh:53\n+Dune::QuadraturePoint::Field\n+ct Field\n+Number type used for coordinates and quadrature weights.\n+Definition quadraturerules.hh:50\n+Dune::QuadraturePoint::weight\n+const ct & weight() const\n+return weight associated with integration point i\n+Definition quadraturerules.hh:68\n+Dune::QuadraturePoint::weight_\n+ct weight_\n+Definition quadraturerules.hh:75\n+Dune::QuadraturePoint::dimension\n static constexpr int dimension\n-The dimension of the reference element.\n-Definition referenceelement.hh:87\n-Dune::Geo::ReferenceElement::size\n-int size(int i, int c, int cc) const\n-number of subentities of codimension cc of subentity (i,c)\n-Definition referenceelement.hh:111\n-Dune::Geo::ReferenceElement::subEntity\n-int subEntity(int i, int c, int ii, int cc) const\n-obtain number of ii-th subentity with codim cc of (i,c)\n-Definition referenceelement.hh:130\n-Dune::Geo::ReferenceElement::ctype\n-typename Implementation::ctype ctype\n-The coordinate field type.\n-Definition referenceelement.hh:75\n-Dune::Geo::ReferenceElement::size\n-int size(int c) const\n-number of subentities of codimension c\n-Definition referenceelement.hh:94\n-Dune::Geo::ReferenceElement::type\n-decltype(auto) type() const\n-obtain the type of this reference element\n-Definition referenceelement.hh:184\n-Dune::Geo::ReferenceElement::impl\n-const Implementation & impl() const\n-Returns a reference to the internal implementation object.\n-Definition referenceelement.hh:280\n-Dune::Geo::ReferenceElement::checkInside\n-bool checkInside(const Coordinate &local) const\n-check if a coordinate is in the reference element\n-Definition referenceelement.hh:216\n-Dune::Geo::ReferenceElement::CoordinateField\n-ctype CoordinateField\n-The coordinate field type.\n-Definition referenceelement.hh:78\n-Dune::Geo::ReferenceElement::operator==\n-bool operator==(const ReferenceElement &r) const\n-Compares for equality with another reference element.\n-Definition referenceelement.hh:286\n-Dune::Geo::ReferenceElement::position\n-decltype(auto) position(int i, int c) const\n-position of the barycenter of entity (i,c)\n-Definition referenceelement.hh:203\n-Dune::Geo::ReferenceElement::integrationOuterNormal\n-decltype(auto) integrationOuterNormal(int face) const\n-obtain the integration outer normal of the reference element\n-Definition referenceelement.hh:258\n-Dune::Geo::ReferenceElement::hash_value\n-friend std::size_t hash_value(const ReferenceElement &r)\n-Yields a hash value suitable for storing the reference element a in hash table.\n-Definition referenceelement.hh:298\n-Dune::Geo::ReferenceElement::subEntities\n-auto subEntities(int i, int c, int cc) const\n-Obtain the range of numbers of subentities with codim cc of (i,c)\n-Definition referenceelement.hh:153\n-Dune::Geo::ReferenceElement::Volume\n-ctype Volume\n-Type used for volume.\n-Definition referenceelement.hh:84\n-Dune::Geo::ReferenceElement::Codim\n-Collection of types depending on the codimension.\n-Definition referenceelement.hh:67\n-Dune::Geo::ReferenceElement::Codim::Geometry\n-implementation-defined Geometry\n-type of geometry embedding a subentity into the reference element\n-Definition referenceelement.hh:69\n+Dimension of the integration domain.\n+Definition quadraturerules.hh:47\n+Dune::QuadraturePoint::QuadraturePoint\n+QuadraturePoint(const Vector &x, ct w)\n+set up quadrature of given order in d dimensions\n+Definition quadraturerules.hh:56\n+Dune::QuadraturePoint::local\n+FieldVector< ct, dim > local\n+Definition quadraturerules.hh:74\n+Dune::QuadratureRule\n+Abstract base class for quadrature rules.\n+Definition quadraturerules.hh:154\n+Dune::QuadratureRule::~QuadratureRule\n+virtual ~QuadratureRule()\n+Definition quadraturerules.hh:181\n+Dune::QuadratureRule::d\n+static constexpr int d\n+The space dimension.\n+Definition quadraturerules.hh:171\n+Dune::QuadratureRule::type\n+virtual GeometryType type() const\n+return type of element\n+Definition quadraturerules.hh:180\n+Dune::QuadratureRule::delivered_order\n+int delivered_order\n+Definition quadraturerules.hh:189\n+Dune::QuadratureRule::QuadratureRule\n+QuadratureRule(GeometryType t, int order)\n+Constructor for a given geometry type and a given quadrature order.\n+Definition quadraturerules.hh:168\n+Dune::QuadratureRule::geometry_type\n+GeometryType geometry_type\n+Definition quadraturerules.hh:188\n+Dune::QuadratureRule::CoordType\n+ct CoordType\n+The type used for coordinates.\n+Definition quadraturerules.hh:174\n+Dune::QuadratureRule::QuadratureRule\n+QuadratureRule()\n+Default constructor.\n+Definition quadraturerules.hh:161\n+Dune::QuadratureRule::order\n+virtual int order() const\n+return order\n+Definition quadraturerules.hh:177\n+Dune::QuadratureRule::QuadratureRule\n+QuadratureRule(GeometryType t)\n+Constructor for a given geometry type. Leaves the quadrature order invalid\n+Definition quadraturerules.hh:165\n+Dune::QuadratureRule::iterator\n+std::vector< QuadraturePoint< ct, dim > >::const_iterator iterator\n+Definition quadraturerules.hh:185\n+Dune::QuadratureRuleFactory\n+Factory class for creation of quadrature rules, depending on GeometryType,\n+order and QuadratureType.\n+Definition quadraturerules.hh:310\n+Dune::QuadratureRules\n+A container for all quadrature rules of dimension dim\n+Definition quadraturerules.hh:200\n+Dune::QuadratureRules::maxOrder\n+static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum\n+qt=QuadratureType::GaussLegendre)\n+maximum quadrature order for given geometry type and quadrature type\n+Definition quadraturerules.hh:259\n+Dune::QuadratureRules::rule\n+static const QuadratureRule & rule(const GeometryType::BasicType t, int p,\n+QuadratureType::Enum qt=QuadratureType::GaussLegendre)\n+select the appropriate QuadratureRule for GeometryType t and order p\n+Definition quadraturerules.hh:272\n+Dune::QuadratureRules::rule\n+static const QuadratureRule & rule(const GeometryType &t, int p,\n+QuadratureType::Enum qt=QuadratureType::GaussLegendre)\n+select the appropriate QuadratureRule for GeometryType t and order p\n+Definition quadraturerules.hh:266\n+Dune::GeometryType\n+Unique label for each type of entities that can occur in DUNE grids.\n+Definition type.hh:126\n+Dune::GeometryType::isPrism\n+constexpr bool isPrism() const\n+Return true if entity is a prism.\n+Definition type.hh:321\n+Dune::GeometryType::isVertex\n+constexpr bool isVertex() const\n+Return true if entity is a vertex.\n+Definition type.hh:291\n+Dune::GeometryType::dim\n+constexpr unsigned int dim() const\n+Return dimension of the type.\n+Definition type.hh:372\n+Dune::GeometryType::BasicType\n+BasicType\n+Each entity can be tagged by one of these basic types plus its space dimension.\n+Definition type.hh:132\n+Dune::GeometryType::isLine\n+constexpr bool isLine() const\n+Return true if entity is a line segment.\n+Definition type.hh:296\n+Dune::GeometryType::id\n+constexpr unsigned int id() const\n+Return the topology id of the type.\n+Definition type.hh:377\n+Dune::GeometryType::isSimplex\n+constexpr bool isSimplex() const\n+Return true if entity is a simplex of any dimension.\n+Definition type.hh:331\n+Dune::LocalGeometryTypeIndex::size\n+static constexpr std::size_t size(std::size_t dim)\n+Compute total number of geometry types for the given dimension.\n+Definition typeindex.hh:61\n+Dune::LocalGeometryTypeIndex::index\n+static constexpr std::size_t index(const GeometryType >)\n+Compute the index for the given geometry type within its dimension.\n+Definition typeindex.hh:73\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00194.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00194.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: generalvertexorder.hh File Reference\n+dune-geometry: virtualrefinement.cc File Reference\n \n \n \n \n \n \n \n@@ -72,50 +72,95 @@\n
  • dune
  • geometry
  • \n
    \n \n
    \n \n-
    generalvertexorder.hh File Reference
    \n+
    virtualrefinement.cc File Reference
    \n
    \n
    \n-
    #include <algorithm>
    \n-#include <cassert>
    \n-#include <cstddef>
    \n-#include <iterator>
    \n-#include <vector>
    \n+\n+

    This file contains the virtual wrapper around refinement. \n+More...

    \n+
    #include <cassert>
    \n+#include <typeinfo>
    \n+#include <dune/common/exceptions.hh>
    \n+#include <dune/common/fvector.hh>
    \n #include <dune/common/iteratorfacades.hh>
    \n #include "type.hh"
    \n-#include <dune/geometry/referenceelements.hh>
    \n+#include "refinement.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 Classes

    class  Dune::GeneralVertexOrder< dim, Index_ >
     Class providing information on the ordering of vertices. More...
    class  Dune::VirtualRefinementSubEntityIteratorSpecial< dimension, CoordType, dimension >
     
    class  Dune::VirtualRefinementSubEntityIteratorSpecial< dimension, CoordType, 0 >
     
    class  Dune::VirtualRefinement< dimension, CoordType >::Codim< codimension >
     
    class  Dune::VirtualRefinementSubEntityIteratorBackSpecial< dimension, CoordType, dimension >
     
    class  Dune::VirtualRefinementSubEntityIteratorBackSpecial< dimension, CoordType, 0 >
     
    class  Dune::VirtualRefinement< dimension, CoordType >::SubEntityIteratorBack< dimension, CoordType >
     
    class  Dune::VirtualRefinementImp< topologyId, CoordType, coerceToId, dimension >
     
    class  Dune::VirtualRefinementImpSubEntityIteratorBackSpecial< topologyId, CoordType, coerceToId, dimension, dimension >
     
    class  Dune::VirtualRefinementImpSubEntityIteratorBackSpecial< topologyId, CoordType, coerceToId, dimension, 0 >
     
    class  Dune::GeneralVertexOrder< dim, Index_ >::iterator
     Iterate over the vertex indices of some sub-entity. More...
    class  Dune::VirtualRefinementImp< topologyId, CoordType, coerceToId, dimension >::SubEntityIteratorBack< codimension >
     
    class  Dune::RefinementBuilder< dimension, CoordType >
     
    class  Dune::RefinementBuilder< 1, CoordType >
     
    class  Dune::RefinementBuilder< 3, CoordType >
     
    \n \n \n \n

    \n Namespaces

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

    \n+Macros

    #define DUNE_GEOMETRY_VIRTUALREFINEMENT_CC
     
    \n \n-\n-\n-\n-\n+\n+\n+\n+\n

    \n Functions

    template<class InIterator , class OutIterator >
    void Dune::reduceOrder (const InIterator &inBegin, const InIterator &inEnd, OutIterator outIt)
     Algorithm to reduce vertex order information.
     
    template<int dimension, class CoordType >
    VirtualRefinement< dimension, CoordType > & Dune::buildRefinement (GeometryType geometryType, GeometryType coerceTo)
     return a reference to the VirtualRefinement according to the parameters
     
    \n+

    Detailed Description

    \n+

    This file contains the virtual wrapper around refinement.

    \n+

    Macro Definition Documentation

    \n+\n+

    ◆ DUNE_GEOMETRY_VIRTUALREFINEMENT_CC

    \n+\n+
    \n+
    \n+ \n+ \n+ \n+ \n+
    #define DUNE_GEOMETRY_VIRTUALREFINEMENT_CC
    \n+
    \n+\n+
    \n+
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,37 +6,76 @@\n dune-geometry\u00a02.9.0\n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n-Classes | Namespaces | Functions\n-generalvertexorder.hh File Reference\n-#include \n+Classes | Namespaces | Macros | Functions\n+virtualrefinement.cc File Reference\n+This file contains the virtual wrapper around refinement. More...\n #include \n-#include \n-#include \n-#include \n+#include \n+#include \n+#include \n #include \n #include \"type.hh\"\n-#include \n+#include \"refinement.hh\"\n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::GeneralVertexOrder<_dim,_Index__>\n-\u00a0 Class providing information on the ordering of vertices. More...\n+class \u00a0Dune::VirtualRefinementSubEntityIteratorSpecial<_dimension,_CoordType,\n+ dimension_>\n \u00a0\n-class \u00a0Dune::GeneralVertexOrder<_dim,_Index__>::iterator\n-\u00a0 Iterate over the vertex indices of some sub-entity. More...\n+class \u00a0Dune::VirtualRefinementSubEntityIteratorSpecial<_dimension,_CoordType,\n+ 0_>\n+\u00a0\n+class \u00a0Dune::VirtualRefinement<_dimension,_CoordType_>::Codim<_codimension_>\n+\u00a0\n+class \u00a0Dune::VirtualRefinementSubEntityIteratorBackSpecial<_dimension,\n+ CoordType,_dimension_>\n+\u00a0\n+class \u00a0Dune::VirtualRefinementSubEntityIteratorBackSpecial<_dimension,\n+ CoordType,_0_>\n+\u00a0\n+class \u00a0Dune::VirtualRefinement<_dimension,_CoordType_>::SubEntityIteratorBack<\n+ dimension,_CoordType_>\n+\u00a0\n+class \u00a0Dune::VirtualRefinementImp<_topologyId,_CoordType,_coerceToId,\n+ dimension_>\n+\u00a0\n+class \u00a0Dune::VirtualRefinementImpSubEntityIteratorBackSpecial<_topologyId,\n+ CoordType,_coerceToId,_dimension,_dimension_>\n+\u00a0\n+class \u00a0Dune::VirtualRefinementImpSubEntityIteratorBackSpecial<_topologyId,\n+ CoordType,_coerceToId,_dimension,_0_>\n+\u00a0\n+class \u00a0Dune::VirtualRefinementImp<_topologyId,_CoordType,_coerceToId,\n+ dimension_>::SubEntityIteratorBack<_codimension_>\n+\u00a0\n+class \u00a0Dune::RefinementBuilder<_dimension,_CoordType_>\n+\u00a0\n+class \u00a0Dune::RefinementBuilder<_1,_CoordType_>\n+\u00a0\n+class \u00a0Dune::RefinementBuilder<_3,_CoordType_>\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n+ Macros\n+#define\u00a0DUNE_GEOMETRY_VIRTUALREFINEMENT_CC\n+\u00a0\n Functions\n-template\n-void\u00a0Dune::reduceOrder (const InIterator &inBegin, const InIterator &inEnd,\n- OutIterator outIt)\n-\u00a0 Algorithm to reduce vertex order information.\n+template\n+VirtualRefinement< dimension, CoordType > Dune::buildRefinement (GeometryType\n+ &\u00a0geometryType, GeometryType coerceTo)\n+ return a reference to the\n+\u00a0 VirtualRefinement according to the\n+ parameters\n \u00a0\n+***** Detailed Description *****\n+This file contains the virtual wrapper around refinement.\n+***** Macro Definition Documentation *****\n+***** \u25c6\u00a0DUNE_GEOMETRY_VIRTUALREFINEMENT_CC *****\n+#define DUNE_GEOMETRY_VIRTUALREFINEMENT_CC\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00194_source.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00194_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: generalvertexorder.hh Source File\n+dune-geometry: virtualrefinement.cc Source File\n \n \n \n \n \n \n \n@@ -74,187 +74,817 @@\n \n
    \n \n
    \n
    \n
    \n-
    generalvertexorder.hh
    \n+
    virtualrefinement.cc
    \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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
    \n
    4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    5
    \n-
    6#ifndef DUNE_GEOMETRY_GENERALVERTEXORDER_HH
    \n-
    7#define DUNE_GEOMETRY_GENERALVERTEXORDER_HH
    \n+
    6#ifndef DUNE_GEOMETRY_VIRTUALREFINEMENT_CC
    \n+
    7#define DUNE_GEOMETRY_VIRTUALREFINEMENT_CC
    \n
    8
    \n-
    9#include <algorithm>
    \n-
    10#include <cassert>
    \n-
    11#include <cstddef>
    \n-
    12#include <iterator>
    \n-
    13#include <vector>
    \n-
    14
    \n-
    15#include <dune/common/iteratorfacades.hh>
    \n+
    14#include <cassert>
    \n+
    15#include <typeinfo>
    \n
    16
    \n-
    17#include "type.hh"
    \n-\n-
    19
    \n-
    20namespace Dune {
    \n-
    21
    \n-
    39 template<class InIterator, class OutIterator>
    \n-
    \n-
    40 void reduceOrder(const InIterator& inBegin, const InIterator& inEnd,
    \n-
    41 OutIterator outIt)
    \n-
    42 {
    \n-
    43 for(InIterator inIt = inBegin; inIt != inEnd; ++inIt, ++outIt)
    \n-
    44 *outIt = std::count_if(inBegin, inEnd, [&](const auto& v)
    \n-
    45 {
    \n-
    46 return v < *inIt;
    \n-
    47 });
    \n-
    48 }
    \n-
    \n-
    49
    \n-
    51
    \n-
    66 template<std::size_t dim, class Index_ = std::size_t>
    \n-
    \n-\n-
    68 typedef ReferenceElements<double, dim> RefElems;
    \n-
    69 typedef typename RefElems::ReferenceElement RefElem;
    \n+
    17#include <dune/common/exceptions.hh>
    \n+
    18#include <dune/common/fvector.hh>
    \n+
    19#include <dune/common/iteratorfacades.hh>
    \n+
    20
    \n+
    21#include "type.hh"
    \n+
    22#include "refinement.hh"
    \n+
    23
    \n+
    24namespace Dune
    \n+
    25{
    \n+
    26 // //////////////////////////////////////////
    \n+
    27 //
    \n+
    28 // The virtual base class and its iterators
    \n+
    29 //
    \n+
    30
    \n+
    31 //
    \n+
    32 // Refinement
    \n+
    33 //
    \n+
    34
    \n+
    35 template<int dimension, class CoordType>
    \n+\n+
    \n+\n+\n+
    39 {
    \n+
    40 return VertexIterator(vBeginBack(tag));
    \n+
    41 }
    \n+
    \n+
    42
    \n+
    43 template<int dimension, class CoordType>
    \n+\n+
    \n+\n+\n+
    47 {
    \n+
    48 return VertexIterator(vEndBack(tag));
    \n+
    49 }
    \n+
    \n+
    50
    \n+
    51 template<int dimension, class CoordType>
    \n+\n+
    \n+\n+\n+
    55 {
    \n+
    56 return ElementIterator(eBeginBack(tag));
    \n+
    57 }
    \n+
    \n+
    58
    \n+
    59 template<int dimension, class CoordType>
    \n+\n+
    \n+\n+\n+
    63 {
    \n+
    64 return ElementIterator(eEndBack(tag));
    \n+
    65 }
    \n+
    \n+
    66
    \n+
    67 //
    \n+
    68 // The iterators
    \n+
    69 //
    \n
    70
    \n-
    71 RefElem refelem;
    \n-
    72 GeometryType gt;
    \n-
    73 std::vector<Index_> vertexOrder;
    \n-
    74
    \n-
    75 public:
    \n-
    77 typedef Index_ Index;
    \n-
    78
    \n-
    80 class iterator;
    \n-
    81
    \n-
    83 static const std::size_t dimension = dim;
    \n-
    85 const GeometryType &type() const { return gt; }
    \n-
    86
    \n-
    88
    \n-
    96 template<class InIterator>
    \n-
    \n-
    97 GeneralVertexOrder(const GeometryType& gt_, const InIterator &inBegin,
    \n-
    98 const InIterator &inEnd) :
    \n-
    99 refelem(RefElems::general(gt_)), gt(gt_),
    \n-
    100 vertexOrder(refelem.size(dim))
    \n-
    101 { reduceOrder(inBegin, inEnd, vertexOrder.begin()); }
    \n-
    \n-
    102
    \n-
    104
    \n-
    \n-
    108 iterator begin(std::size_t codim, std::size_t subEntity) const
    \n-
    109 { return iterator(*this, codim, subEntity); }
    \n+
    71 template<int dimension, class CoordType, int codimension>
    \n+\n+
    73
    \n+
    74 // The iterator for vertices
    \n+
    75 template<int dimension, class CoordType>
    \n+
    \n+
    76 class VirtualRefinementSubEntityIteratorSpecial<dimension, CoordType, dimension>
    \n+
    77 {};
    \n
    \n+
    78
    \n+
    79 // The iterator for elements
    \n+
    80 template<int dimension, class CoordType>
    \n+
    \n+
    81 class VirtualRefinementSubEntityIteratorSpecial<dimension, CoordType, 0>
    \n+
    82 {
    \n+
    83 public:
    \n+\n+
    85 typedef typename Refinement::template Codim<0>::SubEntityIterator Common;
    \n+
    86 typedef typename Refinement::IndexVector IndexVector;
    \n+
    87
    \n+
    88 IndexVector vertexIndices() const;
    \n+
    89 };
    \n+
    \n+
    90
    \n+
    91 template<int dimension, class CoordType>
    \n+\n+
    \n+\n+
    94 vertexIndices() const
    \n+
    95 {
    \n+
    96 return static_cast<const Common *>(this)->backend->vertexIndices();
    \n+
    97 }
    \n+
    \n+
    98
    \n+
    99 // The iterator common stuff
    \n+
    100 template<int dimension, class CoordType>
    \n+
    101 template<int codimension>
    \n+
    \n+
    102 class VirtualRefinement<dimension, CoordType>::Codim<codimension>::SubEntityIterator
    \n+
    103 : public ForwardIteratorFacade<typename VirtualRefinement<dimension, CoordType>::template Codim<codimension>::SubEntityIterator, int>,
    \n+
    104 public VirtualRefinementSubEntityIteratorSpecial<dimension, CoordType, codimension>
    \n+
    105 {
    \n+
    106 public:
    \n+\n+
    108 typedef typename Refinement::template Codim<codimension>::SubEntityIterator This;
    \n+
    109 typedef typename Refinement::template SubEntityIteratorBack<codimension> IteratorBack;
    \n+
    110 typedef typename Refinement::CoordVector CoordVector;
    \n
    111
    \n-
    \n-
    115 iterator end(std::size_t codim, std::size_t subEntity) const {
    \n-
    116 return iterator(*this, codim, subEntity,
    \n-
    117 refelem.size(subEntity, codim, dim));
    \n-
    118 }
    \n-
    \n-
    119
    \n-
    121
    \n-
    \n-
    128 void getReduced(std::size_t codim, std::size_t subEntity,
    \n-
    129 std::vector<Index>& order) const
    \n-
    130 {
    \n-
    131 order.resize(refelem.size(subEntity, codim, dim));
    \n-
    132 reduceOrder(begin(codim, subEntity), end(codim, subEntity),
    \n-
    133 order.begin());
    \n-
    134 }
    \n-
    \n-
    135 };
    \n-
    \n-
    136
    \n+\n+
    113 SubEntityIterator(const This &other);
    \n+\n+
    115
    \n+
    116 This &operator=(const This &other);
    \n+
    117
    \n+
    118 bool equals(const This &other) const;
    \n+
    119 void increment();
    \n+
    120
    \n+
    121 int index() const;
    \n+
    122
    \n+
    123 // If you simply use an unqualified CoordVector here g++-4.2 chokes
    \n+\n+
    125 CoordVector coords() const;
    \n+
    126 private:
    \n+
    127 friend class VirtualRefinementSubEntityIteratorSpecial<dimension, CoordType, codimension>;
    \n+
    128 IteratorBack *backend;
    \n+
    129 };
    \n+
    \n+
    130
    \n+
    131#ifndef DOXYGEN
    \n+
    132 template<int dimension, class CoordType>
    \n+
    133 template<int codimension>
    \n+\n+
    135 SubEntityIterator(IteratorBack *backend_)
    \n+
    136 : backend(backend_)
    \n+
    137 {}
    \n
    138
    \n-
    141 template<std::size_t dim, class Index_>
    \n-
    \n-
    142 class GeneralVertexOrder<dim, Index_>::iterator :
    \n-
    143 public Dune::RandomAccessIteratorFacade<iterator, const Index_>
    \n-
    144 {
    \n-
    145 const GeneralVertexOrder *order;
    \n-
    146 std::size_t codim;
    \n-
    147 std::size_t subEntity;
    \n-
    148 std::size_t vertex;
    \n-
    149
    \n-
    150 iterator(const GeneralVertexOrder &order_, std::size_t codim_,
    \n-
    151 std::size_t subEntity_, std::size_t vertex_ = 0) :
    \n-
    152 order(&order_), codim(codim_), subEntity(subEntity_), vertex(vertex_)
    \n-
    153 { }
    \n-
    154
    \n-
    155 public:
    \n-
    \n-
    156 const Index &dereference() const {
    \n-
    157 return order->vertexOrder[order->refelem.subEntity(subEntity, codim,
    \n-
    158 vertex, dim)];
    \n-
    159 }
    \n-
    \n-
    \n-
    160 const Index &elementAt(std::ptrdiff_t n) const {
    \n-
    161 return order->vertexOrder[order->refelem.subEntity(subEntity, codim,
    \n-
    162 vertex+n, dim)];
    \n-
    163 }
    \n-
    \n-
    \n-
    164 bool equals(const iterator &other) const {
    \n-
    165 return order == other.order && codim == other.codim &&
    \n-
    166 subEntity == other.subEntity && vertex == other.vertex;
    \n-
    167 }
    \n-
    \n-
    168 void increment() { ++vertex; }
    \n-
    169 void decrement() { --vertex; }
    \n-
    170 void advance(std::ptrdiff_t n) { vertex += n; }
    \n-
    \n-
    171 std::ptrdiff_t distanceTo(const iterator &other) const {
    \n-
    172 // make sure we reference the same container
    \n-
    173 assert(order == other.order && codim == other.codim &&
    \n-
    174 subEntity == other.subEntity);
    \n-
    175 if(vertex < other.vertex) return other.vertex - vertex;
    \n-
    176 else return -static_cast<std::ptrdiff_t>(vertex - other.vertex);
    \n-
    177 }
    \n-
    \n-
    178
    \n-
    179 friend class GeneralVertexOrder<dim, Index>;
    \n-
    180
    \n-
    182
    \n-\n-
    188 };
    \n-
    \n-
    189} // namespace Dune
    \n-
    190
    \n-
    191#endif // DUNE_GEOMETRY_GENERALVERTEXORDER_HH
    \n-\n+
    139 template<int dimension, class CoordType>
    \n+
    140 template<int codimension>
    \n+\n+
    142 SubEntityIterator(const This &other)
    \n+
    143 : backend(other.backend->clone())
    \n+
    144 {}
    \n+
    145
    \n+
    146 template<int dimension, class CoordType>
    \n+
    147 template<int codimension>
    \n+
    148 VirtualRefinement<dimension, CoordType>::Codim<codimension>::SubEntityIterator::
    \n+
    149 ~SubEntityIterator()
    \n+
    150 {
    \n+
    151 delete backend;
    \n+
    152 }
    \n+
    153
    \n+
    154 template<int dimension, class CoordType>
    \n+
    155 template<int codimension>
    \n+
    156 typename VirtualRefinement<dimension, CoordType>::template Codim<codimension>::SubEntityIterator &
    \n+
    157 VirtualRefinement<dimension, CoordType>::Codim<codimension>::SubEntityIterator::
    \n+
    158 operator=(const This &other)
    \n+
    159 {
    \n+
    160 delete backend;
    \n+
    161 backend = other.backend->clone();
    \n+
    162 }
    \n+
    163
    \n+
    164 template<int dimension, class CoordType>
    \n+
    165 template<int codimension>
    \n+
    166 bool
    \n+
    167 VirtualRefinement<dimension, CoordType>::Codim<codimension>::SubEntityIterator::
    \n+
    168 equals(const This &other) const
    \n+
    169 { return *backend == *(other.backend); }
    \n+
    170
    \n+
    171 template<int dimension, class CoordType>
    \n+
    172 template<int codimension>
    \n+
    173 void
    \n+
    174 VirtualRefinement<dimension, CoordType>::Codim<codimension>::SubEntityIterator::
    \n+
    175 increment()
    \n+
    176 {
    \n+
    177 ++*backend;
    \n+
    178 }
    \n+
    179
    \n+
    180 template<int dimension, class CoordType>
    \n+
    181 template<int codimension>
    \n+
    182 int
    \n+
    183 VirtualRefinement<dimension, CoordType>::Codim<codimension>::SubEntityIterator::
    \n+
    184 index() const
    \n+
    185 { return backend->index(); }
    \n+
    186
    \n+
    187 template<int dimension, class CoordType>
    \n+
    188 template<int codimension>
    \n+
    189 typename VirtualRefinement<dimension, CoordType>::template Codim<codimension>::SubEntityIterator::CoordVector
    \n+
    190 VirtualRefinement<dimension, CoordType>::Codim<codimension>::SubEntityIterator::
    \n+
    191 coords() const
    \n+
    192 { return backend->coords(); }
    \n+
    193#endif // DOXYGEN
    \n+
    194
    \n+
    195 //
    \n+
    196 // The iterator backend
    \n+
    197 //
    \n+
    198
    \n+
    199 template<int dimension, class CoordType, int codimension>
    \n+\n+
    201
    \n+
    202 // The iterator backend for vertices
    \n+
    203 template<int dimension, class CoordType>
    \n+
    \n+
    204 class VirtualRefinementSubEntityIteratorBackSpecial<dimension, CoordType, dimension>
    \n+
    205 {
    \n+
    206 public:
    \n+
    207
    \n+\n+
    210 };
    \n+
    \n+
    211
    \n+
    212 // The iterator backend for elements
    \n+
    213 template<int dimension, class CoordType>
    \n+
    \n+\n+
    215 {
    \n+
    216 public:
    \n+\n+
    218 typedef typename Refinement::IndexVector IndexVector;
    \n+
    219
    \n+
    220 virtual IndexVector vertexIndices() const = 0;
    \n+
    221
    \n+\n+
    224 };
    \n+
    \n+
    225
    \n+
    226 // The iterator backend common stuff
    \n+
    227 template<int dimension, class CoordType>
    \n+
    228 template<int codimension>
    \n+
    \n+
    229 class VirtualRefinement<dimension, CoordType>::SubEntityIteratorBack
    \n+
    230 : public VirtualRefinementSubEntityIteratorBackSpecial<dimension, CoordType, codimension>
    \n+
    231 {
    \n+
    232 public:
    \n+\n+
    234 typedef typename Refinement::template SubEntityIteratorBack<codimension> This;
    \n+
    235 typedef typename Refinement::CoordVector CoordVector;
    \n+
    236
    \n+\n+
    238
    \n+
    239 virtual This *clone() const = 0;
    \n+
    240
    \n+
    241 virtual bool operator==(const This &other) const = 0;
    \n+
    242 virtual This &operator++() = 0;
    \n+
    243
    \n+
    244 virtual int index() const = 0;
    \n+
    245 virtual CoordVector coords() const = 0;
    \n+
    246 };
    \n+
    \n+
    247
    \n+
    248 // /////////////////////////////////////////////////
    \n+
    249 //
    \n+
    250 // The derived classes and their iterator backends
    \n+
    251 //
    \n+
    252
    \n+
    253 //
    \n+
    254 // The refinement implementation
    \n+
    255 //
    \n+
    256
    \n+
    257 template<unsigned topologyId, class CoordType,
    \n+
    258 unsigned coerceToId, int dimension>
    \n+
    \n+\n+
    260 : public Dune::VirtualRefinement<dimension, CoordType>
    \n+
    261 {
    \n+
    262 public:
    \n+\n+\n+
    265
    \n+
    266 template<int codimension>
    \n+\n+
    268
    \n+
    269 int nVertices(Dune::RefinementIntervals tag) const;
    \n+
    270
    \n+
    271 int nElements(Dune::RefinementIntervals tag) const;
    \n+
    272
    \n+\n+
    274 private:
    \n+\n+
    276
    \n+\n+\n+\n+\n+
    281 };
    \n+
    \n+
    282
    \n+
    283 template<unsigned topologyId, class CoordType,
    \n+
    284 unsigned coerceToId, int dimension>
    \n+
    285 VirtualRefinementImp<topologyId, CoordType, coerceToId, dimension> &
    \n+
    \n+\n+
    287 {
    \n+
    288 static VirtualRefinementImp instance_{};
    \n+
    289 return instance_;
    \n+
    290 }
    \n+
    \n+
    291
    \n+
    292 template<unsigned topologyId, class CoordType,
    \n+
    293 unsigned coerceToId, int dimension>
    \n+\n+
    299
    \n+
    300 template<unsigned topologyId, class CoordType,
    \n+
    301 unsigned coerceToId, int dimension>
    \n+\n+\n+\n+
    305 {
    \n+
    306 return new SubEntityIteratorBack<dimension>(StaticRefinement::vBegin(tag));
    \n+
    307 }
    \n+
    308
    \n+
    309 template<unsigned topologyId, class CoordType,
    \n+
    310 unsigned coerceToId, int dimension>
    \n+\n+
    312 VirtualRefinementImp<topologyId, CoordType, coerceToId, dimension>::
    \n+
    313 vEndBack(Dune::RefinementIntervals tag) const
    \n+
    314 {
    \n+
    315 return new SubEntityIteratorBack<dimension>(StaticRefinement::vEnd(tag));
    \n+
    316 }
    \n+
    317
    \n+
    318 template<unsigned topologyId, class CoordType,
    \n+
    319 unsigned coerceToId, int dimension>
    \n+\n+
    324
    \n+
    325 template<unsigned topologyId, class CoordType,
    \n+
    326 unsigned coerceToId, int dimension>
    \n+\n+\n+\n+
    330 {
    \n+
    331 return new SubEntityIteratorBack<0>(StaticRefinement::eBegin(tag));
    \n+
    332 }
    \n+
    333
    \n+
    334 template<unsigned topologyId, class CoordType,
    \n+
    335 unsigned coerceToId, int dimension>
    \n+\n+
    337 VirtualRefinementImp<topologyId, CoordType, coerceToId, dimension>::
    \n+
    338 eEndBack(Dune::RefinementIntervals tag) const
    \n+
    339 {
    \n+
    340 return new SubEntityIteratorBack<0>(StaticRefinement::eEnd(tag));
    \n+
    341 }
    \n+
    342
    \n+
    343 //
    \n+
    344 // The iterator backend implementation
    \n+
    345 //
    \n+
    346
    \n+
    347 // The iterator backend implementation specialties
    \n+
    348 template<unsigned topologyId, class CoordType,
    \n+
    349 unsigned coerceToId, int dimension, int codimension>
    \n+\n+
    351
    \n+
    352 // The iterator backend implementation specialties for vertices
    \n+
    353 template<unsigned topologyId, class CoordType,
    \n+
    354 unsigned coerceToId, int dimension>
    \n+
    \n+
    355 class VirtualRefinementImpSubEntityIteratorBackSpecial<topologyId, CoordType, coerceToId, dimension, dimension>
    \n+
    356 : public VirtualRefinement<dimension, CoordType>::template SubEntityIteratorBack<dimension>
    \n+
    357 {};
    \n+
    \n+
    358
    \n+
    359 // The iterator backend implementation specialties for elements
    \n+
    360
    \n+
    361 template<unsigned topologyId, class CoordType,
    \n+
    362 unsigned coerceToId, int dimension>
    \n+
    \n+
    363 class VirtualRefinementImpSubEntityIteratorBackSpecial<topologyId, CoordType, coerceToId, dimension, 0>
    \n+
    364 : public VirtualRefinement<dimension, CoordType>::template SubEntityIteratorBack<0>
    \n+
    365 {
    \n+
    366 public:
    \n+\n+
    368 typedef typename VirtualRefinementImp::template SubEntityIteratorBack<0> Common;
    \n+\n+\n+
    371 typedef typename RefinementBase::IndexVector IndexVector;
    \n+
    372
    \n+
    373 IndexVector vertexIndices() const;
    \n+
    374 };
    \n+
    \n+
    375
    \n+
    376 template<unsigned topologyId, class CoordType,
    \n+
    377 unsigned coerceToId, int dimension>
    \n+\n+
    \n+\n+
    380 vertexIndices() const
    \n+
    381 {
    \n+
    382 IndexVector vIndices;
    \n+
    383 vIndices.reserve(StaticRefinement::IndexVector::dimension);
    \n+
    384
    \n+
    385 typename StaticRefinement::IndexVector sIndices = static_cast<const Common *>(this)->backend.vertexIndices();
    \n+
    386 for(int i = 0; i < StaticRefinement::IndexVector::dimension; ++i)
    \n+
    387 vIndices.push_back(sIndices[i]);
    \n+
    388 return vIndices;
    \n+
    389 }
    \n+
    \n+
    390
    \n+
    391 // The shared iterator backend implementation
    \n+
    392 template<unsigned topologyId, class CoordType,
    \n+
    393 unsigned coerceToId, int dimension>
    \n+
    394 template<int codimension>
    \n+
    \n+
    395 class VirtualRefinementImp<topologyId, CoordType, coerceToId, dimension>::SubEntityIteratorBack
    \n+
    396 : public VirtualRefinementImpSubEntityIteratorBackSpecial<topologyId, CoordType, coerceToId, dimension, codimension>
    \n+
    397 {
    \n+
    398 public:
    \n+
    399 typedef typename StaticRefinement::template Codim<codimension>::SubEntityIterator BackendIterator;
    \n+\n+
    401 typedef typename VirtualRefinement::template SubEntityIteratorBack<codimension> Base;
    \n+\n+
    403
    \n+\n+
    405 SubEntityIteratorBack(const This &other);
    \n+
    406
    \n+
    407 Base *clone() const;
    \n+
    408
    \n+
    409 bool operator==(const Base &other) const;
    \n+
    410 Base &operator++();
    \n+
    411
    \n+
    412 int index() const;
    \n+
    413 CoordVector coords() const;
    \n+
    414
    \n+
    415 private:
    \n+
    416 friend class VirtualRefinementImpSubEntityIteratorBackSpecial<topologyId, CoordType, coerceToId, dimension, codimension>;
    \n+
    417 BackendIterator backend;
    \n+
    418 };
    \n+
    \n+
    419
    \n+
    420 template<unsigned topologyId, class CoordType,
    \n+
    421 unsigned coerceToId, int dimension>
    \n+
    422 template<int codimension>
    \n+\n+
    427
    \n+
    428 template<unsigned topologyId, class CoordType,
    \n+
    429 unsigned coerceToId, int dimension>
    \n+
    430 template<int codimension>
    \n+
    \n+\n+
    432 SubEntityIteratorBack(const This &other)
    \n+
    433 : VirtualRefinementImpSubEntityIteratorBackSpecial<topologyId, CoordType, coerceToId, dimension, codimension>(other),
    \n+
    434 backend(other.backend)
    \n+
    435 {}
    \n+
    \n+
    436
    \n+
    437 template<unsigned topologyId, class CoordType, unsigned coerceToId, int dimension>
    \n+
    438 template<int codimension>
    \n+\n+\n+
    443
    \n+
    444 template<unsigned topologyId, class CoordType, unsigned coerceToId, int dimension>
    \n+
    445 template<int codimension>
    \n+
    446 bool
    \n+
    \n+\n+
    448 operator==(const Base &other) const
    \n+
    449 {
    \n+
    450 try {
    \n+
    451 return backend == dynamic_cast<const This &>(other).backend;
    \n+
    452 }
    \n+
    453 catch(const std::bad_cast&)
    \n+
    454 {
    \n+
    455 return false;
    \n+
    456 }
    \n+
    457 }
    \n+
    \n+
    458
    \n+
    459 template<unsigned topologyId, class CoordType, unsigned coerceToId, int dimension>
    \n+
    460 template<int codimension>
    \n+\n+\n+
    468
    \n+
    469 template<unsigned topologyId, class CoordType, unsigned coerceToId, int dimension>
    \n+
    470 template<int codimension>
    \n+
    471 int
    \n+\n+
    475
    \n+
    476 template<unsigned topologyId, class CoordType, unsigned coerceToId, int dimension>
    \n+
    477 template<int codimension>
    \n+\n+\n+
    482
    \n+
    483 // ////////////////////////
    \n+
    484 //
    \n+
    485 // The refinement builder
    \n+
    486 //
    \n+
    487
    \n+
    488 template<int dimension, class CoordType>
    \n+
    489 class RefinementBuilder;
    \n+
    490
    \n+
    501 template<int dimension, class CoordType>
    \n+\n+
    \n+\n+
    504 GeometryType geometryType,
    \n+
    506 GeometryType coerceTo)
    \n+
    507 {
    \n+
    508 // Check that the user used valid geometry types
    \n+
    509 assert(geometryType.dim() == dimension && coerceTo.dim() == dimension);
    \n+
    510 return RefinementBuilder<dimension, CoordType>::build( geometryType.id(), coerceTo.id() );
    \n+
    511 }
    \n+
    \n+
    512
    \n+
    513 // In principle the trick with the class is no longer necessary,
    \n+
    514 // but I'm keeping it in here so it will be easier to specialize
    \n+
    515 // buildRefinement when someone implements pyramids and prisms
    \n+
    516 template<int dimension, class CoordType>
    \n+
    \n+\n+
    518 {
    \n+
    519 public:
    \n+
    520 static
    \n+\n+
    \n+
    522 build(unsigned topologyId, unsigned coerceToId)
    \n+
    523 {
    \n+
    524 topologyId &= ~1;
    \n+
    525 coerceToId &= ~1;
    \n+
    526
    \n+
    527 constexpr unsigned idSimplex = GeometryTypes::simplex(dimension).id() & ~1;
    \n+
    528 constexpr unsigned idCube = GeometryTypes::cube(dimension).id() & ~1;
    \n+
    529
    \n+
    530 switch( topologyId )
    \n+
    531 {
    \n+
    532 //case GeometryType::simplex:
    \n+
    533 case idSimplex :
    \n+
    534 //switch( coerceTo )
    \n+
    535 switch( coerceToId )
    \n+
    536 {
    \n+
    537 //case GeometryType::simplex:
    \n+
    538 case idSimplex :
    \n+\n+
    540 default :
    \n+
    541 break;
    \n+
    542 }
    \n+
    543 break;
    \n+
    544
    \n+
    545 //case GeometryType::cube:
    \n+
    546 case idCube :
    \n+
    547 switch( coerceToId )
    \n+
    548 {
    \n+
    549 case idSimplex :
    \n+\n+
    551 case idCube :
    \n+\n+
    553 default :
    \n+
    554 break;
    \n+
    555 }
    \n+
    556 break;
    \n+
    557
    \n+
    558 default :
    \n+
    559 break;
    \n+
    560 }
    \n+
    561 DUNE_THROW( NotImplemented, "No Refinement<" << topologyId << ", CoordType, "
    \n+
    562 << coerceToId << " >.");
    \n+
    563 }
    \n+
    \n+
    564 };
    \n+
    \n+
    565
    \n+
    566 template<class CoordType>
    \n+
    \n+
    567 class RefinementBuilder<1, CoordType>
    \n+
    568 {
    \n+
    569 static const std::size_t dimension = 1;
    \n+
    570 public:
    \n+
    571 static
    \n+\n+
    \n+
    573 build(unsigned topologyId, unsigned coerceToId)
    \n+
    574 {
    \n+
    575 topologyId &= ~1;
    \n+
    576 coerceToId &= ~1;
    \n+
    577
    \n+
    578 constexpr unsigned idSimplex = GeometryTypes::simplex(dimension).id() & ~1;
    \n+
    579
    \n+
    580 if (topologyId == 0 && coerceToId == 0)
    \n+\n+
    582
    \n+
    583 DUNE_THROW( NotImplemented, "No Refinement<" << topologyId << ", CoordType, "
    \n+
    584 << coerceToId << " >.");
    \n+
    585 }
    \n+
    \n+
    586 };
    \n+
    \n+
    587
    \n+
    588 template<class CoordType>
    \n+
    \n+
    589 class RefinementBuilder<3, CoordType>
    \n+
    590 {
    \n+
    591 static const std::size_t dimension = 3;
    \n+
    592 public:
    \n+
    593 static
    \n+\n+
    \n+
    595 build(unsigned topologyId, unsigned coerceToId)
    \n+
    596 {
    \n+
    597 topologyId &= ~1;
    \n+
    598 coerceToId &= ~1;
    \n+
    599
    \n+
    600 constexpr unsigned idSimplex = GeometryTypes::simplex(dimension).id() & ~1;
    \n+
    601 constexpr unsigned idCube = GeometryTypes::cube(dimension).id() & ~1;
    \n+
    602 constexpr unsigned idPrism = GeometryTypes::prism.id() & ~1;
    \n+
    603 constexpr unsigned idPyramid = GeometryTypes::pyramid.id() & ~1;
    \n+
    604
    \n+
    605 switch( topologyId )
    \n+
    606 {
    \n+
    607 //case GeometryType::simplex:
    \n+
    608 case idSimplex :
    \n+
    609 //switch( coerceTo )
    \n+
    610 switch( coerceToId )
    \n+
    611 {
    \n+
    612 //case GeometryType::simplex:
    \n+
    613 case idSimplex :
    \n+\n+
    615 default :
    \n+
    616 break;
    \n+
    617 }
    \n+
    618 break;
    \n+
    619
    \n+
    620 //case GeometryType::cube:
    \n+
    621 case idCube :
    \n+
    622 switch( coerceToId )
    \n+
    623 {
    \n+
    624 case idSimplex :
    \n+\n+
    626 case idCube :
    \n+\n+
    628 default :
    \n+
    629 break;
    \n+
    630 }
    \n+
    631 break;
    \n+
    632
    \n+
    633 //case GeometryType::prism:
    \n+
    634 case idPrism :
    \n+
    635 switch( coerceToId )
    \n+
    636 {
    \n+
    637 case idSimplex :
    \n+\n+
    639 default :
    \n+
    640 break;
    \n+
    641 }
    \n+
    642 break;
    \n+
    643
    \n+
    644 //case GeometryType::pyramid:
    \n+
    645 case idPyramid :
    \n+
    646 switch( coerceToId )
    \n+
    647 {
    \n+
    648 case idSimplex :
    \n+\n+
    650 default :
    \n+
    651 break;
    \n+
    652 }
    \n+
    653 break;
    \n+
    654
    \n+
    655 default :
    \n+
    656 break;
    \n+
    657 }
    \n+
    658 DUNE_THROW( NotImplemented, "No Refinement<" << topologyId << ", CoordType, "
    \n+
    659 << coerceToId << " >.");
    \n+
    660 }
    \n+
    \n+
    661 };
    \n+
    \n+
    662
    \n+
    663} // namespace Dune
    \n+
    664
    \n+
    665#endif // DUNE_GEOMETRY_VIRTUALREFINEMENT_CC
    \n
    A unique label for each type of element that can occur in a grid.
    \n+
    This file simply includes all Refinement implementations so you don't have to do them separately.
    \n
    Definition affinegeometry.hh:21
    \n-
    void reduceOrder(const InIterator &inBegin, const InIterator &inEnd, OutIterator outIt)
    Algorithm to reduce vertex order information.
    Definition generalvertexorder.hh:40
    \n-
    Class providing access to the singletons of the reference elements.
    Definition referenceelements.hh:170
    \n-
    typename Container::ReferenceElement ReferenceElement
    The reference element type.
    Definition referenceelements.hh:188
    \n-
    Class providing information on the ordering of vertices.
    Definition generalvertexorder.hh:67
    \n-
    Index_ Index
    Type of indices.
    Definition generalvertexorder.hh:77
    \n-
    const GeometryType & type() const
    get type of the entity's geometry
    Definition generalvertexorder.hh:85
    \n-
    static const std::size_t dimension
    export the dimension of the entity we provide information for
    Definition generalvertexorder.hh:83
    \n-
    void getReduced(std::size_t codim, std::size_t subEntity, std::vector< Index > &order) const
    get a vector of reduced indices for some sub-entity
    Definition generalvertexorder.hh:128
    \n-
    iterator end(std::size_t codim, std::size_t subEntity) const
    get end iterator for the vertex indices of some sub-entity
    Definition generalvertexorder.hh:115
    \n-
    GeneralVertexOrder(const GeometryType &gt_, const InIterator &inBegin, const InIterator &inEnd)
    construct a GeneralVertexOrder
    Definition generalvertexorder.hh:97
    \n-
    iterator begin(std::size_t codim, std::size_t subEntity) const
    get begin iterator for the vertex indices of some sub-entity
    Definition generalvertexorder.hh:108
    \n-
    Iterate over the vertex indices of some sub-entity.
    Definition generalvertexorder.hh:144
    \n-
    iterator()
    public default constructor
    Definition generalvertexorder.hh:187
    \n-
    void decrement()
    Definition generalvertexorder.hh:169
    \n-
    void advance(std::ptrdiff_t n)
    Definition generalvertexorder.hh:170
    \n-
    const Index & dereference() const
    Definition generalvertexorder.hh:156
    \n-
    void increment()
    Definition generalvertexorder.hh:168
    \n-
    bool equals(const iterator &other) const
    Definition generalvertexorder.hh:164
    \n-
    std::ptrdiff_t distanceTo(const iterator &other) const
    Definition generalvertexorder.hh:171
    \n-
    const Index & elementAt(std::ptrdiff_t n) const
    Definition generalvertexorder.hh:160
    \n+
    VirtualRefinement< dimension, CoordType > & buildRefinement(GeometryType geometryType, GeometryType coerceTo)
    return a reference to the VirtualRefinement according to the parameters
    Definition virtualrefinement.cc:503
    \n+
    Static tag representing a codimension.
    Definition dimension.hh:24
    \n+
    Holds the number of refined intervals per axis needed for virtual and static refinement.
    Definition base.cc:94
    \n+
    Wrap each Refinement implementation to get a consistent interface.
    Definition base.cc:141
    \n+
    static ElementIterator eEnd(Dune::RefinementIntervals tag)
    Get an ElementIterator.
    Definition base.cc:247
    \n+
    static ElementIterator eBegin(Dune::RefinementIntervals tag)
    Get an ElementIterator.
    Definition base.cc:237
    \n+
    static int nElements(Dune::RefinementIntervals tag)
    Get the number of Elements.
    Definition base.cc:227
    \n+
    static int nVertices(Dune::RefinementIntervals tag)
    Get the number of Vertices.
    Definition base.cc:197
    \n+
    static VertexIterator vBegin(Dune::RefinementIntervals tag)
    Get a VertexIterator.
    Definition base.cc:207
    \n+
    typedef IndexVector
    The IndexVector of the Refinement.
    Definition base.cc:177
    \n+
    static VertexIterator vEnd(Dune::RefinementIntervals tag)
    Get a VertexIterator.
    Definition base.cc:217
    \n
    Unique label for each type of entities that can occur in DUNE grids.
    Definition type.hh:126
    \n+
    constexpr unsigned int dim() const
    Return dimension of the type.
    Definition type.hh:372
    \n+
    constexpr unsigned int id() const
    Return the topology id of the type.
    Definition type.hh:377
    \n+
    Definition virtualrefinement.cc:72
    \n+
    Refinement::template Codim< 0 >::SubEntityIterator Common
    Definition virtualrefinement.cc:85
    \n+
    VirtualRefinement< dimension, CoordType > Refinement
    Definition virtualrefinement.cc:84
    \n+
    Refinement::IndexVector IndexVector
    Definition virtualrefinement.cc:86
    \n+
    VirtualRefinement< dimension, CoordType >::template Codim< codimension >::SubEntityIterator::CoordVector coords() const
    \n+\n+\n+\n+\n+\n+
    Refinement::template SubEntityIteratorBack< codimension > IteratorBack
    Definition virtualrefinement.cc:109
    \n+
    Refinement::CoordVector CoordVector
    Definition virtualrefinement.cc:110
    \n+
    Refinement::template Codim< codimension >::SubEntityIterator This
    Definition virtualrefinement.cc:108
    \n+
    bool equals(const This &other) const
    \n+
    VirtualRefinement< dimension, CoordType > Refinement
    Definition virtualrefinement.cc:107
    \n+\n+
    Definition virtualrefinement.cc:200
    \n+
    virtual ~VirtualRefinementSubEntityIteratorBackSpecial()
    Definition virtualrefinement.cc:208
    \n+\n+
    VirtualRefinement< dimension, CoordType > Refinement
    Definition virtualrefinement.cc:217
    \n+
    Refinement::IndexVector IndexVector
    Definition virtualrefinement.cc:218
    \n+
    virtual ~VirtualRefinementSubEntityIteratorBackSpecial()
    Definition virtualrefinement.cc:222
    \n+
    Definition virtualrefinement.cc:231
    \n+\n+
    Refinement::template SubEntityIteratorBack< codimension > This
    Definition virtualrefinement.cc:234
    \n+\n+
    Refinement::CoordVector CoordVector
    Definition virtualrefinement.cc:235
    \n+
    VirtualRefinement< dimension, CoordType > Refinement
    Definition virtualrefinement.cc:233
    \n+
    virtual bool operator==(const This &other) const =0
    \n+
    virtual CoordVector coords() const =0
    \n+
    virtual ~SubEntityIteratorBack()
    Definition virtualrefinement.cc:237
    \n+\n+
    Definition virtualrefinement.cc:261
    \n+
    int nVertices(Dune::RefinementIntervals tag) const
    Get the number of Vertices.
    Definition virtualrefinement.cc:295
    \n+
    Dune::VirtualRefinement< dimension, CoordType > VirtualRefinement
    Definition virtualrefinement.cc:264
    \n+
    int nElements(Dune::RefinementIntervals tag) const
    Get the number of Elements.
    Definition virtualrefinement.cc:320
    \n+
    static VirtualRefinementImp< topologyId, CoordType, coerceToId, dimension > & instance()
    Definition virtualrefinement.cc:286
    \n+
    Dune::StaticRefinement< topologyId, CoordType, coerceToId, dimension > StaticRefinement
    Definition virtualrefinement.cc:263
    \n+
    Definition virtualrefinement.cc:397
    \n+
    VirtualRefinement::template SubEntityIteratorBack< codimension > Base
    Definition virtualrefinement.cc:401
    \n+
    VirtualRefinementImp< topologyId, CoordType, coerceToId, dimension >::template SubEntityIteratorBack< codimension > This
    Definition virtualrefinement.cc:400
    \n+
    StaticRefinement::template Codim< codimension >::SubEntityIterator BackendIterator
    Definition virtualrefinement.cc:399
    \n+
    VirtualRefinement::CoordVector CoordVector
    Definition virtualrefinement.cc:402
    \n+\n+
    VirtualRefinementImp::template SubEntityIteratorBack< 0 > Common
    Definition virtualrefinement.cc:368
    \n+\n+
    VirtualRefinement< dimension, CoordType > RefinementBase
    Definition virtualrefinement.cc:370
    \n+
    Dune::VirtualRefinementImp< topologyId, CoordType, coerceToId, dimension > VirtualRefinementImp
    Definition virtualrefinement.cc:367
    \n+
    VirtualRefinementImp::StaticRefinement StaticRefinement
    Definition virtualrefinement.cc:369
    \n+
    Definition virtualrefinement.cc:518
    \n+
    static VirtualRefinement< dimension, CoordType > & build(unsigned topologyId, unsigned coerceToId)
    Definition virtualrefinement.cc:522
    \n+
    static VirtualRefinement< dimension, CoordType > & build(unsigned topologyId, unsigned coerceToId)
    Definition virtualrefinement.cc:573
    \n+
    static VirtualRefinement< dimension, CoordType > & build(unsigned topologyId, unsigned coerceToId)
    Definition virtualrefinement.cc:595
    \n+
    VirtualRefinement base class.
    Definition virtualrefinement.hh:294
    \n+
    SubEntityIteratorBack< dimension > VertexIteratorBack
    Definition virtualrefinement.hh:318
    \n+
    VertexIterator vBegin(Dune::RefinementIntervals tag) const
    Get an VertexIterator.
    Definition virtualrefinement.cc:38
    \n+
    ElementIterator eBegin(Dune::RefinementIntervals tag) const
    Get an ElementIterator.
    Definition virtualrefinement.cc:54
    \n+
    ElementIterator eEnd(Dune::RefinementIntervals tag) const
    Get an ElementIterator.
    Definition virtualrefinement.cc:62
    \n+
    Codim< 0 >::SubEntityIterator ElementIterator
    The ElementIterator of the VirtualRefinement.
    Definition virtualrefinement.hh:301
    \n+
    VertexIterator vEnd(Dune::RefinementIntervals tag) const
    Get an VertexIterator.
    Definition virtualrefinement.cc:46
    \n+
    FieldVector< CoordType, dimension > CoordVector
    The CoordVector of the VirtualRefinement.
    Definition virtualrefinement.hh:308
    \n+
    Codim< dimension >::SubEntityIterator VertexIterator
    The VertexIterator of the VirtualRefinement.
    Definition virtualrefinement.hh:299
    \n+
    SubEntityIteratorBack< 0 > ElementIteratorBack
    Definition virtualrefinement.hh:319
    \n+
    codim database of VirtualRefinement
    Definition virtualrefinement.hh:378
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,218 +7,1008 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n-generalvertexorder.hh\n+virtualrefinement.cc\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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file\n LICENSE.md in module root\n 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n 5\n- 6#ifndef DUNE_GEOMETRY_GENERALVERTEXORDER_HH\n- 7#define DUNE_GEOMETRY_GENERALVERTEXORDER_HH\n+ 6#ifndef DUNE_GEOMETRY_VIRTUALREFINEMENT_CC\n+7#define DUNE_GEOMETRY_VIRTUALREFINEMENT_CC\n 8\n- 9#include \n- 10#include \n- 11#include \n- 12#include \n- 13#include \n- 14\n- 15#include \n+ 14#include \n+ 15#include \n 16\n- 17#include \"type.hh\"\n- 18#include \n- 19\n- 20namespace Dune {\n- 21\n- 39 template\n-40 void reduceOrder(const InIterator& inBegin, const InIterator& inEnd,\n- 41 OutIterator outIt)\n- 42 {\n- 43 for(InIterator inIt = inBegin; inIt != inEnd; ++inIt, ++outIt)\n- 44 *outIt = std::count_if(inBegin, inEnd, [&](const auto& v)\n- 45 {\n- 46 return v < *inIt;\n- 47 });\n- 48 }\n- 49\n- 51\n- 66 template\n-67 class GeneralVertexOrder {\n- 68 typedef ReferenceElements RefElems;\n- 69 typedef typename RefElems::ReferenceElement RefElem;\n+ 17#include \n+ 18#include \n+ 19#include \n+ 20\n+ 21#include \"type.hh\"\n+ 22#include \"refinement.hh\"\n+ 23\n+ 24namespace Dune\n+ 25{\n+ 26 // //////////////////////////////////////////\n+ 27 //\n+ 28 // The virtual base class and its iterators\n+ 29 //\n+ 30\n+ 31 //\n+ 32 // Refinement\n+ 33 //\n+ 34\n+ 35 template\n+ 36 typename VirtualRefinement::VertexIterator\n+37 VirtualRefinement::\n+ 38vBegin(Dune::RefinementIntervals tag) const\n+ 39 {\n+ 40 return VertexIterator(vBeginBack(tag));\n+ 41 }\n+ 42\n+ 43 template\n+ 44 typename VirtualRefinement::VertexIterator\n+45 VirtualRefinement::\n+ 46vEnd(Dune::RefinementIntervals tag) const\n+ 47 {\n+ 48 return VertexIterator(vEndBack(tag));\n+ 49 }\n+ 50\n+ 51 template\n+ 52 typename VirtualRefinement::ElementIterator\n+53 VirtualRefinement::\n+ 54eBegin(Dune::RefinementIntervals tag) const\n+ 55 {\n+ 56 return ElementIterator(eBeginBack(tag));\n+ 57 }\n+ 58\n+ 59 template\n+ 60 typename VirtualRefinement::ElementIterator\n+61 VirtualRefinement::\n+ 62eEnd(Dune::RefinementIntervals tag) const\n+ 63 {\n+ 64 return ElementIterator(eEndBack(tag));\n+ 65 }\n+ 66\n+ 67 //\n+ 68 // The iterators\n+ 69 //\n 70\n- 71 RefElem refelem;\n- 72 GeometryType gt;\n- 73 std::vector vertexOrder;\n- 74\n- 75 public:\n-77 typedef Index_ Index;\n+ 71 template\n+72 class VirtualRefinementSubEntityIteratorSpecial;\n+ 73\n+ 74 // The iterator for vertices\n+ 75 template\n+76 class VirtualRefinementSubEntityIteratorSpecial\n+ 77 {};\n 78\n- 80 class iterator;\n- 81\n-83 static const std::size_t dimension = dim;\n-85 const GeometryType &type() const { return gt; }\n- 86\n- 88\n- 96 template\n-97 GeneralVertexOrder(const GeometryType& gt_, const InIterator &inBegin,\n- 98 const InIterator &inEnd) :\n- 99 refelem(RefElems::general(gt_)), gt(gt_),\n- 100 vertexOrder(refelem.size(dim))\n- 101 { reduceOrder(inBegin, inEnd, vertexOrder.begin()); }\n- 102\n- 104\n-108 iterator begin(std::size_t codim, std::size_t subEntity) const\n- 109 { return iterator(*this, codim, subEntity); }\n+ 79 // The iterator for elements\n+ 80 template\n+81 class VirtualRefinementSubEntityIteratorSpecial\n+ 82 {\n+ 83 public:\n+84 typedef VirtualRefinement Refinement;\n+85 typedef typename Refinement::template Codim<0>::SubEntityIterator Common;\n+86 typedef typename Refinement::IndexVector IndexVector;\n+ 87\n+ 88 IndexVector vertexIndices() const;\n+ 89 };\n+ 90\n+ 91 template\n+ 92 typename VirtualRefinementSubEntityIteratorSpecial::IndexVector\n+93 VirtualRefinementSubEntityIteratorSpecial::\n+ 94vertexIndices() const\n+ 95 {\n+ 96 return static_cast(this)->backend->vertexIndices();\n+ 97 }\n+ 98\n+ 99 // The iterator common stuff\n+ 100 template\n+ 101 template\n+102 class VirtualRefinement::Codim::\n+SubEntityIterator\n+ 103 : public ForwardIteratorFacade::template Codim::SubEntityIterator, int>,\n+ 104 public VirtualRefinementSubEntityIteratorSpecial\n+ 105 {\n+ 106 public:\n+107 typedef VirtualRefinement Refinement;\n+108 typedef typename Refinement::template Codim::SubEntityIterator\n+This;\n+109 typedef typename Refinement::template SubEntityIteratorBack\n+IteratorBack;\n+110 typedef typename Refinement::CoordVector CoordVector;\n 111\n-115 iterator end(std::size_t codim, std::size_t subEntity) const {\n- 116 return iterator(*this, codim, subEntity,\n- 117 refelem.size(subEntity, codim, dim));\n- 118 }\n- 119\n- 121\n-128 void getReduced(std::size_t codim, std::size_t subEntity,\n- 129 std::vector& order) const\n- 130 {\n- 131 order.resize(refelem.size(subEntity, codim, dim));\n- 132 reduceOrder(begin(codim, subEntity), end(codim, subEntity),\n- 133 order.begin());\n- 134 }\n- 135 };\n- 136\n+112 SubEntityIterator(IteratorBack *backend);\n+113 SubEntityIterator(const This &other);\n+114 ~SubEntityIterator();\n+ 115\n+116 This &operator=(const This &other);\n+ 117\n+118 bool equals(const This &other) const;\n+119 void increment();\n+ 120\n+121 int index() const;\n+ 122\n+ 123 // If you simply use an unqualified CoordVector here g++-4.2 chokes\n+ 124 typename VirtualRefinement::template\n+Codim::SubEntityIterator::\n+125 CoordVector coords() const;\n+ 126 private:\n+ 127 friend class VirtualRefinementSubEntityIteratorSpecial;\n+ 128 IteratorBack *backend;\n+ 129 };\n+ 130\n+ 131#ifndef DOXYGEN\n+ 132 template\n+ 133 template\n+ 134 VirtualRefinement::Codim::\n+SubEntityIterator::\n+ 135SubEntityIterator(IteratorBack *backend_)\n+ 136 : backend(backend_)\n+ 137 {}\n 138\n- 141 template\n-142 class GeneralVertexOrder::iterator :\n- 143 public Dune::RandomAccessIteratorFacade\n- 144 {\n- 145 const GeneralVertexOrder *order;\n- 146 std::size_t codim;\n- 147 std::size_t subEntity;\n- 148 std::size_t vertex;\n- 149\n- 150 iterator(const GeneralVertexOrder &order_, std::size_t codim_,\n- 151 std::size_t subEntity_, std::size_t vertex_ = 0) :\n- 152 order(&order_), codim(codim_), subEntity(subEntity_), vertex(vertex_)\n- 153 { }\n- 154\n- 155 public:\n-156 const Index &dereference() const {\n- 157 return order->vertexOrder[order->refelem.subEntity(subEntity, codim,\n- 158 vertex, dim)];\n- 159 }\n-160 const Index &elementAt(std::ptrdiff_t n) const {\n- 161 return order->vertexOrder[order->refelem.subEntity(subEntity, codim,\n- 162 vertex+n, dim)];\n- 163 }\n-164 bool equals(const iterator &other) const {\n- 165 return order == other.order && codim == other.codim &&\n- 166 subEntity == other.subEntity && vertex == other.vertex;\n- 167 }\n-168 void increment() { ++vertex; }\n-169 void decrement() { --vertex; }\n-170 void advance(std::ptrdiff_t n) { vertex += n; }\n-171 std::ptrdiff_t distanceTo(const iterator &other) const {\n- 172 // make sure we reference the same container\n- 173 assert(order == other.order && codim == other.codim &&\n- 174 subEntity == other.subEntity);\n- 175 if(vertex < other.vertex) return other.vertex - vertex;\n- 176 else return -static_cast(vertex - other.vertex);\n- 177 }\n- 178\n- 179 friend class GeneralVertexOrder;\n- 180\n- 182\n-187 iterator() { }\n- 188 };\n- 189} // namespace Dune\n- 190\n- 191#endif // DUNE_GEOMETRY_GENERALVERTEXORDER_HH\n-referenceelements.hh\n+ 139 template\n+ 140 template\n+ 141 VirtualRefinement::Codim::\n+SubEntityIterator::\n+ 142SubEntityIterator(const This &other)\n+ 143 : backend(other.backend->clone())\n+ 144 {}\n+ 145\n+ 146 template\n+ 147 template\n+ 148 VirtualRefinement::Codim::\n+SubEntityIterator::\n+ 149 ~SubEntityIterator()\n+ 150 {\n+ 151 delete backend;\n+ 152 }\n+ 153\n+ 154 template\n+ 155 template\n+ 156 typename VirtualRefinement::template\n+Codim::SubEntityIterator &\n+ 157 VirtualRefinement::Codim::\n+SubEntityIterator::\n+ 158 operator=(const This &other)\n+ 159 {\n+ 160 delete backend;\n+ 161 backend = other.backend->clone();\n+ 162 }\n+ 163\n+ 164 template\n+ 165 template\n+ 166 bool\n+ 167 VirtualRefinement::Codim::\n+SubEntityIterator::\n+ 168 equals(const This &other) const\n+ 169 { return *backend == *(other.backend); }\n+ 170\n+ 171 template\n+ 172 template\n+ 173 void\n+ 174 VirtualRefinement::Codim::\n+SubEntityIterator::\n+ 175 increment()\n+ 176 {\n+ 177 ++*backend;\n+ 178 }\n+ 179\n+ 180 template\n+ 181 template\n+ 182 int\n+ 183 VirtualRefinement::Codim::\n+SubEntityIterator::\n+ 184 index() const\n+ 185 { return backend->index(); }\n+ 186\n+ 187 template\n+ 188 template\n+ 189 typename VirtualRefinement::template\n+Codim::SubEntityIterator::CoordVector\n+ 190 VirtualRefinement::Codim::\n+SubEntityIterator::\n+ 191 coords() const\n+ 192 { return backend->coords(); }\n+ 193#endif // DOXYGEN\n+ 194\n+ 195 //\n+ 196 // The iterator backend\n+ 197 //\n+ 198\n+ 199 template\n+200 class VirtualRefinementSubEntityIteratorBackSpecial;\n+ 201\n+ 202 // The iterator backend for vertices\n+ 203 template\n+204 class VirtualRefinementSubEntityIteratorBackSpecial\n+ 205 {\n+ 206 public:\n+ 207\n+208 virtual ~VirtualRefinementSubEntityIteratorBackSpecial()\n+ 209 {}\n+ 210 };\n+ 211\n+ 212 // The iterator backend for elements\n+ 213 template\n+214 class VirtualRefinementSubEntityIteratorBackSpecial\n+ 215 {\n+ 216 public:\n+217 typedef VirtualRefinement Refinement;\n+218 typedef typename Refinement::IndexVector IndexVector;\n+ 219\n+220 virtual IndexVector vertexIndices() const = 0;\n+ 221\n+222 virtual ~VirtualRefinementSubEntityIteratorBackSpecial()\n+ 223 {}\n+ 224 };\n+ 225\n+ 226 // The iterator backend common stuff\n+ 227 template\n+ 228 template\n+229 class VirtualRefinement::SubEntityIteratorBack\n+ 230 : public VirtualRefinementSubEntityIteratorBackSpecial\n+ 231 {\n+ 232 public:\n+233 typedef VirtualRefinement Refinement;\n+234 typedef typename Refinement::template SubEntityIteratorBack\n+This;\n+235 typedef typename Refinement::CoordVector CoordVector;\n+ 236\n+237 virtual ~SubEntityIteratorBack() {}\n+ 238\n+239 virtual This *clone() const = 0;\n+ 240\n+241 virtual bool operator==(const This &other) const = 0;\n+242 virtual This &operator++() = 0;\n+ 243\n+244 virtual int index() const = 0;\n+245 virtual CoordVector coords() const = 0;\n+ 246 };\n+ 247\n+ 248 // /////////////////////////////////////////////////\n+ 249 //\n+ 250 // The derived classes and their iterator backends\n+ 251 //\n+ 252\n+ 253 //\n+ 254 // The refinement implementation\n+ 255 //\n+ 256\n+ 257 template\n+259 class VirtualRefinementImp\n+ 260 : public Dune::VirtualRefinement\n+ 261 {\n+ 262 public:\n+263 typedef Dune::StaticRefinement StaticRefinement;\n+264 typedef Dune::VirtualRefinement VirtualRefinement;\n+ 265\n+ 266 template\n+ 267 class SubEntityIteratorBack;\n+ 268\n+ 269 int nVertices(Dune::RefinementIntervals tag) const;\n+ 270\n+ 271 int nElements(Dune::RefinementIntervals tag) const;\n+ 272\n+ 273 static VirtualRefinementImp\n+&instance();\n+ 274 private:\n+ 275 VirtualRefinementImp() {}\n+ 276\n+ 277 typename VirtualRefinement::VertexIteratorBack *vBeginBack(Dune::\n+RefinementIntervals tag) const;\n+ 278 typename VirtualRefinement::VertexIteratorBack *vEndBack(Dune::\n+RefinementIntervals tag) const;\n+ 279 typename VirtualRefinement::ElementIteratorBack *eBeginBack(Dune::\n+RefinementIntervals tag) const;\n+ 280 typename VirtualRefinement::ElementIteratorBack *eEndBack(Dune::\n+RefinementIntervals tag) const;\n+ 281 };\n+ 282\n+ 283 template\n+ 285 VirtualRefinementImp &\n+286 VirtualRefinementImp::\n+instance()\n+ 287 {\n+ 288 static VirtualRefinementImp instance_{};\n+ 289 return instance_;\n+ 290 }\n+ 291\n+ 292 template\n+294 int VirtualRefinementImp::\n+ 295nVertices(Dune::RefinementIntervals tag) const\n+ 296 {\n+ 297 return StaticRefinement::nVertices(tag);\n+ 298 }\n+ 299\n+ 300 template\n+ 302 typename VirtualRefinementImp::VirtualRefinement::VertexIteratorBack *\n+ 303 VirtualRefinementImp::\n+ 304vBeginBack(Dune::RefinementIntervals tag) const\n+ 305 {\n+ 306 return new SubEntityIteratorBack(StaticRefinement::vBegin\n+(tag));\n+ 307 }\n+ 308\n+ 309 template\n+ 311 typename VirtualRefinementImp::VirtualRefinement::VertexIteratorBack *\n+ 312 VirtualRefinementImp::\n+ 313 vEndBack(Dune::RefinementIntervals tag) const\n+ 314 {\n+ 315 return new SubEntityIteratorBack(StaticRefinement::vEnd(tag));\n+ 316 }\n+ 317\n+ 318 template\n+320 int VirtualRefinementImp::\n+nElements(Dune::RefinementIntervals tag) const\n+ 321 {\n+ 322 return StaticRefinement::nElements(tag);\n+ 323 }\n+ 324\n+ 325 template\n+ 327 typename VirtualRefinementImp::VirtualRefinement::ElementIteratorBack *\n+ 328 VirtualRefinementImp::\n+ 329eBeginBack(Dune::RefinementIntervals tag) const\n+ 330 {\n+ 331 return new SubEntityIteratorBack<0>(StaticRefinement::eBegin(tag));\n+ 332 }\n+ 333\n+ 334 template\n+ 336 typename VirtualRefinementImp::VirtualRefinement::ElementIteratorBack *\n+ 337 VirtualRefinementImp::\n+ 338 eEndBack(Dune::RefinementIntervals tag) const\n+ 339 {\n+ 340 return new SubEntityIteratorBack<0>(StaticRefinement::eEnd(tag));\n+ 341 }\n+ 342\n+ 343 //\n+ 344 // The iterator backend implementation\n+ 345 //\n+ 346\n+ 347 // The iterator backend implementation specialties\n+ 348 template\n+350 class VirtualRefinementImpSubEntityIteratorBackSpecial;\n+ 351\n+ 352 // The iterator backend implementation specialties for vertices\n+ 353 template\n+355 class VirtualRefinementImpSubEntityIteratorBackSpecial\n+ 356 : public VirtualRefinement::template\n+SubEntityIteratorBack\n+ 357 {};\n+ 358\n+ 359 // The iterator backend implementation specialties for elements\n+ 360\n+ 361 template\n+363 class VirtualRefinementImpSubEntityIteratorBackSpecial\n+ 364 : public VirtualRefinement::template\n+SubEntityIteratorBack<0>\n+ 365 {\n+ 366 public:\n+367 typedef Dune::VirtualRefinementImp VirtualRefinementImp;\n+368 typedef typename VirtualRefinementImp::template SubEntityIteratorBack<0>\n+Common;\n+369 typedef typename VirtualRefinementImp::StaticRefinement StaticRefinement;\n+370 typedef VirtualRefinement RefinementBase;\n+371 typedef typename RefinementBase::IndexVector IndexVector;\n+ 372\n+ 373 IndexVector vertexIndices() const;\n+ 374 };\n+ 375\n+ 376 template\n+ 378 typename VirtualRefinementImpSubEntityIteratorBackSpecial::IndexVector\n+379 VirtualRefinementImpSubEntityIteratorBackSpecial::\n+ 380vertexIndices() const\n+ 381 {\n+ 382 IndexVector vIndices;\n+ 383 vIndices.reserve(StaticRefinement::IndexVector::dimension);\n+ 384\n+ 385 typename StaticRefinement::IndexVector sIndices = static_cast(this)->backend.vertexIndices();\n+ 386 for(int i = 0; i < StaticRefinement::IndexVector::dimension; ++i)\n+ 387 vIndices.push_back(sIndices[i]);\n+ 388 return vIndices;\n+ 389 }\n+ 390\n+ 391 // The shared iterator backend implementation\n+ 392 template\n+ 394 template\n+395 class VirtualRefinementImp::\n+SubEntityIteratorBack\n+ 396 : public VirtualRefinementImpSubEntityIteratorBackSpecial\n+ 397 {\n+ 398 public:\n+399 typedef typename StaticRefinement::template Codim::\n+SubEntityIterator BackendIterator;\n+400 typedef typename VirtualRefinementImp::template SubEntityIteratorBack This;\n+401 typedef typename VirtualRefinement::template\n+SubEntityIteratorBack Base;\n+402 typedef typename VirtualRefinement::CoordVector CoordVector;\n+ 403\n+ 404 SubEntityIteratorBack(const BackendIterator &backend);\n+ 405 SubEntityIteratorBack(const This &other);\n+ 406\n+ 407 Base *clone() const;\n+ 408\n+ 409 bool operator==(const Base &other) const;\n+ 410 Base &operator++();\n+ 411\n+ 412 int index() const;\n+413 CoordVector coords() const;\n+ 414\n+ 415 private:\n+ 416 friend class VirtualRefinementImpSubEntityIteratorBackSpecial;\n+ 417 BackendIterator backend;\n+ 418 };\n+ 419\n+ 420 template\n+ 422 template\n+423 VirtualRefinementImp::\n+SubEntityIteratorBack::\n+ 424SubEntityIteratorBack(const BackendIterator &backend_)\n+ 425 : backend(backend_)\n+ 426 {}\n+ 427\n+ 428 template\n+ 430 template\n+431 VirtualRefinementImp::\n+SubEntityIteratorBack::\n+ 432SubEntityIteratorBack(const This &other)\n+ 433 : VirtualRefinementImpSubEntityIteratorBackSpecial(other),\n+ 434 backend(other.backend)\n+ 435 {}\n+ 436\n+ 437 template\n+ 438 template\n+ 439 typename VirtualRefinementImp::template SubEntityIteratorBack::Base *\n+440 VirtualRefinementImp::\n+SubEntityIteratorBack::\n+ 441clone() const\n+ 442 { return new This(*this); }\n+ 443\n+ 444 template\n+ 445 template\n+ 446 bool\n+447 VirtualRefinementImp::\n+SubEntityIteratorBack::\n+ 448operator==(const Base &other) const\n+ 449 {\n+ 450 try {\n+ 451 return backend == dynamic_cast(other).backend;\n+ 452 }\n+ 453 catch(const std::bad_cast&)\n+ 454 {\n+ 455 return false;\n+ 456 }\n+ 457 }\n+ 458\n+ 459 template\n+ 460 template\n+ 461 typename VirtualRefinementImp::template SubEntityIteratorBack::Base &\n+462 VirtualRefinementImp::\n+SubEntityIteratorBack::\n+ 463operator++()\n+ 464 {\n+ 465 ++backend;\n+ 466 return *this;\n+ 467 }\n+ 468\n+ 469 template\n+ 470 template\n+ 471 int\n+472 VirtualRefinementImp::\n+SubEntityIteratorBack::\n+ 473index() const\n+ 474 { return backend.index(); }\n+ 475\n+ 476 template\n+ 477 template\n+ 478 typename VirtualRefinementImp::template SubEntityIteratorBack::CoordVector\n+479 VirtualRefinementImp::\n+SubEntityIteratorBack::\n+ 480coords() const\n+ 481 { return backend.coords(); }\n+ 482\n+ 483 // ////////////////////////\n+ 484 //\n+ 485 // The refinement builder\n+ 486 //\n+ 487\n+ 488 template\n+ 489 class RefinementBuilder;\n+ 490\n+ 501 template\n+ 502 VirtualRefinement &\n+503 buildRefinement(\n+ 504 GeometryType geometryType,\n+ 506 GeometryType coerceTo)\n+ 507 {\n+ 508 // Check that the user used valid geometry types\n+ 509 assert(geometryType.dim() == dimension && coerceTo.dim() == dimension);\n+ 510 return RefinementBuilder::build( geometryType.id(),\n+coerceTo.id() );\n+ 511 }\n+ 512\n+ 513 // In principle the trick with the class is no longer necessary,\n+ 514 // but I'm keeping it in here so it will be easier to specialize\n+ 515 // buildRefinement when someone implements pyramids and prisms\n+ 516 template\n+517 class RefinementBuilder\n+ 518 {\n+ 519 public:\n+ 520 static\n+ 521 VirtualRefinement &\n+522 build(unsigned topologyId, unsigned coerceToId)\n+ 523 {\n+ 524 topologyId &= ~1;\n+ 525 coerceToId &= ~1;\n+ 526\n+ 527 constexpr unsigned idSimplex = GeometryTypes::simplex(dimension).id() &\n+~1;\n+ 528 constexpr unsigned idCube = GeometryTypes::cube(dimension).id() & ~1;\n+ 529\n+ 530 switch( topologyId )\n+ 531 {\n+ 532 //case GeometryType::simplex:\n+ 533 case idSimplex :\n+ 534 //switch( coerceTo )\n+ 535 switch( coerceToId )\n+ 536 {\n+ 537 //case GeometryType::simplex:\n+ 538 case idSimplex :\n+ 539 return VirtualRefinementImp<_idSimplex,_CoordType,_idSimplex,_dimension>::\n+instance();\n+ 540 default :\n+ 541 break;\n+ 542 }\n+ 543 break;\n+ 544\n+ 545 //case GeometryType::cube:\n+ 546 case idCube :\n+ 547 switch( coerceToId )\n+ 548 {\n+ 549 case idSimplex :\n+ 550 return VirtualRefinementImp<_idCube,_CoordType,_idSimplex,_dimension>::\n+instance();\n+ 551 case idCube :\n+ 552 return VirtualRefinementImp<_idCube,_CoordType,_idCube,_dimension>::\n+instance();\n+ 553 default :\n+ 554 break;\n+ 555 }\n+ 556 break;\n+ 557\n+ 558 default :\n+ 559 break;\n+ 560 }\n+ 561 DUNE_THROW( NotImplemented, \"No Refinement<\" << topologyId << \",\n+CoordType, \"\n+ 562 << coerceToId << \" >.\");\n+ 563 }\n+ 564 };\n+ 565\n+ 566 template\n+567 class RefinementBuilder<1, CoordType>\n+ 568 {\n+ 569 static const std::size_t dimension = 1;\n+ 570 public:\n+ 571 static\n+ 572 VirtualRefinement &\n+573 build(unsigned topologyId, unsigned coerceToId)\n+ 574 {\n+ 575 topologyId &= ~1;\n+ 576 coerceToId &= ~1;\n+ 577\n+ 578 constexpr unsigned idSimplex = GeometryTypes::simplex(dimension).id() &\n+~1;\n+ 579\n+ 580 if (topologyId == 0 && coerceToId == 0)\n+ 581 return VirtualRefinementImp<_idSimplex,_CoordType,_idSimplex,_dimension>::\n+instance();\n+ 582\n+ 583 DUNE_THROW( NotImplemented, \"No Refinement<\" << topologyId << \",\n+CoordType, \"\n+ 584 << coerceToId << \" >.\");\n+ 585 }\n+ 586 };\n+ 587\n+ 588 template\n+589 class RefinementBuilder<3, CoordType>\n+ 590 {\n+ 591 static const std::size_t dimension = 3;\n+ 592 public:\n+ 593 static\n+ 594 VirtualRefinement &\n+595 build(unsigned topologyId, unsigned coerceToId)\n+ 596 {\n+ 597 topologyId &= ~1;\n+ 598 coerceToId &= ~1;\n+ 599\n+ 600 constexpr unsigned idSimplex = GeometryTypes::simplex(dimension).id() &\n+~1;\n+ 601 constexpr unsigned idCube = GeometryTypes::cube(dimension).id() & ~1;\n+ 602 constexpr unsigned idPrism = GeometryTypes::prism.id() & ~1;\n+ 603 constexpr unsigned idPyramid = GeometryTypes::pyramid.id() & ~1;\n+ 604\n+ 605 switch( topologyId )\n+ 606 {\n+ 607 //case GeometryType::simplex:\n+ 608 case idSimplex :\n+ 609 //switch( coerceTo )\n+ 610 switch( coerceToId )\n+ 611 {\n+ 612 //case GeometryType::simplex:\n+ 613 case idSimplex :\n+ 614 return VirtualRefinementImp<_idSimplex,_CoordType,_idSimplex,_dimension>::\n+instance();\n+ 615 default :\n+ 616 break;\n+ 617 }\n+ 618 break;\n+ 619\n+ 620 //case GeometryType::cube:\n+ 621 case idCube :\n+ 622 switch( coerceToId )\n+ 623 {\n+ 624 case idSimplex :\n+ 625 return VirtualRefinementImp<_idCube,_CoordType,_idSimplex,_dimension>::\n+instance();\n+ 626 case idCube :\n+ 627 return VirtualRefinementImp<_idCube,_CoordType,_idCube,_dimension>::\n+instance();\n+ 628 default :\n+ 629 break;\n+ 630 }\n+ 631 break;\n+ 632\n+ 633 //case GeometryType::prism:\n+ 634 case idPrism :\n+ 635 switch( coerceToId )\n+ 636 {\n+ 637 case idSimplex :\n+ 638 return VirtualRefinementImp<_idPrism,_CoordType,_idSimplex,_dimension>::\n+instance();\n+ 639 default :\n+ 640 break;\n+ 641 }\n+ 642 break;\n+ 643\n+ 644 //case GeometryType::pyramid:\n+ 645 case idPyramid :\n+ 646 switch( coerceToId )\n+ 647 {\n+ 648 case idSimplex :\n+ 649 return VirtualRefinementImp<_idPyramid,_CoordType,_idSimplex,_dimension>::\n+instance();\n+ 650 default :\n+ 651 break;\n+ 652 }\n+ 653 break;\n+ 654\n+ 655 default :\n+ 656 break;\n+ 657 }\n+ 658 DUNE_THROW( NotImplemented, \"No Refinement<\" << topologyId << \",\n+CoordType, \"\n+ 659 << coerceToId << \" >.\");\n+ 660 }\n+ 661 };\n+ 662\n+ 663} // namespace Dune\n+ 664\n+ 665#endif // DUNE_GEOMETRY_VIRTUALREFINEMENT_CC\n type.hh\n A unique label for each type of element that can occur in a grid.\n+refinement.hh\n+This file simply includes all Refinement implementations so you don't have to\n+do them separately.\n Dune\n Definition affinegeometry.hh:21\n-Dune::reduceOrder\n-void reduceOrder(const InIterator &inBegin, const InIterator &inEnd,\n-OutIterator outIt)\n-Algorithm to reduce vertex order information.\n-Definition generalvertexorder.hh:40\n-Dune::Geo::ReferenceElements\n-Class providing access to the singletons of the reference elements.\n-Definition referenceelements.hh:170\n-Dune::Geo::ReferenceElements::ReferenceElement\n-typename Container::ReferenceElement ReferenceElement\n-The reference element type.\n-Definition referenceelements.hh:188\n-Dune::GeneralVertexOrder\n-Class providing information on the ordering of vertices.\n-Definition generalvertexorder.hh:67\n-Dune::GeneralVertexOrder::Index\n-Index_ Index\n-Type of indices.\n-Definition generalvertexorder.hh:77\n-Dune::GeneralVertexOrder::type\n-const GeometryType & type() const\n-get type of the entity's geometry\n-Definition generalvertexorder.hh:85\n-Dune::GeneralVertexOrder::dimension\n-static const std::size_t dimension\n-export the dimension of the entity we provide information for\n-Definition generalvertexorder.hh:83\n-Dune::GeneralVertexOrder::getReduced\n-void getReduced(std::size_t codim, std::size_t subEntity, std::vector< Index >\n-&order) const\n-get a vector of reduced indices for some sub-entity\n-Definition generalvertexorder.hh:128\n-Dune::GeneralVertexOrder::end\n-iterator end(std::size_t codim, std::size_t subEntity) const\n-get end iterator for the vertex indices of some sub-entity\n-Definition generalvertexorder.hh:115\n-Dune::GeneralVertexOrder::GeneralVertexOrder\n-GeneralVertexOrder(const GeometryType >_, const InIterator &inBegin, const\n-InIterator &inEnd)\n-construct a GeneralVertexOrder\n-Definition generalvertexorder.hh:97\n-Dune::GeneralVertexOrder::begin\n-iterator begin(std::size_t codim, std::size_t subEntity) const\n-get begin iterator for the vertex indices of some sub-entity\n-Definition generalvertexorder.hh:108\n-Dune::GeneralVertexOrder::iterator\n-Iterate over the vertex indices of some sub-entity.\n-Definition generalvertexorder.hh:144\n-Dune::GeneralVertexOrder::iterator::iterator\n-iterator()\n-public default constructor\n-Definition generalvertexorder.hh:187\n-Dune::GeneralVertexOrder::iterator::decrement\n-void decrement()\n-Definition generalvertexorder.hh:169\n-Dune::GeneralVertexOrder::iterator::advance\n-void advance(std::ptrdiff_t n)\n-Definition generalvertexorder.hh:170\n-Dune::GeneralVertexOrder::iterator::dereference\n-const Index & dereference() const\n-Definition generalvertexorder.hh:156\n-Dune::GeneralVertexOrder::iterator::increment\n-void increment()\n-Definition generalvertexorder.hh:168\n-Dune::GeneralVertexOrder::iterator::equals\n-bool equals(const iterator &other) const\n-Definition generalvertexorder.hh:164\n-Dune::GeneralVertexOrder::iterator::distanceTo\n-std::ptrdiff_t distanceTo(const iterator &other) const\n-Definition generalvertexorder.hh:171\n-Dune::GeneralVertexOrder::iterator::elementAt\n-const Index & elementAt(std::ptrdiff_t n) const\n-Definition generalvertexorder.hh:160\n+Dune::buildRefinement\n+VirtualRefinement< dimension, CoordType > & buildRefinement(GeometryType\n+geometryType, GeometryType coerceTo)\n+return a reference to the VirtualRefinement according to the parameters\n+Definition virtualrefinement.cc:503\n+Dune::Codim\n+Static tag representing a codimension.\n+Definition dimension.hh:24\n+Dune::RefinementIntervals\n+Holds the number of refined intervals per axis needed for virtual and static\n+refinement.\n+Definition base.cc:94\n+Dune::StaticRefinement\n+Wrap each Refinement implementation to get a consistent interface.\n+Definition base.cc:141\n+Dune::StaticRefinement::eEnd\n+static ElementIterator eEnd(Dune::RefinementIntervals tag)\n+Get an ElementIterator.\n+Definition base.cc:247\n+Dune::StaticRefinement::eBegin\n+static ElementIterator eBegin(Dune::RefinementIntervals tag)\n+Get an ElementIterator.\n+Definition base.cc:237\n+Dune::StaticRefinement::nElements\n+static int nElements(Dune::RefinementIntervals tag)\n+Get the number of Elements.\n+Definition base.cc:227\n+Dune::StaticRefinement::nVertices\n+static int nVertices(Dune::RefinementIntervals tag)\n+Get the number of Vertices.\n+Definition base.cc:197\n+Dune::StaticRefinement::vBegin\n+static VertexIterator vBegin(Dune::RefinementIntervals tag)\n+Get a VertexIterator.\n+Definition base.cc:207\n+Dune::StaticRefinement::IndexVector\n+typedef IndexVector\n+The IndexVector of the Refinement.\n+Definition base.cc:177\n+Dune::StaticRefinement::vEnd\n+static VertexIterator vEnd(Dune::RefinementIntervals tag)\n+Get a VertexIterator.\n+Definition base.cc:217\n Dune::GeometryType\n Unique label for each type of entities that can occur in DUNE grids.\n Definition type.hh:126\n+Dune::GeometryType::dim\n+constexpr unsigned int dim() const\n+Return dimension of the type.\n+Definition type.hh:372\n+Dune::GeometryType::id\n+constexpr unsigned int id() const\n+Return the topology id of the type.\n+Definition type.hh:377\n+Dune::VirtualRefinementSubEntityIteratorSpecial\n+Definition virtualrefinement.cc:72\n+Dune::VirtualRefinementSubEntityIteratorSpecial<_dimension,_CoordType,_0_>::\n+Common\n+Refinement::template Codim< 0 >::SubEntityIterator Common\n+Definition virtualrefinement.cc:85\n+Dune::VirtualRefinementSubEntityIteratorSpecial<_dimension,_CoordType,_0_>::\n+Refinement\n+VirtualRefinement< dimension, CoordType > Refinement\n+Definition virtualrefinement.cc:84\n+Dune::VirtualRefinementSubEntityIteratorSpecial<_dimension,_CoordType,_0_>::\n+IndexVector\n+Refinement::IndexVector IndexVector\n+Definition virtualrefinement.cc:86\n+Dune::VirtualRefinement::Codim<_codimension_>::coords\n+VirtualRefinement< dimension, CoordType >::template Codim< codimension >::\n+SubEntityIterator::CoordVector coords() const\n+Dune::VirtualRefinement::Codim<_codimension_>::SubEntityIterator\n+SubEntityIterator(const This &other)\n+Dune::VirtualRefinement::Codim<_codimension_>::operator=\n+This & operator=(const This &other)\n+Dune::VirtualRefinement::Codim<_codimension_>::index\n+int index() const\n+Dune::VirtualRefinement::Codim<_codimension_>::~SubEntityIterator\n+~SubEntityIterator()\n+Dune::VirtualRefinement::Codim<_codimension_>::SubEntityIterator\n+SubEntityIterator(IteratorBack *backend)\n+Dune::VirtualRefinement::Codim<_codimension_>::IteratorBack\n+Refinement::template SubEntityIteratorBack< codimension > IteratorBack\n+Definition virtualrefinement.cc:109\n+Dune::VirtualRefinement::Codim<_codimension_>::CoordVector\n+Refinement::CoordVector CoordVector\n+Definition virtualrefinement.cc:110\n+Dune::VirtualRefinement::Codim<_codimension_>::This\n+Refinement::template Codim< codimension >::SubEntityIterator This\n+Definition virtualrefinement.cc:108\n+Dune::VirtualRefinement::Codim<_codimension_>::equals\n+bool equals(const This &other) const\n+Dune::VirtualRefinement::Codim<_codimension_>::Refinement\n+VirtualRefinement< dimension, CoordType > Refinement\n+Definition virtualrefinement.cc:107\n+Dune::VirtualRefinement::Codim<_codimension_>::increment\n+void increment()\n+Dune::VirtualRefinementSubEntityIteratorBackSpecial\n+Definition virtualrefinement.cc:200\n+Dune::VirtualRefinementSubEntityIteratorBackSpecial<_dimension,_CoordType,\n+dimension_>::~VirtualRefinementSubEntityIteratorBackSpecial\n+virtual ~VirtualRefinementSubEntityIteratorBackSpecial()\n+Definition virtualrefinement.cc:208\n+Dune::VirtualRefinementSubEntityIteratorBackSpecial<_dimension,_CoordType,_0\n+>::vertexIndices\n+virtual IndexVector vertexIndices() const =0\n+Dune::VirtualRefinementSubEntityIteratorBackSpecial<_dimension,_CoordType,_0\n+>::Refinement\n+VirtualRefinement< dimension, CoordType > Refinement\n+Definition virtualrefinement.cc:217\n+Dune::VirtualRefinementSubEntityIteratorBackSpecial<_dimension,_CoordType,_0\n+>::IndexVector\n+Refinement::IndexVector IndexVector\n+Definition virtualrefinement.cc:218\n+Dune::VirtualRefinementSubEntityIteratorBackSpecial<_dimension,_CoordType,_0\n+>::~VirtualRefinementSubEntityIteratorBackSpecial\n+virtual ~VirtualRefinementSubEntityIteratorBackSpecial()\n+Definition virtualrefinement.cc:222\n+Dune::VirtualRefinement::SubEntityIteratorBack\n+Definition virtualrefinement.cc:231\n+Dune::VirtualRefinement::SubEntityIteratorBack::index\n+virtual int index() const =0\n+Dune::VirtualRefinement::SubEntityIteratorBack::This\n+Refinement::template SubEntityIteratorBack< codimension > This\n+Definition virtualrefinement.cc:234\n+Dune::VirtualRefinement::SubEntityIteratorBack::clone\n+virtual This * clone() const =0\n+Dune::VirtualRefinement::SubEntityIteratorBack::CoordVector\n+Refinement::CoordVector CoordVector\n+Definition virtualrefinement.cc:235\n+Dune::VirtualRefinement::SubEntityIteratorBack::Refinement\n+VirtualRefinement< dimension, CoordType > Refinement\n+Definition virtualrefinement.cc:233\n+Dune::VirtualRefinement::SubEntityIteratorBack::operator==\n+virtual bool operator==(const This &other) const =0\n+Dune::VirtualRefinement::SubEntityIteratorBack::coords\n+virtual CoordVector coords() const =0\n+Dune::VirtualRefinement::SubEntityIteratorBack::~SubEntityIteratorBack\n+virtual ~SubEntityIteratorBack()\n+Definition virtualrefinement.cc:237\n+Dune::VirtualRefinement::SubEntityIteratorBack::operator++\n+virtual This & operator++()=0\n+Dune::VirtualRefinementImp\n+Definition virtualrefinement.cc:261\n+Dune::VirtualRefinementImp::nVertices\n+int nVertices(Dune::RefinementIntervals tag) const\n+Get the number of Vertices.\n+Definition virtualrefinement.cc:295\n+Dune::VirtualRefinementImp::VirtualRefinement\n+Dune::VirtualRefinement< dimension, CoordType > VirtualRefinement\n+Definition virtualrefinement.cc:264\n+Dune::VirtualRefinementImp::nElements\n+int nElements(Dune::RefinementIntervals tag) const\n+Get the number of Elements.\n+Definition virtualrefinement.cc:320\n+Dune::VirtualRefinementImp::instance\n+static VirtualRefinementImp< topologyId, CoordType, coerceToId, dimension > &\n+instance()\n+Definition virtualrefinement.cc:286\n+Dune::VirtualRefinementImp::StaticRefinement\n+Dune::StaticRefinement< topologyId, CoordType, coerceToId, dimension >\n+StaticRefinement\n+Definition virtualrefinement.cc:263\n+Dune::VirtualRefinementImp::SubEntityIteratorBack\n+Definition virtualrefinement.cc:397\n+Dune::VirtualRefinementImp::SubEntityIteratorBack::Base\n+VirtualRefinement::template SubEntityIteratorBack< codimension > Base\n+Definition virtualrefinement.cc:401\n+Dune::VirtualRefinementImp::SubEntityIteratorBack::This\n+VirtualRefinementImp< topologyId, CoordType, coerceToId, dimension >::template\n+SubEntityIteratorBack< codimension > This\n+Definition virtualrefinement.cc:400\n+Dune::VirtualRefinementImp::SubEntityIteratorBack::BackendIterator\n+StaticRefinement::template Codim< codimension >::SubEntityIterator\n+BackendIterator\n+Definition virtualrefinement.cc:399\n+Dune::VirtualRefinementImp::SubEntityIteratorBack::CoordVector\n+VirtualRefinement::CoordVector CoordVector\n+Definition virtualrefinement.cc:402\n+Dune::VirtualRefinementImpSubEntityIteratorBackSpecial\n+Definition virtualrefinement.cc:350\n+Dune::VirtualRefinementImpSubEntityIteratorBackSpecial<_topologyId,_CoordType,\n+coerceToId,_dimension,_0_>::Common\n+VirtualRefinementImp::template SubEntityIteratorBack< 0 > Common\n+Definition virtualrefinement.cc:368\n+Dune::VirtualRefinementImpSubEntityIteratorBackSpecial<_topologyId,_CoordType,\n+coerceToId,_dimension,_0_>::IndexVector\n+RefinementBase::IndexVector IndexVector\n+Definition virtualrefinement.cc:371\n+Dune::VirtualRefinementImpSubEntityIteratorBackSpecial<_topologyId,_CoordType,\n+coerceToId,_dimension,_0_>::RefinementBase\n+VirtualRefinement< dimension, CoordType > RefinementBase\n+Definition virtualrefinement.cc:370\n+Dune::VirtualRefinementImpSubEntityIteratorBackSpecial<_topologyId,_CoordType,\n+coerceToId,_dimension,_0_>::VirtualRefinementImp\n+Dune::VirtualRefinementImp< topologyId, CoordType, coerceToId, dimension >\n+VirtualRefinementImp\n+Definition virtualrefinement.cc:367\n+Dune::VirtualRefinementImpSubEntityIteratorBackSpecial<_topologyId,_CoordType,\n+coerceToId,_dimension,_0_>::StaticRefinement\n+VirtualRefinementImp::StaticRefinement StaticRefinement\n+Definition virtualrefinement.cc:369\n+Dune::RefinementBuilder\n+Definition virtualrefinement.cc:518\n+Dune::RefinementBuilder::build\n+static VirtualRefinement< dimension, CoordType > & build(unsigned topologyId,\n+unsigned coerceToId)\n+Definition virtualrefinement.cc:522\n+Dune::RefinementBuilder<_1,_CoordType_>::build\n+static VirtualRefinement< dimension, CoordType > & build(unsigned topologyId,\n+unsigned coerceToId)\n+Definition virtualrefinement.cc:573\n+Dune::RefinementBuilder<_3,_CoordType_>::build\n+static VirtualRefinement< dimension, CoordType > & build(unsigned topologyId,\n+unsigned coerceToId)\n+Definition virtualrefinement.cc:595\n+Dune::VirtualRefinement\n+VirtualRefinement base class.\n+Definition virtualrefinement.hh:294\n+Dune::VirtualRefinement::VertexIteratorBack\n+SubEntityIteratorBack< dimension > VertexIteratorBack\n+Definition virtualrefinement.hh:318\n+Dune::VirtualRefinement::vBegin\n+VertexIterator vBegin(Dune::RefinementIntervals tag) const\n+Get an VertexIterator.\n+Definition virtualrefinement.cc:38\n+Dune::VirtualRefinement::eBegin\n+ElementIterator eBegin(Dune::RefinementIntervals tag) const\n+Get an ElementIterator.\n+Definition virtualrefinement.cc:54\n+Dune::VirtualRefinement::eEnd\n+ElementIterator eEnd(Dune::RefinementIntervals tag) const\n+Get an ElementIterator.\n+Definition virtualrefinement.cc:62\n+Dune::VirtualRefinement::ElementIterator\n+Codim< 0 >::SubEntityIterator ElementIterator\n+The ElementIterator of the VirtualRefinement.\n+Definition virtualrefinement.hh:301\n+Dune::VirtualRefinement::vEnd\n+VertexIterator vEnd(Dune::RefinementIntervals tag) const\n+Get an VertexIterator.\n+Definition virtualrefinement.cc:46\n+Dune::VirtualRefinement::CoordVector\n+FieldVector< CoordType, dimension > CoordVector\n+The CoordVector of the VirtualRefinement.\n+Definition virtualrefinement.hh:308\n+Dune::VirtualRefinement::VertexIterator\n+Codim< dimension >::SubEntityIterator VertexIterator\n+The VertexIterator of the VirtualRefinement.\n+Definition virtualrefinement.hh:299\n+Dune::VirtualRefinement::ElementIteratorBack\n+SubEntityIteratorBack< 0 > ElementIteratorBack\n+Definition virtualrefinement.hh:319\n+Dune::VirtualRefinement::Codim\n+codim database of VirtualRefinement\n+Definition virtualrefinement.hh:378\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00197.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00197.html", "unified_diff": "@@ -87,15 +87,15 @@\n #include <cstdint>
    \n #include <string>
    \n #include <type_traits>
    \n #include <dune/common/exceptions.hh>
    \n #include <dune/common/keywords.hh>
    \n #include <dune/common/typetraits.hh>
    \n #include <dune/common/unused.hh>
    \n-#include <dune/geometry/deprecated_topology.hh>
    \n+#include <dune/geometry/deprecated_topology.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00197_source.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00197_source.html", "unified_diff": "@@ -140,15 +140,15 @@\n
    98
    \n
    99// the Topology classes are deprecated and will be removed for the 2.8.
    \n
    100// Temporarily a header 'deprecated_topology.hh' is provided which will be removed after the 2.9 release.
    \n
    101#if __GNUC__ >= 7
    \n
    102# pragma GCC diagnostic push
    \n
    103# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
    \n
    104#endif
    \n-\n+\n
    106#if __GNUC__ >= 7
    \n
    107# pragma GCC diagnostic pop
    \n
    108#endif
    \n
    109
    \n
    110 // GeometryType
    \n
    111 // -------------
    \n
    112
    \n@@ -518,15 +518,15 @@\n
    591 return Operation< geometryId >::apply( std::forward< Args >( args )... );
    \n
    592 }
    \n
    593 };
    \n
    594 } // namespace Impl
    \n
    595} // namespace Dune
    \n
    596
    \n
    597#endif // DUNE_GEOMETRY_TYPE_HH
    \n-\n+\n
    Definition affinegeometry.hh:21
    \n
    std::ostream & operator<<(std::ostream &s, const GeometryType &a)
    Prints the type to an output stream.
    Definition type.hh:421
    \n
    Unique label for each type of entities that can occur in DUNE grids.
    Definition type.hh:126
    \n
    constexpr GeometryType(unsigned int topologyId, unsigned int dim)
    Constructor, using the topologyId (integer) and the dimension.
    Definition type.hh:263
    \n
    constexpr bool operator<(const GeometryType &other) const
    less-than operation for use with maps
    Definition type.hh:404
    \n
    constexpr bool operator!=(const GeometryType &other) const
    Check for inequality.
    Definition type.hh:399
    \n
    constexpr bool isPyramid() const
    Return true if entity is a pyramid.
    Definition type.hh:316
    \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00200.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00200.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: axisalignedcubegeometry.hh File Reference\n+dune-geometry: typeindex.hh File Reference\n \n \n \n \n \n \n \n@@ -72,42 +72,43 @@\n
  • dune
  • geometry
  • \n \n \n
    \n \n-
    axisalignedcubegeometry.hh File Reference
    \n+
    typeindex.hh File Reference
    \n
    \n
    \n \n-

    A geometry implementation for axis-aligned hypercubes. \n+

    Helper classes to provide indices for geometrytypes for use in a vector. \n More...

    \n-
    #include <bitset>
    \n-#include <dune/common/fvector.hh>
    \n-#include <dune/common/fmatrix.hh>
    \n-#include <dune/common/diagonalmatrix.hh>
    \n-#include <dune/geometry/referenceelements.hh>
    \n-#include <dune/geometry/type.hh>
    \n+
    #include <cstddef>
    \n+#include <dune/common/indices.hh>
    \n+#include <dune/common/hybridutilities.hh>
    \n+#include "type.hh"
    \n
    \n

    Go to the source code of this file.

    \n

    \n Classes

    class  Dune::GeometryType
     Unique label for each type of entities that can occur in DUNE grids. More...
    \n \n-\n-\n+\n+\n+\n+\n+\n \n

    \n Classes

    class  Dune::AxisAlignedCubeGeometry< CoordType, dim, coorddim >
     A geometry implementation for axis-aligned hypercubes. More...
    class  Dune::LocalGeometryTypeIndex
     Compute per-dimension indices for geometry types. More...
     
    class  Dune::GlobalGeometryTypeIndex
     Compute indices for geometry types, taking the dimension into account. More...
     
    \n \n \n \n

    \n Namespaces

    namespace  Dune
     
    \n

    Detailed Description

    \n-

    A geometry implementation for axis-aligned hypercubes.

    \n+

    Helper classes to provide indices for geometrytypes for use in a vector.

    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,28 +7,31 @@\n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n Classes | Namespaces\n-axisalignedcubegeometry.hh File Reference\n-A geometry implementation for axis-aligned hypercubes. More...\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n+typeindex.hh File Reference\n+Helper classes to provide indices for geometrytypes for use in a vector.\n+More...\n+#include \n+#include \n+#include \n+#include \"type.hh\"\n Go_to_the_source_code_of_this_file.\n Classes\n-class \u00a0Dune::AxisAlignedCubeGeometry<_CoordType,_dim,_coorddim_>\n-\u00a0 A geometry implementation for axis-aligned hypercubes. More...\n+class \u00a0Dune::LocalGeometryTypeIndex\n+\u00a0 Compute per-dimension indices for geometry types. More...\n+\u00a0\n+class \u00a0Dune::GlobalGeometryTypeIndex\n+\u00a0 Compute indices for geometry types, taking the dimension into account.\n+ More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n ***** Detailed Description *****\n-A geometry implementation for axis-aligned hypercubes.\n+Helper classes to provide indices for geometrytypes for use in a vector.\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00200_source.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00200_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: axisalignedcubegeometry.hh Source File\n+dune-geometry: typeindex.hh Source File\n \n \n \n \n \n \n \n@@ -74,356 +74,161 @@\n \n
    \n \n
    \n \n
    \n-
    axisalignedcubegeometry.hh
    \n+
    typeindex.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
    \n
    4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n-
    5
    \n-
    6#ifndef DUNE_GEOMETRY_AXISALIGNED_CUBE_GEOMETRY_HH
    \n-
    7#define DUNE_GEOMETRY_AXISALIGNED_CUBE_GEOMETRY_HH
    \n-
    8
    \n-
    13#include <bitset>
    \n-
    14
    \n-
    15#include <dune/common/fvector.hh>
    \n-
    16#include <dune/common/fmatrix.hh>
    \n-
    17#include <dune/common/diagonalmatrix.hh>
    \n+
    5#ifndef DUNE_GEOMETRY_TYPEINDEX_HH
    \n+
    6#define DUNE_GEOMETRY_TYPEINDEX_HH
    \n+
    7
    \n+
    14#include <cstddef>
    \n+
    15
    \n+
    16#include <dune/common/indices.hh>
    \n+
    17#include <dune/common/hybridutilities.hh>
    \n
    18
    \n-\n-
    20#include <dune/geometry/type.hh>
    \n-
    21
    \n-
    22
    \n-
    23namespace Dune {
    \n-
    24
    \n-
    48 template <class CoordType, unsigned int dim, unsigned int coorddim>
    \n-
    \n-\n-
    50 {
    \n-
    51
    \n-
    52
    \n-
    53 public:
    \n+
    19#include "type.hh"
    \n+
    20
    \n+
    21namespace Dune
    \n+
    22{
    \n+
    \n+\n+
    25 {
    \n+
    32 inline static constexpr std::size_t regular_size(std::size_t dim)
    \n+
    33 {
    \n+
    34 // The following expression is derived from the expression for
    \n+
    35 // GlobalGeometryTypeIndex::regular_offset(). Subtracting
    \n+
    36 // regular_offset(dim+1)-regular_offset(dim) we get:
    \n+
    37 //
    \n+
    38 // ((1 << dim+1) >> 1) - ((1 << dim) >> 1)
    \n+
    39 //
    \n+
    40 // We always have
    \n+
    41 //
    \n+
    42 // dim >= 0,
    \n+
    43 //
    \n+
    44 // so
    \n+
    45 //
    \n+
    46 // (1 << dim+1) >= 2 and (1 << dim+2) % 2 == 0.
    \n+
    47 //
    \n+
    48 // So if we apply a single right-shift to that, we will never lose any
    \n+
    49 // set bits, thus
    \n+
    50 //
    \n+
    51 // ((1 << dim+1) >> 1) == (1 << dim)
    \n+
    52 return (1 << dim) - ((1 << dim) >> 1);
    \n+
    53 }
    \n
    54
    \n-
    56 constexpr static int mydimension = dim;
    \n-
    57
    \n-
    59 constexpr static int coorddimension = coorddim;
    \n-
    60
    \n-
    62 typedef CoordType ctype;
    \n-
    63
    \n-
    65 typedef FieldVector<ctype,dim> LocalCoordinate;
    \n+
    55 public:
    \n+
    \n+
    61 inline static constexpr std::size_t size(std::size_t dim)
    \n+
    62 {
    \n+
    63 // one for "none"
    \n+
    64 return regular_size(dim) + 1;
    \n+
    65 }
    \n+
    \n
    66
    \n-
    68 typedef FieldVector<ctype,coorddim> GlobalCoordinate;
    \n-
    69
    \n-
    71 typedef ctype Volume;
    \n-
    72
    \n-
    79 typedef typename std::conditional<dim==coorddim,
    \n-
    80 DiagonalMatrix<ctype,dim>,
    \n-
    81 FieldMatrix<ctype,dim,coorddim> >::type JacobianTransposed;
    \n-
    82
    \n-
    89 typedef typename std::conditional<dim==coorddim,
    \n-
    90 DiagonalMatrix<ctype,dim>,
    \n-
    91 FieldMatrix<ctype,coorddim,dim> >::type JacobianInverseTransposed;
    \n-
    92
    \n-
    100 using Jacobian = std::conditional_t<dim==coorddim, DiagonalMatrix<ctype,dim>, FieldMatrix<ctype,coorddim,dim> >;
    \n-
    101
    \n-
    109 using JacobianInverse = std::conditional_t<dim==coorddim, DiagonalMatrix<ctype,dim>, FieldMatrix<ctype,dim,coorddim> >;
    \n-
    110
    \n-
    \n-
    115 AxisAlignedCubeGeometry(const Dune::FieldVector<ctype,coorddim> lower,
    \n-
    116 const Dune::FieldVector<ctype,coorddim> upper)
    \n-
    117 : lower_(lower),
    \n-
    118 upper_(upper),
    \n-
    119 axes_()
    \n-
    120 {
    \n-
    121 static_assert(dim==coorddim, "Use this constructor only if dim==coorddim!");
    \n-
    122 // all 'true', but is never actually used
    \n-
    123 axes_ = (1<<coorddim)-1;
    \n-
    124 }
    \n-
    \n-
    125
    \n-
    \n-
    133 AxisAlignedCubeGeometry(const Dune::FieldVector<ctype,coorddim> lower,
    \n-
    134 const Dune::FieldVector<ctype,coorddim> upper,
    \n-
    135 const std::bitset<coorddim>& axes)
    \n-
    136 : lower_(lower),
    \n-
    137 upper_(upper),
    \n-
    138 axes_(axes)
    \n+
    \n+
    73 inline static constexpr std::size_t index(const GeometryType &gt)
    \n+
    74 {
    \n+
    75 return gt.isNone() ? regular_size(gt.dim()) : (gt.id() >> 1);
    \n+
    76 }
    \n+
    \n+
    77
    \n+
    \n+
    79 inline static constexpr GeometryType type(std::size_t dim, std::size_t index) {
    \n+
    80 return (index == regular_size(dim)) ?
    \n+
    81 GeometryTypes::none(dim) :
    \n+
    82 // the cast to unsigned makes sure this is interpreted as the topology
    \n+
    83 // ID constructor
    \n+
    84 GeometryType(static_cast< unsigned int >(index << 1), dim);
    \n+
    85 }
    \n+
    \n+
    86 };
    \n+
    \n+
    87
    \n+
    \n+\n+
    90 {
    \n+
    98 inline static constexpr std::size_t regular_offset(std::size_t dim)
    \n+
    99 {
    \n+
    100 // The number of regular geometry types in a given dimension is
    \n+
    101 // 2^(dim-1). For dim==0 this would yield 1/2 geometry types (which is
    \n+
    102 // obviously bogus, dim==0 has one regular geometry type, the point).
    \n+
    103 // The following expression relies on 1 >> 1 == 0 to treat dim==0
    \n+
    104 // specially.
    \n+
    105 return (1 << dim) >> 1;
    \n+
    106 }
    \n+
    107
    \n+
    108 public:
    \n+
    \n+
    113 inline static constexpr std::size_t offset(std::size_t dim)
    \n+
    114 {
    \n+
    115 // dim times "none"
    \n+
    116 return regular_offset(dim) + dim;
    \n+
    117 }
    \n+
    \n+
    118
    \n+
    \n+
    125 inline static constexpr std::size_t size(std::size_t maxdim)
    \n+
    126 {
    \n+
    127 return offset(maxdim+1);
    \n+
    128 }
    \n+
    \n+
    129
    \n+
    \n+
    138 inline static constexpr std::size_t index(const GeometryType &gt)
    \n
    139 {
    \n-
    140 assert(axes.count()==dim);
    \n-
    141 for (size_t i=0; i<coorddim; i++)
    \n-
    142 if (not axes_[i])
    \n-
    143 upper_[i] = lower_[i];
    \n-
    144 }
    \n+
    140 return offset(gt.dim()) + LocalGeometryTypeIndex::index(gt);
    \n+
    141 }
    \n+
    \n+
    142 };
    \n
    \n+
    143
    \n+
    144 namespace Impl {
    \n
    145
    \n-
    \n-
    150 AxisAlignedCubeGeometry(const Dune::FieldVector<ctype,coorddim> lower)
    \n-
    151 : lower_(lower)
    \n-
    152 {}
    \n-
    \n-
    153
    \n-
    \n-\n-
    156 {
    \n-
    157 return GeometryTypes::cube(dim);
    \n-
    158 }
    \n-
    \n-
    159
    \n-
    \n-\n-
    162 {
    \n-
    163 GlobalCoordinate result;
    \n-
    164 if (dim == coorddim) { // fast case
    \n-
    165 for (size_t i=0; i<coorddim; i++)
    \n-
    166 result[i] = lower_[i] + local[i]*(upper_[i] - lower_[i]);
    \n-
    167 } else if (dim == 0) { // a vertex -- the other fast case
    \n-
    168 result = lower_; // hope for named-return-type-optimization
    \n-
    169 } else { // slow case
    \n-
    170 size_t lc=0;
    \n-
    171 for (size_t i=0; i<coorddim; i++)
    \n-
    172 result[i] = (axes_[i])
    \n-
    173 ? lower_[i] + local[lc++]*(upper_[i] - lower_[i])
    \n-
    174 : lower_[i];
    \n-
    175 }
    \n-
    176 return result;
    \n-
    177 }
    \n-
    \n-
    178
    \n-
    \n-\n-
    181 {
    \n-
    182 LocalCoordinate result;
    \n-
    183 if (dim == coorddim) { // fast case
    \n-
    184 for (size_t i=0; i<dim; i++)
    \n-
    185 result[i] = (global[i] - lower_[i]) / (upper_[i] - lower_[i]);
    \n-
    186 } else if (dim != 0) { // slow case
    \n-
    187 size_t lc=0;
    \n-
    188 for (size_t i=0; i<coorddim; i++)
    \n-
    189 if (axes_[i])
    \n-
    190 result[lc++] = (global[i] - lower_[i]) / (upper_[i] - lower_[i]);
    \n-
    191 }
    \n-
    192 return result;
    \n-
    193 }
    \n-
    \n-
    194
    \n-
    \n-\n-
    197 {
    \n-
    198 JacobianTransposed result;
    \n-
    199
    \n-
    200 // Actually compute the result. Uses different methods depending
    \n-
    201 // on what kind of matrix JacobianTransposed is.
    \n-
    202 jacobianTransposed(result);
    \n-
    203
    \n-
    204 return result;
    \n-
    205 }
    \n-
    \n-
    206
    \n-
    \n-\n-
    209 {
    \n-\n-
    211
    \n-
    212 // Actually compute the result. Uses different methods depending
    \n-
    213 // on what kind of matrix JacobianTransposed is.
    \n-\n-
    215
    \n-
    216 return result;
    \n-
    217 }
    \n-
    \n-
    218
    \n-
    \n-
    220 Jacobian jacobian([[maybe_unused]] const LocalCoordinate& local) const
    \n-
    221 {
    \n-
    222 return jacobianTransposed(local).transposed();
    \n-
    223 }
    \n-
    \n-
    224
    \n-
    \n-\n-
    227 {
    \n-
    228 return jacobianInverseTransposed(local).transposed();
    \n-
    229 }
    \n-
    \n-
    230
    \n-
    \n-
    234 Volume integrationElement([[maybe_unused]] const LocalCoordinate& local) const
    \n-
    235 {
    \n-
    236 return volume();
    \n-
    237 }
    \n-
    \n-
    238
    \n-
    \n-\n-
    241 {
    \n-
    242 GlobalCoordinate result;
    \n-
    243 if (dim==0)
    \n-
    244 result = lower_;
    \n-
    245 else {
    \n-
    246 // Since lower_==upper_ for unused coordinates, this always does the right thing
    \n-
    247 for (size_t i=0; i<coorddim; i++)
    \n-
    248 result[i] = CoordType(0.5) * (lower_[i] + upper_[i]);
    \n-
    249 }
    \n-
    250 return result;
    \n-
    251 }
    \n-
    \n-
    252
    \n-
    \n-
    254 int corners() const
    \n-
    255 {
    \n-
    256 return 1<<dim;
    \n-
    257 }
    \n-
    \n-
    258
    \n-
    \n-\n-
    261 {
    \n-
    262 GlobalCoordinate result;
    \n-
    263 if (dim == coorddim) { // fast case
    \n-
    264 for (size_t i=0; i<coorddim; i++)
    \n-
    265 result[i] = (k & (1<<i)) ? upper_[i] : lower_[i];
    \n-
    266 } else if (dim == 0) { // vertex
    \n-
    267 result = lower_; // rely on named return-type optimization
    \n-
    268 } else { // slow case
    \n-
    269 unsigned int mask = 1;
    \n-
    270
    \n-
    271 for (size_t i=0; i<coorddim; i++) {
    \n-
    272 if (not axes_[i])
    \n-
    273 result[i] = lower_[i];
    \n-
    274 else {
    \n-
    275 result[i] = (k & mask) ? upper_[i] : lower_[i];
    \n-
    276 mask = (mask<<1);
    \n-
    277 }
    \n-
    278 }
    \n-
    279 }
    \n-
    280
    \n-
    281
    \n-
    282 return result;
    \n-
    283 }
    \n-
    \n-
    284
    \n-
    \n-\n-
    287 {
    \n-
    288 ctype vol = 1;
    \n-
    289 if (dim == coorddim) { // fast case
    \n-
    290 for (size_t i=0; i<dim; i++)
    \n-
    291 vol *= upper_[i] - lower_[i];
    \n-
    292 // do nothing if dim == 0
    \n-
    293 } else if (dim != 0) { // slow case
    \n-
    294 for (size_t i=0; i<coorddim; i++)
    \n-
    295 if (axes_[i])
    \n-
    296 vol *= upper_[i] - lower_[i];
    \n-
    297 }
    \n-
    298 return vol;
    \n-
    299 }
    \n-
    \n-
    300
    \n-
    \n-
    302 bool affine() const
    \n-
    303 {
    \n-
    304 return true;
    \n-
    305 }
    \n-
    \n-
    306
    \n-
    \n-
    307 friend Dune::Transitional::ReferenceElement< ctype, Dim<dim> > referenceElement ( const AxisAlignedCubeGeometry & /* geometry */ )
    \n-
    308 {
    \n-\n-
    310 }
    \n-
    \n-
    311
    \n-
    312 private:
    \n-
    313 // jacobianTransposed: fast case --> diagonal matrix
    \n-
    314 void jacobianTransposed ( DiagonalMatrix<ctype,dim> &jacobianTransposed ) const
    \n-
    315 {
    \n-
    316 for (size_t i=0; i<dim; i++)
    \n-
    317 jacobianTransposed.diagonal()[i] = upper_[i] - lower_[i];
    \n-
    318 }
    \n-
    319
    \n-
    320 // jacobianTransposed: slow case --> dense matrix
    \n-
    321 void jacobianTransposed ( FieldMatrix<ctype,dim,coorddim> &jacobianTransposed ) const
    \n-
    322 {
    \n-
    323 if (dim==0)
    \n-
    324 return;
    \n-
    325
    \n-
    326 size_t lc = 0;
    \n-
    327 for (size_t i=0; i<coorddim; i++)
    \n-
    328 if (axes_[i])
    \n-
    329 jacobianTransposed[lc++][i] = upper_[i] - lower_[i];
    \n-
    330 }
    \n-
    331
    \n-
    332 // jacobianInverseTransposed: fast case --> diagonal matrix
    \n-
    333 void jacobianInverseTransposed ( DiagonalMatrix<ctype,dim> &jacobianInverseTransposed ) const
    \n-
    334 {
    \n-
    335 for (size_t i=0; i<dim; i++)
    \n-
    336 jacobianInverseTransposed.diagonal()[i] = CoordType(1.0) / (upper_[i] - lower_[i]);
    \n-
    337 }
    \n-
    338
    \n-
    339 // jacobianInverseTransposed: slow case --> dense matrix
    \n-
    340 void jacobianInverseTransposed ( FieldMatrix<ctype,coorddim,dim> &jacobianInverseTransposed ) const
    \n-
    341 {
    \n-
    342 if (dim==0)
    \n-
    343 return;
    \n-
    344
    \n-
    345 size_t lc = 0;
    \n-
    346 for (size_t i=0; i<coorddim; i++)
    \n-
    347 if (axes_[i])
    \n-
    348 jacobianInverseTransposed[i][lc++] = CoordType(1.0) / (upper_[i] - lower_[i]);
    \n-
    349 }
    \n-
    350
    \n-
    351 Dune::FieldVector<ctype,coorddim> lower_;
    \n-
    352
    \n-
    353 Dune::FieldVector<ctype,coorddim> upper_;
    \n-
    354
    \n-
    355 std::bitset<coorddim> axes_;
    \n-
    356 };
    \n-
    \n-
    357
    \n-
    358} // namespace Dune
    \n-
    359#endif
    \n-\n+
    146 // Map a dynamic GeometryType to a static integral_constant<GeometryType::Id, ...>
    \n+
    147 template<int dim, class F>
    \n+
    148 static auto toGeometryTypeIdConstant(const GeometryType& gt, F&& f) {
    \n+
    149 // Transform LocalGeometryTypeIndex to GeometryType::Id
    \n+
    150 auto callWithId = [&](auto index) {
    \n+
    151 static constexpr auto id = LocalGeometryTypeIndex::type(dim, decltype(index)::value).toId();
    \n+
    152 return f(std::integral_constant<GeometryType::Id, id>{});
    \n+
    153 };
    \n+
    154 // switchCases needs a fallback to determine the return type.
    \n+
    155 auto fallBack = [&]() { return callWithId(Dune::Indices::_0); };
    \n+
    156 // Iterate over all _regular_ GeometryType indices for given dimension
    \n+
    157 auto allIndices = std::make_index_sequence<LocalGeometryTypeIndex::size(dim)-1>{};
    \n+
    158 return Dune::Hybrid::switchCases(allIndices, LocalGeometryTypeIndex::index(gt), callWithId, fallBack);
    \n+
    159 }
    \n+
    160
    \n+
    161 } // namespace Impl
    \n+
    162} // namespace Dune
    \n+
    163
    \n+
    164#endif // DUNE_GEOMETRY_TYPEINDEX_HH
    \n
    A unique label for each type of element that can occur in a grid.
    \n
    Definition affinegeometry.hh:21
    \n-
    static const ReferenceElement & cube()
    get hypercube reference elements
    Definition referenceelements.hh:210
    \n-
    A geometry implementation for axis-aligned hypercubes.
    Definition axisalignedcubegeometry.hh:50
    \n-
    Volume volume() const
    Return the element volume.
    Definition axisalignedcubegeometry.hh:286
    \n-
    AxisAlignedCubeGeometry(const Dune::FieldVector< ctype, coorddim > lower, const Dune::FieldVector< ctype, coorddim > upper, const std::bitset< coorddim > &axes)
    Constructor from a lower left and an upper right corner.
    Definition axisalignedcubegeometry.hh:133
    \n-
    AxisAlignedCubeGeometry(const Dune::FieldVector< ctype, coorddim > lower, const Dune::FieldVector< ctype, coorddim > upper)
    Constructor from a lower left and an upper right corner.
    Definition axisalignedcubegeometry.hh:115
    \n-
    JacobianInverse jacobianInverse(const LocalCoordinate &local) const
    Inverse Jacobian of the transformation from local to global coordinates.
    Definition axisalignedcubegeometry.hh:226
    \n-
    JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate &local) const
    Inverse Jacobian transposed of the transformation from local to global coordinates.
    Definition axisalignedcubegeometry.hh:208
    \n-
    std::conditional< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< ctype, dim, coorddim > >::type JacobianTransposed
    Return type of jacobianTransposed.
    Definition axisalignedcubegeometry.hh:81
    \n-
    AxisAlignedCubeGeometry(const Dune::FieldVector< ctype, coorddim > lower)
    Constructor from a single point only.
    Definition axisalignedcubegeometry.hh:150
    \n-
    static constexpr int mydimension
    Dimension of the cube element.
    Definition axisalignedcubegeometry.hh:56
    \n-
    static constexpr int coorddimension
    Dimension of the world space that the cube element is embedded in.
    Definition axisalignedcubegeometry.hh:59
    \n-
    GlobalCoordinate corner(int k) const
    Return world coordinates of the k-th corner of the element.
    Definition axisalignedcubegeometry.hh:260
    \n-
    ctype Volume
    Type used for volume.
    Definition axisalignedcubegeometry.hh:71
    \n-
    FieldVector< ctype, dim > LocalCoordinate
    Type used for a vector of element coordinates.
    Definition axisalignedcubegeometry.hh:65
    \n-
    friend Dune::Transitional::ReferenceElement< ctype, Dim< dim > > referenceElement(const AxisAlignedCubeGeometry &)
    Definition axisalignedcubegeometry.hh:307
    \n-
    JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const
    Jacobian transposed of the transformation from local to global coordinates.
    Definition axisalignedcubegeometry.hh:196
    \n-
    FieldVector< ctype, coorddim > GlobalCoordinate
    Type used for a vector of world coordinates.
    Definition axisalignedcubegeometry.hh:68
    \n-
    LocalCoordinate local(const GlobalCoordinate &global) const
    Map a point in global (world) coordinates to element coordinates.
    Definition axisalignedcubegeometry.hh:180
    \n-
    CoordType ctype
    Type used for single coordinate coefficients.
    Definition axisalignedcubegeometry.hh:62
    \n-
    std::conditional_t< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< ctype, coorddim, dim > > Jacobian
    Return type of jacobian.
    Definition axisalignedcubegeometry.hh:100
    \n-
    GeometryType type() const
    Type of the cube. Here: a hypercube of the correct dimension.
    Definition axisalignedcubegeometry.hh:155
    \n-
    int corners() const
    Return the number of corners of the element.
    Definition axisalignedcubegeometry.hh:254
    \n-
    Jacobian jacobian(const LocalCoordinate &local) const
    Jacobian of the transformation from local to global coordinates.
    Definition axisalignedcubegeometry.hh:220
    \n-
    std::conditional< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< ctype, coorddim, dim > >::type JacobianInverseTransposed
    Return type of jacobianInverseTransposed.
    Definition axisalignedcubegeometry.hh:91
    \n-
    Volume integrationElement(const LocalCoordinate &local) const
    Return the integration element, i.e., the determinant term in the integral transformation formula.
    Definition axisalignedcubegeometry.hh:234
    \n-
    GlobalCoordinate center() const
    Return center of mass of the element.
    Definition axisalignedcubegeometry.hh:240
    \n-
    bool affine() const
    Return if the element is affine. Here: yes.
    Definition axisalignedcubegeometry.hh:302
    \n-
    std::conditional_t< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< ctype, dim, coorddim > > JacobianInverse
    Return type of jacobianInverse.
    Definition axisalignedcubegeometry.hh:109
    \n-
    GlobalCoordinate global(const LocalCoordinate &local) const
    Map a point in local (element) coordinates to world coordinates.
    Definition axisalignedcubegeometry.hh:161
    \n
    Unique label for each type of entities that can occur in DUNE grids.
    Definition type.hh:126
    \n+
    constexpr Id toId() const
    Create an Id representation of this GeometryType.
    Definition type.hh:222
    \n+
    constexpr unsigned int dim() const
    Return dimension of the type.
    Definition type.hh:372
    \n+
    constexpr unsigned int id() const
    Return the topology id of the type.
    Definition type.hh:377
    \n+
    constexpr bool isNone() const
    Return true if entity is a singular of any dimension.
    Definition type.hh:367
    \n+
    Compute per-dimension indices for geometry types.
    Definition typeindex.hh:25
    \n+
    static constexpr std::size_t size(std::size_t dim)
    Compute total number of geometry types for the given dimension.
    Definition typeindex.hh:61
    \n+
    static constexpr GeometryType type(std::size_t dim, std::size_t index)
    compute the geometry type for the given local index and dimension
    Definition typeindex.hh:79
    \n+
    static constexpr std::size_t index(const GeometryType &gt)
    Compute the index for the given geometry type within its dimension.
    Definition typeindex.hh:73
    \n+
    Compute indices for geometry types, taking the dimension into account.
    Definition typeindex.hh:90
    \n+
    static constexpr std::size_t index(const GeometryType &gt)
    Compute the index for the given geometry type over all dimensions.
    Definition typeindex.hh:138
    \n+
    static constexpr std::size_t offset(std::size_t dim)
    Compute the starting index for a given dimension including irregular geometry types.
    Definition typeindex.hh:113
    \n+
    static constexpr std::size_t size(std::size_t maxdim)
    Compute total number of geometry types up to and including the given dimension.
    Definition typeindex.hh:125
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,431 +7,185 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n-axisalignedcubegeometry.hh\n+typeindex.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file\n LICENSE.md in module root\n 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n- 5\n- 6#ifndef DUNE_GEOMETRY_AXISALIGNED_CUBE_GEOMETRY_HH\n- 7#define DUNE_GEOMETRY_AXISALIGNED_CUBE_GEOMETRY_HH\n- 8\n- 13#include \n- 14\n- 15#include \n- 16#include \n- 17#include \n+ 5#ifndef DUNE_GEOMETRY_TYPEINDEX_HH\n+ 6#define DUNE_GEOMETRY_TYPEINDEX_HH\n+ 7\n+ 14#include \n+ 15\n+ 16#include \n+ 17#include \n 18\n- 19#include \n- 20#include \n- 21\n- 22\n- 23namespace Dune {\n- 24\n- 48 template \n-49 class AxisAlignedCubeGeometry\n- 50 {\n- 51\n- 52\n- 53 public:\n+ 19#include \"type.hh\"\n+ 20\n+ 21namespace Dune\n+ 22{\n+24 class LocalGeometryTypeIndex\n+ 25 {\n+ 32 inline static constexpr std::size_t regular_size(std::size_t dim)\n+ 33 {\n+ 34 // The following expression is derived from the expression for\n+ 35 // GlobalGeometryTypeIndex::regular_offset(). Subtracting\n+ 36 // regular_offset(dim+1)-regular_offset(dim) we get:\n+ 37 //\n+ 38 // ((1 << dim+1) >> 1) - ((1 << dim) >> 1)\n+ 39 //\n+ 40 // We always have\n+ 41 //\n+ 42 // dim >= 0,\n+ 43 //\n+ 44 // so\n+ 45 //\n+ 46 // (1 << dim+1) >= 2 and (1 << dim+2) % 2 == 0.\n+ 47 //\n+ 48 // So if we apply a single right-shift to that, we will never lose any\n+ 49 // set bits, thus\n+ 50 //\n+ 51 // ((1 << dim+1) >> 1) == (1 << dim)\n+ 52 return (1 << dim) - ((1 << dim) >> 1);\n+ 53 }\n 54\n-56 constexpr static int mydimension = dim;\n- 57\n-59 constexpr static int coorddimension = coorddim;\n- 60\n-62 typedef CoordType ctype;\n- 63\n-65 typedef FieldVector LocalCoordinate;\n+ 55 public:\n+61 inline static constexpr std::size_t size(std::size_t dim)\n+ 62 {\n+ 63 // one for \"none\"\n+ 64 return regular_size(dim) + 1;\n+ 65 }\n 66\n-68 typedef FieldVector GlobalCoordinate;\n- 69\n-71 typedef ctype Volume;\n- 72\n- 79 typedef typename std::conditional,\n-81 FieldMatrix >::type JacobianTransposed;\n- 82\n- 89 typedef typename std::conditional,\n-91 FieldMatrix >::type JacobianInverseTransposed;\n- 92\n-100 using Jacobian = std::conditional_t, FieldMatrix >;\n- 101\n-109 using JacobianInverse = std::conditional_t, FieldMatrix >;\n- 110\n-115 AxisAlignedCubeGeometry(const Dune::FieldVector lower,\n- 116 const Dune::FieldVector upper)\n- 117 : lower_(lower),\n- 118 upper_(upper),\n- 119 axes_()\n- 120 {\n- 121 static_assert(dim==coorddim, \"Use this constructor only if\n-dim==coorddim!\");\n- 122 // all 'true', but is never actually used\n- 123 axes_ = (1< lower,\n- 134 const Dune::FieldVector upper,\n- 135 const std::bitset& axes)\n- 136 : lower_(lower),\n- 137 upper_(upper),\n- 138 axes_(axes)\n+73 inline static constexpr std::size_t index(const GeometryType >)\n+ 74 {\n+ 75 return gt.isNone() ? regular_size(gt.dim()) : (gt.id() >> 1);\n+ 76 }\n+ 77\n+79 inline static constexpr GeometryType type(std::size_t dim, std::size_t\n+index) {\n+ 80 return (index == regular_size(dim)) ?\n+ 81 GeometryTypes::none(dim) :\n+ 82 // the cast to unsigned makes sure this is interpreted as the topology\n+ 83 // ID constructor\n+ 84 GeometryType(static_cast< unsigned int >(index << 1), dim);\n+ 85 }\n+ 86 };\n+ 87\n+89 class GlobalGeometryTypeIndex\n+ 90 {\n+ 98 inline static constexpr std::size_t regular_offset(std::size_t dim)\n+ 99 {\n+ 100 // The number of regular geometry types in a given dimension is\n+ 101 // 2^(dim-1). For dim==0 this would yield 1/2 geometry types (which is\n+ 102 // obviously bogus, dim==0 has one regular geometry type, the point).\n+ 103 // The following expression relies on 1 >> 1 == 0 to treat dim==0\n+ 104 // specially.\n+ 105 return (1 << dim) >> 1;\n+ 106 }\n+ 107\n+ 108 public:\n+113 inline static constexpr std::size_t offset(std::size_t dim)\n+ 114 {\n+ 115 // dim times \"none\"\n+ 116 return regular_offset(dim) + dim;\n+ 117 }\n+ 118\n+125 inline static constexpr std::size_t size(std::size_t maxdim)\n+ 126 {\n+ 127 return offset(maxdim+1);\n+ 128 }\n+ 129\n+138 inline static constexpr std::size_t index(const GeometryType >)\n 139 {\n- 140 assert(axes.count()==dim);\n- 141 for (size_t i=0; i lower)\n- 151 : lower_(lower)\n- 152 {}\n- 153\n-155 GeometryType type() const\n- 156 {\n- 157 return GeometryTypes::cube(dim);\n- 158 }\n- 159\n-161 GlobalCoordinate global(const LocalCoordinate& local) const\n- 162 {\n- 163 GlobalCoordinate result;\n- 164 if (dim == coorddim) { // fast case\n- 165 for (size_t i=0; i >\n-referenceElement ( const AxisAlignedCubeGeometry & /* geometry */ )\n- 308 {\n- 309 return ReferenceElements<_ctype,_dim_>::cube();\n- 310 }\n- 311\n- 312 private:\n- 313 // jacobianTransposed: fast case --> diagonal matrix\n- 314 void jacobianTransposed ( DiagonalMatrix &jacobianTransposed )\n-const\n- 315 {\n- 316 for (size_t i=0; i dense matrix\n- 321 void jacobianTransposed ( FieldMatrix\n-&jacobianTransposed ) const\n- 322 {\n- 323 if (dim==0)\n- 324 return;\n- 325\n- 326 size_t lc = 0;\n- 327 for (size_t i=0; i diagonal matrix\n- 333 void jacobianInverseTransposed ( DiagonalMatrix\n-&jacobianInverseTransposed ) const\n- 334 {\n- 335 for (size_t i=0; i dense matrix\n- 340 void jacobianInverseTransposed ( FieldMatrix\n-&jacobianInverseTransposed ) const\n- 341 {\n- 342 if (dim==0)\n- 343 return;\n- 344\n- 345 size_t lc = 0;\n- 346 for (size_t i=0; i lower_;\n- 352\n- 353 Dune::FieldVector upper_;\n- 354\n- 355 std::bitset axes_;\n- 356 };\n- 357\n- 358} // namespace Dune\n- 359#endif\n-referenceelements.hh\n+ 146 // Map a dynamic GeometryType to a static integral_constant\n+ 147 template\n+ 148 static auto toGeometryTypeIdConstant(const GeometryType& gt, F&& f) {\n+ 149 // Transform LocalGeometryTypeIndex to GeometryType::Id\n+ 150 auto callWithId = [&](auto index) {\n+ 151 static constexpr auto id = LocalGeometryTypeIndex::type(dim, decltype\n+(index)::value).toId();\n+ 152 return f(std::integral_constant{});\n+ 153 };\n+ 154 // switchCases needs a fallback to determine the return type.\n+ 155 auto fallBack = [&]() { return callWithId(Dune::Indices::_0); };\n+ 156 // Iterate over all _regular_ GeometryType indices for given dimension\n+ 157 auto allIndices = std::make_index_sequence{};\n+ 158 return Dune::Hybrid::switchCases(allIndices, LocalGeometryTypeIndex::index\n+(gt), callWithId, fallBack);\n+ 159 }\n+ 160\n+ 161 } // namespace Impl\n+ 162} // namespace Dune\n+ 163\n+ 164#endif // DUNE_GEOMETRY_TYPEINDEX_HH\n type.hh\n A unique label for each type of element that can occur in a grid.\n Dune\n Definition affinegeometry.hh:21\n-Dune::Geo::ReferenceElements::cube\n-static const ReferenceElement & cube()\n-get hypercube reference elements\n-Definition referenceelements.hh:210\n-Dune::AxisAlignedCubeGeometry\n-A geometry implementation for axis-aligned hypercubes.\n-Definition axisalignedcubegeometry.hh:50\n-Dune::AxisAlignedCubeGeometry::volume\n-Volume volume() const\n-Return the element volume.\n-Definition axisalignedcubegeometry.hh:286\n-Dune::AxisAlignedCubeGeometry::AxisAlignedCubeGeometry\n-AxisAlignedCubeGeometry(const Dune::FieldVector< ctype, coorddim > lower, const\n-Dune::FieldVector< ctype, coorddim > upper, const std::bitset< coorddim >\n-&axes)\n-Constructor from a lower left and an upper right corner.\n-Definition axisalignedcubegeometry.hh:133\n-Dune::AxisAlignedCubeGeometry::AxisAlignedCubeGeometry\n-AxisAlignedCubeGeometry(const Dune::FieldVector< ctype, coorddim > lower, const\n-Dune::FieldVector< ctype, coorddim > upper)\n-Constructor from a lower left and an upper right corner.\n-Definition axisalignedcubegeometry.hh:115\n-Dune::AxisAlignedCubeGeometry::jacobianInverse\n-JacobianInverse jacobianInverse(const LocalCoordinate &local) const\n-Inverse Jacobian of the transformation from local to global coordinates.\n-Definition axisalignedcubegeometry.hh:226\n-Dune::AxisAlignedCubeGeometry::jacobianInverseTransposed\n-JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate\n-&local) const\n-Inverse Jacobian transposed of the transformation from local to global\n-coordinates.\n-Definition axisalignedcubegeometry.hh:208\n-Dune::AxisAlignedCubeGeometry::JacobianTransposed\n-std::conditional< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix<\n-ctype, dim, coorddim > >::type JacobianTransposed\n-Return type of jacobianTransposed.\n-Definition axisalignedcubegeometry.hh:81\n-Dune::AxisAlignedCubeGeometry::AxisAlignedCubeGeometry\n-AxisAlignedCubeGeometry(const Dune::FieldVector< ctype, coorddim > lower)\n-Constructor from a single point only.\n-Definition axisalignedcubegeometry.hh:150\n-Dune::AxisAlignedCubeGeometry::mydimension\n-static constexpr int mydimension\n-Dimension of the cube element.\n-Definition axisalignedcubegeometry.hh:56\n-Dune::AxisAlignedCubeGeometry::coorddimension\n-static constexpr int coorddimension\n-Dimension of the world space that the cube element is embedded in.\n-Definition axisalignedcubegeometry.hh:59\n-Dune::AxisAlignedCubeGeometry::corner\n-GlobalCoordinate corner(int k) const\n-Return world coordinates of the k-th corner of the element.\n-Definition axisalignedcubegeometry.hh:260\n-Dune::AxisAlignedCubeGeometry::Volume\n-ctype Volume\n-Type used for volume.\n-Definition axisalignedcubegeometry.hh:71\n-Dune::AxisAlignedCubeGeometry::LocalCoordinate\n-FieldVector< ctype, dim > LocalCoordinate\n-Type used for a vector of element coordinates.\n-Definition axisalignedcubegeometry.hh:65\n-Dune::AxisAlignedCubeGeometry::referenceElement\n-friend Dune::Transitional::ReferenceElement< ctype, Dim< dim > >\n-referenceElement(const AxisAlignedCubeGeometry &)\n-Definition axisalignedcubegeometry.hh:307\n-Dune::AxisAlignedCubeGeometry::jacobianTransposed\n-JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const\n-Jacobian transposed of the transformation from local to global coordinates.\n-Definition axisalignedcubegeometry.hh:196\n-Dune::AxisAlignedCubeGeometry::GlobalCoordinate\n-FieldVector< ctype, coorddim > GlobalCoordinate\n-Type used for a vector of world coordinates.\n-Definition axisalignedcubegeometry.hh:68\n-Dune::AxisAlignedCubeGeometry::local\n-LocalCoordinate local(const GlobalCoordinate &global) const\n-Map a point in global (world) coordinates to element coordinates.\n-Definition axisalignedcubegeometry.hh:180\n-Dune::AxisAlignedCubeGeometry::ctype\n-CoordType ctype\n-Type used for single coordinate coefficients.\n-Definition axisalignedcubegeometry.hh:62\n-Dune::AxisAlignedCubeGeometry::Jacobian\n-std::conditional_t< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix<\n-ctype, coorddim, dim > > Jacobian\n-Return type of jacobian.\n-Definition axisalignedcubegeometry.hh:100\n-Dune::AxisAlignedCubeGeometry::type\n-GeometryType type() const\n-Type of the cube. Here: a hypercube of the correct dimension.\n-Definition axisalignedcubegeometry.hh:155\n-Dune::AxisAlignedCubeGeometry::corners\n-int corners() const\n-Return the number of corners of the element.\n-Definition axisalignedcubegeometry.hh:254\n-Dune::AxisAlignedCubeGeometry::jacobian\n-Jacobian jacobian(const LocalCoordinate &local) const\n-Jacobian of the transformation from local to global coordinates.\n-Definition axisalignedcubegeometry.hh:220\n-Dune::AxisAlignedCubeGeometry::JacobianInverseTransposed\n-std::conditional< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix<\n-ctype, coorddim, dim > >::type JacobianInverseTransposed\n-Return type of jacobianInverseTransposed.\n-Definition axisalignedcubegeometry.hh:91\n-Dune::AxisAlignedCubeGeometry::integrationElement\n-Volume integrationElement(const LocalCoordinate &local) const\n-Return the integration element, i.e., the determinant term in the integral\n-transformation formula.\n-Definition axisalignedcubegeometry.hh:234\n-Dune::AxisAlignedCubeGeometry::center\n-GlobalCoordinate center() const\n-Return center of mass of the element.\n-Definition axisalignedcubegeometry.hh:240\n-Dune::AxisAlignedCubeGeometry::affine\n-bool affine() const\n-Return if the element is affine. Here: yes.\n-Definition axisalignedcubegeometry.hh:302\n-Dune::AxisAlignedCubeGeometry::JacobianInverse\n-std::conditional_t< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix<\n-ctype, dim, coorddim > > JacobianInverse\n-Return type of jacobianInverse.\n-Definition axisalignedcubegeometry.hh:109\n-Dune::AxisAlignedCubeGeometry::global\n-GlobalCoordinate global(const LocalCoordinate &local) const\n-Map a point in local (element) coordinates to world coordinates.\n-Definition axisalignedcubegeometry.hh:161\n Dune::GeometryType\n Unique label for each type of entities that can occur in DUNE grids.\n Definition type.hh:126\n+Dune::GeometryType::toId\n+constexpr Id toId() const\n+Create an Id representation of this GeometryType.\n+Definition type.hh:222\n+Dune::GeometryType::dim\n+constexpr unsigned int dim() const\n+Return dimension of the type.\n+Definition type.hh:372\n+Dune::GeometryType::id\n+constexpr unsigned int id() const\n+Return the topology id of the type.\n+Definition type.hh:377\n+Dune::GeometryType::isNone\n+constexpr bool isNone() const\n+Return true if entity is a singular of any dimension.\n+Definition type.hh:367\n+Dune::LocalGeometryTypeIndex\n+Compute per-dimension indices for geometry types.\n+Definition typeindex.hh:25\n+Dune::LocalGeometryTypeIndex::size\n+static constexpr std::size_t size(std::size_t dim)\n+Compute total number of geometry types for the given dimension.\n+Definition typeindex.hh:61\n+Dune::LocalGeometryTypeIndex::type\n+static constexpr GeometryType type(std::size_t dim, std::size_t index)\n+compute the geometry type for the given local index and dimension\n+Definition typeindex.hh:79\n+Dune::LocalGeometryTypeIndex::index\n+static constexpr std::size_t index(const GeometryType >)\n+Compute the index for the given geometry type within its dimension.\n+Definition typeindex.hh:73\n+Dune::GlobalGeometryTypeIndex\n+Compute indices for geometry types, taking the dimension into account.\n+Definition typeindex.hh:90\n+Dune::GlobalGeometryTypeIndex::index\n+static constexpr std::size_t index(const GeometryType >)\n+Compute the index for the given geometry type over all dimensions.\n+Definition typeindex.hh:138\n+Dune::GlobalGeometryTypeIndex::offset\n+static constexpr std::size_t offset(std::size_t dim)\n+Compute the starting index for a given dimension including irregular geometry\n+types.\n+Definition typeindex.hh:113\n+Dune::GlobalGeometryTypeIndex::size\n+static constexpr std::size_t size(std::size_t maxdim)\n+Compute total number of geometry types up to and including the given dimension.\n+Definition typeindex.hh:125\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00203.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00203.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: affinegeometry.hh File Reference\n+dune-geometry: referenceelements.hh File Reference\n \n \n \n \n \n \n \n@@ -71,44 +71,74 @@\n \n
    \n \n
    \n \n-
    affinegeometry.hh File Reference
    \n+Namespaces |\n+Typedefs |\n+Functions
    \n+
    referenceelements.hh File Reference
    \n \n
    \n-\n-

    An implementation of the Geometry interface for affine geometries. \n-More...

    \n-
    #include <cmath>
    \n-#include <dune/common/fmatrix.hh>
    \n-#include <dune/common/fvector.hh>
    \n+
    #include <cassert>
    \n+#include <algorithm>
    \n+#include <limits>
    \n+#include <tuple>
    \n+#include <utility>
    \n+#include <vector>
    \n+#include <array>
    \n+#include <dune/common/typetraits.hh>
    \n+#include <dune/common/std/type_traits.hh>
    \n+#include <dune/common/visibility.hh>
    \n+#include <dune/geometry/dimension.hh>
    \n #include <dune/geometry/type.hh>
    \n+#include <dune/geometry/referenceelement.hh>
    \n+#include <dune/geometry/referenceelementimplementation.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

    class  Dune::AffineGeometry< ct, mydim, cdim >
     Implementation of the Geometry interface for affine geometries. More...
    struct  Dune::Geo::ReferenceElements< ctype_, dim >
     Class providing access to the singletons of the reference elements. More...
     
    \n \n \n \n \n \n+\n+\n+

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Geo
     
    namespace  Dune::Transitional
     
    \n+\n+\n+\n+\n+\n+

    \n+Typedefs

    template<typename T , int dim>
    using Dune::ReferenceElement = unspecified-type
     Returns the type of reference element for the argument type T.
     
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n

    \n+Functions

    template<typename... T>
    unspecified value type Dune::referenceElement (T &&... t)
     Returns a reference element for the objects t....
     
    template<typename T , int dim>
    auto Dune::referenceElement (const Dune::GeometryType &gt, Dune::Dim< dim >={})
     Returns a reference element of dimension dim for the given geometry type and coordinate field type.
     
    template<typename T , int dim, std::enable_if_t< IsNumber< std::decay_t< T > >::value, int > = 0>
    auto Dune::referenceElement (const T &, const Dune::GeometryType &gt, Dune::Dim< dim >)
     Returns a reference element of dimension dim for the given geometry type and coordinate field type.
     
    \n-

    Detailed Description

    \n-

    An implementation of the Geometry interface for affine geometries.

    \n-
    Author
    Martin Nolte
    \n-
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,31 +6,62 @@\n dune-geometry\u00a02.9.0\n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n-Classes | Namespaces\n-affinegeometry.hh File Reference\n-An implementation of the Geometry interface for affine geometries. More...\n-#include \n-#include \n-#include \n+Classes | Namespaces | Typedefs | Functions\n+referenceelements.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::AffineGeometry<_ct,_mydim,_cdim_>\n-\u00a0 Implementation of the Geometry interface for affine geometries. More...\n+struct \u00a0Dune::Geo::ReferenceElements<_ctype_,_dim_>\n+\u00a0 Class providing access to the singletons of the reference elements.\n+ More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::Geo\n \u00a0\n-***** Detailed Description *****\n-An implementation of the Geometry interface for affine geometries.\n- Author\n- Martin Nolte\n+namespace \u00a0Dune::Transitional\n+\u00a0\n+ Typedefs\n+template\n+using\u00a0Dune::ReferenceElement = unspecified-type\n+\u00a0 Returns the type of reference element for the argument type T.\n+\u00a0\n+ Functions\n+template\n+unspecified value type\u00a0Dune::referenceElement (T &&... t)\n+\u00a0 Returns a reference element for the objects t....\n+\u00a0\n+template\n+ auto\u00a0Dune::referenceElement (const Dune::GeometryType >,\n+ Dune::Dim< dim >={})\n+\u00a0 Returns a reference element of dimension dim for the\n+ given geometry type and coordinate field type.\n+\u00a0\n+template\n+>::value, int > = 0>\n+ auto\u00a0Dune::referenceElement (const T &, const Dune::\n+ GeometryType >, Dune::Dim< dim >)\n+\u00a0 Returns a reference element of dimension dim for the\n+ given geometry type and coordinate field type.\n+\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00203_source.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00203_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: affinegeometry.hh Source File\n+dune-geometry: referenceelements.hh Source File\n \n \n \n \n \n \n \n@@ -74,689 +74,421 @@\n \n
    \n \n
    \n \n
    \n-
    affinegeometry.hh
    \n+
    referenceelements.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
    \n
    4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n-
    5#ifndef DUNE_GEOMETRY_AFFINEGEOMETRY_HH
    \n-
    6#define DUNE_GEOMETRY_AFFINEGEOMETRY_HH
    \n+
    5#ifndef DUNE_GEOMETRY_REFERENCEELEMENTS_HH
    \n+
    6#define DUNE_GEOMETRY_REFERENCEELEMENTS_HH
    \n
    7
    \n-
    13#include <cmath>
    \n-
    14
    \n-
    15#include <dune/common/fmatrix.hh>
    \n-
    16#include <dune/common/fvector.hh>
    \n-
    17
    \n-
    18#include <dune/geometry/type.hh>
    \n-
    19
    \n-
    \n-
    20namespace Dune
    \n-
    21{
    \n-
    22
    \n-
    23 // External Forward Declarations
    \n-
    24 // -----------------------------
    \n+
    8#include <cassert>
    \n+
    9
    \n+
    10#include <algorithm>
    \n+
    11#include <limits>
    \n+
    12#include <tuple>
    \n+
    13#include <utility>
    \n+
    14#include <vector>
    \n+
    15#include <array>
    \n+
    16
    \n+
    17#include <dune/common/typetraits.hh>
    \n+
    18#include <dune/common/std/type_traits.hh>
    \n+
    19#include <dune/common/visibility.hh>
    \n+
    20
    \n+\n+
    22#include <dune/geometry/type.hh>
    \n+\n+\n
    25
    \n-
    \n-
    26 namespace Geo
    \n-
    27 {
    \n+
    26namespace Dune
    \n+
    27{
    \n
    28
    \n-
    29 template< typename Implementation >
    \n-
    30 class ReferenceElement;
    \n+
    29 namespace Geo
    \n+
    30 {
    \n
    31
    \n-
    32 template< class ctype, int dim >
    \n-\n+
    32#ifndef DOXYGEN
    \n+
    33
    \n
    34
    \n-
    35 template< class ctype, int dim >
    \n-
    36 struct ReferenceElements;
    \n-
    37
    \n-
    38 }
    \n-
    \n+
    35 template<typename ctype, int dim>
    \n+
    36 class DeprecatedReferenceElement
    \n+
    37 : public ReferenceElement<ReferenceElementImplementation<ctype,dim>>
    \n+
    38 {
    \n
    39
    \n-
    40
    \n-
    41 namespace Impl
    \n-
    42 {
    \n+
    40 protected:
    \n+
    41
    \n+
    42 DeprecatedReferenceElement() = default;
    \n
    43
    \n-
    44 // FieldMatrixHelper
    \n-
    45 // -----------------
    \n-
    46
    \n-
    47 template< class ct >
    \n-
    48 struct FieldMatrixHelper
    \n-
    49 {
    \n-
    50 typedef ct ctype;
    \n-
    51
    \n-
    52 template< int m, int n >
    \n-
    53 static void Ax ( const FieldMatrix< ctype, m, n > &A, const FieldVector< ctype, n > &x, FieldVector< ctype, m > &ret )
    \n-
    54 {
    \n-
    55 for( int i = 0; i < m; ++i )
    \n-
    56 {
    \n-
    57 ret[ i ] = ctype( 0 );
    \n-
    58 for( int j = 0; j < n; ++j )
    \n-
    59 ret[ i ] += A[ i ][ j ] * x[ j ];
    \n-
    60 }
    \n-
    61 }
    \n-
    62
    \n-
    63 template< int m, int n >
    \n-
    64 static void ATx ( const FieldMatrix< ctype, m, n > &A, const FieldVector< ctype, m > &x, FieldVector< ctype, n > &ret )
    \n-
    65 {
    \n-
    66 for( int i = 0; i < n; ++i )
    \n-
    67 {
    \n-
    68 ret[ i ] = ctype( 0 );
    \n-
    69 for( int j = 0; j < m; ++j )
    \n-
    70 ret[ i ] += A[ j ][ i ] * x[ j ];
    \n-
    71 }
    \n-
    72 }
    \n-
    73
    \n-
    74 template< int m, int n, int p >
    \n-
    75 static void AB ( const FieldMatrix< ctype, m, n > &A, const FieldMatrix< ctype, n, p > &B, FieldMatrix< ctype, m, p > &ret )
    \n-
    76 {
    \n-
    77 for( int i = 0; i < m; ++i )
    \n-
    78 {
    \n-
    79 for( int j = 0; j < p; ++j )
    \n-
    80 {
    \n-
    81 ret[ i ][ j ] = ctype( 0 );
    \n-
    82 for( int k = 0; k < n; ++k )
    \n-
    83 ret[ i ][ j ] += A[ i ][ k ] * B[ k ][ j ];
    \n-
    84 }
    \n-
    85 }
    \n-
    86 }
    \n-
    87
    \n-
    88 template< int m, int n, int p >
    \n-
    89 static void ATBT ( const FieldMatrix< ctype, m, n > &A, const FieldMatrix< ctype, p, m > &B, FieldMatrix< ctype, n, p > &ret )
    \n-
    90 {
    \n-
    91 for( int i = 0; i < n; ++i )
    \n-
    92 {
    \n-
    93 for( int j = 0; j < p; ++j )
    \n-
    94 {
    \n-
    95 ret[ i ][ j ] = ctype( 0 );
    \n-
    96 for( int k = 0; k < m; ++k )
    \n-
    97 ret[ i ][ j ] += A[ k ][ i ] * B[ j ][ k ];
    \n-
    98 }
    \n-
    99 }
    \n-
    100 }
    \n+
    44 public:
    \n+
    45
    \n+
    46 DeprecatedReferenceElement(const DeprecatedReferenceElement&) = delete;
    \n+
    47 DeprecatedReferenceElement& operator=(const DeprecatedReferenceElement&) = delete;
    \n+
    48
    \n+
    49 DeprecatedReferenceElement(const ReferenceElementImplementation<ctype,dim>& impl)
    \n+
    50 : ReferenceElement<ReferenceElementImplementation<ctype,dim>>(impl)
    \n+
    51 {}
    \n+
    52
    \n+
    53 };
    \n+
    54
    \n+
    55
    \n+
    56 template<typename ctype, int dim>
    \n+
    57 class ConstructibleDeprecatedReferenceElement
    \n+
    58 : public DeprecatedReferenceElement<ctype,dim>
    \n+
    59 {
    \n+
    60 public:
    \n+
    61 ConstructibleDeprecatedReferenceElement() = default;
    \n+
    62 };
    \n+
    63
    \n+
    64
    \n+
    65 namespace Impl
    \n+
    66 {
    \n+
    67
    \n+
    68 // ReferenceElementContainer
    \n+
    69 // -------------------------
    \n+
    70
    \n+
    71 template< class ctype, int dim >
    \n+
    72 class ReferenceElementContainer
    \n+
    73 {
    \n+
    74 static const unsigned int numTopologies = dim >= 0 ? (1u << dim) : 0;
    \n+
    75
    \n+
    76 using Implementation = ReferenceElementImplementation< ctype, dim >;
    \n+
    77 using ConstructibleDeprecatedReferenceElement = Dune::Geo::ConstructibleDeprecatedReferenceElement<ctype,dim>;
    \n+
    78
    \n+
    79 public:
    \n+
    80
    \n+
    81 using DeprecatedReferenceElement = Dune::Geo::DeprecatedReferenceElement<ctype,dim>;
    \n+
    82
    \n+
    83 using ReferenceElement = Dune::Geo::ReferenceElement< Implementation >;
    \n+
    84 using value_type = ReferenceElement;
    \n+
    85 using const_iterator = const value_type*;
    \n+
    86
    \n+
    87 ReferenceElementContainer ()
    \n+
    88 {
    \n+
    89 for( unsigned int topologyId = 0; topologyId < numTopologies; ++topologyId )
    \n+
    90 {
    \n+
    91 implementations_[ topologyId ].initialize( topologyId );
    \n+
    92 reference_elements_[ topologyId ].setImplementation( implementations_[ topologyId ] );
    \n+
    93 }
    \n+
    94 }
    \n+
    95
    \n+
    96 const ReferenceElement& operator() ( const GeometryType &type ) const
    \n+
    97 {
    \n+
    98 assert( type.dim() == dim );
    \n+
    99 return reference_elements_[ type.id() ];
    \n+
    100 }
    \n
    101
    \n-
    102 template< int m, int n >
    \n-
    103 static void ATA_L ( const FieldMatrix< ctype, m, n > &A, FieldMatrix< ctype, n, n > &ret )
    \n-
    104 {
    \n-
    105 for( int i = 0; i < n; ++i )
    \n-
    106 {
    \n-
    107 for( int j = 0; j <= i; ++j )
    \n-
    108 {
    \n-
    109 ret[ i ][ j ] = ctype( 0 );
    \n-
    110 for( int k = 0; k < m; ++k )
    \n-
    111 ret[ i ][ j ] += A[ k ][ i ] * A[ k ][ j ];
    \n-
    112 }
    \n-
    113 }
    \n-
    114 }
    \n-
    115
    \n-
    116 template< int m, int n >
    \n-
    117 static void ATA ( const FieldMatrix< ctype, m, n > &A, FieldMatrix< ctype, n, n > &ret )
    \n-
    118 {
    \n-
    119 for( int i = 0; i < n; ++i )
    \n-
    120 {
    \n-
    121 for( int j = 0; j <= i; ++j )
    \n-
    122 {
    \n-
    123 ret[ i ][ j ] = ctype( 0 );
    \n-
    124 for( int k = 0; k < m; ++k )
    \n-
    125 ret[ i ][ j ] += A[ k ][ i ] * A[ k ][ j ];
    \n-
    126 ret[ j ][ i ] = ret[ i ][ j ];
    \n-
    127 }
    \n-
    128
    \n-
    129 ret[ i ][ i ] = ctype( 0 );
    \n-
    130 for( int k = 0; k < m; ++k )
    \n-
    131 ret[ i ][ i ] += A[ k ][ i ] * A[ k ][ i ];
    \n-
    132 }
    \n-
    133 }
    \n-
    134
    \n-
    135 template< int m, int n >
    \n-
    136 static void AAT_L ( const FieldMatrix< ctype, m, n > &A, FieldMatrix< ctype, m, m > &ret )
    \n-
    137 {
    \n-
    138 /*
    \n-
    139 if (m==2) {
    \n-
    140 ret[0][0] = A[0]*A[0];
    \n-
    141 ret[1][1] = A[1]*A[1];
    \n-
    142 ret[1][0] = A[0]*A[1];
    \n-
    143 }
    \n-
    144 else
    \n-
    145 */
    \n-
    146 for( int i = 0; i < m; ++i )
    \n-
    147 {
    \n-
    148 for( int j = 0; j <= i; ++j )
    \n-
    149 {
    \n-
    150 ctype &retij = ret[ i ][ j ];
    \n-
    151 retij = A[ i ][ 0 ] * A[ j ][ 0 ];
    \n-
    152 for( int k = 1; k < n; ++k )
    \n-
    153 retij += A[ i ][ k ] * A[ j ][ k ];
    \n-
    154 }
    \n-
    155 }
    \n-
    156 }
    \n+
    102 const ReferenceElement& simplex () const
    \n+
    103 {
    \n+
    104 return reference_elements_[ Dune::GeometryTypes::simplex(dim).id() ];
    \n+
    105 }
    \n+
    106
    \n+
    107 const ReferenceElement& cube () const
    \n+
    108 {
    \n+
    109 return reference_elements_[ Dune::GeometryTypes::cube(dim).id() ];
    \n+
    110 }
    \n+
    111
    \n+
    112 const ReferenceElement& pyramid () const
    \n+
    113 {
    \n+
    114 return reference_elements_[ Dune::GeometryTypes::pyramid.id() ];
    \n+
    115 }
    \n+
    116
    \n+
    117 const ReferenceElement& prism () const
    \n+
    118 {
    \n+
    119 return reference_elements_[ Dune::GeometryTypes::prism.id() ];
    \n+
    120 }
    \n+
    121
    \n+
    122 const_iterator begin () const
    \n+
    123 {
    \n+
    124 return reference_elements_.data();
    \n+
    125 }
    \n+
    126
    \n+
    127 const_iterator end () const
    \n+
    128 {
    \n+
    129 return reference_elements_.data() + numTopologies;
    \n+
    130 }
    \n+
    131
    \n+
    132 // here, we make sure to actually return a const reference to something
    \n+
    133 // that is guaranteed not to become invalid, as otherwise, we might run
    \n+
    134 // straight into debugging hell when a user binds the return value to a
    \n+
    135 // const ref and the temporary goes out of scope.
    \n+
    136 const DeprecatedReferenceElement& deprecated(const ReferenceElement& v) const
    \n+
    137 {
    \n+
    138 return reference_elements_[v.impl().type(0,0).id()];
    \n+
    139 }
    \n+
    140
    \n+
    141 private:
    \n+
    142
    \n+
    143 std::array<Implementation,numTopologies> implementations_;
    \n+
    144 std::array<ConstructibleDeprecatedReferenceElement,numTopologies> reference_elements_;
    \n+
    145
    \n+
    146 };
    \n+
    147
    \n+
    148
    \n+
    149 } // namespace Impl
    \n+
    150
    \n+
    151
    \n+
    152#endif // DOXYGEN
    \n+
    153
    \n+
    154
    \n+
    155 // ReferenceElements
    \n+
    156 // ------------------------
    \n
    157
    \n-
    158 template< int m, int n >
    \n-
    159 static void AAT ( const FieldMatrix< ctype, m, n > &A, FieldMatrix< ctype, m, m > &ret )
    \n-
    160 {
    \n-
    161 for( int i = 0; i < m; ++i )
    \n-
    162 {
    \n-
    163 for( int j = 0; j < i; ++j )
    \n-
    164 {
    \n-
    165 ret[ i ][ j ] = ctype( 0 );
    \n-
    166 for( int k = 0; k < n; ++k )
    \n-
    167 ret[ i ][ j ] += A[ i ][ k ] * A[ j ][ k ];
    \n-
    168 ret[ j ][ i ] = ret[ i ][ j ];
    \n-
    169 }
    \n-
    170 ret[ i ][ i ] = ctype( 0 );
    \n-
    171 for( int k = 0; k < n; ++k )
    \n-
    172 ret[ i ][ i ] += A[ i ][ k ] * A[ i ][ k ];
    \n-
    173 }
    \n-
    174 }
    \n-
    175
    \n-
    176 template< int n >
    \n-
    177 static void Lx ( const FieldMatrix< ctype, n, n > &L, const FieldVector< ctype, n > &x, FieldVector< ctype, n > &ret )
    \n-
    178 {
    \n-
    179 for( int i = 0; i < n; ++i )
    \n-
    180 {
    \n-
    181 ret[ i ] = ctype( 0 );
    \n-
    182 for( int j = 0; j <= i; ++j )
    \n-
    183 ret[ i ] += L[ i ][ j ] * x[ j ];
    \n-
    184 }
    \n-
    185 }
    \n+
    168 template< class ctype_, int dim >
    \n+
    \n+\n+
    170 {
    \n+
    171
    \n+
    173 using ctype = ctype_;
    \n+
    174
    \n+\n+
    177
    \n+
    179 static constexpr int dimension = dim;
    \n+
    180
    \n+
    181 private:
    \n+
    182
    \n+
    183 using Container = Impl::ReferenceElementContainer< ctype, dim >;
    \n+
    184
    \n+
    185 public:
    \n
    186
    \n-
    187 template< int n >
    \n-
    188 static void LTx ( const FieldMatrix< ctype, n, n > &L, const FieldVector< ctype, n > &x, FieldVector< ctype, n > &ret )
    \n-
    189 {
    \n-
    190 for( int i = 0; i < n; ++i )
    \n-
    191 {
    \n-
    192 ret[ i ] = ctype( 0 );
    \n-
    193 for( int j = i; j < n; ++j )
    \n-
    194 ret[ i ] += L[ j ][ i ] * x[ j ];
    \n-
    195 }
    \n-
    196 }
    \n-
    197
    \n-
    198 template< int n >
    \n-
    199 static void LTL ( const FieldMatrix< ctype, n, n > &L, FieldMatrix< ctype, n, n > &ret )
    \n-
    200 {
    \n-
    201 for( int i = 0; i < n; ++i )
    \n-
    202 {
    \n-
    203 for( int j = 0; j < i; ++j )
    \n-
    204 {
    \n-
    205 ret[ i ][ j ] = ctype( 0 );
    \n-
    206 for( int k = i; k < n; ++k )
    \n-
    207 ret[ i ][ j ] += L[ k ][ i ] * L[ k ][ j ];
    \n-
    208 ret[ j ][ i ] = ret[ i ][ j ];
    \n-
    209 }
    \n-
    210 ret[ i ][ i ] = ctype( 0 );
    \n-
    211 for( int k = i; k < n; ++k )
    \n-
    212 ret[ i ][ i ] += L[ k ][ i ] * L[ k ][ i ];
    \n-
    213 }
    \n-
    214 }
    \n-
    215
    \n-
    216 template< int n >
    \n-
    217 static void LLT ( const FieldMatrix< ctype, n, n > &L, FieldMatrix< ctype, n, n > &ret )
    \n-
    218 {
    \n-
    219 for( int i = 0; i < n; ++i )
    \n-
    220 {
    \n-
    221 for( int j = 0; j < i; ++j )
    \n-
    222 {
    \n-
    223 ret[ i ][ j ] = ctype( 0 );
    \n-
    224 for( int k = 0; k <= j; ++k )
    \n-
    225 ret[ i ][ j ] += L[ i ][ k ] * L[ j ][ k ];
    \n-
    226 ret[ j ][ i ] = ret[ i ][ j ];
    \n-
    227 }
    \n-
    228 ret[ i ][ i ] = ctype( 0 );
    \n-
    229 for( int k = 0; k <= i; ++k )
    \n-
    230 ret[ i ][ i ] += L[ i ][ k ] * L[ i ][ k ];
    \n-
    231 }
    \n-
    232 }
    \n-
    233
    \n-
    234 template< int n >
    \n-
    235 static bool cholesky_L ( const FieldMatrix< ctype, n, n > &A, FieldMatrix< ctype, n, n > &ret, const bool checkSingular = false )
    \n+
    188 using ReferenceElement = typename Container::ReferenceElement;
    \n+
    189
    \n+
    191 using Iterator = typename Container::const_iterator;
    \n+
    192
    \n+\n+
    195
    \n+
    197 static const ReferenceElement&
    \n+
    \n+
    198 general ( const GeometryType& type )
    \n+
    199 {
    \n+
    200 return container() ( type );
    \n+
    201 }
    \n+
    \n+
    202
    \n+
    \n+
    204 static const ReferenceElement& simplex ()
    \n+
    205 {
    \n+
    206 return container().simplex();
    \n+
    207 }
    \n+
    \n+
    208
    \n+
    \n+
    210 static const ReferenceElement& cube ()
    \n+
    211 {
    \n+
    212 return container().cube();
    \n+
    213 }
    \n+
    \n+
    214
    \n+
    \n+
    215 static Iterator begin ()
    \n+
    216 {
    \n+
    217 return container().begin();
    \n+
    218 }
    \n+
    \n+
    219
    \n+
    \n+
    220 static Iterator end ()
    \n+
    221 {
    \n+
    222 return container().end();
    \n+
    223 }
    \n+
    \n+
    224
    \n+
    225#ifndef DOXYGEN
    \n+
    226 static const typename Container::DeprecatedReferenceElement&
    \n+
    227 deprecated(const ReferenceElement& v)
    \n+
    228 {
    \n+
    229 return container().deprecated(v);
    \n+
    230 }
    \n+
    231#endif // DOXYGEN
    \n+
    232
    \n+
    233 private:
    \n+
    234
    \n+
    235 DUNE_EXPORT static const Container& container ()
    \n
    236 {
    \n-
    237 using std::sqrt;
    \n-
    238 for( int i = 0; i < n; ++i )
    \n-
    239 {
    \n-
    240 ctype &rii = ret[ i ][ i ];
    \n+
    237 static Container container;
    \n+
    238 return container;
    \n+
    239 }
    \n+
    240 };
    \n+
    \n
    241
    \n-
    242 ctype xDiag = A[ i ][ i ];
    \n-
    243 for( int j = 0; j < i; ++j )
    \n-
    244 xDiag -= ret[ i ][ j ] * ret[ i ][ j ];
    \n-
    245
    \n-
    246 // in some cases A can be singular, e.g. when checking local for
    \n-
    247 // outside points during checkInside
    \n-
    248 if( checkSingular && ! ( xDiag > ctype( 0 )) )
    \n-
    249 return false ;
    \n-
    250
    \n-
    251 // otherwise this should be true always
    \n-
    252 assert( xDiag > ctype( 0 ) );
    \n-
    253 rii = sqrt( xDiag );
    \n-
    254
    \n-
    255 ctype invrii = ctype( 1 ) / rii;
    \n-
    256 for( int k = i+1; k < n; ++k )
    \n-
    257 {
    \n-
    258 ctype x = A[ k ][ i ];
    \n-
    259 for( int j = 0; j < i; ++j )
    \n-
    260 x -= ret[ i ][ j ] * ret[ k ][ j ];
    \n-
    261 ret[ k ][ i ] = invrii * x;
    \n-
    262 }
    \n-
    263 }
    \n-
    264
    \n-
    265 // return true for meaning A is non-singular
    \n-
    266 return true;
    \n-
    267 }
    \n-
    268
    \n-
    269 template< int n >
    \n-
    270 static ctype detL ( const FieldMatrix< ctype, n, n > &L )
    \n-
    271 {
    \n-
    272 ctype det( 1 );
    \n-
    273 for( int i = 0; i < n; ++i )
    \n-
    274 det *= L[ i ][ i ];
    \n-
    275 return det;
    \n-
    276 }
    \n-
    277
    \n-
    278 template< int n >
    \n-
    279 static ctype invL ( FieldMatrix< ctype, n, n > &L )
    \n-
    280 {
    \n-
    281 ctype det( 1 );
    \n-
    282 for( int i = 0; i < n; ++i )
    \n-
    283 {
    \n-
    284 ctype &lii = L[ i ][ i ];
    \n-
    285 det *= lii;
    \n-
    286 lii = ctype( 1 ) / lii;
    \n-
    287 for( int j = 0; j < i; ++j )
    \n-
    288 {
    \n-
    289 ctype &lij = L[ i ][ j ];
    \n-
    290 ctype x = lij * L[ j ][ j ];
    \n-
    291 for( int k = j+1; k < i; ++k )
    \n-
    292 x += L[ i ][ k ] * L[ k ][ j ];
    \n-
    293 lij = (-lii) * x;
    \n-
    294 }
    \n-
    295 }
    \n-
    296 return det;
    \n-
    297 }
    \n+
    242 } // namespace Geo
    \n+
    243
    \n+
    245 using Geo::ReferenceElements;
    \n+
    246
    \n+
    247
    \n+
    248#ifdef DOXYGEN
    \n+
    249
    \n+
    251
    \n+
    294 template<typename... T>
    \n+
    295 unspecified-value-type referenceElement(T&&... t);
    \n+
    296
    \n+
    297#endif
    \n
    298
    \n-
    299 // calculates x := L^{-1} x
    \n-
    300 template< int n >
    \n-
    301 static void invLx ( FieldMatrix< ctype, n, n > &L, FieldVector< ctype, n > &x )
    \n-
    302 {
    \n-
    303 for( int i = 0; i < n; ++i )
    \n-
    304 {
    \n-
    305 for( int j = 0; j < i; ++j )
    \n-
    306 x[ i ] -= L[ i ][ j ] * x[ j ];
    \n-
    307 x[ i ] /= L[ i ][ i ];
    \n-
    308 }
    \n-
    309 }
    \n-
    310
    \n-
    311 // calculates x := L^{-T} x
    \n-
    312 template< int n >
    \n-
    313 static void invLTx ( FieldMatrix< ctype, n, n > &L, FieldVector< ctype, n > &x )
    \n-
    314 {
    \n-
    315 for( int i = n; i > 0; --i )
    \n-
    316 {
    \n-
    317 for( int j = i; j < n; ++j )
    \n-
    318 x[ i-1 ] -= L[ j ][ i-1 ] * x[ j ];
    \n-
    319 x[ i-1 ] /= L[ i-1 ][ i-1 ];
    \n-
    320 }
    \n-
    321 }
    \n+
    299
    \n+
    301
    \n+
    314 template<typename T, int dim>
    \n+
    \n+\n+
    316 {
    \n+\n+
    318 }
    \n+
    \n+
    319
    \n+
    320
    \n
    322
    \n-
    323 template< int n >
    \n-
    324 static ctype spdDetA ( const FieldMatrix< ctype, n, n > &A )
    \n-
    325 {
    \n-
    326 // return A[0][0]*A[1][1]-A[1][0]*A[1][0];
    \n-
    327 FieldMatrix< ctype, n, n > L;
    \n-
    328 cholesky_L( A, L );
    \n-
    329 return detL( L );
    \n-
    330 }
    \n-
    331
    \n-
    332 template< int n >
    \n-
    333 static ctype spdInvA ( FieldMatrix< ctype, n, n > &A )
    \n-
    334 {
    \n-
    335 FieldMatrix< ctype, n, n > L;
    \n-
    336 cholesky_L( A, L );
    \n-
    337 const ctype det = invL( L );
    \n-
    338 LTL( L, A );
    \n-
    339 return det;
    \n-
    340 }
    \n-
    341
    \n-
    342 // calculate x := A^{-1} x
    \n-
    343 template< int n >
    \n-
    344 static bool spdInvAx ( FieldMatrix< ctype, n, n > &A, FieldVector< ctype, n > &x, const bool checkSingular = false )
    \n-
    345 {
    \n-
    346 FieldMatrix< ctype, n, n > L;
    \n-
    347 const bool invertible = cholesky_L( A, L, checkSingular );
    \n-
    348 if( ! invertible ) return invertible ;
    \n-
    349 invLx( L, x );
    \n-
    350 invLTx( L, x );
    \n-
    351 return invertible;
    \n-
    352 }
    \n-
    353
    \n-
    354 template< int m, int n >
    \n-
    355 static ctype detATA ( const FieldMatrix< ctype, m, n > &A )
    \n-
    356 {
    \n-
    357 if( m >= n )
    \n-
    358 {
    \n-
    359 FieldMatrix< ctype, n, n > ata;
    \n-
    360 ATA_L( A, ata );
    \n-
    361 return spdDetA( ata );
    \n-
    362 }
    \n-
    363 else
    \n-
    364 return ctype( 0 );
    \n-
    365 }
    \n-
    366
    \n-
    372 template< int m, int n >
    \n-
    373 static ctype sqrtDetAAT ( const FieldMatrix< ctype, m, n > &A )
    \n-
    374 {
    \n-
    375 using std::abs;
    \n-
    376 using std::sqrt;
    \n-
    377 // These special cases are here not only for speed reasons:
    \n-
    378 // The general implementation aborts if the matrix is almost singular,
    \n-
    379 // and the special implementation provide a stable way to handle that case.
    \n-
    380 if( (n == 2) && (m == 2) )
    \n-
    381 {
    \n-
    382 // Special implementation for 2x2 matrices: faster and more stable
    \n-
    383 return abs( A[ 0 ][ 0 ]*A[ 1 ][ 1 ] - A[ 1 ][ 0 ]*A[ 0 ][ 1 ] );
    \n-
    384 }
    \n-
    385 else if( (n == 3) && (m == 3) )
    \n-
    386 {
    \n-
    387 // Special implementation for 3x3 matrices
    \n-
    388 const ctype v0 = A[ 0 ][ 1 ] * A[ 1 ][ 2 ] - A[ 1 ][ 1 ] * A[ 0 ][ 2 ];
    \n-
    389 const ctype v1 = A[ 0 ][ 2 ] * A[ 1 ][ 0 ] - A[ 1 ][ 2 ] * A[ 0 ][ 0 ];
    \n-
    390 const ctype v2 = A[ 0 ][ 0 ] * A[ 1 ][ 1 ] - A[ 1 ][ 0 ] * A[ 0 ][ 1 ];
    \n-
    391 return abs( v0 * A[ 2 ][ 0 ] + v1 * A[ 2 ][ 1 ] + v2 * A[ 2 ][ 2 ] );
    \n-
    392 }
    \n-
    393 else if ( (n == 3) && (m == 2) )
    \n-
    394 {
    \n-
    395 // Special implementation for 2x3 matrices
    \n-
    396 const ctype v0 = A[ 0 ][ 0 ] * A[ 1 ][ 1 ] - A[ 0 ][ 1 ] * A[ 1 ][ 0 ];
    \n-
    397 const ctype v1 = A[ 0 ][ 0 ] * A[ 1 ][ 2 ] - A[ 1 ][ 0 ] * A[ 0 ][ 2 ];
    \n-
    398 const ctype v2 = A[ 0 ][ 1 ] * A[ 1 ][ 2 ] - A[ 0 ][ 2 ] * A[ 1 ][ 1 ];
    \n-
    399 return sqrt( v0*v0 + v1*v1 + v2*v2);
    \n-
    400 }
    \n-
    401 else if( n >= m )
    \n-
    402 {
    \n-
    403 // General case
    \n-
    404 FieldMatrix< ctype, m, m > aat;
    \n-
    405 AAT_L( A, aat );
    \n-
    406 return spdDetA( aat );
    \n-
    407 }
    \n-
    408 else
    \n-
    409 return ctype( 0 );
    \n-
    410 }
    \n-
    411
    \n-
    412 // A^{-1}_L = (A^T A)^{-1} A^T
    \n-
    413 // => A^{-1}_L A = I
    \n-
    414 template< int m, int n >
    \n-
    415 static ctype leftInvA ( const FieldMatrix< ctype, m, n > &A, FieldMatrix< ctype, n, m > &ret )
    \n-
    416 {
    \n-
    417 static_assert((m >= n), "Matrix has no left inverse.");
    \n-
    418 FieldMatrix< ctype, n, n > ata;
    \n-
    419 ATA_L( A, ata );
    \n-
    420 const ctype det = spdInvA( ata );
    \n-
    421 ATBT( ata, A, ret );
    \n-
    422 return det;
    \n-
    423 }
    \n+
    334 template<typename T, int dim, std::enable_if_t<IsNumber<std::decay_t<T>>::value, int> = 0>
    \n+
    \n+\n+
    336 {
    \n+\n+
    338 }
    \n+
    \n+
    339
    \n+
    340
    \n+
    341#ifndef DOXYGEN
    \n+
    342
    \n+
    343 // helpers for the ReferenceElement<> meta function
    \n+
    344
    \n+
    345 namespace Impl {
    \n+
    346
    \n+
    347 // Evaluates to the correct reference element iff <T...> matches the pattern <number_type,Dim<int>>
    \n+
    348 // otherwise, it's ill-formed. Should be used with detected_or and friends.
    \n+
    349
    \n+
    350 template<typename... T>
    \n+
    351 struct DefaultReferenceElementExtractor;
    \n+
    352
    \n+
    353 template<typename T, typename std::enable_if<IsNumber<T>::value,int>::type dim>
    \n+
    354 struct DefaultReferenceElementExtractor<T,Dim<dim>>
    \n+
    355 {
    \n+\n+
    357 };
    \n+
    358
    \n+
    359 template<typename... T>
    \n+
    360 using DefaultReferenceElement = typename DefaultReferenceElementExtractor<T...>::type;
    \n+
    361
    \n+
    362 }
    \n+
    363
    \n+
    364 // looks up the type of a reference element by trying to instantiate the correct overload
    \n+
    365 // of referenceElement() for the given arguments. This will fail if there is no valid
    \n+
    366 // overload and should be used with detected_or or some other utility that places the
    \n+
    367 // instantiation in SFINAE context.
    \n+
    368 //
    \n+
    369 // this is placed directly in namespace Dune to avoid any weird surprises
    \n+
    370
    \n+
    371 template<typename... T>
    \n+
    372 using LookupReferenceElement = decltype(referenceElement(std::declval<T>()...));
    \n+
    373
    \n+
    374#endif // DOXYGEN
    \n+
    375
    \n+
    \n+
    376 namespace Transitional {
    \n+
    377
    \n+
    378#ifndef DOXYGEN
    \n+
    379
    \n+
    380 // this abomination checks whether the template signature matches the special case
    \n+
    381 // ReferenceElement<number_type,Dune::Dim<int>> and otherwise defers the type lookup
    \n+
    382 // to a decltype on a call to referenceElement(std::declval<T>())
    \n+
    383
    \n+
    384 template<typename... T>
    \n+
    385 using ReferenceElement = Std::detected_or_t<
    \n+
    386 Std::detected_t<LookupReferenceElement,T...>,
    \n+
    387 Impl::DefaultReferenceElement,
    \n+
    388 T...
    \n+
    389 >;
    \n+
    390
    \n+
    391#else // DOXYGEN
    \n+
    392
    \n+
    394
    \n+
    416 template<typename... T>
    \n+
    417 using ReferenceElement = unspecified-type;
    \n+
    418
    \n+
    419#endif //DOXYGEN
    \n+
    420
    \n+
    421 }
    \n+
    \n+
    422
    \n+
    423#ifndef DOXYGEN
    \n
    424
    \n-
    425 template< int m, int n >
    \n-
    426 static void leftInvAx ( const FieldMatrix< ctype, m, n > &A, const FieldVector< ctype, m > &x, FieldVector< ctype, n > &y )
    \n-
    427 {
    \n-
    428 static_assert((m >= n), "Matrix has no left inverse.");
    \n-
    429 FieldMatrix< ctype, n, n > ata;
    \n-
    430 ATx( A, x, y );
    \n-
    431 ATA_L( A, ata );
    \n-
    432 spdInvAx( ata, y );
    \n-
    433 }
    \n-
    434
    \n-
    436 template< int m, int n >
    \n-
    437 static ctype rightInvA ( const FieldMatrix< ctype, m, n > &A, FieldMatrix< ctype, n, m > &ret )
    \n-
    438 {
    \n-
    439 static_assert((n >= m), "Matrix has no right inverse.");
    \n-
    440 using std::abs;
    \n-
    441 if( (n == 2) && (m == 2) )
    \n-
    442 {
    \n-
    443 const ctype det = (A[ 0 ][ 0 ]*A[ 1 ][ 1 ] - A[ 1 ][ 0 ]*A[ 0 ][ 1 ]);
    \n-
    444 const ctype detInv = ctype( 1 ) / det;
    \n-
    445 ret[ 0 ][ 0 ] = A[ 1 ][ 1 ] * detInv;
    \n-
    446 ret[ 1 ][ 1 ] = A[ 0 ][ 0 ] * detInv;
    \n-
    447 ret[ 1 ][ 0 ] = -A[ 1 ][ 0 ] * detInv;
    \n-
    448 ret[ 0 ][ 1 ] = -A[ 0 ][ 1 ] * detInv;
    \n-
    449 return abs( det );
    \n-
    450 }
    \n-
    451 else
    \n-
    452 {
    \n-
    453 FieldMatrix< ctype, m , m > aat;
    \n-
    454 AAT_L( A, aat );
    \n-
    455 const ctype det = spdInvA( aat );
    \n-
    456 ATBT( A , aat , ret );
    \n-
    457 return det;
    \n-
    458 }
    \n-
    459 }
    \n+
    425 namespace Impl {
    \n+
    426
    \n+
    427 // helpers for triggering a deprecation warning for occurrences of the old
    \n+
    428 // ReferenceElement syntax (Dune::ReferenceElement<T,int>)
    \n+
    429
    \n+
    430 // this looks a little weird, encoding the type in the return type of a nested function,
    \n+
    431 // but it was the only reliable way to trigger the warning iff the compiler encounters
    \n+
    432 // an invalid use. Other solutions either miss some (or all) uses or trigger false alarms.
    \n+
    433
    \n+
    434 template<typename T>
    \n+
    435 struct ValidReferenceElementTypeSignature
    \n+
    436 {
    \n+
    437 Transitional::ReferenceElement<T> check();
    \n+
    438 };
    \n+
    439
    \n+
    440 template<typename T>
    \n+
    441 struct DeprecatedReferenceElementTypeSignature
    \n+
    442 {
    \n+
    443 [[deprecated("Dune::ReferenceElement<T,int> is deprecated, please use Dune::ReferenceElement<Geometry> (if you have a geometry), Dune::ReferenceElements<T,int>::ReferenceElement or Dune::Transitional::ReferenceElement<T,Dune::Dim<int>> instead. After Dune 2.6, you will be able to use Dune::ReferenceElement<T,Dune::Dim<int>>.")]] T check();
    \n+
    444 };
    \n+
    445
    \n+
    446 } // namespace Impl
    \n+
    447
    \n+
    448 // This just makes sure the user doesn't use invalid syntax (by checking against the -1 default for
    \n+
    449 // the dimension, and then either hands back the old-style type along with a deprecation warning or
    \n+
    450 // forwards to the transitional version
    \n+
    451 template<typename T, int dim = -1>
    \n+
    452 using ReferenceElement = decltype(
    \n+
    453 std::declval<
    \n+
    454 typename std::conditional<
    \n+
    455 dim == -1,
    \n+
    456 Impl::ValidReferenceElementTypeSignature<T>,
    \n+
    457 Impl::DeprecatedReferenceElementTypeSignature<Geo::DeprecatedReferenceElement<T,dim>>
    \n+
    458 >::type
    \n+
    459 >().check());
    \n
    460
    \n-
    461 template< int m, int n >
    \n-
    462 static bool xTRightInvA ( const FieldMatrix< ctype, m, n > &A, const FieldVector< ctype, n > &x, FieldVector< ctype, m > &y )
    \n-
    463 {
    \n-
    464 static_assert((n >= m), "Matrix has no right inverse.");
    \n-
    465 FieldMatrix< ctype, m, m > aat;
    \n-
    466 Ax( A, x, y );
    \n-
    467 AAT_L( A, aat );
    \n-
    468 // check whether aat is singular and return true if non-singular
    \n-
    469 return spdInvAx( aat, y, true );
    \n-
    470 }
    \n-
    471 };
    \n-
    472
    \n-
    473 } // namespace Impl
    \n-
    474
    \n-
    475
    \n-
    476
    \n-
    482 template< class ct, int mydim, int cdim>
    \n-
    \n-\n-
    484 {
    \n-
    485 public:
    \n-
    486
    \n-
    488 typedef ct ctype;
    \n-
    489
    \n-
    491 static const int mydimension= mydim;
    \n-
    492
    \n-
    494 static const int coorddimension = cdim;
    \n-
    495
    \n-
    497 typedef FieldVector< ctype, mydimension > LocalCoordinate;
    \n+
    461#else // DOXYGEN
    \n+
    462
    \n+
    464
    \n+
    496 template<typename T, int dim>
    \n+
    497 using ReferenceElement = unspecified-type;
    \n
    498
    \n-
    500 typedef FieldVector< ctype, coorddimension > GlobalCoordinate;
    \n+
    499#endif // DOXYGEN
    \n+
    500
    \n
    501
    \n-
    503 typedef ctype Volume;
    \n+
    502
    \n+
    503} // namespace Dune
    \n
    504
    \n-
    506 typedef FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed;
    \n-
    507
    \n-
    509 typedef FieldMatrix< ctype, coorddimension, mydimension > JacobianInverseTransposed;
    \n-
    510
    \n-
    512 typedef FieldMatrix< ctype, coorddimension, mydimension > Jacobian;
    \n-
    513
    \n-
    515 typedef FieldMatrix< ctype, mydimension, coorddimension > JacobianInverse;
    \n-
    516
    \n-
    517 private:
    \n-\n-
    520
    \n-\n-
    522
    \n-
    523 // Helper class to compute a matrix pseudo inverse
    \n-
    524 typedef Impl::FieldMatrixHelper< ct > MatrixHelper;
    \n-
    525
    \n-
    526 public:
    \n-
    \n-
    528 AffineGeometry ( const ReferenceElement &refElement, const GlobalCoordinate &origin,
    \n-
    529 const JacobianTransposed &jt )
    \n-
    530 : refElement_(refElement), origin_(origin), jacobianTransposed_(jt)
    \n-
    531 {
    \n-
    532 integrationElement_ = MatrixHelper::template rightInvA< mydimension, coorddimension >( jacobianTransposed_, jacobianInverseTransposed_ );
    \n-
    533 }
    \n-
    \n-
    534
    \n-
    \n-\n-
    537 const JacobianTransposed &jt )
    \n-
    538 : AffineGeometry(ReferenceElements::general( gt ), origin, jt)
    \n-
    539 { }
    \n-
    \n-
    540
    \n-
    542 template< class CoordVector >
    \n-
    \n-
    543 AffineGeometry ( const ReferenceElement &refElement, const CoordVector &coordVector )
    \n-
    544 : refElement_(refElement), origin_(coordVector[0])
    \n-
    545 {
    \n-
    546 for( int i = 0; i < mydimension; ++i )
    \n-
    547 jacobianTransposed_[ i ] = coordVector[ i+1 ] - origin_;
    \n-
    548 integrationElement_ = MatrixHelper::template rightInvA< mydimension, coorddimension >( jacobianTransposed_, jacobianInverseTransposed_ );
    \n-
    549 }
    \n-
    \n-
    550
    \n-
    552 template< class CoordVector >
    \n-
    \n-
    553 AffineGeometry ( Dune::GeometryType gt, const CoordVector &coordVector )
    \n-
    554 : AffineGeometry(ReferenceElements::general( gt ), coordVector)
    \n-
    555 { }
    \n-
    \n-
    556
    \n-
    558 bool affine () const { return true; }
    \n-
    559
    \n-
    561 Dune::GeometryType type () const { return refElement_.type(); }
    \n-
    562
    \n-
    564 int corners () const { return refElement_.size( mydimension ); }
    \n-
    565
    \n-
    \n-
    567 GlobalCoordinate corner ( int i ) const
    \n-
    568 {
    \n-
    569 return global( refElement_.position( i, mydimension ) );
    \n-
    570 }
    \n-
    \n-
    571
    \n-
    573 GlobalCoordinate center () const { return global( refElement_.position( 0, 0 ) ); }
    \n-
    574
    \n-
    \n-\n-
    582 {
    \n-
    583 GlobalCoordinate global( origin_ );
    \n-
    584 jacobianTransposed_.umtv( local, global );
    \n-
    585 return global;
    \n-
    586 }
    \n-
    \n-
    587
    \n-
    \n-\n-
    602 {
    \n-\n-
    604 jacobianInverseTransposed_.mtv( global - origin_, local );
    \n-
    605 return local;
    \n-
    606 }
    \n-
    \n-
    607
    \n-
    \n-
    618 ctype integrationElement ([[maybe_unused]] const LocalCoordinate &local) const
    \n-
    619 {
    \n-
    620 return integrationElement_;
    \n-
    621 }
    \n-
    \n-
    622
    \n-
    \n-
    624 Volume volume () const
    \n-
    625 {
    \n-
    626 return integrationElement_ * refElement_.volume();
    \n-
    627 }
    \n-
    \n-
    628
    \n-
    \n-
    635 const JacobianTransposed &jacobianTransposed ([[maybe_unused]] const LocalCoordinate &local) const
    \n-
    636 {
    \n-
    637 return jacobianTransposed_;
    \n-
    638 }
    \n-
    \n-
    639
    \n-
    \n-\n-
    647 {
    \n-
    648 return jacobianInverseTransposed_;
    \n-
    649 }
    \n-
    \n-
    650
    \n-
    \n-
    657 Jacobian jacobian ([[maybe_unused]] const LocalCoordinate &local) const
    \n-
    658 {
    \n-
    659 return jacobianTransposed_.transposed();
    \n-
    660 }
    \n-
    \n-
    661
    \n-
    \n-
    668 JacobianInverse jacobianInverse ([[maybe_unused]] const LocalCoordinate &local) const
    \n-
    669 {
    \n-
    670 return jacobianInverseTransposed_.transposed();
    \n-
    671 }
    \n-
    \n-
    672
    \n-
    \n-\n-
    674 {
    \n-
    675 return geometry.refElement_;
    \n-
    676 }
    \n-
    \n-
    677
    \n-
    678 private:
    \n-
    679 ReferenceElement refElement_;
    \n-
    680 GlobalCoordinate origin_;
    \n-
    681 JacobianTransposed jacobianTransposed_;
    \n-
    682 JacobianInverseTransposed jacobianInverseTransposed_;
    \n-
    683 ctype integrationElement_;
    \n-
    684 };
    \n-
    \n-
    685
    \n-
    686} // namespace Dune
    \n-
    \n-
    687
    \n-
    688#endif // #ifndef DUNE_GEOMETRY_AFFINEGEOMETRY_HH
    \n+
    505#endif // #ifndef DUNE_GEOMETRY_REFERENCEELEMENTS_HH
    \n+\n+\n
    A unique label for each type of element that can occur in a grid.
    \n+\n+
    unspecified value type referenceElement(T &&... t)
    Returns a reference element for the objects t....
    \n
    unspecified-type ReferenceElement
    Returns the type of reference element for the argument type T.
    Definition referenceelements.hh:497
    \n
    Definition affinegeometry.hh:21
    \n
    This class provides access to geometric and topological properties of a reference element.
    Definition referenceelement.hh:52
    \n-
    CoordinateField volume() const
    obtain the volume of the reference element
    Definition referenceelement.hh:241
    \n-
    decltype(auto) type(int i, int c) const
    obtain the type of subentity (i,c)
    Definition referenceelement.hh:171
    \n-
    int size(int c) const
    number of subentities of codimension c
    Definition referenceelement.hh:94
    \n-
    decltype(auto) position(int i, int c) const
    position of the barycenter of entity (i,c)
    Definition referenceelement.hh:203
    \n-
    Definition affinegeometry.hh:33
    \n
    Class providing access to the singletons of the reference elements.
    Definition referenceelements.hh:170
    \n-
    Implementation of the Geometry interface for affine geometries.
    Definition affinegeometry.hh:484
    \n-
    AffineGeometry(const ReferenceElement &refElement, const CoordVector &coordVector)
    Create affine geometry from reference element and a vector of vertex coordinates.
    Definition affinegeometry.hh:543
    \n-
    AffineGeometry(Dune::GeometryType gt, const GlobalCoordinate &origin, const JacobianTransposed &jt)
    Create affine geometry from GeometryType, one vertex, and the Jacobian matrix.
    Definition affinegeometry.hh:536
    \n-
    FieldVector< ctype, mydimension > LocalCoordinate
    Type for local coordinate vector.
    Definition affinegeometry.hh:497
    \n-
    Dune::GeometryType type() const
    Obtain the type of the reference element.
    Definition affinegeometry.hh:561
    \n-
    static const int mydimension
    Dimension of the geometry.
    Definition affinegeometry.hh:491
    \n-
    AffineGeometry(const ReferenceElement &refElement, const GlobalCoordinate &origin, const JacobianTransposed &jt)
    Create affine geometry from reference element, one vertex, and the Jacobian matrix.
    Definition affinegeometry.hh:528
    \n-
    ctype Volume
    Type used for volume.
    Definition affinegeometry.hh:503
    \n-
    JacobianInverse jacobianInverse(const LocalCoordinate &local) const
    Obtain the Jacobian's inverse.
    Definition affinegeometry.hh:668
    \n-
    friend ReferenceElement referenceElement(const AffineGeometry &geometry)
    Definition affinegeometry.hh:673
    \n-
    AffineGeometry(Dune::GeometryType gt, const CoordVector &coordVector)
    Create affine geometry from GeometryType and a vector of vertex coordinates.
    Definition affinegeometry.hh:553
    \n-
    ctype integrationElement(const LocalCoordinate &local) const
    Obtain the integration element.
    Definition affinegeometry.hh:618
    \n-
    FieldMatrix< ctype, mydimension, coorddimension > JacobianInverse
    Type for the inverse Jacobian matrix.
    Definition affinegeometry.hh:515
    \n-
    FieldMatrix< ctype, coorddimension, mydimension > Jacobian
    Type for the Jacobian matrix.
    Definition affinegeometry.hh:512
    \n-
    const JacobianInverseTransposed & jacobianInverseTransposed(const LocalCoordinate &local) const
    Obtain the transposed of the Jacobian's inverse.
    Definition affinegeometry.hh:646
    \n-
    FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed
    Type for the transposed Jacobian matrix.
    Definition affinegeometry.hh:506
    \n-
    GlobalCoordinate corner(int i) const
    Obtain coordinates of the i-th corner.
    Definition affinegeometry.hh:567
    \n-
    int corners() const
    Obtain number of corners of the corresponding reference element.
    Definition affinegeometry.hh:564
    \n-
    LocalCoordinate local(const GlobalCoordinate &global) const
    Evaluate the inverse mapping.
    Definition affinegeometry.hh:601
    \n-
    FieldMatrix< ctype, coorddimension, mydimension > JacobianInverseTransposed
    Type for the transposed inverse Jacobian matrix.
    Definition affinegeometry.hh:509
    \n-
    static const int coorddimension
    Dimension of the world space.
    Definition affinegeometry.hh:494
    \n-
    GlobalCoordinate global(const LocalCoordinate &local) const
    Evaluate the mapping.
    Definition affinegeometry.hh:581
    \n-
    GlobalCoordinate center() const
    Obtain the centroid of the mapping's image.
    Definition affinegeometry.hh:573
    \n-
    Jacobian jacobian(const LocalCoordinate &local) const
    Obtain the Jacobian.
    Definition affinegeometry.hh:657
    \n-
    ct ctype
    Type used for coordinates.
    Definition affinegeometry.hh:488
    \n-
    FieldVector< ctype, coorddimension > GlobalCoordinate
    Type for coordinate vector in world space.
    Definition affinegeometry.hh:500
    \n-
    bool affine() const
    Always true: this is an affine geometry.
    Definition affinegeometry.hh:558
    \n-
    const JacobianTransposed & jacobianTransposed(const LocalCoordinate &local) const
    Obtain the transposed of the Jacobian.
    Definition affinegeometry.hh:635
    \n-
    Volume volume() const
    Obtain the volume of the element.
    Definition affinegeometry.hh:624
    \n+
    static Iterator begin()
    Definition referenceelements.hh:215
    \n+
    Iterator iterator
    Iterator over available reference elements.
    Definition referenceelements.hh:194
    \n+
    typename Container::ReferenceElement ReferenceElement
    The reference element type.
    Definition referenceelements.hh:188
    \n+
    static const ReferenceElement & cube()
    get hypercube reference elements
    Definition referenceelements.hh:210
    \n+
    static Iterator end()
    Definition referenceelements.hh:220
    \n+
    ctype_ ctype
    The coordinate field type of the contained reference elements.
    Definition referenceelements.hh:173
    \n+
    static const ReferenceElement & general(const GeometryType &type)
    get general reference elements
    Definition referenceelements.hh:198
    \n+
    static const ReferenceElement & simplex()
    get simplex reference elements
    Definition referenceelements.hh:204
    \n+
    typename Container::const_iterator Iterator
    Iterator over available reference elements.
    Definition referenceelements.hh:191
    \n+
    static constexpr int dimension
    The dimension of the contained reference elements.
    Definition referenceelements.hh:179
    \n+
    ctype CoordinateField
    The coordinate field type of the contained reference elements.
    Definition referenceelements.hh:176
    \n+
    Static tag representing a dimension.
    Definition dimension.hh:16
    \n
    Unique label for each type of entities that can occur in DUNE grids.
    Definition type.hh:126
    \n+
    constexpr unsigned int id() const
    Return the topology id of the type.
    Definition type.hh:377
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,801 +7,480 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n-affinegeometry.hh\n+referenceelements.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file\n LICENSE.md in module root\n 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n- 5#ifndef DUNE_GEOMETRY_AFFINEGEOMETRY_HH\n- 6#define DUNE_GEOMETRY_AFFINEGEOMETRY_HH\n+ 5#ifndef DUNE_GEOMETRY_REFERENCEELEMENTS_HH\n+ 6#define DUNE_GEOMETRY_REFERENCEELEMENTS_HH\n 7\n- 13#include \n- 14\n- 15#include \n- 16#include \n- 17\n- 18#include \n- 19\n-20namespace Dune\n- 21{\n- 22\n- 23 // External Forward Declarations\n- 24 // -----------------------------\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#include \n+ 18#include \n+ 19#include \n+ 20\n+ 21#include \n+ 22#include \n+ 23#include \n+ 24#include \n 25\n-26 namespace Geo\n- 27 {\n+ 26namespace Dune\n+ 27{\n 28\n- 29 template< typename Implementation >\n- 30 class ReferenceElement;\n+ 29 namespace Geo\n+ 30 {\n 31\n- 32 template< class ctype, int dim >\n-33 class ReferenceElementImplementation;\n+ 32#ifndef DOXYGEN\n+ 33\n 34\n- 35 template< class ctype, int dim >\n- 36 struct ReferenceElements;\n- 37\n- 38 }\n+ 35 template\n+ 36 class DeprecatedReferenceElement\n+ 37 : public ReferenceElement>\n+ 38 {\n 39\n- 40\n- 41 namespace Impl\n- 42 {\n+ 40 protected:\n+ 41\n+ 42 DeprecatedReferenceElement() = default;\n 43\n- 44 // FieldMatrixHelper\n- 45 // -----------------\n- 46\n- 47 template< class ct >\n- 48 struct FieldMatrixHelper\n- 49 {\n- 50 typedef ct ctype;\n- 51\n- 52 template< int m, int n >\n- 53 static void Ax ( const FieldMatrix< ctype, m, n > &A, const FieldVector<\n-ctype, n > &x, FieldVector< ctype, m > &ret )\n- 54 {\n- 55 for( int i = 0; i < m; ++i )\n- 56 {\n- 57 ret[ i ] = ctype( 0 );\n- 58 for( int j = 0; j < n; ++j )\n- 59 ret[ i ] += A[ i ][ j ] * x[ j ];\n- 60 }\n- 61 }\n- 62\n- 63 template< int m, int n >\n- 64 static void ATx ( const FieldMatrix< ctype, m, n > &A, const FieldVector<\n-ctype, m > &x, FieldVector< ctype, n > &ret )\n- 65 {\n- 66 for( int i = 0; i < n; ++i )\n- 67 {\n- 68 ret[ i ] = ctype( 0 );\n- 69 for( int j = 0; j < m; ++j )\n- 70 ret[ i ] += A[ j ][ i ] * x[ j ];\n- 71 }\n- 72 }\n- 73\n- 74 template< int m, int n, int p >\n- 75 static void AB ( const FieldMatrix< ctype, m, n > &A, const FieldMatrix<\n-ctype, n, p > &B, FieldMatrix< ctype, m, p > &ret )\n- 76 {\n- 77 for( int i = 0; i < m; ++i )\n- 78 {\n- 79 for( int j = 0; j < p; ++j )\n- 80 {\n- 81 ret[ i ][ j ] = ctype( 0 );\n- 82 for( int k = 0; k < n; ++k )\n- 83 ret[ i ][ j ] += A[ i ][ k ] * B[ k ][ j ];\n- 84 }\n- 85 }\n- 86 }\n- 87\n- 88 template< int m, int n, int p >\n- 89 static void ATBT ( const FieldMatrix< ctype, m, n > &A, const FieldMatrix<\n-ctype, p, m > &B, FieldMatrix< ctype, n, p > &ret )\n+ 44 public:\n+ 45\n+ 46 DeprecatedReferenceElement(const DeprecatedReferenceElement&) = delete;\n+ 47 DeprecatedReferenceElement& operator=(const DeprecatedReferenceElement&) =\n+delete;\n+ 48\n+ 49 DeprecatedReferenceElement(const ReferenceElementImplementation&\n+impl)\n+ 50 : ReferenceElement>(impl)\n+ 51 {}\n+ 52\n+ 53 };\n+ 54\n+ 55\n+ 56 template\n+ 57 class ConstructibleDeprecatedReferenceElement\n+ 58 : public DeprecatedReferenceElement\n+ 59 {\n+ 60 public:\n+ 61 ConstructibleDeprecatedReferenceElement() = default;\n+ 62 };\n+ 63\n+ 64\n+ 65 namespace Impl\n+ 66 {\n+ 67\n+ 68 // ReferenceElementContainer\n+ 69 // -------------------------\n+ 70\n+ 71 template< class ctype, int dim >\n+ 72 class ReferenceElementContainer\n+ 73 {\n+ 74 static const unsigned int numTopologies = dim >= 0 ? (1u << dim) : 0;\n+ 75\n+ 76 using Implementation = ReferenceElementImplementation< ctype, dim >;\n+ 77 using ConstructibleDeprecatedReferenceElement = Dune::Geo::\n+ConstructibleDeprecatedReferenceElement;\n+ 78\n+ 79 public:\n+ 80\n+ 81 using DeprecatedReferenceElement = Dune::Geo::\n+DeprecatedReferenceElement;\n+ 82\n+ 83 using ReferenceElement = Dune::Geo::ReferenceElement<_Implementation_>;\n+ 84 using value_type = ReferenceElement;\n+ 85 using const_iterator = const value_type*;\n+ 86\n+ 87 ReferenceElementContainer ()\n+ 88 {\n+ 89 for( unsigned int topologyId = 0; topologyId < numTopologies; ++topologyId\n+)\n 90 {\n- 91 for( int i = 0; i < n; ++i )\n- 92 {\n- 93 for( int j = 0; j < p; ++j )\n- 94 {\n- 95 ret[ i ][ j ] = ctype( 0 );\n- 96 for( int k = 0; k < m; ++k )\n- 97 ret[ i ][ j ] += A[ k ][ i ] * B[ j ][ k ];\n- 98 }\n- 99 }\n+ 91 implementations_[ topologyId ].initialize( topologyId );\n+ 92 reference_elements_[ topologyId ].setImplementation( implementations_\n+[ topologyId ] );\n+ 93 }\n+ 94 }\n+ 95\n+ 96 const ReferenceElement& operator() ( const GeometryType &type ) const\n+ 97 {\n+ 98 assert( type.dim() == dim );\n+ 99 return reference_elements_[ type.id() ];\n 100 }\n 101\n- 102 template< int m, int n >\n- 103 static void ATA_L ( const FieldMatrix< ctype, m, n > &A, FieldMatrix<\n-ctype, n, n > &ret )\n- 104 {\n- 105 for( int i = 0; i < n; ++i )\n- 106 {\n- 107 for( int j = 0; j <= i; ++j )\n+ 102 const ReferenceElement& simplex () const\n+ 103 {\n+ 104 return reference_elements_[ Dune::GeometryTypes::simplex(dim).id() ];\n+ 105 }\n+ 106\n+ 107 const ReferenceElement& cube () const\n 108 {\n- 109 ret[ i ][ j ] = ctype( 0 );\n- 110 for( int k = 0; k < m; ++k )\n- 111 ret[ i ][ j ] += A[ k ][ i ] * A[ k ][ j ];\n- 112 }\n- 113 }\n- 114 }\n- 115\n- 116 template< int m, int n >\n- 117 static void ATA ( const FieldMatrix< ctype, m, n > &A, FieldMatrix< ctype,\n-n, n > &ret )\n+ 109 return reference_elements_[ Dune::GeometryTypes::cube(dim).id() ];\n+ 110 }\n+ 111\n+ 112 const ReferenceElement& pyramid () const\n+ 113 {\n+ 114 return reference_elements_[ Dune::GeometryTypes::pyramid.id() ];\n+ 115 }\n+ 116\n+ 117 const ReferenceElement& prism () const\n 118 {\n- 119 for( int i = 0; i < n; ++i )\n- 120 {\n- 121 for( int j = 0; j <= i; ++j )\n- 122 {\n- 123 ret[ i ][ j ] = ctype( 0 );\n- 124 for( int k = 0; k < m; ++k )\n- 125 ret[ i ][ j ] += A[ k ][ i ] * A[ k ][ j ];\n- 126 ret[ j ][ i ] = ret[ i ][ j ];\n- 127 }\n- 128\n- 129 ret[ i ][ i ] = ctype( 0 );\n- 130 for( int k = 0; k < m; ++k )\n- 131 ret[ i ][ i ] += A[ k ][ i ] * A[ k ][ i ];\n- 132 }\n- 133 }\n- 134\n- 135 template< int m, int n >\n- 136 static void AAT_L ( const FieldMatrix< ctype, m, n > &A, FieldMatrix<\n-ctype, m, m > &ret )\n+ 119 return reference_elements_[ Dune::GeometryTypes::prism.id() ];\n+ 120 }\n+ 121\n+ 122 const_iterator begin () const\n+ 123 {\n+ 124 return reference_elements_.data();\n+ 125 }\n+ 126\n+ 127 const_iterator end () const\n+ 128 {\n+ 129 return reference_elements_.data() + numTopologies;\n+ 130 }\n+ 131\n+ 132 // here, we make sure to actually return a const reference to something\n+ 133 // that is guaranteed not to become invalid, as otherwise, we might run\n+ 134 // straight into debugging hell when a user binds the return value to a\n+ 135 // const ref and the temporary goes out of scope.\n+ 136 const DeprecatedReferenceElement& deprecated(const ReferenceElement& v)\n+const\n 137 {\n- 138 /*\n- 139 if (m==2) {\n- 140 ret[0][0] = A[0]*A[0];\n- 141 ret[1][1] = A[1]*A[1];\n- 142 ret[1][0] = A[0]*A[1];\n- 143 }\n- 144 else\n- 145 */\n- 146 for( int i = 0; i < m; ++i )\n- 147 {\n- 148 for( int j = 0; j <= i; ++j )\n- 149 {\n- 150 ctype &retij = ret[ i ][ j ];\n- 151 retij = A[ i ][ 0 ] * A[ j ][ 0 ];\n- 152 for( int k = 1; k < n; ++k )\n- 153 retij += A[ i ][ k ] * A[ j ][ k ];\n- 154 }\n- 155 }\n- 156 }\n+ 138 return reference_elements_[v.impl().type(0,0).id()];\n+ 139 }\n+ 140\n+ 141 private:\n+ 142\n+ 143 std::array implementations_;\n+ 144 std::array\n+reference_elements_;\n+ 145\n+ 146 };\n+ 147\n+ 148\n+ 149 } // namespace Impl\n+ 150\n+ 151\n+ 152#endif // DOXYGEN\n+ 153\n+ 154\n+ 155 // ReferenceElements\n+ 156 // ------------------------\n 157\n- 158 template< int m, int n >\n- 159 static void AAT ( const FieldMatrix< ctype, m, n > &A, FieldMatrix< ctype,\n-m, m > &ret )\n- 160 {\n- 161 for( int i = 0; i < m; ++i )\n- 162 {\n- 163 for( int j = 0; j < i; ++j )\n- 164 {\n- 165 ret[ i ][ j ] = ctype( 0 );\n- 166 for( int k = 0; k < n; ++k )\n- 167 ret[ i ][ j ] += A[ i ][ k ] * A[ j ][ k ];\n- 168 ret[ j ][ i ] = ret[ i ][ j ];\n- 169 }\n- 170 ret[ i ][ i ] = ctype( 0 );\n- 171 for( int k = 0; k < n; ++k )\n- 172 ret[ i ][ i ] += A[ i ][ k ] * A[ i ][ k ];\n- 173 }\n- 174 }\n- 175\n- 176 template< int n >\n- 177 static void Lx ( const FieldMatrix< ctype, n, n > &L, const FieldVector<\n-ctype, n > &x, FieldVector< ctype, n > &ret )\n- 178 {\n- 179 for( int i = 0; i < n; ++i )\n- 180 {\n- 181 ret[ i ] = ctype( 0 );\n- 182 for( int j = 0; j <= i; ++j )\n- 183 ret[ i ] += L[ i ][ j ] * x[ j ];\n- 184 }\n- 185 }\n+ 168 template< class ctype_, int dim >\n+169 struct ReferenceElements\n+ 170 {\n+ 171\n+173 using ctype = ctype_;\n+ 174\n+176 using CoordinateField = ctype;\n+ 177\n+179 static constexpr int dimension = dim;\n+ 180\n+ 181 private:\n+ 182\n+ 183 using Container = Impl::ReferenceElementContainer< ctype, dim >;\n+ 184\n+ 185 public:\n 186\n- 187 template< int n >\n- 188 static void LTx ( const FieldMatrix< ctype, n, n > &L, const FieldVector<\n-ctype, n > &x, FieldVector< ctype, n > &ret )\n- 189 {\n- 190 for( int i = 0; i < n; ++i )\n- 191 {\n- 192 ret[ i ] = ctype( 0 );\n- 193 for( int j = i; j < n; ++j )\n- 194 ret[ i ] += L[ j ][ i ] * x[ j ];\n- 195 }\n- 196 }\n- 197\n- 198 template< int n >\n- 199 static void LTL ( const FieldMatrix< ctype, n, n > &L, FieldMatrix< ctype,\n-n, n > &ret )\n- 200 {\n- 201 for( int i = 0; i < n; ++i )\n- 202 {\n- 203 for( int j = 0; j < i; ++j )\n- 204 {\n- 205 ret[ i ][ j ] = ctype( 0 );\n- 206 for( int k = i; k < n; ++k )\n- 207 ret[ i ][ j ] += L[ k ][ i ] * L[ k ][ j ];\n- 208 ret[ j ][ i ] = ret[ i ][ j ];\n- 209 }\n- 210 ret[ i ][ i ] = ctype( 0 );\n- 211 for( int k = i; k < n; ++k )\n- 212 ret[ i ][ i ] += L[ k ][ i ] * L[ k ][ i ];\n+188 using ReferenceElement = typename Container::ReferenceElement;\n+ 189\n+191 using Iterator = typename Container::const_iterator;\n+ 192\n+194 using iterator = Iterator;\n+ 195\n+ 197 static const ReferenceElement&\n+198 general ( const GeometryType& type )\n+ 199 {\n+ 200 return container() ( type );\n+ 201 }\n+ 202\n+204 static const ReferenceElement& simplex ()\n+ 205 {\n+ 206 return container().simplex();\n+ 207 }\n+ 208\n+210 static const ReferenceElement& cube ()\n+ 211 {\n+ 212 return container().cube();\n 213 }\n- 214 }\n- 215\n- 216 template< int n >\n- 217 static void LLT ( const FieldMatrix< ctype, n, n > &L, FieldMatrix< ctype,\n-n, n > &ret )\n- 218 {\n- 219 for( int i = 0; i < n; ++i )\n- 220 {\n- 221 for( int j = 0; j < i; ++j )\n- 222 {\n- 223 ret[ i ][ j ] = ctype( 0 );\n- 224 for( int k = 0; k <= j; ++k )\n- 225 ret[ i ][ j ] += L[ i ][ k ] * L[ j ][ k ];\n- 226 ret[ j ][ i ] = ret[ i ][ j ];\n- 227 }\n- 228 ret[ i ][ i ] = ctype( 0 );\n- 229 for( int k = 0; k <= i; ++k )\n- 230 ret[ i ][ i ] += L[ i ][ k ] * L[ i ][ k ];\n- 231 }\n- 232 }\n- 233\n- 234 template< int n >\n- 235 static bool cholesky_L ( const FieldMatrix< ctype, n, n > &A, FieldMatrix<\n-ctype, n, n > &ret, const bool checkSingular = false )\n+ 214\n+215 static Iterator begin ()\n+ 216 {\n+ 217 return container().begin();\n+ 218 }\n+ 219\n+220 static Iterator end ()\n+ 221 {\n+ 222 return container().end();\n+ 223 }\n+ 224\n+ 225#ifndef DOXYGEN\n+ 226 static const typename Container::DeprecatedReferenceElement&\n+ 227 deprecated(const ReferenceElement& v)\n+ 228 {\n+ 229 return container().deprecated(v);\n+ 230 }\n+ 231#endif // DOXYGEN\n+ 232\n+ 233 private:\n+ 234\n+ 235 DUNE_EXPORT static const Container& container ()\n 236 {\n- 237 using std::sqrt;\n- 238 for( int i = 0; i < n; ++i )\n- 239 {\n- 240 ctype &rii = ret[ i ][ i ];\n+ 237 static Container container;\n+ 238 return container;\n+ 239 }\n+ 240 };\n 241\n- 242 ctype xDiag = A[ i ][ i ];\n- 243 for( int j = 0; j < i; ++j )\n- 244 xDiag -= ret[ i ][ j ] * ret[ i ][ j ];\n- 245\n- 246 // in some cases A can be singular, e.g. when checking local for\n- 247 // outside points during checkInside\n- 248 if( checkSingular && ! ( xDiag > ctype( 0 )) )\n- 249 return false ;\n- 250\n- 251 // otherwise this should be true always\n- 252 assert( xDiag > ctype( 0 ) );\n- 253 rii = sqrt( xDiag );\n- 254\n- 255 ctype invrii = ctype( 1 ) / rii;\n- 256 for( int k = i+1; k < n; ++k )\n- 257 {\n- 258 ctype x = A[ k ][ i ];\n- 259 for( int j = 0; j < i; ++j )\n- 260 x -= ret[ i ][ j ] * ret[ k ][ j ];\n- 261 ret[ k ][ i ] = invrii * x;\n- 262 }\n- 263 }\n- 264\n- 265 // return true for meaning A is non-singular\n- 266 return true;\n- 267 }\n- 268\n- 269 template< int n >\n- 270 static ctype detL ( const FieldMatrix< ctype, n, n > &L )\n- 271 {\n- 272 ctype det( 1 );\n- 273 for( int i = 0; i < n; ++i )\n- 274 det *= L[ i ][ i ];\n- 275 return det;\n- 276 }\n- 277\n- 278 template< int n >\n- 279 static ctype invL ( FieldMatrix< ctype, n, n > &L )\n- 280 {\n- 281 ctype det( 1 );\n- 282 for( int i = 0; i < n; ++i )\n- 283 {\n- 284 ctype &lii = L[ i ][ i ];\n- 285 det *= lii;\n- 286 lii = ctype( 1 ) / lii;\n- 287 for( int j = 0; j < i; ++j )\n- 288 {\n- 289 ctype &lij = L[ i ][ j ];\n- 290 ctype x = lij * L[ j ][ j ];\n- 291 for( int k = j+1; k < i; ++k )\n- 292 x += L[ i ][ k ] * L[ k ][ j ];\n- 293 lij = (-lii) * x;\n- 294 }\n- 295 }\n- 296 return det;\n- 297 }\n+ 242 } // namespace Geo\n+ 243\n+ 245 using Geo::ReferenceElements;\n+ 246\n+ 247\n+ 248#ifdef DOXYGEN\n+ 249\n+ 251\n+ 294 template\n+295 unspecified-value-type referenceElement(T&&... t);\n+ 296\n+ 297#endif\n 298\n- 299 // calculates x := L^{-1} x\n- 300 template< int n >\n- 301 static void invLx ( FieldMatrix< ctype, n, n > &L, FieldVector< ctype, n >\n-&x )\n- 302 {\n- 303 for( int i = 0; i < n; ++i )\n- 304 {\n- 305 for( int j = 0; j < i; ++j )\n- 306 x[ i ] -= L[ i ][ j ] * x[ j ];\n- 307 x[ i ] /= L[ i ][ i ];\n- 308 }\n- 309 }\n- 310\n- 311 // calculates x := L^{-T} x\n- 312 template< int n >\n- 313 static void invLTx ( FieldMatrix< ctype, n, n > &L, FieldVector< ctype, n\n-> &x )\n- 314 {\n- 315 for( int i = n; i > 0; --i )\n+ 299\n+ 301\n+ 314 template\n+315 auto referenceElement(const Dune::GeometryType& gt, Dune::Dim = {})\n 316 {\n- 317 for( int j = i; j < n; ++j )\n- 318 x[ i-1 ] -= L[ j ][ i-1 ] * x[ j ];\n- 319 x[ i-1 ] /= L[ i-1 ][ i-1 ];\n- 320 }\n- 321 }\n+ 317 return ReferenceElements::general(gt);\n+ 318 }\n+ 319\n+ 320\n 322\n- 323 template< int n >\n- 324 static ctype spdDetA ( const FieldMatrix< ctype, n, n > &A )\n- 325 {\n- 326 // return A[0][0]*A[1][1]-A[1][0]*A[1][0];\n- 327 FieldMatrix< ctype, n, n > L;\n- 328 cholesky_L( A, L );\n- 329 return detL( L );\n- 330 }\n- 331\n- 332 template< int n >\n- 333 static ctype spdInvA ( FieldMatrix< ctype, n, n > &A )\n- 334 {\n- 335 FieldMatrix< ctype, n, n > L;\n- 336 cholesky_L( A, L );\n- 337 const ctype det = invL( L );\n- 338 LTL( L, A );\n- 339 return det;\n- 340 }\n- 341\n- 342 // calculate x := A^{-1} x\n- 343 template< int n >\n- 344 static bool spdInvAx ( FieldMatrix< ctype, n, n > &A, FieldVector< ctype,\n-n > &x, const bool checkSingular = false )\n- 345 {\n- 346 FieldMatrix< ctype, n, n > L;\n- 347 const bool invertible = cholesky_L( A, L, checkSingular );\n- 348 if( ! invertible ) return invertible ;\n- 349 invLx( L, x );\n- 350 invLTx( L, x );\n- 351 return invertible;\n- 352 }\n- 353\n- 354 template< int m, int n >\n- 355 static ctype detATA ( const FieldMatrix< ctype, m, n > &A )\n- 356 {\n- 357 if( m >= n )\n- 358 {\n- 359 FieldMatrix< ctype, n, n > ata;\n- 360 ATA_L( A, ata );\n- 361 return spdDetA( ata );\n+ 334 template>::\n+value, int> = 0>\n+335 auto referenceElement(const T&, const Dune::GeometryType& gt, Dune::\n+Dim)\n+ 336 {\n+ 337 return ReferenceElements::general(gt);\n+ 338 }\n+ 339\n+ 340\n+ 341#ifndef DOXYGEN\n+ 342\n+ 343 // helpers for the ReferenceElement<> meta function\n+ 344\n+ 345 namespace Impl {\n+ 346\n+ 347 // Evaluates to the correct reference element iff matches the\n+pattern >\n+ 348 // otherwise, it's ill-formed. Should be used with detected_or and\n+friends.\n+ 349\n+ 350 template\n+ 351 struct DefaultReferenceElementExtractor;\n+ 352\n+ 353 template::value,int>::type\n+dim>\n+ 354 struct DefaultReferenceElementExtractor>\n+ 355 {\n+ 356 using type = typename Dune::Geo::ReferenceElements::\n+ReferenceElement;\n+ 357 };\n+ 358\n+ 359 template\n+ 360 using DefaultReferenceElement = typename\n+DefaultReferenceElementExtractor::type;\n+ 361\n 362 }\n- 363 else\n- 364 return ctype( 0 );\n- 365 }\n- 366\n- 372 template< int m, int n >\n- 373 static ctype sqrtDetAAT ( const FieldMatrix< ctype, m, n > &A )\n- 374 {\n- 375 using std::abs;\n- 376 using std::sqrt;\n- 377 // These special cases are here not only for speed reasons:\n- 378 // The general implementation aborts if the matrix is almost singular,\n- 379 // and the special implementation provide a stable way to handle that\n-case.\n- 380 if( (n == 2) && (m == 2) )\n- 381 {\n- 382 // Special implementation for 2x2 matrices: faster and more stable\n- 383 return abs( A[ 0 ][ 0 ]*A[ 1 ][ 1 ] - A[ 1 ][ 0 ]*A[ 0 ][ 1 ] );\n- 384 }\n- 385 else if( (n == 3) && (m == 3) )\n- 386 {\n- 387 // Special implementation for 3x3 matrices\n- 388 const ctype v0 = A[ 0 ][ 1 ] * A[ 1 ][ 2 ] - A[ 1 ][ 1 ] * A[ 0 ][ 2 ];\n- 389 const ctype v1 = A[ 0 ][ 2 ] * A[ 1 ][ 0 ] - A[ 1 ][ 2 ] * A[ 0 ][ 0 ];\n- 390 const ctype v2 = A[ 0 ][ 0 ] * A[ 1 ][ 1 ] - A[ 1 ][ 0 ] * A[ 0 ][ 1 ];\n- 391 return abs( v0 * A[ 2 ][ 0 ] + v1 * A[ 2 ][ 1 ] + v2 * A[ 2 ][ 2 ] );\n- 392 }\n- 393 else if ( (n == 3) && (m == 2) )\n- 394 {\n- 395 // Special implementation for 2x3 matrices\n- 396 const ctype v0 = A[ 0 ][ 0 ] * A[ 1 ][ 1 ] - A[ 0 ][ 1 ] * A[ 1 ][ 0 ];\n- 397 const ctype v1 = A[ 0 ][ 0 ] * A[ 1 ][ 2 ] - A[ 1 ][ 0 ] * A[ 0 ][ 2 ];\n- 398 const ctype v2 = A[ 0 ][ 1 ] * A[ 1 ][ 2 ] - A[ 0 ][ 2 ] * A[ 1 ][ 1 ];\n- 399 return sqrt( v0*v0 + v1*v1 + v2*v2);\n- 400 }\n- 401 else if( n >= m )\n- 402 {\n- 403 // General case\n- 404 FieldMatrix< ctype, m, m > aat;\n- 405 AAT_L( A, aat );\n- 406 return spdDetA( aat );\n- 407 }\n- 408 else\n- 409 return ctype( 0 );\n- 410 }\n- 411\n- 412 // A^{-1}_L = (A^T A)^{-1} A^T\n- 413 // => A^{-1}_L A = I\n- 414 template< int m, int n >\n- 415 static ctype leftInvA ( const FieldMatrix< ctype, m, n > &A, FieldMatrix<\n-ctype, n, m > &ret )\n- 416 {\n- 417 static_assert((m >= n), \"Matrix has no left inverse.\");\n- 418 FieldMatrix< ctype, n, n > ata;\n- 419 ATA_L( A, ata );\n- 420 const ctype det = spdInvA( ata );\n- 421 ATBT( ata, A, ret );\n- 422 return det;\n- 423 }\n+ 363\n+ 364 // looks up the type of a reference element by trying to instantiate the\n+correct overload\n+ 365 // of referenceElement() for the given arguments. This will fail if there\n+is no valid\n+ 366 // overload and should be used with detected_or or some other utility that\n+places the\n+ 367 // instantiation in SFINAE context.\n+ 368 //\n+ 369 // this is placed directly in namespace Dune to avoid any weird surprises\n+ 370\n+ 371 template\n+ 372 using LookupReferenceElement = decltype(referenceElement(std::declval\n+()...));\n+ 373\n+ 374#endif // DOXYGEN\n+ 375\n+376 namespace Transitional {\n+ 377\n+ 378#ifndef DOXYGEN\n+ 379\n+ 380 // this abomination checks whether the template signature matches the\n+special case\n+ 381 // ReferenceElement> and otherwise defers the\n+type lookup\n+ 382 // to a decltype on a call to referenceElement(std::declval())\n+ 383\n+ 384 template\n+ 385 using ReferenceElement = Std::detected_or_t<\n+ 386 Std::detected_t,\n+ 387 Impl::DefaultReferenceElement,\n+ 388 T...\n+ 389 >;\n+ 390\n+ 391#else // DOXYGEN\n+ 392\n+ 394\n+ 416 template\n+ 417 using ReferenceElement = unspecified-type;\n+ 418\n+ 419#endif //DOXYGEN\n+ 420\n+ 421 }\n+ 422\n+ 423#ifndef DOXYGEN\n 424\n- 425 template< int m, int n >\n- 426 static void leftInvAx ( const FieldMatrix< ctype, m, n > &A, const\n-FieldVector< ctype, m > &x, FieldVector< ctype, n > &y )\n- 427 {\n- 428 static_assert((m >= n), \"Matrix has no left inverse.\");\n- 429 FieldMatrix< ctype, n, n > ata;\n- 430 ATx( A, x, y );\n- 431 ATA_L( A, ata );\n- 432 spdInvAx( ata, y );\n- 433 }\n- 434\n- 436 template< int m, int n >\n- 437 static ctype rightInvA ( const FieldMatrix< ctype, m, n > &A, FieldMatrix<\n-ctype, n, m > &ret )\n- 438 {\n- 439 static_assert((n >= m), \"Matrix has no right inverse.\");\n- 440 using std::abs;\n- 441 if( (n == 2) && (m == 2) )\n+ 425 namespace Impl {\n+ 426\n+ 427 // helpers for triggering a deprecation warning for occurrences of the old\n+ 428 // ReferenceElement syntax (Dune::ReferenceElement)\n+ 429\n+ 430 // this looks a little weird, encoding the type in the return type of a\n+nested function,\n+ 431 // but it was the only reliable way to trigger the warning iff the\n+compiler encounters\n+ 432 // an invalid use. Other solutions either miss some (or all) uses or\n+trigger false alarms.\n+ 433\n+ 434 template\n+ 435 struct ValidReferenceElementTypeSignature\n+ 436 {\n+ 437 Transitional::ReferenceElement check();\n+ 438 };\n+ 439\n+ 440 template\n+ 441 struct DeprecatedReferenceElementTypeSignature\n 442 {\n- 443 const ctype det = (A[ 0 ][ 0 ]*A[ 1 ][ 1 ] - A[ 1 ][ 0 ]*A[ 0 ][ 1 ]);\n- 444 const ctype detInv = ctype( 1 ) / det;\n- 445 ret[ 0 ][ 0 ] = A[ 1 ][ 1 ] * detInv;\n- 446 ret[ 1 ][ 1 ] = A[ 0 ][ 0 ] * detInv;\n- 447 ret[ 1 ][ 0 ] = -A[ 1 ][ 0 ] * detInv;\n- 448 ret[ 0 ][ 1 ] = -A[ 0 ][ 1 ] * detInv;\n- 449 return abs( det );\n- 450 }\n- 451 else\n- 452 {\n- 453 FieldMatrix< ctype, m , m > aat;\n- 454 AAT_L( A, aat );\n- 455 const ctype det = spdInvA( aat );\n- 456 ATBT( A , aat , ret );\n- 457 return det;\n- 458 }\n- 459 }\n+ 443 [[deprecated(\"Dune::ReferenceElement is deprecated, please use\n+Dune::ReferenceElement (if you have a geometry), Dune::\n+ReferenceElements::ReferenceElement or Dune::Transitional::\n+ReferenceElement> instead. After Dune 2.6, you will be able to\n+use Dune::ReferenceElement>.\")]] T check();\n+ 444 };\n+ 445\n+ 446 } // namespace Impl\n+ 447\n+ 448 // This just makes sure the user doesn't use invalid syntax (by checking\n+against the -1 default for\n+ 449 // the dimension, and then either hands back the old-style type along with\n+a deprecation warning or\n+ 450 // forwards to the transitional version\n+ 451 template\n+ 452 using ReferenceElement = decltype(\n+ 453 std::declval<\n+ 454 typename std::conditional<\n+ 455 dim == -1,\n+ 456 Impl::ValidReferenceElementTypeSignature,\n+ 457 Impl::DeprecatedReferenceElementTypeSignature>\n+ 458 >::type\n+ 459 >().check());\n 460\n- 461 template< int m, int n >\n- 462 static bool xTRightInvA ( const FieldMatrix< ctype, m, n > &A, const\n-FieldVector< ctype, n > &x, FieldVector< ctype, m > &y )\n- 463 {\n- 464 static_assert((n >= m), \"Matrix has no right inverse.\");\n- 465 FieldMatrix< ctype, m, m > aat;\n- 466 Ax( A, x, y );\n- 467 AAT_L( A, aat );\n- 468 // check whether aat is singular and return true if non-singular\n- 469 return spdInvAx( aat, y, true );\n- 470 }\n- 471 };\n- 472\n- 473 } // namespace Impl\n- 474\n- 475\n- 476\n- 482 template< class ct, int mydim, int cdim>\n-483 class AffineGeometry\n- 484 {\n- 485 public:\n- 486\n-488 typedef ct ctype;\n- 489\n-491 static const int mydimension= mydim;\n- 492\n-494 static const int coorddimension = cdim;\n- 495\n-497 typedef FieldVector< ctype, mydimension > LocalCoordinate;\n+ 461#else // DOXYGEN\n+ 462\n+ 464\n+ 496 template\n+497 using ReferenceElement = unspecified-type;\n 498\n-500 typedef FieldVector< ctype, coorddimension > GlobalCoordinate;\n+ 499#endif // DOXYGEN\n+ 500\n 501\n-503 typedef ctype Volume;\n+ 502\n+ 503} // namespace Dune\n 504\n-506 typedef FieldMatrix< ctype, mydimension, coorddimension >\n-JacobianTransposed;\n- 507\n-509 typedef FieldMatrix< ctype, coorddimension, mydimension >\n-JacobianInverseTransposed;\n- 510\n-512 typedef FieldMatrix< ctype, coorddimension, mydimension > Jacobian;\n- 513\n-515 typedef FieldMatrix< ctype, mydimension, coorddimension > JacobianInverse;\n- 516\n- 517 private:\n- 519 typedef Geo::ReferenceElement<_Geo::ReferenceElementImplementation<_ctype,\n-mydimension_> > ReferenceElement;\n- 520\n- 521 typedef Geo::ReferenceElements<_ctype,_mydimension_> ReferenceElements;\n- 522\n- 523 // Helper class to compute a matrix pseudo inverse\n- 524 typedef Impl::FieldMatrixHelper< ct > MatrixHelper;\n- 525\n- 526 public:\n-528 AffineGeometry ( const ReferenceElement &refElement, const GlobalCoordinate\n-&origin,\n- 529 const JacobianTransposed &jt )\n- 530 : refElement_(refElement), origin_(origin), jacobianTransposed_(jt)\n- 531 {\n- 532 integrationElement_ = MatrixHelper::template rightInvA< mydimension,\n-coorddimension >( jacobianTransposed_, jacobianInverseTransposed_ );\n- 533 }\n- 534\n-536 AffineGeometry ( Dune::GeometryType gt, const GlobalCoordinate &origin,\n- 537 const JacobianTransposed &jt )\n- 538 : AffineGeometry(ReferenceElements::general( gt ), origin, jt)\n- 539 { }\n- 540\n- 542 template< class CoordVector >\n-543 AffineGeometry ( const ReferenceElement &refElement, const CoordVector\n-&coordVector )\n- 544 : refElement_(refElement), origin_(coordVector[0])\n- 545 {\n- 546 for( int i = 0; i < mydimension; ++i )\n- 547 jacobianTransposed_[ i ] = coordVector[ i+1 ] - origin_;\n- 548 integrationElement_ = MatrixHelper::template rightInvA< mydimension,\n-coorddimension >( jacobianTransposed_, jacobianInverseTransposed_ );\n- 549 }\n- 550\n- 552 template< class CoordVector >\n-553 AffineGeometry ( Dune::GeometryType gt, const CoordVector &coordVector )\n- 554 : AffineGeometry(ReferenceElements::general( gt ), coordVector)\n- 555 { }\n- 556\n-558 bool affine () const { return true; }\n- 559\n-561 Dune::GeometryType type () const { return refElement_.type(); }\n- 562\n-564 int corners () const { return refElement_.size( mydimension ); }\n- 565\n-567 GlobalCoordinate corner ( int i ) const\n- 568 {\n- 569 return global( refElement_.position( i, mydimension ) );\n- 570 }\n- 571\n-573 GlobalCoordinate center () const { return global( refElement_.position( 0,\n-0 ) ); }\n- 574\n-581 GlobalCoordinate global ( const LocalCoordinate &local ) const\n- 582 {\n- 583 GlobalCoordinate global( origin_ );\n- 584 jacobianTransposed_.umtv( local, global );\n- 585 return global;\n- 586 }\n- 587\n-601 LocalCoordinate local ( const GlobalCoordinate &global ) const\n- 602 {\n- 603 LocalCoordinate local;\n- 604 jacobianInverseTransposed_.mtv( global - origin_, local );\n- 605 return local;\n- 606 }\n- 607\n-618 ctype integrationElement ([[maybe_unused]] const LocalCoordinate &local)\n-const\n- 619 {\n- 620 return integrationElement_;\n- 621 }\n- 622\n-624 Volume volume () const\n- 625 {\n- 626 return integrationElement_ * refElement_.volume();\n- 627 }\n- 628\n-635 const JacobianTransposed &jacobianTransposed ([[maybe_unused]] const\n-LocalCoordinate &local) const\n- 636 {\n- 637 return jacobianTransposed_;\n- 638 }\n- 639\n-646 const JacobianInverseTransposed &jacobianInverseTransposed ([\n-[maybe_unused]] const LocalCoordinate &local) const\n- 647 {\n- 648 return jacobianInverseTransposed_;\n- 649 }\n- 650\n-657 Jacobian jacobian ([[maybe_unused]] const LocalCoordinate &local) const\n- 658 {\n- 659 return jacobianTransposed_.transposed();\n- 660 }\n- 661\n-668 JacobianInverse jacobianInverse ([[maybe_unused]] const LocalCoordinate\n-&local) const\n- 669 {\n- 670 return jacobianInverseTransposed_.transposed();\n- 671 }\n- 672\n-673 friend ReferenceElement referenceElement ( const AffineGeometry &geometry )\n- 674 {\n- 675 return geometry.refElement_;\n- 676 }\n- 677\n- 678 private:\n- 679 ReferenceElement refElement_;\n- 680 GlobalCoordinate origin_;\n- 681 JacobianTransposed jacobianTransposed_;\n- 682 JacobianInverseTransposed jacobianInverseTransposed_;\n- 683 ctype integrationElement_;\n- 684 };\n- 685\n- 686} // namespace Dune\n- 687\n- 688#endif // #ifndef DUNE_GEOMETRY_AFFINEGEOMETRY_HH\n+ 505#endif // #ifndef DUNE_GEOMETRY_REFERENCEELEMENTS_HH\n+referenceelementimplementation.hh\n+dimension.hh\n type.hh\n A unique label for each type of element that can occur in a grid.\n+referenceelement.hh\n+Dune::referenceElement\n+unspecified value type referenceElement(T &&... t)\n+Returns a reference element for the objects t....\n Dune::ReferenceElement\n unspecified-type ReferenceElement\n Returns the type of reference element for the argument type T.\n Definition referenceelements.hh:497\n Dune\n Definition affinegeometry.hh:21\n Dune::Geo::ReferenceElement\n This class provides access to geometric and topological properties of a\n reference element.\n Definition referenceelement.hh:52\n-Dune::Geo::ReferenceElement::volume\n-CoordinateField volume() const\n-obtain the volume of the reference element\n-Definition referenceelement.hh:241\n-Dune::Geo::ReferenceElement::type\n-decltype(auto) type(int i, int c) const\n-obtain the type of subentity (i,c)\n-Definition referenceelement.hh:171\n-Dune::Geo::ReferenceElement::size\n-int size(int c) const\n-number of subentities of codimension c\n-Definition referenceelement.hh:94\n-Dune::Geo::ReferenceElement::position\n-decltype(auto) position(int i, int c) const\n-position of the barycenter of entity (i,c)\n-Definition referenceelement.hh:203\n-Dune::Geo::ReferenceElementImplementation\n-Definition affinegeometry.hh:33\n Dune::Geo::ReferenceElements\n Class providing access to the singletons of the reference elements.\n Definition referenceelements.hh:170\n-Dune::AffineGeometry\n-Implementation of the Geometry interface for affine geometries.\n-Definition affinegeometry.hh:484\n-Dune::AffineGeometry::AffineGeometry\n-AffineGeometry(const ReferenceElement &refElement, const CoordVector\n-&coordVector)\n-Create affine geometry from reference element and a vector of vertex\n-coordinates.\n-Definition affinegeometry.hh:543\n-Dune::AffineGeometry::AffineGeometry\n-AffineGeometry(Dune::GeometryType gt, const GlobalCoordinate &origin, const\n-JacobianTransposed &jt)\n-Create affine geometry from GeometryType, one vertex, and the Jacobian matrix.\n-Definition affinegeometry.hh:536\n-Dune::AffineGeometry::LocalCoordinate\n-FieldVector< ctype, mydimension > LocalCoordinate\n-Type for local coordinate vector.\n-Definition affinegeometry.hh:497\n-Dune::AffineGeometry::type\n-Dune::GeometryType type() const\n-Obtain the type of the reference element.\n-Definition affinegeometry.hh:561\n-Dune::AffineGeometry::mydimension\n-static const int mydimension\n-Dimension of the geometry.\n-Definition affinegeometry.hh:491\n-Dune::AffineGeometry::AffineGeometry\n-AffineGeometry(const ReferenceElement &refElement, const GlobalCoordinate\n-&origin, const JacobianTransposed &jt)\n-Create affine geometry from reference element, one vertex, and the Jacobian\n-matrix.\n-Definition affinegeometry.hh:528\n-Dune::AffineGeometry::Volume\n-ctype Volume\n-Type used for volume.\n-Definition affinegeometry.hh:503\n-Dune::AffineGeometry::jacobianInverse\n-JacobianInverse jacobianInverse(const LocalCoordinate &local) const\n-Obtain the Jacobian's inverse.\n-Definition affinegeometry.hh:668\n-Dune::AffineGeometry::referenceElement\n-friend ReferenceElement referenceElement(const AffineGeometry &geometry)\n-Definition affinegeometry.hh:673\n-Dune::AffineGeometry::AffineGeometry\n-AffineGeometry(Dune::GeometryType gt, const CoordVector &coordVector)\n-Create affine geometry from GeometryType and a vector of vertex coordinates.\n-Definition affinegeometry.hh:553\n-Dune::AffineGeometry::integrationElement\n-ctype integrationElement(const LocalCoordinate &local) const\n-Obtain the integration element.\n-Definition affinegeometry.hh:618\n-Dune::AffineGeometry::JacobianInverse\n-FieldMatrix< ctype, mydimension, coorddimension > JacobianInverse\n-Type for the inverse Jacobian matrix.\n-Definition affinegeometry.hh:515\n-Dune::AffineGeometry::Jacobian\n-FieldMatrix< ctype, coorddimension, mydimension > Jacobian\n-Type for the Jacobian matrix.\n-Definition affinegeometry.hh:512\n-Dune::AffineGeometry::jacobianInverseTransposed\n-const JacobianInverseTransposed & jacobianInverseTransposed(const\n-LocalCoordinate &local) const\n-Obtain the transposed of the Jacobian's inverse.\n-Definition affinegeometry.hh:646\n-Dune::AffineGeometry::JacobianTransposed\n-FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed\n-Type for the transposed Jacobian matrix.\n-Definition affinegeometry.hh:506\n-Dune::AffineGeometry::corner\n-GlobalCoordinate corner(int i) const\n-Obtain coordinates of the i-th corner.\n-Definition affinegeometry.hh:567\n-Dune::AffineGeometry::corners\n-int corners() const\n-Obtain number of corners of the corresponding reference element.\n-Definition affinegeometry.hh:564\n-Dune::AffineGeometry::local\n-LocalCoordinate local(const GlobalCoordinate &global) const\n-Evaluate the inverse mapping.\n-Definition affinegeometry.hh:601\n-Dune::AffineGeometry::JacobianInverseTransposed\n-FieldMatrix< ctype, coorddimension, mydimension > JacobianInverseTransposed\n-Type for the transposed inverse Jacobian matrix.\n-Definition affinegeometry.hh:509\n-Dune::AffineGeometry::coorddimension\n-static const int coorddimension\n-Dimension of the world space.\n-Definition affinegeometry.hh:494\n-Dune::AffineGeometry::global\n-GlobalCoordinate global(const LocalCoordinate &local) const\n-Evaluate the mapping.\n-Definition affinegeometry.hh:581\n-Dune::AffineGeometry::center\n-GlobalCoordinate center() const\n-Obtain the centroid of the mapping's image.\n-Definition affinegeometry.hh:573\n-Dune::AffineGeometry::jacobian\n-Jacobian jacobian(const LocalCoordinate &local) const\n-Obtain the Jacobian.\n-Definition affinegeometry.hh:657\n-Dune::AffineGeometry::ctype\n-ct ctype\n-Type used for coordinates.\n-Definition affinegeometry.hh:488\n-Dune::AffineGeometry::GlobalCoordinate\n-FieldVector< ctype, coorddimension > GlobalCoordinate\n-Type for coordinate vector in world space.\n-Definition affinegeometry.hh:500\n-Dune::AffineGeometry::affine\n-bool affine() const\n-Always true: this is an affine geometry.\n-Definition affinegeometry.hh:558\n-Dune::AffineGeometry::jacobianTransposed\n-const JacobianTransposed & jacobianTransposed(const LocalCoordinate &local)\n-const\n-Obtain the transposed of the Jacobian.\n-Definition affinegeometry.hh:635\n-Dune::AffineGeometry::volume\n-Volume volume() const\n-Obtain the volume of the element.\n-Definition affinegeometry.hh:624\n+Dune::Geo::ReferenceElements::begin\n+static Iterator begin()\n+Definition referenceelements.hh:215\n+Dune::Geo::ReferenceElements::iterator\n+Iterator iterator\n+Iterator over available reference elements.\n+Definition referenceelements.hh:194\n+Dune::Geo::ReferenceElements::ReferenceElement\n+typename Container::ReferenceElement ReferenceElement\n+The reference element type.\n+Definition referenceelements.hh:188\n+Dune::Geo::ReferenceElements::cube\n+static const ReferenceElement & cube()\n+get hypercube reference elements\n+Definition referenceelements.hh:210\n+Dune::Geo::ReferenceElements::end\n+static Iterator end()\n+Definition referenceelements.hh:220\n+Dune::Geo::ReferenceElements::ctype\n+ctype_ ctype\n+The coordinate field type of the contained reference elements.\n+Definition referenceelements.hh:173\n+Dune::Geo::ReferenceElements::general\n+static const ReferenceElement & general(const GeometryType &type)\n+get general reference elements\n+Definition referenceelements.hh:198\n+Dune::Geo::ReferenceElements::simplex\n+static const ReferenceElement & simplex()\n+get simplex reference elements\n+Definition referenceelements.hh:204\n+Dune::Geo::ReferenceElements::Iterator\n+typename Container::const_iterator Iterator\n+Iterator over available reference elements.\n+Definition referenceelements.hh:191\n+Dune::Geo::ReferenceElements::dimension\n+static constexpr int dimension\n+The dimension of the contained reference elements.\n+Definition referenceelements.hh:179\n+Dune::Geo::ReferenceElements::CoordinateField\n+ctype CoordinateField\n+The coordinate field type of the contained reference elements.\n+Definition referenceelements.hh:176\n+Dune::Dim\n+Static tag representing a dimension.\n+Definition dimension.hh:16\n Dune::GeometryType\n Unique label for each type of entities that can occur in DUNE grids.\n Definition type.hh:126\n+Dune::GeometryType::id\n+constexpr unsigned int id() const\n+Return the topology id of the type.\n+Definition type.hh:377\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00206.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00206.html", "unified_diff": "@@ -82,15 +82,15 @@\n
    #include <cassert>
    \n #include <array>
    \n #include <map>
    \n #include <memory>
    \n #include <type_traits>
    \n #include <vector>
    \n #include <dune/geometry/type.hh>
    \n-#include <dune/geometry/typeindex.hh>
    \n+#include <dune/geometry/typeindex.hh>
    \n
    \n

    Go to the source code of this file.

    \n \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00206_source.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00206_source.html", "unified_diff": "@@ -93,15 +93,15 @@\n
    10#include <array>
    \n
    11#include <map>
    \n
    12#include <memory>
    \n
    13#include <type_traits>
    \n
    14#include <vector>
    \n
    15
    \n
    16#include <dune/geometry/type.hh>
    \n-\n+\n
    18
    \n
    19namespace Dune
    \n
    20{
    \n
    21
    \n
    40 template <class Traits>
    \n
    \n \n@@ -234,15 +234,15 @@\n
    164 };
    \n
    \n
    165
    \n
    166}
    \n
    167
    \n
    168#endif // #ifndef DUNE_GEOMETRY_TOPOLOGYFACTORY_HH
    \n
    A unique label for each type of element that can occur in a grid.
    \n-
    Helper classes to provide indices for geometrytypes for use in a vector.
    \n+
    Helper classes to provide indices for geometrytypes for use in a vector.
    \n
    Definition affinegeometry.hh:21
    \n
    Provide a factory over the generic topologies.
    Definition topologyfactory.hh:42
    \n
    Traits::Factory Factory
    Definition topologyfactory.hh:47
    \n
    static Object * create(const Dune::GeometryType &gt, const Key &key)
    dynamically create objects
    Definition topologyfactory.hh:50
    \n
    static const unsigned int dimension
    Definition topologyfactory.hh:44
    \n
    static Object * create(const Key &key)
    statically create objects
    Definition topologyfactory.hh:58
    \n
    static void release(Object *object)
    release the object returned by the create methods
    Definition topologyfactory.hh:71
    \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00209.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00209.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: referenceelementimplementation.hh File Reference\n+dune-geometry: base.cc File Reference\n \n \n \n \n \n \n \n@@ -65,50 +65,87 @@\n \n \n \n \n \n \n \n
    \n \n-
    referenceelementimplementation.hh File Reference
    \n+Classes |\n+Namespaces |\n+Macros |\n+Functions
    \n+
    base.cc File Reference
    \n \n
    \n-
    #include <cassert>
    \n-#include <algorithm>
    \n-#include <limits>
    \n-#include <tuple>
    \n-#include <utility>
    \n-#include <vector>
    \n-#include <array>
    \n-#include <bitset>
    \n-#include <dune/common/fmatrix.hh>
    \n-#include <dune/common/fvector.hh>
    \n-#include <dune/common/hybridutilities.hh>
    \n-#include <dune/common/typetraits.hh>
    \n-#include <dune/common/iteratorrange.hh>
    \n-#include <dune/common/math.hh>
    \n-#include <dune/geometry/referenceelement.hh>
    \n-#include <dune/geometry/affinegeometry.hh>
    \n-#include <dune/geometry/type.hh>
    \n+\n+

    This file contains the parts independent of a particular Refinement implementation. \n+More...

    \n+
    #include <dune/geometry/type.hh>
    \n
    \n

    Go to the source code of this file.

    \n

    \n Classes

    struct  Dune::TopologyFactory< Traits >
     Provide a factory over the generic topologies. More...
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+

    \n+Classes

    struct  Dune::RefinementImp::Traits< topologyId, CoordType, coerceToId, dimension, Dummy >
     Mapping from geometryType, CoordType and coerceTo to a particular Refinement implementation. More...
     
    class  Dune::RefinementIntervals
     Holds the number of refined intervals per axis needed for virtual and static refinement. More...
     
    class  Dune::StaticRefinement< topologyId, CoordType, coerceToId, dimension_ >
     Wrap each Refinement implementation to get a consistent interface. More...
     
    struct  Dune::StaticRefinement< topologyId, CoordType, coerceToId, dimension_ >::Codim< codimension >
     The Codim struct inherited from the Refinement implementation. More...
     
    \n \n \n \n-\n+\n+\n \n+

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Geo
    namespace  Dune::RefinementImp
     This namespace contains the implementation of Refinement.
     
    \n+\n+\n+\n+

    \n+Macros

    #define DUNE_GEOMETRY_REFINEMENT_BASE_CC
     
    \n+\n+\n+\n+\n+\n+\n+\n

    \n+Functions

    RefinementIntervals Dune::refinementIntervals (int intervals)
     Creates a RefinementIntervals object.
     
    RefinementIntervals Dune::refinementLevels (int levels)
     Creates a RefinementIntervals object.
     
    \n+

    Detailed Description

    \n+

    This file contains the parts independent of a particular Refinement implementation.

    \n+

    Macro Definition Documentation

    \n+\n+

    ◆ DUNE_GEOMETRY_REFINEMENT_BASE_CC

    \n+\n+
    \n+
    \n+ \n+ \n+ \n+ \n+
    #define DUNE_GEOMETRY_REFINEMENT_BASE_CC
    \n+
    \n+\n+
    \n+
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,35 +6,58 @@\n dune-geometry\u00a02.9.0\n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n-Namespaces\n-referenceelementimplementation.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+ * refinement\n+Classes | Namespaces | Macros | Functions\n+base.cc File Reference\n+This file contains the parts independent of a particular Refinement\n+implementation. More...\n #include \n Go_to_the_source_code_of_this_file.\n+ Classes\n+struct \u00a0Dune::RefinementImp::Traits<_topologyId,_CoordType,_coerceToId,\n+ dimension,_Dummy_>\n+\u00a0 Mapping from geometryType, CoordType and coerceTo to a particular\n+ Refinement implementation. More...\n+\u00a0\n+ class \u00a0Dune::RefinementIntervals\n+\u00a0 Holds the number of refined intervals per axis needed for virtual and\n+ static refinement. More...\n+\u00a0\n+ class \u00a0Dune::StaticRefinement<_topologyId,_CoordType,_coerceToId,_dimension_\n+ >\n+\u00a0 Wrap each Refinement implementation to get a consistent interface.\n+ More...\n+\u00a0\n+struct \u00a0Dune::StaticRefinement<_topologyId,_CoordType,_coerceToId,_dimension_\n+ >::Codim<_codimension_>\n+\u00a0 The Codim struct inherited from the Refinement implementation. More...\n+\u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n-namespace \u00a0Dune::Geo\n+namespace \u00a0Dune::RefinementImp\n+\u00a0 This namespace contains the implementation of Refinement.\n+\u00a0\n+ Macros\n+#define\u00a0DUNE_GEOMETRY_REFINEMENT_BASE_CC\n+\u00a0\n+ Functions\n+RefinementIntervals\u00a0Dune::refinementIntervals (int intervals)\n+\u00a0 Creates a RefinementIntervals object.\n+\u00a0\n+RefinementIntervals\u00a0Dune::refinementLevels (int levels)\n+\u00a0 Creates a RefinementIntervals object.\n \u00a0\n+***** Detailed Description *****\n+This file contains the parts independent of a particular Refinement\n+implementation.\n+***** Macro Definition Documentation *****\n+***** \u25c6\u00a0DUNE_GEOMETRY_REFINEMENT_BASE_CC *****\n+#define DUNE_GEOMETRY_REFINEMENT_BASE_CC\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00209_source.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00209_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: referenceelementimplementation.hh Source File\n+dune-geometry: base.cc Source File\n \n \n \n \n \n \n \n@@ -70,725 +70,199 @@\n \n \n \n \n \n \n \n
    \n-
    referenceelementimplementation.hh
    \n+
    base.cc
    \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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
    \n
    4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n-
    5#ifndef DUNE_GEOMETRY_REFERENCEELEMENTIMPLEMENTATION_HH
    \n-
    6#define DUNE_GEOMETRY_REFERENCEELEMENTIMPLEMENTATION_HH
    \n+
    5#ifndef DUNE_GEOMETRY_REFINEMENT_BASE_CC
    \n+
    6#define DUNE_GEOMETRY_REFINEMENT_BASE_CC
    \n
    7
    \n-
    8#include <cassert>
    \n-
    9
    \n-
    10#include <algorithm>
    \n-
    11#include <limits>
    \n-
    12#include <tuple>
    \n-
    13#include <utility>
    \n-
    14#include <vector>
    \n-
    15#include <array>
    \n-
    16#include <bitset>
    \n-
    17
    \n-
    18#include <dune/common/fmatrix.hh>
    \n-
    19#include <dune/common/fvector.hh>
    \n-
    20#include <dune/common/hybridutilities.hh>
    \n-
    21#include <dune/common/typetraits.hh>
    \n-
    22#include <dune/common/iteratorrange.hh>
    \n-
    23#include <dune/common/math.hh>
    \n-
    24
    \n-\n-\n-
    27#include <dune/geometry/type.hh>
    \n-
    28
    \n-
    29namespace Dune
    \n-
    30{
    \n-
    31
    \n-
    32 namespace Geo
    \n-
    33 {
    \n+
    15#include <dune/geometry/type.hh>
    \n+
    16
    \n+
    17namespace Dune
    \n+
    18{
    \n+
    \n+
    28 namespace RefinementImp
    \n+
    29 {
    \n+
    30 // /////////////////////////////////
    \n+
    31 //
    \n+
    32 // Declaration of RefinementImp::Traits
    \n+
    33 //
    \n
    34
    \n-
    35#ifndef DOXYGEN
    \n-
    36
    \n-
    37 // Internal Forward Declarations
    \n-
    38 // -----------------------------
    \n-
    39
    \n-
    40 namespace Impl
    \n-
    41 {
    \n-
    42 template< class ctype, int dim >
    \n-
    43 class ReferenceElementContainer;
    \n-
    44 }
    \n-
    45
    \n-
    46 template< class ctype, int dim >
    \n-
    47 struct ReferenceElements;
    \n-
    48
    \n-
    49
    \n-
    50
    \n-
    51 namespace Impl
    \n-
    52 {
    \n-
    53
    \n-
    54 using Dune::Impl::isPrism;
    \n-
    55 using Dune::Impl::isPyramid;
    \n-
    56 using Dune::Impl::baseTopologyId;
    \n-
    57 using Dune::Impl::prismConstruction;
    \n-
    58 using Dune::Impl::pyramidConstruction;
    \n-
    59 using Dune::Impl::numTopologies;
    \n-
    60
    \n-
    62 unsigned int size ( unsigned int topologyId, int dim, int codim );
    \n-
    63
    \n-
    64
    \n-
    65
    \n-
    73 unsigned int subTopologyId ( unsigned int topologyId, int dim, int codim, unsigned int i );
    \n+
    35#ifdef DOXYGEN
    \n+
    36 // This is just for Doxygen
    \n+
    67 template<unsigned topologyId, class CoordType,
    \n+
    68 unsigned coerceToId, int dimension, class Dummy = void>
    \n+
    \n+
    69 struct Traits
    \n+
    70 {
    \n+
    72 typedef SquaringTheCircle::Refinement Imp;
    \n+
    73 };
    \n+
    \n
    74
    \n-
    75
    \n+
    75#else // !DOXYGEN
    \n
    76
    \n-
    77 // subTopologyNumbering
    \n-
    78 // --------------------
    \n-
    79
    \n-
    80 void subTopologyNumbering ( unsigned int topologyId, int dim, int codim, unsigned int i, int subcodim,
    \n-
    81 unsigned int *beginOut, unsigned int *endOut );
    \n+
    77 // Doxygen won't see this
    \n+
    78
    \n+
    79 template<unsigned topologyId, class CoordType,
    \n+
    80 unsigned coerceToId, int dimension, class = void>
    \n+
    81 struct Traits;
    \n
    82
    \n-
    83
    \n-
    84
    \n+
    83#endif // !DOXYGEN
    \n+
    84 } // namespace RefinementImp
    \n+
    \n
    85
    \n-
    86 // checkInside
    \n-
    87 // -----------
    \n-
    88
    \n-
    89 template< class ct, int cdim >
    \n-
    90 inline bool
    \n-
    91 checkInside ( unsigned int topologyId, int dim, const FieldVector< ct, cdim > &x, ct tolerance, ct factor = ct( 1 ) )
    \n-
    92 {
    \n-
    93 assert( (dim >= 0) && (dim <= cdim) );
    \n-
    94 assert( topologyId < numTopologies( dim ) );
    \n-
    95
    \n-
    96 if( dim > 0 )
    \n-
    97 {
    \n-
    98 const ct baseFactor = (isPrism( topologyId, dim ) ? factor : factor - x[ dim-1 ]);
    \n-
    99 if( (x[ dim-1 ] > -tolerance) && (factor - x[ dim-1 ] > -tolerance) )
    \n-
    100 return checkInside< ct, cdim >( baseTopologyId( topologyId, dim ), dim-1, x, tolerance, baseFactor );
    \n-
    101 else
    \n-
    102 return false;
    \n-
    103 }
    \n-
    104 else
    \n-
    105 return true;
    \n-
    106 }
    \n-
    107
    \n-
    108
    \n-
    109
    \n-
    110 // referenceCorners
    \n-
    111 // ----------------
    \n-
    112
    \n-
    113 template< class ct, int cdim >
    \n-
    114 inline unsigned int
    \n-
    115 referenceCorners ( unsigned int topologyId, int dim, FieldVector< ct, cdim > *corners )
    \n-
    116 {
    \n-
    117 assert( (dim >= 0) && (dim <= cdim) );
    \n-
    118 assert( topologyId < numTopologies( dim ) );
    \n-
    119
    \n-
    120 if( dim > 0 )
    \n-
    121 {
    \n-
    122 const unsigned int nBaseCorners
    \n-
    123 = referenceCorners( baseTopologyId( topologyId, dim ), dim-1, corners );
    \n-
    124 assert( nBaseCorners == size( baseTopologyId( topologyId, dim ), dim-1, dim-1 ) );
    \n-
    125 if( isPrism( topologyId, dim ) )
    \n-
    126 {
    \n-
    127 std::copy( corners, corners + nBaseCorners, corners + nBaseCorners );
    \n-
    128 for( unsigned int i = 0; i < nBaseCorners; ++i )
    \n-
    129 corners[ i+nBaseCorners ][ dim-1 ] = ct( 1 );
    \n-
    130 return 2*nBaseCorners;
    \n-
    131 }
    \n-
    132 else
    \n-
    133 {
    \n-
    134 corners[ nBaseCorners ] = FieldVector< ct, cdim >( ct( 0 ) );
    \n-
    135 corners[ nBaseCorners ][ dim-1 ] = ct( 1 );
    \n-
    136 return nBaseCorners+1;
    \n-
    137 }
    \n-
    138 }
    \n-
    139 else
    \n-
    140 {
    \n-
    141 *corners = FieldVector< ct, cdim >( ct( 0 ) );
    \n-
    142 return 1;
    \n-
    143 }
    \n-
    144 }
    \n-
    145
    \n-
    146
    \n-
    147
    \n-
    148 // referenceVolume
    \n-
    149 // ---------------
    \n-
    150
    \n-
    151 unsigned long referenceVolumeInverse ( unsigned int topologyId, int dim );
    \n-
    152
    \n-
    153 template< class ct >
    \n-
    154 inline ct referenceVolume ( unsigned int topologyId, int dim )
    \n-
    155 {
    \n-
    156 return ct( 1 ) / ct( referenceVolumeInverse( topologyId, dim ) );
    \n-
    157 }
    \n-
    158
    \n+
    86
    \n+
    \n+\n+
    95 int intervals_=1;
    \n+
    96
    \n+
    97 public:
    \n+
    98 explicit RefinementIntervals(int i) : intervals_(i) {}
    \n+
    99
    \n+
    100 int intervals() const { return intervals_; }
    \n+
    101 };
    \n+
    \n+
    102
    \n+
    \n+\n+
    109 {
    \n+
    110 return RefinementIntervals{intervals};
    \n+
    111 }
    \n+
    \n+
    \n+\n+
    118 {
    \n+
    119 return RefinementIntervals{1<<levels};
    \n+
    120 }
    \n+
    \n+
    121
    \n+
    122 // ///////////////
    \n+
    123 //
    \n+
    124 // Static Refinement
    \n+
    125 //
    \n+
    126
    \n+
    136 template<unsigned topologyId, class CoordType,
    \n+
    137 unsigned coerceToId, int dimension_>
    \n+
    \n+\n+
    139 : public RefinementImp::Traits<topologyId, CoordType,
    \n+
    140 coerceToId, dimension_ >::Imp
    \n+
    141 {
    \n+
    142 public:
    \n+
    143#ifdef DOXYGEN
    \n+
    149 template<int codimension>
    \n+
    \n+
    150 struct Codim
    \n+
    151 {
    \n+\n+
    158 };
    \n+
    \n
    159
    \n-
    160
    \n-
    161 // referenceOrigins
    \n-
    162 // ----------------
    \n-
    163
    \n-
    164 template< class ct, int cdim >
    \n-
    165 inline unsigned int
    \n-
    166 referenceOrigins ( unsigned int topologyId, int dim, int codim, FieldVector< ct, cdim > *origins )
    \n-
    167 {
    \n-
    168 assert( (dim >= 0) && (dim <= cdim) );
    \n-
    169 assert( topologyId < numTopologies( dim ) );
    \n-
    170 assert( (codim >= 0) && (codim <= dim) );
    \n+\n+\n+
    164
    \n+
    170 typedef CoordVector;
    \n
    171
    \n-
    172 if( codim > 0 )
    \n-
    173 {
    \n-
    174 const unsigned int baseId = baseTopologyId( topologyId, dim );
    \n-
    175 if( isPrism( topologyId, dim ) )
    \n-
    176 {
    \n-
    177 const unsigned int n = (codim < dim ? referenceOrigins( baseId, dim-1, codim, origins ) : 0);
    \n-
    178 const unsigned int m = referenceOrigins( baseId, dim-1, codim-1, origins+n );
    \n-
    179 for( unsigned int i = 0; i < m; ++i )
    \n-
    180 {
    \n-
    181 origins[ n+m+i ] = origins[ n+i ];
    \n-
    182 origins[ n+m+i ][ dim-1 ] = ct( 1 );
    \n-
    183 }
    \n-
    184 return n+2*m;
    \n-
    185 }
    \n-
    186 else
    \n-
    187 {
    \n-
    188 const unsigned int m = referenceOrigins( baseId, dim-1, codim-1, origins );
    \n-
    189 if( codim == dim )
    \n-
    190 {
    \n-
    191 origins[ m ] = FieldVector< ct, cdim >( ct( 0 ) );
    \n-
    192 origins[ m ][ dim-1 ] = ct( 1 );
    \n-
    193 return m+1;
    \n-
    194 }
    \n-
    195 else
    \n-
    196 return m+referenceOrigins( baseId, dim-1, codim, origins+m );
    \n-
    197 }
    \n-
    198 }
    \n-
    199 else
    \n-
    200 {
    \n-
    201 origins[ 0 ] = FieldVector< ct, cdim >( ct( 0 ) );
    \n-
    202 return 1;
    \n-
    203 }
    \n-
    204 }
    \n-
    205
    \n-
    206
    \n-
    207
    \n-
    208 // referenceEmbeddings
    \n-
    209 // -------------------
    \n-
    210
    \n-
    211 template< class ct, int cdim, int mydim >
    \n-
    212 inline unsigned int
    \n-
    213 referenceEmbeddings ( unsigned int topologyId, int dim, int codim,
    \n-
    214 FieldVector< ct, cdim > *origins,
    \n-
    215 FieldMatrix< ct, mydim, cdim > *jacobianTransposeds )
    \n-
    216 {
    \n-
    217 assert( (0 <= codim) && (codim <= dim) && (dim <= cdim) );
    \n-
    218 assert( (dim - codim <= mydim) && (mydim <= cdim) );
    \n-
    219 assert( topologyId < numTopologies( dim ) );
    \n-
    220
    \n-
    221 if( codim > 0 )
    \n-
    222 {
    \n-
    223 const unsigned int baseId = baseTopologyId( topologyId, dim );
    \n-
    224 if( isPrism( topologyId, dim ) )
    \n-
    225 {
    \n-
    226 const unsigned int n = (codim < dim ? referenceEmbeddings( baseId, dim-1, codim, origins, jacobianTransposeds ) : 0);
    \n-
    227 for( unsigned int i = 0; i < n; ++i )
    \n-
    228 jacobianTransposeds[ i ][ dim-codim-1 ][ dim-1 ] = ct( 1 );
    \n-
    229
    \n-
    230 const unsigned int m = referenceEmbeddings( baseId, dim-1, codim-1, origins+n, jacobianTransposeds+n );
    \n-
    231 std::copy( origins+n, origins+n+m, origins+n+m );
    \n-
    232 std::copy( jacobianTransposeds+n, jacobianTransposeds+n+m, jacobianTransposeds+n+m );
    \n-
    233 for( unsigned int i = 0; i < m; ++i )
    \n-
    234 origins[ n+m+i ][ dim-1 ] = ct( 1 );
    \n-
    235
    \n-
    236 return n+2*m;
    \n-
    237 }
    \n-
    238 else
    \n-
    239 {
    \n-
    240 const unsigned int m = referenceEmbeddings( baseId, dim-1, codim-1, origins, jacobianTransposeds );
    \n-
    241 if( codim == dim )
    \n-
    242 {
    \n-
    243 origins[ m ] = FieldVector< ct, cdim >( ct( 0 ) );
    \n-
    244 origins[ m ][ dim-1 ] = ct( 1 );
    \n-
    245 jacobianTransposeds[ m ] = FieldMatrix< ct, mydim, cdim >( ct( 0 ) );
    \n-
    246 return m+1;
    \n-
    247 }
    \n-
    248 else
    \n-
    249 {
    \n-
    250 const unsigned int n = referenceEmbeddings( baseId, dim-1, codim, origins+m, jacobianTransposeds+m );
    \n-
    251 for( unsigned int i = 0; i < n; ++i )
    \n-
    252 {
    \n-
    253 for( int k = 0; k < dim-1; ++k )
    \n-
    254 jacobianTransposeds[ m+i ][ dim-codim-1 ][ k ] = -origins[ m+i ][ k ];
    \n-
    255 jacobianTransposeds[ m+i ][ dim-codim-1 ][ dim-1 ] = ct( 1 );
    \n-
    256 }
    \n-
    257 return m+n;
    \n-
    258 }
    \n-
    259 }
    \n-
    260 }
    \n-
    261 else
    \n-
    262 {
    \n-
    263 origins[ 0 ] = FieldVector< ct, cdim >( ct( 0 ) );
    \n-
    264 jacobianTransposeds[ 0 ] = FieldMatrix< ct, mydim, cdim >( ct( 0 ) );
    \n-
    265 for( int k = 0; k < dim; ++k )
    \n-
    266 jacobianTransposeds[ 0 ][ k ][ k ] = ct( 1 );
    \n-
    267 return 1;
    \n-
    268 }
    \n-
    269 }
    \n-
    270
    \n-
    271
    \n-
    272
    \n-
    273 // referenceIntegrationOuterNormals
    \n-
    274 // --------------------------------
    \n-
    275
    \n-
    276 template< class ct, int cdim >
    \n-
    277 inline unsigned int
    \n-
    278 referenceIntegrationOuterNormals ( unsigned int topologyId, int dim,
    \n-
    279 const FieldVector< ct, cdim > *origins,
    \n-
    280 FieldVector< ct, cdim > *normals )
    \n-
    281 {
    \n-
    282 assert( (dim > 0) && (dim <= cdim) );
    \n-
    283 assert( topologyId < numTopologies( dim ) );
    \n-
    284
    \n-
    285 if( dim > 1 )
    \n-
    286 {
    \n-
    287 const unsigned int baseId = baseTopologyId( topologyId, dim );
    \n-
    288 if( isPrism( topologyId, dim ) )
    \n-
    289 {
    \n-
    290 const unsigned int numBaseFaces
    \n-
    291 = referenceIntegrationOuterNormals( baseId, dim-1, origins, normals );
    \n-
    292
    \n-
    293 for( unsigned int i = 0; i < 2; ++i )
    \n-
    294 {
    \n-
    295 normals[ numBaseFaces+i ] = FieldVector< ct, cdim >( ct( 0 ) );
    \n-
    296 normals[ numBaseFaces+i ][ dim-1 ] = ct( 2*int( i )-1 );
    \n-
    297 }
    \n-
    298
    \n-
    299 return numBaseFaces+2;
    \n-
    300 }
    \n-
    301 else
    \n-
    302 {
    \n-
    303 normals[ 0 ] = FieldVector< ct, cdim >( ct( 0 ) );
    \n-
    304 normals[ 0 ][ dim-1 ] = ct( -1 );
    \n-
    305
    \n-
    306 const unsigned int numBaseFaces
    \n-
    307 = referenceIntegrationOuterNormals( baseId, dim-1, origins+1, normals+1 );
    \n-
    308 for( unsigned int i = 1; i <= numBaseFaces; ++i )
    \n-
    309 normals[ i ][ dim-1 ] = normals[ i ]*origins[ i ];
    \n-
    310
    \n-
    311 return numBaseFaces+1;
    \n-
    312 }
    \n-
    313 }
    \n-
    314 else
    \n-
    315 {
    \n-
    316 for( unsigned int i = 0; i < 2; ++i )
    \n-
    317 {
    \n-
    318 normals[ i ] = FieldVector< ct, cdim >( ct( 0 ) );
    \n-
    319 normals[ i ][ 0 ] = ct( 2*int( i )-1 );
    \n-
    320 }
    \n-
    321
    \n-
    322 return 2;
    \n-
    323 }
    \n-
    324 }
    \n-
    325
    \n-
    326 template< class ct, int cdim >
    \n-
    327 inline unsigned int
    \n-
    328 referenceIntegrationOuterNormals ( unsigned int topologyId, int dim,
    \n-
    329 FieldVector< ct, cdim > *normals )
    \n-
    330 {
    \n-
    331 assert( (dim > 0) && (dim <= cdim) );
    \n-
    332
    \n-
    333 FieldVector< ct, cdim > *origins
    \n-
    334 = new FieldVector< ct, cdim >[ size( topologyId, dim, 1 ) ];
    \n-
    335 referenceOrigins( topologyId, dim, 1, origins );
    \n-
    336
    \n-
    337 const unsigned int numFaces
    \n-
    338 = referenceIntegrationOuterNormals( topologyId, dim, origins, normals );
    \n-
    339 assert( numFaces == size( topologyId, dim, 1 ) );
    \n-
    340
    \n-
    341 delete[] origins;
    \n-
    342
    \n-
    343 return numFaces;
    \n-
    344 }
    \n-
    345
    \n-
    346 } // namespace Impl
    \n-
    347
    \n-
    348
    \n-
    349
    \n-
    350 // ReferenceElement
    \n-
    351 // ----------------
    \n-
    352
    \n-
    371 template< class ctype_, int dim >
    \n-
    372 class ReferenceElementImplementation
    \n-
    373 {
    \n-
    374
    \n-
    375 public:
    \n-
    376
    \n-
    378 using ctype = ctype_;
    \n-
    379
    \n-
    381 using CoordinateField = ctype;
    \n-
    382
    \n-
    384 using Coordinate = Dune::FieldVector<ctype,dim>;
    \n-
    385
    \n-
    387 static constexpr int dimension = dim;
    \n-
    388
    \n-
    390 typedef ctype Volume;
    \n-
    391
    \n-
    392 private:
    \n-
    393
    \n-
    394 friend class Impl::ReferenceElementContainer< ctype, dim >;
    \n-
    395
    \n-
    396 struct SubEntityInfo;
    \n-
    397
    \n-
    398 template< int codim > struct CreateGeometries;
    \n-
    399
    \n-
    400 public:
    \n-
    402 template< int codim >
    \n-
    403 struct Codim
    \n-
    404 {
    \n-
    406 typedef AffineGeometry< ctype, dim-codim, dim > Geometry;
    \n-
    407 };
    \n-
    408
    \n-
    409 // ReferenceElement cannot be copied.
    \n-
    410 ReferenceElementImplementation ( const ReferenceElementImplementation& ) = delete;
    \n-
    411
    \n-
    412 // ReferenceElementImplementation cannot be copied.
    \n-
    413 ReferenceElementImplementation& operator= ( const ReferenceElementImplementation& ) = delete;
    \n-
    414
    \n-
    415 // ReferenceElementImplementation is default-constructible (required for storage in std::array)
    \n-
    416 ReferenceElementImplementation () = default;
    \n-
    417
    \n-
    422 int size ( int c ) const
    \n-
    423 {
    \n-
    424 assert( (c >= 0) && (c <= dim) );
    \n-
    425 return info_[ c ].size();
    \n-
    426 }
    \n-
    427
    \n-
    439 int size ( int i, int c, int cc ) const
    \n-
    440 {
    \n-
    441 assert( (i >= 0) && (i < size( c )) );
    \n-
    442 return info_[ c ][ i ].size( cc );
    \n-
    443 }
    \n-
    444
    \n-
    458 int subEntity ( int i, int c, int ii, int cc ) const
    \n-
    459 {
    \n-
    460 assert( (i >= 0) && (i < size( c )) );
    \n-
    461 return info_[ c ][ i ].number( ii, cc );
    \n-
    462 }
    \n-
    463
    \n-
    479 auto subEntities ( int i, int c, int cc ) const
    \n-
    480 {
    \n-
    481 assert( (i >= 0) && (i < size( c )) );
    \n-
    482 return info_[ c ][ i ].numbers( cc );
    \n-
    483 }
    \n-
    484
    \n-
    493 const GeometryType &type ( int i, int c ) const
    \n-
    494 {
    \n-
    495 assert( (i >= 0) && (i < size( c )) );
    \n-
    496 return info_[ c ][ i ].type();
    \n-
    497 }
    \n-
    498
    \n-
    500 const GeometryType &type () const { return type( 0, 0 ); }
    \n-
    501
    \n-
    511 const Coordinate &position( int i, int c ) const
    \n-
    512 {
    \n-
    513 assert( (c >= 0) && (c <= dim) );
    \n-
    514 return baryCenters_[ c ][ i ];
    \n-
    515 }
    \n-
    516
    \n-
    524 bool checkInside ( const Coordinate &local ) const
    \n-
    525 {
    \n-
    526 const ctype tolerance = ctype( 64 ) * std::numeric_limits< ctype >::epsilon();
    \n-
    527 return Impl::template checkInside< ctype, dim >( type().id(), dim, local, tolerance );
    \n-
    528 }
    \n-
    529
    \n-
    541 template< int codim >
    \n-
    542 typename Codim< codim >::Geometry geometry ( int i ) const
    \n-
    543 {
    \n-
    544 return std::get< codim >( geometries_ )[ i ];
    \n-
    545 }
    \n-
    546
    \n-
    548 Volume volume () const
    \n-
    549 {
    \n-
    550 return volume_;
    \n-
    551 }
    \n-
    552
    \n-
    560 const Coordinate &integrationOuterNormal ( int face ) const
    \n-
    561 {
    \n-
    562 assert( (face >= 0) && (face < int( integrationNormals_.size() )) );
    \n-
    563 return integrationNormals_[ face ];
    \n-
    564 }
    \n-
    565
    \n-
    566 private:
    \n-
    567 void initialize ( unsigned int topologyId )
    \n-
    568 {
    \n-
    569 assert( topologyId < Impl::numTopologies( dim ) );
    \n-
    570
    \n-
    571 // set up subentities
    \n-
    572 for( int codim = 0; codim <= dim; ++codim )
    \n-
    573 {
    \n-
    574 const unsigned int size = Impl::size( topologyId, dim, codim );
    \n-
    575 info_[ codim ].resize( size );
    \n-
    576 for( unsigned int i = 0; i < size; ++i )
    \n-
    577 info_[ codim ][ i ].initialize( topologyId, codim, i );
    \n-
    578 }
    \n-
    579
    \n-
    580 // compute corners
    \n-
    581 const unsigned int numVertices = size( dim );
    \n-
    582 baryCenters_[ dim ].resize( numVertices );
    \n-
    583 Impl::referenceCorners( topologyId, dim, &(baryCenters_[ dim ][ 0 ]) );
    \n-
    584
    \n-
    585 // compute barycenters
    \n-
    586 for( int codim = 0; codim < dim; ++codim )
    \n-
    587 {
    \n-
    588 baryCenters_[ codim ].resize( size(codim) );
    \n-
    589 for( int i = 0; i < size( codim ); ++i )
    \n-
    590 {
    \n-
    591 baryCenters_[ codim ][ i ] = Coordinate( ctype( 0 ) );
    \n-
    592 const unsigned int numCorners = size( i, codim, dim );
    \n-
    593 for( unsigned int j = 0; j < numCorners; ++j )
    \n-
    594 baryCenters_[ codim ][ i ] += baryCenters_[ dim ][ subEntity( i, codim, j, dim ) ];
    \n-
    595 baryCenters_[ codim ][ i ] *= ctype( 1 ) / ctype( numCorners );
    \n-
    596 }
    \n-
    597 }
    \n-
    598
    \n-
    599 // compute reference element volume
    \n-
    600 volume_ = Impl::template referenceVolume< ctype >( topologyId, dim );
    \n-
    601
    \n-
    602 // compute integration outer normals
    \n-
    603 if( dim > 0 )
    \n-
    604 {
    \n-
    605 integrationNormals_.resize( size( 1 ) );
    \n-
    606 Impl::referenceIntegrationOuterNormals( topologyId, dim, &(integrationNormals_[ 0 ]) );
    \n-
    607 }
    \n-
    608
    \n-
    609 // set up geometries
    \n-
    610 Hybrid::forEach( std::make_index_sequence< dim+1 >{}, [ & ]( auto i ){ CreateGeometries< i >::apply( *this, geometries_ ); } );
    \n-
    611 }
    \n-
    612
    \n-
    613 template< int... codim >
    \n-
    614 static std::tuple< std::vector< typename Codim< codim >::Geometry >... >
    \n-
    615 makeGeometryTable ( std::integer_sequence< int, codim... > );
    \n-
    616
    \n-
    618 typedef decltype( makeGeometryTable( std::make_integer_sequence< int, dim+1 >() ) ) GeometryTable;
    \n-
    619
    \n-
    621 ctype volume_;
    \n-
    622
    \n-
    623 std::vector< Coordinate > baryCenters_[ dim+1 ];
    \n-
    624 std::vector< Coordinate > integrationNormals_;
    \n-
    625
    \n-
    627 GeometryTable geometries_;
    \n-
    628
    \n-
    629 std::vector< SubEntityInfo > info_[ dim+1 ];
    \n-
    630 };
    \n-
    631
    \n-
    633 template< class ctype, int dim >
    \n-
    634 struct ReferenceElementImplementation< ctype, dim >::SubEntityInfo
    \n-
    635 {
    \n-
    636 // Compute upper bound for the number of subsentities.
    \n-
    637 // If someone knows an explicit formal feel free to
    \n-
    638 // implement it here.
    \n-
    639 static constexpr std::size_t maxSubEntityCount()
    \n-
    640 {
    \n-
    641 std::size_t maxCount=0;
    \n-
    642 for(std::size_t codim=0; codim<=dim; ++codim)
    \n-
    643 maxCount = std::max(maxCount, binomial(std::size_t(dim),codim)*(1 << codim));
    \n-
    644 return maxCount;
    \n-
    645 }
    \n-
    646
    \n-
    647 using SubEntityFlags = std::bitset<maxSubEntityCount()>;
    \n-
    648
    \n-
    649 class SubEntityRange
    \n-
    650 : public Dune::IteratorRange<const unsigned int*>
    \n-
    651 {
    \n-
    652 using Base = typename Dune::IteratorRange<const unsigned int*>;
    \n-
    653
    \n-
    654 public:
    \n-
    655
    \n-
    656 using iterator = Base::iterator;
    \n-
    657 using const_iterator = Base::const_iterator;
    \n-
    658
    \n-
    659 SubEntityRange(const iterator& begin, const iterator& end, const SubEntityFlags& contains) :
    \n-
    660 Base(begin, end),
    \n-
    661 containsPtr_(&contains),
    \n-
    662 size_(end-begin)
    \n-
    663 {}
    \n-
    664
    \n-
    665 SubEntityRange() :
    \n-
    666 Base(),
    \n-
    667 containsPtr_(nullptr),
    \n-
    668 size_(0)
    \n-
    669 {}
    \n-
    670
    \n-
    671 std::size_t size() const
    \n-
    672 {
    \n-
    673 return size_;
    \n-
    674 }
    \n-
    675
    \n-
    676 bool contains(std::size_t i) const
    \n-
    677 {
    \n-
    678 return (*containsPtr_)[i];
    \n-
    679 }
    \n-
    680
    \n-
    681 private:
    \n-
    682 const SubEntityFlags* containsPtr_;
    \n-
    683 std::size_t size_;
    \n-
    684 std::size_t offset_;
    \n-
    685 };
    \n-
    686
    \n-
    687 using NumberRange = typename Dune::IteratorRange<const unsigned int*>;
    \n-
    688
    \n-
    689 SubEntityInfo ()
    \n-
    690 : numbering_( nullptr )
    \n-
    691 {
    \n-
    692 std::fill( offset_.begin(), offset_.end(), 0 );
    \n-
    693 }
    \n-
    694
    \n-
    695 SubEntityInfo ( const SubEntityInfo &other )
    \n-
    696 : offset_( other.offset_ ),
    \n-
    697 type_( other.type_ ),
    \n-
    698 containsSubentity_( other.containsSubentity_ )
    \n-
    699 {
    \n-
    700 numbering_ = allocate();
    \n-
    701 std::copy( other.numbering_, other.numbering_ + capacity(), numbering_ );
    \n-
    702 }
    \n-
    703
    \n-
    704 ~SubEntityInfo () { deallocate( numbering_ ); }
    \n-
    705
    \n-
    706 const SubEntityInfo &operator= ( const SubEntityInfo &other )
    \n-
    707 {
    \n-
    708 type_ = other.type_;
    \n-
    709 offset_ = other.offset_;
    \n-
    710
    \n-
    711 deallocate( numbering_ );
    \n-
    712 numbering_ = allocate();
    \n-
    713 std::copy( other.numbering_, other.numbering_ + capacity(), numbering_ );
    \n-
    714
    \n-
    715 containsSubentity_ = other.containsSubentity_;
    \n-
    716
    \n-
    717 return *this;
    \n-
    718 }
    \n-
    719
    \n-
    720 int size ( int cc ) const
    \n-
    721 {
    \n-
    722 assert( (cc >= 0) && (cc <= dim) );
    \n-
    723 return (offset_[ cc+1 ] - offset_[ cc ]);
    \n-
    724 }
    \n-
    725
    \n-
    726 int number ( int ii, int cc ) const
    \n-
    727 {
    \n-
    728 assert( (ii >= 0) && (ii < size( cc )) );
    \n-
    729 return numbering_[ offset_[ cc ] + ii ];
    \n-
    730 }
    \n-
    731
    \n-
    732 auto numbers ( int cc ) const
    \n-
    733 {
    \n-
    734 return SubEntityRange( numbering_ + offset_[ cc ], numbering_ + offset_[ cc+1 ], containsSubentity_[cc]);
    \n-
    735 }
    \n-
    736
    \n-
    737 const GeometryType &type () const { return type_; }
    \n-
    738
    \n-
    739 void initialize ( unsigned int topologyId, int codim, unsigned int i )
    \n-
    740 {
    \n-
    741 const unsigned int subId = Impl::subTopologyId( topologyId, dim, codim, i );
    \n-
    742 type_ = GeometryType( subId, dim-codim );
    \n-
    743
    \n-
    744 // compute offsets
    \n-
    745 for( int cc = 0; cc <= codim; ++cc )
    \n-
    746 offset_[ cc ] = 0;
    \n-
    747 for( int cc = codim; cc <= dim; ++cc )
    \n-
    748 offset_[ cc+1 ] = offset_[ cc ] + Impl::size( subId, dim-codim, cc-codim );
    \n-
    749
    \n-
    750 // compute subnumbering
    \n-
    751 deallocate( numbering_ );
    \n-
    752 numbering_ = allocate();
    \n-
    753 for( int cc = codim; cc <= dim; ++cc )
    \n-
    754 Impl::subTopologyNumbering( topologyId, dim, codim, i, cc-codim, numbering_+offset_[ cc ], numbering_+offset_[ cc+1 ] );
    \n-
    755
    \n-
    756 // initialize containsSubentity lookup-table
    \n-
    757 for(std::size_t cc=0; cc<= dim; ++cc)
    \n-
    758 {
    \n-
    759 containsSubentity_[cc].reset();
    \n-
    760 for(std::size_t idx=0; idx<std::size_t(size(cc)); ++idx)
    \n-
    761 containsSubentity_[cc][number(idx,cc)] = true;
    \n-
    762 }
    \n-
    763 }
    \n-
    764
    \n-
    765 protected:
    \n-
    766 int codim () const { return dim - type().dim(); }
    \n-
    767
    \n-
    768 unsigned int *allocate () { return (capacity() != 0 ? new unsigned int[ capacity() ] : nullptr); }
    \n-
    769 void deallocate ( unsigned int *ptr ) { delete[] ptr; }
    \n-
    770 unsigned int capacity () const { return offset_[ dim+1 ]; }
    \n-
    771
    \n-
    772 private:
    \n-
    773 unsigned int *numbering_;
    \n-
    774 std::array< unsigned int, dim+2 > offset_;
    \n-
    775 GeometryType type_;
    \n-
    776 std::array< SubEntityFlags, dim+1> containsSubentity_;
    \n-
    777 };
    \n-
    778
    \n-
    779
    \n-
    780 template< class ctype, int dim >
    \n-
    781 template< int codim >
    \n-
    782 struct ReferenceElementImplementation< ctype, dim >::CreateGeometries
    \n-
    783 {
    \n-
    784 template< int cc >
    \n-
    785 static typename ReferenceElements< ctype, dim-cc >::ReferenceElement
    \n-
    786 subRefElement( const ReferenceElementImplementation< ctype, dim > &refElement, int i, std::integral_constant< int, cc > )
    \n-
    787 {
    \n-
    788 return ReferenceElements< ctype, dim-cc >::general( refElement.type( i, cc ) );
    \n-
    789 }
    \n-
    790
    \n-\n-
    792 subRefElement(const ReferenceElementImplementation< ctype, dim > &refElement,
    \n-
    793 [[maybe_unused]] int i, std::integral_constant<int, 0>)
    \n-
    794 {
    \n-
    795 return refElement;
    \n-
    796 }
    \n-
    797
    \n-
    798 static void apply ( const ReferenceElementImplementation< ctype, dim > &refElement, GeometryTable &geometries )
    \n-
    799 {
    \n-
    800 const int size = refElement.size( codim );
    \n-
    801 std::vector< FieldVector< ctype, dim > > origins( size );
    \n-
    802 std::vector< FieldMatrix< ctype, dim - codim, dim > > jacobianTransposeds( size );
    \n-
    803 Impl::referenceEmbeddings( refElement.type().id(), dim, codim, &(origins[ 0 ]), &(jacobianTransposeds[ 0 ]) );
    \n-
    804
    \n-
    805 std::get< codim >( geometries ).reserve( size );
    \n-
    806 for( int i = 0; i < size; ++i )
    \n-
    807 {
    \n-
    808 typename Codim< codim >::Geometry geometry( subRefElement( refElement, i, std::integral_constant< int, codim >() ), origins[ i ], jacobianTransposeds[ i ] );
    \n-
    809 std::get< codim >( geometries ).push_back( geometry );
    \n-
    810 }
    \n-
    811 }
    \n-
    812 };
    \n-
    813
    \n-
    814#endif // DOXYGEN
    \n-
    815
    \n-
    816 } // namespace Geo
    \n-
    817
    \n-
    818} // namespace Dune
    \n-
    819
    \n-
    820#endif // #ifndef DUNE_GEOMETRY_REFERENCEELEMENTIMPLEMENTATION_HH
    \n-\n+
    177 typedef IndexVector;
    \n+
    178#endif
    \n+
    179
    \n+
    180 typedef typename RefinementImp::Traits< topologyId, CoordType, coerceToId, dimension_>::Imp RefinementImp;
    \n+
    181
    \n+
    182 using RefinementImp::dimension;
    \n+
    183
    \n+
    184 using RefinementImp::Codim;
    \n+
    185
    \n+
    186 using typename RefinementImp::VertexIterator;
    \n+
    187 using typename RefinementImp::CoordVector;
    \n+
    188
    \n+
    189 using typename RefinementImp::ElementIterator;
    \n+
    190 using typename RefinementImp::IndexVector;
    \n+
    191
    \n+
    \n+\n+
    198 {
    \n+
    199 return RefinementImp::nVertices(tag.intervals());
    \n+
    200 }
    \n+
    \n+
    201
    \n+
    \n+\n+
    208 {
    \n+
    209 return RefinementImp::vBegin(tag.intervals());
    \n+
    210 }
    \n+
    \n+
    211
    \n+
    \n+\n+
    218 {
    \n+
    219 return RefinementImp::vEnd(tag.intervals());
    \n+
    220 }
    \n+
    \n+
    221
    \n+
    \n+\n+
    228 {
    \n+
    229 return RefinementImp::nElements(tag.intervals());
    \n+
    230 }
    \n+
    \n+
    231
    \n+
    \n+\n+
    238 {
    \n+
    239 return RefinementImp::eBegin(tag.intervals());
    \n+
    240 }
    \n+
    \n+
    241
    \n+
    \n+\n+
    248 {
    \n+
    249 return RefinementImp::eEnd(tag.intervals());
    \n+
    250 }
    \n+
    \n+
    251 };
    \n+
    \n+
    252
    \n+
    254} // namespace Dune
    \n+
    255
    \n+
    256#endif // DUNE_GEOMETRY_REFINEMENT_BASE_CC
    \n
    A unique label for each type of element that can occur in a grid.
    \n-
    An implementation of the Geometry interface for affine geometries.
    \n+
    RefinementIntervals refinementIntervals(int intervals)
    Creates a RefinementIntervals object.
    Definition base.cc:108
    \n+
    RefinementIntervals refinementLevels(int levels)
    Creates a RefinementIntervals object.
    Definition base.cc:117
    \n
    Definition affinegeometry.hh:21
    \n-
    @ size
    Definition quadraturerules.hh:145
    \n-
    int binomial(int upper, int lower)
    calculate
    Definition simplex.cc:305
    \n-
    typename Container::ReferenceElement ReferenceElement
    The reference element type.
    Definition referenceelements.hh:188
    \n-
    static const ReferenceElement & general(const GeometryType &type)
    get general reference elements
    Definition referenceelements.hh:198
    \n+
    Mapping from geometryType, CoordType and coerceTo to a particular Refinement implementation.
    Definition base.cc:70
    \n+
    Holds the number of refined intervals per axis needed for virtual and static refinement.
    Definition base.cc:94
    \n+
    RefinementIntervals(int i)
    Definition base.cc:98
    \n+
    int intervals() const
    Definition base.cc:100
    \n+
    Wrap each Refinement implementation to get a consistent interface.
    Definition base.cc:141
    \n+
    static ElementIterator eEnd(Dune::RefinementIntervals tag)
    Get an ElementIterator.
    Definition base.cc:247
    \n+
    static ElementIterator eBegin(Dune::RefinementIntervals tag)
    Get an ElementIterator.
    Definition base.cc:237
    \n+
    static int nElements(Dune::RefinementIntervals tag)
    Get the number of Elements.
    Definition base.cc:227
    \n+
    Codim< 0 >::SubEntityIterator ElementIterator
    The ElementIterator of the Refinement.
    Definition base.cc:163
    \n+
    static int nVertices(Dune::RefinementIntervals tag)
    Get the number of Vertices.
    Definition base.cc:197
    \n+
    static VertexIterator vBegin(Dune::RefinementIntervals tag)
    Get a VertexIterator.
    Definition base.cc:207
    \n+
    Codim< dimension >::SubEntityIterator VertexIterator
    The VertexIterator of the Refinement.
    Definition base.cc:161
    \n+
    typedef CoordVector
    The CoordVector of the Refinement.
    Definition base.cc:170
    \n+
    typedef IndexVector
    The IndexVector of the Refinement.
    Definition base.cc:177
    \n+
    RefinementImp::Traits< topologyId, CoordType, coerceToId, dimension_ >::Imp RefinementImp
    Definition base.cc:180
    \n+
    static VertexIterator vEnd(Dune::RefinementIntervals tag)
    Get a VertexIterator.
    Definition base.cc:217
    \n+
    The Codim struct inherited from the Refinement implementation.
    Definition base.cc:151
    \n+
    typedef SubEntityIterator
    The SubEntityIterator for each codim.
    Definition base.cc:157
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,771 +7,225 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n-referenceelementimplementation.hh\n+ * refinement\n+base.cc\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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file\n LICENSE.md in module root\n 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n- 5#ifndef DUNE_GEOMETRY_REFERENCEELEMENTIMPLEMENTATION_HH\n- 6#define DUNE_GEOMETRY_REFERENCEELEMENTIMPLEMENTATION_HH\n+ 5#ifndef DUNE_GEOMETRY_REFINEMENT_BASE_CC\n+6#define DUNE_GEOMETRY_REFINEMENT_BASE_CC\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#include \n- 19#include \n- 20#include \n- 21#include \n- 22#include \n- 23#include \n- 24\n- 25#include \n- 26#include \n- 27#include \n- 28\n- 29namespace Dune\n- 30{\n- 31\n- 32 namespace Geo\n- 33 {\n+ 15#include \n+ 16\n+ 17namespace Dune\n+ 18{\n+28 namespace RefinementImp\n+ 29 {\n+ 30 // /////////////////////////////////\n+ 31 //\n+ 32 // Declaration of RefinementImp::Traits\n+ 33 //\n 34\n- 35#ifndef DOXYGEN\n- 36\n- 37 // Internal Forward Declarations\n- 38 // -----------------------------\n- 39\n- 40 namespace Impl\n- 41 {\n- 42 template< class ctype, int dim >\n- 43 class ReferenceElementContainer;\n- 44 }\n- 45\n- 46 template< class ctype, int dim >\n- 47 struct ReferenceElements;\n- 48\n- 49\n- 50\n- 51 namespace Impl\n- 52 {\n- 53\n- 54 using Dune::Impl::isPrism;\n- 55 using Dune::Impl::isPyramid;\n- 56 using Dune::Impl::baseTopologyId;\n- 57 using Dune::Impl::prismConstruction;\n- 58 using Dune::Impl::pyramidConstruction;\n- 59 using Dune::Impl::numTopologies;\n- 60\n- 62 unsigned int size ( unsigned int topologyId, int dim, int codim );\n- 63\n- 64\n- 65\n- 73 unsigned int subTopologyId ( unsigned int topologyId, int dim, int codim,\n-unsigned int i );\n+ 35#ifdef DOXYGEN\n+ 36 // This is just for Doxygen\n+ 67 template\n+69 struct Traits\n+ 70 {\n+ 72 typedef SquaringTheCircle::Refinement Imp;\n+ 73 };\n 74\n- 75\n+ 75#else // !DOXYGEN\n 76\n- 77 // subTopologyNumbering\n- 78 // --------------------\n- 79\n- 80 void subTopologyNumbering ( unsigned int topologyId, int dim, int codim,\n-unsigned int i, int subcodim,\n- 81 unsigned int *beginOut, unsigned int *endOut );\n+ 77 // Doxygen won't see this\n+ 78\n+ 79 template\n+ 81 struct Traits;\n 82\n- 83\n- 84\n+ 83#endif // !DOXYGEN\n+ 84 } // namespace RefinementImp\n 85\n- 86 // checkInside\n- 87 // -----------\n- 88\n- 89 template< class ct, int cdim >\n- 90 inline bool\n- 91 checkInside ( unsigned int topologyId, int dim, const FieldVector< ct, cdim\n-> &x, ct tolerance, ct factor = ct( 1 ) )\n- 92 {\n- 93 assert( (dim >= 0) && (dim <= cdim) );\n- 94 assert( topologyId < numTopologies( dim ) );\n- 95\n- 96 if( dim > 0 )\n- 97 {\n- 98 const ct baseFactor = (isPrism( topologyId, dim ) ? factor : factor - x\n-[ dim-1 ]);\n- 99 if( (x[ dim-1 ] > -tolerance) && (factor - x[ dim-1 ] > -tolerance) )\n- 100 return checkInside< ct, cdim >( baseTopologyId( topologyId, dim ), dim-1,\n-x, tolerance, baseFactor );\n- 101 else\n- 102 return false;\n- 103 }\n- 104 else\n- 105 return true;\n- 106 }\n- 107\n- 108\n- 109\n- 110 // referenceCorners\n- 111 // ----------------\n- 112\n- 113 template< class ct, int cdim >\n- 114 inline unsigned int\n- 115 referenceCorners ( unsigned int topologyId, int dim, FieldVector< ct, cdim\n-> *corners )\n- 116 {\n- 117 assert( (dim >= 0) && (dim <= cdim) );\n- 118 assert( topologyId < numTopologies( dim ) );\n- 119\n- 120 if( dim > 0 )\n- 121 {\n- 122 const unsigned int nBaseCorners\n- 123 = referenceCorners( baseTopologyId( topologyId, dim ), dim-1, corners );\n- 124 assert( nBaseCorners == size( baseTopologyId( topologyId, dim ), dim-1,\n-dim-1 ) );\n- 125 if( isPrism( topologyId, dim ) )\n- 126 {\n- 127 std::copy( corners, corners + nBaseCorners, corners + nBaseCorners );\n- 128 for( unsigned int i = 0; i < nBaseCorners; ++i )\n- 129 corners[ i+nBaseCorners ][ dim-1 ] = ct( 1 );\n- 130 return 2*nBaseCorners;\n- 131 }\n- 132 else\n- 133 {\n- 134 corners[ nBaseCorners ] = FieldVector< ct, cdim >( ct( 0 ) );\n- 135 corners[ nBaseCorners ][ dim-1 ] = ct( 1 );\n- 136 return nBaseCorners+1;\n- 137 }\n- 138 }\n- 139 else\n- 140 {\n- 141 *corners = FieldVector< ct, cdim >( ct( 0 ) );\n- 142 return 1;\n- 143 }\n- 144 }\n- 145\n- 146\n- 147\n- 148 // referenceVolume\n- 149 // ---------------\n- 150\n- 151 unsigned long referenceVolumeInverse ( unsigned int topologyId, int dim );\n- 152\n- 153 template< class ct >\n- 154 inline ct referenceVolume ( unsigned int topologyId, int dim )\n- 155 {\n- 156 return ct( 1 ) / ct( referenceVolumeInverse( topologyId, dim ) );\n- 157 }\n- 158\n+ 86\n+94 class RefinementIntervals{\n+ 95 int intervals_=1;\n+ 96\n+ 97 public:\n+98 explicit RefinementIntervals(int i) : intervals_(i) {}\n+ 99\n+100 int intervals() const { return intervals_; }\n+ 101 };\n+ 102\n+108 inline RefinementIntervals refinementIntervals(int intervals)\n+ 109 {\n+ 110 return RefinementIntervals{intervals};\n+ 111 }\n+117 inline RefinementIntervals refinementLevels(int levels)\n+ 118 {\n+ 119 return RefinementIntervals{1<\n+138 class StaticRefinement\n+ 139 : public RefinementImp::Traits::Imp\n+ 141 {\n+ 142 public:\n+ 143#ifdef DOXYGEN\n+ 149 template\n+150 struct Codim\n+ 151 {\n+157 typedef SubEntityIterator;\n+ 158 };\n 159\n- 160\n- 161 // referenceOrigins\n- 162 // ----------------\n- 163\n- 164 template< class ct, int cdim >\n- 165 inline unsigned int\n- 166 referenceOrigins ( unsigned int topologyId, int dim, int codim,\n-FieldVector< ct, cdim > *origins )\n- 167 {\n- 168 assert( (dim >= 0) && (dim <= cdim) );\n- 169 assert( topologyId < numTopologies( dim ) );\n- 170 assert( (codim >= 0) && (codim <= dim) );\n+161 typedef Codim::SubEntityIterator VertexIterator;\n+163 typedef Codim<0>::SubEntityIterator ElementIterator;\n+ 164\n+170 typedef CoordVector;\n 171\n- 172 if( codim > 0 )\n- 173 {\n- 174 const unsigned int baseId = baseTopologyId( topologyId, dim );\n- 175 if( isPrism( topologyId, dim ) )\n- 176 {\n- 177 const unsigned int n = (codim < dim ? referenceOrigins( baseId, dim-1,\n-codim, origins ) : 0);\n- 178 const unsigned int m = referenceOrigins( baseId, dim-1, codim-1, origins+n\n-);\n- 179 for( unsigned int i = 0; i < m; ++i )\n- 180 {\n- 181 origins[ n+m+i ] = origins[ n+i ];\n- 182 origins[ n+m+i ][ dim-1 ] = ct( 1 );\n- 183 }\n- 184 return n+2*m;\n- 185 }\n- 186 else\n- 187 {\n- 188 const unsigned int m = referenceOrigins( baseId, dim-1, codim-1, origins\n-);\n- 189 if( codim == dim )\n- 190 {\n- 191 origins[ m ] = FieldVector< ct, cdim >( ct( 0 ) );\n- 192 origins[ m ][ dim-1 ] = ct( 1 );\n- 193 return m+1;\n- 194 }\n- 195 else\n- 196 return m+referenceOrigins( baseId, dim-1, codim, origins+m );\n- 197 }\n- 198 }\n- 199 else\n- 200 {\n- 201 origins[ 0 ] = FieldVector< ct, cdim >( ct( 0 ) );\n- 202 return 1;\n- 203 }\n- 204 }\n- 205\n- 206\n- 207\n- 208 // referenceEmbeddings\n- 209 // -------------------\n- 210\n- 211 template< class ct, int cdim, int mydim >\n- 212 inline unsigned int\n- 213 referenceEmbeddings ( unsigned int topologyId, int dim, int codim,\n- 214 FieldVector< ct, cdim > *origins,\n- 215 FieldMatrix< ct, mydim, cdim > *jacobianTransposeds )\n- 216 {\n- 217 assert( (0 <= codim) && (codim <= dim) && (dim <= cdim) );\n- 218 assert( (dim - codim <= mydim) && (mydim <= cdim) );\n- 219 assert( topologyId < numTopologies( dim ) );\n- 220\n- 221 if( codim > 0 )\n- 222 {\n- 223 const unsigned int baseId = baseTopologyId( topologyId, dim );\n- 224 if( isPrism( topologyId, dim ) )\n- 225 {\n- 226 const unsigned int n = (codim < dim ? referenceEmbeddings( baseId, dim-1,\n-codim, origins, jacobianTransposeds ) : 0);\n- 227 for( unsigned int i = 0; i < n; ++i )\n- 228 jacobianTransposeds[ i ][ dim-codim-1 ][ dim-1 ] = ct( 1 );\n- 229\n- 230 const unsigned int m = referenceEmbeddings( baseId, dim-1, codim-1,\n-origins+n, jacobianTransposeds+n );\n- 231 std::copy( origins+n, origins+n+m, origins+n+m );\n- 232 std::copy( jacobianTransposeds+n, jacobianTransposeds+n+m,\n-jacobianTransposeds+n+m );\n- 233 for( unsigned int i = 0; i < m; ++i )\n- 234 origins[ n+m+i ][ dim-1 ] = ct( 1 );\n- 235\n- 236 return n+2*m;\n- 237 }\n- 238 else\n- 239 {\n- 240 const unsigned int m = referenceEmbeddings( baseId, dim-1, codim-1,\n-origins, jacobianTransposeds );\n- 241 if( codim == dim )\n- 242 {\n- 243 origins[ m ] = FieldVector< ct, cdim >( ct( 0 ) );\n- 244 origins[ m ][ dim-1 ] = ct( 1 );\n- 245 jacobianTransposeds[ m ] = FieldMatrix< ct, mydim, cdim >( ct( 0 ) );\n- 246 return m+1;\n- 247 }\n- 248 else\n- 249 {\n- 250 const unsigned int n = referenceEmbeddings( baseId, dim-1, codim,\n-origins+m, jacobianTransposeds+m );\n- 251 for( unsigned int i = 0; i < n; ++i )\n- 252 {\n- 253 for( int k = 0; k < dim-1; ++k )\n- 254 jacobianTransposeds[ m+i ][ dim-codim-1 ][ k ] = -origins[ m+i ][ k ];\n- 255 jacobianTransposeds[ m+i ][ dim-codim-1 ][ dim-1 ] = ct( 1 );\n- 256 }\n- 257 return m+n;\n- 258 }\n- 259 }\n- 260 }\n- 261 else\n- 262 {\n- 263 origins[ 0 ] = FieldVector< ct, cdim >( ct( 0 ) );\n- 264 jacobianTransposeds[ 0 ] = FieldMatrix< ct, mydim, cdim >( ct( 0 ) );\n- 265 for( int k = 0; k < dim; ++k )\n- 266 jacobianTransposeds[ 0 ][ k ][ k ] = ct( 1 );\n- 267 return 1;\n- 268 }\n- 269 }\n- 270\n- 271\n- 272\n- 273 // referenceIntegrationOuterNormals\n- 274 // --------------------------------\n- 275\n- 276 template< class ct, int cdim >\n- 277 inline unsigned int\n- 278 referenceIntegrationOuterNormals ( unsigned int topologyId, int dim,\n- 279 const FieldVector< ct, cdim > *origins,\n- 280 FieldVector< ct, cdim > *normals )\n- 281 {\n- 282 assert( (dim > 0) && (dim <= cdim) );\n- 283 assert( topologyId < numTopologies( dim ) );\n- 284\n- 285 if( dim > 1 )\n- 286 {\n- 287 const unsigned int baseId = baseTopologyId( topologyId, dim );\n- 288 if( isPrism( topologyId, dim ) )\n- 289 {\n- 290 const unsigned int numBaseFaces\n- 291 = referenceIntegrationOuterNormals( baseId, dim-1, origins, normals );\n- 292\n- 293 for( unsigned int i = 0; i < 2; ++i )\n- 294 {\n- 295 normals[ numBaseFaces+i ] = FieldVector< ct, cdim >( ct( 0 ) );\n- 296 normals[ numBaseFaces+i ][ dim-1 ] = ct( 2*int( i )-1 );\n- 297 }\n- 298\n- 299 return numBaseFaces+2;\n- 300 }\n- 301 else\n- 302 {\n- 303 normals[ 0 ] = FieldVector< ct, cdim >( ct( 0 ) );\n- 304 normals[ 0 ][ dim-1 ] = ct( -1 );\n- 305\n- 306 const unsigned int numBaseFaces\n- 307 = referenceIntegrationOuterNormals( baseId, dim-1, origins+1, normals+1 );\n- 308 for( unsigned int i = 1; i <= numBaseFaces; ++i )\n- 309 normals[ i ][ dim-1 ] = normals[ i ]*origins[ i ];\n- 310\n- 311 return numBaseFaces+1;\n- 312 }\n- 313 }\n- 314 else\n- 315 {\n- 316 for( unsigned int i = 0; i < 2; ++i )\n- 317 {\n- 318 normals[ i ] = FieldVector< ct, cdim >( ct( 0 ) );\n- 319 normals[ i ][ 0 ] = ct( 2*int( i )-1 );\n- 320 }\n- 321\n- 322 return 2;\n- 323 }\n- 324 }\n- 325\n- 326 template< class ct, int cdim >\n- 327 inline unsigned int\n- 328 referenceIntegrationOuterNormals ( unsigned int topologyId, int dim,\n- 329 FieldVector< ct, cdim > *normals )\n- 330 {\n- 331 assert( (dim > 0) && (dim <= cdim) );\n- 332\n- 333 FieldVector< ct, cdim > *origins\n- 334 = new FieldVector< ct, cdim >[ size( topologyId, dim, 1 ) ];\n- 335 referenceOrigins( topologyId, dim, 1, origins );\n- 336\n- 337 const unsigned int numFaces\n- 338 = referenceIntegrationOuterNormals( topologyId, dim, origins, normals );\n- 339 assert( numFaces == size( topologyId, dim, 1 ) );\n- 340\n- 341 delete[] origins;\n- 342\n- 343 return numFaces;\n- 344 }\n- 345\n- 346 } // namespace Impl\n- 347\n- 348\n- 349\n- 350 // ReferenceElement\n- 351 // ----------------\n- 352\n- 371 template< class ctype_, int dim >\n- 372 class ReferenceElementImplementation\n- 373 {\n- 374\n- 375 public:\n- 376\n- 378 using ctype = ctype_;\n- 379\n- 381 using CoordinateField = ctype;\n- 382\n- 384 using Coordinate = Dune::FieldVector;\n- 385\n- 387 static constexpr int dimension = dim;\n- 388\n- 390 typedef ctype Volume;\n- 391\n- 392 private:\n- 393\n- 394 friend class Impl::ReferenceElementContainer< ctype, dim >;\n- 395\n- 396 struct SubEntityInfo;\n- 397\n- 398 template< int codim > struct CreateGeometries;\n- 399\n- 400 public:\n- 402 template< int codim >\n- 403 struct Codim\n- 404 {\n- 406 typedef AffineGeometry< ctype, dim-codim, dim > Geometry;\n- 407 };\n- 408\n- 409 // ReferenceElement cannot be copied.\n- 410 ReferenceElementImplementation ( const ReferenceElementImplementation& ) =\n-delete;\n- 411\n- 412 // ReferenceElementImplementation cannot be copied.\n- 413 ReferenceElementImplementation& operator= ( const\n-ReferenceElementImplementation& ) = delete;\n- 414\n- 415 // ReferenceElementImplementation is default-constructible (required for\n-storage in std::array)\n- 416 ReferenceElementImplementation () = default;\n- 417\n- 422 int size ( int c ) const\n- 423 {\n- 424 assert( (c >= 0) && (c <= dim) );\n- 425 return info_[ c ].size();\n- 426 }\n- 427\n- 439 int size ( int i, int c, int cc ) const\n- 440 {\n- 441 assert( (i >= 0) && (i < size( c )) );\n- 442 return info_[ c ][ i ].size( cc );\n- 443 }\n- 444\n- 458 int subEntity ( int i, int c, int ii, int cc ) const\n- 459 {\n- 460 assert( (i >= 0) && (i < size( c )) );\n- 461 return info_[ c ][ i ].number( ii, cc );\n- 462 }\n- 463\n- 479 auto subEntities ( int i, int c, int cc ) const\n- 480 {\n- 481 assert( (i >= 0) && (i < size( c )) );\n- 482 return info_[ c ][ i ].numbers( cc );\n- 483 }\n- 484\n- 493 const GeometryType &type ( int i, int c ) const\n- 494 {\n- 495 assert( (i >= 0) && (i < size( c )) );\n- 496 return info_[ c ][ i ].type();\n- 497 }\n- 498\n- 500 const GeometryType &type () const { return type( 0, 0 ); }\n- 501\n- 511 const Coordinate &position( int i, int c ) const\n- 512 {\n- 513 assert( (c >= 0) && (c <= dim) );\n- 514 return baryCenters_[ c ][ i ];\n- 515 }\n- 516\n- 524 bool checkInside ( const Coordinate &local ) const\n- 525 {\n- 526 const ctype tolerance = ctype( 64 ) * std::numeric_limits< ctype >::\n-epsilon();\n- 527 return Impl::template checkInside< ctype, dim >( type().id(), dim, local,\n-tolerance );\n- 528 }\n- 529\n- 541 template< int codim >\n- 542 typename Codim< codim >::Geometry geometry ( int i ) const\n- 543 {\n- 544 return std::get< codim >( geometries_ )[ i ];\n- 545 }\n- 546\n- 548 Volume volume () const\n- 549 {\n- 550 return volume_;\n- 551 }\n- 552\n- 560 const Coordinate &integrationOuterNormal ( int face ) const\n- 561 {\n- 562 assert( (face >= 0) && (face < int( integrationNormals_.size() )) );\n- 563 return integrationNormals_[ face ];\n- 564 }\n- 565\n- 566 private:\n- 567 void initialize ( unsigned int topologyId )\n- 568 {\n- 569 assert( topologyId < Impl::numTopologies( dim ) );\n- 570\n- 571 // set up subentities\n- 572 for( int codim = 0; codim <= dim; ++codim )\n- 573 {\n- 574 const unsigned int size = Impl::size( topologyId, dim, codim );\n- 575 info_[ codim ].resize( size );\n- 576 for( unsigned int i = 0; i < size; ++i )\n- 577 info_[ codim ][ i ].initialize( topologyId, codim, i );\n- 578 }\n- 579\n- 580 // compute corners\n- 581 const unsigned int numVertices = size( dim );\n- 582 baryCenters_[ dim ].resize( numVertices );\n- 583 Impl::referenceCorners( topologyId, dim, &(baryCenters_[ dim ][ 0 ]) );\n- 584\n- 585 // compute barycenters\n- 586 for( int codim = 0; codim < dim; ++codim )\n- 587 {\n- 588 baryCenters_[ codim ].resize( size(codim) );\n- 589 for( int i = 0; i < size( codim ); ++i )\n- 590 {\n- 591 baryCenters_[ codim ][ i ] = Coordinate( ctype( 0 ) );\n- 592 const unsigned int numCorners = size( i, codim, dim );\n- 593 for( unsigned int j = 0; j < numCorners; ++j )\n- 594 baryCenters_[ codim ][ i ] += baryCenters_[ dim ][ subEntity( i, codim, j,\n-dim ) ];\n- 595 baryCenters_[ codim ][ i ] *= ctype( 1 ) / ctype( numCorners );\n- 596 }\n- 597 }\n- 598\n- 599 // compute reference element volume\n- 600 volume_ = Impl::template referenceVolume< ctype >( topologyId, dim );\n- 601\n- 602 // compute integration outer normals\n- 603 if( dim > 0 )\n- 604 {\n- 605 integrationNormals_.resize( size( 1 ) );\n- 606 Impl::referenceIntegrationOuterNormals( topologyId, dim, &\n-(integrationNormals_[ 0 ]) );\n- 607 }\n- 608\n- 609 // set up geometries\n- 610 Hybrid::forEach( std::make_index_sequence< dim+1 >{}, [ & ]( auto i )\n-{ CreateGeometries< i >::apply( *this, geometries_ ); } );\n- 611 }\n- 612\n- 613 template< int... codim >\n- 614 static std::tuple< std::vector< typename Codim< codim >::Geometry >... >\n- 615 makeGeometryTable ( std::integer_sequence< int, codim... > );\n- 616\n- 618 typedef decltype( makeGeometryTable( std::make_integer_sequence< int,\n-dim+1 >() ) ) GeometryTable;\n- 619\n- 621 ctype volume_;\n- 622\n- 623 std::vector< Coordinate > baryCenters_[ dim+1 ];\n- 624 std::vector< Coordinate > integrationNormals_;\n- 625\n- 627 GeometryTable geometries_;\n- 628\n- 629 std::vector< SubEntityInfo > info_[ dim+1 ];\n- 630 };\n- 631\n- 633 template< class ctype, int dim >\n- 634 struct ReferenceElementImplementation< ctype, dim >::SubEntityInfo\n- 635 {\n- 636 // Compute upper bound for the number of subsentities.\n- 637 // If someone knows an explicit formal feel free to\n- 638 // implement it here.\n- 639 static constexpr std::size_t maxSubEntityCount()\n- 640 {\n- 641 std::size_t maxCount=0;\n- 642 for(std::size_t codim=0; codim<=dim; ++codim)\n- 643 maxCount = std::max(maxCount, binomial(std::size_t(dim),codim)*(1 <<\n-codim));\n- 644 return maxCount;\n- 645 }\n- 646\n- 647 using SubEntityFlags = std::bitset;\n- 648\n- 649 class SubEntityRange\n- 650 : public Dune::IteratorRange\n- 651 {\n- 652 using Base = typename Dune::IteratorRange;\n- 653\n- 654 public:\n- 655\n- 656 using iterator = Base::iterator;\n- 657 using const_iterator = Base::const_iterator;\n- 658\n- 659 SubEntityRange(const iterator& begin, const iterator& end, const\n-SubEntityFlags& contains) :\n- 660 Base(begin, end),\n- 661 containsPtr_(&contains),\n- 662 size_(end-begin)\n- 663 {}\n- 664\n- 665 SubEntityRange() :\n- 666 Base(),\n- 667 containsPtr_(nullptr),\n- 668 size_(0)\n- 669 {}\n- 670\n- 671 std::size_t size() const\n- 672 {\n- 673 return size_;\n- 674 }\n- 675\n- 676 bool contains(std::size_t i) const\n- 677 {\n- 678 return (*containsPtr_)[i];\n- 679 }\n- 680\n- 681 private:\n- 682 const SubEntityFlags* containsPtr_;\n- 683 std::size_t size_;\n- 684 std::size_t offset_;\n- 685 };\n- 686\n- 687 using NumberRange = typename Dune::IteratorRange;\n- 688\n- 689 SubEntityInfo ()\n- 690 : numbering_( nullptr )\n- 691 {\n- 692 std::fill( offset_.begin(), offset_.end(), 0 );\n- 693 }\n- 694\n- 695 SubEntityInfo ( const SubEntityInfo &other )\n- 696 : offset_( other.offset_ ),\n- 697 type_( other.type_ ),\n- 698 containsSubentity_( other.containsSubentity_ )\n- 699 {\n- 700 numbering_ = allocate();\n- 701 std::copy( other.numbering_, other.numbering_ + capacity(), numbering_ );\n- 702 }\n- 703\n- 704 ~SubEntityInfo () { deallocate( numbering_ ); }\n- 705\n- 706 const SubEntityInfo &operator= ( const SubEntityInfo &other )\n- 707 {\n- 708 type_ = other.type_;\n- 709 offset_ = other.offset_;\n- 710\n- 711 deallocate( numbering_ );\n- 712 numbering_ = allocate();\n- 713 std::copy( other.numbering_, other.numbering_ + capacity(), numbering_ );\n- 714\n- 715 containsSubentity_ = other.containsSubentity_;\n- 716\n- 717 return *this;\n- 718 }\n- 719\n- 720 int size ( int cc ) const\n- 721 {\n- 722 assert( (cc >= 0) && (cc <= dim) );\n- 723 return (offset_[ cc+1 ] - offset_[ cc ]);\n- 724 }\n- 725\n- 726 int number ( int ii, int cc ) const\n- 727 {\n- 728 assert( (ii >= 0) && (ii < size( cc )) );\n- 729 return numbering_[ offset_[ cc ] + ii ];\n- 730 }\n- 731\n- 732 auto numbers ( int cc ) const\n- 733 {\n- 734 return SubEntityRange( numbering_ + offset_[ cc ], numbering_ + offset_\n-[ cc+1 ], containsSubentity_[cc]);\n- 735 }\n- 736\n- 737 const GeometryType &type () const { return type_; }\n- 738\n- 739 void initialize ( unsigned int topologyId, int codim, unsigned int i )\n- 740 {\n- 741 const unsigned int subId = Impl::subTopologyId( topologyId, dim, codim, i\n-);\n- 742 type_ = GeometryType( subId, dim-codim );\n- 743\n- 744 // compute offsets\n- 745 for( int cc = 0; cc <= codim; ++cc )\n- 746 offset_[ cc ] = 0;\n- 747 for( int cc = codim; cc <= dim; ++cc )\n- 748 offset_[ cc+1 ] = offset_[ cc ] + Impl::size( subId, dim-codim, cc-codim\n-);\n- 749\n- 750 // compute subnumbering\n- 751 deallocate( numbering_ );\n- 752 numbering_ = allocate();\n- 753 for( int cc = codim; cc <= dim; ++cc )\n- 754 Impl::subTopologyNumbering( topologyId, dim, codim, i, cc-codim,\n-numbering_+offset_[ cc ], numbering_+offset_[ cc+1 ] );\n- 755\n- 756 // initialize containsSubentity lookup-table\n- 757 for(std::size_t cc=0; cc<= dim; ++cc)\n- 758 {\n- 759 containsSubentity_[cc].reset();\n- 760 for(std::size_t idx=0; idx offset_;\n- 775 GeometryType type_;\n- 776 std::array< SubEntityFlags, dim+1> containsSubentity_;\n- 777 };\n- 778\n- 779\n- 780 template< class ctype, int dim >\n- 781 template< int codim >\n- 782 struct ReferenceElementImplementation< ctype, dim >::CreateGeometries\n- 783 {\n- 784 template< int cc >\n- 785 static typename ReferenceElements< ctype, dim-cc >::ReferenceElement\n- 786 subRefElement( const ReferenceElementImplementation< ctype, dim >\n-&refElement, int i, std::integral_constant< int, cc > )\n- 787 {\n- 788 return ReferenceElements<_ctype,_dim-cc_>::general( refElement.type( i, cc\n-) );\n- 789 }\n- 790\n- 791 static typename ReferenceElements<_ctype,_dim_>::ReferenceElement\n- 792 subRefElement(const ReferenceElementImplementation< ctype, dim >\n-&refElement,\n- 793 [[maybe_unused]] int i, std::integral_constant)\n- 794 {\n- 795 return refElement;\n- 796 }\n- 797\n- 798 static void apply ( const ReferenceElementImplementation< ctype, dim >\n-&refElement, GeometryTable &geometries )\n- 799 {\n- 800 const int size = refElement.size( codim );\n- 801 std::vector< FieldVector< ctype, dim > > origins( size );\n- 802 std::vector< FieldMatrix< ctype, dim - codim, dim > > jacobianTransposeds\n-( size );\n- 803 Impl::referenceEmbeddings( refElement.type().id(), dim, codim, &(origins\n-[ 0 ]), &(jacobianTransposeds[ 0 ]) );\n- 804\n- 805 std::get< codim >( geometries ).reserve( size );\n- 806 for( int i = 0; i < size; ++i )\n- 807 {\n- 808 typename Codim< codim >::Geometry geometry( subRefElement( refElement, i,\n-std::integral_constant< int, codim >() ), origins[ i ], jacobianTransposeds[ i\n-] );\n- 809 std::get< codim >( geometries ).push_back( geometry );\n- 810 }\n- 811 }\n- 812 };\n- 813\n- 814#endif // DOXYGEN\n- 815\n- 816 } // namespace Geo\n- 817\n- 818} // namespace Dune\n- 819\n- 820#endif // #ifndef DUNE_GEOMETRY_REFERENCEELEMENTIMPLEMENTATION_HH\n-referenceelement.hh\n+177 typedef IndexVector;\n+ 178#endif\n+ 179\n+180 typedef typename RefinementImp::Traits< topologyId, CoordType, coerceToId,\n+dimension_>::Imp RefinementImp;\n+ 181\n+ 182 using RefinementImp::dimension;\n+ 183\n+ 184 using RefinementImp::Codim;\n+ 185\n+ 186 using typename RefinementImp::VertexIterator;\n+ 187 using typename RefinementImp::CoordVector;\n+ 188\n+ 189 using typename RefinementImp::ElementIterator;\n+ 190 using typename RefinementImp::IndexVector;\n+ 191\n+197 static int nVertices(Dune::RefinementIntervals tag)\n+ 198 {\n+ 199 return RefinementImp::nVertices(tag.intervals());\n+ 200 }\n+ 201\n+207 static VertexIterator vBegin(Dune::RefinementIntervals tag)\n+ 208 {\n+ 209 return RefinementImp::vBegin(tag.intervals());\n+ 210 }\n+ 211\n+217 static VertexIterator vEnd(Dune::RefinementIntervals tag)\n+ 218 {\n+ 219 return RefinementImp::vEnd(tag.intervals());\n+ 220 }\n+ 221\n+227 static int nElements(Dune::RefinementIntervals tag)\n+ 228 {\n+ 229 return RefinementImp::nElements(tag.intervals());\n+ 230 }\n+ 231\n+237 static ElementIterator eBegin(Dune::RefinementIntervals tag)\n+ 238 {\n+ 239 return RefinementImp::eBegin(tag.intervals());\n+ 240 }\n+ 241\n+247 static ElementIterator eEnd(Dune::RefinementIntervals tag)\n+ 248 {\n+ 249 return RefinementImp::eEnd(tag.intervals());\n+ 250 }\n+ 251 };\n+ 252\n+ 254} // namespace Dune\n+ 255\n+ 256#endif // DUNE_GEOMETRY_REFINEMENT_BASE_CC\n type.hh\n A unique label for each type of element that can occur in a grid.\n-affinegeometry.hh\n-An implementation of the Geometry interface for affine geometries.\n+Dune::refinementIntervals\n+RefinementIntervals refinementIntervals(int intervals)\n+Creates a RefinementIntervals object.\n+Definition base.cc:108\n+Dune::refinementLevels\n+RefinementIntervals refinementLevels(int levels)\n+Creates a RefinementIntervals object.\n+Definition base.cc:117\n Dune\n Definition affinegeometry.hh:21\n-Dune::QuadratureType::size\n-@ size\n-Definition quadraturerules.hh:145\n-Dune::RefinementImp::Simplex::binomial\n-int binomial(int upper, int lower)\n-calculate\n-Definition simplex.cc:305\n-Dune::Geo::ReferenceElements::ReferenceElement\n-typename Container::ReferenceElement ReferenceElement\n-The reference element type.\n-Definition referenceelements.hh:188\n-Dune::Geo::ReferenceElements::general\n-static const ReferenceElement & general(const GeometryType &type)\n-get general reference elements\n-Definition referenceelements.hh:198\n+Dune::RefinementImp::Traits\n+Mapping from geometryType, CoordType and coerceTo to a particular Refinement\n+implementation.\n+Definition base.cc:70\n+Dune::RefinementIntervals\n+Holds the number of refined intervals per axis needed for virtual and static\n+refinement.\n+Definition base.cc:94\n+Dune::RefinementIntervals::RefinementIntervals\n+RefinementIntervals(int i)\n+Definition base.cc:98\n+Dune::RefinementIntervals::intervals\n+int intervals() const\n+Definition base.cc:100\n+Dune::StaticRefinement\n+Wrap each Refinement implementation to get a consistent interface.\n+Definition base.cc:141\n+Dune::StaticRefinement::eEnd\n+static ElementIterator eEnd(Dune::RefinementIntervals tag)\n+Get an ElementIterator.\n+Definition base.cc:247\n+Dune::StaticRefinement::eBegin\n+static ElementIterator eBegin(Dune::RefinementIntervals tag)\n+Get an ElementIterator.\n+Definition base.cc:237\n+Dune::StaticRefinement::nElements\n+static int nElements(Dune::RefinementIntervals tag)\n+Get the number of Elements.\n+Definition base.cc:227\n+Dune::StaticRefinement::ElementIterator\n+Codim< 0 >::SubEntityIterator ElementIterator\n+The ElementIterator of the Refinement.\n+Definition base.cc:163\n+Dune::StaticRefinement::nVertices\n+static int nVertices(Dune::RefinementIntervals tag)\n+Get the number of Vertices.\n+Definition base.cc:197\n+Dune::StaticRefinement::vBegin\n+static VertexIterator vBegin(Dune::RefinementIntervals tag)\n+Get a VertexIterator.\n+Definition base.cc:207\n+Dune::StaticRefinement::VertexIterator\n+Codim< dimension >::SubEntityIterator VertexIterator\n+The VertexIterator of the Refinement.\n+Definition base.cc:161\n+Dune::StaticRefinement::CoordVector\n+typedef CoordVector\n+The CoordVector of the Refinement.\n+Definition base.cc:170\n+Dune::StaticRefinement::IndexVector\n+typedef IndexVector\n+The IndexVector of the Refinement.\n+Definition base.cc:177\n+Dune::StaticRefinement::RefinementImp\n+RefinementImp::Traits< topologyId, CoordType, coerceToId, dimension_ >::Imp\n+RefinementImp\n+Definition base.cc:180\n+Dune::StaticRefinement::vEnd\n+static VertexIterator vEnd(Dune::RefinementIntervals tag)\n+Get a VertexIterator.\n+Definition base.cc:217\n+Dune::StaticRefinement::Codim\n+The Codim struct inherited from the Refinement implementation.\n+Definition base.cc:151\n+Dune::StaticRefinement::Codim::SubEntityIterator\n+typedef SubEntityIterator\n+The SubEntityIterator for each codim.\n+Definition base.cc:157\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00212.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00212.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: dimension.hh File Reference\n+dune-geometry: pyramidtriangulation.cc File Reference\n \n \n \n \n \n \n \n@@ -65,42 +65,86 @@\n \n \n \n \n \n \n \n
    \n \n-
    dimension.hh File Reference
    \n+Namespaces |\n+Macros |\n+Functions
    \n+
    pyramidtriangulation.cc File Reference
    \n \n
    \n-
    #include <type_traits>
    \n+
    #include <dune/common/fvector.hh>
    \n+#include <dune/common/typetraits.hh>
    \n+#include <dune/geometry/referenceelements.hh>
    \n+#include <dune/geometry/type.hh>
    \n+#include "base.cc"
    \n+#include "simplex.cc"
    \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 Classes

    struct  Dune::Dim< dim >
     Static tag representing a dimension. More...
    class  Dune::RefinementImp::PyramidTriangulation::RefinementImp< dimension_, CoordType >
     Implementation of the refinement of a pyramid into simplices. More...
     
    struct  Dune::Codim< codim >
     Static tag representing a codimension. More...
    struct  Dune::RefinementImp::PyramidTriangulation::RefinementImp< dimension_, CoordType >::Codim< codimension >
     
    class  Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< dimension, CoordType, dimension >
     
    class  Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< dimension, CoordType, 0 >
     
    class  Dune::RefinementImp::PyramidTriangulation::RefinementImp< dimension_, CoordType >::Codim< codimension >
     
    \n \n \n \n+\n+\n+\n+\n+\n+\n+

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::RefinementImp
     This namespace contains the implementation of Refinement.
     
    namespace  Dune::RefinementImp::PyramidTriangulation
     This namespace contains the Refinement implementation for triangulating pyramids (GeometryType::pyramid -> GeometryType::simplex)
     
    \n+\n+\n+\n+

    \n+Macros

    #define DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC
     
    \n+\n+\n+\n+\n

    \n+Functions

    template<int dimension, class CoordType >
    FieldVector< CoordType, dimension > Dune::RefinementImp::PyramidTriangulation::transformCoordinate (FieldVector< CoordType, dimension > point)
     
    \n+

    Macro Definition Documentation

    \n+\n+

    ◆ DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC

    \n+\n+
    \n+
    \n+ \n+ \n+ \n+ \n+
    #define DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC
    \n+
    \n+\n+
    \n+
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,24 +6,61 @@\n dune-geometry\u00a02.9.0\n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n-Classes | Namespaces\n-dimension.hh File Reference\n-#include \n+ * refinement\n+Classes | Namespaces | Macros | Functions\n+pyramidtriangulation.cc File Reference\n+#include \n+#include \n+#include \n+#include \n+#include \"base.cc\"\n+#include \"simplex.cc\"\n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0Dune::Dim<_dim_>\n-\u00a0 Static tag representing a dimension. More...\n+ class \u00a0Dune::RefinementImp::PyramidTriangulation::RefinementImp<_dimension_,\n+ CoordType_>\n+\u00a0 Implementation of the refinement of a pyramid into simplices. More...\n \u00a0\n-struct \u00a0Dune::Codim<_codim_>\n-\u00a0 Static tag representing a codimension. More...\n+struct \u00a0Dune::RefinementImp::PyramidTriangulation::RefinementImp<_dimension_,\n+ CoordType_>::Codim<_codimension_>\n+\u00a0\n+ class \u00a0Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n+ dimension,_CoordType,_dimension_>\n+\u00a0\n+ class \u00a0Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n+ dimension,_CoordType,_0_>\n+\u00a0\n+ class \u00a0Dune::RefinementImp::PyramidTriangulation::RefinementImp<_dimension_,\n+ CoordType_>::Codim<_codimension_>\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n+namespace \u00a0Dune::RefinementImp\n+\u00a0 This namespace contains the implementation of Refinement.\n+\u00a0\n+namespace \u00a0Dune::RefinementImp::PyramidTriangulation\n+ This namespace contains the Refinement implementation for\n+\u00a0 triangulating pyramids (GeometryType::pyramid -> GeometryType::\n+ simplex)\n+\u00a0\n+ Macros\n+#define\u00a0DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC\n+\u00a0\n+ Functions\n+template\n+FieldVector< CoordType, dimension >\u00a0Dune::RefinementImp::\n+ PyramidTriangulation::transformCoordinate\n+ (FieldVector< CoordType, dimension >\n+ point)\n+\u00a0\n+***** Macro Definition Documentation *****\n+***** \u25c6\u00a0DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC *****\n+#define DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00212_source.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00212_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: dimension.hh Source File\n+dune-geometry: pyramidtriangulation.cc Source File\n \n \n \n \n \n \n \n@@ -70,58 +70,523 @@\n
    \n \n \n \n \n \n \n
    \n-
    dimension.hh
    \n+
    pyramidtriangulation.cc
    \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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
    \n
    4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n-
    5#ifndef DUNE_GEOMETRY_DIMENSION_HH
    \n-
    6#define DUNE_GEOMETRY_DIMENSION_HH
    \n+
    5#ifndef DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC
    \n+
    6#define DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC
    \n
    7
    \n-
    8#include <type_traits>
    \n-
    9
    \n-
    10namespace Dune {
    \n-
    11
    \n-
    13 template<int dim>
    \n-
    \n-
    14 struct Dim
    \n-
    15 : public std::integral_constant<int,dim>
    \n-
    16 {
    \n-
    17 typedef Dim type;
    \n-
    18 };
    \n-
    \n-
    19
    \n-
    21 template<int codim>
    \n-
    \n-
    22 struct Codim
    \n-
    23 : public std::integral_constant<int,codim>
    \n-
    24 {
    \n-
    25 typedef Codim type;
    \n-
    26 };
    \n-
    \n-
    27
    \n-
    28}
    \n-
    29
    \n-
    30#endif // DUNE_GEOMETRY_DIMENSION_HH
    \n+
    8#include <dune/common/fvector.hh>
    \n+
    9#include <dune/common/typetraits.hh>
    \n+
    10
    \n+\n+
    12#include <dune/geometry/type.hh>
    \n+
    13
    \n+
    14#include "base.cc"
    \n+
    15#include "simplex.cc"
    \n+
    16
    \n+
    17namespace Dune
    \n+
    18{
    \n+
    19 namespace RefinementImp
    \n+
    20 {
    \n+
    \n+
    26 namespace PyramidTriangulation
    \n+
    27 {
    \n+
    28 // ////////////
    \n+
    29 //
    \n+
    30 // Utilities
    \n+
    31 //
    \n+
    32
    \n+\n+\n+
    35
    \n+
    36 // ////////////////////////////////////
    \n+
    37 //
    \n+
    38 // Refine a pyramid with simplices
    \n+
    39 //
    \n+
    40
    \n+
    41 // forward declaration of the iterator base
    \n+
    42 template<int dimension, class CoordType, int codimension>
    \n+\n+
    44
    \n+
    45 /*
    \n+
    46 * The permutations 0 and 1 of the Kuhn-decomposition of a cube into simplices form a pyramid.
    \n+
    47 * The resulting pyramid is not oriented the same as the reference pyramid and so the Kuhn-coordinates
    \n+
    48 * have to be transformed using the method below.
    \n+
    49 */
    \n+
    50 template<int dimension, class CoordType> FieldVector<CoordType, dimension>
    \n+
    \n+
    51 transformCoordinate( FieldVector<CoordType, dimension> point)
    \n+
    52 {
    \n+
    53 FieldVector<CoordType, dimension> transform;
    \n+
    54 transform[0]=1-point[0];
    \n+
    55 transform[1]=1-point[1];
    \n+
    56 transform[2]=point[2];
    \n+
    57 return transform;
    \n+
    58 }
    \n+
    \n+
    59
    \n+
    66 template<int dimension_, class CoordType>
    \n+
    \n+\n+
    68 {
    \n+
    69 public:
    \n+
    70 constexpr static int dimension = dimension_;
    \n+
    71
    \n+
    72 typedef CoordType ctype;
    \n+
    73
    \n+
    74 template<int codimension>
    \n+
    75 struct Codim;
    \n+\n+
    77 typedef FieldVector<CoordType, dimension> CoordVector;
    \n+\n+
    79 typedef FieldVector<int, dimension+1> IndexVector;
    \n+
    80
    \n+
    81 static int nVertices(int nIntervals);
    \n+
    82 static VertexIterator vBegin(int nIntervals);
    \n+
    83 static VertexIterator vEnd(int nIntervals);
    \n+
    84
    \n+
    85 static int nElements(int nIntervals);
    \n+
    86 static ElementIterator eBegin(int nIntervals);
    \n+
    87 static ElementIterator eEnd(int nIntervals);
    \n+
    88
    \n+
    89 private:
    \n+
    90 friend class RefinementIteratorSpecial<dimension, CoordType, 0>;
    \n+
    91 friend class RefinementIteratorSpecial<dimension, CoordType, dimension>;
    \n+
    92
    \n+\n+
    94
    \n+
    95 constexpr static int nKuhnSimplices = 2;
    \n+
    96 };
    \n+
    \n+
    97
    \n+
    98 template<int dimension, class CoordType>
    \n+
    99 template<int codimension>
    \n+
    \n+
    100 struct RefinementImp<dimension, CoordType>::Codim
    \n+
    101 {
    \n+
    102 class SubEntityIterator;
    \n+\n+
    104 };
    \n+
    \n+
    105
    \n+
    106 template<int dimension, class CoordType>
    \n+
    107 int
    \n+
    \n+\n+
    109 nVertices(int nIntervals)
    \n+
    110 {
    \n+
    111 return BackendRefinement::nVertices(nIntervals) * nKuhnSimplices;
    \n+
    112 }
    \n+
    \n+
    113
    \n+
    114 template<int dimension, class CoordType>
    \n+\n+
    \n+\n+
    117 vBegin(int nIntervals)
    \n+
    118 {
    \n+
    119 return VertexIterator(nIntervals);
    \n+
    120 }
    \n+
    \n+
    121
    \n+
    122 template<int dimension, class CoordType>
    \n+\n+
    \n+\n+
    125 vEnd(int nIntervals)
    \n+
    126 {
    \n+
    127 return VertexIterator(nIntervals, true);
    \n+
    128 }
    \n+
    \n+
    129
    \n+
    130 template<int dimension, class CoordType>
    \n+
    131 int
    \n+
    \n+\n+
    133 nElements(int nIntervals)
    \n+
    134 {
    \n+
    135 return BackendRefinement::nElements(nIntervals) * nKuhnSimplices;
    \n+
    136 }
    \n+
    \n+
    137
    \n+
    138 template<int dimension, class CoordType>
    \n+\n+
    \n+\n+
    141 eBegin(int nIntervals)
    \n+
    142 {
    \n+
    143 return ElementIterator(nIntervals);
    \n+
    144 }
    \n+
    \n+
    145
    \n+
    146 template<int dimension, class CoordType>
    \n+\n+
    \n+\n+
    149 eEnd(int nIntervals)
    \n+
    150 {
    \n+
    151 return ElementIterator(nIntervals, true);
    \n+
    152 }
    \n+
    \n+
    153
    \n+
    154 // //////////////
    \n+
    155 //
    \n+
    156 // The iterator
    \n+
    157 //
    \n+
    158
    \n+
    159 // vertices
    \n+
    160 template<int dimension, class CoordType>
    \n+
    \n+
    161 class RefinementIteratorSpecial<dimension, CoordType, dimension>
    \n+
    162 {
    \n+
    163 public:
    \n+\n+
    165 typedef typename Refinement::CoordVector CoordVector;
    \n+
    166 typedef typename Refinement::template Codim<dimension>::Geometry Geometry;
    \n+
    167
    \n+
    168 RefinementIteratorSpecial(int nIntervals, bool end = false);
    \n+
    169
    \n+
    170 void increment();
    \n+
    171
    \n+
    172 CoordVector coords() const;
    \n+
    173
    \n+
    174 Geometry geometry() const;
    \n+
    175
    \n+
    176 int index() const;
    \n+
    177 protected:
    \n+
    178 typedef typename Refinement::BackendRefinement BackendRefinement;
    \n+
    179 typedef typename BackendRefinement::template Codim<dimension>::SubEntityIterator BackendIterator;
    \n+
    180 constexpr static int nKuhnSimplices = 2;
    \n+
    181
    \n+\n+
    183
    \n+\n+\n+\n+
    187 };
    \n+
    \n+
    188
    \n+
    189 template<int dimension, class CoordType>
    \n+
    \n+\n+
    191 RefinementIteratorSpecial(int nIntervals, bool end)
    \n+
    192 : nIntervals_(nIntervals), kuhnIndex(0),
    \n+
    193 backend(BackendRefinement::vBegin(nIntervals_)),
    \n+
    194 backendEnd(BackendRefinement::vEnd(nIntervals_))
    \n+
    195 {
    \n+
    196 if (end)
    \n+
    197 kuhnIndex = nKuhnSimplices;
    \n+
    198 }
    \n+
    \n+
    199
    \n+
    200 template<int dimension, class CoordType>
    \n+
    201 void
    \n+
    \n+\n+\n+
    204 {
    \n+
    205 ++backend;
    \n+
    206 if(backend == backendEnd)
    \n+
    207 {
    \n+
    208 backend = BackendRefinement::vBegin(nIntervals_);
    \n+
    209 ++kuhnIndex;
    \n+
    210 }
    \n+
    211 }
    \n+
    \n+
    212
    \n+
    213 template<int dimension, class CoordType>
    \n+\n+
    \n+\n+
    216 coords() const
    \n+
    217 {
    \n+
    218 return transformCoordinate(referenceToKuhn(backend.coords(),
    \n+
    219 getPermutation<dimension>(kuhnIndex)));
    \n+
    220 }
    \n+
    \n+
    221
    \n+
    222 template<int dimension, class CoordType>
    \n+\n+
    \n+\n+
    225 {
    \n+
    226 std::vector<CoordVector> corners(1);
    \n+
    227 corners[0] = referenceToKuhn(backend.coords(), getPermutation<dimension>(kuhnIndex));
    \n+
    228 return Geometry(GeometryTypes::vertex, corners);
    \n+
    229 }
    \n+
    \n+
    230
    \n+
    231 template<int dimension, class CoordType>
    \n+
    232 int
    \n+
    \n+\n+
    234 index() const
    \n+
    235 {
    \n+
    236 return kuhnIndex*BackendRefinement::nVertices(nIntervals_) + backend.index();
    \n+
    237 }
    \n+
    \n+
    238
    \n+
    239 // elements
    \n+
    240 template<int dimension, class CoordType>
    \n+
    \n+
    241 class RefinementIteratorSpecial<dimension, CoordType, 0>
    \n+
    242 {
    \n+
    243 public:
    \n+\n+\n+\n+
    247 typedef typename Refinement::template Codim<0>::Geometry Geometry;
    \n+
    248
    \n+
    249 RefinementIteratorSpecial(int nIntervals, bool end = false);
    \n+
    250
    \n+
    251 void increment();
    \n+
    252
    \n+
    253 IndexVector vertexIndices() const;
    \n+
    254 int index() const;
    \n+
    255 CoordVector coords() const;
    \n+
    256
    \n+
    257 Geometry geometry() const;
    \n+
    258
    \n+
    259 private:
    \n+
    260 CoordVector global(const CoordVector &local) const;
    \n+
    261
    \n+
    262 protected:
    \n+\n+
    264 typedef typename BackendRefinement::template Codim<0>::SubEntityIterator BackendIterator;
    \n+
    265 constexpr static int nKuhnSimplices = 2;
    \n+
    266
    \n+\n+
    268
    \n+\n+\n+\n+
    272 };
    \n+
    \n+
    273
    \n+
    274 template<int dimension, class CoordType>
    \n+
    \n+\n+
    276 RefinementIteratorSpecial(int nIntervals, bool end)
    \n+
    277 : nIntervals_(nIntervals), kuhnIndex(0),
    \n+
    278 backend(BackendRefinement::eBegin(nIntervals_)),
    \n+
    279 backendEnd(BackendRefinement::eEnd(nIntervals_))
    \n+
    280 {
    \n+
    281 if (end)
    \n+
    282 kuhnIndex = nKuhnSimplices;
    \n+
    283 }
    \n+
    \n+
    284
    \n+
    285 template<int dimension, class CoordType>
    \n+
    286 void
    \n+
    \n+\n+\n+
    289 {
    \n+
    290 ++backend;
    \n+
    291 if (backend == backendEnd)
    \n+
    292 {
    \n+
    293 backend = BackendRefinement::eBegin(nIntervals_);
    \n+
    294 ++kuhnIndex;
    \n+
    295 }
    \n+
    296 }
    \n+
    \n+
    297
    \n+
    298 template<int dimension, class CoordType>
    \n+\n+
    \n+\n+
    301 vertexIndices() const
    \n+
    302 {
    \n+
    303 IndexVector indices = backend.vertexIndices();
    \n+
    304
    \n+
    305 int base = kuhnIndex * BackendRefinement::nVertices(nIntervals_);
    \n+
    306 indices += base;
    \n+
    307
    \n+
    308 return indices;
    \n+
    309 }
    \n+
    \n+
    310
    \n+
    311 template<int dimension, class CoordType>
    \n+
    312 int
    \n+
    \n+\n+
    314 index() const
    \n+
    315 {
    \n+
    316 return kuhnIndex*BackendRefinement::nElements(nIntervals_) + backend.index();
    \n+
    317 }
    \n+
    \n+
    318
    \n+
    319 template<int dimension, class CoordType>
    \n+\n+
    \n+\n+
    322 coords() const
    \n+
    323 {
    \n+
    324 return global(backend.coords());
    \n+
    325 }
    \n+
    \n+
    326
    \n+
    327 template<int dimension, class CoordType>
    \n+\n+
    \n+\n+
    330 geometry() const
    \n+
    331 {
    \n+
    332 const typename BackendIterator::Geometry &
    \n+
    333 bgeo = backend.geometry();
    \n+
    334 std::vector<CoordVector> corners(dimension+1);
    \n+
    335 for(int i = 0; i <= dimension; ++i)
    \n+
    336 corners[i] = global(bgeo.corner(i));
    \n+
    337
    \n+
    338 return Geometry(bgeo.type(), corners);
    \n+
    339 }
    \n+
    \n+
    340
    \n+
    341 template<int dimension, class CoordType>
    \n+\n+
    343 CoordVector
    \n+\n+
    345 global(const CoordVector &local) const
    \n+
    346 {
    \n+
    347 return transformCoordinate(referenceToKuhn(local,
    \n+
    348 getPermutation<dimension>(kuhnIndex)));
    \n+
    349 }
    \n+
    350
    \n+
    351 // common
    \n+
    352 template<int dimension, class CoordType>
    \n+
    353 template<int codimension>
    \n+
    \n+
    354 class RefinementImp<dimension, CoordType>::Codim<codimension>::SubEntityIterator
    \n+
    355 : public ForwardIteratorFacade<typename RefinementImp<dimension, CoordType>::template Codim<codimension>::SubEntityIterator, int>,
    \n+
    356 public RefinementIteratorSpecial<dimension, CoordType, codimension>
    \n+
    357 {
    \n+
    358 public:
    \n+\n+
    360 typedef SubEntityIterator This;
    \n+
    361
    \n+
    362 SubEntityIterator(int nIntervals, bool end = false);
    \n+
    363
    \n+
    364 bool equals(const This &other) const;
    \n+
    365 protected:
    \n+
    366 using RefinementIteratorSpecial<dimension, CoordType, codimension>::kuhnIndex;
    \n+
    367 using RefinementIteratorSpecial<dimension, CoordType, codimension>::backend;
    \n+
    368 };
    \n+
    \n+
    369
    \n+
    370#ifndef DOXYGEN
    \n+
    371 template<int dimension, class CoordType>
    \n+
    372 template<int codimension>
    \n+\n+
    374 SubEntityIterator(int nIntervals, bool end)
    \n+
    375 : RefinementIteratorSpecial<dimension, CoordType, codimension>(nIntervals, end)
    \n+
    376 {}
    \n+
    377
    \n+
    378 template<int dimension, class CoordType>
    \n+
    379 template<int codimension>
    \n+
    380 bool
    \n+\n+
    382 equals(const This &other) const
    \n+
    383 {
    \n+
    384 return kuhnIndex == other.kuhnIndex && backend == other.backend;
    \n+
    385 }
    \n+
    386#endif
    \n+
    387
    \n+
    388 } // namespace PyramidTriangulation
    \n+
    \n+
    389 } // namespace RefinementImp
    \n+
    390
    \n+
    391 namespace RefinementImp
    \n+
    392 {
    \n+
    393 // ///////////////////////
    \n+
    394 //
    \n+
    395 // The refinement traits
    \n+
    396 //
    \n+
    397#ifndef DOXYGEN
    \n+
    398 template<unsigned topologyId, class CoordType, unsigned coerceToId>
    \n+
    399 struct Traits<
    \n+
    400 topologyId, CoordType, coerceToId, 3,
    \n+
    401 typename std::enable_if<
    \n+
    402 (GeometryTypes::pyramid.id() >> 1) ==
    \n+
    403 (topologyId >> 1) &&
    \n+
    404 (GeometryTypes::simplex(3).id() >> 1) ==
    \n+
    405 (coerceToId >> 1)
    \n+
    406 >::type>
    \n+
    407 {
    \n+
    408 typedef PyramidTriangulation::RefinementImp<3, CoordType> Imp;
    \n+
    409 };
    \n+
    410#endif
    \n+
    411
    \n+
    412 } // namespace RefinementImp
    \n+
    413} // namespace Dune
    \n+
    414
    \n+
    415#endif // DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC
    \n+
    A unique label for each type of element that can occur in a grid.
    \n+\n+
    This file contains the parts independent of a particular Refinement implementation.
    \n+
    This file contains the Refinement implementation for simplices (triangles, tetrahedrons....
    \n
    Definition affinegeometry.hh:21
    \n-
    Static tag representing a dimension.
    Definition dimension.hh:16
    \n-
    Dim type
    Definition dimension.hh:17
    \n+
    FieldVector< CoordType, dimension > transformCoordinate(FieldVector< CoordType, dimension > point)
    Definition pyramidtriangulation.cc:51
    \n+
    FieldVector< int, n > getPermutation(int m)
    Calculate permutation from it's index.
    Definition simplex.cc:336
    \n+
    FieldVector< CoordType, dimension > referenceToKuhn(FieldVector< CoordType, dimension > point, const FieldVector< int, dimension > &kuhn)
    Map from the reference simplex to some Kuhn simplex.
    Definition simplex.cc:394
    \n
    Static tag representing a codimension.
    Definition dimension.hh:24
    \n-
    Codim type
    Definition dimension.hh:25
    \n+
    generic geometry implementation based on corner coordinates
    Definition multilineargeometry.hh:181
    \n+\n+
    Implementation of the refinement of a pyramid into simplices.
    Definition pyramidtriangulation.cc:68
    \n+
    FieldVector< CoordType, dimension > CoordVector
    Definition pyramidtriangulation.cc:77
    \n+
    static int nVertices(int nIntervals)
    Definition pyramidtriangulation.cc:109
    \n+
    static int nElements(int nIntervals)
    Definition pyramidtriangulation.cc:133
    \n+
    CoordType ctype
    Definition pyramidtriangulation.cc:72
    \n+
    Codim< dimension >::SubEntityIterator VertexIterator
    Definition pyramidtriangulation.cc:76
    \n+
    Codim< 0 >::SubEntityIterator ElementIterator
    Definition pyramidtriangulation.cc:78
    \n+
    static constexpr int dimension
    Definition pyramidtriangulation.cc:70
    \n+
    static ElementIterator eBegin(int nIntervals)
    Definition pyramidtriangulation.cc:141
    \n+
    static ElementIterator eEnd(int nIntervals)
    Definition pyramidtriangulation.cc:149
    \n+
    FieldVector< int, dimension+1 > IndexVector
    Definition pyramidtriangulation.cc:79
    \n+
    static VertexIterator vBegin(int nIntervals)
    Definition pyramidtriangulation.cc:117
    \n+
    static VertexIterator vEnd(int nIntervals)
    Definition pyramidtriangulation.cc:125
    \n+\n+
    Dune::MultiLinearGeometry< CoordType, dimension-codimension, dimension > Geometry
    Definition pyramidtriangulation.cc:103
    \n+
    RefinementImp< dimension, CoordType > Refinement
    Definition pyramidtriangulation.cc:164
    \n+
    Refinement::template Codim< dimension >::Geometry Geometry
    Definition pyramidtriangulation.cc:166
    \n+
    Refinement::BackendRefinement BackendRefinement
    Definition pyramidtriangulation.cc:178
    \n+\n+
    BackendRefinement::template Codim< dimension >::SubEntityIterator BackendIterator
    Definition pyramidtriangulation.cc:179
    \n+\n+\n+\n+\n+\n+
    Refinement::CoordVector CoordVector
    Definition pyramidtriangulation.cc:246
    \n+\n+
    Refinement::template Codim< 0 >::Geometry Geometry
    Definition pyramidtriangulation.cc:247
    \n+
    Refinement::IndexVector IndexVector
    Definition pyramidtriangulation.cc:245
    \n+
    BackendRefinement::template Codim< 0 >::SubEntityIterator BackendIterator
    Definition pyramidtriangulation.cc:264
    \n+\n+\n+
    RefinementImp< dimension, CoordType > Refinement
    Definition pyramidtriangulation.cc:244
    \n+
    Refinement::BackendRefinement BackendRefinement
    Definition pyramidtriangulation.cc:263
    \n+\n+
    SubEntityIterator This
    Definition pyramidtriangulation.cc:360
    \n+\n+
    RefinementImp< dimension, CoordType > Refinement
    Definition pyramidtriangulation.cc:359
    \n+\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,55 +7,606 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n-dimension.hh\n+ * refinement\n+pyramidtriangulation.cc\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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file\n LICENSE.md in module root\n 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n- 5#ifndef DUNE_GEOMETRY_DIMENSION_HH\n- 6#define DUNE_GEOMETRY_DIMENSION_HH\n+ 5#ifndef DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC\n+6#define DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC\n 7\n- 8#include \n- 9\n- 10namespace Dune {\n- 11\n- 13 template\n-14 struct Dim\n- 15 : public std::integral_constant\n- 16 {\n-17 typedef Dim type;\n- 18 };\n- 19\n- 21 template\n-22 struct Codim\n- 23 : public std::integral_constant\n- 24 {\n-25 typedef Codim type;\n- 26 };\n- 27\n- 28}\n- 29\n- 30#endif // DUNE_GEOMETRY_DIMENSION_HH\n+ 8#include \n+ 9#include \n+ 10\n+ 11#include \n+ 12#include \n+ 13\n+ 14#include \"base.cc\"\n+ 15#include \"simplex.cc\"\n+ 16\n+ 17namespace Dune\n+ 18{\n+ 19 namespace RefinementImp\n+ 20 {\n+26 namespace PyramidTriangulation\n+ 27 {\n+ 28 // ////////////\n+ 29 //\n+ 30 // Utilities\n+ 31 //\n+ 32\n+ 33 using Simplex::getPermutation;\n+ 34 using Simplex::referenceToKuhn;\n+ 35\n+ 36 // ////////////////////////////////////\n+ 37 //\n+ 38 // Refine a pyramid with simplices\n+ 39 //\n+ 40\n+ 41 // forward declaration of the iterator base\n+ 42 template\n+43 class RefinementIteratorSpecial;\n+ 44\n+ 45 /*\n+ 46 * The permutations 0 and 1 of the Kuhn-decomposition of a cube into\n+simplices form a pyramid.\n+ 47 * The resulting pyramid is not oriented the same as the reference pyramid\n+and so the Kuhn-coordinates\n+ 48 * have to be transformed using the method below.\n+ 49 */\n+ 50 template FieldVector\n+51 transformCoordinate( FieldVector point)\n+ 52 {\n+ 53 FieldVector transform;\n+ 54 transform[0]=1-point[0];\n+ 55 transform[1]=1-point[1];\n+ 56 transform[2]=point[2];\n+ 57 return transform;\n+ 58 }\n+ 59\n+ 66 template\n+67 class RefinementImp\n+ 68 {\n+ 69 public:\n+70 constexpr static int dimension = dimension_;\n+ 71\n+72 typedef CoordType ctype;\n+ 73\n+ 74 template\n+ 75 struct Codim;\n+76 typedef typename Codim::SubEntityIterator VertexIterator;\n+77 typedef FieldVector CoordVector;\n+78 typedef typename Codim<0>::SubEntityIterator ElementIterator;\n+79 typedef FieldVector IndexVector;\n+ 80\n+ 81 static int nVertices(int nIntervals);\n+ 82 static VertexIterator vBegin(int nIntervals);\n+ 83 static VertexIterator vEnd(int nIntervals);\n+ 84\n+ 85 static int nElements(int nIntervals);\n+ 86 static ElementIterator eBegin(int nIntervals);\n+87 static ElementIterator eEnd(int nIntervals);\n+ 88\n+ 89 private:\n+ 90 friend class RefinementIteratorSpecial;\n+ 91 friend class RefinementIteratorSpecial;\n+ 92\n+ 93 typedef Simplex::RefinementImp BackendRefinement;\n+ 94\n+ 95 constexpr static int nKuhnSimplices = 2;\n+ 96 };\n+ 97\n+ 98 template\n+ 99 template\n+100 struct RefinementImp::Codim\n+ 101 {\n+ 102 class SubEntityIterator;\n+103 typedef Dune::MultiLinearGeometry Geometry;\n+ 104 };\n+ 105\n+ 106 template\n+ 107 int\n+108 RefinementImp::\n+ 109nVertices(int nIntervals)\n+ 110 {\n+ 111 return BackendRefinement::nVertices(nIntervals) * nKuhnSimplices;\n+ 112 }\n+ 113\n+ 114 template\n+ 115 typename RefinementImp::VertexIterator\n+116 RefinementImp::\n+ 117vBegin(int nIntervals)\n+ 118 {\n+ 119 return VertexIterator(nIntervals);\n+ 120 }\n+ 121\n+ 122 template\n+ 123 typename RefinementImp::VertexIterator\n+124 RefinementImp::\n+ 125vEnd(int nIntervals)\n+ 126 {\n+ 127 return VertexIterator(nIntervals, true);\n+ 128 }\n+ 129\n+ 130 template\n+ 131 int\n+132 RefinementImp::\n+ 133nElements(int nIntervals)\n+ 134 {\n+ 135 return BackendRefinement::nElements(nIntervals) * nKuhnSimplices;\n+ 136 }\n+ 137\n+ 138 template\n+ 139 typename RefinementImp::ElementIterator\n+140 RefinementImp::\n+ 141eBegin(int nIntervals)\n+ 142 {\n+ 143 return ElementIterator(nIntervals);\n+ 144 }\n+ 145\n+ 146 template\n+ 147 typename RefinementImp::ElementIterator\n+148 RefinementImp::\n+ 149eEnd(int nIntervals)\n+ 150 {\n+ 151 return ElementIterator(nIntervals, true);\n+ 152 }\n+ 153\n+ 154 // //////////////\n+ 155 //\n+ 156 // The iterator\n+ 157 //\n+ 158\n+ 159 // vertices\n+ 160 template\n+161 class RefinementIteratorSpecial\n+ 162 {\n+ 163 public:\n+164 typedef RefinementImp Refinement;\n+165 typedef typename Refinement::CoordVector CoordVector;\n+166 typedef typename Refinement::template Codim::Geometry Geometry;\n+ 167\n+ 168 RefinementIteratorSpecial(int nIntervals, bool end = false);\n+ 169\n+ 170 void increment();\n+ 171\n+ 172 CoordVector coords() const;\n+ 173\n+ 174 Geometry geometry() const;\n+ 175\n+ 176 int index() const;\n+ 177 protected:\n+178 typedef typename Refinement::BackendRefinement BackendRefinement;\n+179 typedef typename BackendRefinement::template Codim::\n+SubEntityIterator BackendIterator;\n+180 constexpr static int nKuhnSimplices = 2;\n+ 181\n+182 int nIntervals_;\n+ 183\n+184 int kuhnIndex;\n+185 BackendIterator backend;\n+186 const BackendIterator backendEnd;\n+ 187 };\n+ 188\n+ 189 template\n+190 RefinementIteratorSpecial::\n+ 191RefinementIteratorSpecial(int nIntervals, bool end)\n+ 192 : nIntervals_(nIntervals), kuhnIndex(0),\n+ 193 backend(BackendRefinement::vBegin(nIntervals_)),\n+ 194 backendEnd(BackendRefinement::vEnd(nIntervals_))\n+ 195 {\n+ 196 if (end)\n+ 197 kuhnIndex = nKuhnSimplices;\n+ 198 }\n+ 199\n+ 200 template\n+ 201 void\n+202 RefinementIteratorSpecial::\n+ 203increment()\n+ 204 {\n+ 205 ++backend;\n+ 206 if(backend == backendEnd)\n+ 207 {\n+ 208 backend = BackendRefinement::vBegin(nIntervals_);\n+ 209 ++kuhnIndex;\n+ 210 }\n+ 211 }\n+ 212\n+ 213 template\n+ 214 typename RefinementIteratorSpecial::\n+CoordVector\n+215 RefinementIteratorSpecial::\n+ 216coords() const\n+ 217 {\n+ 218 return transformCoordinate(referenceToKuhn(backend.coords(),\n+ 219 getPermutation(kuhnIndex)));\n+ 220 }\n+ 221\n+ 222 template\n+ 223 typename RefinementIteratorSpecial::\n+Geometry\n+224 RefinementIteratorSpecial::geometry ()\n+const\n+ 225 {\n+ 226 std::vector corners(1);\n+ 227 corners[0] = referenceToKuhn(backend.coords(), getPermutation\n+(kuhnIndex));\n+ 228 return Geometry(GeometryTypes::vertex, corners);\n+ 229 }\n+ 230\n+ 231 template\n+ 232 int\n+233 RefinementIteratorSpecial::\n+ 234index() const\n+ 235 {\n+ 236 return kuhnIndex*BackendRefinement::nVertices(nIntervals_) + backend.index\n+();\n+ 237 }\n+ 238\n+ 239 // elements\n+ 240 template\n+241 class RefinementIteratorSpecial\n+ 242 {\n+ 243 public:\n+244 typedef RefinementImp Refinement;\n+245 typedef typename Refinement::IndexVector IndexVector;\n+246 typedef typename Refinement::CoordVector CoordVector;\n+247 typedef typename Refinement::template Codim<0>::Geometry Geometry;\n+ 248\n+ 249 RefinementIteratorSpecial(int nIntervals, bool end = false);\n+ 250\n+ 251 void increment();\n+ 252\n+ 253 IndexVector vertexIndices() const;\n+ 254 int index() const;\n+ 255 CoordVector coords() const;\n+ 256\n+ 257 Geometry geometry() const;\n+ 258\n+ 259 private:\n+ 260 CoordVector global(const CoordVector &local) const;\n+ 261\n+ 262 protected:\n+263 typedef typename Refinement::BackendRefinement BackendRefinement;\n+264 typedef typename BackendRefinement::template Codim<0>::SubEntityIterator\n+BackendIterator;\n+265 constexpr static int nKuhnSimplices = 2;\n+ 266\n+267 int nIntervals_;\n+ 268\n+269 int kuhnIndex;\n+270 BackendIterator backend;\n+271 const BackendIterator backendEnd;\n+ 272 };\n+ 273\n+ 274 template\n+275 RefinementIteratorSpecial::\n+ 276RefinementIteratorSpecial(int nIntervals, bool end)\n+ 277 : nIntervals_(nIntervals), kuhnIndex(0),\n+ 278 backend(BackendRefinement::eBegin(nIntervals_)),\n+ 279 backendEnd(BackendRefinement::eEnd(nIntervals_))\n+ 280 {\n+ 281 if (end)\n+ 282 kuhnIndex = nKuhnSimplices;\n+ 283 }\n+ 284\n+ 285 template\n+ 286 void\n+287 RefinementIteratorSpecial::\n+ 288increment()\n+ 289 {\n+ 290 ++backend;\n+ 291 if (backend == backendEnd)\n+ 292 {\n+ 293 backend = BackendRefinement::eBegin(nIntervals_);\n+ 294 ++kuhnIndex;\n+ 295 }\n+ 296 }\n+ 297\n+ 298 template\n+ 299 typename RefinementIteratorSpecial::IndexVector\n+300 RefinementIteratorSpecial::\n+ 301vertexIndices() const\n+ 302 {\n+ 303 IndexVector indices = backend.vertexIndices();\n+ 304\n+ 305 int base = kuhnIndex * BackendRefinement::nVertices(nIntervals_);\n+ 306 indices += base;\n+ 307\n+ 308 return indices;\n+ 309 }\n+ 310\n+ 311 template\n+ 312 int\n+313 RefinementIteratorSpecial::\n+ 314index() const\n+ 315 {\n+ 316 return kuhnIndex*BackendRefinement::nElements(nIntervals_) + backend.index\n+();\n+ 317 }\n+ 318\n+ 319 template\n+ 320 typename RefinementIteratorSpecial::CoordVector\n+321 RefinementIteratorSpecial::\n+ 322coords() const\n+ 323 {\n+ 324 return global(backend.coords());\n+ 325 }\n+ 326\n+ 327 template\n+ 328 typename RefinementIteratorSpecial::Geometry\n+329 RefinementIteratorSpecial::\n+ 330geometry() const\n+ 331 {\n+ 332 const typename BackendIterator::Geometry &\n+ 333 bgeo = backend.geometry();\n+ 334 std::vector corners(dimension+1);\n+ 335 for(int i = 0; i <= dimension; ++i)\n+ 336 corners[i] = global(bgeo.corner(i));\n+ 337\n+ 338 return Geometry(bgeo.type(), corners);\n+ 339 }\n+ 340\n+ 341 template\n+ 342 typename RefinementIteratorSpecial::\n+ 343 CoordVector\n+ 344 RefinementIteratorSpecial::\n+ 345global(const CoordVector &local) const\n+ 346 {\n+ 347 return transformCoordinate(referenceToKuhn(local,\n+ 348 getPermutation(kuhnIndex)));\n+ 349 }\n+ 350\n+ 351 // common\n+ 352 template\n+ 353 template\n+354 class RefinementImp::Codim::\n+SubEntityIterator\n+ 355 : public ForwardIteratorFacade::template Codim::SubEntityIterator, int>,\n+ 356 public RefinementIteratorSpecial\n+ 357 {\n+ 358 public:\n+359 typedef RefinementImp Refinement;\n+360 typedef SubEntityIterator This;\n+ 361\n+362 SubEntityIterator(int nIntervals, bool end = false);\n+ 363\n+364 bool equals(const This &other) const;\n+ 365 protected:\n+ 366 using RefinementIteratorSpecial::\n+kuhnIndex;\n+ 367 using RefinementIteratorSpecial::\n+backend;\n+ 368 };\n+ 369\n+ 370#ifndef DOXYGEN\n+ 371 template\n+ 372 template\n+ 373 RefinementImp::Codim::\n+SubEntityIterator::\n+ 374SubEntityIterator(int nIntervals, bool end)\n+ 375 : RefinementIteratorSpecial(nIntervals,\n+end)\n+ 376 {}\n+ 377\n+ 378 template\n+ 379 template\n+ 380 bool\n+ 381 RefinementImp::Codim::\n+SubEntityIterator::\n+ 382equals(const This &other) const\n+ 383 {\n+ 384 return kuhnIndex == other.kuhnIndex && backend == other.backend;\n+ 385 }\n+ 386#endif\n+ 387\n+ 388 } // namespace PyramidTriangulation\n+ 389 } // namespace RefinementImp\n+ 390\n+ 391 namespace RefinementImp\n+ 392 {\n+ 393 // ///////////////////////\n+ 394 //\n+ 395 // The refinement traits\n+ 396 //\n+ 397#ifndef DOXYGEN\n+ 398 template\n+ 399 struct Traits<\n+ 400 topologyId, CoordType, coerceToId, 3,\n+ 401 typename std::enable_if<\n+ 402 (GeometryTypes::pyramid.id() >> 1) ==\n+ 403 (topologyId >> 1) &&\n+ 404 (GeometryTypes::simplex(3).id() >> 1) ==\n+ 405 (coerceToId >> 1)\n+ 406 >::type>\n+ 407 {\n+ 408 typedef PyramidTriangulation::RefinementImp<3, CoordType> Imp;\n+ 409 };\n+ 410#endif\n+ 411\n+ 412 } // namespace RefinementImp\n+ 413} // namespace Dune\n+ 414\n+ 415#endif // DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC\n+type.hh\n+A unique label for each type of element that can occur in a grid.\n+referenceelements.hh\n+base.cc\n+This file contains the parts independent of a particular Refinement\n+implementation.\n+simplex.cc\n+This file contains the Refinement implementation for simplices (triangles,\n+tetrahedrons....\n Dune\n Definition affinegeometry.hh:21\n-Dune::Dim\n-Static tag representing a dimension.\n-Definition dimension.hh:16\n-Dune::Dim::type\n-Dim type\n-Definition dimension.hh:17\n+Dune::RefinementImp::PyramidTriangulation::transformCoordinate\n+FieldVector< CoordType, dimension > transformCoordinate(FieldVector< CoordType,\n+dimension > point)\n+Definition pyramidtriangulation.cc:51\n+Dune::RefinementImp::Simplex::getPermutation\n+FieldVector< int, n > getPermutation(int m)\n+Calculate permutation from it's index.\n+Definition simplex.cc:336\n+Dune::RefinementImp::Simplex::referenceToKuhn\n+FieldVector< CoordType, dimension > referenceToKuhn(FieldVector< CoordType,\n+dimension > point, const FieldVector< int, dimension > &kuhn)\n+Map from the reference simplex to some Kuhn simplex.\n+Definition simplex.cc:394\n Dune::Codim\n Static tag representing a codimension.\n Definition dimension.hh:24\n-Dune::Codim::type\n-Codim type\n-Definition dimension.hh:25\n+Dune::MultiLinearGeometry\n+generic geometry implementation based on corner coordinates\n+Definition multilineargeometry.hh:181\n+Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial\n+Definition pyramidtriangulation.cc:43\n+Dune::RefinementImp::PyramidTriangulation::RefinementImp\n+Implementation of the refinement of a pyramid into simplices.\n+Definition pyramidtriangulation.cc:68\n+Dune::RefinementImp::PyramidTriangulation::RefinementImp::CoordVector\n+FieldVector< CoordType, dimension > CoordVector\n+Definition pyramidtriangulation.cc:77\n+Dune::RefinementImp::PyramidTriangulation::RefinementImp::nVertices\n+static int nVertices(int nIntervals)\n+Definition pyramidtriangulation.cc:109\n+Dune::RefinementImp::PyramidTriangulation::RefinementImp::nElements\n+static int nElements(int nIntervals)\n+Definition pyramidtriangulation.cc:133\n+Dune::RefinementImp::PyramidTriangulation::RefinementImp::ctype\n+CoordType ctype\n+Definition pyramidtriangulation.cc:72\n+Dune::RefinementImp::PyramidTriangulation::RefinementImp::VertexIterator\n+Codim< dimension >::SubEntityIterator VertexIterator\n+Definition pyramidtriangulation.cc:76\n+Dune::RefinementImp::PyramidTriangulation::RefinementImp::ElementIterator\n+Codim< 0 >::SubEntityIterator ElementIterator\n+Definition pyramidtriangulation.cc:78\n+Dune::RefinementImp::PyramidTriangulation::RefinementImp::dimension\n+static constexpr int dimension\n+Definition pyramidtriangulation.cc:70\n+Dune::RefinementImp::PyramidTriangulation::RefinementImp::eBegin\n+static ElementIterator eBegin(int nIntervals)\n+Definition pyramidtriangulation.cc:141\n+Dune::RefinementImp::PyramidTriangulation::RefinementImp::eEnd\n+static ElementIterator eEnd(int nIntervals)\n+Definition pyramidtriangulation.cc:149\n+Dune::RefinementImp::PyramidTriangulation::RefinementImp::IndexVector\n+FieldVector< int, dimension+1 > IndexVector\n+Definition pyramidtriangulation.cc:79\n+Dune::RefinementImp::PyramidTriangulation::RefinementImp::vBegin\n+static VertexIterator vBegin(int nIntervals)\n+Definition pyramidtriangulation.cc:117\n+Dune::RefinementImp::PyramidTriangulation::RefinementImp::vEnd\n+static VertexIterator vEnd(int nIntervals)\n+Definition pyramidtriangulation.cc:125\n+Dune::RefinementImp::PyramidTriangulation::RefinementImp::Codim\n+Definition pyramidtriangulation.cc:101\n+Dune::RefinementImp::PyramidTriangulation::RefinementImp::Codim::Geometry\n+Dune::MultiLinearGeometry< CoordType, dimension-codimension, dimension >\n+Geometry\n+Definition pyramidtriangulation.cc:103\n+Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n+dimension,_CoordType,_dimension_>::Refinement\n+RefinementImp< dimension, CoordType > Refinement\n+Definition pyramidtriangulation.cc:164\n+Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n+dimension,_CoordType,_dimension_>::Geometry\n+Refinement::template Codim< dimension >::Geometry Geometry\n+Definition pyramidtriangulation.cc:166\n+Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n+dimension,_CoordType,_dimension_>::BackendRefinement\n+Refinement::BackendRefinement BackendRefinement\n+Definition pyramidtriangulation.cc:178\n+Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n+dimension,_CoordType,_dimension_>::backend\n+BackendIterator backend\n+Definition pyramidtriangulation.cc:185\n+Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n+dimension,_CoordType,_dimension_>::BackendIterator\n+BackendRefinement::template Codim< dimension >::SubEntityIterator\n+BackendIterator\n+Definition pyramidtriangulation.cc:179\n+Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n+dimension,_CoordType,_dimension_>::kuhnIndex\n+int kuhnIndex\n+Definition pyramidtriangulation.cc:184\n+Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n+dimension,_CoordType,_dimension_>::CoordVector\n+Refinement::CoordVector CoordVector\n+Definition pyramidtriangulation.cc:165\n+Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n+dimension,_CoordType,_dimension_>::backendEnd\n+const BackendIterator backendEnd\n+Definition pyramidtriangulation.cc:186\n+Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n+dimension,_CoordType,_dimension_>::nIntervals_\n+int nIntervals_\n+Definition pyramidtriangulation.cc:182\n+Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n+dimension,_CoordType,_0_>::backendEnd\n+const BackendIterator backendEnd\n+Definition pyramidtriangulation.cc:271\n+Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n+dimension,_CoordType,_0_>::CoordVector\n+Refinement::CoordVector CoordVector\n+Definition pyramidtriangulation.cc:246\n+Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n+dimension,_CoordType,_0_>::nIntervals_\n+int nIntervals_\n+Definition pyramidtriangulation.cc:267\n+Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n+dimension,_CoordType,_0_>::Geometry\n+Refinement::template Codim< 0 >::Geometry Geometry\n+Definition pyramidtriangulation.cc:247\n+Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n+dimension,_CoordType,_0_>::IndexVector\n+Refinement::IndexVector IndexVector\n+Definition pyramidtriangulation.cc:245\n+Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n+dimension,_CoordType,_0_>::BackendIterator\n+BackendRefinement::template Codim< 0 >::SubEntityIterator BackendIterator\n+Definition pyramidtriangulation.cc:264\n+Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n+dimension,_CoordType,_0_>::kuhnIndex\n+int kuhnIndex\n+Definition pyramidtriangulation.cc:269\n+Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n+dimension,_CoordType,_0_>::backend\n+BackendIterator backend\n+Definition pyramidtriangulation.cc:270\n+Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n+dimension,_CoordType,_0_>::Refinement\n+RefinementImp< dimension, CoordType > Refinement\n+Definition pyramidtriangulation.cc:244\n+Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n+dimension,_CoordType,_0_>::BackendRefinement\n+Refinement::BackendRefinement BackendRefinement\n+Definition pyramidtriangulation.cc:263\n+Dune::RefinementImp::PyramidTriangulation::RefinementImp::Codim<_codimension\n+>::equals\n+bool equals(const This &other) const\n+Dune::RefinementImp::PyramidTriangulation::RefinementImp::Codim<_codimension\n+>::This\n+SubEntityIterator This\n+Definition pyramidtriangulation.cc:360\n+Dune::RefinementImp::PyramidTriangulation::RefinementImp::Codim<_codimension\n+>::SubEntityIterator\n+SubEntityIterator(int nIntervals, bool end=false)\n+Dune::RefinementImp::PyramidTriangulation::RefinementImp::Codim<_codimension\n+>::Refinement\n+RefinementImp< dimension, CoordType > Refinement\n+Definition pyramidtriangulation.cc:359\n+Dune::RefinementImp::Simplex::RefinementImp\n+Definition simplex.cc:433\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00215.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00215.html", "unified_diff": "@@ -82,17 +82,17 @@\n
    \n \n

    This file contains the Refinement implementation for hypercubes (quadrilaterals, hexahedrons, etc.). \n More...

    \n
    #include <cassert>
    \n #include <dune/common/fvector.hh>
    \n #include <dune/common/iteratorfacades.hh>
    \n-#include <dune/geometry/referenceelements.hh>
    \n-#include <dune/geometry/axisalignedcubegeometry.hh>
    \n-#include "base.cc"
    \n+#include <dune/geometry/referenceelements.hh>
    \n+#include <dune/geometry/axisalignedcubegeometry.hh>
    \n+#include "base.cc"
    \n
    \n

    Go to the source code of this file.

    \n \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00215_source.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00215_source.html", "unified_diff": "@@ -89,18 +89,18 @@\n
    6#define DUNE_GEOMETRY_REFINEMENT_HCUBE_CC
    \n
    7
    \n
    42#include <cassert>
    \n
    43
    \n
    44#include <dune/common/fvector.hh>
    \n
    45#include <dune/common/iteratorfacades.hh>
    \n
    46
    \n-\n-\n+\n+\n
    49
    \n-
    50#include "base.cc" // for RefinementTraits
    \n+
    50#include "base.cc" // for RefinementTraits
    \n
    51
    \n
    52namespace Dune
    \n
    53{
    \n
    54 namespace RefinementImp
    \n
    55 {
    \n
    \n
    62 namespace HCube
    \n@@ -497,17 +497,17 @@\n
    445#endif
    \n
    446
    \n
    447 } // namespace RefinementImp
    \n
    448
    \n
    449} // namespace Dune
    \n
    450
    \n
    451#endif // DUNE_GEOMETRY_REFINEMENT_HCUBE_CC
    \n-\n-
    A geometry implementation for axis-aligned hypercubes.
    \n-
    This file contains the parts independent of a particular Refinement implementation.
    \n+
    A geometry implementation for axis-aligned hypercubes.
    \n+\n+
    This file contains the parts independent of a particular Refinement implementation.
    \n
    Definition affinegeometry.hh:21
    \n
    A geometry implementation for axis-aligned hypercubes.
    Definition axisalignedcubegeometry.hh:50
    \n
    Static tag representing a codimension.
    Definition dimension.hh:24
    \n
    Refinement implementation for hypercubes
    Definition hcube.cc:75
    \n
    Codim< 0 >::SubEntityIterator ElementIterator
    Definition hcube.cc:86
    \n
    static ElementIterator eEnd(unsigned nIntervals)
    Definition hcube.cc:153
    \n
    static unsigned nVertices(unsigned nIntervals)
    Definition hcube.cc:109
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -418,17 +418,17 @@\n 445#endif\n 446\n 447 } // namespace RefinementImp\n 448\n 449} // namespace Dune\n 450\n 451#endif // DUNE_GEOMETRY_REFINEMENT_HCUBE_CC\n-referenceelements.hh\n axisalignedcubegeometry.hh\n A geometry implementation for axis-aligned hypercubes.\n+referenceelements.hh\n base.cc\n This file contains the parts independent of a particular Refinement\n implementation.\n Dune\n Definition affinegeometry.hh:21\n Dune::AxisAlignedCubeGeometry\n A geometry implementation for axis-aligned hypercubes.\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00218.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00218.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: pyramidtriangulation.cc File Reference\n+dune-geometry: simplex.cc File Reference\n \n \n \n \n \n \n \n@@ -72,73 +72,98 @@\n
  • dune
  • geometry
  • refinement
  • \n
    \n \n
    \n \n-
    pyramidtriangulation.cc File Reference
    \n+Macros
    \n+
    simplex.cc File Reference
    \n \n
    \n-
    #include <dune/common/fvector.hh>
    \n-#include <dune/common/typetraits.hh>
    \n-#include <dune/geometry/referenceelements.hh>
    \n+\n+

    This file contains the Refinement implementation for simplices (triangles, tetrahedrons...) \n+More...

    \n+
    #include <algorithm>
    \n+#include <dune/common/fvector.hh>
    \n+#include <dune/common/math.hh>
    \n+#include <dune/geometry/multilineargeometry.hh>
    \n+#include <dune/geometry/referenceelements.hh>
    \n #include <dune/geometry/type.hh>
    \n-#include "base.cc"
    \n-#include "simplex.cc"
    \n+#include "base.cc"
    \n
    \n

    Go to the source code of this file.

    \n

    \n Classes

    class  Dune::RefinementImp::HCube::RefinementImp< dimension_, CoordType >
     Refinement implementation for hypercubes More...
    \n \n-\n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n

    \n Classes

    class  Dune::RefinementImp::PyramidTriangulation::RefinementImp< dimension_, CoordType >
     Implementation of the refinement of a pyramid into simplices. More...
    class  Dune::RefinementImp::Simplex::RefinementImp< dimension_, CoordType >
     
    struct  Dune::RefinementImp::PyramidTriangulation::RefinementImp< dimension_, CoordType >::Codim< codimension >
    struct  Dune::RefinementImp::Simplex::RefinementImp< dimension_, CoordType >::Codim< codimension >
     
    class  Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< dimension, CoordType, dimension >
    class  Dune::RefinementImp::Simplex::RefinementIteratorSpecial< dimension, CoordType, dimension >
     
    class  Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< dimension, CoordType, 0 >
    class  Dune::RefinementImp::Simplex::RefinementIteratorSpecial< dimension, CoordType, 0 >
     
    class  Dune::RefinementImp::PyramidTriangulation::RefinementImp< dimension_, CoordType >::Codim< codimension >
    class  Dune::RefinementImp::Simplex::RefinementImp< dimension_, CoordType >::Codim< codimension >
     
    \n \n \n \n \n \n \n-\n-\n+\n+\n \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::RefinementImp
     This namespace contains the implementation of Refinement.
     
    namespace  Dune::RefinementImp::PyramidTriangulation
     This namespace contains the Refinement implementation for triangulating pyramids (GeometryType::pyramid -> GeometryType::simplex)
    namespace  Dune::RefinementImp::Simplex
     This namespace contains the Refinement implementation for simplices (triangles, tetrahedrons...)
     
    \n \n-\n-\n+\n+\n

    \n Macros

    #define DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC
     
    #define DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC
     
    \n \n-\n-\n-\n+\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<int dimension, class CoordType >
    FieldVector< CoordType, dimension > Dune::RefinementImp::PyramidTriangulation::transformCoordinate (FieldVector< CoordType, dimension > point)
     
    Utilities
    int Dune::RefinementImp::Simplex::factorial (int n)
     Calculate n!
     
    int Dune::RefinementImp::Simplex::binomial (int upper, int lower)
     calculate \"$\\left({upper}\\atop{lower}\\right)$\"
     
    template<int dimension>
    int Dune::RefinementImp::Simplex::pointIndex (const FieldVector< int, dimension > &point)
     calculate the index of a given gridpoint within a Kuhn0 simplex
     
    template<int n>
    FieldVector< int, n > Dune::RefinementImp::Simplex::getPermutation (int m)
     Calculate permutation from it's index.
     
    template<int dimension, class CoordType >
    FieldVector< CoordType, dimension > Dune::RefinementImp::Simplex::referenceToKuhn (FieldVector< CoordType, dimension > point, const FieldVector< int, dimension > &kuhn)
     Map from the reference simplex to some Kuhn simplex.
     
    template<int dimension, class CoordType >
    FieldVector< CoordType, dimension > Dune::RefinementImp::Simplex::kuhnToReference (FieldVector< CoordType, dimension > point, const FieldVector< int, dimension > &kuhn)
     Map from some Kuhn simplex to the reference simplex.
     
    \n-

    Macro Definition Documentation

    \n-\n-

    ◆ DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC

    \n+

    Detailed Description

    \n+

    This file contains the Refinement implementation for simplices (triangles, tetrahedrons...)

    \n+

    See Refinement implementation for simplices.

    \n+

    Macro Definition Documentation

    \n+\n+

    ◆ DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC

    \n \n
    \n
    \n \n \n- \n+ \n \n
    #define DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC#define DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC
    \n
    \n \n
    \n
    \n
    \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,60 +7,96 @@\n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n * refinement\n-Classes | Namespaces | Macros | Functions\n-pyramidtriangulation.cc File Reference\n+Classes | Namespaces | Macros\n+simplex.cc File Reference\n+This file contains the Refinement implementation for simplices (triangles,\n+tetrahedrons...) More...\n+#include \n #include \n-#include \n+#include \n+#include \n #include \n #include \n #include \"base.cc\"\n-#include \"simplex.cc\"\n Go_to_the_source_code_of_this_file.\n Classes\n- class \u00a0Dune::RefinementImp::PyramidTriangulation::RefinementImp<_dimension_,\n- CoordType_>\n-\u00a0 Implementation of the refinement of a pyramid into simplices. More...\n+ class \u00a0Dune::RefinementImp::Simplex::RefinementImp<_dimension_,_CoordType_>\n \u00a0\n-struct \u00a0Dune::RefinementImp::PyramidTriangulation::RefinementImp<_dimension_,\n- CoordType_>::Codim<_codimension_>\n+struct \u00a0Dune::RefinementImp::Simplex::RefinementImp<_dimension_,_CoordType_>::\n+ Codim<_codimension_>\n \u00a0\n- class \u00a0Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n- dimension,_CoordType,_dimension_>\n+ class \u00a0Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,\n+ CoordType,_dimension_>\n \u00a0\n- class \u00a0Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n- dimension,_CoordType,_0_>\n+ class \u00a0Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,\n+ CoordType,_0_>\n \u00a0\n- class \u00a0Dune::RefinementImp::PyramidTriangulation::RefinementImp<_dimension_,\n- CoordType_>::Codim<_codimension_>\n+ class \u00a0Dune::RefinementImp::Simplex::RefinementImp<_dimension_,_CoordType_>::\n+ Codim<_codimension_>\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n namespace \u00a0Dune::RefinementImp\n \u00a0 This namespace contains the implementation of Refinement.\n \u00a0\n-namespace \u00a0Dune::RefinementImp::PyramidTriangulation\n- This namespace contains the Refinement implementation for\n-\u00a0 triangulating pyramids (GeometryType::pyramid -> GeometryType::\n- simplex)\n+namespace \u00a0Dune::RefinementImp::Simplex\n+\u00a0 This namespace contains the Refinement implementation for simplices\n+ (triangles, tetrahedrons...)\n \u00a0\n Macros\n-#define\u00a0DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC\n+#define\u00a0DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC\n \u00a0\n Functions\n+Utilities\n+ int\u00a0Dune::RefinementImp::Simplex::factorial\n+ (int n)\n+\u00a0 Calculate n!\n+\u00a0\n+ int\u00a0Dune::RefinementImp::Simplex::binomial\n+ (int upper, int lower)\n+\u00a0 calculate [$\\left({upper}\\atop\n+ {lower}\\right)$]\n+\u00a0\n+template\n+ int\u00a0Dune::RefinementImp::Simplex::pointIndex\n+ (const FieldVector< int, dimension >\n+ &point)\n+\u00a0 calculate the index of a given gridpoint\n+ within a Kuhn0 simplex\n+\u00a0\n+template\n+ FieldVector< int, n >\u00a0Dune::RefinementImp::Simplex::\n+ getPermutation (int m)\n+\u00a0 Calculate permutation from it's index.\n+\u00a0\n template\n-FieldVector< CoordType, dimension >\u00a0Dune::RefinementImp::\n- PyramidTriangulation::transformCoordinate\n- (FieldVector< CoordType, dimension >\n- point)\n+FieldVector< CoordType, dimension >\u00a0Dune::RefinementImp::Simplex::\n+ referenceToKuhn (FieldVector< CoordType,\n+ dimension > point, const FieldVector< int,\n+ dimension > &kuhn)\n+\u00a0 Map from the reference simplex to some\n+ Kuhn simplex.\n \u00a0\n+template\n+FieldVector< CoordType, dimension >\u00a0Dune::RefinementImp::Simplex::\n+ kuhnToReference (FieldVector< CoordType,\n+ dimension > point, const FieldVector< int,\n+ dimension > &kuhn)\n+\u00a0 Map from some Kuhn simplex to the\n+ reference simplex.\n+\u00a0\n+***** Detailed Description *****\n+This file contains the Refinement implementation for simplices (triangles,\n+tetrahedrons...)\n+See Refinement_implementation_for_simplices.\n ***** Macro Definition Documentation *****\n-***** \u25c6\u00a0DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC *****\n-#define DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC\n+***** \u25c6\u00a0DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC *****\n+#define DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00218_source.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00218_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: pyramidtriangulation.cc Source File\n+dune-geometry: simplex.cc Source File\n \n \n \n \n \n \n \n@@ -74,519 +74,672 @@\n \n \n \n
    \n-
    pyramidtriangulation.cc
    \n+
    simplex.cc
    \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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
    \n
    4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n-
    5#ifndef DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC
    \n-
    6#define DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC
    \n+
    5#ifndef DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC
    \n+
    6#define DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC
    \n
    7
    \n-
    8#include <dune/common/fvector.hh>
    \n-
    9#include <dune/common/typetraits.hh>
    \n-
    10
    \n-\n-
    12#include <dune/geometry/type.hh>
    \n+
    8// This file is part of DUNE, a Distributed and Unified Numerics Environment
    \n+
    9// This file is copyright (C) 2005 Jorrit Fahlke <jorrit@jorrit.de>
    \n+
    10// This file is licensed under version 2 of the GNU General Public License,
    \n+
    11// with a special "runtime exception." See COPYING at the top of the source
    \n+
    12// tree for the full licence.
    \n
    13
    \n-
    14#include "base.cc"
    \n-
    15#include "simplex.cc"
    \n-
    16
    \n-
    17namespace Dune
    \n-
    18{
    \n-
    19 namespace RefinementImp
    \n-
    20 {
    \n-
    \n-
    26 namespace PyramidTriangulation
    \n-
    27 {
    \n-
    28 // ////////////
    \n-
    29 //
    \n-
    30 // Utilities
    \n-
    31 //
    \n-
    32
    \n-\n-\n-
    35
    \n-
    36 // ////////////////////////////////////
    \n-
    37 //
    \n-
    38 // Refine a pyramid with simplices
    \n-
    39 //
    \n-
    40
    \n-
    41 // forward declaration of the iterator base
    \n-
    42 template<int dimension, class CoordType, int codimension>
    \n-\n-
    44
    \n-
    45 /*
    \n-
    46 * The permutations 0 and 1 of the Kuhn-decomposition of a cube into simplices form a pyramid.
    \n-
    47 * The resulting pyramid is not oriented the same as the reference pyramid and so the Kuhn-coordinates
    \n-
    48 * have to be transformed using the method below.
    \n-
    49 */
    \n-
    50 template<int dimension, class CoordType> FieldVector<CoordType, dimension>
    \n-
    \n-
    51 transformCoordinate( FieldVector<CoordType, dimension> point)
    \n-
    52 {
    \n-
    53 FieldVector<CoordType, dimension> transform;
    \n-
    54 transform[0]=1-point[0];
    \n-
    55 transform[1]=1-point[1];
    \n-
    56 transform[2]=point[2];
    \n-
    57 return transform;
    \n-
    58 }
    \n-
    \n-
    59
    \n-
    66 template<int dimension_, class CoordType>
    \n-
    \n-\n-
    68 {
    \n-
    69 public:
    \n-
    70 constexpr static int dimension = dimension_;
    \n-
    71
    \n-
    72 typedef CoordType ctype;
    \n-
    73
    \n-
    74 template<int codimension>
    \n-
    75 struct Codim;
    \n-\n-
    77 typedef FieldVector<CoordType, dimension> CoordVector;
    \n-\n-
    79 typedef FieldVector<int, dimension+1> IndexVector;
    \n-
    80
    \n-
    81 static int nVertices(int nIntervals);
    \n-
    82 static VertexIterator vBegin(int nIntervals);
    \n-
    83 static VertexIterator vEnd(int nIntervals);
    \n-
    84
    \n-
    85 static int nElements(int nIntervals);
    \n-
    86 static ElementIterator eBegin(int nIntervals);
    \n-
    87 static ElementIterator eEnd(int nIntervals);
    \n-
    88
    \n-
    89 private:
    \n-
    90 friend class RefinementIteratorSpecial<dimension, CoordType, 0>;
    \n-
    91 friend class RefinementIteratorSpecial<dimension, CoordType, dimension>;
    \n-
    92
    \n-\n-
    94
    \n-
    95 constexpr static int nKuhnSimplices = 2;
    \n-
    96 };
    \n-
    \n-
    97
    \n-
    98 template<int dimension, class CoordType>
    \n-
    99 template<int codimension>
    \n-
    \n-
    100 struct RefinementImp<dimension, CoordType>::Codim
    \n-
    101 {
    \n-
    102 class SubEntityIterator;
    \n-\n-
    104 };
    \n-
    \n-
    105
    \n-
    106 template<int dimension, class CoordType>
    \n-
    107 int
    \n-
    \n-\n-
    109 nVertices(int nIntervals)
    \n-
    110 {
    \n-
    111 return BackendRefinement::nVertices(nIntervals) * nKuhnSimplices;
    \n-
    112 }
    \n-
    \n-
    113
    \n-
    114 template<int dimension, class CoordType>
    \n-\n-
    \n-\n-
    117 vBegin(int nIntervals)
    \n-
    118 {
    \n-
    119 return VertexIterator(nIntervals);
    \n-
    120 }
    \n-
    \n-
    121
    \n-
    122 template<int dimension, class CoordType>
    \n-\n-
    \n-\n-
    125 vEnd(int nIntervals)
    \n-
    126 {
    \n-
    127 return VertexIterator(nIntervals, true);
    \n-
    128 }
    \n-
    \n-
    129
    \n-
    130 template<int dimension, class CoordType>
    \n-
    131 int
    \n-
    \n-\n-
    133 nElements(int nIntervals)
    \n-
    134 {
    \n-
    135 return BackendRefinement::nElements(nIntervals) * nKuhnSimplices;
    \n-
    136 }
    \n-
    \n-
    137
    \n-
    138 template<int dimension, class CoordType>
    \n-\n-
    \n-\n-
    141 eBegin(int nIntervals)
    \n-
    142 {
    \n-
    143 return ElementIterator(nIntervals);
    \n-
    144 }
    \n-
    \n-
    145
    \n-
    146 template<int dimension, class CoordType>
    \n-\n-
    \n-\n-
    149 eEnd(int nIntervals)
    \n-
    150 {
    \n-
    151 return ElementIterator(nIntervals, true);
    \n-
    152 }
    \n-
    \n-
    153
    \n-
    154 // //////////////
    \n-
    155 //
    \n-
    156 // The iterator
    \n-
    157 //
    \n-
    158
    \n-
    159 // vertices
    \n-
    160 template<int dimension, class CoordType>
    \n-
    \n-
    161 class RefinementIteratorSpecial<dimension, CoordType, dimension>
    \n-
    162 {
    \n-
    163 public:
    \n-\n-
    165 typedef typename Refinement::CoordVector CoordVector;
    \n-
    166 typedef typename Refinement::template Codim<dimension>::Geometry Geometry;
    \n-
    167
    \n-
    168 RefinementIteratorSpecial(int nIntervals, bool end = false);
    \n-
    169
    \n-
    170 void increment();
    \n-
    171
    \n-
    172 CoordVector coords() const;
    \n-
    173
    \n-
    174 Geometry geometry() const;
    \n-
    175
    \n-
    176 int index() const;
    \n-
    177 protected:
    \n-
    178 typedef typename Refinement::BackendRefinement BackendRefinement;
    \n-
    179 typedef typename BackendRefinement::template Codim<dimension>::SubEntityIterator BackendIterator;
    \n-
    180 constexpr static int nKuhnSimplices = 2;
    \n-
    181
    \n-\n-
    183
    \n-\n-\n-\n-
    187 };
    \n-
    \n-
    188
    \n-
    189 template<int dimension, class CoordType>
    \n-
    \n-\n-
    191 RefinementIteratorSpecial(int nIntervals, bool end)
    \n-
    192 : nIntervals_(nIntervals), kuhnIndex(0),
    \n-
    193 backend(BackendRefinement::vBegin(nIntervals_)),
    \n-
    194 backendEnd(BackendRefinement::vEnd(nIntervals_))
    \n-
    195 {
    \n-
    196 if (end)
    \n-
    197 kuhnIndex = nKuhnSimplices;
    \n-
    198 }
    \n-
    \n-
    199
    \n-
    200 template<int dimension, class CoordType>
    \n-
    201 void
    \n-
    \n-\n-\n-
    204 {
    \n-
    205 ++backend;
    \n-
    206 if(backend == backendEnd)
    \n-
    207 {
    \n-
    208 backend = BackendRefinement::vBegin(nIntervals_);
    \n-
    209 ++kuhnIndex;
    \n-
    210 }
    \n-
    211 }
    \n-
    \n-
    212
    \n-
    213 template<int dimension, class CoordType>
    \n-\n-
    \n-\n-
    216 coords() const
    \n-
    217 {
    \n-
    218 return transformCoordinate(referenceToKuhn(backend.coords(),
    \n-
    219 getPermutation<dimension>(kuhnIndex)));
    \n-
    220 }
    \n-
    \n-
    221
    \n-
    222 template<int dimension, class CoordType>
    \n-\n-
    \n-\n-
    225 {
    \n-
    226 std::vector<CoordVector> corners(1);
    \n-
    227 corners[0] = referenceToKuhn(backend.coords(), getPermutation<dimension>(kuhnIndex));
    \n-
    228 return Geometry(GeometryTypes::vertex, corners);
    \n-
    229 }
    \n-
    \n-
    230
    \n-
    231 template<int dimension, class CoordType>
    \n-
    232 int
    \n-
    \n-\n-
    234 index() const
    \n-
    235 {
    \n-
    236 return kuhnIndex*BackendRefinement::nVertices(nIntervals_) + backend.index();
    \n-
    237 }
    \n-
    \n-
    238
    \n-
    239 // elements
    \n-
    240 template<int dimension, class CoordType>
    \n-
    \n-
    241 class RefinementIteratorSpecial<dimension, CoordType, 0>
    \n-
    242 {
    \n-
    243 public:
    \n-\n-\n-\n-
    247 typedef typename Refinement::template Codim<0>::Geometry Geometry;
    \n-
    248
    \n-
    249 RefinementIteratorSpecial(int nIntervals, bool end = false);
    \n-
    250
    \n-
    251 void increment();
    \n+
    251#include <algorithm>
    \n
    252
    \n-
    253 IndexVector vertexIndices() const;
    \n-
    254 int index() const;
    \n-
    255 CoordVector coords() const;
    \n-
    256
    \n-
    257 Geometry geometry() const;
    \n-
    258
    \n-
    259 private:
    \n-
    260 CoordVector global(const CoordVector &local) const;
    \n+
    253#include <dune/common/fvector.hh>
    \n+
    254#include <dune/common/math.hh>
    \n+
    255
    \n+\n+\n+
    258#include <dune/geometry/type.hh>
    \n+
    259
    \n+
    260#include "base.cc"
    \n
    261
    \n-
    262 protected:
    \n-\n-
    264 typedef typename BackendRefinement::template Codim<0>::SubEntityIterator BackendIterator;
    \n-
    265 constexpr static int nKuhnSimplices = 2;
    \n-
    266
    \n-\n-
    268
    \n-\n-\n-\n-
    272 };
    \n-
    \n+
    262namespace Dune {
    \n+
    263
    \n+
    264 namespace RefinementImp {
    \n+
    265
    \n+
    \n+
    272 namespace Simplex {
    \n
    273
    \n-
    274 template<int dimension, class CoordType>
    \n-
    \n-\n-
    276 RefinementIteratorSpecial(int nIntervals, bool end)
    \n-
    277 : nIntervals_(nIntervals), kuhnIndex(0),
    \n-
    278 backend(BackendRefinement::eBegin(nIntervals_)),
    \n-
    279 backendEnd(BackendRefinement::eEnd(nIntervals_))
    \n-
    280 {
    \n-
    281 if (end)
    \n-
    282 kuhnIndex = nKuhnSimplices;
    \n-
    283 }
    \n-
    \n-
    284
    \n-
    285 template<int dimension, class CoordType>
    \n-
    286 void
    \n-
    \n-\n-\n-
    289 {
    \n-
    290 ++backend;
    \n-
    291 if (backend == backendEnd)
    \n-
    292 {
    \n-
    293 backend = BackendRefinement::eBegin(nIntervals_);
    \n-
    294 ++kuhnIndex;
    \n-
    295 }
    \n-
    296 }
    \n-
    \n-
    297
    \n-
    298 template<int dimension, class CoordType>
    \n-\n-
    \n-\n-
    301 vertexIndices() const
    \n-
    302 {
    \n-
    303 IndexVector indices = backend.vertexIndices();
    \n-
    304
    \n-
    305 int base = kuhnIndex * BackendRefinement::nVertices(nIntervals_);
    \n-
    306 indices += base;
    \n-
    307
    \n-
    308 return indices;
    \n-
    309 }
    \n-
    \n-
    310
    \n-
    311 template<int dimension, class CoordType>
    \n-
    312 int
    \n-
    \n-\n-
    314 index() const
    \n-
    315 {
    \n-
    316 return kuhnIndex*BackendRefinement::nElements(nIntervals_) + backend.index();
    \n-
    317 }
    \n-
    \n-
    318
    \n-
    319 template<int dimension, class CoordType>
    \n-\n-
    \n-\n-
    322 coords() const
    \n-
    323 {
    \n-
    324 return global(backend.coords());
    \n-
    325 }
    \n-
    \n-
    326
    \n-
    327 template<int dimension, class CoordType>
    \n-\n-
    \n-\n-
    330 geometry() const
    \n-
    331 {
    \n-
    332 const typename BackendIterator::Geometry &
    \n-
    333 bgeo = backend.geometry();
    \n-
    334 std::vector<CoordVector> corners(dimension+1);
    \n-
    335 for(int i = 0; i <= dimension; ++i)
    \n-
    336 corners[i] = global(bgeo.corner(i));
    \n-
    337
    \n-
    338 return Geometry(bgeo.type(), corners);
    \n-
    339 }
    \n-
    \n-
    340
    \n-
    341 template<int dimension, class CoordType>
    \n-\n-
    343 CoordVector
    \n-\n-
    345 global(const CoordVector &local) const
    \n-
    346 {
    \n-
    347 return transformCoordinate(referenceToKuhn(local,
    \n-
    348 getPermutation<dimension>(kuhnIndex)));
    \n-
    349 }
    \n-
    350
    \n-
    351 // common
    \n-
    352 template<int dimension, class CoordType>
    \n-
    353 template<int codimension>
    \n-
    \n-
    354 class RefinementImp<dimension, CoordType>::Codim<codimension>::SubEntityIterator
    \n-
    355 : public ForwardIteratorFacade<typename RefinementImp<dimension, CoordType>::template Codim<codimension>::SubEntityIterator, int>,
    \n-
    356 public RefinementIteratorSpecial<dimension, CoordType, codimension>
    \n-
    357 {
    \n-
    358 public:
    \n-\n-
    360 typedef SubEntityIterator This;
    \n-
    361
    \n-
    362 SubEntityIterator(int nIntervals, bool end = false);
    \n-
    363
    \n-
    364 bool equals(const This &other) const;
    \n-
    365 protected:
    \n-
    366 using RefinementIteratorSpecial<dimension, CoordType, codimension>::kuhnIndex;
    \n-
    367 using RefinementIteratorSpecial<dimension, CoordType, codimension>::backend;
    \n-
    368 };
    \n-
    \n+
    274 // //////////////////
    \n+
    275 //
    \n+
    277 //
    \n+
    278
    \n+
    280
    \n+
    288 [[deprecated("Use factorial from dune-common's math.hh")]]
    \n+
    \n+
    289 inline int factorial(int n)
    \n+
    290 {
    \n+
    291 int prod = 1;
    \n+
    292 for(int i = 1; i <= n; ++i)
    \n+
    293 prod *= i;
    \n+
    294 return prod;
    \n+
    295 }
    \n+
    \n+
    296
    \n+
    304 [[deprecated("Use binomial from dune-common's math.hh")]]
    \n+
    \n+
    305 inline int binomial(int upper, int lower)
    \n+
    306 {
    \n+
    307 lower = std::min( lower, upper - lower );
    \n+
    308 if(lower < 0)
    \n+
    309 return 0;
    \n+
    310 int prod = 1;
    \n+
    311 for(int i = upper - lower; i < upper; ++i)
    \n+
    312 prod *= (i+1);
    \n+
    313 return prod / Dune::factorial(lower);
    \n+
    314 }
    \n+
    \n+
    315
    \n+
    322 template<int dimension>
    \n+
    \n+
    323 int pointIndex(const FieldVector<int, dimension> &point)
    \n+
    324 {
    \n+
    325 int index = 0;
    \n+
    326 for(int i = 0; i < dimension; ++i)
    \n+
    327 index += Dune::binomial(dimension-i + point[i]-1, dimension-i);
    \n+
    328 return index;
    \n+
    329 }
    \n+
    \n+
    330
    \n+
    335 template<int n>
    \n+
    \n+
    336 FieldVector<int, n> getPermutation(int m)
    \n+
    337 {
    \n+
    338 FieldVector<int, n> perm;
    \n+
    339 for(int i = 0; i < n; ++i)
    \n+
    340 perm[i] = i;
    \n+
    341
    \n+
    342 int base = 1;
    \n+
    343 for(int i = 1; i <= n; ++i)
    \n+
    344 base *= i;
    \n+
    345
    \n+
    346 for(int i = n; i > 0; --i) {
    \n+
    347 base /= i;
    \n+
    348 int d = m / base;
    \n+
    349 m %= base;
    \n+
    350 int t = perm[i-1]; perm[i-1] = perm[i-1-d]; perm[i-1-d] = t;
    \n+
    351 }
    \n+
    352 return perm;
    \n+
    353 }
    \n+
    \n+
    354
    \n+
    355#if 0
    \n+
    356 Has to be checked
    \n+
    357 // calculate the index of a permutation
    \n+
    358 template<int n>
    \n+
    359 int getPermIndex(const FieldVector<int, n>& test) // O(n^2)
    \n+
    360 {
    \n+
    361 int m = 0;
    \n+
    362 FieldVector<int, n> perm;
    \n+
    363 for(int i = 0; i < n; ++i)
    \n+
    364 perm[i] = i;
    \n+
    365
    \n+
    366 int base = 1;
    \n+
    367 for(int i = 1; i <= n; ++i)
    \n+
    368 base *= i;
    \n
    369
    \n-
    370#ifndef DOXYGEN
    \n-
    371 template<int dimension, class CoordType>
    \n-
    372 template<int codimension>
    \n-\n-
    374 SubEntityIterator(int nIntervals, bool end)
    \n-
    375 : RefinementIteratorSpecial<dimension, CoordType, codimension>(nIntervals, end)
    \n-
    376 {}
    \n-
    377
    \n-
    378 template<int dimension, class CoordType>
    \n-
    379 template<int codimension>
    \n-
    380 bool
    \n-\n-
    382 equals(const This &other) const
    \n-
    383 {
    \n-
    384 return kuhnIndex == other.kuhnIndex && backend == other.backend;
    \n-
    385 }
    \n-
    386#endif
    \n-
    387
    \n-
    388 } // namespace PyramidTriangulation
    \n-
    \n-
    389 } // namespace RefinementImp
    \n-
    390
    \n-
    391 namespace RefinementImp
    \n-
    392 {
    \n-
    393 // ///////////////////////
    \n-
    394 //
    \n-
    395 // The refinement traits
    \n-
    396 //
    \n-
    397#ifndef DOXYGEN
    \n-
    398 template<unsigned topologyId, class CoordType, unsigned coerceToId>
    \n-
    399 struct Traits<
    \n-
    400 topologyId, CoordType, coerceToId, 3,
    \n-
    401 typename std::enable_if<
    \n-
    402 (GeometryTypes::pyramid.id() >> 1) ==
    \n-
    403 (topologyId >> 1) &&
    \n-
    404 (GeometryTypes::simplex(3).id() >> 1) ==
    \n-
    405 (coerceToId >> 1)
    \n-
    406 >::type>
    \n-
    407 {
    \n-
    408 typedef PyramidTriangulation::RefinementImp<3, CoordType> Imp;
    \n-
    409 };
    \n-
    410#endif
    \n-
    411
    \n-
    412 } // namespace RefinementImp
    \n-
    413} // namespace Dune
    \n-
    414
    \n-
    415#endif // DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC
    \n-\n+
    370 for(int i = n; i > 0; --i) {
    \n+
    371 base /= i;
    \n+
    372 int d;
    \n+
    373 for(d = 0; d < i; ++d)
    \n+
    374 if(test[i-1] == perm[i-1-d])
    \n+
    375 break;
    \n+
    376 m += d * base;
    \n+
    377 int d = m / base;
    \n+
    378 m %= base;
    \n+
    379 perm[i-1-d] = perm[i-1];
    \n+
    380 }
    \n+
    381 }
    \n+
    382#endif
    \n+
    383
    \n+
    384 // map between the reference simplex and some arbitrary kuhn simplex (denoted by it's permutation)
    \n+
    392 template<int dimension, class CoordType>
    \n+
    393 FieldVector<CoordType, dimension>
    \n+
    \n+\n+
    395 FieldVector<CoordType, dimension> point,
    \n+
    397 const FieldVector<int, dimension> &kuhn)
    \n+
    398 {
    \n+
    399 for(int i = dimension - 1; i > 0; --i)
    \n+
    400 point[kuhn[i-1]] += point[kuhn[i]];
    \n+
    401 return point;
    \n+
    402 }
    \n+
    \n+
    403
    \n+
    411 template<int dimension, class CoordType>
    \n+
    412 FieldVector<CoordType, dimension>
    \n+
    \n+\n+
    414 FieldVector<CoordType, dimension> point,
    \n+
    416 const FieldVector<int, dimension> &kuhn)
    \n+
    417 {
    \n+
    418 for(int i = 0; i < dimension - 1; ++i)
    \n+
    419 point[kuhn[i]] -= point[kuhn[i+1]];
    \n+
    420 return point;
    \n+
    421 }
    \n+
    \n+
    422
    \n+
    423
    \n+
    425
    \n+
    426 // /////////////////////////////////////////
    \n+
    427 //
    \n+
    428 // refinement implementation for simplices
    \n+
    429 //
    \n+
    430
    \n+
    431 template<int dimension_, class CoordType>
    \n+
    \n+\n+
    433 {
    \n+
    434 public:
    \n+
    435 constexpr static int dimension = dimension_;
    \n+
    436 typedef CoordType ctype;
    \n+
    437
    \n+
    438 template<int codimension>
    \n+
    439 struct Codim;
    \n+\n+
    441 typedef FieldVector<CoordType, dimension> CoordVector;
    \n+\n+
    443 typedef FieldVector<int, dimension+1> IndexVector;
    \n+
    444
    \n+
    445 static int nVertices(int nIntervals);
    \n+
    446 static VertexIterator vBegin(int nIntervals);
    \n+
    447 static VertexIterator vEnd(int nIntervals);
    \n+
    448
    \n+
    449 static int nElements(int nIntervals);
    \n+
    450 static ElementIterator eBegin(int nIntervals);
    \n+
    451 static ElementIterator eEnd(int nIntervals);
    \n+
    452 };
    \n+
    \n+
    453
    \n+
    454 template<int dimension, class CoordType>
    \n+
    455 template<int codimension>
    \n+
    \n+
    456 struct RefinementImp<dimension, CoordType>::Codim
    \n+
    457 {
    \n+
    458 class SubEntityIterator;
    \n+
    459 // We don't need the caching, but the uncached MultiLinearGeometry has bug FS#1209
    \n+\n+
    461 };
    \n+
    \n+
    462
    \n+
    463 template<int dimension, class CoordType>
    \n+
    464 int
    \n+
    \n+\n+
    466 nVertices(int nIntervals)
    \n+
    467 {
    \n+
    468 return Dune::binomial(dimension + nIntervals, (int)dimension);
    \n+
    469 }
    \n+
    \n+
    470
    \n+
    471 template<int dimension, class CoordType>
    \n+\n+
    \n+\n+
    474 vBegin(int nIntervals)
    \n+
    475 {
    \n+
    476 return VertexIterator(nIntervals);
    \n+
    477 }
    \n+
    \n+
    478
    \n+
    479 template<int dimension, class CoordType>
    \n+\n+
    \n+\n+
    482 vEnd(int nIntervals)
    \n+
    483 {
    \n+
    484 return VertexIterator(nIntervals, true);
    \n+
    485 }
    \n+
    \n+
    486
    \n+
    487 template<int dimension, class CoordType>
    \n+
    488 int
    \n+
    \n+\n+
    490 nElements(int nIntervals)
    \n+
    491 {
    \n+
    492 return Dune::power(nIntervals, int(dimension));
    \n+
    493 }
    \n+
    \n+
    494
    \n+
    495 template<int dimension, class CoordType>
    \n+\n+
    \n+\n+
    498 eBegin(int nIntervals)
    \n+
    499 {
    \n+
    500 return ElementIterator(nIntervals);
    \n+
    501 }
    \n+
    \n+
    502
    \n+
    503 template<int dimension, class CoordType>
    \n+\n+
    \n+\n+
    506 eEnd(int nIntervals)
    \n+
    507 {
    \n+
    508 return ElementIterator(nIntervals, true);
    \n+
    509 }
    \n+
    \n+
    510
    \n+
    511 // //////////////
    \n+
    512 //
    \n+
    513 // The iterator
    \n+
    514 //
    \n+
    515
    \n+
    516 template<int dimension, class CoordType, int codimension>
    \n+\n+
    518
    \n+
    519 // vertices
    \n+
    520
    \n+
    521 template<int dimension, class CoordType>
    \n+
    \n+
    522 class RefinementIteratorSpecial<dimension, CoordType, dimension>
    \n+
    523 {
    \n+
    524 public:
    \n+\n+
    526 typedef typename Refinement::CoordVector CoordVector;
    \n+
    527 typedef typename Refinement::template Codim<dimension>::Geometry Geometry;
    \n+\n+
    529
    \n+
    530 RefinementIteratorSpecial(int nIntervals, bool end = false);
    \n+
    531
    \n+
    532 void increment();
    \n+
    533 bool equals(const This &other) const;
    \n+
    534
    \n+
    535 CoordVector coords() const;
    \n+
    536 Geometry geometry () const;
    \n+
    537
    \n+
    538 int index() const;
    \n+
    539 protected:
    \n+
    540 typedef FieldVector<int, dimension> Vertex;
    \n+
    541
    \n+
    542 int size;
    \n+\n+
    544 };
    \n+
    \n+
    545
    \n+
    546 template<int dimension, class CoordType>
    \n+
    \n+\n+
    548 RefinementIteratorSpecial(int nIntervals, bool end)
    \n+
    549 : size(nIntervals)
    \n+
    550 {
    \n+
    551 vertex[0] = (end) ? size + 1 : 0;
    \n+
    552 for(int i = 1; i < dimension; ++ i)
    \n+
    553 vertex[i] = 0;
    \n+
    554 }
    \n+
    \n+
    555
    \n+
    556 template<int dimension, class CoordType>
    \n+
    557 void
    \n+
    \n+\n+\n+
    560 {
    \n+
    561 assert(vertex[0] <= size);
    \n+
    562 for(int i = dimension - 1; i >= 0; --i) {
    \n+
    563 ++vertex[i];
    \n+
    564 if(i == 0 || vertex[i] <= vertex[i-1])
    \n+
    565 break;
    \n+
    566 else
    \n+
    567 vertex[i] = 0;
    \n+
    568 }
    \n+
    569 }
    \n+
    \n+
    570
    \n+
    571 template<int dimension, class CoordType>
    \n+
    572 bool
    \n+
    \n+\n+
    574 equals(const This &other) const
    \n+
    575 {
    \n+
    576 return size == other.size && vertex == other.vertex;
    \n+
    577 }
    \n+
    \n+
    578
    \n+
    579 template<int dimension, class CoordType>
    \n+\n+
    \n+\n+
    582 coords() const
    \n+
    583 {
    \n+
    584 Vertex ref = kuhnToReference(vertex, getPermutation<dimension>(0));
    \n+
    585
    \n+
    586 CoordVector coords;
    \n+
    587 for(int i = 0; i < dimension; ++i)
    \n+
    588 coords[i] = CoordType(ref[i]) / size;
    \n+
    589 return coords;
    \n+
    590 }
    \n+
    \n+
    591
    \n+
    592 template<int dimension, class CoordType>
    \n+\n+
    \n+\n+
    595 {
    \n+
    596 std::vector<CoordVector> corners(1);
    \n+
    597 corners[0] = (CoordVector)vertex;
    \n+
    598 return Geometry(GeometryTypes::vertex, corners);
    \n+
    599 }
    \n+
    \n+
    600
    \n+
    601 template<int dimension, class CoordType>
    \n+
    602 int
    \n+
    \n+\n+
    604 index() const
    \n+
    605 {
    \n+
    606 return pointIndex(vertex);
    \n+
    607 }
    \n+
    \n+
    608
    \n+
    609 // elements
    \n+
    610
    \n+
    611 template<int dimension, class CoordType>
    \n+
    \n+
    612 class RefinementIteratorSpecial<dimension, CoordType, 0>
    \n+
    613 {
    \n+
    614 public:
    \n+\n+\n+\n+
    618 typedef typename Refinement::template Codim<0>::Geometry Geometry;
    \n+\n+
    620
    \n+
    621 RefinementIteratorSpecial(int nIntervals, bool end = false);
    \n+
    622
    \n+
    623 void increment();
    \n+
    624 bool equals(const This &other) const;
    \n+
    625
    \n+
    626 IndexVector vertexIndices() const;
    \n+
    627 int index() const;
    \n+
    628 CoordVector coords() const;
    \n+
    629
    \n+
    630 Geometry geometry () const;
    \n+
    631
    \n+
    632 private:
    \n+
    633 CoordVector global(const CoordVector &local) const;
    \n+
    634
    \n+
    635 protected:
    \n+
    636 typedef FieldVector<int, dimension> Vertex;
    \n+
    637 constexpr static int nKuhnIntervals = Dune::factorial(dimension);
    \n+
    638
    \n+\n+\n+
    641 int size;
    \n+\n+
    643 };
    \n+
    \n+
    644
    \n+
    645 template<int dimension, class CoordType>
    \n+
    \n+\n+
    647 RefinementIteratorSpecial(int nIntervals, bool end)
    \n+
    648 : kuhnIndex(0), size(nIntervals), index_(0)
    \n+
    649 {
    \n+
    650 for(int i = 0; i < dimension; ++i)
    \n+
    651 origin[i] = 0;
    \n+
    652 if(end) {
    \n+
    653 index_ = Refinement::nElements(nIntervals);
    \n+
    654 origin[0] = size;
    \n+
    655 }
    \n+
    656 }
    \n+
    \n+
    657
    \n+
    658 template<int dimension, class CoordType>
    \n+
    659 void
    \n+
    \n+\n+\n+
    662 {
    \n+
    663 assert(origin[0] < size);
    \n+
    664
    \n+
    665 ++index_;
    \n+
    666
    \n+
    667 while(1) {
    \n+
    668 ++kuhnIndex;
    \n+
    669 if(kuhnIndex == nKuhnIntervals) {
    \n+
    670 kuhnIndex = 0;
    \n+
    671 // increment origin
    \n+
    672 for(int i = dimension - 1; i >= 0; --i) {
    \n+
    673 ++origin[i];
    \n+
    674 if(i == 0 || origin[i] <= origin[i-1])
    \n+
    675 break;
    \n+
    676 else
    \n+
    677 origin[i] = 0;
    \n+
    678 }
    \n+
    679 }
    \n+
    680
    \n+
    681 // test whether the current simplex has any corner outside the kuhn0 simplex
    \n+
    682 FieldVector<int, dimension> perm = getPermutation<dimension>(kuhnIndex);
    \n+
    683 Vertex corner = origin;
    \n+
    684 bool outside = false;
    \n+
    685 for(int i = 0; i < dimension; ++i) {
    \n+
    686 // next corner
    \n+
    687 ++corner[perm[i]];
    \n+
    688 if(perm[i] > 0)
    \n+
    689 if(corner[perm[i]] > corner[perm[i]-1]) {
    \n+
    690 outside = true;
    \n+
    691 break;
    \n+
    692 }
    \n+
    693 }
    \n+
    694 if(!outside)
    \n+
    695 return;
    \n+
    696 }
    \n+
    697 }
    \n+
    \n+
    698
    \n+
    699 template<int dimension, class CoordType>
    \n+
    700 bool
    \n+
    \n+\n+
    702 equals(const This &other) const
    \n+
    703 {
    \n+
    704 return size == other.size && index_ == other.index_;
    \n+
    705 }
    \n+
    \n+
    706
    \n+
    707 template<int dimension, class CoordType>
    \n+\n+
    \n+\n+
    710 vertexIndices() const
    \n+
    711 {
    \n+
    712 IndexVector indices;
    \n+
    713 FieldVector<int, dimension> perm = getPermutation<dimension>(kuhnIndex);
    \n+
    714 Vertex vertex = origin;
    \n+
    715 indices[0] = pointIndex(vertex);
    \n+
    716 for(int i = 0; i < dimension; ++i) {
    \n+
    717 ++vertex[perm[i]];
    \n+
    718 indices[i+1] = pointIndex(vertex);
    \n+
    719 }
    \n+
    720 if (kuhnIndex%2 == 1)
    \n+
    721 for(int i = 0; i < (dimension+1)/2; ++i) {
    \n+
    722 int t = indices[i];
    \n+
    723 indices[i] = indices[dimension-i];
    \n+
    724 indices[dimension-i] = t;
    \n+
    725 }
    \n+
    726 return indices;
    \n+
    727 }
    \n+
    \n+
    728
    \n+
    729 template<int dimension, class CoordType>
    \n+
    730 int
    \n+
    \n+\n+
    732 index() const
    \n+
    733 {
    \n+
    734 return index_;
    \n+
    735 }
    \n+
    \n+
    736
    \n+
    737 template<int dimension, class CoordType>
    \n+\n+
    \n+\n+
    740 coords() const
    \n+
    741 {
    \n+\n+
    743 ::simplex().position(0,0));
    \n+
    744 }
    \n+
    \n+
    745
    \n+
    746 template<int dimension, class CoordType>
    \n+\n+
    \n+\n+
    749 {
    \n+
    750 std::vector<CoordVector> corners(dimension+1);
    \n+\n+
    752 for(int i = 0; i <= dimension; ++i)
    \n+
    753 corners[i] = global(refelem.position(i, dimension));
    \n+
    754 return Geometry(refelem.type(), corners);
    \n+
    755 }
    \n+
    \n+
    756
    \n+
    757 template<int dimension, class CoordType>
    \n+\n+\n+
    760 global(const CoordVector &local) const {
    \n+
    761 CoordVector v =
    \n+
    762 referenceToKuhn(local, getPermutation<dimension>(kuhnIndex));
    \n+
    763 v += origin;
    \n+
    764 v /= (typename CoordVector::value_type)size;
    \n+
    765 return kuhnToReference(v, getPermutation<dimension>(0));
    \n+
    766 }
    \n+
    767
    \n+
    768 // common
    \n+
    769
    \n+
    770 template<int dimension, class CoordType>
    \n+
    771 template<int codimension>
    \n+
    \n+
    772 class RefinementImp<dimension, CoordType>::Codim<codimension>::SubEntityIterator
    \n+
    773 : public ForwardIteratorFacade<typename RefinementImp<dimension, CoordType>::template Codim<codimension>::SubEntityIterator, int>,
    \n+
    774 public RefinementIteratorSpecial<dimension, CoordType, codimension>
    \n+
    775 {
    \n+
    776 public:
    \n+\n+
    778
    \n+
    779 SubEntityIterator(int nIntervals, bool end = false);
    \n+
    780 };
    \n+
    \n+
    781
    \n+
    782#ifndef DOXYGEN
    \n+
    783
    \n+
    784 template<int dimension, class CoordType>
    \n+
    785 template<int codimension>
    \n+\n+
    787 SubEntityIterator(int nIntervals, bool end)
    \n+
    788 : RefinementIteratorSpecial<dimension, CoordType, codimension>(nIntervals, end)
    \n+
    789 {}
    \n+
    790
    \n+
    791#endif
    \n+
    792
    \n+
    793 } // namespace Simplex
    \n+
    \n+
    794
    \n+
    795 } // namespace RefinementImp
    \n+
    796
    \n+
    797
    \n+
    798 namespace RefinementImp {
    \n+
    799
    \n+
    800 // ///////////////////////
    \n+
    801 //
    \n+
    802 // The refinement traits
    \n+
    803 //
    \n+
    804
    \n+
    805#ifndef DOXYGEN
    \n+
    806 template<unsigned topologyId, class CoordType, unsigned coerceToId,
    \n+
    807 int dim>
    \n+
    808 struct Traits<
    \n+
    809 topologyId, CoordType, coerceToId, dim,
    \n+
    810 typename std::enable_if<
    \n+
    811 ((GeometryTypes::simplex(dim).id() >> 1) ==
    \n+
    812 (topologyId >> 1) &&
    \n+
    813 (GeometryTypes::simplex(dim).id() >> 1) ==
    \n+
    814 (coerceToId >> 1)
    \n+
    815 )>::type
    \n+
    816 >
    \n+
    817 {
    \n+
    818 typedef Simplex::RefinementImp<dim, CoordType> Imp;
    \n+
    819 };
    \n+
    820#endif
    \n+
    821
    \n+
    822
    \n+
    823 } // namespace RefinementImp
    \n+
    824
    \n+
    825} // namespace Dune
    \n+
    826
    \n+
    827#endif //DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC
    \n+\n
    A unique label for each type of element that can occur in a grid.
    \n-
    This file contains the parts independent of a particular Refinement implementation.
    \n-
    This file contains the Refinement implementation for simplices (triangles, tetrahedrons....
    \n+\n+
    This file contains the parts independent of a particular Refinement implementation.
    \n
    Definition affinegeometry.hh:21
    \n-
    FieldVector< CoordType, dimension > transformCoordinate(FieldVector< CoordType, dimension > point)
    Definition pyramidtriangulation.cc:51
    \n+
    int pointIndex(const FieldVector< int, dimension > &point)
    calculate the index of a given gridpoint within a Kuhn0 simplex
    Definition simplex.cc:323
    \n
    FieldVector< int, n > getPermutation(int m)
    Calculate permutation from it's index.
    Definition simplex.cc:336
    \n+
    int factorial(int n)
    Calculate n!
    Definition simplex.cc:289
    \n+
    int binomial(int upper, int lower)
    calculate
    Definition simplex.cc:305
    \n
    FieldVector< CoordType, dimension > referenceToKuhn(FieldVector< CoordType, dimension > point, const FieldVector< int, dimension > &kuhn)
    Map from the reference simplex to some Kuhn simplex.
    Definition simplex.cc:394
    \n+
    FieldVector< CoordType, dimension > kuhnToReference(FieldVector< CoordType, dimension > point, const FieldVector< int, dimension > &kuhn)
    Map from some Kuhn simplex to the reference simplex.
    Definition simplex.cc:413
    \n+
    Class providing access to the singletons of the reference elements.
    Definition referenceelements.hh:170
    \n+
    static const ReferenceElement & simplex()
    get simplex reference elements
    Definition referenceelements.hh:204
    \n
    Static tag representing a codimension.
    Definition dimension.hh:24
    \n-
    generic geometry implementation based on corner coordinates
    Definition multilineargeometry.hh:181
    \n-\n-
    Implementation of the refinement of a pyramid into simplices.
    Definition pyramidtriangulation.cc:68
    \n-
    FieldVector< CoordType, dimension > CoordVector
    Definition pyramidtriangulation.cc:77
    \n-
    static int nVertices(int nIntervals)
    Definition pyramidtriangulation.cc:109
    \n-
    static int nElements(int nIntervals)
    Definition pyramidtriangulation.cc:133
    \n-
    CoordType ctype
    Definition pyramidtriangulation.cc:72
    \n-
    Codim< dimension >::SubEntityIterator VertexIterator
    Definition pyramidtriangulation.cc:76
    \n-
    Codim< 0 >::SubEntityIterator ElementIterator
    Definition pyramidtriangulation.cc:78
    \n-
    static constexpr int dimension
    Definition pyramidtriangulation.cc:70
    \n-
    static ElementIterator eBegin(int nIntervals)
    Definition pyramidtriangulation.cc:141
    \n-
    static ElementIterator eEnd(int nIntervals)
    Definition pyramidtriangulation.cc:149
    \n-
    FieldVector< int, dimension+1 > IndexVector
    Definition pyramidtriangulation.cc:79
    \n-
    static VertexIterator vBegin(int nIntervals)
    Definition pyramidtriangulation.cc:117
    \n-
    static VertexIterator vEnd(int nIntervals)
    Definition pyramidtriangulation.cc:125
    \n-\n-
    Dune::MultiLinearGeometry< CoordType, dimension-codimension, dimension > Geometry
    Definition pyramidtriangulation.cc:103
    \n-
    RefinementImp< dimension, CoordType > Refinement
    Definition pyramidtriangulation.cc:164
    \n-
    Refinement::template Codim< dimension >::Geometry Geometry
    Definition pyramidtriangulation.cc:166
    \n-
    Refinement::BackendRefinement BackendRefinement
    Definition pyramidtriangulation.cc:178
    \n-\n-
    BackendRefinement::template Codim< dimension >::SubEntityIterator BackendIterator
    Definition pyramidtriangulation.cc:179
    \n-\n-\n-\n-\n-\n-
    Refinement::CoordVector CoordVector
    Definition pyramidtriangulation.cc:246
    \n-\n-
    Refinement::template Codim< 0 >::Geometry Geometry
    Definition pyramidtriangulation.cc:247
    \n-
    Refinement::IndexVector IndexVector
    Definition pyramidtriangulation.cc:245
    \n-
    BackendRefinement::template Codim< 0 >::SubEntityIterator BackendIterator
    Definition pyramidtriangulation.cc:264
    \n-\n-\n-
    RefinementImp< dimension, CoordType > Refinement
    Definition pyramidtriangulation.cc:244
    \n-
    Refinement::BackendRefinement BackendRefinement
    Definition pyramidtriangulation.cc:263
    \n-\n-
    SubEntityIterator This
    Definition pyramidtriangulation.cc:360
    \n-\n-
    RefinementImp< dimension, CoordType > Refinement
    Definition pyramidtriangulation.cc:359
    \n+
    Implement a MultiLinearGeometry with additional caching.
    Definition multilineargeometry.hh:526
    \n \n+
    Codim< dimension >::SubEntityIterator VertexIterator
    Definition simplex.cc:440
    \n+
    FieldVector< int, dimension+1 > IndexVector
    Definition simplex.cc:443
    \n+
    CoordType ctype
    Definition simplex.cc:436
    \n+
    static int nVertices(int nIntervals)
    Definition simplex.cc:466
    \n+
    static int nElements(int nIntervals)
    Definition simplex.cc:490
    \n+
    static ElementIterator eEnd(int nIntervals)
    Definition simplex.cc:506
    \n+
    static VertexIterator vEnd(int nIntervals)
    Definition simplex.cc:482
    \n+
    Codim< 0 >::SubEntityIterator ElementIterator
    Definition simplex.cc:442
    \n+
    static VertexIterator vBegin(int nIntervals)
    Definition simplex.cc:474
    \n+
    static ElementIterator eBegin(int nIntervals)
    Definition simplex.cc:498
    \n+
    FieldVector< CoordType, dimension > CoordVector
    Definition simplex.cc:441
    \n+
    static constexpr int dimension
    Definition simplex.cc:435
    \n+\n+
    Dune::CachedMultiLinearGeometry< CoordType, dimension-codimension, dimension > Geometry
    Definition simplex.cc:460
    \n+\n+\n+\n+
    RefinementImp< dimension, CoordType > Refinement
    Definition simplex.cc:525
    \n+\n+
    Refinement::template Codim< dimension >::Geometry Geometry
    Definition simplex.cc:527
    \n+
    RefinementIteratorSpecial< dimension, CoordType, dimension > This
    Definition simplex.cc:528
    \n+\n+\n+\n+\n+
    FieldVector< int, dimension > Vertex
    Definition simplex.cc:636
    \n+\n+\n+
    Refinement::template Codim< 0 >::Geometry Geometry
    Definition simplex.cc:618
    \n+\n+\n+
    RefinementIteratorSpecial< dimension, CoordType, 0 > This
    Definition simplex.cc:619
    \n+
    RefinementImp< dimension, CoordType > Refinement
    Definition simplex.cc:615
    \n+\n+\n+
    RefinementImp< dimension, CoordType > Refinement
    Definition simplex.cc:777
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -8,605 +8,739 @@\n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n * refinement\n-pyramidtriangulation.cc\n+simplex.cc\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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file\n LICENSE.md in module root\n 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n- 5#ifndef DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC\n-6#define DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC\n+ 5#ifndef DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC\n+6#define DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC\n 7\n- 8#include \n- 9#include \n- 10\n- 11#include \n- 12#include \n+ 8// This file is part of DUNE, a Distributed and Unified Numerics Environment\n+ 9// This file is copyright (C) 2005 Jorrit Fahlke \n+ 10// This file is licensed under version 2 of the GNU General Public License,\n+ 11// with a special \"runtime exception.\" See COPYING at the top of the source\n+ 12// tree for the full licence.\n 13\n- 14#include \"base.cc\"\n- 15#include \"simplex.cc\"\n- 16\n- 17namespace Dune\n- 18{\n- 19 namespace RefinementImp\n- 20 {\n-26 namespace PyramidTriangulation\n- 27 {\n- 28 // ////////////\n- 29 //\n- 30 // Utilities\n- 31 //\n- 32\n- 33 using Simplex::getPermutation;\n- 34 using Simplex::referenceToKuhn;\n- 35\n- 36 // ////////////////////////////////////\n- 37 //\n- 38 // Refine a pyramid with simplices\n- 39 //\n- 40\n- 41 // forward declaration of the iterator base\n- 42 template\n-43 class RefinementIteratorSpecial;\n- 44\n- 45 /*\n- 46 * The permutations 0 and 1 of the Kuhn-decomposition of a cube into\n-simplices form a pyramid.\n- 47 * The resulting pyramid is not oriented the same as the reference pyramid\n-and so the Kuhn-coordinates\n- 48 * have to be transformed using the method below.\n- 49 */\n- 50 template FieldVector\n-51 transformCoordinate( FieldVector point)\n- 52 {\n- 53 FieldVector transform;\n- 54 transform[0]=1-point[0];\n- 55 transform[1]=1-point[1];\n- 56 transform[2]=point[2];\n- 57 return transform;\n- 58 }\n- 59\n- 66 template\n-67 class RefinementImp\n- 68 {\n- 69 public:\n-70 constexpr static int dimension = dimension_;\n- 71\n-72 typedef CoordType ctype;\n- 73\n- 74 template\n- 75 struct Codim;\n-76 typedef typename Codim::SubEntityIterator VertexIterator;\n-77 typedef FieldVector CoordVector;\n-78 typedef typename Codim<0>::SubEntityIterator ElementIterator;\n-79 typedef FieldVector IndexVector;\n- 80\n- 81 static int nVertices(int nIntervals);\n- 82 static VertexIterator vBegin(int nIntervals);\n- 83 static VertexIterator vEnd(int nIntervals);\n- 84\n- 85 static int nElements(int nIntervals);\n- 86 static ElementIterator eBegin(int nIntervals);\n-87 static ElementIterator eEnd(int nIntervals);\n- 88\n- 89 private:\n- 90 friend class RefinementIteratorSpecial;\n- 91 friend class RefinementIteratorSpecial;\n- 92\n- 93 typedef Simplex::RefinementImp BackendRefinement;\n- 94\n- 95 constexpr static int nKuhnSimplices = 2;\n- 96 };\n- 97\n- 98 template\n- 99 template\n-100 struct RefinementImp::Codim\n- 101 {\n- 102 class SubEntityIterator;\n-103 typedef Dune::MultiLinearGeometry Geometry;\n- 104 };\n- 105\n- 106 template\n- 107 int\n-108 RefinementImp::\n- 109nVertices(int nIntervals)\n- 110 {\n- 111 return BackendRefinement::nVertices(nIntervals) * nKuhnSimplices;\n- 112 }\n- 113\n- 114 template\n- 115 typename RefinementImp::VertexIterator\n-116 RefinementImp::\n- 117vBegin(int nIntervals)\n- 118 {\n- 119 return VertexIterator(nIntervals);\n- 120 }\n- 121\n- 122 template\n- 123 typename RefinementImp::VertexIterator\n-124 RefinementImp::\n- 125vEnd(int nIntervals)\n- 126 {\n- 127 return VertexIterator(nIntervals, true);\n- 128 }\n- 129\n- 130 template\n- 131 int\n-132 RefinementImp::\n- 133nElements(int nIntervals)\n- 134 {\n- 135 return BackendRefinement::nElements(nIntervals) * nKuhnSimplices;\n- 136 }\n- 137\n- 138 template\n- 139 typename RefinementImp::ElementIterator\n-140 RefinementImp::\n- 141eBegin(int nIntervals)\n- 142 {\n- 143 return ElementIterator(nIntervals);\n- 144 }\n- 145\n- 146 template\n- 147 typename RefinementImp::ElementIterator\n-148 RefinementImp::\n- 149eEnd(int nIntervals)\n- 150 {\n- 151 return ElementIterator(nIntervals, true);\n- 152 }\n- 153\n- 154 // //////////////\n- 155 //\n- 156 // The iterator\n- 157 //\n- 158\n- 159 // vertices\n- 160 template\n-161 class RefinementIteratorSpecial\n- 162 {\n- 163 public:\n-164 typedef RefinementImp Refinement;\n-165 typedef typename Refinement::CoordVector CoordVector;\n-166 typedef typename Refinement::template Codim::Geometry Geometry;\n- 167\n- 168 RefinementIteratorSpecial(int nIntervals, bool end = false);\n- 169\n- 170 void increment();\n- 171\n- 172 CoordVector coords() const;\n- 173\n- 174 Geometry geometry() const;\n- 175\n- 176 int index() const;\n- 177 protected:\n-178 typedef typename Refinement::BackendRefinement BackendRefinement;\n-179 typedef typename BackendRefinement::template Codim::\n-SubEntityIterator BackendIterator;\n-180 constexpr static int nKuhnSimplices = 2;\n- 181\n-182 int nIntervals_;\n- 183\n-184 int kuhnIndex;\n-185 BackendIterator backend;\n-186 const BackendIterator backendEnd;\n- 187 };\n- 188\n- 189 template\n-190 RefinementIteratorSpecial::\n- 191RefinementIteratorSpecial(int nIntervals, bool end)\n- 192 : nIntervals_(nIntervals), kuhnIndex(0),\n- 193 backend(BackendRefinement::vBegin(nIntervals_)),\n- 194 backendEnd(BackendRefinement::vEnd(nIntervals_))\n- 195 {\n- 196 if (end)\n- 197 kuhnIndex = nKuhnSimplices;\n- 198 }\n- 199\n- 200 template\n- 201 void\n-202 RefinementIteratorSpecial::\n- 203increment()\n- 204 {\n- 205 ++backend;\n- 206 if(backend == backendEnd)\n- 207 {\n- 208 backend = BackendRefinement::vBegin(nIntervals_);\n- 209 ++kuhnIndex;\n- 210 }\n- 211 }\n- 212\n- 213 template\n- 214 typename RefinementIteratorSpecial::\n-CoordVector\n-215 RefinementIteratorSpecial::\n- 216coords() const\n- 217 {\n- 218 return transformCoordinate(referenceToKuhn(backend.coords(),\n- 219 getPermutation(kuhnIndex)));\n- 220 }\n- 221\n- 222 template\n- 223 typename RefinementIteratorSpecial::\n-Geometry\n-224 RefinementIteratorSpecial::geometry ()\n-const\n- 225 {\n- 226 std::vector corners(1);\n- 227 corners[0] = referenceToKuhn(backend.coords(), getPermutation\n-(kuhnIndex));\n- 228 return Geometry(GeometryTypes::vertex, corners);\n- 229 }\n- 230\n- 231 template\n- 232 int\n-233 RefinementIteratorSpecial::\n- 234index() const\n- 235 {\n- 236 return kuhnIndex*BackendRefinement::nVertices(nIntervals_) + backend.index\n-();\n- 237 }\n- 238\n- 239 // elements\n- 240 template\n-241 class RefinementIteratorSpecial\n- 242 {\n- 243 public:\n-244 typedef RefinementImp Refinement;\n-245 typedef typename Refinement::IndexVector IndexVector;\n-246 typedef typename Refinement::CoordVector CoordVector;\n-247 typedef typename Refinement::template Codim<0>::Geometry Geometry;\n- 248\n- 249 RefinementIteratorSpecial(int nIntervals, bool end = false);\n- 250\n- 251 void increment();\n+ 251#include \n 252\n- 253 IndexVector vertexIndices() const;\n- 254 int index() const;\n- 255 CoordVector coords() const;\n- 256\n- 257 Geometry geometry() const;\n- 258\n- 259 private:\n- 260 CoordVector global(const CoordVector &local) const;\n+ 253#include \n+ 254#include \n+ 255\n+ 256#include \n+ 257#include \n+ 258#include \n+ 259\n+ 260#include \"base.cc\"\n 261\n- 262 protected:\n-263 typedef typename Refinement::BackendRefinement BackendRefinement;\n-264 typedef typename BackendRefinement::template Codim<0>::SubEntityIterator\n-BackendIterator;\n-265 constexpr static int nKuhnSimplices = 2;\n- 266\n-267 int nIntervals_;\n- 268\n-269 int kuhnIndex;\n-270 BackendIterator backend;\n-271 const BackendIterator backendEnd;\n- 272 };\n+ 262namespace Dune {\n+ 263\n+ 264 namespace RefinementImp {\n+ 265\n+272 namespace Simplex {\n 273\n- 274 template\n-275 RefinementIteratorSpecial::\n- 276RefinementIteratorSpecial(int nIntervals, bool end)\n- 277 : nIntervals_(nIntervals), kuhnIndex(0),\n- 278 backend(BackendRefinement::eBegin(nIntervals_)),\n- 279 backendEnd(BackendRefinement::eEnd(nIntervals_))\n- 280 {\n- 281 if (end)\n- 282 kuhnIndex = nKuhnSimplices;\n- 283 }\n- 284\n- 285 template\n- 286 void\n-287 RefinementIteratorSpecial::\n- 288increment()\n- 289 {\n- 290 ++backend;\n- 291 if (backend == backendEnd)\n- 292 {\n- 293 backend = BackendRefinement::eBegin(nIntervals_);\n- 294 ++kuhnIndex;\n+ 274 // //////////////////\n+ 275 //\n+ 277 //\n+ 278\n+ 280\n+ 288 [[deprecated(\"Use factorial from dune-common's math.hh\")]]\n+289 inline int factorial(int n)\n+ 290 {\n+ 291 int prod = 1;\n+ 292 for(int i = 1; i <= n; ++i)\n+ 293 prod *= i;\n+ 294 return prod;\n 295 }\n- 296 }\n- 297\n- 298 template\n- 299 typename RefinementIteratorSpecial::IndexVector\n-300 RefinementIteratorSpecial::\n- 301vertexIndices() const\n- 302 {\n- 303 IndexVector indices = backend.vertexIndices();\n- 304\n- 305 int base = kuhnIndex * BackendRefinement::nVertices(nIntervals_);\n- 306 indices += base;\n- 307\n- 308 return indices;\n- 309 }\n- 310\n- 311 template\n- 312 int\n-313 RefinementIteratorSpecial::\n- 314index() const\n- 315 {\n- 316 return kuhnIndex*BackendRefinement::nElements(nIntervals_) + backend.index\n-();\n- 317 }\n- 318\n- 319 template\n- 320 typename RefinementIteratorSpecial::CoordVector\n-321 RefinementIteratorSpecial::\n- 322coords() const\n- 323 {\n- 324 return global(backend.coords());\n- 325 }\n- 326\n- 327 template\n- 328 typename RefinementIteratorSpecial::Geometry\n-329 RefinementIteratorSpecial::\n- 330geometry() const\n- 331 {\n- 332 const typename BackendIterator::Geometry &\n- 333 bgeo = backend.geometry();\n- 334 std::vector corners(dimension+1);\n- 335 for(int i = 0; i <= dimension; ++i)\n- 336 corners[i] = global(bgeo.corner(i));\n- 337\n- 338 return Geometry(bgeo.type(), corners);\n- 339 }\n- 340\n- 341 template\n- 342 typename RefinementIteratorSpecial::\n- 343 CoordVector\n- 344 RefinementIteratorSpecial::\n- 345global(const CoordVector &local) const\n- 346 {\n- 347 return transformCoordinate(referenceToKuhn(local,\n- 348 getPermutation(kuhnIndex)));\n- 349 }\n- 350\n- 351 // common\n- 352 template\n- 353 template\n-354 class RefinementImp::Codim::\n+ 296\n+ 304 [[deprecated(\"Use binomial from dune-common's math.hh\")]]\n+305 inline int binomial(int upper, int lower)\n+ 306 {\n+ 307 lower = std::min( lower, upper - lower );\n+ 308 if(lower < 0)\n+ 309 return 0;\n+ 310 int prod = 1;\n+ 311 for(int i = upper - lower; i < upper; ++i)\n+ 312 prod *= (i+1);\n+ 313 return prod / Dune::factorial(lower);\n+ 314 }\n+ 315\n+ 322 template\n+323 int pointIndex(const FieldVector &point)\n+ 324 {\n+ 325 int index = 0;\n+ 326 for(int i = 0; i < dimension; ++i)\n+ 327 index += Dune::binomial(dimension-i + point[i]-1, dimension-i);\n+ 328 return index;\n+ 329 }\n+ 330\n+ 335 template\n+336 FieldVector getPermutation(int m)\n+ 337 {\n+ 338 FieldVector perm;\n+ 339 for(int i = 0; i < n; ++i)\n+ 340 perm[i] = i;\n+ 341\n+ 342 int base = 1;\n+ 343 for(int i = 1; i <= n; ++i)\n+ 344 base *= i;\n+ 345\n+ 346 for(int i = n; i > 0; --i) {\n+ 347 base /= i;\n+ 348 int d = m / base;\n+ 349 m %= base;\n+ 350 int t = perm[i-1]; perm[i-1] = perm[i-1-d]; perm[i-1-d] = t;\n+ 351 }\n+ 352 return perm;\n+ 353 }\n+ 354\n+ 355#if 0\n+ 356 Has to be checked\n+ 357 // calculate the index of a permutation\n+ 358 template\n+ 359 int getPermIndex(const FieldVector& test) // O(n^2)\n+ 360 {\n+ 361 int m = 0;\n+ 362 FieldVector perm;\n+ 363 for(int i = 0; i < n; ++i)\n+ 364 perm[i] = i;\n+ 365\n+ 366 int base = 1;\n+ 367 for(int i = 1; i <= n; ++i)\n+ 368 base *= i;\n+ 369\n+ 370 for(int i = n; i > 0; --i) {\n+ 371 base /= i;\n+ 372 int d;\n+ 373 for(d = 0; d < i; ++d)\n+ 374 if(test[i-1] == perm[i-1-d])\n+ 375 break;\n+ 376 m += d * base;\n+ 377 int d = m / base;\n+ 378 m %= base;\n+ 379 perm[i-1-d] = perm[i-1];\n+ 380 }\n+ 381 }\n+ 382#endif\n+ 383\n+ 384 // map between the reference simplex and some arbitrary kuhn simplex\n+(denoted by it's permutation)\n+ 392 template\n+ 393 FieldVector\n+394 referenceToKuhn(\n+ 395 FieldVector point,\n+ 397 const FieldVector &kuhn)\n+ 398 {\n+ 399 for(int i = dimension - 1; i > 0; --i)\n+ 400 point[kuhn[i-1]] += point[kuhn[i]];\n+ 401 return point;\n+ 402 }\n+ 403\n+ 411 template\n+ 412 FieldVector\n+413 kuhnToReference(\n+ 414 FieldVector point,\n+ 416 const FieldVector &kuhn)\n+ 417 {\n+ 418 for(int i = 0; i < dimension - 1; ++i)\n+ 419 point[kuhn[i]] -= point[kuhn[i+1]];\n+ 420 return point;\n+ 421 }\n+ 422\n+ 423\n+ 425\n+ 426 // /////////////////////////////////////////\n+ 427 //\n+ 428 // refinement implementation for simplices\n+ 429 //\n+ 430\n+ 431 template\n+432 class RefinementImp\n+ 433 {\n+ 434 public:\n+435 constexpr static int dimension = dimension_;\n+436 typedef CoordType ctype;\n+ 437\n+ 438 template\n+ 439 struct Codim;\n+440 typedef typename Codim::SubEntityIterator VertexIterator;\n+441 typedef FieldVector CoordVector;\n+442 typedef typename Codim<0>::SubEntityIterator ElementIterator;\n+443 typedef FieldVector IndexVector;\n+ 444\n+ 445 static int nVertices(int nIntervals);\n+ 446 static VertexIterator vBegin(int nIntervals);\n+ 447 static VertexIterator vEnd(int nIntervals);\n+ 448\n+ 449 static int nElements(int nIntervals);\n+ 450 static ElementIterator eBegin(int nIntervals);\n+ 451 static ElementIterator eEnd(int nIntervals);\n+ 452 };\n+ 453\n+ 454 template\n+ 455 template\n+456 struct RefinementImp::Codim\n+ 457 {\n+ 458 class SubEntityIterator;\n+ 459 // We don't need the caching, but the uncached MultiLinearGeometry has bug\n+FS#1209\n+460 typedef Dune::CachedMultiLinearGeometry Geometry;\n+ 461 };\n+ 462\n+ 463 template\n+ 464 int\n+465 RefinementImp::\n+ 466nVertices(int nIntervals)\n+ 467 {\n+ 468 return Dune::binomial(dimension + nIntervals, (int)dimension);\n+ 469 }\n+ 470\n+ 471 template\n+ 472 typename RefinementImp::VertexIterator\n+473 RefinementImp::\n+ 474vBegin(int nIntervals)\n+ 475 {\n+ 476 return VertexIterator(nIntervals);\n+ 477 }\n+ 478\n+ 479 template\n+ 480 typename RefinementImp::VertexIterator\n+481 RefinementImp::\n+ 482vEnd(int nIntervals)\n+ 483 {\n+ 484 return VertexIterator(nIntervals, true);\n+ 485 }\n+ 486\n+ 487 template\n+ 488 int\n+489 RefinementImp::\n+ 490nElements(int nIntervals)\n+ 491 {\n+ 492 return Dune::power(nIntervals, int(dimension));\n+ 493 }\n+ 494\n+ 495 template\n+ 496 typename RefinementImp::ElementIterator\n+497 RefinementImp::\n+ 498eBegin(int nIntervals)\n+ 499 {\n+ 500 return ElementIterator(nIntervals);\n+ 501 }\n+ 502\n+ 503 template\n+ 504 typename RefinementImp::ElementIterator\n+505 RefinementImp::\n+ 506eEnd(int nIntervals)\n+ 507 {\n+ 508 return ElementIterator(nIntervals, true);\n+ 509 }\n+ 510\n+ 511 // //////////////\n+ 512 //\n+ 513 // The iterator\n+ 514 //\n+ 515\n+ 516 template\n+517 class RefinementIteratorSpecial;\n+ 518\n+ 519 // vertices\n+ 520\n+ 521 template\n+522 class RefinementIteratorSpecial\n+ 523 {\n+ 524 public:\n+525 typedef RefinementImp Refinement;\n+526 typedef typename Refinement::CoordVector CoordVector;\n+527 typedef typename Refinement::template Codim::Geometry Geometry;\n+528 typedef RefinementIteratorSpecial This;\n+ 529\n+ 530 RefinementIteratorSpecial(int nIntervals, bool end = false);\n+ 531\n+ 532 void increment();\n+ 533 bool equals(const This &other) const;\n+ 534\n+ 535 CoordVector coords() const;\n+ 536 Geometry geometry () const;\n+ 537\n+ 538 int index() const;\n+ 539 protected:\n+540 typedef FieldVector Vertex;\n+ 541\n+542 int size;\n+543 Vertex vertex;\n+ 544 };\n+ 545\n+ 546 template\n+547 RefinementIteratorSpecial::\n+ 548RefinementIteratorSpecial(int nIntervals, bool end)\n+ 549 : size(nIntervals)\n+ 550 {\n+ 551 vertex[0] = (end) ? size + 1 : 0;\n+ 552 for(int i = 1; i < dimension; ++ i)\n+ 553 vertex[i] = 0;\n+ 554 }\n+ 555\n+ 556 template\n+ 557 void\n+558 RefinementIteratorSpecial::\n+ 559increment()\n+ 560 {\n+ 561 assert(vertex[0] <= size);\n+ 562 for(int i = dimension - 1; i >= 0; --i) {\n+ 563 ++vertex[i];\n+ 564 if(i == 0 || vertex[i] <= vertex[i-1])\n+ 565 break;\n+ 566 else\n+ 567 vertex[i] = 0;\n+ 568 }\n+ 569 }\n+ 570\n+ 571 template\n+ 572 bool\n+573 RefinementIteratorSpecial::\n+ 574equals(const This &other) const\n+ 575 {\n+ 576 return size == other.size && vertex == other.vertex;\n+ 577 }\n+ 578\n+ 579 template\n+ 580 typename RefinementIteratorSpecial::\n+CoordVector\n+581 RefinementIteratorSpecial::\n+ 582coords() const\n+ 583 {\n+ 584 Vertex ref = kuhnToReference(vertex, getPermutation(0));\n+ 585\n+ 586 CoordVector coords;\n+ 587 for(int i = 0; i < dimension; ++i)\n+ 588 coords[i] = CoordType(ref[i]) / size;\n+ 589 return coords;\n+ 590 }\n+ 591\n+ 592 template\n+ 593 typename RefinementIteratorSpecial::\n+Geometry\n+594 RefinementIteratorSpecial::geometry ()\n+const\n+ 595 {\n+ 596 std::vector corners(1);\n+ 597 corners[0] = (CoordVector)vertex;\n+ 598 return Geometry(GeometryTypes::vertex, corners);\n+ 599 }\n+ 600\n+ 601 template\n+ 602 int\n+603 RefinementIteratorSpecial::\n+ 604index() const\n+ 605 {\n+ 606 return pointIndex(vertex);\n+ 607 }\n+ 608\n+ 609 // elements\n+ 610\n+ 611 template\n+612 class RefinementIteratorSpecial\n+ 613 {\n+ 614 public:\n+615 typedef RefinementImp Refinement;\n+616 typedef typename Refinement::IndexVector IndexVector;\n+617 typedef typename Refinement::CoordVector CoordVector;\n+618 typedef typename Refinement::template Codim<0>::Geometry Geometry;\n+619 typedef RefinementIteratorSpecial This;\n+ 620\n+ 621 RefinementIteratorSpecial(int nIntervals, bool end = false);\n+ 622\n+ 623 void increment();\n+ 624 bool equals(const This &other) const;\n+ 625\n+ 626 IndexVector vertexIndices() const;\n+ 627 int index() const;\n+ 628 CoordVector coords() const;\n+ 629\n+ 630 Geometry geometry () const;\n+ 631\n+ 632 private:\n+ 633 CoordVector global(const CoordVector &local) const;\n+ 634\n+ 635 protected:\n+636 typedef FieldVector Vertex;\n+637 constexpr static int nKuhnIntervals = Dune::factorial(dimension);\n+ 638\n+639 Vertex origin;\n+640 int kuhnIndex;\n+641 int size;\n+642 int index_;\n+ 643 };\n+ 644\n+ 645 template\n+646 RefinementIteratorSpecial::\n+ 647RefinementIteratorSpecial(int nIntervals, bool end)\n+ 648 : kuhnIndex(0), size(nIntervals), index_(0)\n+ 649 {\n+ 650 for(int i = 0; i < dimension; ++i)\n+ 651 origin[i] = 0;\n+ 652 if(end) {\n+ 653 index_ = Refinement::nElements(nIntervals);\n+ 654 origin[0] = size;\n+ 655 }\n+ 656 }\n+ 657\n+ 658 template\n+ 659 void\n+660 RefinementIteratorSpecial::\n+ 661increment()\n+ 662 {\n+ 663 assert(origin[0] < size);\n+ 664\n+ 665 ++index_;\n+ 666\n+ 667 while(1) {\n+ 668 ++kuhnIndex;\n+ 669 if(kuhnIndex == nKuhnIntervals) {\n+ 670 kuhnIndex = 0;\n+ 671 // increment origin\n+ 672 for(int i = dimension - 1; i >= 0; --i) {\n+ 673 ++origin[i];\n+ 674 if(i == 0 || origin[i] <= origin[i-1])\n+ 675 break;\n+ 676 else\n+ 677 origin[i] = 0;\n+ 678 }\n+ 679 }\n+ 680\n+ 681 // test whether the current simplex has any corner outside the kuhn0\n+simplex\n+ 682 FieldVector perm = getPermutation(kuhnIndex);\n+ 683 Vertex corner = origin;\n+ 684 bool outside = false;\n+ 685 for(int i = 0; i < dimension; ++i) {\n+ 686 // next corner\n+ 687 ++corner[perm[i]];\n+ 688 if(perm[i] > 0)\n+ 689 if(corner[perm[i]] > corner[perm[i]-1]) {\n+ 690 outside = true;\n+ 691 break;\n+ 692 }\n+ 693 }\n+ 694 if(!outside)\n+ 695 return;\n+ 696 }\n+ 697 }\n+ 698\n+ 699 template\n+ 700 bool\n+701 RefinementIteratorSpecial::\n+ 702equals(const This &other) const\n+ 703 {\n+ 704 return size == other.size && index_ == other.index_;\n+ 705 }\n+ 706\n+ 707 template\n+ 708 typename RefinementIteratorSpecial::IndexVector\n+709 RefinementIteratorSpecial::\n+ 710vertexIndices() const\n+ 711 {\n+ 712 IndexVector indices;\n+ 713 FieldVector perm = getPermutation(kuhnIndex);\n+ 714 Vertex vertex = origin;\n+ 715 indices[0] = pointIndex(vertex);\n+ 716 for(int i = 0; i < dimension; ++i) {\n+ 717 ++vertex[perm[i]];\n+ 718 indices[i+1] = pointIndex(vertex);\n+ 719 }\n+ 720 if (kuhnIndex%2 == 1)\n+ 721 for(int i = 0; i < (dimension+1)/2; ++i) {\n+ 722 int t = indices[i];\n+ 723 indices[i] = indices[dimension-i];\n+ 724 indices[dimension-i] = t;\n+ 725 }\n+ 726 return indices;\n+ 727 }\n+ 728\n+ 729 template\n+ 730 int\n+731 RefinementIteratorSpecial::\n+ 732index() const\n+ 733 {\n+ 734 return index_;\n+ 735 }\n+ 736\n+ 737 template\n+ 738 typename RefinementIteratorSpecial::CoordVector\n+739 RefinementIteratorSpecial::\n+ 740coords() const\n+ 741 {\n+ 742 return global(ReferenceElements\n+ 743 ::simplex().position(0,0));\n+ 744 }\n+ 745\n+ 746 template\n+ 747 typename RefinementIteratorSpecial::Geometry\n+748 RefinementIteratorSpecial::geometry () const\n+ 749 {\n+ 750 std::vector corners(dimension+1);\n+ 751 auto refelem = ReferenceElements::simplex();\n+ 752 for(int i = 0; i <= dimension; ++i)\n+ 753 corners[i] = global(refelem.position(i, dimension));\n+ 754 return Geometry(refelem.type(), corners);\n+ 755 }\n+ 756\n+ 757 template\n+ 758 typename RefinementIteratorSpecial::CoordVector\n+ 759 RefinementIteratorSpecial::\n+ 760global(const CoordVector &local) const {\n+ 761 CoordVector v =\n+ 762 referenceToKuhn(local, getPermutation(kuhnIndex));\n+ 763 v += origin;\n+ 764 v /= (typename CoordVector::value_type)size;\n+ 765 return kuhnToReference(v, getPermutation(0));\n+ 766 }\n+ 767\n+ 768 // common\n+ 769\n+ 770 template\n+ 771 template\n+772 class RefinementImp::Codim::\n SubEntityIterator\n- 355 : public ForwardIteratorFacade::template Codim::SubEntityIterator, int>,\n- 356 public RefinementIteratorSpecial\n- 357 {\n- 358 public:\n-359 typedef RefinementImp Refinement;\n-360 typedef SubEntityIterator This;\n- 361\n-362 SubEntityIterator(int nIntervals, bool end = false);\n- 363\n-364 bool equals(const This &other) const;\n- 365 protected:\n- 366 using RefinementIteratorSpecial::\n-kuhnIndex;\n- 367 using RefinementIteratorSpecial::\n-backend;\n- 368 };\n- 369\n- 370#ifndef DOXYGEN\n- 371 template\n- 372 template\n- 373 RefinementImp::Codim::\n+ 774 public RefinementIteratorSpecial\n+ 775 {\n+ 776 public:\n+777 typedef RefinementImp Refinement;\n+ 778\n+779 SubEntityIterator(int nIntervals, bool end = false);\n+ 780 };\n+ 781\n+ 782#ifndef DOXYGEN\n+ 783\n+ 784 template\n+ 785 template\n+ 786 RefinementImp::Codim::\n SubEntityIterator::\n- 374SubEntityIterator(int nIntervals, bool end)\n- 375 : RefinementIteratorSpecial(nIntervals,\n+ 787SubEntityIterator(int nIntervals, bool end)\n+ 788 : RefinementIteratorSpecial(nIntervals,\n end)\n- 376 {}\n- 377\n- 378 template\n- 379 template\n- 380 bool\n- 381 RefinementImp::Codim::\n-SubEntityIterator::\n- 382equals(const This &other) const\n- 383 {\n- 384 return kuhnIndex == other.kuhnIndex && backend == other.backend;\n- 385 }\n- 386#endif\n- 387\n- 388 } // namespace PyramidTriangulation\n- 389 } // namespace RefinementImp\n- 390\n- 391 namespace RefinementImp\n- 392 {\n- 393 // ///////////////////////\n- 394 //\n- 395 // The refinement traits\n- 396 //\n- 397#ifndef DOXYGEN\n- 398 template\n- 399 struct Traits<\n- 400 topologyId, CoordType, coerceToId, 3,\n- 401 typename std::enable_if<\n- 402 (GeometryTypes::pyramid.id() >> 1) ==\n- 403 (topologyId >> 1) &&\n- 404 (GeometryTypes::simplex(3).id() >> 1) ==\n- 405 (coerceToId >> 1)\n- 406 >::type>\n- 407 {\n- 408 typedef PyramidTriangulation::RefinementImp<3, CoordType> Imp;\n- 409 };\n- 410#endif\n- 411\n- 412 } // namespace RefinementImp\n- 413} // namespace Dune\n- 414\n- 415#endif // DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC\n-referenceelements.hh\n+ 789 {}\n+ 790\n+ 791#endif\n+ 792\n+ 793 } // namespace Simplex\n+ 794\n+ 795 } // namespace RefinementImp\n+ 796\n+ 797\n+ 798 namespace RefinementImp {\n+ 799\n+ 800 // ///////////////////////\n+ 801 //\n+ 802 // The refinement traits\n+ 803 //\n+ 804\n+ 805#ifndef DOXYGEN\n+ 806 template\n+ 808 struct Traits<\n+ 809 topologyId, CoordType, coerceToId, dim,\n+ 810 typename std::enable_if<\n+ 811 ((GeometryTypes::simplex(dim).id() >> 1) ==\n+ 812 (topologyId >> 1) &&\n+ 813 (GeometryTypes::simplex(dim).id() >> 1) ==\n+ 814 (coerceToId >> 1)\n+ 815 )>::type\n+ 816 >\n+ 817 {\n+ 818 typedef Simplex::RefinementImp Imp;\n+ 819 };\n+ 820#endif\n+ 821\n+ 822\n+ 823 } // namespace RefinementImp\n+ 824\n+ 825} // namespace Dune\n+ 826\n+ 827#endif //DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC\n+multilineargeometry.hh\n type.hh\n A unique label for each type of element that can occur in a grid.\n+referenceelements.hh\n base.cc\n This file contains the parts independent of a particular Refinement\n implementation.\n-simplex.cc\n-This file contains the Refinement implementation for simplices (triangles,\n-tetrahedrons....\n Dune\n Definition affinegeometry.hh:21\n-Dune::RefinementImp::PyramidTriangulation::transformCoordinate\n-FieldVector< CoordType, dimension > transformCoordinate(FieldVector< CoordType,\n-dimension > point)\n-Definition pyramidtriangulation.cc:51\n+Dune::RefinementImp::Simplex::pointIndex\n+int pointIndex(const FieldVector< int, dimension > &point)\n+calculate the index of a given gridpoint within a Kuhn0 simplex\n+Definition simplex.cc:323\n Dune::RefinementImp::Simplex::getPermutation\n FieldVector< int, n > getPermutation(int m)\n Calculate permutation from it's index.\n Definition simplex.cc:336\n+Dune::RefinementImp::Simplex::factorial\n+int factorial(int n)\n+Calculate n!\n+Definition simplex.cc:289\n+Dune::RefinementImp::Simplex::binomial\n+int binomial(int upper, int lower)\n+calculate\n+Definition simplex.cc:305\n Dune::RefinementImp::Simplex::referenceToKuhn\n FieldVector< CoordType, dimension > referenceToKuhn(FieldVector< CoordType,\n dimension > point, const FieldVector< int, dimension > &kuhn)\n Map from the reference simplex to some Kuhn simplex.\n Definition simplex.cc:394\n+Dune::RefinementImp::Simplex::kuhnToReference\n+FieldVector< CoordType, dimension > kuhnToReference(FieldVector< CoordType,\n+dimension > point, const FieldVector< int, dimension > &kuhn)\n+Map from some Kuhn simplex to the reference simplex.\n+Definition simplex.cc:413\n+Dune::Geo::ReferenceElements\n+Class providing access to the singletons of the reference elements.\n+Definition referenceelements.hh:170\n+Dune::Geo::ReferenceElements::simplex\n+static const ReferenceElement & simplex()\n+get simplex reference elements\n+Definition referenceelements.hh:204\n Dune::Codim\n Static tag representing a codimension.\n Definition dimension.hh:24\n-Dune::MultiLinearGeometry\n-generic geometry implementation based on corner coordinates\n-Definition multilineargeometry.hh:181\n-Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial\n-Definition pyramidtriangulation.cc:43\n-Dune::RefinementImp::PyramidTriangulation::RefinementImp\n-Implementation of the refinement of a pyramid into simplices.\n-Definition pyramidtriangulation.cc:68\n-Dune::RefinementImp::PyramidTriangulation::RefinementImp::CoordVector\n-FieldVector< CoordType, dimension > CoordVector\n-Definition pyramidtriangulation.cc:77\n-Dune::RefinementImp::PyramidTriangulation::RefinementImp::nVertices\n+Dune::CachedMultiLinearGeometry\n+Implement a MultiLinearGeometry with additional caching.\n+Definition multilineargeometry.hh:526\n+Dune::RefinementImp::Simplex::RefinementImp\n+Definition simplex.cc:433\n+Dune::RefinementImp::Simplex::RefinementImp::VertexIterator\n+Codim< dimension >::SubEntityIterator VertexIterator\n+Definition simplex.cc:440\n+Dune::RefinementImp::Simplex::RefinementImp::IndexVector\n+FieldVector< int, dimension+1 > IndexVector\n+Definition simplex.cc:443\n+Dune::RefinementImp::Simplex::RefinementImp::ctype\n+CoordType ctype\n+Definition simplex.cc:436\n+Dune::RefinementImp::Simplex::RefinementImp::nVertices\n static int nVertices(int nIntervals)\n-Definition pyramidtriangulation.cc:109\n-Dune::RefinementImp::PyramidTriangulation::RefinementImp::nElements\n+Definition simplex.cc:466\n+Dune::RefinementImp::Simplex::RefinementImp::nElements\n static int nElements(int nIntervals)\n-Definition pyramidtriangulation.cc:133\n-Dune::RefinementImp::PyramidTriangulation::RefinementImp::ctype\n-CoordType ctype\n-Definition pyramidtriangulation.cc:72\n-Dune::RefinementImp::PyramidTriangulation::RefinementImp::VertexIterator\n-Codim< dimension >::SubEntityIterator VertexIterator\n-Definition pyramidtriangulation.cc:76\n-Dune::RefinementImp::PyramidTriangulation::RefinementImp::ElementIterator\n-Codim< 0 >::SubEntityIterator ElementIterator\n-Definition pyramidtriangulation.cc:78\n-Dune::RefinementImp::PyramidTriangulation::RefinementImp::dimension\n-static constexpr int dimension\n-Definition pyramidtriangulation.cc:70\n-Dune::RefinementImp::PyramidTriangulation::RefinementImp::eBegin\n-static ElementIterator eBegin(int nIntervals)\n-Definition pyramidtriangulation.cc:141\n-Dune::RefinementImp::PyramidTriangulation::RefinementImp::eEnd\n+Definition simplex.cc:490\n+Dune::RefinementImp::Simplex::RefinementImp::eEnd\n static ElementIterator eEnd(int nIntervals)\n-Definition pyramidtriangulation.cc:149\n-Dune::RefinementImp::PyramidTriangulation::RefinementImp::IndexVector\n-FieldVector< int, dimension+1 > IndexVector\n-Definition pyramidtriangulation.cc:79\n-Dune::RefinementImp::PyramidTriangulation::RefinementImp::vBegin\n-static VertexIterator vBegin(int nIntervals)\n-Definition pyramidtriangulation.cc:117\n-Dune::RefinementImp::PyramidTriangulation::RefinementImp::vEnd\n+Definition simplex.cc:506\n+Dune::RefinementImp::Simplex::RefinementImp::vEnd\n static VertexIterator vEnd(int nIntervals)\n-Definition pyramidtriangulation.cc:125\n-Dune::RefinementImp::PyramidTriangulation::RefinementImp::Codim\n-Definition pyramidtriangulation.cc:101\n-Dune::RefinementImp::PyramidTriangulation::RefinementImp::Codim::Geometry\n-Dune::MultiLinearGeometry< CoordType, dimension-codimension, dimension >\n+Definition simplex.cc:482\n+Dune::RefinementImp::Simplex::RefinementImp::ElementIterator\n+Codim< 0 >::SubEntityIterator ElementIterator\n+Definition simplex.cc:442\n+Dune::RefinementImp::Simplex::RefinementImp::vBegin\n+static VertexIterator vBegin(int nIntervals)\n+Definition simplex.cc:474\n+Dune::RefinementImp::Simplex::RefinementImp::eBegin\n+static ElementIterator eBegin(int nIntervals)\n+Definition simplex.cc:498\n+Dune::RefinementImp::Simplex::RefinementImp::CoordVector\n+FieldVector< CoordType, dimension > CoordVector\n+Definition simplex.cc:441\n+Dune::RefinementImp::Simplex::RefinementImp::dimension\n+static constexpr int dimension\n+Definition simplex.cc:435\n+Dune::RefinementImp::Simplex::RefinementImp::Codim\n+Definition simplex.cc:457\n+Dune::RefinementImp::Simplex::RefinementImp::Codim::Geometry\n+Dune::CachedMultiLinearGeometry< CoordType, dimension-codimension, dimension >\n Geometry\n-Definition pyramidtriangulation.cc:103\n-Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n-dimension,_CoordType,_dimension_>::Refinement\n+Definition simplex.cc:460\n+Dune::RefinementImp::Simplex::RefinementIteratorSpecial\n+Definition simplex.cc:517\n+Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n+dimension_>\n+Definition simplex.cc:523\n+Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n+dimension_>::CoordVector\n+Refinement::CoordVector CoordVector\n+Definition simplex.cc:526\n+Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n+dimension_>::Refinement\n RefinementImp< dimension, CoordType > Refinement\n-Definition pyramidtriangulation.cc:164\n-Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n-dimension,_CoordType,_dimension_>::Geometry\n+Definition simplex.cc:525\n+Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n+dimension_>::vertex\n+Vertex vertex\n+Definition simplex.cc:543\n+Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n+dimension_>::Geometry\n Refinement::template Codim< dimension >::Geometry Geometry\n-Definition pyramidtriangulation.cc:166\n-Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n-dimension,_CoordType,_dimension_>::BackendRefinement\n-Refinement::BackendRefinement BackendRefinement\n-Definition pyramidtriangulation.cc:178\n-Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n-dimension,_CoordType,_dimension_>::backend\n-BackendIterator backend\n-Definition pyramidtriangulation.cc:185\n-Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n-dimension,_CoordType,_dimension_>::BackendIterator\n-BackendRefinement::template Codim< dimension >::SubEntityIterator\n-BackendIterator\n-Definition pyramidtriangulation.cc:179\n-Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n-dimension,_CoordType,_dimension_>::kuhnIndex\n+Definition simplex.cc:527\n+Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n+dimension_>::This\n+RefinementIteratorSpecial< dimension, CoordType, dimension > This\n+Definition simplex.cc:528\n+Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n+dimension_>::Vertex\n+FieldVector< int, dimension > Vertex\n+Definition simplex.cc:540\n+Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n+dimension_>::size\n+int size\n+Definition simplex.cc:542\n+Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n+0_>\n+Definition simplex.cc:613\n+Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n+0_>::kuhnIndex\n int kuhnIndex\n-Definition pyramidtriangulation.cc:184\n-Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n-dimension,_CoordType,_dimension_>::CoordVector\n-Refinement::CoordVector CoordVector\n-Definition pyramidtriangulation.cc:165\n-Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n-dimension,_CoordType,_dimension_>::backendEnd\n-const BackendIterator backendEnd\n-Definition pyramidtriangulation.cc:186\n-Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n-dimension,_CoordType,_dimension_>::nIntervals_\n-int nIntervals_\n-Definition pyramidtriangulation.cc:182\n-Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n-dimension,_CoordType,_0_>::backendEnd\n-const BackendIterator backendEnd\n-Definition pyramidtriangulation.cc:271\n-Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n-dimension,_CoordType,_0_>::CoordVector\n-Refinement::CoordVector CoordVector\n-Definition pyramidtriangulation.cc:246\n-Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n-dimension,_CoordType,_0_>::nIntervals_\n-int nIntervals_\n-Definition pyramidtriangulation.cc:267\n-Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n-dimension,_CoordType,_0_>::Geometry\n+Definition simplex.cc:640\n+Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n+0_>::Vertex\n+FieldVector< int, dimension > Vertex\n+Definition simplex.cc:636\n+Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n+0_>::origin\n+Vertex origin\n+Definition simplex.cc:639\n+Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n+0_>::index_\n+int index_\n+Definition simplex.cc:642\n+Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n+0_>::Geometry\n Refinement::template Codim< 0 >::Geometry Geometry\n-Definition pyramidtriangulation.cc:247\n-Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n-dimension,_CoordType,_0_>::IndexVector\n+Definition simplex.cc:618\n+Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n+0_>::IndexVector\n Refinement::IndexVector IndexVector\n-Definition pyramidtriangulation.cc:245\n-Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n-dimension,_CoordType,_0_>::BackendIterator\n-BackendRefinement::template Codim< 0 >::SubEntityIterator BackendIterator\n-Definition pyramidtriangulation.cc:264\n-Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n-dimension,_CoordType,_0_>::kuhnIndex\n-int kuhnIndex\n-Definition pyramidtriangulation.cc:269\n-Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n-dimension,_CoordType,_0_>::backend\n-BackendIterator backend\n-Definition pyramidtriangulation.cc:270\n-Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n-dimension,_CoordType,_0_>::Refinement\n+Definition simplex.cc:616\n+Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n+0_>::CoordVector\n+Refinement::CoordVector CoordVector\n+Definition simplex.cc:617\n+Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n+0_>::This\n+RefinementIteratorSpecial< dimension, CoordType, 0 > This\n+Definition simplex.cc:619\n+Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n+0_>::Refinement\n RefinementImp< dimension, CoordType > Refinement\n-Definition pyramidtriangulation.cc:244\n-Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial<\n-dimension,_CoordType,_0_>::BackendRefinement\n-Refinement::BackendRefinement BackendRefinement\n-Definition pyramidtriangulation.cc:263\n-Dune::RefinementImp::PyramidTriangulation::RefinementImp::Codim<_codimension\n->::equals\n-bool equals(const This &other) const\n-Dune::RefinementImp::PyramidTriangulation::RefinementImp::Codim<_codimension\n->::This\n-SubEntityIterator This\n-Definition pyramidtriangulation.cc:360\n-Dune::RefinementImp::PyramidTriangulation::RefinementImp::Codim<_codimension\n->::SubEntityIterator\n+Definition simplex.cc:615\n+Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n+0_>::size\n+int size\n+Definition simplex.cc:641\n+Dune::RefinementImp::Simplex::RefinementImp::Codim<_codimension_>::\n+SubEntityIterator\n SubEntityIterator(int nIntervals, bool end=false)\n-Dune::RefinementImp::PyramidTriangulation::RefinementImp::Codim<_codimension\n->::Refinement\n+Dune::RefinementImp::Simplex::RefinementImp::Codim<_codimension_>::Refinement\n RefinementImp< dimension, CoordType > Refinement\n-Definition pyramidtriangulation.cc:359\n-Dune::RefinementImp::Simplex::RefinementImp\n-Definition simplex.cc:433\n+Definition simplex.cc:777\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00221.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00221.html", "unified_diff": "@@ -79,18 +79,18 @@\n Macros |\n Functions \n
    prismtriangulation.cc File Reference
    \n \n
    \n
    #include <dune/common/fvector.hh>
    \n #include <dune/common/typetraits.hh>
    \n-#include <dune/geometry/referenceelements.hh>
    \n+#include <dune/geometry/referenceelements.hh>
    \n #include <dune/geometry/type.hh>
    \n-#include "base.cc"
    \n-#include "simplex.cc"
    \n+#include "base.cc"
    \n+#include "simplex.cc"
    \n
    \n

    Go to the source code of this file.

    \n \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00221_source.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00221_source.html", "unified_diff": "@@ -87,19 +87,19 @@\n
    4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    5#ifndef DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC
    \n
    6#define DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC
    \n
    7
    \n
    8#include <dune/common/fvector.hh>
    \n
    9#include <dune/common/typetraits.hh>
    \n
    10
    \n-\n+\n
    12#include <dune/geometry/type.hh>
    \n
    13
    \n-
    14#include "base.cc"
    \n-
    15#include "simplex.cc"
    \n+
    14#include "base.cc"
    \n+
    15#include "simplex.cc"
    \n
    16
    \n
    17namespace Dune
    \n
    18{
    \n
    19 namespace RefinementImp
    \n
    20 {
    \n
    \n
    26 namespace PrismTriangulation
    \n@@ -526,18 +526,18 @@\n
    406 };
    \n
    407#endif
    \n
    408
    \n
    409 } // namespace RefinementImp
    \n
    410} // namespace Dune
    \n
    411
    \n
    412#endif // DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC
    \n-\n
    A unique label for each type of element that can occur in a grid.
    \n-
    This file contains the parts independent of a particular Refinement implementation.
    \n-
    This file contains the Refinement implementation for simplices (triangles, tetrahedrons....
    \n+\n+
    This file contains the parts independent of a particular Refinement implementation.
    \n+
    This file contains the Refinement implementation for simplices (triangles, tetrahedrons....
    \n
    Definition affinegeometry.hh:21
    \n
    FieldVector< CoordType, dimension > transformCoordinate(FieldVector< CoordType, dimension > point)
    Definition prismtriangulation.cc:50
    \n
    FieldVector< int, n > getPermutation(int m)
    Calculate permutation from it's index.
    Definition simplex.cc:336
    \n
    FieldVector< CoordType, dimension > referenceToKuhn(FieldVector< CoordType, dimension > point, const FieldVector< int, dimension > &kuhn)
    Map from the reference simplex to some Kuhn simplex.
    Definition simplex.cc:394
    \n
    Static tag representing a codimension.
    Definition dimension.hh:24
    \n
    generic geometry implementation based on corner coordinates
    Definition multilineargeometry.hh:181
    \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -432,17 +432,17 @@\n 406 };\n 407#endif\n 408\n 409 } // namespace RefinementImp\n 410} // namespace Dune\n 411\n 412#endif // DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC\n-referenceelements.hh\n type.hh\n A unique label for each type of element that can occur in a grid.\n+referenceelements.hh\n base.cc\n This file contains the parts independent of a particular Refinement\n implementation.\n simplex.cc\n This file contains the Refinement implementation for simplices (triangles,\n tetrahedrons....\n Dune\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00224.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00224.html", "unified_diff": "@@ -79,18 +79,18 @@\n Macros
    \n
    hcubetriangulation.cc File Reference
    \n \n
    \n \n

    This file contains the Refinement implementation for triangulating hypercubes (quadrilateral -> triangle, hexahedron -> tetrahedron) \n More...

    \n-

    \n Classes

    class  Dune::RefinementImp::PrismTriangulation::RefinementImp< dimension_, CoordType >
     Implementation of the refinement of a prism into simplices. More...
    \n \n \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00224_source.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00224_source.html", "unified_diff": "@@ -84,19 +84,19 @@\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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
    \n
    4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n
    5#ifndef DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC
    \n
    6#define DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC
    \n
    7
    \n-\n+\n
    30#include <dune/geometry/type.hh>
    \n
    31
    \n-
    32#include "base.cc"
    \n-
    33#include "simplex.cc"
    \n+
    32#include "base.cc"
    \n+
    33#include "simplex.cc"
    \n
    34
    \n
    35namespace Dune
    \n
    36{
    \n
    37 namespace RefinementImp
    \n
    38 {
    \n
    \n
    46 namespace HCubeTriangulation {
    \n@@ -515,18 +515,18 @@\n
    412 };
    \n
    413#endif
    \n
    414
    \n
    415 } // namespace RefinementImp
    \n
    416} // namespace Dune
    \n
    417
    \n
    418#endif // DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC
    \n-\n
    A unique label for each type of element that can occur in a grid.
    \n-
    This file contains the parts independent of a particular Refinement implementation.
    \n-
    This file contains the Refinement implementation for simplices (triangles, tetrahedrons....
    \n+\n+
    This file contains the parts independent of a particular Refinement implementation.
    \n+
    This file contains the Refinement implementation for simplices (triangles, tetrahedrons....
    \n
    Definition affinegeometry.hh:21
    \n
    FieldVector< int, n > getPermutation(int m)
    Calculate permutation from it's index.
    Definition simplex.cc:336
    \n
    FieldVector< CoordType, dimension > referenceToKuhn(FieldVector< CoordType, dimension > point, const FieldVector< int, dimension > &kuhn)
    Map from the reference simplex to some Kuhn simplex.
    Definition simplex.cc:394
    \n
    Static tag representing a codimension.
    Definition dimension.hh:24
    \n
    generic geometry implementation based on corner coordinates
    Definition multilineargeometry.hh:181
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -422,17 +422,17 @@\n 412 };\n 413#endif\n 414\n 415 } // namespace RefinementImp\n 416} // namespace Dune\n 417\n 418#endif // DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC\n-referenceelements.hh\n type.hh\n A unique label for each type of element that can occur in a grid.\n+referenceelements.hh\n base.cc\n This file contains the parts independent of a particular Refinement\n implementation.\n simplex.cc\n This file contains the Refinement implementation for simplices (triangles,\n tetrahedrons....\n Dune\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00227.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00227.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: base.cc File Reference\n+dune-geometry: referenceelement.hh File Reference\n \n \n \n \n \n \n \n@@ -65,87 +65,44 @@\n
    \n
    \n \n \n \n \n \n
    \n \n-
    base.cc File Reference
    \n+Namespaces
    \n+
    referenceelement.hh File Reference
    \n \n
    \n-\n-

    This file contains the parts independent of a particular Refinement implementation. \n-More...

    \n
    #include <dune/geometry/type.hh>
    \n
    \n

    Go to the source code of this file.

    \n

    \n Classes

    class  Dune::RefinementImp::HCubeTriangulation::RefinementImp< dimension_, CoordType >
     
    \n \n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n \n-\n-\n+\n+\n \n

    \n Classes

    struct  Dune::RefinementImp::Traits< topologyId, CoordType, coerceToId, dimension, Dummy >
     Mapping from geometryType, CoordType and coerceTo to a particular Refinement implementation. More...
     
    class  Dune::RefinementIntervals
     Holds the number of refined intervals per axis needed for virtual and static refinement. More...
     
    class  Dune::StaticRefinement< topologyId, CoordType, coerceToId, dimension_ >
     Wrap each Refinement implementation to get a consistent interface. More...
    class  Dune::Geo::ReferenceElement< Implementation >
     This class provides access to geometric and topological properties of a reference element. More...
     
    struct  Dune::StaticRefinement< topologyId, CoordType, coerceToId, dimension_ >::Codim< codimension >
     The Codim struct inherited from the Refinement implementation. More...
    struct  Dune::Geo::ReferenceElement< Implementation >::Codim< codim >
     Collection of types depending on the codimension. More...
     
    \n \n \n \n-\n-\n+\n \n-

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::RefinementImp
     This namespace contains the implementation of Refinement.
    namespace  Dune::Geo
     
    \n-\n-\n-\n-

    \n-Macros

    #define DUNE_GEOMETRY_REFINEMENT_BASE_CC
     
    \n-\n-\n-\n-\n-\n-\n-\n

    \n-Functions

    RefinementIntervals Dune::refinementIntervals (int intervals)
     Creates a RefinementIntervals object.
     
    RefinementIntervals Dune::refinementLevels (int levels)
     Creates a RefinementIntervals object.
     
    \n-

    Detailed Description

    \n-

    This file contains the parts independent of a particular Refinement implementation.

    \n-

    Macro Definition Documentation

    \n-\n-

    ◆ DUNE_GEOMETRY_REFINEMENT_BASE_CC

    \n-\n-
    \n-
    \n- \n- \n- \n- \n-
    #define DUNE_GEOMETRY_REFINEMENT_BASE_CC
    \n-
    \n-\n-
    \n-
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,58 +6,27 @@\n dune-geometry\u00a02.9.0\n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n- * refinement\n-Classes | Namespaces | Macros | Functions\n-base.cc File Reference\n-This file contains the parts independent of a particular Refinement\n-implementation. More...\n+Classes | Namespaces\n+referenceelement.hh File Reference\n #include \n Go_to_the_source_code_of_this_file.\n Classes\n-struct \u00a0Dune::RefinementImp::Traits<_topologyId,_CoordType,_coerceToId,\n- dimension,_Dummy_>\n-\u00a0 Mapping from geometryType, CoordType and coerceTo to a particular\n- Refinement implementation. More...\n+ class \u00a0Dune::Geo::ReferenceElement<_Implementation_>\n+\u00a0 This class provides access to geometric and topological properties of\n+ a reference element. More...\n \u00a0\n- class \u00a0Dune::RefinementIntervals\n-\u00a0 Holds the number of refined intervals per axis needed for virtual and\n- static refinement. More...\n-\u00a0\n- class \u00a0Dune::StaticRefinement<_topologyId,_CoordType,_coerceToId,_dimension_\n- >\n-\u00a0 Wrap each Refinement implementation to get a consistent interface.\n- More...\n-\u00a0\n-struct \u00a0Dune::StaticRefinement<_topologyId,_CoordType,_coerceToId,_dimension_\n- >::Codim<_codimension_>\n-\u00a0 The Codim struct inherited from the Refinement implementation. More...\n+struct \u00a0Dune::Geo::ReferenceElement<_Implementation_>::Codim<_codim_>\n+\u00a0 Collection of types depending on the codimension. More...\n \u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n-namespace \u00a0Dune::RefinementImp\n-\u00a0 This namespace contains the implementation of Refinement.\n-\u00a0\n- Macros\n-#define\u00a0DUNE_GEOMETRY_REFINEMENT_BASE_CC\n-\u00a0\n- Functions\n-RefinementIntervals\u00a0Dune::refinementIntervals (int intervals)\n-\u00a0 Creates a RefinementIntervals object.\n-\u00a0\n-RefinementIntervals\u00a0Dune::refinementLevels (int levels)\n-\u00a0 Creates a RefinementIntervals object.\n+namespace \u00a0Dune::Geo\n \u00a0\n-***** Detailed Description *****\n-This file contains the parts independent of a particular Refinement\n-implementation.\n-***** Macro Definition Documentation *****\n-***** \u25c6\u00a0DUNE_GEOMETRY_REFINEMENT_BASE_CC *****\n-#define DUNE_GEOMETRY_REFINEMENT_BASE_CC\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00227_source.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00227_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: base.cc Source File\n+dune-geometry: referenceelement.hh Source File\n \n \n \n \n \n \n \n@@ -70,199 +70,264 @@\n \n \n \n \n \n \n \n
    \n-
    base.cc
    \n+
    referenceelement.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
    \n
    4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n-
    5#ifndef DUNE_GEOMETRY_REFINEMENT_BASE_CC
    \n-
    6#define DUNE_GEOMETRY_REFINEMENT_BASE_CC
    \n+
    5#ifndef DUNE_GEOMETRY_REFERENCEELEMENT_HH
    \n+
    6#define DUNE_GEOMETRY_REFERENCEELEMENT_HH
    \n
    7
    \n-
    15#include <dune/geometry/type.hh>
    \n-
    16
    \n-
    17namespace Dune
    \n-
    18{
    \n-
    \n-
    28 namespace RefinementImp
    \n-
    29 {
    \n-
    30 // /////////////////////////////////
    \n-
    31 //
    \n-
    32 // Declaration of RefinementImp::Traits
    \n-
    33 //
    \n-
    34
    \n-
    35#ifdef DOXYGEN
    \n-
    36 // This is just for Doxygen
    \n-
    67 template<unsigned topologyId, class CoordType,
    \n-
    68 unsigned coerceToId, int dimension, class Dummy = void>
    \n-
    \n-
    69 struct Traits
    \n-
    70 {
    \n-
    72 typedef SquaringTheCircle::Refinement Imp;
    \n-
    73 };
    \n-
    \n-
    74
    \n-
    75#else // !DOXYGEN
    \n+\n+
    9
    \n+
    10namespace Dune {
    \n+
    11 namespace Geo {
    \n+
    12
    \n+
    13 namespace Impl {
    \n+
    14
    \n+
    15 // forward declaration for friend declaration
    \n+
    16 template<typename ctype, int dim>
    \n+
    17 class ReferenceElementContainer;
    \n+
    18
    \n+
    19 }
    \n+
    20
    \n+
    21 // forward declaration for constructing default reference element type
    \n+
    22 template<typename ctype, int dim>
    \n+
    23 class ReferenceElementImplementation;
    \n+
    24
    \n+
    25 // forward declaration for backwards compatibility conversion
    \n+
    26 template<typename ctype, int dim>
    \n+
    27 struct ReferenceElements;
    \n+
    28
    \n+
    29 // ReferenceElement
    \n+
    30 // ----------------
    \n+
    31
    \n+
    50 template<typename Implementation>
    \n+
    \n+\n+
    52 {
    \n+
    53
    \n+
    54 public:
    \n+
    55
    \n+
    56#ifndef DOXYGEN
    \n+
    57
    \n+
    59 template<int codim>
    \n+
    60 using Codim = typename Implementation::template Codim<codim>;
    \n+
    61
    \n+
    62#else
    \n+
    63
    \n+
    65 template< int codim >
    \n+
    \n+
    66 struct Codim
    \n+
    67 {
    \n+
    69 using Geometry = implementation-defined;
    \n+
    70 };
    \n+
    \n+
    71
    \n+
    72#endif // DOXYGEN
    \n+
    73
    \n+
    75 using ctype = typename Implementation::ctype;
    \n
    76
    \n-
    77 // Doxygen won't see this
    \n-
    78
    \n-
    79 template<unsigned topologyId, class CoordType,
    \n-
    80 unsigned coerceToId, int dimension, class = void>
    \n-
    81 struct Traits;
    \n+\n+
    79
    \n+
    81 using Coordinate = typename Implementation::Coordinate;
    \n
    82
    \n-
    83#endif // !DOXYGEN
    \n-
    84 } // namespace RefinementImp
    \n-
    \n+
    84 typedef ctype Volume;
    \n
    85
    \n-
    86
    \n-
    \n-\n-
    95 int intervals_=1;
    \n-
    96
    \n-
    97 public:
    \n-
    98 explicit RefinementIntervals(int i) : intervals_(i) {}
    \n+
    87 static constexpr int dimension = Implementation::dimension;
    \n+
    88
    \n+
    89
    \n+
    \n+
    94 int size(int c) const
    \n+
    95 {
    \n+
    96 return _impl->size(c);
    \n+
    97 }
    \n+
    \n+
    98
    \n
    99
    \n-
    100 int intervals() const { return intervals_; }
    \n-
    101 };
    \n+
    \n+
    111 int size(int i, int c, int cc) const
    \n+
    112 {
    \n+
    113 return _impl->size(i,c,cc);
    \n+
    114 }
    \n+
    \n+
    115
    \n+
    116
    \n+
    \n+
    130 int subEntity(int i, int c, int ii, int cc) const
    \n+
    131 {
    \n+
    132 return _impl->subEntity(i,c,ii,cc);
    \n+
    133 }
    \n+
    \n+
    134
    \n+
    \n+
    153 auto subEntities ( int i, int c, int cc ) const
    \n+
    154 {
    \n+
    155 return _impl->subEntities(i,c,cc);
    \n+
    156 }
    \n+
    \n+
    157
    \n+
    158
    \n+
    \n+
    171 decltype(auto) type(int i, int c) const
    \n+
    172 {
    \n+
    173 return _impl->type(i,c);
    \n+
    174 }
    \n+
    \n+
    175
    \n+
    176
    \n+
    \n+
    184 decltype(auto) type() const
    \n+
    185 {
    \n+
    186 return _impl->type();
    \n+
    187 }
    \n
    \n-
    102
    \n-
    \n-\n-
    109 {
    \n-
    110 return RefinementIntervals{intervals};
    \n-
    111 }
    \n-
    \n-
    \n-\n-
    118 {
    \n-
    119 return RefinementIntervals{1<<levels};
    \n-
    120 }
    \n-
    \n-
    121
    \n-
    122 // ///////////////
    \n-
    123 //
    \n-
    124 // Static Refinement
    \n-
    125 //
    \n-
    126
    \n-
    136 template<unsigned topologyId, class CoordType,
    \n-
    137 unsigned coerceToId, int dimension_>
    \n-
    \n-\n-
    139 : public RefinementImp::Traits<topologyId, CoordType,
    \n-
    140 coerceToId, dimension_ >::Imp
    \n-
    141 {
    \n-
    142 public:
    \n-
    143#ifdef DOXYGEN
    \n-
    149 template<int codimension>
    \n-
    \n-
    150 struct Codim
    \n-
    151 {
    \n-\n-
    158 };
    \n-
    \n-
    159
    \n-\n-\n-
    164
    \n-
    170 typedef CoordVector;
    \n-
    171
    \n-
    177 typedef IndexVector;
    \n-
    178#endif
    \n-
    179
    \n-
    180 typedef typename RefinementImp::Traits< topologyId, CoordType, coerceToId, dimension_>::Imp RefinementImp;
    \n-
    181
    \n-
    182 using RefinementImp::dimension;
    \n-
    183
    \n-
    184 using RefinementImp::Codim;
    \n-
    185
    \n-
    186 using typename RefinementImp::VertexIterator;
    \n-
    187 using typename RefinementImp::CoordVector;
    \n
    188
    \n-
    189 using typename RefinementImp::ElementIterator;
    \n-
    190 using typename RefinementImp::IndexVector;
    \n-
    191
    \n-
    \n-\n-
    198 {
    \n-
    199 return RefinementImp::nVertices(tag.intervals());
    \n-
    200 }
    \n-
    \n-
    201
    \n-
    \n-\n-
    208 {
    \n-
    209 return RefinementImp::vBegin(tag.intervals());
    \n-
    210 }
    \n-
    \n-
    211
    \n-
    \n-\n-
    218 {
    \n-
    219 return RefinementImp::vEnd(tag.intervals());
    \n-
    220 }
    \n+
    189
    \n+
    \n+
    203 decltype(auto) position(int i, int c) const
    \n+
    204 {
    \n+
    205 return _impl->position(i,c);
    \n+
    206 }
    \n+
    \n+
    207
    \n+
    208
    \n+
    \n+
    216 bool checkInside(const Coordinate& local) const
    \n+
    217 {
    \n+
    218 return _impl->checkInside(local);
    \n+
    219 }
    \n
    \n+
    220
    \n
    221
    \n-
    \n-\n-
    228 {
    \n-
    229 return RefinementImp::nElements(tag.intervals());
    \n-
    230 }
    \n-
    \n-
    231
    \n-
    \n-\n-
    238 {
    \n-
    239 return RefinementImp::eBegin(tag.intervals());
    \n-
    240 }
    \n-
    \n-
    241
    \n-
    \n-\n-
    248 {
    \n-
    249 return RefinementImp::eEnd(tag.intervals());
    \n-
    250 }
    \n-
    \n-
    251 };
    \n-
    \n-
    252
    \n-
    254} // namespace Dune
    \n-
    255
    \n-
    256#endif // DUNE_GEOMETRY_REFINEMENT_BASE_CC
    \n+
    233 template<int codim>
    \n+
    \n+
    234 typename Codim<codim>::Geometry geometry(int i) const
    \n+
    235 {
    \n+
    236 return _impl->template geometry<codim>(i);
    \n+
    237 }
    \n+
    \n+
    238
    \n+
    239
    \n+
    \n+\n+
    242 {
    \n+
    243 return _impl->volume();
    \n+
    244 }
    \n+
    \n+
    245
    \n+
    246
    \n+
    \n+
    258 decltype(auto) integrationOuterNormal(int face) const
    \n+
    259 {
    \n+
    260 return _impl->integrationOuterNormal(face);
    \n+
    261 }
    \n+
    \n+
    262
    \n+
    263
    \n+
    \n+\n+
    272 : _impl(nullptr)
    \n+
    273 {}
    \n+
    \n+
    274
    \n+
    \n+
    280 const Implementation& impl() const
    \n+
    281 {
    \n+
    282 return *_impl;
    \n+
    283 }
    \n+
    \n+
    284
    \n+
    \n+
    286 bool operator==(const ReferenceElement& r) const
    \n+
    287 {
    \n+
    288 return _impl == r._impl;
    \n+
    289 }
    \n+
    \n+
    290
    \n+
    \n+
    292 bool operator!=(const ReferenceElement& r) const
    \n+
    293 {
    \n+
    294 return not (*this == r);
    \n+
    295 }
    \n+
    \n+
    296
    \n+
    \n+
    298 friend std::size_t hash_value(const ReferenceElement& r)
    \n+
    299 {
    \n+
    300 return reinterpret_cast<std::size_t>(r._impl);
    \n+
    301 }
    \n+
    \n+
    302
    \n+
    303 private:
    \n+
    304
    \n+
    305 // The implementation must be a friend to construct a wrapper around itself.
    \n+
    306 friend Implementation;
    \n+
    307
    \n+
    308 // The reference container is a friend to be able to call setImplementation.
    \n+
    309 friend class Impl::ReferenceElementContainer<ctype,dimension>;
    \n+
    310
    \n+
    311 // Constructor for wrapping an implementation reference (required internally by the default implementation)
    \n+
    312 ReferenceElement(const Implementation& impl)
    \n+
    313 : _impl(&impl)
    \n+
    314 {}
    \n+
    315
    \n+
    316 void setImplementation(const Implementation& impl)
    \n+
    317 {
    \n+
    318 _impl = &impl;
    \n+
    319 }
    \n+
    320
    \n+
    321 const Implementation* _impl;
    \n+
    322
    \n+
    323 };
    \n+
    \n+
    324
    \n+
    325 }
    \n+
    326
    \n+
    327}
    \n+
    328
    \n+
    329
    \n+
    330#endif // DUNE_GEOMETRY_REFERENCEELEMENT_HH
    \n
    A unique label for each type of element that can occur in a grid.
    \n-
    RefinementIntervals refinementIntervals(int intervals)
    Creates a RefinementIntervals object.
    Definition base.cc:108
    \n-
    RefinementIntervals refinementLevels(int levels)
    Creates a RefinementIntervals object.
    Definition base.cc:117
    \n
    Definition affinegeometry.hh:21
    \n-
    Mapping from geometryType, CoordType and coerceTo to a particular Refinement implementation.
    Definition base.cc:70
    \n-
    Holds the number of refined intervals per axis needed for virtual and static refinement.
    Definition base.cc:94
    \n-
    RefinementIntervals(int i)
    Definition base.cc:98
    \n-
    int intervals() const
    Definition base.cc:100
    \n-
    Wrap each Refinement implementation to get a consistent interface.
    Definition base.cc:141
    \n-
    static ElementIterator eEnd(Dune::RefinementIntervals tag)
    Get an ElementIterator.
    Definition base.cc:247
    \n-
    static ElementIterator eBegin(Dune::RefinementIntervals tag)
    Get an ElementIterator.
    Definition base.cc:237
    \n-
    static int nElements(Dune::RefinementIntervals tag)
    Get the number of Elements.
    Definition base.cc:227
    \n-
    Codim< 0 >::SubEntityIterator ElementIterator
    The ElementIterator of the Refinement.
    Definition base.cc:163
    \n-
    static int nVertices(Dune::RefinementIntervals tag)
    Get the number of Vertices.
    Definition base.cc:197
    \n-
    static VertexIterator vBegin(Dune::RefinementIntervals tag)
    Get a VertexIterator.
    Definition base.cc:207
    \n-
    Codim< dimension >::SubEntityIterator VertexIterator
    The VertexIterator of the Refinement.
    Definition base.cc:161
    \n-
    typedef CoordVector
    The CoordVector of the Refinement.
    Definition base.cc:170
    \n-
    typedef IndexVector
    The IndexVector of the Refinement.
    Definition base.cc:177
    \n-
    RefinementImp::Traits< topologyId, CoordType, coerceToId, dimension_ >::Imp RefinementImp
    Definition base.cc:180
    \n-
    static VertexIterator vEnd(Dune::RefinementIntervals tag)
    Get a VertexIterator.
    Definition base.cc:217
    \n-
    The Codim struct inherited from the Refinement implementation.
    Definition base.cc:151
    \n-
    typedef SubEntityIterator
    The SubEntityIterator for each codim.
    Definition base.cc:157
    \n+
    This class provides access to geometric and topological properties of a reference element.
    Definition referenceelement.hh:52
    \n+
    CoordinateField volume() const
    obtain the volume of the reference element
    Definition referenceelement.hh:241
    \n+
    ReferenceElement()
    Constructs an empty reference element.
    Definition referenceelement.hh:271
    \n+
    bool operator!=(const ReferenceElement &r) const
    Compares for inequality with another reference element.
    Definition referenceelement.hh:292
    \n+
    decltype(auto) type(int i, int c) const
    obtain the type of subentity (i,c)
    Definition referenceelement.hh:171
    \n+
    typename Implementation::Coordinate Coordinate
    The coordinate type.
    Definition referenceelement.hh:81
    \n+
    Codim< codim >::Geometry geometry(int i) const
    obtain the embedding of subentity (i,codim) into the reference element
    Definition referenceelement.hh:234
    \n+
    static constexpr int dimension
    The dimension of the reference element.
    Definition referenceelement.hh:87
    \n+
    int size(int i, int c, int cc) const
    number of subentities of codimension cc of subentity (i,c)
    Definition referenceelement.hh:111
    \n+
    int subEntity(int i, int c, int ii, int cc) const
    obtain number of ii-th subentity with codim cc of (i,c)
    Definition referenceelement.hh:130
    \n+
    typename Implementation::ctype ctype
    The coordinate field type.
    Definition referenceelement.hh:75
    \n+
    int size(int c) const
    number of subentities of codimension c
    Definition referenceelement.hh:94
    \n+
    decltype(auto) type() const
    obtain the type of this reference element
    Definition referenceelement.hh:184
    \n+
    const Implementation & impl() const
    Returns a reference to the internal implementation object.
    Definition referenceelement.hh:280
    \n+
    bool checkInside(const Coordinate &local) const
    check if a coordinate is in the reference element
    Definition referenceelement.hh:216
    \n+
    ctype CoordinateField
    The coordinate field type.
    Definition referenceelement.hh:78
    \n+
    bool operator==(const ReferenceElement &r) const
    Compares for equality with another reference element.
    Definition referenceelement.hh:286
    \n+
    decltype(auto) position(int i, int c) const
    position of the barycenter of entity (i,c)
    Definition referenceelement.hh:203
    \n+
    decltype(auto) integrationOuterNormal(int face) const
    obtain the integration outer normal of the reference element
    Definition referenceelement.hh:258
    \n+
    friend std::size_t hash_value(const ReferenceElement &r)
    Yields a hash value suitable for storing the reference element a in hash table.
    Definition referenceelement.hh:298
    \n+
    auto subEntities(int i, int c, int cc) const
    Obtain the range of numbers of subentities with codim cc of (i,c)
    Definition referenceelement.hh:153
    \n+
    ctype Volume
    Type used for volume.
    Definition referenceelement.hh:84
    \n+
    Collection of types depending on the codimension.
    Definition referenceelement.hh:67
    \n+
    implementation-defined Geometry
    type of geometry embedding a subentity into the reference element
    Definition referenceelement.hh:69
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,225 +7,296 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n- * refinement\n-base.cc\n+referenceelement.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file\n LICENSE.md in module root\n 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n- 5#ifndef DUNE_GEOMETRY_REFINEMENT_BASE_CC\n-6#define DUNE_GEOMETRY_REFINEMENT_BASE_CC\n+ 5#ifndef DUNE_GEOMETRY_REFERENCEELEMENT_HH\n+ 6#define DUNE_GEOMETRY_REFERENCEELEMENT_HH\n 7\n- 15#include \n- 16\n- 17namespace Dune\n- 18{\n-28 namespace RefinementImp\n- 29 {\n- 30 // /////////////////////////////////\n- 31 //\n- 32 // Declaration of RefinementImp::Traits\n- 33 //\n- 34\n- 35#ifdef DOXYGEN\n- 36 // This is just for Doxygen\n- 67 template\n-69 struct Traits\n- 70 {\n- 72 typedef SquaringTheCircle::Refinement Imp;\n- 73 };\n- 74\n- 75#else // !DOXYGEN\n+ 8#include \n+ 9\n+ 10namespace Dune {\n+ 11 namespace Geo {\n+ 12\n+ 13 namespace Impl {\n+ 14\n+ 15 // forward declaration for friend declaration\n+ 16 template\n+ 17 class ReferenceElementContainer;\n+ 18\n+ 19 }\n+ 20\n+ 21 // forward declaration for constructing default reference element type\n+ 22 template\n+ 23 class ReferenceElementImplementation;\n+ 24\n+ 25 // forward declaration for backwards compatibility conversion\n+ 26 template\n+ 27 struct ReferenceElements;\n+ 28\n+ 29 // ReferenceElement\n+ 30 // ----------------\n+ 31\n+ 50 template\n+51 class ReferenceElement\n+ 52 {\n+ 53\n+ 54 public:\n+ 55\n+ 56#ifndef DOXYGEN\n+ 57\n+ 59 template\n+ 60 using Codim = typename Implementation::template Codim;\n+ 61\n+ 62#else\n+ 63\n+ 65 template< int codim >\n+66 struct Codim\n+ 67 {\n+69 using Geometry = implementation-defined;\n+ 70 };\n+ 71\n+ 72#endif // DOXYGEN\n+ 73\n+75 using ctype = typename Implementation::ctype;\n 76\n- 77 // Doxygen won't see this\n- 78\n- 79 template\n- 81 struct Traits;\n+78 using CoordinateField = ctype;\n+ 79\n+81 using Coordinate = typename Implementation::Coordinate;\n 82\n- 83#endif // !DOXYGEN\n- 84 } // namespace RefinementImp\n+84 typedef ctype Volume;\n 85\n- 86\n-94 class RefinementIntervals{\n- 95 int intervals_=1;\n- 96\n- 97 public:\n-98 explicit RefinementIntervals(int i) : intervals_(i) {}\n+87 static constexpr int dimension = Implementation::dimension;\n+ 88\n+ 89\n+94 int size(int c) const\n+ 95 {\n+ 96 return _impl->size(c);\n+ 97 }\n+ 98\n 99\n-100 int intervals() const { return intervals_; }\n- 101 };\n- 102\n-108 inline RefinementIntervals refinementIntervals(int intervals)\n- 109 {\n- 110 return RefinementIntervals{intervals};\n- 111 }\n-117 inline RefinementIntervals refinementLevels(int levels)\n- 118 {\n- 119 return RefinementIntervals{1<\n-138 class StaticRefinement\n- 139 : public RefinementImp::Traits::Imp\n- 141 {\n- 142 public:\n- 143#ifdef DOXYGEN\n- 149 template\n-150 struct Codim\n- 151 {\n-157 typedef SubEntityIterator;\n- 158 };\n- 159\n-161 typedef Codim::SubEntityIterator VertexIterator;\n-163 typedef Codim<0>::SubEntityIterator ElementIterator;\n- 164\n-170 typedef CoordVector;\n- 171\n-177 typedef IndexVector;\n- 178#endif\n- 179\n-180 typedef typename RefinementImp::Traits< topologyId, CoordType, coerceToId,\n-dimension_>::Imp RefinementImp;\n- 181\n- 182 using RefinementImp::dimension;\n- 183\n- 184 using RefinementImp::Codim;\n- 185\n- 186 using typename RefinementImp::VertexIterator;\n- 187 using typename RefinementImp::CoordVector;\n+111 int size(int i, int c, int cc) const\n+ 112 {\n+ 113 return _impl->size(i,c,cc);\n+ 114 }\n+ 115\n+ 116\n+130 int subEntity(int i, int c, int ii, int cc) const\n+ 131 {\n+ 132 return _impl->subEntity(i,c,ii,cc);\n+ 133 }\n+ 134\n+153 auto subEntities ( int i, int c, int cc ) const\n+ 154 {\n+ 155 return _impl->subEntities(i,c,cc);\n+ 156 }\n+ 157\n+ 158\n+171 decltype(auto) type(int i, int c) const\n+ 172 {\n+ 173 return _impl->type(i,c);\n+ 174 }\n+ 175\n+ 176\n+184 decltype(auto) type() const\n+ 185 {\n+ 186 return _impl->type();\n+ 187 }\n 188\n- 189 using typename RefinementImp::ElementIterator;\n- 190 using typename RefinementImp::IndexVector;\n- 191\n-197 static int nVertices(Dune::RefinementIntervals tag)\n- 198 {\n- 199 return RefinementImp::nVertices(tag.intervals());\n- 200 }\n- 201\n-207 static VertexIterator vBegin(Dune::RefinementIntervals tag)\n- 208 {\n- 209 return RefinementImp::vBegin(tag.intervals());\n- 210 }\n- 211\n-217 static VertexIterator vEnd(Dune::RefinementIntervals tag)\n- 218 {\n- 219 return RefinementImp::vEnd(tag.intervals());\n- 220 }\n+ 189\n+203 decltype(auto) position(int i, int c) const\n+ 204 {\n+ 205 return _impl->position(i,c);\n+ 206 }\n+ 207\n+ 208\n+216 bool checkInside(const Coordinate& local) const\n+ 217 {\n+ 218 return _impl->checkInside(local);\n+ 219 }\n+ 220\n 221\n-227 static int nElements(Dune::RefinementIntervals tag)\n- 228 {\n- 229 return RefinementImp::nElements(tag.intervals());\n- 230 }\n- 231\n-237 static ElementIterator eBegin(Dune::RefinementIntervals tag)\n- 238 {\n- 239 return RefinementImp::eBegin(tag.intervals());\n- 240 }\n- 241\n-247 static ElementIterator eEnd(Dune::RefinementIntervals tag)\n- 248 {\n- 249 return RefinementImp::eEnd(tag.intervals());\n- 250 }\n- 251 };\n- 252\n- 254} // namespace Dune\n- 255\n- 256#endif // DUNE_GEOMETRY_REFINEMENT_BASE_CC\n+ 233 template\n+234 typename Codim::Geometry geometry(int i) const\n+ 235 {\n+ 236 return _impl->template geometry(i);\n+ 237 }\n+ 238\n+ 239\n+241 CoordinateField volume() const\n+ 242 {\n+ 243 return _impl->volume();\n+ 244 }\n+ 245\n+ 246\n+258 decltype(auto) integrationOuterNormal(int face) const\n+ 259 {\n+ 260 return _impl->integrationOuterNormal(face);\n+ 261 }\n+ 262\n+ 263\n+271 ReferenceElement()\n+ 272 : _impl(nullptr)\n+ 273 {}\n+ 274\n+280 const Implementation& impl() const\n+ 281 {\n+ 282 return *_impl;\n+ 283 }\n+ 284\n+286 bool operator==(const ReferenceElement& r) const\n+ 287 {\n+ 288 return _impl == r._impl;\n+ 289 }\n+ 290\n+292 bool operator!=(const ReferenceElement& r) const\n+ 293 {\n+ 294 return not (*this == r);\n+ 295 }\n+ 296\n+298 friend std::size_t hash_value(const ReferenceElement& r)\n+ 299 {\n+ 300 return reinterpret_cast(r._impl);\n+ 301 }\n+ 302\n+ 303 private:\n+ 304\n+ 305 // The implementation must be a friend to construct a wrapper around\n+itself.\n+ 306 friend Implementation;\n+ 307\n+ 308 // The reference container is a friend to be able to call\n+setImplementation.\n+ 309 friend class Impl::ReferenceElementContainer;\n+ 310\n+ 311 // Constructor for wrapping an implementation reference (required\n+internally by the default implementation)\n+ 312 ReferenceElement(const Implementation& impl)\n+ 313 : _impl(&impl)\n+ 314 {}\n+ 315\n+ 316 void setImplementation(const Implementation& impl)\n+ 317 {\n+ 318 _impl = &impl;\n+ 319 }\n+ 320\n+ 321 const Implementation* _impl;\n+ 322\n+ 323 };\n+ 324\n+ 325 }\n+ 326\n+ 327}\n+ 328\n+ 329\n+ 330#endif // DUNE_GEOMETRY_REFERENCEELEMENT_HH\n type.hh\n A unique label for each type of element that can occur in a grid.\n-Dune::refinementIntervals\n-RefinementIntervals refinementIntervals(int intervals)\n-Creates a RefinementIntervals object.\n-Definition base.cc:108\n-Dune::refinementLevels\n-RefinementIntervals refinementLevels(int levels)\n-Creates a RefinementIntervals object.\n-Definition base.cc:117\n Dune\n Definition affinegeometry.hh:21\n-Dune::RefinementImp::Traits\n-Mapping from geometryType, CoordType and coerceTo to a particular Refinement\n-implementation.\n-Definition base.cc:70\n-Dune::RefinementIntervals\n-Holds the number of refined intervals per axis needed for virtual and static\n-refinement.\n-Definition base.cc:94\n-Dune::RefinementIntervals::RefinementIntervals\n-RefinementIntervals(int i)\n-Definition base.cc:98\n-Dune::RefinementIntervals::intervals\n-int intervals() const\n-Definition base.cc:100\n-Dune::StaticRefinement\n-Wrap each Refinement implementation to get a consistent interface.\n-Definition base.cc:141\n-Dune::StaticRefinement::eEnd\n-static ElementIterator eEnd(Dune::RefinementIntervals tag)\n-Get an ElementIterator.\n-Definition base.cc:247\n-Dune::StaticRefinement::eBegin\n-static ElementIterator eBegin(Dune::RefinementIntervals tag)\n-Get an ElementIterator.\n-Definition base.cc:237\n-Dune::StaticRefinement::nElements\n-static int nElements(Dune::RefinementIntervals tag)\n-Get the number of Elements.\n-Definition base.cc:227\n-Dune::StaticRefinement::ElementIterator\n-Codim< 0 >::SubEntityIterator ElementIterator\n-The ElementIterator of the Refinement.\n-Definition base.cc:163\n-Dune::StaticRefinement::nVertices\n-static int nVertices(Dune::RefinementIntervals tag)\n-Get the number of Vertices.\n-Definition base.cc:197\n-Dune::StaticRefinement::vBegin\n-static VertexIterator vBegin(Dune::RefinementIntervals tag)\n-Get a VertexIterator.\n-Definition base.cc:207\n-Dune::StaticRefinement::VertexIterator\n-Codim< dimension >::SubEntityIterator VertexIterator\n-The VertexIterator of the Refinement.\n-Definition base.cc:161\n-Dune::StaticRefinement::CoordVector\n-typedef CoordVector\n-The CoordVector of the Refinement.\n-Definition base.cc:170\n-Dune::StaticRefinement::IndexVector\n-typedef IndexVector\n-The IndexVector of the Refinement.\n-Definition base.cc:177\n-Dune::StaticRefinement::RefinementImp\n-RefinementImp::Traits< topologyId, CoordType, coerceToId, dimension_ >::Imp\n-RefinementImp\n-Definition base.cc:180\n-Dune::StaticRefinement::vEnd\n-static VertexIterator vEnd(Dune::RefinementIntervals tag)\n-Get a VertexIterator.\n-Definition base.cc:217\n-Dune::StaticRefinement::Codim\n-The Codim struct inherited from the Refinement implementation.\n-Definition base.cc:151\n-Dune::StaticRefinement::Codim::SubEntityIterator\n-typedef SubEntityIterator\n-The SubEntityIterator for each codim.\n-Definition base.cc:157\n+Dune::Geo::ReferenceElement\n+This class provides access to geometric and topological properties of a\n+reference element.\n+Definition referenceelement.hh:52\n+Dune::Geo::ReferenceElement::volume\n+CoordinateField volume() const\n+obtain the volume of the reference element\n+Definition referenceelement.hh:241\n+Dune::Geo::ReferenceElement::ReferenceElement\n+ReferenceElement()\n+Constructs an empty reference element.\n+Definition referenceelement.hh:271\n+Dune::Geo::ReferenceElement::operator!=\n+bool operator!=(const ReferenceElement &r) const\n+Compares for inequality with another reference element.\n+Definition referenceelement.hh:292\n+Dune::Geo::ReferenceElement::type\n+decltype(auto) type(int i, int c) const\n+obtain the type of subentity (i,c)\n+Definition referenceelement.hh:171\n+Dune::Geo::ReferenceElement::Coordinate\n+typename Implementation::Coordinate Coordinate\n+The coordinate type.\n+Definition referenceelement.hh:81\n+Dune::Geo::ReferenceElement::geometry\n+Codim< codim >::Geometry geometry(int i) const\n+obtain the embedding of subentity (i,codim) into the reference element\n+Definition referenceelement.hh:234\n+Dune::Geo::ReferenceElement::dimension\n+static constexpr int dimension\n+The dimension of the reference element.\n+Definition referenceelement.hh:87\n+Dune::Geo::ReferenceElement::size\n+int size(int i, int c, int cc) const\n+number of subentities of codimension cc of subentity (i,c)\n+Definition referenceelement.hh:111\n+Dune::Geo::ReferenceElement::subEntity\n+int subEntity(int i, int c, int ii, int cc) const\n+obtain number of ii-th subentity with codim cc of (i,c)\n+Definition referenceelement.hh:130\n+Dune::Geo::ReferenceElement::ctype\n+typename Implementation::ctype ctype\n+The coordinate field type.\n+Definition referenceelement.hh:75\n+Dune::Geo::ReferenceElement::size\n+int size(int c) const\n+number of subentities of codimension c\n+Definition referenceelement.hh:94\n+Dune::Geo::ReferenceElement::type\n+decltype(auto) type() const\n+obtain the type of this reference element\n+Definition referenceelement.hh:184\n+Dune::Geo::ReferenceElement::impl\n+const Implementation & impl() const\n+Returns a reference to the internal implementation object.\n+Definition referenceelement.hh:280\n+Dune::Geo::ReferenceElement::checkInside\n+bool checkInside(const Coordinate &local) const\n+check if a coordinate is in the reference element\n+Definition referenceelement.hh:216\n+Dune::Geo::ReferenceElement::CoordinateField\n+ctype CoordinateField\n+The coordinate field type.\n+Definition referenceelement.hh:78\n+Dune::Geo::ReferenceElement::operator==\n+bool operator==(const ReferenceElement &r) const\n+Compares for equality with another reference element.\n+Definition referenceelement.hh:286\n+Dune::Geo::ReferenceElement::position\n+decltype(auto) position(int i, int c) const\n+position of the barycenter of entity (i,c)\n+Definition referenceelement.hh:203\n+Dune::Geo::ReferenceElement::integrationOuterNormal\n+decltype(auto) integrationOuterNormal(int face) const\n+obtain the integration outer normal of the reference element\n+Definition referenceelement.hh:258\n+Dune::Geo::ReferenceElement::hash_value\n+friend std::size_t hash_value(const ReferenceElement &r)\n+Yields a hash value suitable for storing the reference element a in hash table.\n+Definition referenceelement.hh:298\n+Dune::Geo::ReferenceElement::subEntities\n+auto subEntities(int i, int c, int cc) const\n+Obtain the range of numbers of subentities with codim cc of (i,c)\n+Definition referenceelement.hh:153\n+Dune::Geo::ReferenceElement::Volume\n+ctype Volume\n+Type used for volume.\n+Definition referenceelement.hh:84\n+Dune::Geo::ReferenceElement::Codim\n+Collection of types depending on the codimension.\n+Definition referenceelement.hh:67\n+Dune::Geo::ReferenceElement::Codim::Geometry\n+implementation-defined Geometry\n+type of geometry embedding a subentity into the reference element\n+Definition referenceelement.hh:69\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00230.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00230.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: simplex.cc File Reference\n+dune-geometry: deprecated_topology.hh File Reference\n \n \n \n \n \n \n \n@@ -65,111 +65,23 @@\n
    \n
    \n \n \n \n \n \n
    \n- \n-
    simplex.cc File Reference
    \n+
    deprecated_topology.hh File Reference
    \n
    \n
    \n \n-

    This file contains the Refinement implementation for simplices (triangles, tetrahedrons...) \n-More...

    \n-
    #include <algorithm>
    \n-#include <dune/common/fvector.hh>
    \n-#include <dune/common/math.hh>
    \n-#include <dune/geometry/multilineargeometry.hh>
    \n-#include <dune/geometry/referenceelements.hh>
    \n-#include <dune/geometry/type.hh>
    \n-#include "base.cc"
    \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::RefinementImp::Simplex::RefinementImp< dimension_, CoordType >
     
    struct  Dune::RefinementImp::Simplex::RefinementImp< dimension_, CoordType >::Codim< codimension >
     
    class  Dune::RefinementImp::Simplex::RefinementIteratorSpecial< dimension, CoordType, dimension >
     
    class  Dune::RefinementImp::Simplex::RefinementIteratorSpecial< dimension, CoordType, 0 >
     
    class  Dune::RefinementImp::Simplex::RefinementImp< dimension_, CoordType >::Codim< codimension >
     
    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-

    \n-Namespaces

    namespace  Dune
     
    namespace  Dune::RefinementImp
     This namespace contains the implementation of Refinement.
     
    namespace  Dune::RefinementImp::Simplex
     This namespace contains the Refinement implementation for simplices (triangles, tetrahedrons...)
     
    \n-\n-\n-\n-

    \n-Macros

    #define DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC
     
    \n-\n-\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

    Utilities
    int Dune::RefinementImp::Simplex::factorial (int n)
     Calculate n!
     
    int Dune::RefinementImp::Simplex::binomial (int upper, int lower)
     calculate \"$\\left({upper}\\atop{lower}\\right)$\"
     
    template<int dimension>
    int Dune::RefinementImp::Simplex::pointIndex (const FieldVector< int, dimension > &point)
     calculate the index of a given gridpoint within a Kuhn0 simplex
     
    template<int n>
    FieldVector< int, n > Dune::RefinementImp::Simplex::getPermutation (int m)
     Calculate permutation from it's index.
     
    template<int dimension, class CoordType >
    FieldVector< CoordType, dimension > Dune::RefinementImp::Simplex::referenceToKuhn (FieldVector< CoordType, dimension > point, const FieldVector< int, dimension > &kuhn)
     Map from the reference simplex to some Kuhn simplex.
     
    template<int dimension, class CoordType >
    FieldVector< CoordType, dimension > Dune::RefinementImp::Simplex::kuhnToReference (FieldVector< CoordType, dimension > point, const FieldVector< int, dimension > &kuhn)
     Map from some Kuhn simplex to the reference simplex.
     
    \n-

    Detailed Description

    \n-

    This file contains the Refinement implementation for simplices (triangles, tetrahedrons...)

    \n-

    See Refinement implementation for simplices.

    \n-

    Macro Definition Documentation

    \n-\n-

    ◆ DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC

    \n-\n-
    \n-
    \n- \n- \n- \n- \n-
    #define DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC
    \n-
    \n-\n-
    \n-
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,97 +6,12 @@\n dune-geometry\u00a02.9.0\n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n- * refinement\n-Classes | Namespaces | Macros\n-simplex.cc File Reference\n-This file contains the Refinement implementation for simplices (triangles,\n-tetrahedrons...) More...\n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \n-#include \"base.cc\"\n+deprecated_topology.hh File Reference\n Go_to_the_source_code_of_this_file.\n- Classes\n- class \u00a0Dune::RefinementImp::Simplex::RefinementImp<_dimension_,_CoordType_>\n-\u00a0\n-struct \u00a0Dune::RefinementImp::Simplex::RefinementImp<_dimension_,_CoordType_>::\n- Codim<_codimension_>\n-\u00a0\n- class \u00a0Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,\n- CoordType,_dimension_>\n-\u00a0\n- class \u00a0Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,\n- CoordType,_0_>\n-\u00a0\n- class \u00a0Dune::RefinementImp::Simplex::RefinementImp<_dimension_,_CoordType_>::\n- Codim<_codimension_>\n-\u00a0\n- Namespaces\n-namespace \u00a0Dune\n-\u00a0\n-namespace \u00a0Dune::RefinementImp\n-\u00a0 This namespace contains the implementation of Refinement.\n-\u00a0\n-namespace \u00a0Dune::RefinementImp::Simplex\n-\u00a0 This namespace contains the Refinement implementation for simplices\n- (triangles, tetrahedrons...)\n-\u00a0\n- Macros\n-#define\u00a0DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC\n-\u00a0\n- Functions\n-Utilities\n- int\u00a0Dune::RefinementImp::Simplex::factorial\n- (int n)\n-\u00a0 Calculate n!\n-\u00a0\n- int\u00a0Dune::RefinementImp::Simplex::binomial\n- (int upper, int lower)\n-\u00a0 calculate [$\\left({upper}\\atop\n- {lower}\\right)$]\n-\u00a0\n-template\n- int\u00a0Dune::RefinementImp::Simplex::pointIndex\n- (const FieldVector< int, dimension >\n- &point)\n-\u00a0 calculate the index of a given gridpoint\n- within a Kuhn0 simplex\n-\u00a0\n-template\n- FieldVector< int, n >\u00a0Dune::RefinementImp::Simplex::\n- getPermutation (int m)\n-\u00a0 Calculate permutation from it's index.\n-\u00a0\n-template\n-FieldVector< CoordType, dimension >\u00a0Dune::RefinementImp::Simplex::\n- referenceToKuhn (FieldVector< CoordType,\n- dimension > point, const FieldVector< int,\n- dimension > &kuhn)\n-\u00a0 Map from the reference simplex to some\n- Kuhn simplex.\n-\u00a0\n-template\n-FieldVector< CoordType, dimension >\u00a0Dune::RefinementImp::Simplex::\n- kuhnToReference (FieldVector< CoordType,\n- dimension > point, const FieldVector< int,\n- dimension > &kuhn)\n-\u00a0 Map from some Kuhn simplex to the\n- reference simplex.\n-\u00a0\n-***** Detailed Description *****\n-This file contains the Refinement implementation for simplices (triangles,\n-tetrahedrons...)\n-See Refinement_implementation_for_simplices.\n-***** Macro Definition Documentation *****\n-***** \u25c6\u00a0DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC *****\n-#define DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00230_source.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00230_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: simplex.cc Source File\n+dune-geometry: deprecated_topology.hh Source File\n \n \n \n \n \n \n \n@@ -70,676 +70,180 @@\n \n \n \n \n \n \n \n
    \n-
    simplex.cc
    \n+
    deprecated_topology.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
    \n
    4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n-
    5#ifndef DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC
    \n-
    6#define DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC
    \n+
    5#ifndef DUNE_DEPRECATED_TOPOLOGY_HH
    \n+
    6#define DUNE_DEPRECATED_TOPOLOGY_HH
    \n
    7
    \n-
    8// This file is part of DUNE, a Distributed and Unified Numerics Environment
    \n-
    9// This file is copyright (C) 2005 Jorrit Fahlke <jorrit@jorrit.de>
    \n-
    10// This file is licensed under version 2 of the GNU General Public License,
    \n-
    11// with a special "runtime exception." See COPYING at the top of the source
    \n-
    12// tree for the full licence.
    \n+
    8 namespace Impl
    \n+
    9 {
    \n+
    10
    \n+
    11 // Basic Topology Types
    \n+
    12 // --------------------
    \n
    13
    \n-
    251#include <algorithm>
    \n-
    252
    \n-
    253#include <dune/common/fvector.hh>
    \n-
    254#include <dune/common/math.hh>
    \n-
    255
    \n-\n-\n-
    258#include <dune/geometry/type.hh>
    \n-
    259
    \n-
    260#include "base.cc"
    \n-
    261
    \n-
    262namespace Dune {
    \n-
    263
    \n-
    264 namespace RefinementImp {
    \n-
    265
    \n-
    \n-
    272 namespace Simplex {
    \n-
    273
    \n-
    274 // //////////////////
    \n-
    275 //
    \n-
    277 //
    \n-
    278
    \n-
    280
    \n-
    288 [[deprecated("Use factorial from dune-common's math.hh")]]
    \n-
    \n-
    289 inline int factorial(int n)
    \n-
    290 {
    \n-
    291 int prod = 1;
    \n-
    292 for(int i = 1; i <= n; ++i)
    \n-
    293 prod *= i;
    \n-
    294 return prod;
    \n-
    295 }
    \n-
    \n-
    296
    \n-
    304 [[deprecated("Use binomial from dune-common's math.hh")]]
    \n-
    \n-
    305 inline int binomial(int upper, int lower)
    \n-
    306 {
    \n-
    307 lower = std::min( lower, upper - lower );
    \n-
    308 if(lower < 0)
    \n-
    309 return 0;
    \n-
    310 int prod = 1;
    \n-
    311 for(int i = upper - lower; i < upper; ++i)
    \n-
    312 prod *= (i+1);
    \n-
    313 return prod / Dune::factorial(lower);
    \n-
    314 }
    \n-
    \n-
    315
    \n-
    322 template<int dimension>
    \n-
    \n-
    323 int pointIndex(const FieldVector<int, dimension> &point)
    \n-
    324 {
    \n-
    325 int index = 0;
    \n-
    326 for(int i = 0; i < dimension; ++i)
    \n-
    327 index += Dune::binomial(dimension-i + point[i]-1, dimension-i);
    \n-
    328 return index;
    \n-
    329 }
    \n-
    \n-
    330
    \n-
    335 template<int n>
    \n-
    \n-
    336 FieldVector<int, n> getPermutation(int m)
    \n-
    337 {
    \n-
    338 FieldVector<int, n> perm;
    \n-
    339 for(int i = 0; i < n; ++i)
    \n-
    340 perm[i] = i;
    \n-
    341
    \n-
    342 int base = 1;
    \n-
    343 for(int i = 1; i <= n; ++i)
    \n-
    344 base *= i;
    \n-
    345
    \n-
    346 for(int i = n; i > 0; --i) {
    \n-
    347 base /= i;
    \n-
    348 int d = m / base;
    \n-
    349 m %= base;
    \n-
    350 int t = perm[i-1]; perm[i-1] = perm[i-1-d]; perm[i-1-d] = t;
    \n-
    351 }
    \n-
    352 return perm;
    \n-
    353 }
    \n-
    \n-
    354
    \n-
    355#if 0
    \n-
    356 Has to be checked
    \n-
    357 // calculate the index of a permutation
    \n-
    358 template<int n>
    \n-
    359 int getPermIndex(const FieldVector<int, n>& test) // O(n^2)
    \n-
    360 {
    \n-
    361 int m = 0;
    \n-
    362 FieldVector<int, n> perm;
    \n-
    363 for(int i = 0; i < n; ++i)
    \n-
    364 perm[i] = i;
    \n-
    365
    \n-
    366 int base = 1;
    \n-
    367 for(int i = 1; i <= n; ++i)
    \n-
    368 base *= i;
    \n-
    369
    \n-
    370 for(int i = n; i > 0; --i) {
    \n-
    371 base /= i;
    \n-
    372 int d;
    \n-
    373 for(d = 0; d < i; ++d)
    \n-
    374 if(test[i-1] == perm[i-1-d])
    \n-
    375 break;
    \n-
    376 m += d * base;
    \n-
    377 int d = m / base;
    \n-
    378 m %= base;
    \n-
    379 perm[i-1-d] = perm[i-1];
    \n-
    380 }
    \n-
    381 }
    \n-
    382#endif
    \n-
    383
    \n-
    384 // map between the reference simplex and some arbitrary kuhn simplex (denoted by it's permutation)
    \n-
    392 template<int dimension, class CoordType>
    \n-
    393 FieldVector<CoordType, dimension>
    \n-
    \n-\n-
    395 FieldVector<CoordType, dimension> point,
    \n-
    397 const FieldVector<int, dimension> &kuhn)
    \n-
    398 {
    \n-
    399 for(int i = dimension - 1; i > 0; --i)
    \n-
    400 point[kuhn[i-1]] += point[kuhn[i]];
    \n-
    401 return point;
    \n-
    402 }
    \n-
    \n-
    403
    \n-
    411 template<int dimension, class CoordType>
    \n-
    412 FieldVector<CoordType, dimension>
    \n-
    \n-\n-
    414 FieldVector<CoordType, dimension> point,
    \n-
    416 const FieldVector<int, dimension> &kuhn)
    \n-
    417 {
    \n-
    418 for(int i = 0; i < dimension - 1; ++i)
    \n-
    419 point[kuhn[i]] -= point[kuhn[i+1]];
    \n-
    420 return point;
    \n-
    421 }
    \n-
    \n-
    422
    \n-
    423
    \n-
    425
    \n-
    426 // /////////////////////////////////////////
    \n-
    427 //
    \n-
    428 // refinement implementation for simplices
    \n-
    429 //
    \n-
    430
    \n-
    431 template<int dimension_, class CoordType>
    \n-
    \n-\n-
    433 {
    \n-
    434 public:
    \n-
    435 constexpr static int dimension = dimension_;
    \n-
    436 typedef CoordType ctype;
    \n-
    437
    \n-
    438 template<int codimension>
    \n-
    439 struct Codim;
    \n-\n-
    441 typedef FieldVector<CoordType, dimension> CoordVector;
    \n-\n-
    443 typedef FieldVector<int, dimension+1> IndexVector;
    \n-
    444
    \n-
    445 static int nVertices(int nIntervals);
    \n-
    446 static VertexIterator vBegin(int nIntervals);
    \n-
    447 static VertexIterator vEnd(int nIntervals);
    \n-
    448
    \n-
    449 static int nElements(int nIntervals);
    \n-
    450 static ElementIterator eBegin(int nIntervals);
    \n-
    451 static ElementIterator eEnd(int nIntervals);
    \n-
    452 };
    \n-
    \n-
    453
    \n-
    454 template<int dimension, class CoordType>
    \n-
    455 template<int codimension>
    \n-
    \n-
    456 struct RefinementImp<dimension, CoordType>::Codim
    \n-
    457 {
    \n-
    458 class SubEntityIterator;
    \n-
    459 // We don't need the caching, but the uncached MultiLinearGeometry has bug FS#1209
    \n-\n-
    461 };
    \n-
    \n-
    462
    \n-
    463 template<int dimension, class CoordType>
    \n-
    464 int
    \n-
    \n-\n-
    466 nVertices(int nIntervals)
    \n-
    467 {
    \n-
    468 return Dune::binomial(dimension + nIntervals, (int)dimension);
    \n-
    469 }
    \n-
    \n-
    470
    \n-
    471 template<int dimension, class CoordType>
    \n-\n-
    \n-\n-
    474 vBegin(int nIntervals)
    \n-
    475 {
    \n-
    476 return VertexIterator(nIntervals);
    \n-
    477 }
    \n-
    \n-
    478
    \n-
    479 template<int dimension, class CoordType>
    \n-\n-
    \n-\n-
    482 vEnd(int nIntervals)
    \n-
    483 {
    \n-
    484 return VertexIterator(nIntervals, true);
    \n-
    485 }
    \n-
    \n-
    486
    \n-
    487 template<int dimension, class CoordType>
    \n-
    488 int
    \n-
    \n-\n-
    490 nElements(int nIntervals)
    \n-
    491 {
    \n-
    492 return Dune::power(nIntervals, int(dimension));
    \n-
    493 }
    \n-
    \n-
    494
    \n-
    495 template<int dimension, class CoordType>
    \n-\n-
    \n-\n-
    498 eBegin(int nIntervals)
    \n-
    499 {
    \n-
    500 return ElementIterator(nIntervals);
    \n-
    501 }
    \n-
    \n-
    502
    \n-
    503 template<int dimension, class CoordType>
    \n-\n-
    \n-\n-
    506 eEnd(int nIntervals)
    \n-
    507 {
    \n-
    508 return ElementIterator(nIntervals, true);
    \n-
    509 }
    \n-
    \n-
    510
    \n-
    511 // //////////////
    \n-
    512 //
    \n-
    513 // The iterator
    \n-
    514 //
    \n-
    515
    \n-
    516 template<int dimension, class CoordType, int codimension>
    \n-\n-
    518
    \n-
    519 // vertices
    \n-
    520
    \n-
    521 template<int dimension, class CoordType>
    \n-
    \n-
    522 class RefinementIteratorSpecial<dimension, CoordType, dimension>
    \n-
    523 {
    \n-
    524 public:
    \n-\n-
    526 typedef typename Refinement::CoordVector CoordVector;
    \n-
    527 typedef typename Refinement::template Codim<dimension>::Geometry Geometry;
    \n-\n-
    529
    \n-
    530 RefinementIteratorSpecial(int nIntervals, bool end = false);
    \n-
    531
    \n-
    532 void increment();
    \n-
    533 bool equals(const This &other) const;
    \n-
    534
    \n-
    535 CoordVector coords() const;
    \n-
    536 Geometry geometry () const;
    \n-
    537
    \n-
    538 int index() const;
    \n-
    539 protected:
    \n-
    540 typedef FieldVector<int, dimension> Vertex;
    \n-
    541
    \n-
    542 int size;
    \n-\n-
    544 };
    \n-
    \n-
    545
    \n-
    546 template<int dimension, class CoordType>
    \n-
    \n-\n-
    548 RefinementIteratorSpecial(int nIntervals, bool end)
    \n-
    549 : size(nIntervals)
    \n-
    550 {
    \n-
    551 vertex[0] = (end) ? size + 1 : 0;
    \n-
    552 for(int i = 1; i < dimension; ++ i)
    \n-
    553 vertex[i] = 0;
    \n-
    554 }
    \n-
    \n-
    555
    \n-
    556 template<int dimension, class CoordType>
    \n-
    557 void
    \n-
    \n-\n-\n-
    560 {
    \n-
    561 assert(vertex[0] <= size);
    \n-
    562 for(int i = dimension - 1; i >= 0; --i) {
    \n-
    563 ++vertex[i];
    \n-
    564 if(i == 0 || vertex[i] <= vertex[i-1])
    \n-
    565 break;
    \n-
    566 else
    \n-
    567 vertex[i] = 0;
    \n-
    568 }
    \n-
    569 }
    \n-
    \n-
    570
    \n-
    571 template<int dimension, class CoordType>
    \n-
    572 bool
    \n-
    \n-\n-
    574 equals(const This &other) const
    \n-
    575 {
    \n-
    576 return size == other.size && vertex == other.vertex;
    \n-
    577 }
    \n-
    \n-
    578
    \n-
    579 template<int dimension, class CoordType>
    \n-\n-
    \n-\n-
    582 coords() const
    \n-
    583 {
    \n-
    584 Vertex ref = kuhnToReference(vertex, getPermutation<dimension>(0));
    \n-
    585
    \n-
    586 CoordVector coords;
    \n-
    587 for(int i = 0; i < dimension; ++i)
    \n-
    588 coords[i] = CoordType(ref[i]) / size;
    \n-
    589 return coords;
    \n-
    590 }
    \n-
    \n-
    591
    \n-
    592 template<int dimension, class CoordType>
    \n-\n-
    \n-\n-
    595 {
    \n-
    596 std::vector<CoordVector> corners(1);
    \n-
    597 corners[0] = (CoordVector)vertex;
    \n-
    598 return Geometry(GeometryTypes::vertex, corners);
    \n-
    599 }
    \n-
    \n-
    600
    \n-
    601 template<int dimension, class CoordType>
    \n-
    602 int
    \n-
    \n-\n-
    604 index() const
    \n-
    605 {
    \n-
    606 return pointIndex(vertex);
    \n-
    607 }
    \n-
    \n-
    608
    \n-
    609 // elements
    \n-
    610
    \n-
    611 template<int dimension, class CoordType>
    \n-
    \n-
    612 class RefinementIteratorSpecial<dimension, CoordType, 0>
    \n-
    613 {
    \n-
    614 public:
    \n-\n-\n-\n-
    618 typedef typename Refinement::template Codim<0>::Geometry Geometry;
    \n-\n-
    620
    \n-
    621 RefinementIteratorSpecial(int nIntervals, bool end = false);
    \n-
    622
    \n-
    623 void increment();
    \n-
    624 bool equals(const This &other) const;
    \n-
    625
    \n-
    626 IndexVector vertexIndices() const;
    \n-
    627 int index() const;
    \n-
    628 CoordVector coords() const;
    \n-
    629
    \n-
    630 Geometry geometry () const;
    \n-
    631
    \n-
    632 private:
    \n-
    633 CoordVector global(const CoordVector &local) const;
    \n-
    634
    \n-
    635 protected:
    \n-
    636 typedef FieldVector<int, dimension> Vertex;
    \n-
    637 constexpr static int nKuhnIntervals = Dune::factorial(dimension);
    \n-
    638
    \n-\n-\n-
    641 int size;
    \n-\n-
    643 };
    \n-
    \n-
    644
    \n-
    645 template<int dimension, class CoordType>
    \n-
    \n-\n-
    647 RefinementIteratorSpecial(int nIntervals, bool end)
    \n-
    648 : kuhnIndex(0), size(nIntervals), index_(0)
    \n-
    649 {
    \n-
    650 for(int i = 0; i < dimension; ++i)
    \n-
    651 origin[i] = 0;
    \n-
    652 if(end) {
    \n-
    653 index_ = Refinement::nElements(nIntervals);
    \n-
    654 origin[0] = size;
    \n-
    655 }
    \n-
    656 }
    \n-
    \n-
    657
    \n-
    658 template<int dimension, class CoordType>
    \n-
    659 void
    \n-
    \n-\n-\n-
    662 {
    \n-
    663 assert(origin[0] < size);
    \n-
    664
    \n-
    665 ++index_;
    \n-
    666
    \n-
    667 while(1) {
    \n-
    668 ++kuhnIndex;
    \n-
    669 if(kuhnIndex == nKuhnIntervals) {
    \n-
    670 kuhnIndex = 0;
    \n-
    671 // increment origin
    \n-
    672 for(int i = dimension - 1; i >= 0; --i) {
    \n-
    673 ++origin[i];
    \n-
    674 if(i == 0 || origin[i] <= origin[i-1])
    \n-
    675 break;
    \n-
    676 else
    \n-
    677 origin[i] = 0;
    \n-
    678 }
    \n-
    679 }
    \n-
    680
    \n-
    681 // test whether the current simplex has any corner outside the kuhn0 simplex
    \n-
    682 FieldVector<int, dimension> perm = getPermutation<dimension>(kuhnIndex);
    \n-
    683 Vertex corner = origin;
    \n-
    684 bool outside = false;
    \n-
    685 for(int i = 0; i < dimension; ++i) {
    \n-
    686 // next corner
    \n-
    687 ++corner[perm[i]];
    \n-
    688 if(perm[i] > 0)
    \n-
    689 if(corner[perm[i]] > corner[perm[i]-1]) {
    \n-
    690 outside = true;
    \n-
    691 break;
    \n-
    692 }
    \n-
    693 }
    \n-
    694 if(!outside)
    \n-
    695 return;
    \n-
    696 }
    \n-
    697 }
    \n-
    \n-
    698
    \n-
    699 template<int dimension, class CoordType>
    \n-
    700 bool
    \n-
    \n-\n-
    702 equals(const This &other) const
    \n-
    703 {
    \n-
    704 return size == other.size && index_ == other.index_;
    \n-
    705 }
    \n-
    \n-
    706
    \n-
    707 template<int dimension, class CoordType>
    \n-\n-
    \n-\n-
    710 vertexIndices() const
    \n-
    711 {
    \n-
    712 IndexVector indices;
    \n-
    713 FieldVector<int, dimension> perm = getPermutation<dimension>(kuhnIndex);
    \n-
    714 Vertex vertex = origin;
    \n-
    715 indices[0] = pointIndex(vertex);
    \n-
    716 for(int i = 0; i < dimension; ++i) {
    \n-
    717 ++vertex[perm[i]];
    \n-
    718 indices[i+1] = pointIndex(vertex);
    \n-
    719 }
    \n-
    720 if (kuhnIndex%2 == 1)
    \n-
    721 for(int i = 0; i < (dimension+1)/2; ++i) {
    \n-
    722 int t = indices[i];
    \n-
    723 indices[i] = indices[dimension-i];
    \n-
    724 indices[dimension-i] = t;
    \n-
    725 }
    \n-
    726 return indices;
    \n-
    727 }
    \n-
    \n-
    728
    \n-
    729 template<int dimension, class CoordType>
    \n-
    730 int
    \n-
    \n-\n-
    732 index() const
    \n-
    733 {
    \n-
    734 return index_;
    \n-
    735 }
    \n-
    \n-
    736
    \n-
    737 template<int dimension, class CoordType>
    \n-\n-
    \n-\n-
    740 coords() const
    \n-
    741 {
    \n-\n-
    743 ::simplex().position(0,0));
    \n-
    744 }
    \n-
    \n-
    745
    \n-
    746 template<int dimension, class CoordType>
    \n-\n-
    \n-\n-
    749 {
    \n-
    750 std::vector<CoordVector> corners(dimension+1);
    \n-\n-
    752 for(int i = 0; i <= dimension; ++i)
    \n-
    753 corners[i] = global(refelem.position(i, dimension));
    \n-
    754 return Geometry(refelem.type(), corners);
    \n-
    755 }
    \n-
    \n-
    756
    \n-
    757 template<int dimension, class CoordType>
    \n-\n-\n-
    760 global(const CoordVector &local) const {
    \n-
    761 CoordVector v =
    \n-
    762 referenceToKuhn(local, getPermutation<dimension>(kuhnIndex));
    \n-
    763 v += origin;
    \n-
    764 v /= (typename CoordVector::value_type)size;
    \n-
    765 return kuhnToReference(v, getPermutation<dimension>(0));
    \n-
    766 }
    \n-
    767
    \n-
    768 // common
    \n-
    769
    \n-
    770 template<int dimension, class CoordType>
    \n-
    771 template<int codimension>
    \n-
    \n-
    772 class RefinementImp<dimension, CoordType>::Codim<codimension>::SubEntityIterator
    \n-
    773 : public ForwardIteratorFacade<typename RefinementImp<dimension, CoordType>::template Codim<codimension>::SubEntityIterator, int>,
    \n-
    774 public RefinementIteratorSpecial<dimension, CoordType, codimension>
    \n-
    775 {
    \n-
    776 public:
    \n-\n-
    778
    \n-
    779 SubEntityIterator(int nIntervals, bool end = false);
    \n-
    780 };
    \n-
    \n-
    781
    \n-
    782#ifndef DOXYGEN
    \n-
    783
    \n-
    784 template<int dimension, class CoordType>
    \n-
    785 template<int codimension>
    \n-\n-
    787 SubEntityIterator(int nIntervals, bool end)
    \n-
    788 : RefinementIteratorSpecial<dimension, CoordType, codimension>(nIntervals, end)
    \n-
    789 {}
    \n-
    790
    \n-
    791#endif
    \n-
    792
    \n-
    793 } // namespace Simplex
    \n-
    \n-
    794
    \n-
    795 } // namespace RefinementImp
    \n-
    796
    \n-
    797
    \n-
    798 namespace RefinementImp {
    \n-
    799
    \n-
    800 // ///////////////////////
    \n-
    801 //
    \n-
    802 // The refinement traits
    \n-
    803 //
    \n-
    804
    \n-
    805#ifndef DOXYGEN
    \n-
    806 template<unsigned topologyId, class CoordType, unsigned coerceToId,
    \n-
    807 int dim>
    \n-
    808 struct Traits<
    \n-
    809 topologyId, CoordType, coerceToId, dim,
    \n-
    810 typename std::enable_if<
    \n-
    811 ((GeometryTypes::simplex(dim).id() >> 1) ==
    \n-
    812 (topologyId >> 1) &&
    \n-
    813 (GeometryTypes::simplex(dim).id() >> 1) ==
    \n-
    814 (coerceToId >> 1)
    \n-
    815 )>::type
    \n-
    816 >
    \n-
    817 {
    \n-
    818 typedef Simplex::RefinementImp<dim, CoordType> Imp;
    \n-
    819 };
    \n-
    820#endif
    \n-
    821
    \n-
    822
    \n-
    823 } // namespace RefinementImp
    \n-
    824
    \n-
    825} // namespace Dune
    \n-
    826
    \n-
    827#endif //DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC
    \n-\n-\n-
    A unique label for each type of element that can occur in a grid.
    \n-
    This file contains the parts independent of a particular Refinement implementation.
    \n-
    Definition affinegeometry.hh:21
    \n-
    int pointIndex(const FieldVector< int, dimension > &point)
    calculate the index of a given gridpoint within a Kuhn0 simplex
    Definition simplex.cc:323
    \n-
    FieldVector< int, n > getPermutation(int m)
    Calculate permutation from it's index.
    Definition simplex.cc:336
    \n-
    int factorial(int n)
    Calculate n!
    Definition simplex.cc:289
    \n-
    int binomial(int upper, int lower)
    calculate
    Definition simplex.cc:305
    \n-
    FieldVector< CoordType, dimension > referenceToKuhn(FieldVector< CoordType, dimension > point, const FieldVector< int, dimension > &kuhn)
    Map from the reference simplex to some Kuhn simplex.
    Definition simplex.cc:394
    \n-
    FieldVector< CoordType, dimension > kuhnToReference(FieldVector< CoordType, dimension > point, const FieldVector< int, dimension > &kuhn)
    Map from some Kuhn simplex to the reference simplex.
    Definition simplex.cc:413
    \n-
    Class providing access to the singletons of the reference elements.
    Definition referenceelements.hh:170
    \n-
    static const ReferenceElement & simplex()
    get simplex reference elements
    Definition referenceelements.hh:204
    \n-
    Static tag representing a codimension.
    Definition dimension.hh:24
    \n-
    Implement a MultiLinearGeometry with additional caching.
    Definition multilineargeometry.hh:526
    \n-\n-
    Codim< dimension >::SubEntityIterator VertexIterator
    Definition simplex.cc:440
    \n-
    FieldVector< int, dimension+1 > IndexVector
    Definition simplex.cc:443
    \n-
    CoordType ctype
    Definition simplex.cc:436
    \n-
    static int nVertices(int nIntervals)
    Definition simplex.cc:466
    \n-
    static int nElements(int nIntervals)
    Definition simplex.cc:490
    \n-
    static ElementIterator eEnd(int nIntervals)
    Definition simplex.cc:506
    \n-
    static VertexIterator vEnd(int nIntervals)
    Definition simplex.cc:482
    \n-
    Codim< 0 >::SubEntityIterator ElementIterator
    Definition simplex.cc:442
    \n-
    static VertexIterator vBegin(int nIntervals)
    Definition simplex.cc:474
    \n-
    static ElementIterator eBegin(int nIntervals)
    Definition simplex.cc:498
    \n-
    FieldVector< CoordType, dimension > CoordVector
    Definition simplex.cc:441
    \n-
    static constexpr int dimension
    Definition simplex.cc:435
    \n-\n-
    Dune::CachedMultiLinearGeometry< CoordType, dimension-codimension, dimension > Geometry
    Definition simplex.cc:460
    \n-\n-\n-\n-
    RefinementImp< dimension, CoordType > Refinement
    Definition simplex.cc:525
    \n-\n-
    Refinement::template Codim< dimension >::Geometry Geometry
    Definition simplex.cc:527
    \n-
    RefinementIteratorSpecial< dimension, CoordType, dimension > This
    Definition simplex.cc:528
    \n-\n-\n-\n-\n-
    FieldVector< int, dimension > Vertex
    Definition simplex.cc:636
    \n-\n-\n-
    Refinement::template Codim< 0 >::Geometry Geometry
    Definition simplex.cc:618
    \n-\n-\n-
    RefinementIteratorSpecial< dimension, CoordType, 0 > This
    Definition simplex.cc:619
    \n-
    RefinementImp< dimension, CoordType > Refinement
    Definition simplex.cc:615
    \n-\n-\n-
    RefinementImp< dimension, CoordType > Refinement
    Definition simplex.cc:777
    \n+
    14 // PointDeprecationHelper can be used to prevent a deprecation warning for Point
    \n+
    15 struct PointDeprecationHelper
    \n+
    16 {
    \n+
    17 static const unsigned int dimension = 0;
    \n+
    18 static const unsigned int numCorners = 1;
    \n+
    19
    \n+
    20 static const unsigned int id = 0;
    \n+
    21
    \n+
    22 static std::string name () { return "p"; }
    \n+
    23 };
    \n+
    24
    \n+
    25 using Point [[deprecated("Use GeometryTypes::vertex instead.")]] = PointDeprecationHelper;
    \n+
    26
    \n+
    27
    \n+
    28 template< class BaseTopology >
    \n+
    29 struct [[deprecated("Use GeometryTypes::prismaticExtension(GeometryType gt) instead.")]] Prism
    \n+
    30 {
    \n+
    31 static const unsigned int dimension = BaseTopology::dimension + 1;
    \n+
    32 static const unsigned int numCorners = 2 * BaseTopology::numCorners;
    \n+
    33
    \n+
    34 static const unsigned int id = BaseTopology::id | ((unsigned int)prismConstruction << (dimension-1));
    \n+
    35
    \n+
    36 static std::string name () { return BaseTopology::name() + "l"; }
    \n+
    37 };
    \n+
    38
    \n+
    39
    \n+
    40 template< class BaseTopology >
    \n+
    41 struct [[deprecated("Use GeometryTypes::conicalExtension(GeometryType gt) instead.")]] Pyramid
    \n+
    42 {
    \n+
    43 static const unsigned int dimension = BaseTopology::dimension + 1;
    \n+
    44 static const unsigned int numCorners = BaseTopology::numCorners + 1;
    \n+
    45
    \n+
    46 static const unsigned int id = BaseTopology::id | ((unsigned int)pyramidConstruction << (dimension-1));
    \n+
    47
    \n+
    48 static std::string name () { return BaseTopology::name() + "o"; }
    \n+
    49 };
    \n+
    50
    \n+
    51
    \n+
    52
    \n+
    53 // Properties of Topologies
    \n+
    54 // ------------------------
    \n+
    55
    \n+
    56 template< class Topology >
    \n+
    57 struct [[deprecated("Use GeometryType::isSimplex() instead.")]] IsSimplex
    \n+
    58 : public std::integral_constant< bool, (Topology::id >> 1) == 0 >
    \n+
    59 {};
    \n+
    60
    \n+
    61 template< class Topology >
    \n+
    62 struct [[deprecated("Use GeometryType::isCube() instead.")]] IsCube
    \n+
    63 : public std::integral_constant< bool, (Topology::id | 1) == (1 << Topology::dimension) - 1 >
    \n+
    64 {};
    \n+
    65
    \n+
    78 [[deprecated("Use GeometryType::isPrismatic() or GeometryType::isConical() instead.")]]
    \n+
    79 inline static bool isTopology ( TopologyConstruction construction, unsigned int topologyId, int dim, int codim = 0 ) noexcept
    \n+
    80 {
    \n+
    81 assert( (dim > 0) && (topologyId < numTopologies( dim )) );
    \n+
    82 assert( (0 <= codim) && (codim <= dim) );
    \n+
    83 return (codim >= (dim-1)) || (((topologyId >> (dim-codim-1)) & 1) == (unsigned int)construction);
    \n+
    84 }
    \n+
    85
    \n+
    86
    \n+
    87 // SimplexTopology
    \n+
    88 // ---------------
    \n+
    89
    \n+
    90 template< unsigned int dim >
    \n+
    91 struct [[deprecated("Use GeometryTypes::simplex(dim) instead.")]] SimplexTopology
    \n+
    92 {
    \n+
    93 typedef Pyramid< typename SimplexTopology< dim-1 >::type > type;
    \n+
    94 };
    \n+
    95
    \n+
    96 template<>
    \n+
    97 struct [[deprecated("Use GeometryTypes::simplex(dim) instead.")]] SimplexTopology< 0 >
    \n+
    98 {
    \n+
    99 typedef Point type;
    \n+
    100 };
    \n+
    101
    \n+
    102
    \n+
    103
    \n+
    104 // CubeTopology
    \n+
    105 // ------------
    \n+
    106
    \n+
    107 template< unsigned int dim >
    \n+
    108 struct [[deprecated("Use GeometryTypes::cube(dim) instead.")]] CubeTopology
    \n+
    109 {
    \n+
    110 typedef Prism< typename CubeTopology< dim-1 >::type > type;
    \n+
    111 };
    \n+
    112
    \n+
    113 template<>
    \n+
    114 struct [[deprecated("Use GeometryTypes::simplex(dim) instead.")]] CubeTopology< 0 >
    \n+
    115 {
    \n+
    116 typedef Point type;
    \n+
    117 };
    \n+
    118
    \n+
    119
    \n+
    120
    \n+
    121 // PyramidTopology
    \n+
    122 // ---------------
    \n+
    123
    \n+
    124 template< unsigned int dim >
    \n+
    125 struct [[deprecated]] PyramidTopology
    \n+
    126 {
    \n+
    127 typedef Pyramid< typename CubeTopology< dim-1 >::type > type;
    \n+
    128 };
    \n+
    129
    \n+
    130
    \n+
    131
    \n+
    132 // PrismTopology
    \n+
    133 // -------------
    \n+
    134
    \n+
    135 template< unsigned int dim >
    \n+
    136 struct [[deprecated]] PrismTopology
    \n+
    137 {
    \n+
    138 typedef Prism< typename SimplexTopology< dim-1 >::type > type;
    \n+
    139 };
    \n+
    140
    \n+
    141
    \n+
    142
    \n+
    143
    \n+
    144 // IfTopology
    \n+
    145 // ----------
    \n+
    146
    \n+
    147 template< template< class > class Operation, int dim, class Topology = PointDeprecationHelper >
    \n+
    148 struct [[deprecated("Use IfGeometryType instead.")]] IfTopology
    \n+
    149 {
    \n+
    150 template< class... Args >
    \n+
    151 static auto apply ( unsigned int topologyId, Args &&... args )
    \n+
    152 {
    \n+
    153 if( topologyId & 1 )
    \n+
    154 return IfTopology< Operation, dim-1, Prism< Topology > >::apply( topologyId >> 1, std::forward< Args >( args )... );
    \n+
    155 else
    \n+
    156 return IfTopology< Operation, dim-1, Pyramid< Topology > >::apply( topologyId >> 1, std::forward< Args >( args )... );
    \n+
    157 }
    \n+
    158 };
    \n+
    159
    \n+
    160 template< template< class > class Operation, class Topology >
    \n+
    161 struct [[deprecated("Use IfGeometryType instead.")]] IfTopology< Operation, 0, Topology >
    \n+
    162 {
    \n+
    163 template< class... Args >
    \n+
    164 static auto apply ([[maybe_unused]] unsigned int topologyId, Args &&... args)
    \n+
    165 {
    \n+
    166 return Operation< Topology >::apply( std::forward< Args >( args )... );
    \n+
    167 }
    \n+
    168 };
    \n+
    169
    \n+
    170 } // namespace Impl
    \n+
    171#endif
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,740 +7,191 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n- * refinement\n-simplex.cc\n+deprecated_topology.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file\n LICENSE.md in module root\n 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n- 5#ifndef DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC\n-6#define DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC\n+ 5#ifndef DUNE_DEPRECATED_TOPOLOGY_HH\n+ 6#define DUNE_DEPRECATED_TOPOLOGY_HH\n 7\n- 8// This file is part of DUNE, a Distributed and Unified Numerics Environment\n- 9// This file is copyright (C) 2005 Jorrit Fahlke \n- 10// This file is licensed under version 2 of the GNU General Public License,\n- 11// with a special \"runtime exception.\" See COPYING at the top of the source\n- 12// tree for the full licence.\n+ 8 namespace Impl\n+ 9 {\n+ 10\n+ 11 // Basic Topology Types\n+ 12 // --------------------\n 13\n- 251#include \n- 252\n- 253#include \n- 254#include \n- 255\n- 256#include \n- 257#include \n- 258#include \n- 259\n- 260#include \"base.cc\"\n- 261\n- 262namespace Dune {\n- 263\n- 264 namespace RefinementImp {\n- 265\n-272 namespace Simplex {\n- 273\n- 274 // //////////////////\n- 275 //\n- 277 //\n- 278\n- 280\n- 288 [[deprecated(\"Use factorial from dune-common's math.hh\")]]\n-289 inline int factorial(int n)\n- 290 {\n- 291 int prod = 1;\n- 292 for(int i = 1; i <= n; ++i)\n- 293 prod *= i;\n- 294 return prod;\n- 295 }\n- 296\n- 304 [[deprecated(\"Use binomial from dune-common's math.hh\")]]\n-305 inline int binomial(int upper, int lower)\n- 306 {\n- 307 lower = std::min( lower, upper - lower );\n- 308 if(lower < 0)\n- 309 return 0;\n- 310 int prod = 1;\n- 311 for(int i = upper - lower; i < upper; ++i)\n- 312 prod *= (i+1);\n- 313 return prod / Dune::factorial(lower);\n- 314 }\n- 315\n- 322 template\n-323 int pointIndex(const FieldVector &point)\n- 324 {\n- 325 int index = 0;\n- 326 for(int i = 0; i < dimension; ++i)\n- 327 index += Dune::binomial(dimension-i + point[i]-1, dimension-i);\n- 328 return index;\n- 329 }\n- 330\n- 335 template\n-336 FieldVector getPermutation(int m)\n- 337 {\n- 338 FieldVector perm;\n- 339 for(int i = 0; i < n; ++i)\n- 340 perm[i] = i;\n- 341\n- 342 int base = 1;\n- 343 for(int i = 1; i <= n; ++i)\n- 344 base *= i;\n- 345\n- 346 for(int i = n; i > 0; --i) {\n- 347 base /= i;\n- 348 int d = m / base;\n- 349 m %= base;\n- 350 int t = perm[i-1]; perm[i-1] = perm[i-1-d]; perm[i-1-d] = t;\n- 351 }\n- 352 return perm;\n- 353 }\n- 354\n- 355#if 0\n- 356 Has to be checked\n- 357 // calculate the index of a permutation\n- 358 template\n- 359 int getPermIndex(const FieldVector& test) // O(n^2)\n- 360 {\n- 361 int m = 0;\n- 362 FieldVector perm;\n- 363 for(int i = 0; i < n; ++i)\n- 364 perm[i] = i;\n- 365\n- 366 int base = 1;\n- 367 for(int i = 1; i <= n; ++i)\n- 368 base *= i;\n- 369\n- 370 for(int i = n; i > 0; --i) {\n- 371 base /= i;\n- 372 int d;\n- 373 for(d = 0; d < i; ++d)\n- 374 if(test[i-1] == perm[i-1-d])\n- 375 break;\n- 376 m += d * base;\n- 377 int d = m / base;\n- 378 m %= base;\n- 379 perm[i-1-d] = perm[i-1];\n- 380 }\n- 381 }\n- 382#endif\n- 383\n- 384 // map between the reference simplex and some arbitrary kuhn simplex\n-(denoted by it's permutation)\n- 392 template\n- 393 FieldVector\n-394 referenceToKuhn(\n- 395 FieldVector point,\n- 397 const FieldVector &kuhn)\n- 398 {\n- 399 for(int i = dimension - 1; i > 0; --i)\n- 400 point[kuhn[i-1]] += point[kuhn[i]];\n- 401 return point;\n- 402 }\n- 403\n- 411 template\n- 412 FieldVector\n-413 kuhnToReference(\n- 414 FieldVector point,\n- 416 const FieldVector &kuhn)\n- 417 {\n- 418 for(int i = 0; i < dimension - 1; ++i)\n- 419 point[kuhn[i]] -= point[kuhn[i+1]];\n- 420 return point;\n- 421 }\n- 422\n- 423\n- 425\n- 426 // /////////////////////////////////////////\n- 427 //\n- 428 // refinement implementation for simplices\n- 429 //\n- 430\n- 431 template\n-432 class RefinementImp\n- 433 {\n- 434 public:\n-435 constexpr static int dimension = dimension_;\n-436 typedef CoordType ctype;\n- 437\n- 438 template\n- 439 struct Codim;\n-440 typedef typename Codim::SubEntityIterator VertexIterator;\n-441 typedef FieldVector CoordVector;\n-442 typedef typename Codim<0>::SubEntityIterator ElementIterator;\n-443 typedef FieldVector IndexVector;\n- 444\n- 445 static int nVertices(int nIntervals);\n- 446 static VertexIterator vBegin(int nIntervals);\n- 447 static VertexIterator vEnd(int nIntervals);\n- 448\n- 449 static int nElements(int nIntervals);\n- 450 static ElementIterator eBegin(int nIntervals);\n- 451 static ElementIterator eEnd(int nIntervals);\n- 452 };\n- 453\n- 454 template\n- 455 template\n-456 struct RefinementImp::Codim\n- 457 {\n- 458 class SubEntityIterator;\n- 459 // We don't need the caching, but the uncached MultiLinearGeometry has bug\n-FS#1209\n-460 typedef Dune::CachedMultiLinearGeometry Geometry;\n- 461 };\n- 462\n- 463 template\n- 464 int\n-465 RefinementImp::\n- 466nVertices(int nIntervals)\n- 467 {\n- 468 return Dune::binomial(dimension + nIntervals, (int)dimension);\n- 469 }\n- 470\n- 471 template\n- 472 typename RefinementImp::VertexIterator\n-473 RefinementImp::\n- 474vBegin(int nIntervals)\n- 475 {\n- 476 return VertexIterator(nIntervals);\n- 477 }\n- 478\n- 479 template\n- 480 typename RefinementImp::VertexIterator\n-481 RefinementImp::\n- 482vEnd(int nIntervals)\n- 483 {\n- 484 return VertexIterator(nIntervals, true);\n- 485 }\n- 486\n- 487 template\n- 488 int\n-489 RefinementImp::\n- 490nElements(int nIntervals)\n- 491 {\n- 492 return Dune::power(nIntervals, int(dimension));\n- 493 }\n- 494\n- 495 template\n- 496 typename RefinementImp::ElementIterator\n-497 RefinementImp::\n- 498eBegin(int nIntervals)\n- 499 {\n- 500 return ElementIterator(nIntervals);\n- 501 }\n- 502\n- 503 template\n- 504 typename RefinementImp::ElementIterator\n-505 RefinementImp::\n- 506eEnd(int nIntervals)\n- 507 {\n- 508 return ElementIterator(nIntervals, true);\n- 509 }\n- 510\n- 511 // //////////////\n- 512 //\n- 513 // The iterator\n- 514 //\n- 515\n- 516 template\n-517 class RefinementIteratorSpecial;\n- 518\n- 519 // vertices\n- 520\n- 521 template\n-522 class RefinementIteratorSpecial\n- 523 {\n- 524 public:\n-525 typedef RefinementImp Refinement;\n-526 typedef typename Refinement::CoordVector CoordVector;\n-527 typedef typename Refinement::template Codim::Geometry Geometry;\n-528 typedef RefinementIteratorSpecial This;\n- 529\n- 530 RefinementIteratorSpecial(int nIntervals, bool end = false);\n- 531\n- 532 void increment();\n- 533 bool equals(const This &other) const;\n- 534\n- 535 CoordVector coords() const;\n- 536 Geometry geometry () const;\n- 537\n- 538 int index() const;\n- 539 protected:\n-540 typedef FieldVector Vertex;\n- 541\n-542 int size;\n-543 Vertex vertex;\n- 544 };\n- 545\n- 546 template\n-547 RefinementIteratorSpecial::\n- 548RefinementIteratorSpecial(int nIntervals, bool end)\n- 549 : size(nIntervals)\n- 550 {\n- 551 vertex[0] = (end) ? size + 1 : 0;\n- 552 for(int i = 1; i < dimension; ++ i)\n- 553 vertex[i] = 0;\n- 554 }\n- 555\n- 556 template\n- 557 void\n-558 RefinementIteratorSpecial::\n- 559increment()\n- 560 {\n- 561 assert(vertex[0] <= size);\n- 562 for(int i = dimension - 1; i >= 0; --i) {\n- 563 ++vertex[i];\n- 564 if(i == 0 || vertex[i] <= vertex[i-1])\n- 565 break;\n- 566 else\n- 567 vertex[i] = 0;\n- 568 }\n- 569 }\n- 570\n- 571 template\n- 572 bool\n-573 RefinementIteratorSpecial::\n- 574equals(const This &other) const\n- 575 {\n- 576 return size == other.size && vertex == other.vertex;\n- 577 }\n- 578\n- 579 template\n- 580 typename RefinementIteratorSpecial::\n-CoordVector\n-581 RefinementIteratorSpecial::\n- 582coords() const\n- 583 {\n- 584 Vertex ref = kuhnToReference(vertex, getPermutation(0));\n- 585\n- 586 CoordVector coords;\n- 587 for(int i = 0; i < dimension; ++i)\n- 588 coords[i] = CoordType(ref[i]) / size;\n- 589 return coords;\n- 590 }\n- 591\n- 592 template\n- 593 typename RefinementIteratorSpecial::\n-Geometry\n-594 RefinementIteratorSpecial::geometry ()\n-const\n- 595 {\n- 596 std::vector corners(1);\n- 597 corners[0] = (CoordVector)vertex;\n- 598 return Geometry(GeometryTypes::vertex, corners);\n- 599 }\n- 600\n- 601 template\n- 602 int\n-603 RefinementIteratorSpecial::\n- 604index() const\n- 605 {\n- 606 return pointIndex(vertex);\n- 607 }\n- 608\n- 609 // elements\n- 610\n- 611 template\n-612 class RefinementIteratorSpecial\n- 613 {\n- 614 public:\n-615 typedef RefinementImp Refinement;\n-616 typedef typename Refinement::IndexVector IndexVector;\n-617 typedef typename Refinement::CoordVector CoordVector;\n-618 typedef typename Refinement::template Codim<0>::Geometry Geometry;\n-619 typedef RefinementIteratorSpecial This;\n- 620\n- 621 RefinementIteratorSpecial(int nIntervals, bool end = false);\n- 622\n- 623 void increment();\n- 624 bool equals(const This &other) const;\n- 625\n- 626 IndexVector vertexIndices() const;\n- 627 int index() const;\n- 628 CoordVector coords() const;\n- 629\n- 630 Geometry geometry () const;\n- 631\n- 632 private:\n- 633 CoordVector global(const CoordVector &local) const;\n- 634\n- 635 protected:\n-636 typedef FieldVector Vertex;\n-637 constexpr static int nKuhnIntervals = Dune::factorial(dimension);\n- 638\n-639 Vertex origin;\n-640 int kuhnIndex;\n-641 int size;\n-642 int index_;\n- 643 };\n- 644\n- 645 template\n-646 RefinementIteratorSpecial::\n- 647RefinementIteratorSpecial(int nIntervals, bool end)\n- 648 : kuhnIndex(0), size(nIntervals), index_(0)\n- 649 {\n- 650 for(int i = 0; i < dimension; ++i)\n- 651 origin[i] = 0;\n- 652 if(end) {\n- 653 index_ = Refinement::nElements(nIntervals);\n- 654 origin[0] = size;\n- 655 }\n- 656 }\n- 657\n- 658 template\n- 659 void\n-660 RefinementIteratorSpecial::\n- 661increment()\n- 662 {\n- 663 assert(origin[0] < size);\n- 664\n- 665 ++index_;\n- 666\n- 667 while(1) {\n- 668 ++kuhnIndex;\n- 669 if(kuhnIndex == nKuhnIntervals) {\n- 670 kuhnIndex = 0;\n- 671 // increment origin\n- 672 for(int i = dimension - 1; i >= 0; --i) {\n- 673 ++origin[i];\n- 674 if(i == 0 || origin[i] <= origin[i-1])\n- 675 break;\n- 676 else\n- 677 origin[i] = 0;\n- 678 }\n- 679 }\n- 680\n- 681 // test whether the current simplex has any corner outside the kuhn0\n-simplex\n- 682 FieldVector perm = getPermutation(kuhnIndex);\n- 683 Vertex corner = origin;\n- 684 bool outside = false;\n- 685 for(int i = 0; i < dimension; ++i) {\n- 686 // next corner\n- 687 ++corner[perm[i]];\n- 688 if(perm[i] > 0)\n- 689 if(corner[perm[i]] > corner[perm[i]-1]) {\n- 690 outside = true;\n- 691 break;\n- 692 }\n- 693 }\n- 694 if(!outside)\n- 695 return;\n- 696 }\n- 697 }\n- 698\n- 699 template\n- 700 bool\n-701 RefinementIteratorSpecial::\n- 702equals(const This &other) const\n- 703 {\n- 704 return size == other.size && index_ == other.index_;\n- 705 }\n- 706\n- 707 template\n- 708 typename RefinementIteratorSpecial::IndexVector\n-709 RefinementIteratorSpecial::\n- 710vertexIndices() const\n- 711 {\n- 712 IndexVector indices;\n- 713 FieldVector perm = getPermutation(kuhnIndex);\n- 714 Vertex vertex = origin;\n- 715 indices[0] = pointIndex(vertex);\n- 716 for(int i = 0; i < dimension; ++i) {\n- 717 ++vertex[perm[i]];\n- 718 indices[i+1] = pointIndex(vertex);\n- 719 }\n- 720 if (kuhnIndex%2 == 1)\n- 721 for(int i = 0; i < (dimension+1)/2; ++i) {\n- 722 int t = indices[i];\n- 723 indices[i] = indices[dimension-i];\n- 724 indices[dimension-i] = t;\n- 725 }\n- 726 return indices;\n- 727 }\n- 728\n- 729 template\n- 730 int\n-731 RefinementIteratorSpecial::\n- 732index() const\n- 733 {\n- 734 return index_;\n- 735 }\n- 736\n- 737 template\n- 738 typename RefinementIteratorSpecial::CoordVector\n-739 RefinementIteratorSpecial::\n- 740coords() const\n- 741 {\n- 742 return global(ReferenceElements\n- 743 ::simplex().position(0,0));\n- 744 }\n- 745\n- 746 template\n- 747 typename RefinementIteratorSpecial::Geometry\n-748 RefinementIteratorSpecial::geometry () const\n- 749 {\n- 750 std::vector corners(dimension+1);\n- 751 auto refelem = ReferenceElements::simplex();\n- 752 for(int i = 0; i <= dimension; ++i)\n- 753 corners[i] = global(refelem.position(i, dimension));\n- 754 return Geometry(refelem.type(), corners);\n- 755 }\n- 756\n- 757 template\n- 758 typename RefinementIteratorSpecial::CoordVector\n- 759 RefinementIteratorSpecial::\n- 760global(const CoordVector &local) const {\n- 761 CoordVector v =\n- 762 referenceToKuhn(local, getPermutation(kuhnIndex));\n- 763 v += origin;\n- 764 v /= (typename CoordVector::value_type)size;\n- 765 return kuhnToReference(v, getPermutation(0));\n- 766 }\n- 767\n- 768 // common\n- 769\n- 770 template\n- 771 template\n-772 class RefinementImp::Codim::\n-SubEntityIterator\n- 773 : public ForwardIteratorFacade::template Codim::SubEntityIterator, int>,\n- 774 public RefinementIteratorSpecial\n- 775 {\n- 776 public:\n-777 typedef RefinementImp Refinement;\n- 778\n-779 SubEntityIterator(int nIntervals, bool end = false);\n- 780 };\n- 781\n- 782#ifndef DOXYGEN\n- 783\n- 784 template\n- 785 template\n- 786 RefinementImp::Codim::\n-SubEntityIterator::\n- 787SubEntityIterator(int nIntervals, bool end)\n- 788 : RefinementIteratorSpecial(nIntervals,\n-end)\n- 789 {}\n- 790\n- 791#endif\n- 792\n- 793 } // namespace Simplex\n- 794\n- 795 } // namespace RefinementImp\n- 796\n- 797\n- 798 namespace RefinementImp {\n- 799\n- 800 // ///////////////////////\n- 801 //\n- 802 // The refinement traits\n- 803 //\n- 804\n- 805#ifndef DOXYGEN\n- 806 template\n- 808 struct Traits<\n- 809 topologyId, CoordType, coerceToId, dim,\n- 810 typename std::enable_if<\n- 811 ((GeometryTypes::simplex(dim).id() >> 1) ==\n- 812 (topologyId >> 1) &&\n- 813 (GeometryTypes::simplex(dim).id() >> 1) ==\n- 814 (coerceToId >> 1)\n- 815 )>::type\n- 816 >\n- 817 {\n- 818 typedef Simplex::RefinementImp Imp;\n- 819 };\n- 820#endif\n- 821\n- 822\n- 823 } // namespace RefinementImp\n- 824\n- 825} // namespace Dune\n- 826\n- 827#endif //DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC\n-multilineargeometry.hh\n-referenceelements.hh\n-type.hh\n-A unique label for each type of element that can occur in a grid.\n-base.cc\n-This file contains the parts independent of a particular Refinement\n-implementation.\n-Dune\n-Definition affinegeometry.hh:21\n-Dune::RefinementImp::Simplex::pointIndex\n-int pointIndex(const FieldVector< int, dimension > &point)\n-calculate the index of a given gridpoint within a Kuhn0 simplex\n-Definition simplex.cc:323\n-Dune::RefinementImp::Simplex::getPermutation\n-FieldVector< int, n > getPermutation(int m)\n-Calculate permutation from it's index.\n-Definition simplex.cc:336\n-Dune::RefinementImp::Simplex::factorial\n-int factorial(int n)\n-Calculate n!\n-Definition simplex.cc:289\n-Dune::RefinementImp::Simplex::binomial\n-int binomial(int upper, int lower)\n-calculate\n-Definition simplex.cc:305\n-Dune::RefinementImp::Simplex::referenceToKuhn\n-FieldVector< CoordType, dimension > referenceToKuhn(FieldVector< CoordType,\n-dimension > point, const FieldVector< int, dimension > &kuhn)\n-Map from the reference simplex to some Kuhn simplex.\n-Definition simplex.cc:394\n-Dune::RefinementImp::Simplex::kuhnToReference\n-FieldVector< CoordType, dimension > kuhnToReference(FieldVector< CoordType,\n-dimension > point, const FieldVector< int, dimension > &kuhn)\n-Map from some Kuhn simplex to the reference simplex.\n-Definition simplex.cc:413\n-Dune::Geo::ReferenceElements\n-Class providing access to the singletons of the reference elements.\n-Definition referenceelements.hh:170\n-Dune::Geo::ReferenceElements::simplex\n-static const ReferenceElement & simplex()\n-get simplex reference elements\n-Definition referenceelements.hh:204\n-Dune::Codim\n-Static tag representing a codimension.\n-Definition dimension.hh:24\n-Dune::CachedMultiLinearGeometry\n-Implement a MultiLinearGeometry with additional caching.\n-Definition multilineargeometry.hh:526\n-Dune::RefinementImp::Simplex::RefinementImp\n-Definition simplex.cc:433\n-Dune::RefinementImp::Simplex::RefinementImp::VertexIterator\n-Codim< dimension >::SubEntityIterator VertexIterator\n-Definition simplex.cc:440\n-Dune::RefinementImp::Simplex::RefinementImp::IndexVector\n-FieldVector< int, dimension+1 > IndexVector\n-Definition simplex.cc:443\n-Dune::RefinementImp::Simplex::RefinementImp::ctype\n-CoordType ctype\n-Definition simplex.cc:436\n-Dune::RefinementImp::Simplex::RefinementImp::nVertices\n-static int nVertices(int nIntervals)\n-Definition simplex.cc:466\n-Dune::RefinementImp::Simplex::RefinementImp::nElements\n-static int nElements(int nIntervals)\n-Definition simplex.cc:490\n-Dune::RefinementImp::Simplex::RefinementImp::eEnd\n-static ElementIterator eEnd(int nIntervals)\n-Definition simplex.cc:506\n-Dune::RefinementImp::Simplex::RefinementImp::vEnd\n-static VertexIterator vEnd(int nIntervals)\n-Definition simplex.cc:482\n-Dune::RefinementImp::Simplex::RefinementImp::ElementIterator\n-Codim< 0 >::SubEntityIterator ElementIterator\n-Definition simplex.cc:442\n-Dune::RefinementImp::Simplex::RefinementImp::vBegin\n-static VertexIterator vBegin(int nIntervals)\n-Definition simplex.cc:474\n-Dune::RefinementImp::Simplex::RefinementImp::eBegin\n-static ElementIterator eBegin(int nIntervals)\n-Definition simplex.cc:498\n-Dune::RefinementImp::Simplex::RefinementImp::CoordVector\n-FieldVector< CoordType, dimension > CoordVector\n-Definition simplex.cc:441\n-Dune::RefinementImp::Simplex::RefinementImp::dimension\n-static constexpr int dimension\n-Definition simplex.cc:435\n-Dune::RefinementImp::Simplex::RefinementImp::Codim\n-Definition simplex.cc:457\n-Dune::RefinementImp::Simplex::RefinementImp::Codim::Geometry\n-Dune::CachedMultiLinearGeometry< CoordType, dimension-codimension, dimension >\n-Geometry\n-Definition simplex.cc:460\n-Dune::RefinementImp::Simplex::RefinementIteratorSpecial\n-Definition simplex.cc:517\n-Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n-dimension_>\n-Definition simplex.cc:523\n-Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n-dimension_>::CoordVector\n-Refinement::CoordVector CoordVector\n-Definition simplex.cc:526\n-Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n-dimension_>::Refinement\n-RefinementImp< dimension, CoordType > Refinement\n-Definition simplex.cc:525\n-Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n-dimension_>::vertex\n-Vertex vertex\n-Definition simplex.cc:543\n-Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n-dimension_>::Geometry\n-Refinement::template Codim< dimension >::Geometry Geometry\n-Definition simplex.cc:527\n-Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n-dimension_>::This\n-RefinementIteratorSpecial< dimension, CoordType, dimension > This\n-Definition simplex.cc:528\n-Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n-dimension_>::Vertex\n-FieldVector< int, dimension > Vertex\n-Definition simplex.cc:540\n-Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n-dimension_>::size\n-int size\n-Definition simplex.cc:542\n-Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n-0_>\n-Definition simplex.cc:613\n-Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n-0_>::kuhnIndex\n-int kuhnIndex\n-Definition simplex.cc:640\n-Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n-0_>::Vertex\n-FieldVector< int, dimension > Vertex\n-Definition simplex.cc:636\n-Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n-0_>::origin\n-Vertex origin\n-Definition simplex.cc:639\n-Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n-0_>::index_\n-int index_\n-Definition simplex.cc:642\n-Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n-0_>::Geometry\n-Refinement::template Codim< 0 >::Geometry Geometry\n-Definition simplex.cc:618\n-Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n-0_>::IndexVector\n-Refinement::IndexVector IndexVector\n-Definition simplex.cc:616\n-Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n-0_>::CoordVector\n-Refinement::CoordVector CoordVector\n-Definition simplex.cc:617\n-Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n-0_>::This\n-RefinementIteratorSpecial< dimension, CoordType, 0 > This\n-Definition simplex.cc:619\n-Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n-0_>::Refinement\n-RefinementImp< dimension, CoordType > Refinement\n-Definition simplex.cc:615\n-Dune::RefinementImp::Simplex::RefinementIteratorSpecial<_dimension,_CoordType,\n-0_>::size\n-int size\n-Definition simplex.cc:641\n-Dune::RefinementImp::Simplex::RefinementImp::Codim<_codimension_>::\n-SubEntityIterator\n-SubEntityIterator(int nIntervals, bool end=false)\n-Dune::RefinementImp::Simplex::RefinementImp::Codim<_codimension_>::Refinement\n-RefinementImp< dimension, CoordType > Refinement\n-Definition simplex.cc:777\n+ 14 // PointDeprecationHelper can be used to prevent a deprecation warning for\n+Point\n+ 15 struct PointDeprecationHelper\n+ 16 {\n+ 17 static const unsigned int dimension = 0;\n+ 18 static const unsigned int numCorners = 1;\n+ 19\n+ 20 static const unsigned int id = 0;\n+ 21\n+ 22 static std::string name () { return \"p\"; }\n+ 23 };\n+ 24\n+ 25 using Point [[deprecated(\"Use GeometryTypes::vertex instead.\")]] =\n+PointDeprecationHelper;\n+ 26\n+ 27\n+ 28 template< class BaseTopology >\n+ 29 struct [[deprecated(\"Use GeometryTypes::prismaticExtension(GeometryType gt)\n+instead.\")]] Prism\n+ 30 {\n+ 31 static const unsigned int dimension = BaseTopology::dimension + 1;\n+ 32 static const unsigned int numCorners = 2 * BaseTopology::numCorners;\n+ 33\n+ 34 static const unsigned int id = BaseTopology::id | ((unsigned\n+int)prismConstruction << (dimension-1));\n+ 35\n+ 36 static std::string name () { return BaseTopology::name() + \"l\"; }\n+ 37 };\n+ 38\n+ 39\n+ 40 template< class BaseTopology >\n+ 41 struct [[deprecated(\"Use GeometryTypes::conicalExtension(GeometryType gt)\n+instead.\")]] Pyramid\n+ 42 {\n+ 43 static const unsigned int dimension = BaseTopology::dimension + 1;\n+ 44 static const unsigned int numCorners = BaseTopology::numCorners + 1;\n+ 45\n+ 46 static const unsigned int id = BaseTopology::id | ((unsigned\n+int)pyramidConstruction << (dimension-1));\n+ 47\n+ 48 static std::string name () { return BaseTopology::name() + \"o\"; }\n+ 49 };\n+ 50\n+ 51\n+ 52\n+ 53 // Properties of Topologies\n+ 54 // ------------------------\n+ 55\n+ 56 template< class Topology >\n+ 57 struct [[deprecated(\"Use GeometryType::isSimplex() instead.\")]] IsSimplex\n+ 58 : public std::integral_constant< bool, (Topology::id >> 1) == 0 >\n+ 59 {};\n+ 60\n+ 61 template< class Topology >\n+ 62 struct [[deprecated(\"Use GeometryType::isCube() instead.\")]] IsCube\n+ 63 : public std::integral_constant< bool, (Topology::id | 1) == (1 <<\n+Topology::dimension) - 1 >\n+ 64 {};\n+ 65\n+ 78 [[deprecated(\"Use GeometryType::isPrismatic() or GeometryType::isConical()\n+instead.\")]]\n+ 79 inline static bool isTopology ( TopologyConstruction construction, unsigned\n+int topologyId, int dim, int codim = 0 ) noexcept\n+ 80 {\n+ 81 assert( (dim > 0) && (topologyId < numTopologies( dim )) );\n+ 82 assert( (0 <= codim) && (codim <= dim) );\n+ 83 return (codim >= (dim-1)) || (((topologyId >> (dim-codim-1)) & 1) ==\n+(unsigned int)construction);\n+ 84 }\n+ 85\n+ 86\n+ 87 // SimplexTopology\n+ 88 // ---------------\n+ 89\n+ 90 template< unsigned int dim >\n+ 91 struct [[deprecated(\"Use GeometryTypes::simplex(dim) instead.\")]]\n+SimplexTopology\n+ 92 {\n+ 93 typedef Pyramid< typename SimplexTopology< dim-1 >::type > type;\n+ 94 };\n+ 95\n+ 96 template<>\n+ 97 struct [[deprecated(\"Use GeometryTypes::simplex(dim) instead.\")]]\n+SimplexTopology< 0 >\n+ 98 {\n+ 99 typedef Point type;\n+ 100 };\n+ 101\n+ 102\n+ 103\n+ 104 // CubeTopology\n+ 105 // ------------\n+ 106\n+ 107 template< unsigned int dim >\n+ 108 struct [[deprecated(\"Use GeometryTypes::cube(dim) instead.\")]]\n+CubeTopology\n+ 109 {\n+ 110 typedef Prism< typename CubeTopology< dim-1 >::type > type;\n+ 111 };\n+ 112\n+ 113 template<>\n+ 114 struct [[deprecated(\"Use GeometryTypes::simplex(dim) instead.\")]]\n+CubeTopology< 0 >\n+ 115 {\n+ 116 typedef Point type;\n+ 117 };\n+ 118\n+ 119\n+ 120\n+ 121 // PyramidTopology\n+ 122 // ---------------\n+ 123\n+ 124 template< unsigned int dim >\n+ 125 struct [[deprecated]] PyramidTopology\n+ 126 {\n+ 127 typedef Pyramid< typename CubeTopology< dim-1 >::type > type;\n+ 128 };\n+ 129\n+ 130\n+ 131\n+ 132 // PrismTopology\n+ 133 // -------------\n+ 134\n+ 135 template< unsigned int dim >\n+ 136 struct [[deprecated]] PrismTopology\n+ 137 {\n+ 138 typedef Prism< typename SimplexTopology< dim-1 >::type > type;\n+ 139 };\n+ 140\n+ 141\n+ 142\n+ 143\n+ 144 // IfTopology\n+ 145 // ----------\n+ 146\n+ 147 template< template< class > class Operation, int dim, class Topology =\n+PointDeprecationHelper >\n+ 148 struct [[deprecated(\"Use IfGeometryType instead.\")]] IfTopology\n+ 149 {\n+ 150 template< class... Args >\n+ 151 static auto apply ( unsigned int topologyId, Args &&... args )\n+ 152 {\n+ 153 if( topologyId & 1 )\n+ 154 return IfTopology< Operation, dim-1, Prism< Topology > >::apply\n+( topologyId >> 1, std::forward< Args >( args )... );\n+ 155 else\n+ 156 return IfTopology< Operation, dim-1, Pyramid< Topology > >::apply\n+( topologyId >> 1, std::forward< Args >( args )... );\n+ 157 }\n+ 158 };\n+ 159\n+ 160 template< template< class > class Operation, class Topology >\n+ 161 struct [[deprecated(\"Use IfGeometryType instead.\")]] IfTopology<\n+Operation, 0, Topology >\n+ 162 {\n+ 163 template< class... Args >\n+ 164 static auto apply ([[maybe_unused]] unsigned int topologyId, Args &&...\n+args)\n+ 165 {\n+ 166 return Operation< Topology >::apply( std::forward< Args >( args )... );\n+ 167 }\n+ 168 };\n+ 169\n+ 170 } // namespace Impl\n+ 171#endif\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00233.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00233.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: typefromvertexcount.hh File Reference\n+dune-geometry: refinement.hh File Reference\n \n \n \n \n \n \n \n@@ -65,39 +65,34 @@\n \n \n \n \n \n \n \n
    \n- \n-
    typefromvertexcount.hh File Reference
    \n+
    refinement.hh File Reference
    \n
    \n
    \n-
    #include <dune/geometry/type.hh>
    \n+\n+

    This file simply includes all Refinement implementations so you don't have to do them separately. \n+More...

    \n+\n

    Go to the source code of this file.

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

    \n-Namespaces

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

    \n-Functions

    GeometryType Dune::geometryTypeFromVertexCount (unsigned int dim, unsigned int vertices)
     Utitlity function to construct the correct geometry type given the dimension and the number of vertices.
     
    \n-
    \n+

    Detailed Description

    \n+

    This file simply includes all Refinement implementations so you don't have to do them separately.

    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,24 +6,23 @@\n dune-geometry\u00a02.9.0\n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n- * utility\n-Namespaces | Functions\n-typefromvertexcount.hh File Reference\n-#include \n+refinement.hh File Reference\n+This file simply includes all Refinement implementations so you don't have to\n+do them separately. More...\n+#include \"refinement/base.cc\"\n+#include \"refinement/hcube.cc\"\n+#include \"refinement/simplex.cc\"\n+#include \"refinement/hcubetriangulation.cc\"\n+#include \"refinement/prismtriangulation.cc\"\n+#include \"refinement/pyramidtriangulation.cc\"\n Go_to_the_source_code_of_this_file.\n- Namespaces\n-namespace \u00a0Dune\n-\u00a0\n- Functions\n-GeometryType\u00a0Dune::geometryTypeFromVertexCount (unsigned int dim, unsigned int\n- vertices)\n-\u00a0 Utitlity function to construct the correct geometry type given\n- the dimension and the number of vertices.\n-\u00a0\n+***** Detailed Description *****\n+This file simply includes all Refinement implementations so you don't have to\n+do them separately.\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00233_source.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00233_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: typefromvertexcount.hh Source File\n+dune-geometry: refinement.hh Source File\n \n \n \n \n \n \n \n@@ -70,77 +70,46 @@\n \n \n \n \n \n \n \n
    \n-
    typefromvertexcount.hh
    \n+
    refinement.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
    \n
    4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n-
    5#ifndef DUNE_GEOMETRY_TYPE_FROM_VERTEX_COUNT_HH
    \n-
    6#define DUNE_GEOMETRY_TYPE_FROM_VERTEX_COUNT_HH
    \n+
    5#ifndef DUNE_GEOMETRY_REFINEMENT_HH
    \n+
    6#define DUNE_GEOMETRY_REFINEMENT_HH
    \n
    7
    \n-\n-
    9
    \n-
    10namespace Dune {
    \n-
    11
    \n-
    16 inline
    \n-
    \n-
    17 GeometryType geometryTypeFromVertexCount(unsigned int dim, unsigned int vertices)
    \n-
    18 {
    \n-
    19 switch (dim)
    \n-
    20 {
    \n-
    21 case 0 :
    \n-
    22 return GeometryTypes::vertex;
    \n-
    23 case 1 :
    \n-
    24 return GeometryTypes::line;
    \n-
    25 case 2 :
    \n-
    26 switch (vertices) {
    \n-
    27 case 3 :
    \n-
    28 return GeometryTypes::triangle;
    \n-
    29 case 4 :
    \n-
    30 return GeometryTypes::quadrilateral;
    \n-
    31 default :
    \n-
    32 DUNE_THROW(NotImplemented, "2d elements with " << vertices << " corners are not supported!");
    \n-
    33 }
    \n-
    34 case 3 :
    \n-
    35 switch (vertices) {
    \n-
    36 case 4 :
    \n-
    37 return GeometryTypes::tetrahedron;
    \n-
    38 case 5 :
    \n-
    39 return GeometryTypes::pyramid;
    \n-
    40 case 6 :
    \n-
    41 return GeometryTypes::prism;
    \n-
    42 case 8 :
    \n-
    43 return GeometryTypes::hexahedron;
    \n-
    44 default :
    \n-
    45 DUNE_THROW(NotImplemented, "3d elements with " << vertices << " corners are not supported!");
    \n-
    46 }
    \n-
    47 default :
    \n-
    48 DUNE_THROW(NotImplemented, "geometryTypeFromVertexCount works only up to dim=3");
    \n-
    49 }
    \n-
    50 }
    \n-
    \n-
    51
    \n-
    52}
    \n-
    53
    \n-
    54#endif // DUNE_GEOMETRY_TYPE_FROM_VERTEX_COUNT_HH
    \n-
    A unique label for each type of element that can occur in a grid.
    \n-
    Definition affinegeometry.hh:21
    \n-
    GeometryType geometryTypeFromVertexCount(unsigned int dim, unsigned int vertices)
    Utitlity function to construct the correct geometry type given the dimension and the number of vertic...
    Definition typefromvertexcount.hh:17
    \n-
    Unique label for each type of entities that can occur in DUNE grids.
    Definition type.hh:126
    \n+
    250// The interface (template<...> class StaticRefinement) is not included here
    \n+
    251// since it derives from parts which I consider implementation. Look
    \n+
    252// into refinement/base.cc if the documentation is above is not enough.
    \n+
    253#include "refinement/base.cc"
    \n+
    254
    \n+
    255#include "refinement/hcube.cc"
    \n+
    256#include "refinement/simplex.cc"
    \n+\n+\n+\n+
    260
    \n+
    261#endif // DUNE_GEOMETRY_REFINEMENT_HH
    \n+
    This file contains the parts independent of a particular Refinement implementation.
    \n+\n+
    This file contains the Refinement implementation for hypercubes (quadrilaterals, hexahedrons,...
    \n+
    This file contains the Refinement implementation for simplices (triangles, tetrahedrons....
    \n+\n+
    This file contains the Refinement implementation for triangulating hypercubes (quadrilateral -> trian...
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,81 +7,47 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n- * utility\n-typefromvertexcount.hh\n+refinement.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file\n LICENSE.md in module root\n 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n- 5#ifndef DUNE_GEOMETRY_TYPE_FROM_VERTEX_COUNT_HH\n- 6#define DUNE_GEOMETRY_TYPE_FROM_VERTEX_COUNT_HH\n+ 5#ifndef DUNE_GEOMETRY_REFINEMENT_HH\n+ 6#define DUNE_GEOMETRY_REFINEMENT_HH\n 7\n- 8#include \n- 9\n- 10namespace Dune {\n- 11\n- 16 inline\n-17 GeometryType geometryTypeFromVertexCount(unsigned int dim, unsigned int\n-vertices)\n- 18 {\n- 19 switch (dim)\n- 20 {\n- 21 case 0 :\n- 22 return GeometryTypes::vertex;\n- 23 case 1 :\n- 24 return GeometryTypes::line;\n- 25 case 2 :\n- 26 switch (vertices) {\n- 27 case 3 :\n- 28 return GeometryTypes::triangle;\n- 29 case 4 :\n- 30 return GeometryTypes::quadrilateral;\n- 31 default :\n- 32 DUNE_THROW(NotImplemented, \"2d elements with \" << vertices << \" corners are\n-not supported!\");\n- 33 }\n- 34 case 3 :\n- 35 switch (vertices) {\n- 36 case 4 :\n- 37 return GeometryTypes::tetrahedron;\n- 38 case 5 :\n- 39 return GeometryTypes::pyramid;\n- 40 case 6 :\n- 41 return GeometryTypes::prism;\n- 42 case 8 :\n- 43 return GeometryTypes::hexahedron;\n- 44 default :\n- 45 DUNE_THROW(NotImplemented, \"3d elements with \" << vertices << \" corners are\n-not supported!\");\n- 46 }\n- 47 default :\n- 48 DUNE_THROW(NotImplemented, \"geometryTypeFromVertexCount works only up to\n-dim=3\");\n- 49 }\n- 50 }\n- 51\n- 52}\n- 53\n- 54#endif // DUNE_GEOMETRY_TYPE_FROM_VERTEX_COUNT_HH\n-type.hh\n-A unique label for each type of element that can occur in a grid.\n-Dune\n-Definition affinegeometry.hh:21\n-Dune::geometryTypeFromVertexCount\n-GeometryType geometryTypeFromVertexCount(unsigned int dim, unsigned int\n-vertices)\n-Utitlity function to construct the correct geometry type given the dimension\n-and the number of vertic...\n-Definition typefromvertexcount.hh:17\n-Dune::GeometryType\n-Unique label for each type of entities that can occur in DUNE grids.\n-Definition type.hh:126\n+ 250// The interface (template<...> class StaticRefinement) is not included\n+here\n+ 251// since it derives from parts which I consider implementation. Look\n+ 252// into refinement/base.cc if the documentation is above is not enough.\n+ 253#include \"refinement/base.cc\"\n+ 254\n+ 255#include \"refinement/hcube.cc\"\n+ 256#include \"refinement/simplex.cc\"\n+ 257#include \"refinement/hcubetriangulation.cc\"\n+ 258#include \"refinement/prismtriangulation.cc\"\n+ 259#include \"refinement/pyramidtriangulation.cc\"\n+ 260\n+ 261#endif // DUNE_GEOMETRY_REFINEMENT_HH\n+base.cc\n+This file contains the parts independent of a particular Refinement\n+implementation.\n+pyramidtriangulation.cc\n+hcube.cc\n+This file contains the Refinement implementation for hypercubes\n+(quadrilaterals, hexahedrons,...\n+simplex.cc\n+This file contains the Refinement implementation for simplices (triangles,\n+tetrahedrons....\n+prismtriangulation.cc\n+hcubetriangulation.cc\n+This file contains the Refinement implementation for triangulating hypercubes\n+(quadrilateral -> trian...\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00236.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00236.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: typeindex.hh File Reference\n+dune-geometry: typefromvertexcount.hh File Reference\n \n \n \n \n \n \n \n@@ -65,50 +65,39 @@\n \n \n \n \n \n \n \n
    \n \n-
    typeindex.hh File Reference
    \n+Namespaces |\n+Functions
    \n+
    typefromvertexcount.hh File Reference
    \n \n
    \n-\n-

    Helper classes to provide indices for geometrytypes for use in a vector. \n-More...

    \n-
    #include <cstddef>
    \n-#include <dune/common/indices.hh>
    \n-#include <dune/common/hybridutilities.hh>
    \n-#include "type.hh"
    \n+
    #include <dune/geometry/type.hh>
    \n
    \n

    Go to the source code of this file.

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

    \n-Classes

    class  Dune::LocalGeometryTypeIndex
     Compute per-dimension indices for geometry types. More...
     
    class  Dune::GlobalGeometryTypeIndex
     Compute indices for geometry types, taking the dimension into account. More...
     
    \n \n \n \n+

    \n Namespaces

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

    \n+Functions

    GeometryType Dune::geometryTypeFromVertexCount (unsigned int dim, unsigned int vertices)
     Utitlity function to construct the correct geometry type given the dimension and the number of vertices.
     
    \n-

    Detailed Description

    \n-

    Helper classes to provide indices for geometrytypes for use in a vector.

    \n-
    \n+
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,32 +6,24 @@\n dune-geometry\u00a02.9.0\n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n-Classes | Namespaces\n-typeindex.hh File Reference\n-Helper classes to provide indices for geometrytypes for use in a vector.\n-More...\n-#include \n-#include \n-#include \n-#include \"type.hh\"\n+ * utility\n+Namespaces | Functions\n+typefromvertexcount.hh File Reference\n+#include \n Go_to_the_source_code_of_this_file.\n- Classes\n-class \u00a0Dune::LocalGeometryTypeIndex\n-\u00a0 Compute per-dimension indices for geometry types. More...\n-\u00a0\n-class \u00a0Dune::GlobalGeometryTypeIndex\n-\u00a0 Compute indices for geometry types, taking the dimension into account.\n- More...\n-\u00a0\n Namespaces\n namespace \u00a0Dune\n \u00a0\n-***** Detailed Description *****\n-Helper classes to provide indices for geometrytypes for use in a vector.\n+ Functions\n+GeometryType\u00a0Dune::geometryTypeFromVertexCount (unsigned int dim, unsigned int\n+ vertices)\n+\u00a0 Utitlity function to construct the correct geometry type given\n+ the dimension and the number of vertices.\n+\u00a0\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00236_source.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00236_source.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: typeindex.hh Source File\n+dune-geometry: typefromvertexcount.hh Source File\n \n \n \n \n \n \n \n@@ -70,165 +70,77 @@\n \n \n \n \n \n \n \n
    \n-
    typeindex.hh
    \n+
    typefromvertexcount.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
    \n
    4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
    \n-
    5#ifndef DUNE_GEOMETRY_TYPEINDEX_HH
    \n-
    6#define DUNE_GEOMETRY_TYPEINDEX_HH
    \n+
    5#ifndef DUNE_GEOMETRY_TYPE_FROM_VERTEX_COUNT_HH
    \n+
    6#define DUNE_GEOMETRY_TYPE_FROM_VERTEX_COUNT_HH
    \n
    7
    \n-
    14#include <cstddef>
    \n-
    15
    \n-
    16#include <dune/common/indices.hh>
    \n-
    17#include <dune/common/hybridutilities.hh>
    \n-
    18
    \n-
    19#include "type.hh"
    \n-
    20
    \n-
    21namespace Dune
    \n-
    22{
    \n-
    \n-\n-
    25 {
    \n-
    32 inline static constexpr std::size_t regular_size(std::size_t dim)
    \n-
    33 {
    \n-
    34 // The following expression is derived from the expression for
    \n-
    35 // GlobalGeometryTypeIndex::regular_offset(). Subtracting
    \n-
    36 // regular_offset(dim+1)-regular_offset(dim) we get:
    \n-
    37 //
    \n-
    38 // ((1 << dim+1) >> 1) - ((1 << dim) >> 1)
    \n-
    39 //
    \n-
    40 // We always have
    \n-
    41 //
    \n-
    42 // dim >= 0,
    \n-
    43 //
    \n-
    44 // so
    \n-
    45 //
    \n-
    46 // (1 << dim+1) >= 2 and (1 << dim+2) % 2 == 0.
    \n-
    47 //
    \n-
    48 // So if we apply a single right-shift to that, we will never lose any
    \n-
    49 // set bits, thus
    \n-
    50 //
    \n-
    51 // ((1 << dim+1) >> 1) == (1 << dim)
    \n-
    52 return (1 << dim) - ((1 << dim) >> 1);
    \n-
    53 }
    \n-
    54
    \n-
    55 public:
    \n-
    \n-
    61 inline static constexpr std::size_t size(std::size_t dim)
    \n-
    62 {
    \n-
    63 // one for "none"
    \n-
    64 return regular_size(dim) + 1;
    \n-
    65 }
    \n-
    \n-
    66
    \n-
    \n-
    73 inline static constexpr std::size_t index(const GeometryType &gt)
    \n-
    74 {
    \n-
    75 return gt.isNone() ? regular_size(gt.dim()) : (gt.id() >> 1);
    \n-
    76 }
    \n-
    \n-
    77
    \n-
    \n-
    79 inline static constexpr GeometryType type(std::size_t dim, std::size_t index) {
    \n-
    80 return (index == regular_size(dim)) ?
    \n-
    81 GeometryTypes::none(dim) :
    \n-
    82 // the cast to unsigned makes sure this is interpreted as the topology
    \n-
    83 // ID constructor
    \n-
    84 GeometryType(static_cast< unsigned int >(index << 1), dim);
    \n-
    85 }
    \n-
    \n-
    86 };
    \n-
    \n-
    87
    \n-
    \n-\n-
    90 {
    \n-
    98 inline static constexpr std::size_t regular_offset(std::size_t dim)
    \n-
    99 {
    \n-
    100 // The number of regular geometry types in a given dimension is
    \n-
    101 // 2^(dim-1). For dim==0 this would yield 1/2 geometry types (which is
    \n-
    102 // obviously bogus, dim==0 has one regular geometry type, the point).
    \n-
    103 // The following expression relies on 1 >> 1 == 0 to treat dim==0
    \n-
    104 // specially.
    \n-
    105 return (1 << dim) >> 1;
    \n-
    106 }
    \n-
    107
    \n-
    108 public:
    \n-
    \n-
    113 inline static constexpr std::size_t offset(std::size_t dim)
    \n-
    114 {
    \n-
    115 // dim times "none"
    \n-
    116 return regular_offset(dim) + dim;
    \n-
    117 }
    \n-
    \n-
    118
    \n-
    \n-
    125 inline static constexpr std::size_t size(std::size_t maxdim)
    \n-
    126 {
    \n-
    127 return offset(maxdim+1);
    \n-
    128 }
    \n-
    \n-
    129
    \n-
    \n-
    138 inline static constexpr std::size_t index(const GeometryType &gt)
    \n-
    139 {
    \n-
    140 return offset(gt.dim()) + LocalGeometryTypeIndex::index(gt);
    \n-
    141 }
    \n-
    \n-
    142 };
    \n-
    \n-
    143
    \n-
    144 namespace Impl {
    \n-
    145
    \n-
    146 // Map a dynamic GeometryType to a static integral_constant<GeometryType::Id, ...>
    \n-
    147 template<int dim, class F>
    \n-
    148 static auto toGeometryTypeIdConstant(const GeometryType& gt, F&& f) {
    \n-
    149 // Transform LocalGeometryTypeIndex to GeometryType::Id
    \n-
    150 auto callWithId = [&](auto index) {
    \n-
    151 static constexpr auto id = LocalGeometryTypeIndex::type(dim, decltype(index)::value).toId();
    \n-
    152 return f(std::integral_constant<GeometryType::Id, id>{});
    \n-
    153 };
    \n-
    154 // switchCases needs a fallback to determine the return type.
    \n-
    155 auto fallBack = [&]() { return callWithId(Dune::Indices::_0); };
    \n-
    156 // Iterate over all _regular_ GeometryType indices for given dimension
    \n-
    157 auto allIndices = std::make_index_sequence<LocalGeometryTypeIndex::size(dim)-1>{};
    \n-
    158 return Dune::Hybrid::switchCases(allIndices, LocalGeometryTypeIndex::index(gt), callWithId, fallBack);
    \n-
    159 }
    \n-
    160
    \n-
    161 } // namespace Impl
    \n-
    162} // namespace Dune
    \n-
    163
    \n-
    164#endif // DUNE_GEOMETRY_TYPEINDEX_HH
    \n+\n+
    9
    \n+
    10namespace Dune {
    \n+
    11
    \n+
    16 inline
    \n+
    \n+
    17 GeometryType geometryTypeFromVertexCount(unsigned int dim, unsigned int vertices)
    \n+
    18 {
    \n+
    19 switch (dim)
    \n+
    20 {
    \n+
    21 case 0 :
    \n+
    22 return GeometryTypes::vertex;
    \n+
    23 case 1 :
    \n+
    24 return GeometryTypes::line;
    \n+
    25 case 2 :
    \n+
    26 switch (vertices) {
    \n+
    27 case 3 :
    \n+
    28 return GeometryTypes::triangle;
    \n+
    29 case 4 :
    \n+
    30 return GeometryTypes::quadrilateral;
    \n+
    31 default :
    \n+
    32 DUNE_THROW(NotImplemented, "2d elements with " << vertices << " corners are not supported!");
    \n+
    33 }
    \n+
    34 case 3 :
    \n+
    35 switch (vertices) {
    \n+
    36 case 4 :
    \n+
    37 return GeometryTypes::tetrahedron;
    \n+
    38 case 5 :
    \n+
    39 return GeometryTypes::pyramid;
    \n+
    40 case 6 :
    \n+
    41 return GeometryTypes::prism;
    \n+
    42 case 8 :
    \n+
    43 return GeometryTypes::hexahedron;
    \n+
    44 default :
    \n+
    45 DUNE_THROW(NotImplemented, "3d elements with " << vertices << " corners are not supported!");
    \n+
    46 }
    \n+
    47 default :
    \n+
    48 DUNE_THROW(NotImplemented, "geometryTypeFromVertexCount works only up to dim=3");
    \n+
    49 }
    \n+
    50 }
    \n+
    \n+
    51
    \n+
    52}
    \n+
    53
    \n+
    54#endif // DUNE_GEOMETRY_TYPE_FROM_VERTEX_COUNT_HH
    \n
    A unique label for each type of element that can occur in a grid.
    \n
    Definition affinegeometry.hh:21
    \n+
    GeometryType geometryTypeFromVertexCount(unsigned int dim, unsigned int vertices)
    Utitlity function to construct the correct geometry type given the dimension and the number of vertic...
    Definition typefromvertexcount.hh:17
    \n
    Unique label for each type of entities that can occur in DUNE grids.
    Definition type.hh:126
    \n-
    constexpr Id toId() const
    Create an Id representation of this GeometryType.
    Definition type.hh:222
    \n-
    constexpr unsigned int dim() const
    Return dimension of the type.
    Definition type.hh:372
    \n-
    constexpr unsigned int id() const
    Return the topology id of the type.
    Definition type.hh:377
    \n-
    constexpr bool isNone() const
    Return true if entity is a singular of any dimension.
    Definition type.hh:367
    \n-
    Compute per-dimension indices for geometry types.
    Definition typeindex.hh:25
    \n-
    static constexpr std::size_t size(std::size_t dim)
    Compute total number of geometry types for the given dimension.
    Definition typeindex.hh:61
    \n-
    static constexpr GeometryType type(std::size_t dim, std::size_t index)
    compute the geometry type for the given local index and dimension
    Definition typeindex.hh:79
    \n-
    static constexpr std::size_t index(const GeometryType &gt)
    Compute the index for the given geometry type within its dimension.
    Definition typeindex.hh:73
    \n-
    Compute indices for geometry types, taking the dimension into account.
    Definition typeindex.hh:90
    \n-
    static constexpr std::size_t index(const GeometryType &gt)
    Compute the index for the given geometry type over all dimensions.
    Definition typeindex.hh:138
    \n-
    static constexpr std::size_t offset(std::size_t dim)
    Compute the starting index for a given dimension including irregular geometry types.
    Definition typeindex.hh:113
    \n-
    static constexpr std::size_t size(std::size_t maxdim)
    Compute total number of geometry types up to and including the given dimension.
    Definition typeindex.hh:125
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -7,185 +7,81 @@\n \n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n-typeindex.hh\n+ * utility\n+typefromvertexcount.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// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file\n LICENSE.md in module root\n 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception\n- 5#ifndef DUNE_GEOMETRY_TYPEINDEX_HH\n- 6#define DUNE_GEOMETRY_TYPEINDEX_HH\n+ 5#ifndef DUNE_GEOMETRY_TYPE_FROM_VERTEX_COUNT_HH\n+ 6#define DUNE_GEOMETRY_TYPE_FROM_VERTEX_COUNT_HH\n 7\n- 14#include \n- 15\n- 16#include \n- 17#include \n- 18\n- 19#include \"type.hh\"\n- 20\n- 21namespace Dune\n- 22{\n-24 class LocalGeometryTypeIndex\n- 25 {\n- 32 inline static constexpr std::size_t regular_size(std::size_t dim)\n- 33 {\n- 34 // The following expression is derived from the expression for\n- 35 // GlobalGeometryTypeIndex::regular_offset(). Subtracting\n- 36 // regular_offset(dim+1)-regular_offset(dim) we get:\n- 37 //\n- 38 // ((1 << dim+1) >> 1) - ((1 << dim) >> 1)\n- 39 //\n- 40 // We always have\n- 41 //\n- 42 // dim >= 0,\n- 43 //\n- 44 // so\n- 45 //\n- 46 // (1 << dim+1) >= 2 and (1 << dim+2) % 2 == 0.\n- 47 //\n- 48 // So if we apply a single right-shift to that, we will never lose any\n- 49 // set bits, thus\n- 50 //\n- 51 // ((1 << dim+1) >> 1) == (1 << dim)\n- 52 return (1 << dim) - ((1 << dim) >> 1);\n- 53 }\n- 54\n- 55 public:\n-61 inline static constexpr std::size_t size(std::size_t dim)\n- 62 {\n- 63 // one for \"none\"\n- 64 return regular_size(dim) + 1;\n- 65 }\n- 66\n-73 inline static constexpr std::size_t index(const GeometryType >)\n- 74 {\n- 75 return gt.isNone() ? regular_size(gt.dim()) : (gt.id() >> 1);\n- 76 }\n- 77\n-79 inline static constexpr GeometryType type(std::size_t dim, std::size_t\n-index) {\n- 80 return (index == regular_size(dim)) ?\n- 81 GeometryTypes::none(dim) :\n- 82 // the cast to unsigned makes sure this is interpreted as the topology\n- 83 // ID constructor\n- 84 GeometryType(static_cast< unsigned int >(index << 1), dim);\n- 85 }\n- 86 };\n- 87\n-89 class GlobalGeometryTypeIndex\n- 90 {\n- 98 inline static constexpr std::size_t regular_offset(std::size_t dim)\n- 99 {\n- 100 // The number of regular geometry types in a given dimension is\n- 101 // 2^(dim-1). For dim==0 this would yield 1/2 geometry types (which is\n- 102 // obviously bogus, dim==0 has one regular geometry type, the point).\n- 103 // The following expression relies on 1 >> 1 == 0 to treat dim==0\n- 104 // specially.\n- 105 return (1 << dim) >> 1;\n- 106 }\n- 107\n- 108 public:\n-113 inline static constexpr std::size_t offset(std::size_t dim)\n- 114 {\n- 115 // dim times \"none\"\n- 116 return regular_offset(dim) + dim;\n- 117 }\n- 118\n-125 inline static constexpr std::size_t size(std::size_t maxdim)\n- 126 {\n- 127 return offset(maxdim+1);\n- 128 }\n- 129\n-138 inline static constexpr std::size_t index(const GeometryType >)\n- 139 {\n- 140 return offset(gt.dim()) + LocalGeometryTypeIndex::index(gt);\n- 141 }\n- 142 };\n- 143\n- 144 namespace Impl {\n- 145\n- 146 // Map a dynamic GeometryType to a static integral_constant\n- 147 template\n- 148 static auto toGeometryTypeIdConstant(const GeometryType& gt, F&& f) {\n- 149 // Transform LocalGeometryTypeIndex to GeometryType::Id\n- 150 auto callWithId = [&](auto index) {\n- 151 static constexpr auto id = LocalGeometryTypeIndex::type(dim, decltype\n-(index)::value).toId();\n- 152 return f(std::integral_constant{});\n- 153 };\n- 154 // switchCases needs a fallback to determine the return type.\n- 155 auto fallBack = [&]() { return callWithId(Dune::Indices::_0); };\n- 156 // Iterate over all _regular_ GeometryType indices for given dimension\n- 157 auto allIndices = std::make_index_sequence{};\n- 158 return Dune::Hybrid::switchCases(allIndices, LocalGeometryTypeIndex::index\n-(gt), callWithId, fallBack);\n- 159 }\n- 160\n- 161 } // namespace Impl\n- 162} // namespace Dune\n- 163\n- 164#endif // DUNE_GEOMETRY_TYPEINDEX_HH\n+ 8#include \n+ 9\n+ 10namespace Dune {\n+ 11\n+ 16 inline\n+17 GeometryType geometryTypeFromVertexCount(unsigned int dim, unsigned int\n+vertices)\n+ 18 {\n+ 19 switch (dim)\n+ 20 {\n+ 21 case 0 :\n+ 22 return GeometryTypes::vertex;\n+ 23 case 1 :\n+ 24 return GeometryTypes::line;\n+ 25 case 2 :\n+ 26 switch (vertices) {\n+ 27 case 3 :\n+ 28 return GeometryTypes::triangle;\n+ 29 case 4 :\n+ 30 return GeometryTypes::quadrilateral;\n+ 31 default :\n+ 32 DUNE_THROW(NotImplemented, \"2d elements with \" << vertices << \" corners are\n+not supported!\");\n+ 33 }\n+ 34 case 3 :\n+ 35 switch (vertices) {\n+ 36 case 4 :\n+ 37 return GeometryTypes::tetrahedron;\n+ 38 case 5 :\n+ 39 return GeometryTypes::pyramid;\n+ 40 case 6 :\n+ 41 return GeometryTypes::prism;\n+ 42 case 8 :\n+ 43 return GeometryTypes::hexahedron;\n+ 44 default :\n+ 45 DUNE_THROW(NotImplemented, \"3d elements with \" << vertices << \" corners are\n+not supported!\");\n+ 46 }\n+ 47 default :\n+ 48 DUNE_THROW(NotImplemented, \"geometryTypeFromVertexCount works only up to\n+dim=3\");\n+ 49 }\n+ 50 }\n+ 51\n+ 52}\n+ 53\n+ 54#endif // DUNE_GEOMETRY_TYPE_FROM_VERTEX_COUNT_HH\n type.hh\n A unique label for each type of element that can occur in a grid.\n Dune\n Definition affinegeometry.hh:21\n+Dune::geometryTypeFromVertexCount\n+GeometryType geometryTypeFromVertexCount(unsigned int dim, unsigned int\n+vertices)\n+Utitlity function to construct the correct geometry type given the dimension\n+and the number of vertic...\n+Definition typefromvertexcount.hh:17\n Dune::GeometryType\n Unique label for each type of entities that can occur in DUNE grids.\n Definition type.hh:126\n-Dune::GeometryType::toId\n-constexpr Id toId() const\n-Create an Id representation of this GeometryType.\n-Definition type.hh:222\n-Dune::GeometryType::dim\n-constexpr unsigned int dim() const\n-Return dimension of the type.\n-Definition type.hh:372\n-Dune::GeometryType::id\n-constexpr unsigned int id() const\n-Return the topology id of the type.\n-Definition type.hh:377\n-Dune::GeometryType::isNone\n-constexpr bool isNone() const\n-Return true if entity is a singular of any dimension.\n-Definition type.hh:367\n-Dune::LocalGeometryTypeIndex\n-Compute per-dimension indices for geometry types.\n-Definition typeindex.hh:25\n-Dune::LocalGeometryTypeIndex::size\n-static constexpr std::size_t size(std::size_t dim)\n-Compute total number of geometry types for the given dimension.\n-Definition typeindex.hh:61\n-Dune::LocalGeometryTypeIndex::type\n-static constexpr GeometryType type(std::size_t dim, std::size_t index)\n-compute the geometry type for the given local index and dimension\n-Definition typeindex.hh:79\n-Dune::LocalGeometryTypeIndex::index\n-static constexpr std::size_t index(const GeometryType >)\n-Compute the index for the given geometry type within its dimension.\n-Definition typeindex.hh:73\n-Dune::GlobalGeometryTypeIndex\n-Compute indices for geometry types, taking the dimension into account.\n-Definition typeindex.hh:90\n-Dune::GlobalGeometryTypeIndex::index\n-static constexpr std::size_t index(const GeometryType >)\n-Compute the index for the given geometry type over all dimensions.\n-Definition typeindex.hh:138\n-Dune::GlobalGeometryTypeIndex::offset\n-static constexpr std::size_t offset(std::size_t dim)\n-Compute the starting index for a given dimension including irregular geometry\n-types.\n-Definition typeindex.hh:113\n-Dune::GlobalGeometryTypeIndex::size\n-static constexpr std::size_t size(std::size_t maxdim)\n-Compute total number of geometry types up to and including the given dimension.\n-Definition typeindex.hh:125\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00239.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00239.html", "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-geometry: quadraturerules.hh File Reference\n+dune-geometry: referenceelementimplementation.cc File Reference\n \n \n \n \n \n \n \n@@ -70,120 +70,28 @@\n
    \n \n
    \n \n
    \n \n-
    quadraturerules.hh File Reference
    \n+Namespaces
    \n+
    referenceelementimplementation.cc File Reference
    \n \n
    \n-
    #include <algorithm>
    \n-#include <iostream>
    \n-#include <limits>
    \n-#include <mutex>
    \n-#include <utility>
    \n-#include <vector>
    \n-#include <dune/common/fvector.hh>
    \n-#include <dune/common/exceptions.hh>
    \n-#include <dune/common/stdstreams.hh>
    \n-#include <dune/common/stdthread.hh>
    \n-#include <dune/common/visibility.hh>
    \n-#include <dune/geometry/type.hh>
    \n-#include <dune/geometry/typeindex.hh>
    \n-#include "quadraturerules/pointquadrature.hh"
    \n-#include "quadraturerules/gausslobattoquadrature.hh"
    \n-#include "quadraturerules/gaussquadrature.hh"
    \n-#include "quadraturerules/gaussradauleftquadrature.hh"
    \n-#include "quadraturerules/gaussradaurightquadrature.hh"
    \n-#include "quadraturerules/jacobi1quadrature.hh"
    \n-#include "quadraturerules/jacobi2quadrature.hh"
    \n-#include "quadraturerules/jacobiNquadrature.hh"
    \n-#include "quadraturerules/prismquadrature.hh"
    \n-#include "quadraturerules/simplexquadrature.hh"
    \n-#include "quadraturerules/tensorproductquadrature.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-Classes

    class  Dune::QuadratureOrderOutOfRange
     Exception thrown if a desired QuadratureRule is not available, because the requested order is to high. More...
     
    class  Dune::QuadraturePoint< ct, dim >
     Single evaluation point in a quadrature rule. More...
     
    class  Dune::QuadratureRule< ct, dim >
     Abstract base class for quadrature rules. More...
     
    class  Dune::QuadratureRules< ctype, dim >
     A container for all quadrature rules of dimension dim More...
     
    class  Dune::QuadratureRuleFactory< ctype, dim >
     Factory class for creation of quadrature rules, depending on GeometryType, order and QuadratureType. More...
     
    class  Dune::QuadratureRuleFactory< ctype, 0 >
     
    class  Dune::QuadratureRuleFactory< ctype, 1 >
     
    class  Dune::QuadratureRuleFactory< ctype, 2 >
     
    class  Dune::QuadratureRuleFactory< ctype, 3 >
     
    \n+
    #include <config.h>
    \n+#include <dune/geometry/referenceelementimplementation.hh>
    \n+
    \n \n \n \n-\n-\n+\n \n-

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::QuadratureType
     Defines an enum for currently available quadrature rules.
    namespace  Dune::Geo
     
    \n-\n-\n-\n-

    \n-Macros

    #define DUNE_INCLUDING_IMPLEMENTATION
     
    \n-\n-\n-\n

    \n-Enumerations

    enum  Dune::QuadratureType::Enum {
    \n-  Dune::QuadratureType::GaussLegendre = 0\n-, Dune::QuadratureType::GaussJacobi_1_0 = 1\n-, Dune::QuadratureType::GaussJacobi_2_0 = 2\n-, Dune::QuadratureType::GaussJacobi_n_0 = 3\n-,
    \n-  Dune::QuadratureType::GaussLobatto = 4\n-, Dune::QuadratureType::GaussRadauLeft = 5\n-, Dune::QuadratureType::GaussRadauRight = 6\n-, Dune::QuadratureType::size\n-
    \n- }
     
    \n-

    Detailed Description

    \n-

    Interface for quadrature points and rules

    \n-

    Macro Definition Documentation

    \n-\n-

    ◆ DUNE_INCLUDING_IMPLEMENTATION

    \n-\n-
    \n-
    \n- \n- \n- \n- \n-
    #define DUNE_INCLUDING_IMPLEMENTATION
    \n-
    \n-\n-
    \n-
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -6,87 +6,19 @@\n dune-geometry\u00a02.9.0\n \n Loading...\n Searching...\n No Matches\n * dune\n * geometry\n-Classes | Namespaces | Macros | Enumerations\n-quadraturerules.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 \"quadraturerules/pointquadrature.hh\"\n-#include \"quadraturerules/gausslobattoquadrature.hh\"\n-#include \"quadraturerules/gaussquadrature.hh\"\n-#include \"quadraturerules/gaussradauleftquadrature.hh\"\n-#include \"quadraturerules/gaussradaurightquadrature.hh\"\n-#include \"quadraturerules/jacobi1quadrature.hh\"\n-#include \"quadraturerules/jacobi2quadrature.hh\"\n-#include \"quadraturerules/jacobiNquadrature.hh\"\n-#include \"quadraturerules/prismquadrature.hh\"\n-#include \"quadraturerules/simplexquadrature.hh\"\n-#include \"quadraturerules/tensorproductquadrature.hh\"\n-Go_to_the_source_code_of_this_file.\n- Classes\n-class \u00a0Dune::QuadratureOrderOutOfRange\n-\u00a0 Exception thrown if a desired QuadratureRule is not available, because\n- the requested order is to high. More...\n-\u00a0\n-class \u00a0Dune::QuadraturePoint<_ct,_dim_>\n-\u00a0 Single evaluation point in a quadrature rule. More...\n-\u00a0\n-class \u00a0Dune::QuadratureRule<_ct,_dim_>\n-\u00a0 Abstract base class for quadrature rules. More...\n-\u00a0\n-class \u00a0Dune::QuadratureRules<_ctype,_dim_>\n-\u00a0 A container for all quadrature rules of dimension dim More...\n-\u00a0\n-class \u00a0Dune::QuadratureRuleFactory<_ctype,_dim_>\n-\u00a0 Factory class for creation of quadrature rules, depending on\n- GeometryType, order and QuadratureType. More...\n-\u00a0\n-class \u00a0Dune::QuadratureRuleFactory<_ctype,_0_>\n-\u00a0\n-class \u00a0Dune::QuadratureRuleFactory<_ctype,_1_>\n-\u00a0\n-class \u00a0Dune::QuadratureRuleFactory<_ctype,_2_>\n-\u00a0\n-class \u00a0Dune::QuadratureRuleFactory<_ctype,_3_>\n-\u00a0\n+Namespaces\n+referenceelementimplementation.cc File Reference\n+#include \n+#include \n Namespaces\n namespace \u00a0Dune\n \u00a0\n-namespace \u00a0Dune::QuadratureType\n-\u00a0 Defines an enum for currently available quadrature rules.\n-\u00a0\n- Macros\n-#define\u00a0DUNE_INCLUDING_IMPLEMENTATION\n-\u00a0\n- Enumerations\n-enum \u00a0Dune::QuadratureType::Enum {\n- \u00a0\u00a0Dune::QuadratureType::GaussLegendre = 0 , Dune::QuadratureType::\n- GaussJacobi_1_0 = 1 , Dune::QuadratureType::GaussJacobi_2_0 = 2 , Dune::\n- QuadratureType::GaussJacobi_n_0 = 3 ,\n- \u00a0\u00a0Dune::QuadratureType::GaussLobatto = 4 , Dune::QuadratureType::\n- GaussRadauLeft = 5 , Dune::QuadratureType::GaussRadauRight = 6 , Dune::\n- QuadratureType::size\n- }\n+namespace \u00a0Dune::Geo\n \u00a0\n-***** Detailed Description *****\n-Interface for quadrature points and rules\n-***** Macro Definition Documentation *****\n-***** \u25c6\u00a0DUNE_INCLUDING_IMPLEMENTATION *****\n-#define DUNE_INCLUDING_IMPLEMENTATION\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.8\n"}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00251.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00251.html", "unified_diff": "@@ -204,15 +204,15 @@\n
    GeometryTypes::cube(2), 2>
    \n
    {
    \n
    typedef SquaringTheCircle::RefinementImp<CoordType> Imp;
    \n
    };
    \n
    }
    \n
    This namespace contains the implementation of Refinement.
    Definition base.cc:29
    \n If you implement a template class, you have to specialise struct RefinementImp::Traits for every possible combination of topologyId and coerceToId that your implementation supports.\n-
  • #include \"refinement/squaringthecircle.cc\" from refinement.hh.
  • \n+
  • #include \"refinement/squaringthecircle.cc\" from refinement.hh.
  • \n \n

    This is enough to integrate your implementation into the Refinement system. You probably want to include it into VirtualRefinement also.

    \n

    \n Namespaces

    \n

    Function Documentation

    \n \n

    ◆ refinementIntervals()

    \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00254.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00254.html", "unified_diff": "@@ -397,16 +397,16 @@\n )\n \n \n \n
    \n \n

    Algorithm to reduce vertex order information.

    \n-
    \n-\n+
    Parameters
    \n \n \n \n \n
    inBeginStart of the range of ids to reduce.
    inEndEnd of the range of ids to reduce.
    outItStart of the sequence where to store the result.
    \n
    \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01083.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01083.html", "unified_diff": "@@ -82,15 +82,15 @@\n
    Dune::Geo::ReferenceElement< Implementation > Class Template Reference
    \n
    \n
    \n \n

    This class provides access to geometric and topological properties of a reference element. \n More...

    \n \n-

    #include <dune/geometry/referenceelement.hh>

    \n+

    #include <dune/geometry/referenceelement.hh>

    \n
    \n Inheritance diagram for Dune::Geo::ReferenceElement< Implementation >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -887,16 +887,16 @@\n
    \n \n

    The dimension of the reference element.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following files:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01087.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01087.html", "unified_diff": "@@ -83,15 +83,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01091.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01091.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::Geo::ReferenceElements< ctype_, dim > Struct Template Reference
    \n \n
    \n \n

    Class providing access to the singletons of the reference elements. \n More...

    \n \n-

    #include <dune/geometry/referenceelements.hh>

    \n+

    #include <dune/geometry/referenceelements.hh>

    \n \n \n \n \n \n \n@@ -389,16 +389,16 @@\n
    \n \n

    The dimension of the contained reference elements.

    \n \n
    \n \n
    The documentation for this struct was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01099.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01099.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::AffineGeometry< ct, mydim, cdim > Class Template Reference
    \n \n
    \n \n

    Implementation of the Geometry interface for affine geometries. \n More...

    \n \n-

    #include <dune/geometry/affinegeometry.hh>

    \n+

    #include <dune/geometry/affinegeometry.hh>

    \n

    \n Public Types

    using ctype = ctype_
     The coordinate field type of the contained reference elements.
     
    using CoordinateField = ctype
    \n \n \n \n \n \n@@ -995,15 +995,15 @@\n
    \n \n

    Dimension of the geometry.

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01103.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01103.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::AxisAlignedCubeGeometry< CoordType, dim, coorddim > Class Template Reference
    \n \n
    \n \n

    A geometry implementation for axis-aligned hypercubes. \n More...

    \n \n-

    #include <dune/geometry/axisalignedcubegeometry.hh>

    \n+

    #include <dune/geometry/axisalignedcubegeometry.hh>

    \n

    \n Public Types

    typedef ct ctype
     Type used for coordinates.
     
    typedef FieldVector< ctype, mydimensionLocalCoordinate
    \n \n \n \n \n \n@@ -900,15 +900,15 @@\n
    \n \n

    Dimension of the cube element.

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01159.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01159.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::Dim< dim > Struct Template Reference
    \n \n
    \n \n

    Static tag representing a dimension. \n More...

    \n \n-

    #include <dune/geometry/dimension.hh>

    \n+

    #include <dune/geometry/dimension.hh>

    \n
    \n Inheritance diagram for Dune::Dim< dim >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -117,15 +117,15 @@\n \n

    \n Public Types

    typedef CoordType ctype
     Type used for single coordinate coefficients.
     
    typedef FieldVector< ctype, dim > LocalCoordinate
    \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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01163.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01163.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::Codim< codim > Struct Template Reference
    \n \n
    \n \n

    Static tag representing a codimension. \n More...

    \n \n-

    #include <dune/geometry/dimension.hh>

    \n+

    #include <dune/geometry/dimension.hh>

    \n
    \n Inheritance diagram for Dune::Codim< codim >:
    \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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01167.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01167.html", "unified_diff": "@@ -82,15 +82,15 @@\n
    Dune::GeneralVertexOrder< dim, Index_ > Class Template Reference
    \n \n
    \n \n

    Class providing information on the ordering of vertices. \n More...

    \n \n-

    #include <dune/geometry/generalvertexorder.hh>

    \n+

    #include <dune/geometry/generalvertexorder.hh>

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

    \n Classes

    class  iterator
     Iterate over the vertex indices of some sub-entity. More...
     
    \n@@ -417,15 +417,15 @@\n
    \n \n

    export the dimension of the entity we provide information for

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01171.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01171.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::GeneralVertexOrder< dim, Index_ >::iterator Class Reference
    \n \n
    \n \n

    Iterate over the vertex indices of some sub-entity. \n More...

    \n \n-

    #include <dune/geometry/generalvertexorder.hh>

    \n+

    #include <dune/geometry/generalvertexorder.hh>

    \n
    \n Inheritance diagram for Dune::GeneralVertexOrder< dim, Index_ >::iterator:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -341,15 +341,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01175.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01175.html", "unified_diff": "@@ -81,15 +81,15 @@\n
    Dune::MultiLinearGeometryTraits< ct > Struct Template Reference
    \n \n
    \n \n

    default traits class for MultiLinearGeometry \n More...

    \n \n-

    #include <dune/geometry/multilineargeometry.hh>

    \n+

    #include <dune/geometry/multilineargeometry.hh>

    \n \n \n \n \n \n \n@@ -176,15 +176,15 @@\n
    \n \n

    tolerance to numerical algorithms

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01179.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01179.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::MultiLinearGeometryTraits< ct >::CornerStorage< mydim, cdim > Struct Template Reference
    \n \n
    \n \n

    template specifying the storage for the corners \n More...

    \n \n-

    #include <dune/geometry/multilineargeometry.hh>

    \n+

    #include <dune/geometry/multilineargeometry.hh>

    \n

    \n Classes

    struct  CornerStorage
     template specifying the storage for the corners More...
     
    struct  hasSingleGeometryType
    \n \n \n \n

    \n Public Types

    typedef std::vector< FieldVector< ct, cdim > > Type
     
    \n

    Detailed Description

    \n@@ -143,15 +143,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01183.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01183.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::MultiLinearGeometryTraits< ct >::hasSingleGeometryType< dim > Struct Template Reference
    \n \n
    \n \n

    will there be only one geometry type for a dimension? \n More...

    \n \n-

    #include <dune/geometry/multilineargeometry.hh>

    \n+

    #include <dune/geometry/multilineargeometry.hh>

    \n \n \n \n \n \n \n@@ -149,15 +149,15 @@\n \n

    \n Static Public Attributes

    static const bool v = false
     
    static const unsigned int topologyId = ~0u
     
    \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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01187.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01187.html", "unified_diff": "@@ -85,15 +85,15 @@\n
    Dune::MultiLinearGeometry< ct, mydim, cdim, Traits > Class Template Reference
    \n \n
    \n \n

    generic geometry implementation based on corner coordinates \n More...

    \n \n-

    #include <dune/geometry/multilineargeometry.hh>

    \n+

    #include <dune/geometry/multilineargeometry.hh>

    \n
    \n Inheritance diagram for Dune::MultiLinearGeometry< ct, mydim, cdim, Traits >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -1521,15 +1521,15 @@\n
    \n \n

    geometry 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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01191.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01191.html", "unified_diff": "@@ -76,15 +76,15 @@\n \n
    Dune::MultiLinearGeometry< ct, mydim, cdim, Traits >::JacobianInverseTransposed Class Reference
    \n \n
    \n \n-

    #include <dune/geometry/multilineargeometry.hh>

    \n+

    #include <dune/geometry/multilineargeometry.hh>

    \n
    \n Inheritance diagram for Dune::MultiLinearGeometry< ct, mydim, cdim, Traits >::JacobianInverseTransposed:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -211,15 +211,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01195.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01195.html", "unified_diff": "@@ -84,15 +84,15 @@\n
    Dune::CachedMultiLinearGeometry< ct, mydim, cdim, Traits > Class Template Reference
    \n \n
    \n \n

    Implement a MultiLinearGeometry with additional caching. \n More...

    \n \n-

    #include <dune/geometry/multilineargeometry.hh>

    \n+

    #include <dune/geometry/multilineargeometry.hh>

    \n
    \n Inheritance diagram for Dune::CachedMultiLinearGeometry< ct, mydim, cdim, Traits >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -1479,15 +1479,15 @@\n
    \n \n

    geometry 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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01199.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01199.html", "unified_diff": "@@ -76,29 +76,29 @@\n
    Dune::QuadratureOrderOutOfRange Class Reference
    \n \n
    \n \n

    Exception thrown if a desired QuadratureRule is not available, because the requested order is to high. \n More...

    \n \n-

    #include <dune/geometry/quadraturerules.hh>

    \n+

    #include <dune/geometry/quadraturerules.hh>

    \n
    \n Inheritance diagram for Dune::QuadratureOrderOutOfRange:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n \"\"\n \n
    \n

    Detailed Description

    \n

    Exception thrown if a desired QuadratureRule is not available, because the requested order is to high.

    \n

    The documentation for this class was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01203.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01203.html", "unified_diff": "@@ -82,15 +82,15 @@\n
    Dune::QuadraturePoint< ct, dim > Class Template Reference
    \n \n
    \n \n

    Single evaluation point in a quadrature rule. \n More...

    \n \n-

    #include <dune/geometry/quadraturerules.hh>

    \n+

    #include <dune/geometry/quadraturerules.hh>

    \n \n \n \n \n \n \n@@ -341,15 +341,15 @@\n \n

    \n Public Types

    typedef ct Field
     Number type used for coordinates and quadrature weights.
     
    typedef Dune::FieldVector< ct, dim > Vector
    \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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01207.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01207.html", "unified_diff": "@@ -84,15 +84,15 @@\n
    Dune::QuadratureRule< ct, dim > Class Template Reference
    \n \n
    \n \n

    Abstract base class for quadrature rules. \n More...

    \n \n-

    #include <dune/geometry/quadraturerules.hh>

    \n+

    #include <dune/geometry/quadraturerules.hh>

    \n
    \n Inheritance diagram for Dune::QuadratureRule< ct, dim >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -474,15 +474,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01211.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01211.html", "unified_diff": "@@ -78,21 +78,21 @@\n
    Dune::QuadratureRuleFactory< ctype, dim > Class Template Reference
    \n \n
    \n \n

    Factory class for creation of quadrature rules, depending on GeometryType, order and QuadratureType. \n More...

    \n \n-

    #include <dune/geometry/quadraturerules.hh>

    \n+

    #include <dune/geometry/quadraturerules.hh>

    \n

    Detailed Description

    \n
    template<typename ctype, int dim>
    \n class Dune::QuadratureRuleFactory< ctype, dim >

    Factory class for creation of quadrature rules, depending on GeometryType, order and QuadratureType.

    \n

    The whole class is private and can only be accessed by the singleton container class QuadratureRules.

    \n

    The documentation for this class was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01215.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01215.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::QuadratureRules< ctype, dim > Class Template Reference
    \n \n
    \n \n

    A container for all quadrature rules of dimension dim \n More...

    \n \n-

    #include <dune/geometry/quadraturerules.hh>

    \n+

    #include <dune/geometry/quadraturerules.hh>

    \n \n \n \n \n \n \n@@ -230,15 +230,15 @@\n
    \n \n

    select the appropriate QuadratureRule for GeometryType t and order p

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01219.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01219.html", "unified_diff": "@@ -75,17 +75,17 @@\n
    \n \n
    Dune::QuadratureRuleFactory< ctype, 0 > Class Template Reference
    \n
    \n
    \n \n-

    #include <dune/geometry/quadraturerules.hh>

    \n+

    #include <dune/geometry/quadraturerules.hh>

    \n
    The documentation for this class was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01223.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01223.html", "unified_diff": "@@ -75,17 +75,17 @@\n
    \n \n
    Dune::QuadratureRuleFactory< ctype, 1 > Class Template Reference
    \n
    \n
    \n \n-

    #include <dune/geometry/quadraturerules.hh>

    \n+

    #include <dune/geometry/quadraturerules.hh>

    \n
    The documentation for this class was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01227.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01227.html", "unified_diff": "@@ -75,17 +75,17 @@\n
    \n \n
    Dune::QuadratureRuleFactory< ctype, 2 > Class Template Reference
    \n
    \n
    \n \n-

    #include <dune/geometry/quadraturerules.hh>

    \n+

    #include <dune/geometry/quadraturerules.hh>

    \n
    The documentation for this class was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01231.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01231.html", "unified_diff": "@@ -75,17 +75,17 @@\n
    \n \n
    Dune::QuadratureRuleFactory< ctype, 3 > Class Template Reference
    \n
    \n
    \n \n-

    #include <dune/geometry/quadraturerules.hh>

    \n+

    #include <dune/geometry/quadraturerules.hh>

    \n
    The documentation for this class was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01239.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01239.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::Geo::ReferenceElement< Implementation >::Codim< codim > Struct Template Reference
    \n \n
    \n \n

    Collection of types depending on the codimension. \n More...

    \n \n-

    #include <dune/geometry/referenceelement.hh>

    \n+

    #include <dune/geometry/referenceelement.hh>

    \n

    \n Static Public Member Functions

    static unsigned maxOrder (const GeometryType &t, QuadratureType::Enum qt=QuadratureType::GaussLegendre)
     maximum quadrature order for given geometry type and quadrature type
     
    static const QuadratureRulerule (const GeometryType &t, int p, QuadratureType::Enum qt=QuadratureType::GaussLegendre)
    \n \n \n \n \n

    \n Public Types

    using Geometry = implementation-defined
     type of geometry embedding a subentity into the reference element
     
    \n@@ -113,15 +113,15 @@\n
    \n \n

    type of geometry embedding a subentity into the reference element

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01243.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01243.html", "unified_diff": "@@ -96,15 +96,15 @@\n

    Each specialisation should contain a single member typedef Imp, e.g.:

    template<class CoordType>
    \n
    struct Traits<sphereTopologyId, CoordType, Impl::CubeToplogy<2>::id, 2>
    \n
    {
    \n
    typedef SquaringTheCircle::Refinement Imp;
    \n
    };
    \n
    Mapping from geometryType, CoordType and coerceTo to a particular Refinement implementation.
    Definition base.cc:70
    \n

    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01247.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01247.html", "unified_diff": "@@ -143,15 +143,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01251.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01251.html", "unified_diff": "@@ -461,15 +461,15 @@\n \n

    The IndexVector of the Refinement.

    \n

    This is always a typedef to a FieldVector

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

    The SubEntityIterator for each codim.

    \n

    This is some sort of type, not necessarily a typedef

    \n \n \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01331.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01331.html", "unified_diff": "@@ -83,15 +83,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01335.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01335.html", "unified_diff": "@@ -402,15 +402,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01339.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01339.html", "unified_diff": "@@ -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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01343.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01343.html", "unified_diff": "@@ -452,15 +452,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01347.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01347.html", "unified_diff": "@@ -491,15 +491,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01351.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01351.html", "unified_diff": "@@ -196,15 +196,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01355.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01355.html", "unified_diff": "@@ -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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01359.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01359.html", "unified_diff": "@@ -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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01363.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01363.html", "unified_diff": "@@ -83,15 +83,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01367.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01367.html", "unified_diff": "@@ -384,15 +384,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01371.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01371.html", "unified_diff": "@@ -503,15 +503,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01375.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01375.html", "unified_diff": "@@ -152,15 +152,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01403.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01403.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::LocalGeometryTypeIndex Class Reference
    \n \n
    \n \n

    Compute per-dimension indices for geometry types. \n More...

    \n \n-

    #include <dune/geometry/typeindex.hh>

    \n+

    #include <dune/geometry/typeindex.hh>

    \n \n \n \n \n \n \n@@ -193,15 +193,15 @@\n
    \n \n

    compute the geometry type for the given local index and 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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01407.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01407.html", "unified_diff": "@@ -79,15 +79,15 @@\n
    Dune::GlobalGeometryTypeIndex Class Reference
    \n \n
    \n \n

    Compute indices for geometry types, taking the dimension into account. \n More...

    \n \n-

    #include <dune/geometry/typeindex.hh>

    \n+

    #include <dune/geometry/typeindex.hh>

    \n

    \n Static Public Member Functions

    static constexpr std::size_t size (std::size_t dim)
     Compute total number of geometry types for the given dimension.
     
    static constexpr std::size_t index (const GeometryType &gt)
    \n \n \n \n \n \n@@ -183,15 +183,15 @@\n \n

    Compute total number of geometry types up to and including the given dimension.

    \n

    This includes irregular geometry types such as \"None\".

    \n \n \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01411.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01411.html", "unified_diff": "@@ -83,15 +83,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01415.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01415.html", "unified_diff": "@@ -73,15 +73,15 @@\n \n \n
    \n
    Dune::VirtualRefinementSubEntityIteratorSpecial< dimension, CoordType, dimension > 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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01419.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01419.html", "unified_diff": "@@ -161,15 +161,15 @@\n \n

    \n Static Public Member Functions

    static constexpr std::size_t offset (std::size_t dim)
     Compute the starting index for a given dimension including irregular geometry types.
     
    static constexpr std::size_t size (std::size_t maxdim)
    \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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01423.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01423.html", "unified_diff": "@@ -367,15 +367,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01427.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01427.html", "unified_diff": "@@ -83,15 +83,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01431.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01431.html", "unified_diff": "@@ -110,15 +110,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01435.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01435.html", "unified_diff": "@@ -181,15 +181,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01439.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01439.html", "unified_diff": "@@ -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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01443.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01443.html", "unified_diff": "@@ -579,15 +579,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01447.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01447.html", "unified_diff": "@@ -341,15 +341,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01451.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01451.html", "unified_diff": "@@ -83,15 +83,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01455.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01455.html", "unified_diff": "@@ -83,15 +83,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01459.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01459.html", "unified_diff": "@@ -207,15 +207,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01463.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01463.html", "unified_diff": "@@ -121,15 +121,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01467.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01467.html", "unified_diff": "@@ -121,15 +121,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01471.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01471.html", "unified_diff": "@@ -121,15 +121,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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01475.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01475.html", "unified_diff": "@@ -82,15 +82,15 @@\n
    Dune::VirtualRefinement< dimension, CoordType > Class Template Referenceabstract
    \n \n
    \n \n

    VirtualRefinement base class. \n More...

    \n \n-

    #include <dune/geometry/virtualrefinement.hh>

    \n+

    #include <dune/geometry/virtualrefinement.hh>

    \n
    \n Inheritance diagram for Dune::VirtualRefinement< dimension, CoordType >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -607,16 +607,16 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a01479.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a01479.html", "unified_diff": "@@ -76,21 +76,21 @@\n
    Dune::VirtualRefinement< dimension, CoordType >::Codim< codimension > Struct Template Reference
    \n \n
    \n \n

    codim database of VirtualRefinement \n More...

    \n \n-

    #include <dune/geometry/virtualrefinement.hh>

    \n+

    #include <dune/geometry/virtualrefinement.hh>

    \n

    Detailed Description

    \n
    template<int dimension, class CoordType>
    \n template<int codimension>
    \n struct Dune::VirtualRefinement< dimension, CoordType >::Codim< codimension >

    codim database of VirtualRefinement

    \n

    The documentation for this struct was generated from the following file:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/dir_000004_000006.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/dir_000004_000006.html", "unified_diff": "@@ -69,14 +69,14 @@\n \n
    \n \n
    \n \n \n+

    geometry → refinement Relation

    File in dune/geometryIncludes file in dune/geometry/refinement
    refinement.hhbase.cc
    refinement.hhhcube.cc
    refinement.hhhcubetriangulation.cc
    refinement.hhprismtriangulation.cc
    refinement.hhpyramidtriangulation.cc
    refinement.hhsimplex.cc
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/dir_18620fa9f137864b479f21357cfac10d.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/dir_18620fa9f137864b479f21357cfac10d.html", "unified_diff": "@@ -95,54 +95,54 @@\n  refinement\n  \n  utility\n  \n \n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n-\n+\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

     affinegeometry.hh
     An implementation of the Geometry interface for affine geometries.
     affinegeometry.hh
     An implementation of the Geometry interface for affine geometries.
     
     axisalignedcubegeometry.hh
     A geometry implementation for axis-aligned hypercubes.
     axisalignedcubegeometry.hh
     A geometry implementation for axis-aligned hypercubes.
     
     deprecated_topology.hh
     deprecated_topology.hh
     
     dimension.hh
     dimension.hh
     
     generalvertexorder.hh
     generalvertexorder.hh
     
     multilineargeometry.hh
     multilineargeometry.hh
     
     quadraturerules.hh
     quadraturerules.hh
     
     referenceelement.hh
     referenceelement.hh
     
     referenceelementimplementation.cc
     referenceelementimplementation.cc
     
     referenceelementimplementation.hh
     referenceelementimplementation.hh
     
     referenceelements.hh
     referenceelements.hh
     
     refinement.hh
     This file simply includes all Refinement implementations so you don't have to do them separately.
     refinement.hh
     This file simply includes all Refinement implementations so you don't have to do them separately.
     
     topologyfactory.hh
     
     type.hh
     A unique label for each type of element that can occur in a grid.
     
     typeindex.hh
     Helper classes to provide indices for geometrytypes for use in a vector.
     typeindex.hh
     Helper classes to provide indices for geometrytypes for use in a vector.
     
     virtualrefinement.cc
     This file contains the virtual wrapper around refinement.
     virtualrefinement.cc
     This file contains the virtual wrapper around refinement.
     
     virtualrefinement.hh
     This file contains the virtual wrapper around refinement.
     virtualrefinement.hh
     This file contains the virtual wrapper around refinement.
     
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/dir_428ed1c935e77406fcbfdccd4ee3f7a2.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/dir_428ed1c935e77406fcbfdccd4ee3f7a2.html", "unified_diff": "@@ -84,15 +84,15 @@\n \"\"\n \"\"\n \n \n \n \n-\n+\n \n

    \n Files

     typefromvertexcount.hh
     typefromvertexcount.hh
     
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/dir_b609f53bbb5e26b8e9292001c59476a3.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/dir_b609f53bbb5e26b8e9292001c59476a3.html", "unified_diff": "@@ -84,29 +84,29 @@\n \"\"\n \"\"\n \n \n \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

     base.cc
     This file contains the parts independent of a particular Refinement implementation.
     base.cc
     This file contains the parts independent of a particular Refinement implementation.
     
     hcube.cc
     This file contains the Refinement implementation for hypercubes (quadrilaterals, hexahedrons, etc.).
     
     hcubetriangulation.cc
     This file contains the Refinement implementation for triangulating hypercubes (quadrilateral -> triangle, hexahedron -> tetrahedron)
     
     prismtriangulation.cc
     
     pyramidtriangulation.cc
     pyramidtriangulation.cc
     
     simplex.cc
     This file contains the Refinement implementation for simplices (triangles, tetrahedrons...)
     simplex.cc
     This file contains the Refinement implementation for simplices (triangles, tetrahedrons...)
     
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/dune-geometry.tag.gz", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/dune-geometry.tag.gz", "unified_diff": null, "details": [{"source1": "dune-geometry.tag", "source2": "dune-geometry.tag", "unified_diff": null, "details": [{"source1": "dune-geometry.tag", "source2": "dune-geometry.tag", "unified_diff": "@@ -1,183 +1,183 @@\n \n \n \n referenceelementspage.txt\n /build/reproducible-path/dune-geometry-2.9.0/doc/appl/refelements/\n- a00107.html\n+ a00110.html\n \n \n mainpage.txt\n /build/reproducible-path/dune-geometry-2.9.0/doc/doxygen/\n a00164.html\n \n \n modules.txt\n /build/reproducible-path/dune-geometry-2.9.0/doc/doxygen/\n a00167.html\n \n \n affinegeometry.hh\n /build/reproducible-path/dune-geometry-2.9.0/dune/geometry/\n- a00203.html\n+ a00185.html\n dune/geometry/type.hh\n Dune::AffineGeometry\n Dune\n Dune::Geo\n \n \n axisalignedcubegeometry.hh\n /build/reproducible-path/dune-geometry-2.9.0/dune/geometry/\n- a00200.html\n- dune/geometry/referenceelements.hh\n+ a00176.html\n+ dune/geometry/referenceelements.hh\n dune/geometry/type.hh\n Dune::AxisAlignedCubeGeometry\n Dune\n \n \n deprecated_topology.hh\n /build/reproducible-path/dune-geometry-2.9.0/dune/geometry/\n- a00176.html\n+ a00230.html\n \n \n dimension.hh\n /build/reproducible-path/dune-geometry-2.9.0/dune/geometry/\n- a00212.html\n+ a00173.html\n Dune::Dim\n Dune::Codim\n Dune\n \n \n generalvertexorder.hh\n /build/reproducible-path/dune-geometry-2.9.0/dune/geometry/\n- a00194.html\n+ a00182.html\n type.hh\n- dune/geometry/referenceelements.hh\n+ dune/geometry/referenceelements.hh\n Dune::GeneralVertexOrder\n Dune::GeneralVertexOrder::iterator\n Dune\n \n \n multilineargeometry.hh\n /build/reproducible-path/dune-geometry-2.9.0/dune/geometry/\n- a00170.html\n- dune/geometry/affinegeometry.hh\n- dune/geometry/referenceelements.hh\n+ a00179.html\n+ dune/geometry/affinegeometry.hh\n+ dune/geometry/referenceelements.hh\n dune/geometry/type.hh\n Dune::MultiLinearGeometryTraits\n Dune::MultiLinearGeometryTraits::CornerStorage\n Dune::MultiLinearGeometryTraits::hasSingleGeometryType\n Dune::MultiLinearGeometry\n Dune::MultiLinearGeometry::JacobianInverseTransposed\n Dune::CachedMultiLinearGeometry\n Dune\n \n \n quadraturerules.hh\n /build/reproducible-path/dune-geometry-2.9.0/dune/geometry/\n- a00239.html\n+ a00191.html\n dune/geometry/type.hh\n- dune/geometry/typeindex.hh\n+ dune/geometry/typeindex.hh\n Dune::QuadratureOrderOutOfRange\n Dune::QuadraturePoint\n Dune::QuadratureRule\n Dune::QuadratureRules\n Dune::QuadratureRuleFactory\n Dune::QuadratureRuleFactory< ctype, 0 >\n Dune::QuadratureRuleFactory< ctype, 1 >\n Dune::QuadratureRuleFactory< ctype, 2 >\n Dune::QuadratureRuleFactory< ctype, 3 >\n Dune\n Dune::QuadratureType\n \n #define\n DUNE_INCLUDING_IMPLEMENTATION\n- a00239.html\n+ a00191.html\n a0aeda817d7161b7c1afd8dd15ff12f17\n \n \n \n \n referenceelement.hh\n /build/reproducible-path/dune-geometry-2.9.0/dune/geometry/\n- a00191.html\n+ a00227.html\n dune/geometry/type.hh\n Dune::Geo::ReferenceElement\n Dune::Geo::ReferenceElement::Codim\n Dune\n Dune::Geo\n \n \n referenceelementimplementation.cc\n /build/reproducible-path/dune-geometry-2.9.0/dune/geometry/\n- a00185.html\n- dune/geometry/referenceelementimplementation.hh\n+ a00239.html\n+ dune/geometry/referenceelementimplementation.hh\n Dune\n Dune::Geo\n \n \n referenceelementimplementation.hh\n /build/reproducible-path/dune-geometry-2.9.0/dune/geometry/\n- a00209.html\n- dune/geometry/referenceelement.hh\n- dune/geometry/affinegeometry.hh\n+ a00170.html\n+ dune/geometry/referenceelement.hh\n+ dune/geometry/affinegeometry.hh\n dune/geometry/type.hh\n Dune\n Dune::Geo\n \n \n referenceelements.hh\n /build/reproducible-path/dune-geometry-2.9.0/dune/geometry/\n- a00179.html\n- dune/geometry/dimension.hh\n+ a00203.html\n+ dune/geometry/dimension.hh\n dune/geometry/type.hh\n- dune/geometry/referenceelement.hh\n- dune/geometry/referenceelementimplementation.hh\n+ dune/geometry/referenceelement.hh\n+ dune/geometry/referenceelementimplementation.hh\n Dune::Geo::ReferenceElements\n Dune\n Dune::Geo\n Dune::Transitional\n \n \n refinement.hh\n /build/reproducible-path/dune-geometry-2.9.0/dune/geometry/\n- a00173.html\n- refinement/base.cc\n+ a00233.html\n+ refinement/base.cc\n refinement/hcube.cc\n- refinement/simplex.cc\n+ refinement/simplex.cc\n refinement/hcubetriangulation.cc\n refinement/prismtriangulation.cc\n- refinement/pyramidtriangulation.cc\n+ refinement/pyramidtriangulation.cc\n \n \n base.cc\n /build/reproducible-path/dune-geometry-2.9.0/dune/geometry/refinement/\n- a00227.html\n+ a00209.html\n dune/geometry/type.hh\n Dune::RefinementImp::Traits\n Dune::RefinementIntervals\n Dune::StaticRefinement\n Dune::StaticRefinement::Codim\n Dune\n Dune::RefinementImp\n \n #define\n DUNE_GEOMETRY_REFINEMENT_BASE_CC\n- a00227.html\n+ a00209.html\n ab8232ef779e57c3676c54a73bd759f72\n \n \n \n \n hcube.cc\n /build/reproducible-path/dune-geometry-2.9.0/dune/geometry/refinement/\n a00215.html\n- dune/geometry/referenceelements.hh\n- dune/geometry/axisalignedcubegeometry.hh\n- base.cc\n+ dune/geometry/referenceelements.hh\n+ dune/geometry/axisalignedcubegeometry.hh\n+ base.cc\n Dune::RefinementImp::HCube::RefinementImp\n Dune::RefinementImp::HCube::RefinementImp::Codim\n Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial\n Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial< dimension, CoordType, dimension >\n Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial< dimension, CoordType, 0 >\n Dune::RefinementImp::HCube::RefinementImp::Codim< codimension >\n Dune\n@@ -191,18 +191,18 @@\n \n \n \n \n hcubetriangulation.cc\n /build/reproducible-path/dune-geometry-2.9.0/dune/geometry/refinement/\n a00224.html\n- dune/geometry/referenceelements.hh\n+ dune/geometry/referenceelements.hh\n dune/geometry/type.hh\n- base.cc\n- simplex.cc\n+ base.cc\n+ simplex.cc\n Dune::RefinementImp::HCubeTriangulation::RefinementImp\n Dune::RefinementImp::HCubeTriangulation::RefinementImp::Codim\n Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial< dimension, CoordType, dimension >\n Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial< dimension, CoordType, 0 >\n Dune::RefinementImp::HCubeTriangulation::RefinementImp::Codim< codimension >\n Dune\n Dune::RefinementImp\n@@ -215,18 +215,18 @@\n \n \n \n \n prismtriangulation.cc\n /build/reproducible-path/dune-geometry-2.9.0/dune/geometry/refinement/\n a00221.html\n- dune/geometry/referenceelements.hh\n+ dune/geometry/referenceelements.hh\n dune/geometry/type.hh\n- base.cc\n- simplex.cc\n+ base.cc\n+ simplex.cc\n Dune::RefinementImp::PrismTriangulation::RefinementImp\n Dune::RefinementImp::PrismTriangulation::RefinementImp::Codim\n Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial< dimension, CoordType, dimension >\n Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial< dimension, CoordType, 0 >\n Dune::RefinementImp::PrismTriangulation::RefinementImp::Codim< codimension >\n Dune\n Dune::RefinementImp\n@@ -238,55 +238,55 @@\n ae56eb72b98f97f57cc224eb9b4394ef8\n \n \n \n \n pyramidtriangulation.cc\n /build/reproducible-path/dune-geometry-2.9.0/dune/geometry/refinement/\n- a00218.html\n- dune/geometry/referenceelements.hh\n+ a00212.html\n+ dune/geometry/referenceelements.hh\n dune/geometry/type.hh\n- base.cc\n- simplex.cc\n+ base.cc\n+ simplex.cc\n Dune::RefinementImp::PyramidTriangulation::RefinementImp\n Dune::RefinementImp::PyramidTriangulation::RefinementImp::Codim\n Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< dimension, CoordType, dimension >\n Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< dimension, CoordType, 0 >\n Dune::RefinementImp::PyramidTriangulation::RefinementImp::Codim< codimension >\n Dune\n Dune::RefinementImp\n Dune::RefinementImp::PyramidTriangulation\n \n #define\n DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC\n- a00218.html\n+ a00212.html\n a5f431ee98541c17b3d9aea2dbc726941\n \n \n \n \n simplex.cc\n /build/reproducible-path/dune-geometry-2.9.0/dune/geometry/refinement/\n- a00230.html\n- dune/geometry/multilineargeometry.hh\n- dune/geometry/referenceelements.hh\n+ a00218.html\n+ dune/geometry/multilineargeometry.hh\n+ dune/geometry/referenceelements.hh\n dune/geometry/type.hh\n- base.cc\n+ base.cc\n Dune::RefinementImp::Simplex::RefinementImp\n Dune::RefinementImp::Simplex::RefinementImp::Codim\n Dune::RefinementImp::Simplex::RefinementIteratorSpecial< dimension, CoordType, dimension >\n Dune::RefinementImp::Simplex::RefinementIteratorSpecial< dimension, CoordType, 0 >\n Dune::RefinementImp::Simplex::RefinementImp::Codim< codimension >\n Dune\n Dune::RefinementImp\n Dune::RefinementImp::Simplex\n \n #define\n DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC\n- a00230.html\n+ a00218.html\n a944407dc4f6f9a372b10b69bbb5a0792\n \n \n \n int\n factorial\n a00266.html\n@@ -372,50 +372,50 @@\n \n \n \n topologyfactory.hh\n /build/reproducible-path/dune-geometry-2.9.0/dune/geometry/\n a00206.html\n dune/geometry/type.hh\n- dune/geometry/typeindex.hh\n+ dune/geometry/typeindex.hh\n Dune::TopologyFactory\n Dune::TopologySingletonFactory\n Dune\n \n \n type.hh\n /build/reproducible-path/dune-geometry-2.9.0/dune/geometry/\n a00197.html\n- dune/geometry/deprecated_topology.hh\n+ dune/geometry/deprecated_topology.hh\n Dune::GeometryType\n Dune\n Dune::GeometryTypes\n \n \n typeindex.hh\n /build/reproducible-path/dune-geometry-2.9.0/dune/geometry/\n- a00236.html\n+ a00200.html\n type.hh\n Dune::LocalGeometryTypeIndex\n Dune::GlobalGeometryTypeIndex\n Dune\n \n \n typefromvertexcount.hh\n /build/reproducible-path/dune-geometry-2.9.0/dune/geometry/utility/\n- a00233.html\n+ a00236.html\n dune/geometry/type.hh\n Dune\n \n \n virtualrefinement.cc\n /build/reproducible-path/dune-geometry-2.9.0/dune/geometry/\n- a00188.html\n+ a00194.html\n type.hh\n- refinement.hh\n+ refinement.hh\n Dune::VirtualRefinementSubEntityIteratorSpecial< dimension, CoordType, dimension >\n Dune::VirtualRefinementSubEntityIteratorSpecial< dimension, CoordType, 0 >\n Dune::VirtualRefinement::Codim< codimension >\n Dune::VirtualRefinementSubEntityIteratorBackSpecial< dimension, CoordType, dimension >\n Dune::VirtualRefinementSubEntityIteratorBackSpecial< dimension, CoordType, 0 >\n Dune::VirtualRefinement::SubEntityIteratorBack\n Dune::VirtualRefinementImp\n@@ -425,26 +425,26 @@\n Dune::RefinementBuilder\n Dune::RefinementBuilder< 1, CoordType >\n Dune::RefinementBuilder< 3, CoordType >\n Dune\n \n #define\n DUNE_GEOMETRY_VIRTUALREFINEMENT_CC\n- a00188.html\n+ a00194.html\n ac82d420bff6cce87d06ad71b4f1cb0c8\n \n \n \n \n virtualrefinement.hh\n /build/reproducible-path/dune-geometry-2.9.0/dune/geometry/\n- a00182.html\n- refinement.hh\n+ a00188.html\n+ refinement.hh\n type.hh\n- virtualrefinement.cc\n+ virtualrefinement.cc\n Dune::VirtualRefinement\n Dune::VirtualRefinement::Codim\n Dune\n \n \n Dune::AffineGeometry\n a01099.html\n"}]}]}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/files.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/files.html", "unified_diff": "@@ -77,39 +77,39 @@\n   doc\n   appl\n  refelements\n  doxygen\n   dune\n   geometry\n   refinement\n- base.ccThis file contains the parts independent of a particular Refinement implementation \n+ base.ccThis file contains the parts independent of a particular Refinement implementation \n  hcube.ccThis file contains the Refinement implementation for hypercubes (quadrilaterals, hexahedrons, etc.) \n  hcubetriangulation.ccThis file contains the Refinement implementation for triangulating hypercubes (quadrilateral -> triangle, hexahedron -> tetrahedron) \n  prismtriangulation.cc\n- pyramidtriangulation.cc\n- simplex.ccThis file contains the Refinement implementation for simplices (triangles, tetrahedrons...) \n+ pyramidtriangulation.cc\n+ simplex.ccThis file contains the Refinement implementation for simplices (triangles, tetrahedrons...) \n   utility\n- typefromvertexcount.hh\n- affinegeometry.hhAn implementation of the Geometry interface for affine geometries \n- axisalignedcubegeometry.hhA geometry implementation for axis-aligned hypercubes \n- deprecated_topology.hh\n- dimension.hh\n- generalvertexorder.hh\n- multilineargeometry.hh\n- quadraturerules.hh\n- referenceelement.hh\n- referenceelementimplementation.cc\n- referenceelementimplementation.hh\n- referenceelements.hh\n- refinement.hhThis file simply includes all Refinement implementations so you don't have to do them separately \n+ typefromvertexcount.hh\n+ affinegeometry.hhAn implementation of the Geometry interface for affine geometries \n+ axisalignedcubegeometry.hhA geometry implementation for axis-aligned hypercubes \n+ deprecated_topology.hh\n+ dimension.hh\n+ generalvertexorder.hh\n+ multilineargeometry.hh\n+ quadraturerules.hh\n+ referenceelement.hh\n+ referenceelementimplementation.cc\n+ referenceelementimplementation.hh\n+ referenceelements.hh\n+ refinement.hhThis file simply includes all Refinement implementations so you don't have to do them separately \n  topologyfactory.hh\n  type.hhA unique label for each type of element that can occur in a grid \n- typeindex.hhHelper classes to provide indices for geometrytypes for use in a vector \n- virtualrefinement.ccThis file contains the virtual wrapper around refinement \n- virtualrefinement.hhThis file contains the virtual wrapper around refinement \n+ typeindex.hhHelper classes to provide indices for geometrytypes for use in a vector \n+ virtualrefinement.ccThis file contains the virtual wrapper around refinement \n+ virtualrefinement.hhThis file contains the virtual wrapper around refinement \n \n \n \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/globals.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/globals.html", "unified_diff": "@@ -66,22 +66,22 @@\n \n \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.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/globals_defs.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/globals_defs.html", "unified_diff": "@@ -66,22 +66,22 @@\n \n \n \n \n \n
    \n
    Here is a list of all macros with links to the files they belong to:
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.8\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-geometry-doc/doxygen/a00107.html", "source2": "./usr/share/doc/libdune-geometry-doc/doxygen/a00110.html", "comments": ["Files identical despite different names"], "unified_diff": null}]}]}]}]}