--- /srv/reproducible-results/rbuild-debian/r-b-build.FDQYDdG4/b1/dune-geometry_2.9.0-4_armhf.changes +++ /srv/reproducible-results/rbuild-debian/r-b-build.FDQYDdG4/b2/dune-geometry_2.9.0-4_armhf.changes ├── Files │ @@ -1,4 +1,4 @@ │ │ 3193baa5bdb213892e77d9d9f889697e 369660 debug optional libdune-geometry-dev-dbgsym_2.9.0-4_armhf.deb │ 53fb42779d40915833322e747d7c71cd 289788 libdevel optional libdune-geometry-dev_2.9.0-4_armhf.deb │ - 2f1bcad3075761d2ca9ec15a9c9d57e7 1525928 doc optional libdune-geometry-doc_2.9.0-4_all.deb │ + 8e1293de43638d04104e72aebddd010b 1525364 doc optional libdune-geometry-doc_2.9.0-4_all.deb ├── libdune-geometry-doc_2.9.0-4_all.deb │ ├── file list │ │ @@ -1,3 +1,3 @@ │ │ -rw-r--r-- 0 0 0 4 2023-07-15 14:03:47.000000 debian-binary │ │ --rw-r--r-- 0 0 0 15712 2023-07-15 14:03:47.000000 control.tar.xz │ │ --rw-r--r-- 0 0 0 1510024 2023-07-15 14:03:47.000000 data.tar.xz │ │ +-rw-r--r-- 0 0 0 15708 2023-07-15 14:03:47.000000 control.tar.xz │ │ +-rw-r--r-- 0 0 0 1509464 2023-07-15 14:03:47.000000 data.tar.xz │ ├── control.tar.xz │ │ ├── control.tar │ │ │ ├── ./md5sums │ │ │ │ ├── ./md5sums │ │ │ │ │┄ Files differ │ │ │ │ ├── line order │ │ │ │ │ @@ -8,30 +8,30 @@ │ │ │ │ │ usr/share/doc/libdune-geometry-doc/appl/refelements/gg_quadrilateral.png │ │ │ │ │ usr/share/doc/libdune-geometry-doc/appl/refelements/gg_tetrahedron.png │ │ │ │ │ usr/share/doc/libdune-geometry-doc/appl/refelements/gg_tetrahedron_edges.png │ │ │ │ │ usr/share/doc/libdune-geometry-doc/appl/refelements/gg_triangle.png │ │ │ │ │ usr/share/doc/libdune-geometry-doc/changelog.Debian.gz │ │ │ │ │ usr/share/doc/libdune-geometry-doc/changelog.gz │ │ │ │ │ usr/share/doc/libdune-geometry-doc/copyright │ │ │ │ │ -usr/share/doc/libdune-geometry-doc/doxygen/a00035.html │ │ │ │ │ +usr/share/doc/libdune-geometry-doc/doxygen/a00008.html │ │ │ │ │ usr/share/doc/libdune-geometry-doc/doxygen/a00164.html │ │ │ │ │ usr/share/doc/libdune-geometry-doc/doxygen/a00167.html │ │ │ │ │ usr/share/doc/libdune-geometry-doc/doxygen/a00170.html │ │ │ │ │ usr/share/doc/libdune-geometry-doc/doxygen/a00170_source.html │ │ │ │ │ usr/share/doc/libdune-geometry-doc/doxygen/a00173.html │ │ │ │ │ +usr/share/doc/libdune-geometry-doc/doxygen/a00173_source.html │ │ │ │ │ usr/share/doc/libdune-geometry-doc/doxygen/a00176.html │ │ │ │ │ usr/share/doc/libdune-geometry-doc/doxygen/a00176_source.html │ │ │ │ │ usr/share/doc/libdune-geometry-doc/doxygen/a00179.html │ │ │ │ │ usr/share/doc/libdune-geometry-doc/doxygen/a00179_source.html │ │ │ │ │ usr/share/doc/libdune-geometry-doc/doxygen/a00182.html │ │ │ │ │ usr/share/doc/libdune-geometry-doc/doxygen/a00182_source.html │ │ │ │ │ usr/share/doc/libdune-geometry-doc/doxygen/a00185.html │ │ │ │ │ usr/share/doc/libdune-geometry-doc/doxygen/a00185_source.html │ │ │ │ │ usr/share/doc/libdune-geometry-doc/doxygen/a00188.html │ │ │ │ │ -usr/share/doc/libdune-geometry-doc/doxygen/a00188_source.html │ │ │ │ │ usr/share/doc/libdune-geometry-doc/doxygen/a00191.html │ │ │ │ │ usr/share/doc/libdune-geometry-doc/doxygen/a00191_source.html │ │ │ │ │ usr/share/doc/libdune-geometry-doc/doxygen/a00194.html │ │ │ │ │ usr/share/doc/libdune-geometry-doc/doxygen/a00194_source.html │ │ │ │ │ usr/share/doc/libdune-geometry-doc/doxygen/a00197.html │ │ │ │ │ usr/share/doc/libdune-geometry-doc/doxygen/a00197_source.html │ │ │ │ │ usr/share/doc/libdune-geometry-doc/doxygen/a00200.html │ ├── data.tar.xz │ │ ├── data.tar │ │ │ ├── file list │ │ │ │ @@ -16,64 +16,64 @@ │ │ │ │ -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 │ │ │ │ -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 │ │ │ │ -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 │ │ │ │ -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 │ │ │ │ -rw-r--r-- 0 root (0) root (0) 3307 2022-10-20 18:03:11.000000 ./usr/share/doc/libdune-geometry-doc/changelog.gz │ │ │ │ -rw-r--r-- 0 root (0) root (0) 2567 2023-01-12 15:07:27.000000 ./usr/share/doc/libdune-geometry-doc/copyright │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 3075 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00035.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 3075 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00008.html │ │ │ │ -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 │ │ │ │ -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 │ │ │ │ --rw-r--r-- 0 root (0) root (0) 3400 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00170.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 26542 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00170_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 4352 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00173.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11783 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00176.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 156234 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00176_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5671 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00179.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 29350 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00179_source.html │ │ │ │ --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 │ │ │ │ --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 │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5106 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00185.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 12688 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00185_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 4510 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00188.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8120 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00188_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10165 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00191.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 66730 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00191_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7986 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00194.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 171806 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00194_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5096 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00197.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9368 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00197_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7240 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00200.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 29452 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00200_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5299 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00203.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 112512 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00203_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10134 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00206.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 86047 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00206_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9692 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00209.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 96784 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00209_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10293 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00212.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 98931 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00212_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10328 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00215.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 99226 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00215_source.html │ │ │ │ --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 │ │ │ │ --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 │ │ │ │ +-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 │ │ │ │ +-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 │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7986 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00173.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 171806 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00173_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5096 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00176.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9368 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00176_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13461 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00179.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 94629 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00179_source.html │ │ │ │ +-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 │ │ │ │ +-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 │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10165 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00185.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 66730 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00185_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 4352 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00188.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5671 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00191.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 29350 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00191_source.html │ │ │ │ +-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 │ │ │ │ +-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 │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11783 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00197.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 156234 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00197_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 4510 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00200.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8120 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00200_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6873 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00203.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 85999 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00203_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5106 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00206.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 12688 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00206_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5862 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00209.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 36535 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00209_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5394 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00212.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 66962 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00212_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5592 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00215.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 44620 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00215_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 3400 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00218.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 26542 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00218_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 10618 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00221.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 34670 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00221_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13461 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00224.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 94629 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00224_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5394 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00227.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 66962 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00227_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5592 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00230.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 44620 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00230_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5567 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00233.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 117778 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00233_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6873 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00236.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 85999 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00236_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5862 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00239.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 36535 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00239_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10328 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00224.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 99226 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00224_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10293 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00227.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 98931 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00227_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10134 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00230.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 86047 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00230_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 14353 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00233.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 118175 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00233_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9692 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00236.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 96784 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00236_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5567 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00239.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 117778 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/a00239_source.html │ │ │ │ -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 │ │ │ │ -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 │ │ │ │ -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 │ │ │ │ -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 │ │ │ │ -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 │ │ │ │ -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 │ │ │ │ -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 │ │ │ │ @@ -302,15 +302,15 @@ │ │ │ │ -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 │ │ │ │ -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 │ │ │ │ -rw-r--r-- 0 root (0) root (0) 2492 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/dir_b609f53bbb5e26b8e9292001c59476a3_dep.png │ │ │ │ -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 │ │ │ │ -rw-r--r-- 0 root (0) root (0) 1994 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/dir_de8ef2d1b4283b99fcb86ec9d2fa66db_dep.png │ │ │ │ -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 │ │ │ │ -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 │ │ │ │ --rw-r--r-- 0 root (0) root (0) 26052 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/dune-geometry.tag.gz │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 26059 2023-07-15 14:03:47.000000 ./usr/share/doc/libdune-geometry-doc/doxygen/dune-geometry.tag.gz │ │ │ │ -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 │ │ │ │ -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 │ │ │ │ -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 │ │ │ │ -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 │ │ │ │ -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 │ │ │ │ -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 │ │ │ │ -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 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00170.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: deprecated_topology.hh File Reference │ │ │ │ +dune-geometry: referenceelementimplementation.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -69,19 +69,46 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
deprecated_topology.hh File Reference
│ │ │ │ +
│ │ │ │ +Namespaces
│ │ │ │ +
referenceelementimplementation.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ - │ │ │ │ +
#include <cassert>
│ │ │ │ +#include <algorithm>
│ │ │ │ +#include <limits>
│ │ │ │ +#include <tuple>
│ │ │ │ +#include <utility>
│ │ │ │ +#include <vector>
│ │ │ │ +#include <array>
│ │ │ │ +#include <bitset>
│ │ │ │ +#include <dune/common/fmatrix.hh>
│ │ │ │ +#include <dune/common/fvector.hh>
│ │ │ │ +#include <dune/common/hybridutilities.hh>
│ │ │ │ +#include <dune/common/typetraits.hh>
│ │ │ │ +#include <dune/common/iteratorrange.hh>
│ │ │ │ +#include <dune/common/math.hh>
│ │ │ │ +#include <dune/geometry/referenceelement.hh>
│ │ │ │ +#include <dune/geometry/affinegeometry.hh>
│ │ │ │ +#include <dune/geometry/type.hh>
│ │ │ │ +
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ +Namespaces

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

Go to the source code of this file.

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

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

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::Geo
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -6,19 +6,46 @@ │ │ │ │ │ dune-geometry 2.9.0 │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ -Namespaces │ │ │ │ │ -referenceelementimplementation.cc File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +multilineargeometry.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +Go_to_the_source_code_of_this_file. │ │ │ │ │ + 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... │ │ │ │ │ +  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ -namespace  Dune::Geo │ │ │ │ │ -  │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00176.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: virtualrefinement.cc File Reference │ │ │ │ +dune-geometry: dimension.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -71,96 +71,36 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Macros | │ │ │ │ -Functions
│ │ │ │ -
virtualrefinement.cc File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
dimension.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ - │ │ │ │ -

This file contains the virtual wrapper around refinement. │ │ │ │ -More...

│ │ │ │ -
#include <cassert>
│ │ │ │ -#include <typeinfo>
│ │ │ │ -#include <dune/common/exceptions.hh>
│ │ │ │ -#include <dune/common/fvector.hh>
│ │ │ │ -#include <dune/common/iteratorfacades.hh>
│ │ │ │ -#include "type.hh"
│ │ │ │ -#include "refinement.hh"
│ │ │ │ +
#include <type_traits>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

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 >
struct  Dune::Dim< dim >
 Static tag representing a dimension. 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 >
struct  Dune::Codim< codim >
 Static tag representing a codimension. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ │ Namespaces

namespace  Dune
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Macros

#define DUNE_GEOMETRY_VIRTUALREFINEMENT_CC
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

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

Detailed Description

│ │ │ │ -

This file contains the virtual wrapper around refinement.

│ │ │ │ -

Macro Definition Documentation

│ │ │ │ - │ │ │ │ -

◆ DUNE_GEOMETRY_VIRTUALREFINEMENT_CC

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

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

│ │ │ │ -
#include <cstddef>
│ │ │ │ -#include <dune/common/indices.hh>
│ │ │ │ -#include <dune/common/hybridutilities.hh>
│ │ │ │ -#include "type.hh"
│ │ │ │ +
#include <algorithm>
│ │ │ │ +#include <iostream>
│ │ │ │ +#include <limits>
│ │ │ │ +#include <mutex>
│ │ │ │ +#include <utility>
│ │ │ │ +#include <vector>
│ │ │ │ +#include <dune/common/fvector.hh>
│ │ │ │ +#include <dune/common/exceptions.hh>
│ │ │ │ +#include <dune/common/stdstreams.hh>
│ │ │ │ +#include <dune/common/stdthread.hh>
│ │ │ │ +#include <dune/common/visibility.hh>
│ │ │ │ +#include <dune/geometry/type.hh>
│ │ │ │ +#include <dune/geometry/typeindex.hh>
│ │ │ │ +#include "quadraturerules/pointquadrature.hh"
│ │ │ │ +#include "quadraturerules/gausslobattoquadrature.hh"
│ │ │ │ +#include "quadraturerules/gaussquadrature.hh"
│ │ │ │ +#include "quadraturerules/gaussradauleftquadrature.hh"
│ │ │ │ +#include "quadraturerules/gaussradaurightquadrature.hh"
│ │ │ │ +#include "quadraturerules/jacobi1quadrature.hh"
│ │ │ │ +#include "quadraturerules/jacobi2quadrature.hh"
│ │ │ │ +#include "quadraturerules/jacobiNquadrature.hh"
│ │ │ │ +#include "quadraturerules/prismquadrature.hh"
│ │ │ │ +#include "quadraturerules/simplexquadrature.hh"
│ │ │ │ +#include "quadraturerules/tensorproductquadrature.hh"
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::LocalGeometryTypeIndex
 Compute per-dimension indices for geometry types. More...
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::GlobalGeometryTypeIndex
 Compute indices for geometry types, taking the dimension into account. More...
class  Dune::QuadratureRuleFactory< ctype, 3 >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::QuadratureType
 Defines an enum for currently available quadrature rules.
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Macros

#define DUNE_INCLUDING_IMPLEMENTATION
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +Enumerations

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

Detailed Description

│ │ │ │ -

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

│ │ │ │ -
│ │ │ │ +

Interface for quadrature points and rules

│ │ │ │ +

Macro Definition Documentation

│ │ │ │ + │ │ │ │ +

◆ DUNE_INCLUDING_IMPLEMENTATION

│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
#define DUNE_INCLUDING_IMPLEMENTATION
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -6,32 +6,87 @@ │ │ │ │ │ dune-geometry 2.9.0 │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -typeindex.hh File Reference │ │ │ │ │ -Helper classes to provide indices for geometrytypes for use in a vector. │ │ │ │ │ -More... │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include "type.hh" │ │ │ │ │ +Classes | Namespaces | Macros | Enumerations │ │ │ │ │ +quadraturerules.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include "quadraturerules/pointquadrature.hh" │ │ │ │ │ +#include "quadraturerules/gausslobattoquadrature.hh" │ │ │ │ │ +#include "quadraturerules/gaussquadrature.hh" │ │ │ │ │ +#include "quadraturerules/gaussradauleftquadrature.hh" │ │ │ │ │ +#include "quadraturerules/gaussradaurightquadrature.hh" │ │ │ │ │ +#include "quadraturerules/jacobi1quadrature.hh" │ │ │ │ │ +#include "quadraturerules/jacobi2quadrature.hh" │ │ │ │ │ +#include "quadraturerules/jacobiNquadrature.hh" │ │ │ │ │ +#include "quadraturerules/prismquadrature.hh" │ │ │ │ │ +#include "quadraturerules/simplexquadrature.hh" │ │ │ │ │ +#include "quadraturerules/tensorproductquadrature.hh" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  Dune::LocalGeometryTypeIndex │ │ │ │ │ -  Compute per-dimension indices for geometry types. More... │ │ │ │ │ +class  Dune::QuadratureOrderOutOfRange │ │ │ │ │ +  Exception thrown if a desired QuadratureRule is not available, because │ │ │ │ │ + the requested order is to high. More... │ │ │ │ │   │ │ │ │ │ -class  Dune::GlobalGeometryTypeIndex │ │ │ │ │ -  Compute indices for geometry types, taking the dimension into account. │ │ │ │ │ - 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_> │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ +namespace  Dune::QuadratureType │ │ │ │ │ +  Defines an enum for currently available quadrature rules. │ │ │ │ │ +  │ │ │ │ │ + Macros │ │ │ │ │ +#define DUNE_INCLUDING_IMPLEMENTATION │ │ │ │ │ +  │ │ │ │ │ + Enumerations │ │ │ │ │ +enum  Dune::QuadratureType::Enum { │ │ │ │ │ +   Dune::QuadratureType::GaussLegendre = 0 , Dune::QuadratureType:: │ │ │ │ │ + GaussJacobi_1_0 = 1 , Dune::QuadratureType::GaussJacobi_2_0 = 2 , Dune:: │ │ │ │ │ + QuadratureType::GaussJacobi_n_0 = 3 , │ │ │ │ │ +   Dune::QuadratureType::GaussLobatto = 4 , Dune::QuadratureType:: │ │ │ │ │ + GaussRadauLeft = 5 , Dune::QuadratureType::GaussRadauRight = 6 , Dune:: │ │ │ │ │ + QuadratureType::size │ │ │ │ │ + } │ │ │ │ │ +  │ │ │ │ │ ***** Detailed Description ***** │ │ │ │ │ -Helper classes to provide indices for geometrytypes for use in a vector. │ │ │ │ │ +Interface for quadrature points and rules │ │ │ │ │ +***** Macro Definition Documentation ***** │ │ │ │ │ +***** ◆ DUNE_INCLUDING_IMPLEMENTATION ***** │ │ │ │ │ +#define DUNE_INCLUDING_IMPLEMENTATION │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00179_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: typeindex.hh Source File │ │ │ │ +dune-geometry: quadraturerules.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,161 +74,474 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
typeindex.hh
│ │ │ │ +
quadraturerules.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
│ │ │ │ -
5#ifndef DUNE_GEOMETRY_TYPEINDEX_HH
│ │ │ │ -
6#define DUNE_GEOMETRY_TYPEINDEX_HH
│ │ │ │ -
7
│ │ │ │ -
14#include <cstddef>
│ │ │ │ +
5
│ │ │ │ +
6#ifndef DUNE_GEOMETRY_QUADRATURERULES_HH
│ │ │ │ +
7#define DUNE_GEOMETRY_QUADRATURERULES_HH
│ │ │ │ +
8
│ │ │ │ +
9#include <algorithm>
│ │ │ │ +
10#include <iostream>
│ │ │ │ +
11#include <limits>
│ │ │ │ +
12#include <mutex>
│ │ │ │ +
13#include <utility>
│ │ │ │ +
14#include <vector>
│ │ │ │
15
│ │ │ │ -
16#include <dune/common/indices.hh>
│ │ │ │ -
17#include <dune/common/hybridutilities.hh>
│ │ │ │ -
18
│ │ │ │ -
19#include "type.hh"
│ │ │ │ -
20
│ │ │ │ -
21namespace Dune
│ │ │ │ -
22{
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
25 {
│ │ │ │ -
32 inline static constexpr std::size_t regular_size(std::size_t dim)
│ │ │ │ -
33 {
│ │ │ │ -
34 // The following expression is derived from the expression for
│ │ │ │ -
35 // GlobalGeometryTypeIndex::regular_offset(). Subtracting
│ │ │ │ -
36 // regular_offset(dim+1)-regular_offset(dim) we get:
│ │ │ │ -
37 //
│ │ │ │ -
38 // ((1 << dim+1) >> 1) - ((1 << dim) >> 1)
│ │ │ │ -
39 //
│ │ │ │ -
40 // We always have
│ │ │ │ -
41 //
│ │ │ │ -
42 // dim >= 0,
│ │ │ │ -
43 //
│ │ │ │ -
44 // so
│ │ │ │ -
45 //
│ │ │ │ -
46 // (1 << dim+1) >= 2 and (1 << dim+2) % 2 == 0.
│ │ │ │ -
47 //
│ │ │ │ -
48 // So if we apply a single right-shift to that, we will never lose any
│ │ │ │ -
49 // set bits, thus
│ │ │ │ -
50 //
│ │ │ │ -
51 // ((1 << dim+1) >> 1) == (1 << dim)
│ │ │ │ -
52 return (1 << dim) - ((1 << dim) >> 1);
│ │ │ │ -
53 }
│ │ │ │ +
16#include <dune/common/fvector.hh>
│ │ │ │ +
17#include <dune/common/exceptions.hh>
│ │ │ │ +
18#include <dune/common/stdstreams.hh>
│ │ │ │ +
19#include <dune/common/stdthread.hh>
│ │ │ │ +
20#include <dune/common/visibility.hh>
│ │ │ │ +
21
│ │ │ │ +
22#include <dune/geometry/type.hh>
│ │ │ │ + │ │ │ │ +
24
│ │ │ │ +
30namespace Dune {
│ │ │ │ +
31
│ │ │ │ +
36 class QuadratureOrderOutOfRange : public NotImplemented {};
│ │ │ │ +
37
│ │ │ │ +
43 template<typename ct, int dim>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
45 public:
│ │ │ │ +
47 constexpr static int dimension = dim;
│ │ │ │ +
48
│ │ │ │ +
50 typedef ct Field;
│ │ │ │ +
51
│ │ │ │ +
53 typedef Dune::FieldVector<ct,dim> Vector;
│ │ │ │
54
│ │ │ │ -
55 public:
│ │ │ │ -
│ │ │ │ -
61 inline static constexpr std::size_t size(std::size_t dim)
│ │ │ │ -
62 {
│ │ │ │ -
63 // one for "none"
│ │ │ │ -
64 return regular_size(dim) + 1;
│ │ │ │ +
│ │ │ │ +
56 QuadraturePoint (const Vector& x, ct w) : local(x)
│ │ │ │ +
57 {
│ │ │ │ +
58 weight_ = w;
│ │ │ │ +
59 }
│ │ │ │ +
│ │ │ │ +
60
│ │ │ │ +
│ │ │ │ +
62 const Vector& position () const
│ │ │ │ +
63 {
│ │ │ │ +
64 return local;
│ │ │ │
65 }
│ │ │ │
│ │ │ │
66
│ │ │ │ -
│ │ │ │ -
73 inline static constexpr std::size_t index(const GeometryType &gt)
│ │ │ │ -
74 {
│ │ │ │ -
75 return gt.isNone() ? regular_size(gt.dim()) : (gt.id() >> 1);
│ │ │ │ -
76 }
│ │ │ │ +
│ │ │ │ +
68 const ct &weight () const
│ │ │ │ +
69 {
│ │ │ │ +
70 return weight_;
│ │ │ │ +
71 }
│ │ │ │ +
│ │ │ │ +
72
│ │ │ │ +
73 protected:
│ │ │ │ +
74 FieldVector<ct, dim> local;
│ │ │ │ + │ │ │ │ +
76 };
│ │ │ │
│ │ │ │
77
│ │ │ │ -
│ │ │ │ -
79 inline static constexpr GeometryType type(std::size_t dim, std::size_t index) {
│ │ │ │ -
80 return (index == regular_size(dim)) ?
│ │ │ │ -
81 GeometryTypes::none(dim) :
│ │ │ │ -
82 // the cast to unsigned makes sure this is interpreted as the topology
│ │ │ │ -
83 // ID constructor
│ │ │ │ -
84 GeometryType(static_cast< unsigned int >(index << 1), dim);
│ │ │ │ -
85 }
│ │ │ │ -
│ │ │ │ -
86 };
│ │ │ │ -
│ │ │ │ -
87
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
90 {
│ │ │ │ -
98 inline static constexpr std::size_t regular_offset(std::size_t dim)
│ │ │ │ -
99 {
│ │ │ │ -
100 // The number of regular geometry types in a given dimension is
│ │ │ │ -
101 // 2^(dim-1). For dim==0 this would yield 1/2 geometry types (which is
│ │ │ │ -
102 // obviously bogus, dim==0 has one regular geometry type, the point).
│ │ │ │ -
103 // The following expression relies on 1 >> 1 == 0 to treat dim==0
│ │ │ │ -
104 // specially.
│ │ │ │ -
105 return (1 << dim) >> 1;
│ │ │ │ -
106 }
│ │ │ │ +
│ │ │ │ +
81 namespace QuadratureType {
│ │ │ │ +
│ │ │ │ +
82 enum Enum {
│ │ │ │ + │ │ │ │ +
93
│ │ │ │ + │ │ │ │ +
100
│ │ │ │ + │ │ │ │
107
│ │ │ │ -
108 public:
│ │ │ │ -
│ │ │ │ -
113 inline static constexpr std::size_t offset(std::size_t dim)
│ │ │ │ -
114 {
│ │ │ │ -
115 // dim times "none"
│ │ │ │ -
116 return regular_offset(dim) + dim;
│ │ │ │ -
117 }
│ │ │ │ -
│ │ │ │ -
118
│ │ │ │ -
│ │ │ │ -
125 inline static constexpr std::size_t size(std::size_t maxdim)
│ │ │ │ -
126 {
│ │ │ │ -
127 return offset(maxdim+1);
│ │ │ │ -
128 }
│ │ │ │ -
│ │ │ │ -
129
│ │ │ │ -
│ │ │ │ -
138 inline static constexpr std::size_t index(const GeometryType &gt)
│ │ │ │ -
139 {
│ │ │ │ -
140 return offset(gt.dim()) + LocalGeometryTypeIndex::index(gt);
│ │ │ │ -
141 }
│ │ │ │ -
│ │ │ │ -
142 };
│ │ │ │ -
│ │ │ │ -
143
│ │ │ │ -
144 namespace Impl {
│ │ │ │ -
145
│ │ │ │ -
146 // Map a dynamic GeometryType to a static integral_constant<GeometryType::Id, ...>
│ │ │ │ -
147 template<int dim, class F>
│ │ │ │ -
148 static auto toGeometryTypeIdConstant(const GeometryType& gt, F&& f) {
│ │ │ │ -
149 // Transform LocalGeometryTypeIndex to GeometryType::Id
│ │ │ │ -
150 auto callWithId = [&](auto index) {
│ │ │ │ -
151 static constexpr auto id = LocalGeometryTypeIndex::type(dim, decltype(index)::value).toId();
│ │ │ │ -
152 return f(std::integral_constant<GeometryType::Id, id>{});
│ │ │ │ -
153 };
│ │ │ │ -
154 // switchCases needs a fallback to determine the return type.
│ │ │ │ -
155 auto fallBack = [&]() { return callWithId(Dune::Indices::_0); };
│ │ │ │ -
156 // Iterate over all _regular_ GeometryType indices for given dimension
│ │ │ │ -
157 auto allIndices = std::make_index_sequence<LocalGeometryTypeIndex::size(dim)-1>{};
│ │ │ │ -
158 return Dune::Hybrid::switchCases(allIndices, LocalGeometryTypeIndex::index(gt), callWithId, fallBack);
│ │ │ │ -
159 }
│ │ │ │ -
160
│ │ │ │ -
161 } // namespace Impl
│ │ │ │ -
162} // namespace Dune
│ │ │ │ -
163
│ │ │ │ -
164#endif // DUNE_GEOMETRY_TYPEINDEX_HH
│ │ │ │ -
A unique label for each type of element that can occur in a grid.
│ │ │ │ + │ │ │ │ +
120
│ │ │ │ + │ │ │ │ +
128
│ │ │ │ + │ │ │ │ +
136
│ │ │ │ + │ │ │ │ +
145 size
│ │ │ │ +
146 };
│ │ │ │ +
│ │ │ │ +
147 }
│ │ │ │ +
│ │ │ │ +
148
│ │ │ │ +
152 template<typename ct, int dim>
│ │ │ │ +
│ │ │ │ +
153 class QuadratureRule : public std::vector<QuadraturePoint<ct,dim> >
│ │ │ │ +
154 {
│ │ │ │ +
155 public:
│ │ │ │ + │ │ │ │ +
162
│ │ │ │ +
163 protected:
│ │ │ │ + │ │ │ │ +
166
│ │ │ │ + │ │ │ │ +
169 public:
│ │ │ │ +
171 constexpr static int d = dim;
│ │ │ │ +
172
│ │ │ │ +
174 typedef ct CoordType;
│ │ │ │ +
175
│ │ │ │ +
177 virtual int order () const { return delivered_order; }
│ │ │ │ +
178
│ │ │ │ +
180 virtual GeometryType type () const { return geometry_type; }
│ │ │ │ +
181 virtual ~QuadratureRule(){}
│ │ │ │ +
182
│ │ │ │ +
185 typedef typename std::vector<QuadraturePoint<ct,dim> >::const_iterator iterator;
│ │ │ │ +
186
│ │ │ │ +
187 protected:
│ │ │ │ + │ │ │ │ + │ │ │ │ +
190 };
│ │ │ │ +
│ │ │ │ +
191
│ │ │ │ +
192 // Forward declaration of the factory class,
│ │ │ │ +
193 // needed internally by the QuadratureRules container class.
│ │ │ │ +
194 template<typename ctype, int dim> class QuadratureRuleFactory;
│ │ │ │ +
195
│ │ │ │ +
199 template<typename ctype, int dim>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
201
│ │ │ │ + │ │ │ │ +
204
│ │ │ │ +
205 // indexed by quadrature order
│ │ │ │ +
206 using QuadratureOrderVector = std::vector<std::pair<std::once_flag, QuadratureRule> >;
│ │ │ │ +
207
│ │ │ │ +
208 // indexed by geometry type
│ │ │ │ +
209 using GeometryTypeVector = std::vector<std::pair<std::once_flag, QuadratureOrderVector> >;
│ │ │ │ +
210
│ │ │ │ +
211 // indexed by quadrature type enum
│ │ │ │ +
212 using QuadratureCacheVector = std::vector<std::pair<std::once_flag, GeometryTypeVector> >;
│ │ │ │ +
213
│ │ │ │ +
215 DUNE_EXPORT const QuadratureRule& _rule(const GeometryType& t, int p, QuadratureType::Enum qt=QuadratureType::GaussLegendre) const
│ │ │ │ +
216 {
│ │ │ │ +
217 assert(t.dim()==dim);
│ │ │ │ +
218
│ │ │ │ +
219 DUNE_ASSERT_CALL_ONCE();
│ │ │ │ +
220
│ │ │ │ +
221 static QuadratureCacheVector quadratureCache(QuadratureType::size);
│ │ │ │ +
222
│ │ │ │ +
223 auto& [ onceFlagQuadratureType, geometryTypes ] = quadratureCache[qt];
│ │ │ │ +
224 // initialize geometry types for this quadrature type once
│ │ │ │ +
225 std::call_once(onceFlagQuadratureType, [&types = geometryTypes]{
│ │ │ │ +
226 types = GeometryTypeVector(LocalGeometryTypeIndex::size(dim));
│ │ │ │ +
227 });
│ │ │ │ +
228
│ │ │ │ +
229 auto& [ onceFlagGeometryType, quadratureOrders ] = geometryTypes[LocalGeometryTypeIndex::index(t)];
│ │ │ │ +
230 // initialize quadrature orders for this geometry type and quadrature type once
│ │ │ │ +
231 std::call_once(onceFlagGeometryType, [&, &orders = quadratureOrders]{
│ │ │ │ +
232 // we only need one quadrature rule for points, not maxint
│ │ │ │ +
233 const auto numRules = dim == 0 ? 1 : QuadratureRuleFactory<ctype,dim>::maxOrder(t, qt)+1;
│ │ │ │ +
234 orders = QuadratureOrderVector(numRules);
│ │ │ │ +
235 });
│ │ │ │ +
236
│ │ │ │ +
237 // we only have one quadrature rule for points
│ │ │ │ +
238 auto& [ onceFlagQuadratureOrder, quadratureRule ] = quadratureOrders[dim == 0 ? 0 : p];
│ │ │ │ +
239 // initialize quadrature rule once
│ │ │ │ +
240 std::call_once(onceFlagQuadratureOrder, [&, &rule = quadratureRule]{
│ │ │ │ + │ │ │ │ +
242 });
│ │ │ │ +
243
│ │ │ │ +
244 return quadratureRule;
│ │ │ │ +
245 }
│ │ │ │ +
246
│ │ │ │ +
248 DUNE_EXPORT static QuadratureRules& instance()
│ │ │ │ +
249 {
│ │ │ │ +
250 static QuadratureRules instance;
│ │ │ │ +
251 return instance;
│ │ │ │ +
252 }
│ │ │ │ +
253
│ │ │ │ +
255 QuadratureRules () = default;
│ │ │ │ +
256 public:
│ │ │ │ +
258 static unsigned
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ +
261 {
│ │ │ │ + │ │ │ │ +
263 }
│ │ │ │ +
│ │ │ │ +
264
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
267 {
│ │ │ │ +
268 return instance()._rule(t,p,qt);
│ │ │ │ +
269 }
│ │ │ │ +
│ │ │ │ +
270
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
273 {
│ │ │ │ +
274 GeometryType gt(t,dim);
│ │ │ │ +
275 return instance()._rule(gt,p,qt);
│ │ │ │ +
276 }
│ │ │ │ +
│ │ │ │ +
277 };
│ │ │ │ +
│ │ │ │ +
278
│ │ │ │ +
279} // end namespace Dune
│ │ │ │ +
280
│ │ │ │ +
281#define DUNE_INCLUDING_IMPLEMENTATION
│ │ │ │ +
282
│ │ │ │ +
283// 0d rules
│ │ │ │ +
284#include "quadraturerules/pointquadrature.hh"
│ │ │ │ +
285// 1d rules
│ │ │ │ +
286#include "quadraturerules/gausslobattoquadrature.hh"
│ │ │ │ +
287#include "quadraturerules/gaussquadrature.hh"
│ │ │ │ +
288#include "quadraturerules/gaussradauleftquadrature.hh"
│ │ │ │ +
289#include "quadraturerules/gaussradaurightquadrature.hh"
│ │ │ │ +
290#include "quadraturerules/jacobi1quadrature.hh"
│ │ │ │ +
291#include "quadraturerules/jacobi2quadrature.hh"
│ │ │ │ +
292#include "quadraturerules/jacobiNquadrature.hh"
│ │ │ │ +
293// 3d rules
│ │ │ │ +
294#include "quadraturerules/prismquadrature.hh"
│ │ │ │ +
295// general rules
│ │ │ │ +
296#include "quadraturerules/simplexquadrature.hh"
│ │ │ │ +
297#include "quadraturerules/tensorproductquadrature.hh"
│ │ │ │ +
298
│ │ │ │ +
299#undef DUNE_INCLUDING_IMPLEMENTATION
│ │ │ │ +
300
│ │ │ │ +
301namespace Dune {
│ │ │ │ +
302
│ │ │ │ +
309 template<typename ctype, int dim>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
311 private:
│ │ │ │ +
312 friend class QuadratureRules<ctype, dim>;
│ │ │ │ +
313 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum qt)
│ │ │ │ +
314 {
│ │ │ │ +
315 return TensorProductQuadratureRule<ctype,dim>::maxOrder(t.id(), qt);
│ │ │ │ +
316 }
│ │ │ │ +
317 static QuadratureRule<ctype, dim> rule(const GeometryType& t, int p, QuadratureType::Enum qt)
│ │ │ │ +
318 {
│ │ │ │ +
319 return TensorProductQuadratureRule<ctype,dim>(t.id(), p, qt);
│ │ │ │ +
320 }
│ │ │ │ +
321 };
│ │ │ │ +
│ │ │ │ +
322
│ │ │ │ +
323 template<typename ctype>
│ │ │ │ +
│ │ │ │ +
324 class QuadratureRuleFactory<ctype, 0> {
│ │ │ │ +
325 private:
│ │ │ │ +
326 constexpr static int dim = 0;
│ │ │ │ +
327 friend class QuadratureRules<ctype, dim>;
│ │ │ │ +
328 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum)
│ │ │ │ +
329 {
│ │ │ │ +
330 if (t.isVertex())
│ │ │ │ +
331 {
│ │ │ │ +
332 return std::numeric_limits<int>::max();
│ │ │ │ +
333 }
│ │ │ │ +
334 DUNE_THROW(Exception, "Unknown GeometryType");
│ │ │ │ +
335 }
│ │ │ │ +
336 static QuadratureRule<ctype, dim> rule(const GeometryType& t, int , QuadratureType::Enum)
│ │ │ │ +
337 {
│ │ │ │ +
338 if (t.isVertex())
│ │ │ │ +
339 {
│ │ │ │ +
340 return PointQuadratureRule<ctype>();
│ │ │ │ +
341 }
│ │ │ │ +
342 DUNE_THROW(Exception, "Unknown GeometryType");
│ │ │ │ +
343 }
│ │ │ │ +
344 };
│ │ │ │ +
│ │ │ │ +
345
│ │ │ │ +
346 template<typename ctype>
│ │ │ │ +
│ │ │ │ +
347 class QuadratureRuleFactory<ctype, 1> {
│ │ │ │ +
348 private:
│ │ │ │ +
349 constexpr static int dim = 1;
│ │ │ │ +
350 friend class QuadratureRules<ctype, dim>;
│ │ │ │ +
351 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum qt)
│ │ │ │ +
352 {
│ │ │ │ +
353 if (t.isLine())
│ │ │ │ +
354 {
│ │ │ │ +
355 switch (qt) {
│ │ │ │ + │ │ │ │ +
357 return GaussQuadratureRule1D<ctype>::highest_order;
│ │ │ │ + │ │ │ │ +
359 return Jacobi1QuadratureRule1D<ctype>::highest_order;
│ │ │ │ + │ │ │ │ +
361 return Jacobi2QuadratureRule1D<ctype>::highest_order;
│ │ │ │ + │ │ │ │ +
363 return GaussLobattoQuadratureRule1D<ctype>::highest_order;
│ │ │ │ + │ │ │ │ +
365 return JacobiNQuadratureRule1D<ctype>::maxOrder();
│ │ │ │ + │ │ │ │ +
367 return GaussRadauLeftQuadratureRule1D<ctype>::highest_order;
│ │ │ │ + │ │ │ │ +
369 return GaussRadauRightQuadratureRule1D<ctype>::highest_order;
│ │ │ │ +
370 default :
│ │ │ │ +
371 DUNE_THROW(Exception, "Unknown QuadratureType");
│ │ │ │ +
372 }
│ │ │ │ +
373 }
│ │ │ │ +
374 DUNE_THROW(Exception, "Unknown GeometryType");
│ │ │ │ +
375 }
│ │ │ │ +
376 static QuadratureRule<ctype, dim> rule(const GeometryType& t, int p, QuadratureType::Enum qt)
│ │ │ │ +
377 {
│ │ │ │ +
378 if (t.isLine())
│ │ │ │ +
379 {
│ │ │ │ +
380 switch (qt) {
│ │ │ │ + │ │ │ │ +
382 return GaussQuadratureRule1D<ctype>(p);
│ │ │ │ + │ │ │ │ +
384 return Jacobi1QuadratureRule1D<ctype>(p);
│ │ │ │ + │ │ │ │ +
386 return Jacobi2QuadratureRule1D<ctype>(p);
│ │ │ │ + │ │ │ │ +
388 return GaussLobattoQuadratureRule1D<ctype>(p);
│ │ │ │ + │ │ │ │ +
390 return JacobiNQuadratureRule1D<ctype>(p);
│ │ │ │ + │ │ │ │ +
392 return GaussRadauLeftQuadratureRule1D<ctype>(p);
│ │ │ │ + │ │ │ │ +
394 return GaussRadauRightQuadratureRule1D<ctype>(p);
│ │ │ │ +
395 default :
│ │ │ │ +
396 DUNE_THROW(Exception, "Unknown QuadratureType");
│ │ │ │ +
397 }
│ │ │ │ +
398 }
│ │ │ │ +
399 DUNE_THROW(Exception, "Unknown GeometryType");
│ │ │ │ +
400 }
│ │ │ │ +
401 };
│ │ │ │ +
│ │ │ │ +
402
│ │ │ │ +
403 template<typename ctype>
│ │ │ │ +
│ │ │ │ +
404 class QuadratureRuleFactory<ctype, 2> {
│ │ │ │ +
405 private:
│ │ │ │ +
406 constexpr static int dim = 2;
│ │ │ │ +
407 friend class QuadratureRules<ctype, dim>;
│ │ │ │ +
408 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum qt)
│ │ │ │ +
409 {
│ │ │ │ +
410 unsigned order =
│ │ │ │ +
411 TensorProductQuadratureRule<ctype,dim>::maxOrder(t.id(), qt);
│ │ │ │ +
412 if (t.isSimplex())
│ │ │ │ +
413 order = std::max
│ │ │ │ +
414 (order, unsigned(SimplexQuadratureRule<ctype,dim>::highest_order));
│ │ │ │ +
415 return order;
│ │ │ │ +
416 }
│ │ │ │ +
417 static QuadratureRule<ctype, dim> rule(const GeometryType& t, int p, QuadratureType::Enum qt)
│ │ │ │ +
418 {
│ │ │ │ +
419 if (t.isSimplex()
│ │ │ │ + │ │ │ │ +
421 && p <= SimplexQuadratureRule<ctype,dim>::highest_order)
│ │ │ │ +
422 {
│ │ │ │ +
423 return SimplexQuadratureRule<ctype,dim>(p);
│ │ │ │ +
424 }
│ │ │ │ +
425 return TensorProductQuadratureRule<ctype,dim>(t.id(), p, qt);
│ │ │ │ +
426 }
│ │ │ │ +
427 };
│ │ │ │ +
│ │ │ │ +
428
│ │ │ │ +
429 template<typename ctype>
│ │ │ │ +
│ │ │ │ +
430 class QuadratureRuleFactory<ctype, 3> {
│ │ │ │ +
431 private:
│ │ │ │ +
432 constexpr static int dim = 3;
│ │ │ │ +
433 friend class QuadratureRules<ctype, dim>;
│ │ │ │ +
434 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum qt)
│ │ │ │ +
435 {
│ │ │ │ +
436 unsigned order =
│ │ │ │ +
437 TensorProductQuadratureRule<ctype,dim>::maxOrder(t.id(), qt);
│ │ │ │ +
438 if (t.isSimplex())
│ │ │ │ +
439 order = std::max
│ │ │ │ +
440 (order, unsigned(SimplexQuadratureRule<ctype,dim>::highest_order));
│ │ │ │ +
441 if (t.isPrism())
│ │ │ │ +
442 order = std::max
│ │ │ │ +
443 (order, unsigned(PrismQuadratureRule<ctype,dim>::highest_order));
│ │ │ │ +
444 return order;
│ │ │ │ +
445 }
│ │ │ │ +
446 static QuadratureRule<ctype, dim> rule(const GeometryType& t, int p, QuadratureType::Enum qt)
│ │ │ │ +
447 {
│ │ │ │ +
448
│ │ │ │ +
449 if (t.isSimplex()
│ │ │ │ + │ │ │ │ +
451 && p <= SimplexQuadratureRule<ctype,dim>::highest_order)
│ │ │ │ +
452 {
│ │ │ │ +
453 return SimplexQuadratureRule<ctype,dim>(p);
│ │ │ │ +
454 }
│ │ │ │ +
455 if (t.isPrism()
│ │ │ │ + │ │ │ │ +
457 && p <= PrismQuadratureRule<ctype,dim>::highest_order)
│ │ │ │ +
458 {
│ │ │ │ +
459 return PrismQuadratureRule<ctype,dim>(p);
│ │ │ │ +
460 }
│ │ │ │ +
461 return TensorProductQuadratureRule<ctype,dim>(t.id(), p, qt);
│ │ │ │ +
462 }
│ │ │ │ +
463 };
│ │ │ │ +
│ │ │ │ +
464
│ │ │ │ +
465#ifndef DUNE_NO_EXTERN_QUADRATURERULES
│ │ │ │ +
466 extern template class GaussLobattoQuadratureRule<double, 1>;
│ │ │ │ +
467 extern template class GaussQuadratureRule<double, 1>;
│ │ │ │ +
468 extern template class GaussRadauLeftQuadratureRule<double, 1>;
│ │ │ │ +
469 extern template class GaussRadauRightQuadratureRule<double, 1>;
│ │ │ │ +
470 extern template class Jacobi1QuadratureRule<double, 1>;
│ │ │ │ +
471 extern template class Jacobi2QuadratureRule<double, 1>;
│ │ │ │ +
472 extern template class JacobiNQuadratureRule<double, 1>;
│ │ │ │ +
473 extern template class PrismQuadratureRule<double, 3>;
│ │ │ │ +
474 extern template class SimplexQuadratureRule<double, 2>;
│ │ │ │ +
475 extern template class SimplexQuadratureRule<double, 3>;
│ │ │ │ +
476#endif // !DUNE_NO_EXTERN_QUADRATURERULES
│ │ │ │ +
477
│ │ │ │ +
478} // end namespace
│ │ │ │ +
479
│ │ │ │ +
480#endif // DUNE_GEOMETRY_QUADRATURERULES_HH
│ │ │ │ +
Helper classes to provide indices for geometrytypes for use in a vector.
│ │ │ │ +
A unique label for each type of element that can occur in a grid.
│ │ │ │
Definition affinegeometry.hh:21
│ │ │ │ +
Enum
Definition quadraturerules.hh:82
│ │ │ │ +
@ GaussJacobi_n_0
Gauss-Legendre rules with .
Definition quadraturerules.hh:119
│ │ │ │ +
@ GaussJacobi_2_0
Gauss-Legendre rules with .
Definition quadraturerules.hh:106
│ │ │ │ +
@ GaussRadauRight
Gauss-Radau rules including the right endpoint.
Definition quadraturerules.hh:144
│ │ │ │ +
@ GaussJacobi_1_0
Gauss-Jacobi rules with .
Definition quadraturerules.hh:99
│ │ │ │ +
@ size
Definition quadraturerules.hh:145
│ │ │ │ +
@ GaussLobatto
Gauss-Lobatto rules.
Definition quadraturerules.hh:127
│ │ │ │ +
@ GaussRadauLeft
Gauss-Radau rules including the left endpoint.
Definition quadraturerules.hh:135
│ │ │ │ +
@ GaussLegendre
Gauss-Legendre rules (default)
Definition quadraturerules.hh:92
│ │ │ │ +
Exception thrown if a desired QuadratureRule is not available, because the requested order is to high...
Definition quadraturerules.hh:36
│ │ │ │ +
Single evaluation point in a quadrature rule.
Definition quadraturerules.hh:44
│ │ │ │ +
const Vector & position() const
return local coordinates of integration point i
Definition quadraturerules.hh:62
│ │ │ │ +
Dune::FieldVector< ct, dim > Vector
Type used for the position of a quadrature point.
Definition quadraturerules.hh:53
│ │ │ │ +
ct Field
Number type used for coordinates and quadrature weights.
Definition quadraturerules.hh:50
│ │ │ │ +
const ct & weight() const
return weight associated with integration point i
Definition quadraturerules.hh:68
│ │ │ │ +
ct weight_
Definition quadraturerules.hh:75
│ │ │ │ +
static constexpr int dimension
Dimension of the integration domain.
Definition quadraturerules.hh:47
│ │ │ │ +
QuadraturePoint(const Vector &x, ct w)
set up quadrature of given order in d dimensions
Definition quadraturerules.hh:56
│ │ │ │ +
FieldVector< ct, dim > local
Definition quadraturerules.hh:74
│ │ │ │ +
Abstract base class for quadrature rules.
Definition quadraturerules.hh:154
│ │ │ │ +
virtual ~QuadratureRule()
Definition quadraturerules.hh:181
│ │ │ │ +
static constexpr int d
The space dimension.
Definition quadraturerules.hh:171
│ │ │ │ +
virtual GeometryType type() const
return type of element
Definition quadraturerules.hh:180
│ │ │ │ +
int delivered_order
Definition quadraturerules.hh:189
│ │ │ │ +
QuadratureRule(GeometryType t, int order)
Constructor for a given geometry type and a given quadrature order.
Definition quadraturerules.hh:168
│ │ │ │ +
GeometryType geometry_type
Definition quadraturerules.hh:188
│ │ │ │ +
ct CoordType
The type used for coordinates.
Definition quadraturerules.hh:174
│ │ │ │ +
QuadratureRule()
Default constructor.
Definition quadraturerules.hh:161
│ │ │ │ +
virtual int order() const
return order
Definition quadraturerules.hh:177
│ │ │ │ +
QuadratureRule(GeometryType t)
Constructor for a given geometry type. Leaves the quadrature order invalid
Definition quadraturerules.hh:165
│ │ │ │ +
std::vector< QuadraturePoint< ct, dim > >::const_iterator iterator
Definition quadraturerules.hh:185
│ │ │ │ +
Factory class for creation of quadrature rules, depending on GeometryType, order and QuadratureType.
Definition quadraturerules.hh:310
│ │ │ │ +
A container for all quadrature rules of dimension dim
Definition quadraturerules.hh:200
│ │ │ │ +
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
│ │ │ │ +
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
│ │ │ │ +
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
│ │ │ │
Unique label for each type of entities that can occur in DUNE grids.
Definition type.hh:126
│ │ │ │ -
constexpr Id toId() const
Create an Id representation of this GeometryType.
Definition type.hh:222
│ │ │ │ +
constexpr bool isPrism() const
Return true if entity is a prism.
Definition type.hh:321
│ │ │ │ +
constexpr bool isVertex() const
Return true if entity is a vertex.
Definition type.hh:291
│ │ │ │
constexpr unsigned int dim() const
Return dimension of the type.
Definition type.hh:372
│ │ │ │ +
BasicType
Each entity can be tagged by one of these basic types plus its space dimension.
Definition type.hh:132
│ │ │ │ +
constexpr bool isLine() const
Return true if entity is a line segment.
Definition type.hh:296
│ │ │ │
constexpr unsigned int id() const
Return the topology id of the type.
Definition type.hh:377
│ │ │ │ -
constexpr bool isNone() const
Return true if entity is a singular of any dimension.
Definition type.hh:367
│ │ │ │ -
Compute per-dimension indices for geometry types.
Definition typeindex.hh:25
│ │ │ │ +
constexpr bool isSimplex() const
Return true if entity is a simplex of any dimension.
Definition type.hh:331
│ │ │ │
static constexpr std::size_t size(std::size_t dim)
Compute total number of geometry types for the given dimension.
Definition typeindex.hh:61
│ │ │ │ -
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
│ │ │ │
static constexpr std::size_t index(const GeometryType &gt)
Compute the index for the given geometry type within its dimension.
Definition typeindex.hh:73
│ │ │ │ -
Compute indices for geometry types, taking the dimension into account.
Definition typeindex.hh:90
│ │ │ │ -
static constexpr std::size_t index(const GeometryType &gt)
Compute the index for the given geometry type over all dimensions.
Definition typeindex.hh:138
│ │ │ │ -
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
│ │ │ │ -
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
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -7,185 +7,589 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ -typeindex.hh │ │ │ │ │ +quadraturerules.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception │ │ │ │ │ - 5#ifndef DUNE_GEOMETRY_TYPEINDEX_HH │ │ │ │ │ - 6#define DUNE_GEOMETRY_TYPEINDEX_HH │ │ │ │ │ - 7 │ │ │ │ │ - 14#include │ │ │ │ │ + 5 │ │ │ │ │ + 6#ifndef DUNE_GEOMETRY_QUADRATURERULES_HH │ │ │ │ │ + 7#define DUNE_GEOMETRY_QUADRATURERULES_HH │ │ │ │ │ + 8 │ │ │ │ │ + 9#include │ │ │ │ │ + 10#include │ │ │ │ │ + 11#include │ │ │ │ │ + 12#include │ │ │ │ │ + 13#include │ │ │ │ │ + 14#include │ │ │ │ │ 15 │ │ │ │ │ - 16#include │ │ │ │ │ - 17#include │ │ │ │ │ - 18 │ │ │ │ │ - 19#include "type.hh" │ │ │ │ │ - 20 │ │ │ │ │ - 21namespace Dune │ │ │ │ │ - 22{ │ │ │ │ │ -24 class LocalGeometryTypeIndex │ │ │ │ │ - 25 { │ │ │ │ │ - 32 inline static constexpr std::size_t regular_size(std::size_t dim) │ │ │ │ │ - 33 { │ │ │ │ │ - 34 // The following expression is derived from the expression for │ │ │ │ │ - 35 // GlobalGeometryTypeIndex::regular_offset(). Subtracting │ │ │ │ │ - 36 // regular_offset(dim+1)-regular_offset(dim) we get: │ │ │ │ │ - 37 // │ │ │ │ │ - 38 // ((1 << dim+1) >> 1) - ((1 << dim) >> 1) │ │ │ │ │ - 39 // │ │ │ │ │ - 40 // We always have │ │ │ │ │ - 41 // │ │ │ │ │ - 42 // dim >= 0, │ │ │ │ │ - 43 // │ │ │ │ │ - 44 // so │ │ │ │ │ - 45 // │ │ │ │ │ - 46 // (1 << dim+1) >= 2 and (1 << dim+2) % 2 == 0. │ │ │ │ │ - 47 // │ │ │ │ │ - 48 // So if we apply a single right-shift to that, we will never lose any │ │ │ │ │ - 49 // set bits, thus │ │ │ │ │ - 50 // │ │ │ │ │ - 51 // ((1 << dim+1) >> 1) == (1 << dim) │ │ │ │ │ - 52 return (1 << dim) - ((1 << dim) >> 1); │ │ │ │ │ - 53 } │ │ │ │ │ + 16#include │ │ │ │ │ + 17#include │ │ │ │ │ + 18#include │ │ │ │ │ + 19#include │ │ │ │ │ + 20#include │ │ │ │ │ + 21 │ │ │ │ │ + 22#include │ │ │ │ │ + 23#include │ │ │ │ │ + 24 │ │ │ │ │ + 30namespace Dune { │ │ │ │ │ + 31 │ │ │ │ │ +36 class QuadratureOrderOutOfRange : public NotImplemented {}; │ │ │ │ │ + 37 │ │ │ │ │ + 43 template │ │ │ │ │ +44 class QuadraturePoint { │ │ │ │ │ + 45 public: │ │ │ │ │ +47 constexpr static int dimension = dim; │ │ │ │ │ + 48 │ │ │ │ │ +50 typedef ct Field; │ │ │ │ │ + 51 │ │ │ │ │ +53 typedef Dune::FieldVector Vector; │ │ │ │ │ 54 │ │ │ │ │ - 55 public: │ │ │ │ │ -61 inline static constexpr std::size_t size(std::size_t dim) │ │ │ │ │ - 62 { │ │ │ │ │ - 63 // one for "none" │ │ │ │ │ - 64 return regular_size(dim) + 1; │ │ │ │ │ +56 QuadraturePoint (const Vector& x, ct w) : local(x) │ │ │ │ │ + 57 { │ │ │ │ │ + 58 weight_ = w; │ │ │ │ │ + 59 } │ │ │ │ │ + 60 │ │ │ │ │ +62 const Vector& position () const │ │ │ │ │ + 63 { │ │ │ │ │ + 64 return local; │ │ │ │ │ 65 } │ │ │ │ │ 66 │ │ │ │ │ -73 inline static constexpr std::size_t index(const GeometryType >) │ │ │ │ │ - 74 { │ │ │ │ │ - 75 return gt.isNone() ? regular_size(gt.dim()) : (gt.id() >> 1); │ │ │ │ │ - 76 } │ │ │ │ │ +68 const ct &weight () const │ │ │ │ │ + 69 { │ │ │ │ │ + 70 return weight_; │ │ │ │ │ + 71 } │ │ │ │ │ + 72 │ │ │ │ │ + 73 protected: │ │ │ │ │ +74 FieldVector local; │ │ │ │ │ +75 ct weight_; │ │ │ │ │ + 76 }; │ │ │ │ │ 77 │ │ │ │ │ -79 inline static constexpr GeometryType type(std::size_t dim, std::size_t │ │ │ │ │ -index) { │ │ │ │ │ - 80 return (index == regular_size(dim)) ? │ │ │ │ │ - 81 GeometryTypes::none(dim) : │ │ │ │ │ - 82 // the cast to unsigned makes sure this is interpreted as the topology │ │ │ │ │ - 83 // ID constructor │ │ │ │ │ - 84 GeometryType(static_cast< unsigned int >(index << 1), dim); │ │ │ │ │ - 85 } │ │ │ │ │ - 86 }; │ │ │ │ │ - 87 │ │ │ │ │ -89 class GlobalGeometryTypeIndex │ │ │ │ │ - 90 { │ │ │ │ │ - 98 inline static constexpr std::size_t regular_offset(std::size_t dim) │ │ │ │ │ - 99 { │ │ │ │ │ - 100 // The number of regular geometry types in a given dimension is │ │ │ │ │ - 101 // 2^(dim-1). For dim==0 this would yield 1/2 geometry types (which is │ │ │ │ │ - 102 // obviously bogus, dim==0 has one regular geometry type, the point). │ │ │ │ │ - 103 // The following expression relies on 1 >> 1 == 0 to treat dim==0 │ │ │ │ │ - 104 // specially. │ │ │ │ │ - 105 return (1 << dim) >> 1; │ │ │ │ │ - 106 } │ │ │ │ │ +81 namespace QuadratureType { │ │ │ │ │ +82 enum Enum { │ │ │ │ │ +92 GaussLegendre = 0, │ │ │ │ │ + 93 │ │ │ │ │ +99 GaussJacobi_1_0 = 1, │ │ │ │ │ + 100 │ │ │ │ │ +106 GaussJacobi_2_0 = 2, │ │ │ │ │ 107 │ │ │ │ │ - 108 public: │ │ │ │ │ -113 inline static constexpr std::size_t offset(std::size_t dim) │ │ │ │ │ - 114 { │ │ │ │ │ - 115 // dim times "none" │ │ │ │ │ - 116 return regular_offset(dim) + dim; │ │ │ │ │ - 117 } │ │ │ │ │ - 118 │ │ │ │ │ -125 inline static constexpr std::size_t size(std::size_t maxdim) │ │ │ │ │ - 126 { │ │ │ │ │ - 127 return offset(maxdim+1); │ │ │ │ │ - 128 } │ │ │ │ │ - 129 │ │ │ │ │ -138 inline static constexpr std::size_t index(const GeometryType >) │ │ │ │ │ - 139 { │ │ │ │ │ - 140 return offset(gt.dim()) + LocalGeometryTypeIndex::index(gt); │ │ │ │ │ - 141 } │ │ │ │ │ - 142 }; │ │ │ │ │ - 143 │ │ │ │ │ - 144 namespace Impl { │ │ │ │ │ - 145 │ │ │ │ │ - 146 // Map a dynamic GeometryType to a static integral_constant │ │ │ │ │ - 147 template │ │ │ │ │ - 148 static auto toGeometryTypeIdConstant(const GeometryType& gt, F&& f) { │ │ │ │ │ - 149 // Transform LocalGeometryTypeIndex to GeometryType::Id │ │ │ │ │ - 150 auto callWithId = [&](auto index) { │ │ │ │ │ - 151 static constexpr auto id = LocalGeometryTypeIndex::type(dim, decltype │ │ │ │ │ -(index)::value).toId(); │ │ │ │ │ - 152 return f(std::integral_constant{}); │ │ │ │ │ - 153 }; │ │ │ │ │ - 154 // switchCases needs a fallback to determine the return type. │ │ │ │ │ - 155 auto fallBack = [&]() { return callWithId(Dune::Indices::_0); }; │ │ │ │ │ - 156 // Iterate over all _regular_ GeometryType indices for given dimension │ │ │ │ │ - 157 auto allIndices = std::make_index_sequence{}; │ │ │ │ │ - 158 return Dune::Hybrid::switchCases(allIndices, LocalGeometryTypeIndex::index │ │ │ │ │ -(gt), callWithId, fallBack); │ │ │ │ │ - 159 } │ │ │ │ │ - 160 │ │ │ │ │ - 161 } // namespace Impl │ │ │ │ │ - 162} // namespace Dune │ │ │ │ │ - 163 │ │ │ │ │ - 164#endif // DUNE_GEOMETRY_TYPEINDEX_HH │ │ │ │ │ +119 GaussJacobi_n_0 = 3, │ │ │ │ │ + 120 │ │ │ │ │ +127 GaussLobatto = 4, │ │ │ │ │ + 128 │ │ │ │ │ +135 GaussRadauLeft = 5, │ │ │ │ │ + 136 │ │ │ │ │ +144 GaussRadauRight = 6, │ │ │ │ │ + 145 size │ │ │ │ │ +146 }; │ │ │ │ │ + 147 } │ │ │ │ │ + 148 │ │ │ │ │ + 152 template │ │ │ │ │ +153 class QuadratureRule : public std::vector > │ │ │ │ │ + 154 { │ │ │ │ │ + 155 public: │ │ │ │ │ +161 QuadratureRule() : delivered_order(-1) {} │ │ │ │ │ + 162 │ │ │ │ │ + 163 protected: │ │ │ │ │ +165 QuadratureRule(GeometryType t) : geometry_type(t), delivered_order(-1) {} │ │ │ │ │ + 166 │ │ │ │ │ +168 QuadratureRule(GeometryType t, int order) : geometry_type(t), │ │ │ │ │ +delivered_order(order) {} │ │ │ │ │ + 169 public: │ │ │ │ │ +171 constexpr static int d = dim; │ │ │ │ │ + 172 │ │ │ │ │ +174 typedef ct CoordType; │ │ │ │ │ + 175 │ │ │ │ │ +177 virtual int order () const { return delivered_order; } │ │ │ │ │ + 178 │ │ │ │ │ +180 virtual GeometryType type () const { return geometry_type; } │ │ │ │ │ +181 virtual ~QuadratureRule(){} │ │ │ │ │ + 182 │ │ │ │ │ +185 typedef typename std::vector >::const_iterator │ │ │ │ │ +iterator; │ │ │ │ │ + 186 │ │ │ │ │ + 187 protected: │ │ │ │ │ +188 GeometryType geometry_type; │ │ │ │ │ +189 int delivered_order; │ │ │ │ │ + 190 }; │ │ │ │ │ + 191 │ │ │ │ │ + 192 // Forward declaration of the factory class, │ │ │ │ │ + 193 // needed internally by the QuadratureRules container class. │ │ │ │ │ + 194 template class QuadratureRuleFactory; │ │ │ │ │ + 195 │ │ │ │ │ + 199 template │ │ │ │ │ +200 class QuadratureRules { │ │ │ │ │ + 201 │ │ │ │ │ + 203 using QuadratureRule = Dune::QuadratureRule; │ │ │ │ │ + 204 │ │ │ │ │ + 205 // indexed by quadrature order │ │ │ │ │ + 206 using QuadratureOrderVector = std::vector >; │ │ │ │ │ + 207 │ │ │ │ │ + 208 // indexed by geometry type │ │ │ │ │ + 209 using GeometryTypeVector = std::vector >; │ │ │ │ │ + 210 │ │ │ │ │ + 211 // indexed by quadrature type enum │ │ │ │ │ + 212 using QuadratureCacheVector = std::vector >; │ │ │ │ │ + 213 │ │ │ │ │ + 215 DUNE_EXPORT const QuadratureRule& _rule(const GeometryType& t, int p, │ │ │ │ │ +QuadratureType::Enum qt=QuadratureType::GaussLegendre) const │ │ │ │ │ + 216 { │ │ │ │ │ + 217 assert(t.dim()==dim); │ │ │ │ │ + 218 │ │ │ │ │ + 219 DUNE_ASSERT_CALL_ONCE(); │ │ │ │ │ + 220 │ │ │ │ │ + 221 static QuadratureCacheVector quadratureCache(QuadratureType::size); │ │ │ │ │ + 222 │ │ │ │ │ + 223 auto& [ onceFlagQuadratureType, geometryTypes ] = quadratureCache[qt]; │ │ │ │ │ + 224 // initialize geometry types for this quadrature type once │ │ │ │ │ + 225 std::call_once(onceFlagQuadratureType, [&types = geometryTypes]{ │ │ │ │ │ + 226 types = GeometryTypeVector(LocalGeometryTypeIndex::size(dim)); │ │ │ │ │ + 227 }); │ │ │ │ │ + 228 │ │ │ │ │ + 229 auto& [ onceFlagGeometryType, quadratureOrders ] = geometryTypes │ │ │ │ │ +[LocalGeometryTypeIndex::index(t)]; │ │ │ │ │ + 230 // initialize quadrature orders for this geometry type and quadrature type │ │ │ │ │ +once │ │ │ │ │ + 231 std::call_once(onceFlagGeometryType, [&, &orders = quadratureOrders]{ │ │ │ │ │ + 232 // we only need one quadrature rule for points, not maxint │ │ │ │ │ + 233 const auto numRules = dim == 0 ? 1 : QuadratureRuleFactory:: │ │ │ │ │ +maxOrder(t, qt)+1; │ │ │ │ │ + 234 orders = QuadratureOrderVector(numRules); │ │ │ │ │ + 235 }); │ │ │ │ │ + 236 │ │ │ │ │ + 237 // we only have one quadrature rule for points │ │ │ │ │ + 238 auto& [ onceFlagQuadratureOrder, quadratureRule ] = quadratureOrders[dim │ │ │ │ │ +== 0 ? 0 : p]; │ │ │ │ │ + 239 // initialize quadrature rule once │ │ │ │ │ + 240 std::call_once(onceFlagQuadratureOrder, [&, &rule = quadratureRule]{ │ │ │ │ │ + 241 rule = QuadratureRuleFactory::rule(t, p, qt); │ │ │ │ │ + 242 }); │ │ │ │ │ + 243 │ │ │ │ │ + 244 return quadratureRule; │ │ │ │ │ + 245 } │ │ │ │ │ + 246 │ │ │ │ │ + 248 DUNE_EXPORT static QuadratureRules& instance() │ │ │ │ │ + 249 { │ │ │ │ │ + 250 static QuadratureRules instance; │ │ │ │ │ + 251 return instance; │ │ │ │ │ + 252 } │ │ │ │ │ + 253 │ │ │ │ │ + 255 QuadratureRules () = default; │ │ │ │ │ + 256 public: │ │ │ │ │ + 258 static unsigned │ │ │ │ │ +259 maxOrder(const GeometryType& t, │ │ │ │ │ + 260 QuadratureType::Enum qt=QuadratureType::GaussLegendre) │ │ │ │ │ + 261 { │ │ │ │ │ + 262 return QuadratureRuleFactory::maxOrder(t,qt); │ │ │ │ │ + 263 } │ │ │ │ │ + 264 │ │ │ │ │ +266 static const QuadratureRule& rule(const GeometryType& t, int p, │ │ │ │ │ +QuadratureType::Enum qt=QuadratureType::GaussLegendre) │ │ │ │ │ + 267 { │ │ │ │ │ + 268 return instance()._rule(t,p,qt); │ │ │ │ │ + 269 } │ │ │ │ │ + 270 │ │ │ │ │ +272 static const QuadratureRule& rule(const GeometryType::BasicType t, int p, │ │ │ │ │ +QuadratureType::Enum qt=QuadratureType::GaussLegendre) │ │ │ │ │ + 273 { │ │ │ │ │ + 274 GeometryType gt(t,dim); │ │ │ │ │ + 275 return instance()._rule(gt,p,qt); │ │ │ │ │ + 276 } │ │ │ │ │ + 277 }; │ │ │ │ │ + 278 │ │ │ │ │ + 279} // end namespace Dune │ │ │ │ │ + 280 │ │ │ │ │ +281#define DUNE_INCLUDING_IMPLEMENTATION │ │ │ │ │ + 282 │ │ │ │ │ + 283// 0d rules │ │ │ │ │ + 284#include "quadraturerules/pointquadrature.hh" │ │ │ │ │ + 285// 1d rules │ │ │ │ │ + 286#include "quadraturerules/gausslobattoquadrature.hh" │ │ │ │ │ + 287#include "quadraturerules/gaussquadrature.hh" │ │ │ │ │ + 288#include "quadraturerules/gaussradauleftquadrature.hh" │ │ │ │ │ + 289#include "quadraturerules/gaussradaurightquadrature.hh" │ │ │ │ │ + 290#include "quadraturerules/jacobi1quadrature.hh" │ │ │ │ │ + 291#include "quadraturerules/jacobi2quadrature.hh" │ │ │ │ │ + 292#include "quadraturerules/jacobiNquadrature.hh" │ │ │ │ │ + 293// 3d rules │ │ │ │ │ + 294#include "quadraturerules/prismquadrature.hh" │ │ │ │ │ + 295// general rules │ │ │ │ │ + 296#include "quadraturerules/simplexquadrature.hh" │ │ │ │ │ + 297#include "quadraturerules/tensorproductquadrature.hh" │ │ │ │ │ + 298 │ │ │ │ │ + 299#undef DUNE_INCLUDING_IMPLEMENTATION │ │ │ │ │ + 300 │ │ │ │ │ + 301namespace Dune { │ │ │ │ │ + 302 │ │ │ │ │ + 309 template │ │ │ │ │ +310 class QuadratureRuleFactory { │ │ │ │ │ + 311 private: │ │ │ │ │ + 312 friend class QuadratureRules; │ │ │ │ │ + 313 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum qt) │ │ │ │ │ + 314 { │ │ │ │ │ + 315 return TensorProductQuadratureRule::maxOrder(t.id(), qt); │ │ │ │ │ + 316 } │ │ │ │ │ + 317 static QuadratureRule rule(const GeometryType& t, int p, │ │ │ │ │ +QuadratureType::Enum qt) │ │ │ │ │ + 318 { │ │ │ │ │ + 319 return TensorProductQuadratureRule(t.id(), p, qt); │ │ │ │ │ + 320 } │ │ │ │ │ + 321 }; │ │ │ │ │ + 322 │ │ │ │ │ + 323 template │ │ │ │ │ +324 class QuadratureRuleFactory { │ │ │ │ │ + 325 private: │ │ │ │ │ +326 constexpr static int dim = 0; │ │ │ │ │ + 327 friend class QuadratureRules; │ │ │ │ │ + 328 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum) │ │ │ │ │ + 329 { │ │ │ │ │ + 330 if (t.isVertex()) │ │ │ │ │ + 331 { │ │ │ │ │ + 332 return std::numeric_limits::max(); │ │ │ │ │ + 333 } │ │ │ │ │ + 334 DUNE_THROW(Exception, "Unknown GeometryType"); │ │ │ │ │ + 335 } │ │ │ │ │ + 336 static QuadratureRule rule(const GeometryType& t, int , │ │ │ │ │ +QuadratureType::Enum) │ │ │ │ │ + 337 { │ │ │ │ │ + 338 if (t.isVertex()) │ │ │ │ │ + 339 { │ │ │ │ │ + 340 return PointQuadratureRule(); │ │ │ │ │ + 341 } │ │ │ │ │ + 342 DUNE_THROW(Exception, "Unknown GeometryType"); │ │ │ │ │ + 343 } │ │ │ │ │ + 344 }; │ │ │ │ │ + 345 │ │ │ │ │ + 346 template │ │ │ │ │ +347 class QuadratureRuleFactory { │ │ │ │ │ + 348 private: │ │ │ │ │ +349 constexpr static int dim = 1; │ │ │ │ │ + 350 friend class QuadratureRules; │ │ │ │ │ + 351 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum qt) │ │ │ │ │ + 352 { │ │ │ │ │ + 353 if (t.isLine()) │ │ │ │ │ + 354 { │ │ │ │ │ + 355 switch (qt) { │ │ │ │ │ + 356 case QuadratureType::GaussLegendre : │ │ │ │ │ + 357 return GaussQuadratureRule1D::highest_order; │ │ │ │ │ + 358 case QuadratureType::GaussJacobi_1_0 : │ │ │ │ │ + 359 return Jacobi1QuadratureRule1D::highest_order; │ │ │ │ │ + 360 case QuadratureType::GaussJacobi_2_0 : │ │ │ │ │ + 361 return Jacobi2QuadratureRule1D::highest_order; │ │ │ │ │ + 362 case QuadratureType::GaussLobatto : │ │ │ │ │ + 363 return GaussLobattoQuadratureRule1D::highest_order; │ │ │ │ │ + 364 case QuadratureType::GaussJacobi_n_0 : │ │ │ │ │ + 365 return JacobiNQuadratureRule1D::maxOrder(); │ │ │ │ │ + 366 case QuadratureType::GaussRadauLeft : │ │ │ │ │ + 367 return GaussRadauLeftQuadratureRule1D::highest_order; │ │ │ │ │ + 368 case QuadratureType::GaussRadauRight : │ │ │ │ │ + 369 return GaussRadauRightQuadratureRule1D::highest_order; │ │ │ │ │ + 370 default : │ │ │ │ │ + 371 DUNE_THROW(Exception, "Unknown QuadratureType"); │ │ │ │ │ + 372 } │ │ │ │ │ + 373 } │ │ │ │ │ + 374 DUNE_THROW(Exception, "Unknown GeometryType"); │ │ │ │ │ + 375 } │ │ │ │ │ + 376 static QuadratureRule rule(const GeometryType& t, int p, │ │ │ │ │ +QuadratureType::Enum qt) │ │ │ │ │ + 377 { │ │ │ │ │ + 378 if (t.isLine()) │ │ │ │ │ + 379 { │ │ │ │ │ + 380 switch (qt) { │ │ │ │ │ + 381 case QuadratureType::GaussLegendre : │ │ │ │ │ + 382 return GaussQuadratureRule1D(p); │ │ │ │ │ + 383 case QuadratureType::GaussJacobi_1_0 : │ │ │ │ │ + 384 return Jacobi1QuadratureRule1D(p); │ │ │ │ │ + 385 case QuadratureType::GaussJacobi_2_0 : │ │ │ │ │ + 386 return Jacobi2QuadratureRule1D(p); │ │ │ │ │ + 387 case QuadratureType::GaussLobatto : │ │ │ │ │ + 388 return GaussLobattoQuadratureRule1D(p); │ │ │ │ │ + 389 case QuadratureType::GaussJacobi_n_0 : │ │ │ │ │ + 390 return JacobiNQuadratureRule1D(p); │ │ │ │ │ + 391 case QuadratureType::GaussRadauLeft : │ │ │ │ │ + 392 return GaussRadauLeftQuadratureRule1D(p); │ │ │ │ │ + 393 case QuadratureType::GaussRadauRight : │ │ │ │ │ + 394 return GaussRadauRightQuadratureRule1D(p); │ │ │ │ │ + 395 default : │ │ │ │ │ + 396 DUNE_THROW(Exception, "Unknown QuadratureType"); │ │ │ │ │ + 397 } │ │ │ │ │ + 398 } │ │ │ │ │ + 399 DUNE_THROW(Exception, "Unknown GeometryType"); │ │ │ │ │ + 400 } │ │ │ │ │ + 401 }; │ │ │ │ │ + 402 │ │ │ │ │ + 403 template │ │ │ │ │ +404 class QuadratureRuleFactory { │ │ │ │ │ + 405 private: │ │ │ │ │ +406 constexpr static int dim = 2; │ │ │ │ │ + 407 friend class QuadratureRules; │ │ │ │ │ + 408 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum qt) │ │ │ │ │ + 409 { │ │ │ │ │ + 410 unsigned order = │ │ │ │ │ + 411 TensorProductQuadratureRule::maxOrder(t.id(), qt); │ │ │ │ │ + 412 if (t.isSimplex()) │ │ │ │ │ + 413 order = std::max │ │ │ │ │ + 414 (order, unsigned(SimplexQuadratureRule::highest_order)); │ │ │ │ │ + 415 return order; │ │ │ │ │ + 416 } │ │ │ │ │ + 417 static QuadratureRule rule(const GeometryType& t, int p, │ │ │ │ │ +QuadratureType::Enum qt) │ │ │ │ │ + 418 { │ │ │ │ │ + 419 if (t.isSimplex() │ │ │ │ │ + 420 && ( qt == QuadratureType::GaussLegendre || qt == QuadratureType:: │ │ │ │ │ +GaussJacobi_n_0 ) │ │ │ │ │ + 421 && p <= SimplexQuadratureRule::highest_order) │ │ │ │ │ + 422 { │ │ │ │ │ + 423 return SimplexQuadratureRule(p); │ │ │ │ │ + 424 } │ │ │ │ │ + 425 return TensorProductQuadratureRule(t.id(), p, qt); │ │ │ │ │ + 426 } │ │ │ │ │ + 427 }; │ │ │ │ │ + 428 │ │ │ │ │ + 429 template │ │ │ │ │ +430 class QuadratureRuleFactory { │ │ │ │ │ + 431 private: │ │ │ │ │ +432 constexpr static int dim = 3; │ │ │ │ │ + 433 friend class QuadratureRules; │ │ │ │ │ + 434 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum qt) │ │ │ │ │ + 435 { │ │ │ │ │ + 436 unsigned order = │ │ │ │ │ + 437 TensorProductQuadratureRule::maxOrder(t.id(), qt); │ │ │ │ │ + 438 if (t.isSimplex()) │ │ │ │ │ + 439 order = std::max │ │ │ │ │ + 440 (order, unsigned(SimplexQuadratureRule::highest_order)); │ │ │ │ │ + 441 if (t.isPrism()) │ │ │ │ │ + 442 order = std::max │ │ │ │ │ + 443 (order, unsigned(PrismQuadratureRule::highest_order)); │ │ │ │ │ + 444 return order; │ │ │ │ │ + 445 } │ │ │ │ │ + 446 static QuadratureRule rule(const GeometryType& t, int p, │ │ │ │ │ +QuadratureType::Enum qt) │ │ │ │ │ + 447 { │ │ │ │ │ + 448 │ │ │ │ │ + 449 if (t.isSimplex() │ │ │ │ │ + 450 && ( qt == QuadratureType::GaussLegendre || qt == QuadratureType:: │ │ │ │ │ +GaussJacobi_n_0 ) │ │ │ │ │ + 451 && p <= SimplexQuadratureRule::highest_order) │ │ │ │ │ + 452 { │ │ │ │ │ + 453 return SimplexQuadratureRule(p); │ │ │ │ │ + 454 } │ │ │ │ │ + 455 if (t.isPrism() │ │ │ │ │ + 456 && qt == QuadratureType::GaussLegendre │ │ │ │ │ + 457 && p <= PrismQuadratureRule::highest_order) │ │ │ │ │ + 458 { │ │ │ │ │ + 459 return PrismQuadratureRule(p); │ │ │ │ │ + 460 } │ │ │ │ │ + 461 return TensorProductQuadratureRule(t.id(), p, qt); │ │ │ │ │ + 462 } │ │ │ │ │ + 463 }; │ │ │ │ │ + 464 │ │ │ │ │ + 465#ifndef DUNE_NO_EXTERN_QUADRATURERULES │ │ │ │ │ + 466 extern template class GaussLobattoQuadratureRule; │ │ │ │ │ + 467 extern template class GaussQuadratureRule; │ │ │ │ │ + 468 extern template class GaussRadauLeftQuadratureRule; │ │ │ │ │ + 469 extern template class GaussRadauRightQuadratureRule; │ │ │ │ │ + 470 extern template class Jacobi1QuadratureRule; │ │ │ │ │ + 471 extern template class Jacobi2QuadratureRule; │ │ │ │ │ + 472 extern template class JacobiNQuadratureRule; │ │ │ │ │ + 473 extern template class PrismQuadratureRule; │ │ │ │ │ + 474 extern template class SimplexQuadratureRule; │ │ │ │ │ +475 extern template class SimplexQuadratureRule; │ │ │ │ │ + 476#endif // !DUNE_NO_EXTERN_QUADRATURERULES │ │ │ │ │ + 477 │ │ │ │ │ + 478} // end namespace │ │ │ │ │ + 479 │ │ │ │ │ + 480#endif // DUNE_GEOMETRY_QUADRATURERULES_HH │ │ │ │ │ +typeindex.hh │ │ │ │ │ +Helper classes to provide indices for geometrytypes for use in a vector. │ │ │ │ │ type.hh │ │ │ │ │ A unique label for each type of element that can occur in a grid. │ │ │ │ │ Dune │ │ │ │ │ Definition affinegeometry.hh:21 │ │ │ │ │ +Dune::QuadratureType::Enum │ │ │ │ │ +Enum │ │ │ │ │ +Definition quadraturerules.hh:82 │ │ │ │ │ +Dune::QuadratureType::GaussJacobi_n_0 │ │ │ │ │ +@ GaussJacobi_n_0 │ │ │ │ │ +Gauss-Legendre rules with . │ │ │ │ │ +Definition quadraturerules.hh:119 │ │ │ │ │ +Dune::QuadratureType::GaussJacobi_2_0 │ │ │ │ │ +@ GaussJacobi_2_0 │ │ │ │ │ +Gauss-Legendre rules with . │ │ │ │ │ +Definition quadraturerules.hh:106 │ │ │ │ │ +Dune::QuadratureType::GaussRadauRight │ │ │ │ │ +@ GaussRadauRight │ │ │ │ │ +Gauss-Radau rules including the right endpoint. │ │ │ │ │ +Definition quadraturerules.hh:144 │ │ │ │ │ +Dune::QuadratureType::GaussJacobi_1_0 │ │ │ │ │ +@ GaussJacobi_1_0 │ │ │ │ │ +Gauss-Jacobi rules with . │ │ │ │ │ +Definition quadraturerules.hh:99 │ │ │ │ │ +Dune::QuadratureType::size │ │ │ │ │ +@ size │ │ │ │ │ +Definition quadraturerules.hh:145 │ │ │ │ │ +Dune::QuadratureType::GaussLobatto │ │ │ │ │ +@ GaussLobatto │ │ │ │ │ +Gauss-Lobatto rules. │ │ │ │ │ +Definition quadraturerules.hh:127 │ │ │ │ │ +Dune::QuadratureType::GaussRadauLeft │ │ │ │ │ +@ GaussRadauLeft │ │ │ │ │ +Gauss-Radau rules including the left endpoint. │ │ │ │ │ +Definition quadraturerules.hh:135 │ │ │ │ │ +Dune::QuadratureType::GaussLegendre │ │ │ │ │ +@ GaussLegendre │ │ │ │ │ +Gauss-Legendre rules (default) │ │ │ │ │ +Definition quadraturerules.hh:92 │ │ │ │ │ +Dune::QuadratureOrderOutOfRange │ │ │ │ │ +Exception thrown if a desired QuadratureRule is not available, because the │ │ │ │ │ +requested order is to high... │ │ │ │ │ +Definition quadraturerules.hh:36 │ │ │ │ │ +Dune::QuadraturePoint │ │ │ │ │ +Single evaluation point in a quadrature rule. │ │ │ │ │ +Definition quadraturerules.hh:44 │ │ │ │ │ +Dune::QuadraturePoint::position │ │ │ │ │ +const Vector & position() const │ │ │ │ │ +return local coordinates of integration point i │ │ │ │ │ +Definition quadraturerules.hh:62 │ │ │ │ │ +Dune::QuadraturePoint::Vector │ │ │ │ │ +Dune::FieldVector< ct, dim > Vector │ │ │ │ │ +Type used for the position of a quadrature point. │ │ │ │ │ +Definition quadraturerules.hh:53 │ │ │ │ │ +Dune::QuadraturePoint::Field │ │ │ │ │ +ct Field │ │ │ │ │ +Number type used for coordinates and quadrature weights. │ │ │ │ │ +Definition quadraturerules.hh:50 │ │ │ │ │ +Dune::QuadraturePoint::weight │ │ │ │ │ +const ct & weight() const │ │ │ │ │ +return weight associated with integration point i │ │ │ │ │ +Definition quadraturerules.hh:68 │ │ │ │ │ +Dune::QuadraturePoint::weight_ │ │ │ │ │ +ct weight_ │ │ │ │ │ +Definition quadraturerules.hh:75 │ │ │ │ │ +Dune::QuadraturePoint::dimension │ │ │ │ │ +static constexpr int dimension │ │ │ │ │ +Dimension of the integration domain. │ │ │ │ │ +Definition quadraturerules.hh:47 │ │ │ │ │ +Dune::QuadraturePoint::QuadraturePoint │ │ │ │ │ +QuadraturePoint(const Vector &x, ct w) │ │ │ │ │ +set up quadrature of given order in d dimensions │ │ │ │ │ +Definition quadraturerules.hh:56 │ │ │ │ │ +Dune::QuadraturePoint::local │ │ │ │ │ +FieldVector< ct, dim > local │ │ │ │ │ +Definition quadraturerules.hh:74 │ │ │ │ │ +Dune::QuadratureRule │ │ │ │ │ +Abstract base class for quadrature rules. │ │ │ │ │ +Definition quadraturerules.hh:154 │ │ │ │ │ +Dune::QuadratureRule::~QuadratureRule │ │ │ │ │ +virtual ~QuadratureRule() │ │ │ │ │ +Definition quadraturerules.hh:181 │ │ │ │ │ +Dune::QuadratureRule::d │ │ │ │ │ +static constexpr int d │ │ │ │ │ +The space dimension. │ │ │ │ │ +Definition quadraturerules.hh:171 │ │ │ │ │ +Dune::QuadratureRule::type │ │ │ │ │ +virtual GeometryType type() const │ │ │ │ │ +return type of element │ │ │ │ │ +Definition quadraturerules.hh:180 │ │ │ │ │ +Dune::QuadratureRule::delivered_order │ │ │ │ │ +int delivered_order │ │ │ │ │ +Definition quadraturerules.hh:189 │ │ │ │ │ +Dune::QuadratureRule::QuadratureRule │ │ │ │ │ +QuadratureRule(GeometryType t, int order) │ │ │ │ │ +Constructor for a given geometry type and a given quadrature order. │ │ │ │ │ +Definition quadraturerules.hh:168 │ │ │ │ │ +Dune::QuadratureRule::geometry_type │ │ │ │ │ +GeometryType geometry_type │ │ │ │ │ +Definition quadraturerules.hh:188 │ │ │ │ │ +Dune::QuadratureRule::CoordType │ │ │ │ │ +ct CoordType │ │ │ │ │ +The type used for coordinates. │ │ │ │ │ +Definition quadraturerules.hh:174 │ │ │ │ │ +Dune::QuadratureRule::QuadratureRule │ │ │ │ │ +QuadratureRule() │ │ │ │ │ +Default constructor. │ │ │ │ │ +Definition quadraturerules.hh:161 │ │ │ │ │ +Dune::QuadratureRule::order │ │ │ │ │ +virtual int order() const │ │ │ │ │ +return order │ │ │ │ │ +Definition quadraturerules.hh:177 │ │ │ │ │ +Dune::QuadratureRule::QuadratureRule │ │ │ │ │ +QuadratureRule(GeometryType t) │ │ │ │ │ +Constructor for a given geometry type. Leaves the quadrature order invalid │ │ │ │ │ +Definition quadraturerules.hh:165 │ │ │ │ │ +Dune::QuadratureRule::iterator │ │ │ │ │ +std::vector< QuadraturePoint< ct, dim > >::const_iterator iterator │ │ │ │ │ +Definition quadraturerules.hh:185 │ │ │ │ │ +Dune::QuadratureRuleFactory │ │ │ │ │ +Factory class for creation of quadrature rules, depending on GeometryType, │ │ │ │ │ +order and QuadratureType. │ │ │ │ │ +Definition quadraturerules.hh:310 │ │ │ │ │ +Dune::QuadratureRules │ │ │ │ │ +A container for all quadrature rules of dimension dim │ │ │ │ │ +Definition quadraturerules.hh:200 │ │ │ │ │ +Dune::QuadratureRules::maxOrder │ │ │ │ │ +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 │ │ │ │ │ +Dune::QuadratureRules::rule │ │ │ │ │ +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 │ │ │ │ │ +Dune::QuadratureRules::rule │ │ │ │ │ +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 │ │ │ │ │ Dune::GeometryType │ │ │ │ │ Unique label for each type of entities that can occur in DUNE grids. │ │ │ │ │ Definition type.hh:126 │ │ │ │ │ -Dune::GeometryType::toId │ │ │ │ │ -constexpr Id toId() const │ │ │ │ │ -Create an Id representation of this GeometryType. │ │ │ │ │ -Definition type.hh:222 │ │ │ │ │ +Dune::GeometryType::isPrism │ │ │ │ │ +constexpr bool isPrism() const │ │ │ │ │ +Return true if entity is a prism. │ │ │ │ │ +Definition type.hh:321 │ │ │ │ │ +Dune::GeometryType::isVertex │ │ │ │ │ +constexpr bool isVertex() const │ │ │ │ │ +Return true if entity is a vertex. │ │ │ │ │ +Definition type.hh:291 │ │ │ │ │ Dune::GeometryType::dim │ │ │ │ │ constexpr unsigned int dim() const │ │ │ │ │ Return dimension of the type. │ │ │ │ │ Definition type.hh:372 │ │ │ │ │ +Dune::GeometryType::BasicType │ │ │ │ │ +BasicType │ │ │ │ │ +Each entity can be tagged by one of these basic types plus its space dimension. │ │ │ │ │ +Definition type.hh:132 │ │ │ │ │ +Dune::GeometryType::isLine │ │ │ │ │ +constexpr bool isLine() const │ │ │ │ │ +Return true if entity is a line segment. │ │ │ │ │ +Definition type.hh:296 │ │ │ │ │ Dune::GeometryType::id │ │ │ │ │ constexpr unsigned int id() const │ │ │ │ │ Return the topology id of the type. │ │ │ │ │ Definition type.hh:377 │ │ │ │ │ -Dune::GeometryType::isNone │ │ │ │ │ -constexpr bool isNone() const │ │ │ │ │ -Return true if entity is a singular of any dimension. │ │ │ │ │ -Definition type.hh:367 │ │ │ │ │ -Dune::LocalGeometryTypeIndex │ │ │ │ │ -Compute per-dimension indices for geometry types. │ │ │ │ │ -Definition typeindex.hh:25 │ │ │ │ │ +Dune::GeometryType::isSimplex │ │ │ │ │ +constexpr bool isSimplex() const │ │ │ │ │ +Return true if entity is a simplex of any dimension. │ │ │ │ │ +Definition type.hh:331 │ │ │ │ │ Dune::LocalGeometryTypeIndex::size │ │ │ │ │ static constexpr std::size_t size(std::size_t dim) │ │ │ │ │ Compute total number of geometry types for the given dimension. │ │ │ │ │ Definition typeindex.hh:61 │ │ │ │ │ -Dune::LocalGeometryTypeIndex::type │ │ │ │ │ -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 │ │ │ │ │ Dune::LocalGeometryTypeIndex::index │ │ │ │ │ static constexpr std::size_t index(const GeometryType >) │ │ │ │ │ Compute the index for the given geometry type within its dimension. │ │ │ │ │ Definition typeindex.hh:73 │ │ │ │ │ -Dune::GlobalGeometryTypeIndex │ │ │ │ │ -Compute indices for geometry types, taking the dimension into account. │ │ │ │ │ -Definition typeindex.hh:90 │ │ │ │ │ -Dune::GlobalGeometryTypeIndex::index │ │ │ │ │ -static constexpr std::size_t index(const GeometryType >) │ │ │ │ │ -Compute the index for the given geometry type over all dimensions. │ │ │ │ │ -Definition typeindex.hh:138 │ │ │ │ │ -Dune::GlobalGeometryTypeIndex::offset │ │ │ │ │ -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 │ │ │ │ │ -Dune::GlobalGeometryTypeIndex::size │ │ │ │ │ -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 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00182.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: generalvertexorder.hh File Reference │ │ │ │ +dune-geometry: virtualrefinement.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -73,49 +73,51 @@ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces | │ │ │ │ Functions
│ │ │ │ -
generalvertexorder.hh File Reference
│ │ │ │ +
virtualrefinement.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <algorithm>
│ │ │ │ -#include <cassert>
│ │ │ │ -#include <cstddef>
│ │ │ │ -#include <iterator>
│ │ │ │ -#include <vector>
│ │ │ │ -#include <dune/common/iteratorfacades.hh>
│ │ │ │ -#include "type.hh"
│ │ │ │ -#include <dune/geometry/referenceelements.hh>
│ │ │ │ + │ │ │ │ +

This file contains the virtual wrapper around refinement. │ │ │ │ +More...

│ │ │ │ +
#include <vector>
│ │ │ │ +#include <dune/common/fvector.hh>
│ │ │ │ +#include "refinement.hh"
│ │ │ │ +#include "type.hh"
│ │ │ │ +#include "virtualrefinement.cc"
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::GeneralVertexOrder< dim, Index_ >
 Class providing information on the ordering of vertices. More...
class  Dune::VirtualRefinement< dimension, CoordType >
 VirtualRefinement base class. More...
 
class  Dune::GeneralVertexOrder< dim, Index_ >::iterator
 Iterate over the vertex indices of some sub-entity. More...
struct  Dune::VirtualRefinement< dimension, CoordType >::Codim< codimension >
 codim database of VirtualRefinement More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

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

Detailed Description

│ │ │ │ +

This file contains the virtual wrapper around refinement.

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

Go to the source code of this file.

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

│ │ │ │ +Classes

struct  Dune::Geo::ReferenceElements< ctype_, dim >
 Class providing access to the singletons of the reference elements. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::Geo
 
namespace  Dune::Transitional
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +Typedefs

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

│ │ │ │ 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.
 
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.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -6,24 +6,62 @@ │ │ │ │ │ dune-geometry 2.9.0 │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ - * utility │ │ │ │ │ -Namespaces | Functions │ │ │ │ │ -typefromvertexcount.hh File Reference │ │ │ │ │ +Classes | Namespaces | Typedefs | Functions │ │ │ │ │ +referenceelements.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ + Classes │ │ │ │ │ +struct  Dune::Geo::ReferenceElements<_ctype_,_dim_> │ │ │ │ │ +  Class providing access to the singletons of the reference elements. │ │ │ │ │ + More... │ │ │ │ │ +  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ +namespace  Dune::Geo │ │ │ │ │ +  │ │ │ │ │ +namespace  Dune::Transitional │ │ │ │ │ +  │ │ │ │ │ + Typedefs │ │ │ │ │ +template │ │ │ │ │ +using Dune::ReferenceElement = unspecified-type │ │ │ │ │ +  Returns the type of reference element for the argument type T. │ │ │ │ │ +  │ │ │ │ │ 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. │ │ │ │ │ +template │ │ │ │ │ +unspecified value type Dune::referenceElement (T &&... t) │ │ │ │ │ +  Returns a reference element for the objects t.... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ + auto Dune::referenceElement (const Dune::GeometryType >, │ │ │ │ │ + Dune::Dim< dim >={}) │ │ │ │ │ +  Returns a reference element of dimension dim for the │ │ │ │ │ + given geometry type and coordinate field type. │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +>::value, int > = 0> │ │ │ │ │ + auto Dune::referenceElement (const T &, const Dune:: │ │ │ │ │ + GeometryType >, Dune::Dim< dim >) │ │ │ │ │ +  Returns a reference element of dimension dim for the │ │ │ │ │ + given geometry type and coordinate field type. │ │ │ │ │   │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00185_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: typefromvertexcount.hh Source File │ │ │ │ +dune-geometry: referenceelements.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,77 +70,425 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
typefromvertexcount.hh
│ │ │ │ +
referenceelements.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
│ │ │ │ -
5#ifndef DUNE_GEOMETRY_TYPE_FROM_VERTEX_COUNT_HH
│ │ │ │ -
6#define DUNE_GEOMETRY_TYPE_FROM_VERTEX_COUNT_HH
│ │ │ │ +
5#ifndef DUNE_GEOMETRY_REFERENCEELEMENTS_HH
│ │ │ │ +
6#define DUNE_GEOMETRY_REFERENCEELEMENTS_HH
│ │ │ │
7
│ │ │ │ - │ │ │ │ +
8#include <cassert>
│ │ │ │
9
│ │ │ │ -
10namespace Dune {
│ │ │ │ -
11
│ │ │ │ -
16 inline
│ │ │ │ -
│ │ │ │ -
17 GeometryType geometryTypeFromVertexCount(unsigned int dim, unsigned int vertices)
│ │ │ │ -
18 {
│ │ │ │ -
19 switch (dim)
│ │ │ │ -
20 {
│ │ │ │ -
21 case 0 :
│ │ │ │ -
22 return GeometryTypes::vertex;
│ │ │ │ -
23 case 1 :
│ │ │ │ -
24 return GeometryTypes::line;
│ │ │ │ -
25 case 2 :
│ │ │ │ -
26 switch (vertices) {
│ │ │ │ -
27 case 3 :
│ │ │ │ -
28 return GeometryTypes::triangle;
│ │ │ │ -
29 case 4 :
│ │ │ │ -
30 return GeometryTypes::quadrilateral;
│ │ │ │ -
31 default :
│ │ │ │ -
32 DUNE_THROW(NotImplemented, "2d elements with " << vertices << " corners are not supported!");
│ │ │ │ -
33 }
│ │ │ │ -
34 case 3 :
│ │ │ │ -
35 switch (vertices) {
│ │ │ │ -
36 case 4 :
│ │ │ │ -
37 return GeometryTypes::tetrahedron;
│ │ │ │ -
38 case 5 :
│ │ │ │ -
39 return GeometryTypes::pyramid;
│ │ │ │ -
40 case 6 :
│ │ │ │ -
41 return GeometryTypes::prism;
│ │ │ │ -
42 case 8 :
│ │ │ │ -
43 return GeometryTypes::hexahedron;
│ │ │ │ -
44 default :
│ │ │ │ -
45 DUNE_THROW(NotImplemented, "3d elements with " << vertices << " corners are not supported!");
│ │ │ │ -
46 }
│ │ │ │ -
47 default :
│ │ │ │ -
48 DUNE_THROW(NotImplemented, "geometryTypeFromVertexCount works only up to dim=3");
│ │ │ │ -
49 }
│ │ │ │ -
50 }
│ │ │ │ -
│ │ │ │ -
51
│ │ │ │ -
52}
│ │ │ │ -
53
│ │ │ │ -
54#endif // DUNE_GEOMETRY_TYPE_FROM_VERTEX_COUNT_HH
│ │ │ │ -
A unique label for each type of element that can occur in a grid.
│ │ │ │ +
10#include <algorithm>
│ │ │ │ +
11#include <limits>
│ │ │ │ +
12#include <tuple>
│ │ │ │ +
13#include <utility>
│ │ │ │ +
14#include <vector>
│ │ │ │ +
15#include <array>
│ │ │ │ +
16
│ │ │ │ +
17#include <dune/common/typetraits.hh>
│ │ │ │ +
18#include <dune/common/std/type_traits.hh>
│ │ │ │ +
19#include <dune/common/visibility.hh>
│ │ │ │ +
20
│ │ │ │ + │ │ │ │ +
22#include <dune/geometry/type.hh>
│ │ │ │ + │ │ │ │ + │ │ │ │ +
25
│ │ │ │ +
26namespace Dune
│ │ │ │ +
27{
│ │ │ │ +
28
│ │ │ │ +
29 namespace Geo
│ │ │ │ +
30 {
│ │ │ │ +
31
│ │ │ │ +
32#ifndef DOXYGEN
│ │ │ │ +
33
│ │ │ │ +
34
│ │ │ │ +
35 template<typename ctype, int dim>
│ │ │ │ +
36 class DeprecatedReferenceElement
│ │ │ │ +
37 : public ReferenceElement<ReferenceElementImplementation<ctype,dim>>
│ │ │ │ +
38 {
│ │ │ │ +
39
│ │ │ │ +
40 protected:
│ │ │ │ +
41
│ │ │ │ +
42 DeprecatedReferenceElement() = default;
│ │ │ │ +
43
│ │ │ │ +
44 public:
│ │ │ │ +
45
│ │ │ │ +
46 DeprecatedReferenceElement(const DeprecatedReferenceElement&) = delete;
│ │ │ │ +
47 DeprecatedReferenceElement& operator=(const DeprecatedReferenceElement&) = delete;
│ │ │ │ +
48
│ │ │ │ +
49 DeprecatedReferenceElement(const ReferenceElementImplementation<ctype,dim>& impl)
│ │ │ │ +
50 : ReferenceElement<ReferenceElementImplementation<ctype,dim>>(impl)
│ │ │ │ +
51 {}
│ │ │ │ +
52
│ │ │ │ +
53 };
│ │ │ │ +
54
│ │ │ │ +
55
│ │ │ │ +
56 template<typename ctype, int dim>
│ │ │ │ +
57 class ConstructibleDeprecatedReferenceElement
│ │ │ │ +
58 : public DeprecatedReferenceElement<ctype,dim>
│ │ │ │ +
59 {
│ │ │ │ +
60 public:
│ │ │ │ +
61 ConstructibleDeprecatedReferenceElement() = default;
│ │ │ │ +
62 };
│ │ │ │ +
63
│ │ │ │ +
64
│ │ │ │ +
65 namespace Impl
│ │ │ │ +
66 {
│ │ │ │ +
67
│ │ │ │ +
68 // ReferenceElementContainer
│ │ │ │ +
69 // -------------------------
│ │ │ │ +
70
│ │ │ │ +
71 template< class ctype, int dim >
│ │ │ │ +
72 class ReferenceElementContainer
│ │ │ │ +
73 {
│ │ │ │ +
74 static const unsigned int numTopologies = dim >= 0 ? (1u << dim) : 0;
│ │ │ │ +
75
│ │ │ │ +
76 using Implementation = ReferenceElementImplementation< ctype, dim >;
│ │ │ │ +
77 using ConstructibleDeprecatedReferenceElement = Dune::Geo::ConstructibleDeprecatedReferenceElement<ctype,dim>;
│ │ │ │ +
78
│ │ │ │ +
79 public:
│ │ │ │ +
80
│ │ │ │ +
81 using DeprecatedReferenceElement = Dune::Geo::DeprecatedReferenceElement<ctype,dim>;
│ │ │ │ +
82
│ │ │ │ +
83 using ReferenceElement = Dune::Geo::ReferenceElement< Implementation >;
│ │ │ │ +
84 using value_type = ReferenceElement;
│ │ │ │ +
85 using const_iterator = const value_type*;
│ │ │ │ +
86
│ │ │ │ +
87 ReferenceElementContainer ()
│ │ │ │ +
88 {
│ │ │ │ +
89 for( unsigned int topologyId = 0; topologyId < numTopologies; ++topologyId )
│ │ │ │ +
90 {
│ │ │ │ +
91 implementations_[ topologyId ].initialize( topologyId );
│ │ │ │ +
92 reference_elements_[ topologyId ].setImplementation( implementations_[ topologyId ] );
│ │ │ │ +
93 }
│ │ │ │ +
94 }
│ │ │ │ +
95
│ │ │ │ +
96 const ReferenceElement& operator() ( const GeometryType &type ) const
│ │ │ │ +
97 {
│ │ │ │ +
98 assert( type.dim() == dim );
│ │ │ │ +
99 return reference_elements_[ type.id() ];
│ │ │ │ +
100 }
│ │ │ │ +
101
│ │ │ │ +
102 const ReferenceElement& simplex () const
│ │ │ │ +
103 {
│ │ │ │ +
104 return reference_elements_[ Dune::GeometryTypes::simplex(dim).id() ];
│ │ │ │ +
105 }
│ │ │ │ +
106
│ │ │ │ +
107 const ReferenceElement& cube () const
│ │ │ │ +
108 {
│ │ │ │ +
109 return reference_elements_[ Dune::GeometryTypes::cube(dim).id() ];
│ │ │ │ +
110 }
│ │ │ │ +
111
│ │ │ │ +
112 const ReferenceElement& pyramid () const
│ │ │ │ +
113 {
│ │ │ │ +
114 return reference_elements_[ Dune::GeometryTypes::pyramid.id() ];
│ │ │ │ +
115 }
│ │ │ │ +
116
│ │ │ │ +
117 const ReferenceElement& prism () const
│ │ │ │ +
118 {
│ │ │ │ +
119 return reference_elements_[ Dune::GeometryTypes::prism.id() ];
│ │ │ │ +
120 }
│ │ │ │ +
121
│ │ │ │ +
122 const_iterator begin () const
│ │ │ │ +
123 {
│ │ │ │ +
124 return reference_elements_.data();
│ │ │ │ +
125 }
│ │ │ │ +
126
│ │ │ │ +
127 const_iterator end () const
│ │ │ │ +
128 {
│ │ │ │ +
129 return reference_elements_.data() + numTopologies;
│ │ │ │ +
130 }
│ │ │ │ +
131
│ │ │ │ +
132 // here, we make sure to actually return a const reference to something
│ │ │ │ +
133 // that is guaranteed not to become invalid, as otherwise, we might run
│ │ │ │ +
134 // straight into debugging hell when a user binds the return value to a
│ │ │ │ +
135 // const ref and the temporary goes out of scope.
│ │ │ │ +
136 const DeprecatedReferenceElement& deprecated(const ReferenceElement& v) const
│ │ │ │ +
137 {
│ │ │ │ +
138 return reference_elements_[v.impl().type(0,0).id()];
│ │ │ │ +
139 }
│ │ │ │ +
140
│ │ │ │ +
141 private:
│ │ │ │ +
142
│ │ │ │ +
143 std::array<Implementation,numTopologies> implementations_;
│ │ │ │ +
144 std::array<ConstructibleDeprecatedReferenceElement,numTopologies> reference_elements_;
│ │ │ │ +
145
│ │ │ │ +
146 };
│ │ │ │ +
147
│ │ │ │ +
148
│ │ │ │ +
149 } // namespace Impl
│ │ │ │ +
150
│ │ │ │ +
151
│ │ │ │ +
152#endif // DOXYGEN
│ │ │ │ +
153
│ │ │ │ +
154
│ │ │ │ +
155 // ReferenceElements
│ │ │ │ +
156 // ------------------------
│ │ │ │ +
157
│ │ │ │ +
168 template< class ctype_, int dim >
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
170 {
│ │ │ │ +
171
│ │ │ │ +
173 using ctype = ctype_;
│ │ │ │ +
174
│ │ │ │ + │ │ │ │ +
177
│ │ │ │ +
179 static constexpr int dimension = dim;
│ │ │ │ +
180
│ │ │ │ +
181 private:
│ │ │ │ +
182
│ │ │ │ +
183 using Container = Impl::ReferenceElementContainer< ctype, dim >;
│ │ │ │ +
184
│ │ │ │ +
185 public:
│ │ │ │ +
186
│ │ │ │ +
188 using ReferenceElement = typename Container::ReferenceElement;
│ │ │ │ +
189
│ │ │ │ +
191 using Iterator = typename Container::const_iterator;
│ │ │ │ +
192
│ │ │ │ + │ │ │ │ +
195
│ │ │ │ +
197 static const ReferenceElement&
│ │ │ │ +
│ │ │ │ +
198 general ( const GeometryType& type )
│ │ │ │ +
199 {
│ │ │ │ +
200 return container() ( type );
│ │ │ │ +
201 }
│ │ │ │ +
│ │ │ │ +
202
│ │ │ │ +
│ │ │ │ +
204 static const ReferenceElement& simplex ()
│ │ │ │ +
205 {
│ │ │ │ +
206 return container().simplex();
│ │ │ │ +
207 }
│ │ │ │ +
│ │ │ │ +
208
│ │ │ │ +
│ │ │ │ +
210 static const ReferenceElement& cube ()
│ │ │ │ +
211 {
│ │ │ │ +
212 return container().cube();
│ │ │ │ +
213 }
│ │ │ │ +
│ │ │ │ +
214
│ │ │ │ +
│ │ │ │ +
215 static Iterator begin ()
│ │ │ │ +
216 {
│ │ │ │ +
217 return container().begin();
│ │ │ │ +
218 }
│ │ │ │ +
│ │ │ │ +
219
│ │ │ │ +
│ │ │ │ +
220 static Iterator end ()
│ │ │ │ +
221 {
│ │ │ │ +
222 return container().end();
│ │ │ │ +
223 }
│ │ │ │ +
│ │ │ │ +
224
│ │ │ │ +
225#ifndef DOXYGEN
│ │ │ │ +
226 static const typename Container::DeprecatedReferenceElement&
│ │ │ │ +
227 deprecated(const ReferenceElement& v)
│ │ │ │ +
228 {
│ │ │ │ +
229 return container().deprecated(v);
│ │ │ │ +
230 }
│ │ │ │ +
231#endif // DOXYGEN
│ │ │ │ +
232
│ │ │ │ +
233 private:
│ │ │ │ +
234
│ │ │ │ +
235 DUNE_EXPORT static const Container& container ()
│ │ │ │ +
236 {
│ │ │ │ +
237 static Container container;
│ │ │ │ +
238 return container;
│ │ │ │ +
239 }
│ │ │ │ +
240 };
│ │ │ │ +
│ │ │ │ +
241
│ │ │ │ +
242 } // namespace Geo
│ │ │ │ +
243
│ │ │ │ +
245 using Geo::ReferenceElements;
│ │ │ │ +
246
│ │ │ │ +
247
│ │ │ │ +
248#ifdef DOXYGEN
│ │ │ │ +
249
│ │ │ │ +
251
│ │ │ │ +
294 template<typename... T>
│ │ │ │ +
295 unspecified-value-type referenceElement(T&&... t);
│ │ │ │ +
296
│ │ │ │ +
297#endif
│ │ │ │ +
298
│ │ │ │ +
299
│ │ │ │ +
301
│ │ │ │ +
314 template<typename T, int dim>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
316 {
│ │ │ │ + │ │ │ │ +
318 }
│ │ │ │ +
│ │ │ │ +
319
│ │ │ │ +
320
│ │ │ │ +
322
│ │ │ │ +
334 template<typename T, int dim, std::enable_if_t<IsNumber<std::decay_t<T>>::value, int> = 0>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
336 {
│ │ │ │ + │ │ │ │ +
338 }
│ │ │ │ +
│ │ │ │ +
339
│ │ │ │ +
340
│ │ │ │ +
341#ifndef DOXYGEN
│ │ │ │ +
342
│ │ │ │ +
343 // helpers for the ReferenceElement<> meta function
│ │ │ │ +
344
│ │ │ │ +
345 namespace Impl {
│ │ │ │ +
346
│ │ │ │ +
347 // Evaluates to the correct reference element iff <T...> matches the pattern <number_type,Dim<int>>
│ │ │ │ +
348 // otherwise, it's ill-formed. Should be used with detected_or and friends.
│ │ │ │ +
349
│ │ │ │ +
350 template<typename... T>
│ │ │ │ +
351 struct DefaultReferenceElementExtractor;
│ │ │ │ +
352
│ │ │ │ +
353 template<typename T, typename std::enable_if<IsNumber<T>::value,int>::type dim>
│ │ │ │ +
354 struct DefaultReferenceElementExtractor<T,Dim<dim>>
│ │ │ │ +
355 {
│ │ │ │ + │ │ │ │ +
357 };
│ │ │ │ +
358
│ │ │ │ +
359 template<typename... T>
│ │ │ │ +
360 using DefaultReferenceElement = typename DefaultReferenceElementExtractor<T...>::type;
│ │ │ │ +
361
│ │ │ │ +
362 }
│ │ │ │ +
363
│ │ │ │ +
364 // looks up the type of a reference element by trying to instantiate the correct overload
│ │ │ │ +
365 // of referenceElement() for the given arguments. This will fail if there is no valid
│ │ │ │ +
366 // overload and should be used with detected_or or some other utility that places the
│ │ │ │ +
367 // instantiation in SFINAE context.
│ │ │ │ +
368 //
│ │ │ │ +
369 // this is placed directly in namespace Dune to avoid any weird surprises
│ │ │ │ +
370
│ │ │ │ +
371 template<typename... T>
│ │ │ │ +
372 using LookupReferenceElement = decltype(referenceElement(std::declval<T>()...));
│ │ │ │ +
373
│ │ │ │ +
374#endif // DOXYGEN
│ │ │ │ +
375
│ │ │ │ +
│ │ │ │ +
376 namespace Transitional {
│ │ │ │ +
377
│ │ │ │ +
378#ifndef DOXYGEN
│ │ │ │ +
379
│ │ │ │ +
380 // this abomination checks whether the template signature matches the special case
│ │ │ │ +
381 // ReferenceElement<number_type,Dune::Dim<int>> and otherwise defers the type lookup
│ │ │ │ +
382 // to a decltype on a call to referenceElement(std::declval<T>())
│ │ │ │ +
383
│ │ │ │ +
384 template<typename... T>
│ │ │ │ +
385 using ReferenceElement = Std::detected_or_t<
│ │ │ │ +
386 Std::detected_t<LookupReferenceElement,T...>,
│ │ │ │ +
387 Impl::DefaultReferenceElement,
│ │ │ │ +
388 T...
│ │ │ │ +
389 >;
│ │ │ │ +
390
│ │ │ │ +
391#else // DOXYGEN
│ │ │ │ +
392
│ │ │ │ +
394
│ │ │ │ +
416 template<typename... T>
│ │ │ │ +
417 using ReferenceElement = unspecified-type;
│ │ │ │ +
418
│ │ │ │ +
419#endif //DOXYGEN
│ │ │ │ +
420
│ │ │ │ +
421 }
│ │ │ │ +
│ │ │ │ +
422
│ │ │ │ +
423#ifndef DOXYGEN
│ │ │ │ +
424
│ │ │ │ +
425 namespace Impl {
│ │ │ │ +
426
│ │ │ │ +
427 // helpers for triggering a deprecation warning for occurrences of the old
│ │ │ │ +
428 // ReferenceElement syntax (Dune::ReferenceElement<T,int>)
│ │ │ │ +
429
│ │ │ │ +
430 // this looks a little weird, encoding the type in the return type of a nested function,
│ │ │ │ +
431 // but it was the only reliable way to trigger the warning iff the compiler encounters
│ │ │ │ +
432 // an invalid use. Other solutions either miss some (or all) uses or trigger false alarms.
│ │ │ │ +
433
│ │ │ │ +
434 template<typename T>
│ │ │ │ +
435 struct ValidReferenceElementTypeSignature
│ │ │ │ +
436 {
│ │ │ │ +
437 Transitional::ReferenceElement<T> check();
│ │ │ │ +
438 };
│ │ │ │ +
439
│ │ │ │ +
440 template<typename T>
│ │ │ │ +
441 struct DeprecatedReferenceElementTypeSignature
│ │ │ │ +
442 {
│ │ │ │ +
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();
│ │ │ │ +
444 };
│ │ │ │ +
445
│ │ │ │ +
446 } // namespace Impl
│ │ │ │ +
447
│ │ │ │ +
448 // This just makes sure the user doesn't use invalid syntax (by checking against the -1 default for
│ │ │ │ +
449 // the dimension, and then either hands back the old-style type along with a deprecation warning or
│ │ │ │ +
450 // forwards to the transitional version
│ │ │ │ +
451 template<typename T, int dim = -1>
│ │ │ │ +
452 using ReferenceElement = decltype(
│ │ │ │ +
453 std::declval<
│ │ │ │ +
454 typename std::conditional<
│ │ │ │ +
455 dim == -1,
│ │ │ │ +
456 Impl::ValidReferenceElementTypeSignature<T>,
│ │ │ │ +
457 Impl::DeprecatedReferenceElementTypeSignature<Geo::DeprecatedReferenceElement<T,dim>>
│ │ │ │ +
458 >::type
│ │ │ │ +
459 >().check());
│ │ │ │ +
460
│ │ │ │ +
461#else // DOXYGEN
│ │ │ │ +
462
│ │ │ │ +
464
│ │ │ │ +
496 template<typename T, int dim>
│ │ │ │ +
497 using ReferenceElement = unspecified-type;
│ │ │ │ +
498
│ │ │ │ +
499#endif // DOXYGEN
│ │ │ │ +
500
│ │ │ │ +
501
│ │ │ │ +
502
│ │ │ │ +
503} // namespace Dune
│ │ │ │ +
504
│ │ │ │ +
505#endif // #ifndef DUNE_GEOMETRY_REFERENCEELEMENTS_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ +
A unique label for each type of element that can occur in a grid.
│ │ │ │ + │ │ │ │ +
unspecified value type referenceElement(T &&... t)
Returns a reference element for the objects t....
│ │ │ │ +
unspecified-type ReferenceElement
Returns the type of reference element for the argument type T.
Definition referenceelements.hh:497
│ │ │ │
Definition affinegeometry.hh:21
│ │ │ │ -
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
│ │ │ │ +
This class provides access to geometric and topological properties of a reference element.
Definition referenceelement.hh:52
│ │ │ │ +
Class providing access to the singletons of the reference elements.
Definition referenceelements.hh:170
│ │ │ │ +
static Iterator begin()
Definition referenceelements.hh:215
│ │ │ │ +
Iterator iterator
Iterator over available reference elements.
Definition referenceelements.hh:194
│ │ │ │ +
typename Container::ReferenceElement ReferenceElement
The reference element type.
Definition referenceelements.hh:188
│ │ │ │ +
static const ReferenceElement & cube()
get hypercube reference elements
Definition referenceelements.hh:210
│ │ │ │ +
static Iterator end()
Definition referenceelements.hh:220
│ │ │ │ +
ctype_ ctype
The coordinate field type of the contained reference elements.
Definition referenceelements.hh:173
│ │ │ │ +
static const ReferenceElement & general(const GeometryType &type)
get general reference elements
Definition referenceelements.hh:198
│ │ │ │ +
static const ReferenceElement & simplex()
get simplex reference elements
Definition referenceelements.hh:204
│ │ │ │ +
typename Container::const_iterator Iterator
Iterator over available reference elements.
Definition referenceelements.hh:191
│ │ │ │ +
static constexpr int dimension
The dimension of the contained reference elements.
Definition referenceelements.hh:179
│ │ │ │ +
ctype CoordinateField
The coordinate field type of the contained reference elements.
Definition referenceelements.hh:176
│ │ │ │ +
Static tag representing a dimension.
Definition dimension.hh:16
│ │ │ │
Unique label for each type of entities that can occur in DUNE grids.
Definition type.hh:126
│ │ │ │ +
constexpr unsigned int id() const
Return the topology id of the type.
Definition type.hh:377
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -7,81 +7,480 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ - * utility │ │ │ │ │ -typefromvertexcount.hh │ │ │ │ │ +referenceelements.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception │ │ │ │ │ - 5#ifndef DUNE_GEOMETRY_TYPE_FROM_VERTEX_COUNT_HH │ │ │ │ │ - 6#define DUNE_GEOMETRY_TYPE_FROM_VERTEX_COUNT_HH │ │ │ │ │ + 5#ifndef DUNE_GEOMETRY_REFERENCEELEMENTS_HH │ │ │ │ │ + 6#define DUNE_GEOMETRY_REFERENCEELEMENTS_HH │ │ │ │ │ 7 │ │ │ │ │ - 8#include │ │ │ │ │ + 8#include │ │ │ │ │ 9 │ │ │ │ │ - 10namespace Dune { │ │ │ │ │ - 11 │ │ │ │ │ - 16 inline │ │ │ │ │ -17 GeometryType geometryTypeFromVertexCount(unsigned int dim, unsigned int │ │ │ │ │ -vertices) │ │ │ │ │ - 18 { │ │ │ │ │ - 19 switch (dim) │ │ │ │ │ - 20 { │ │ │ │ │ - 21 case 0 : │ │ │ │ │ - 22 return GeometryTypes::vertex; │ │ │ │ │ - 23 case 1 : │ │ │ │ │ - 24 return GeometryTypes::line; │ │ │ │ │ - 25 case 2 : │ │ │ │ │ - 26 switch (vertices) { │ │ │ │ │ - 27 case 3 : │ │ │ │ │ - 28 return GeometryTypes::triangle; │ │ │ │ │ - 29 case 4 : │ │ │ │ │ - 30 return GeometryTypes::quadrilateral; │ │ │ │ │ - 31 default : │ │ │ │ │ - 32 DUNE_THROW(NotImplemented, "2d elements with " << vertices << " corners are │ │ │ │ │ -not supported!"); │ │ │ │ │ - 33 } │ │ │ │ │ - 34 case 3 : │ │ │ │ │ - 35 switch (vertices) { │ │ │ │ │ - 36 case 4 : │ │ │ │ │ - 37 return GeometryTypes::tetrahedron; │ │ │ │ │ - 38 case 5 : │ │ │ │ │ - 39 return GeometryTypes::pyramid; │ │ │ │ │ - 40 case 6 : │ │ │ │ │ - 41 return GeometryTypes::prism; │ │ │ │ │ - 42 case 8 : │ │ │ │ │ - 43 return GeometryTypes::hexahedron; │ │ │ │ │ - 44 default : │ │ │ │ │ - 45 DUNE_THROW(NotImplemented, "3d elements with " << vertices << " corners are │ │ │ │ │ -not supported!"); │ │ │ │ │ - 46 } │ │ │ │ │ - 47 default : │ │ │ │ │ - 48 DUNE_THROW(NotImplemented, "geometryTypeFromVertexCount works only up to │ │ │ │ │ -dim=3"); │ │ │ │ │ - 49 } │ │ │ │ │ - 50 } │ │ │ │ │ - 51 │ │ │ │ │ - 52} │ │ │ │ │ - 53 │ │ │ │ │ - 54#endif // DUNE_GEOMETRY_TYPE_FROM_VERTEX_COUNT_HH │ │ │ │ │ + 10#include │ │ │ │ │ + 11#include │ │ │ │ │ + 12#include │ │ │ │ │ + 13#include │ │ │ │ │ + 14#include │ │ │ │ │ + 15#include │ │ │ │ │ + 16 │ │ │ │ │ + 17#include │ │ │ │ │ + 18#include │ │ │ │ │ + 19#include │ │ │ │ │ + 20 │ │ │ │ │ + 21#include │ │ │ │ │ + 22#include │ │ │ │ │ + 23#include │ │ │ │ │ + 24#include │ │ │ │ │ + 25 │ │ │ │ │ + 26namespace Dune │ │ │ │ │ + 27{ │ │ │ │ │ + 28 │ │ │ │ │ + 29 namespace Geo │ │ │ │ │ + 30 { │ │ │ │ │ + 31 │ │ │ │ │ + 32#ifndef DOXYGEN │ │ │ │ │ + 33 │ │ │ │ │ + 34 │ │ │ │ │ + 35 template │ │ │ │ │ + 36 class DeprecatedReferenceElement │ │ │ │ │ + 37 : public ReferenceElement> │ │ │ │ │ + 38 { │ │ │ │ │ + 39 │ │ │ │ │ + 40 protected: │ │ │ │ │ + 41 │ │ │ │ │ + 42 DeprecatedReferenceElement() = default; │ │ │ │ │ + 43 │ │ │ │ │ + 44 public: │ │ │ │ │ + 45 │ │ │ │ │ + 46 DeprecatedReferenceElement(const DeprecatedReferenceElement&) = delete; │ │ │ │ │ + 47 DeprecatedReferenceElement& operator=(const DeprecatedReferenceElement&) = │ │ │ │ │ +delete; │ │ │ │ │ + 48 │ │ │ │ │ + 49 DeprecatedReferenceElement(const ReferenceElementImplementation& │ │ │ │ │ +impl) │ │ │ │ │ + 50 : ReferenceElement>(impl) │ │ │ │ │ + 51 {} │ │ │ │ │ + 52 │ │ │ │ │ + 53 }; │ │ │ │ │ + 54 │ │ │ │ │ + 55 │ │ │ │ │ + 56 template │ │ │ │ │ + 57 class ConstructibleDeprecatedReferenceElement │ │ │ │ │ + 58 : public DeprecatedReferenceElement │ │ │ │ │ + 59 { │ │ │ │ │ + 60 public: │ │ │ │ │ + 61 ConstructibleDeprecatedReferenceElement() = default; │ │ │ │ │ + 62 }; │ │ │ │ │ + 63 │ │ │ │ │ + 64 │ │ │ │ │ + 65 namespace Impl │ │ │ │ │ + 66 { │ │ │ │ │ + 67 │ │ │ │ │ + 68 // ReferenceElementContainer │ │ │ │ │ + 69 // ------------------------- │ │ │ │ │ + 70 │ │ │ │ │ + 71 template< class ctype, int dim > │ │ │ │ │ + 72 class ReferenceElementContainer │ │ │ │ │ + 73 { │ │ │ │ │ + 74 static const unsigned int numTopologies = dim >= 0 ? (1u << dim) : 0; │ │ │ │ │ + 75 │ │ │ │ │ + 76 using Implementation = ReferenceElementImplementation< ctype, dim >; │ │ │ │ │ + 77 using ConstructibleDeprecatedReferenceElement = Dune::Geo:: │ │ │ │ │ +ConstructibleDeprecatedReferenceElement; │ │ │ │ │ + 78 │ │ │ │ │ + 79 public: │ │ │ │ │ + 80 │ │ │ │ │ + 81 using DeprecatedReferenceElement = Dune::Geo:: │ │ │ │ │ +DeprecatedReferenceElement; │ │ │ │ │ + 82 │ │ │ │ │ + 83 using ReferenceElement = Dune::Geo::ReferenceElement<_Implementation_>; │ │ │ │ │ + 84 using value_type = ReferenceElement; │ │ │ │ │ + 85 using const_iterator = const value_type*; │ │ │ │ │ + 86 │ │ │ │ │ + 87 ReferenceElementContainer () │ │ │ │ │ + 88 { │ │ │ │ │ + 89 for( unsigned int topologyId = 0; topologyId < numTopologies; ++topologyId │ │ │ │ │ +) │ │ │ │ │ + 90 { │ │ │ │ │ + 91 implementations_[ topologyId ].initialize( topologyId ); │ │ │ │ │ + 92 reference_elements_[ topologyId ].setImplementation( implementations_ │ │ │ │ │ +[ topologyId ] ); │ │ │ │ │ + 93 } │ │ │ │ │ + 94 } │ │ │ │ │ + 95 │ │ │ │ │ + 96 const ReferenceElement& operator() ( const GeometryType &type ) const │ │ │ │ │ + 97 { │ │ │ │ │ + 98 assert( type.dim() == dim ); │ │ │ │ │ + 99 return reference_elements_[ type.id() ]; │ │ │ │ │ + 100 } │ │ │ │ │ + 101 │ │ │ │ │ + 102 const ReferenceElement& simplex () const │ │ │ │ │ + 103 { │ │ │ │ │ + 104 return reference_elements_[ Dune::GeometryTypes::simplex(dim).id() ]; │ │ │ │ │ + 105 } │ │ │ │ │ + 106 │ │ │ │ │ + 107 const ReferenceElement& cube () const │ │ │ │ │ + 108 { │ │ │ │ │ + 109 return reference_elements_[ Dune::GeometryTypes::cube(dim).id() ]; │ │ │ │ │ + 110 } │ │ │ │ │ + 111 │ │ │ │ │ + 112 const ReferenceElement& pyramid () const │ │ │ │ │ + 113 { │ │ │ │ │ + 114 return reference_elements_[ Dune::GeometryTypes::pyramid.id() ]; │ │ │ │ │ + 115 } │ │ │ │ │ + 116 │ │ │ │ │ + 117 const ReferenceElement& prism () const │ │ │ │ │ + 118 { │ │ │ │ │ + 119 return reference_elements_[ Dune::GeometryTypes::prism.id() ]; │ │ │ │ │ + 120 } │ │ │ │ │ + 121 │ │ │ │ │ + 122 const_iterator begin () const │ │ │ │ │ + 123 { │ │ │ │ │ + 124 return reference_elements_.data(); │ │ │ │ │ + 125 } │ │ │ │ │ + 126 │ │ │ │ │ + 127 const_iterator end () const │ │ │ │ │ + 128 { │ │ │ │ │ + 129 return reference_elements_.data() + numTopologies; │ │ │ │ │ + 130 } │ │ │ │ │ + 131 │ │ │ │ │ + 132 // here, we make sure to actually return a const reference to something │ │ │ │ │ + 133 // that is guaranteed not to become invalid, as otherwise, we might run │ │ │ │ │ + 134 // straight into debugging hell when a user binds the return value to a │ │ │ │ │ + 135 // const ref and the temporary goes out of scope. │ │ │ │ │ + 136 const DeprecatedReferenceElement& deprecated(const ReferenceElement& v) │ │ │ │ │ +const │ │ │ │ │ + 137 { │ │ │ │ │ + 138 return reference_elements_[v.impl().type(0,0).id()]; │ │ │ │ │ + 139 } │ │ │ │ │ + 140 │ │ │ │ │ + 141 private: │ │ │ │ │ + 142 │ │ │ │ │ + 143 std::array implementations_; │ │ │ │ │ + 144 std::array │ │ │ │ │ +reference_elements_; │ │ │ │ │ + 145 │ │ │ │ │ + 146 }; │ │ │ │ │ + 147 │ │ │ │ │ + 148 │ │ │ │ │ + 149 } // namespace Impl │ │ │ │ │ + 150 │ │ │ │ │ + 151 │ │ │ │ │ + 152#endif // DOXYGEN │ │ │ │ │ + 153 │ │ │ │ │ + 154 │ │ │ │ │ + 155 // ReferenceElements │ │ │ │ │ + 156 // ------------------------ │ │ │ │ │ + 157 │ │ │ │ │ + 168 template< class ctype_, int dim > │ │ │ │ │ +169 struct ReferenceElements │ │ │ │ │ + 170 { │ │ │ │ │ + 171 │ │ │ │ │ +173 using ctype = ctype_; │ │ │ │ │ + 174 │ │ │ │ │ +176 using CoordinateField = ctype; │ │ │ │ │ + 177 │ │ │ │ │ +179 static constexpr int dimension = dim; │ │ │ │ │ + 180 │ │ │ │ │ + 181 private: │ │ │ │ │ + 182 │ │ │ │ │ + 183 using Container = Impl::ReferenceElementContainer< ctype, dim >; │ │ │ │ │ + 184 │ │ │ │ │ + 185 public: │ │ │ │ │ + 186 │ │ │ │ │ +188 using ReferenceElement = typename Container::ReferenceElement; │ │ │ │ │ + 189 │ │ │ │ │ +191 using Iterator = typename Container::const_iterator; │ │ │ │ │ + 192 │ │ │ │ │ +194 using iterator = Iterator; │ │ │ │ │ + 195 │ │ │ │ │ + 197 static const ReferenceElement& │ │ │ │ │ +198 general ( const GeometryType& type ) │ │ │ │ │ + 199 { │ │ │ │ │ + 200 return container() ( type ); │ │ │ │ │ + 201 } │ │ │ │ │ + 202 │ │ │ │ │ +204 static const ReferenceElement& simplex () │ │ │ │ │ + 205 { │ │ │ │ │ + 206 return container().simplex(); │ │ │ │ │ + 207 } │ │ │ │ │ + 208 │ │ │ │ │ +210 static const ReferenceElement& cube () │ │ │ │ │ + 211 { │ │ │ │ │ + 212 return container().cube(); │ │ │ │ │ + 213 } │ │ │ │ │ + 214 │ │ │ │ │ +215 static Iterator begin () │ │ │ │ │ + 216 { │ │ │ │ │ + 217 return container().begin(); │ │ │ │ │ + 218 } │ │ │ │ │ + 219 │ │ │ │ │ +220 static Iterator end () │ │ │ │ │ + 221 { │ │ │ │ │ + 222 return container().end(); │ │ │ │ │ + 223 } │ │ │ │ │ + 224 │ │ │ │ │ + 225#ifndef DOXYGEN │ │ │ │ │ + 226 static const typename Container::DeprecatedReferenceElement& │ │ │ │ │ + 227 deprecated(const ReferenceElement& v) │ │ │ │ │ + 228 { │ │ │ │ │ + 229 return container().deprecated(v); │ │ │ │ │ + 230 } │ │ │ │ │ + 231#endif // DOXYGEN │ │ │ │ │ + 232 │ │ │ │ │ + 233 private: │ │ │ │ │ + 234 │ │ │ │ │ + 235 DUNE_EXPORT static const Container& container () │ │ │ │ │ + 236 { │ │ │ │ │ + 237 static Container container; │ │ │ │ │ + 238 return container; │ │ │ │ │ + 239 } │ │ │ │ │ + 240 }; │ │ │ │ │ + 241 │ │ │ │ │ + 242 } // namespace Geo │ │ │ │ │ + 243 │ │ │ │ │ + 245 using Geo::ReferenceElements; │ │ │ │ │ + 246 │ │ │ │ │ + 247 │ │ │ │ │ + 248#ifdef DOXYGEN │ │ │ │ │ + 249 │ │ │ │ │ + 251 │ │ │ │ │ + 294 template │ │ │ │ │ +295 unspecified-value-type referenceElement(T&&... t); │ │ │ │ │ + 296 │ │ │ │ │ + 297#endif │ │ │ │ │ + 298 │ │ │ │ │ + 299 │ │ │ │ │ + 301 │ │ │ │ │ + 314 template │ │ │ │ │ +315 auto referenceElement(const Dune::GeometryType& gt, Dune::Dim = {}) │ │ │ │ │ + 316 { │ │ │ │ │ + 317 return ReferenceElements::general(gt); │ │ │ │ │ + 318 } │ │ │ │ │ + 319 │ │ │ │ │ + 320 │ │ │ │ │ + 322 │ │ │ │ │ + 334 template>:: │ │ │ │ │ +value, int> = 0> │ │ │ │ │ +335 auto referenceElement(const T&, const Dune::GeometryType& gt, Dune:: │ │ │ │ │ +Dim) │ │ │ │ │ + 336 { │ │ │ │ │ + 337 return ReferenceElements::general(gt); │ │ │ │ │ + 338 } │ │ │ │ │ + 339 │ │ │ │ │ + 340 │ │ │ │ │ + 341#ifndef DOXYGEN │ │ │ │ │ + 342 │ │ │ │ │ + 343 // helpers for the ReferenceElement<> meta function │ │ │ │ │ + 344 │ │ │ │ │ + 345 namespace Impl { │ │ │ │ │ + 346 │ │ │ │ │ + 347 // Evaluates to the correct reference element iff matches the │ │ │ │ │ +pattern > │ │ │ │ │ + 348 // otherwise, it's ill-formed. Should be used with detected_or and │ │ │ │ │ +friends. │ │ │ │ │ + 349 │ │ │ │ │ + 350 template │ │ │ │ │ + 351 struct DefaultReferenceElementExtractor; │ │ │ │ │ + 352 │ │ │ │ │ + 353 template::value,int>::type │ │ │ │ │ +dim> │ │ │ │ │ + 354 struct DefaultReferenceElementExtractor> │ │ │ │ │ + 355 { │ │ │ │ │ + 356 using type = typename Dune::Geo::ReferenceElements:: │ │ │ │ │ +ReferenceElement; │ │ │ │ │ + 357 }; │ │ │ │ │ + 358 │ │ │ │ │ + 359 template │ │ │ │ │ + 360 using DefaultReferenceElement = typename │ │ │ │ │ +DefaultReferenceElementExtractor::type; │ │ │ │ │ + 361 │ │ │ │ │ + 362 } │ │ │ │ │ + 363 │ │ │ │ │ + 364 // looks up the type of a reference element by trying to instantiate the │ │ │ │ │ +correct overload │ │ │ │ │ + 365 // of referenceElement() for the given arguments. This will fail if there │ │ │ │ │ +is no valid │ │ │ │ │ + 366 // overload and should be used with detected_or or some other utility that │ │ │ │ │ +places the │ │ │ │ │ + 367 // instantiation in SFINAE context. │ │ │ │ │ + 368 // │ │ │ │ │ + 369 // this is placed directly in namespace Dune to avoid any weird surprises │ │ │ │ │ + 370 │ │ │ │ │ + 371 template │ │ │ │ │ + 372 using LookupReferenceElement = decltype(referenceElement(std::declval │ │ │ │ │ +()...)); │ │ │ │ │ + 373 │ │ │ │ │ + 374#endif // DOXYGEN │ │ │ │ │ + 375 │ │ │ │ │ +376 namespace Transitional { │ │ │ │ │ + 377 │ │ │ │ │ + 378#ifndef DOXYGEN │ │ │ │ │ + 379 │ │ │ │ │ + 380 // this abomination checks whether the template signature matches the │ │ │ │ │ +special case │ │ │ │ │ + 381 // ReferenceElement> and otherwise defers the │ │ │ │ │ +type lookup │ │ │ │ │ + 382 // to a decltype on a call to referenceElement(std::declval()) │ │ │ │ │ + 383 │ │ │ │ │ + 384 template │ │ │ │ │ + 385 using ReferenceElement = Std::detected_or_t< │ │ │ │ │ + 386 Std::detected_t, │ │ │ │ │ + 387 Impl::DefaultReferenceElement, │ │ │ │ │ + 388 T... │ │ │ │ │ + 389 >; │ │ │ │ │ + 390 │ │ │ │ │ + 391#else // DOXYGEN │ │ │ │ │ + 392 │ │ │ │ │ + 394 │ │ │ │ │ + 416 template │ │ │ │ │ + 417 using ReferenceElement = unspecified-type; │ │ │ │ │ + 418 │ │ │ │ │ + 419#endif //DOXYGEN │ │ │ │ │ + 420 │ │ │ │ │ + 421 } │ │ │ │ │ + 422 │ │ │ │ │ + 423#ifndef DOXYGEN │ │ │ │ │ + 424 │ │ │ │ │ + 425 namespace Impl { │ │ │ │ │ + 426 │ │ │ │ │ + 427 // helpers for triggering a deprecation warning for occurrences of the old │ │ │ │ │ + 428 // ReferenceElement syntax (Dune::ReferenceElement) │ │ │ │ │ + 429 │ │ │ │ │ + 430 // this looks a little weird, encoding the type in the return type of a │ │ │ │ │ +nested function, │ │ │ │ │ + 431 // but it was the only reliable way to trigger the warning iff the │ │ │ │ │ +compiler encounters │ │ │ │ │ + 432 // an invalid use. Other solutions either miss some (or all) uses or │ │ │ │ │ +trigger false alarms. │ │ │ │ │ + 433 │ │ │ │ │ + 434 template │ │ │ │ │ + 435 struct ValidReferenceElementTypeSignature │ │ │ │ │ + 436 { │ │ │ │ │ + 437 Transitional::ReferenceElement check(); │ │ │ │ │ + 438 }; │ │ │ │ │ + 439 │ │ │ │ │ + 440 template │ │ │ │ │ + 441 struct DeprecatedReferenceElementTypeSignature │ │ │ │ │ + 442 { │ │ │ │ │ + 443 [[deprecated("Dune::ReferenceElement is deprecated, please use │ │ │ │ │ +Dune::ReferenceElement (if you have a geometry), Dune:: │ │ │ │ │ +ReferenceElements::ReferenceElement or Dune::Transitional:: │ │ │ │ │ +ReferenceElement> instead. After Dune 2.6, you will be able to │ │ │ │ │ +use Dune::ReferenceElement>.")]] T check(); │ │ │ │ │ + 444 }; │ │ │ │ │ + 445 │ │ │ │ │ + 446 } // namespace Impl │ │ │ │ │ + 447 │ │ │ │ │ + 448 // This just makes sure the user doesn't use invalid syntax (by checking │ │ │ │ │ +against the -1 default for │ │ │ │ │ + 449 // the dimension, and then either hands back the old-style type along with │ │ │ │ │ +a deprecation warning or │ │ │ │ │ + 450 // forwards to the transitional version │ │ │ │ │ + 451 template │ │ │ │ │ + 452 using ReferenceElement = decltype( │ │ │ │ │ + 453 std::declval< │ │ │ │ │ + 454 typename std::conditional< │ │ │ │ │ + 455 dim == -1, │ │ │ │ │ + 456 Impl::ValidReferenceElementTypeSignature, │ │ │ │ │ + 457 Impl::DeprecatedReferenceElementTypeSignature> │ │ │ │ │ + 458 >::type │ │ │ │ │ + 459 >().check()); │ │ │ │ │ + 460 │ │ │ │ │ + 461#else // DOXYGEN │ │ │ │ │ + 462 │ │ │ │ │ + 464 │ │ │ │ │ + 496 template │ │ │ │ │ +497 using ReferenceElement = unspecified-type; │ │ │ │ │ + 498 │ │ │ │ │ + 499#endif // DOXYGEN │ │ │ │ │ + 500 │ │ │ │ │ + 501 │ │ │ │ │ + 502 │ │ │ │ │ + 503} // namespace Dune │ │ │ │ │ + 504 │ │ │ │ │ + 505#endif // #ifndef DUNE_GEOMETRY_REFERENCEELEMENTS_HH │ │ │ │ │ +referenceelementimplementation.hh │ │ │ │ │ +dimension.hh │ │ │ │ │ type.hh │ │ │ │ │ A unique label for each type of element that can occur in a grid. │ │ │ │ │ +referenceelement.hh │ │ │ │ │ +Dune::referenceElement │ │ │ │ │ +unspecified value type referenceElement(T &&... t) │ │ │ │ │ +Returns a reference element for the objects t.... │ │ │ │ │ +Dune::ReferenceElement │ │ │ │ │ +unspecified-type ReferenceElement │ │ │ │ │ +Returns the type of reference element for the argument type T. │ │ │ │ │ +Definition referenceelements.hh:497 │ │ │ │ │ Dune │ │ │ │ │ Definition affinegeometry.hh:21 │ │ │ │ │ -Dune::geometryTypeFromVertexCount │ │ │ │ │ -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 │ │ │ │ │ +Dune::Geo::ReferenceElement │ │ │ │ │ +This class provides access to geometric and topological properties of a │ │ │ │ │ +reference element. │ │ │ │ │ +Definition referenceelement.hh:52 │ │ │ │ │ +Dune::Geo::ReferenceElements │ │ │ │ │ +Class providing access to the singletons of the reference elements. │ │ │ │ │ +Definition referenceelements.hh:170 │ │ │ │ │ +Dune::Geo::ReferenceElements::begin │ │ │ │ │ +static Iterator begin() │ │ │ │ │ +Definition referenceelements.hh:215 │ │ │ │ │ +Dune::Geo::ReferenceElements::iterator │ │ │ │ │ +Iterator iterator │ │ │ │ │ +Iterator over available reference elements. │ │ │ │ │ +Definition referenceelements.hh:194 │ │ │ │ │ +Dune::Geo::ReferenceElements::ReferenceElement │ │ │ │ │ +typename Container::ReferenceElement ReferenceElement │ │ │ │ │ +The reference element type. │ │ │ │ │ +Definition referenceelements.hh:188 │ │ │ │ │ +Dune::Geo::ReferenceElements::cube │ │ │ │ │ +static const ReferenceElement & cube() │ │ │ │ │ +get hypercube reference elements │ │ │ │ │ +Definition referenceelements.hh:210 │ │ │ │ │ +Dune::Geo::ReferenceElements::end │ │ │ │ │ +static Iterator end() │ │ │ │ │ +Definition referenceelements.hh:220 │ │ │ │ │ +Dune::Geo::ReferenceElements::ctype │ │ │ │ │ +ctype_ ctype │ │ │ │ │ +The coordinate field type of the contained reference elements. │ │ │ │ │ +Definition referenceelements.hh:173 │ │ │ │ │ +Dune::Geo::ReferenceElements::general │ │ │ │ │ +static const ReferenceElement & general(const GeometryType &type) │ │ │ │ │ +get general reference elements │ │ │ │ │ +Definition referenceelements.hh:198 │ │ │ │ │ +Dune::Geo::ReferenceElements::simplex │ │ │ │ │ +static const ReferenceElement & simplex() │ │ │ │ │ +get simplex reference elements │ │ │ │ │ +Definition referenceelements.hh:204 │ │ │ │ │ +Dune::Geo::ReferenceElements::Iterator │ │ │ │ │ +typename Container::const_iterator Iterator │ │ │ │ │ +Iterator over available reference elements. │ │ │ │ │ +Definition referenceelements.hh:191 │ │ │ │ │ +Dune::Geo::ReferenceElements::dimension │ │ │ │ │ +static constexpr int dimension │ │ │ │ │ +The dimension of the contained reference elements. │ │ │ │ │ +Definition referenceelements.hh:179 │ │ │ │ │ +Dune::Geo::ReferenceElements::CoordinateField │ │ │ │ │ +ctype CoordinateField │ │ │ │ │ +The coordinate field type of the contained reference elements. │ │ │ │ │ +Definition referenceelements.hh:176 │ │ │ │ │ +Dune::Dim │ │ │ │ │ +Static tag representing a dimension. │ │ │ │ │ +Definition dimension.hh:16 │ │ │ │ │ Dune::GeometryType │ │ │ │ │ Unique label for each type of entities that can occur in DUNE grids. │ │ │ │ │ Definition type.hh:126 │ │ │ │ │ +Dune::GeometryType::id │ │ │ │ │ +constexpr unsigned int id() const │ │ │ │ │ +Return the topology id of the type. │ │ │ │ │ +Definition type.hh:377 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00188.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: refinement.hh File Reference │ │ │ │ +dune-geometry: referenceelementimplementation.cc File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -69,30 +69,29 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
refinement.hh File Reference
│ │ │ │ +
│ │ │ │ +Namespaces
│ │ │ │ +
referenceelementimplementation.cc File Reference
│ │ │ │
│ │ │ │
│ │ │ │ - │ │ │ │ -

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

│ │ │ │ -
#include "refinement/base.cc"
│ │ │ │ -#include "refinement/hcube.cc"
│ │ │ │ -#include "refinement/simplex.cc"
│ │ │ │ -#include "refinement/hcubetriangulation.cc"
│ │ │ │ -#include "refinement/prismtriangulation.cc"
│ │ │ │ -#include "refinement/pyramidtriangulation.cc"
│ │ │ │ -
│ │ │ │ -

Go to the source code of this file.

│ │ │ │ -

Detailed Description

│ │ │ │ -

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

│ │ │ │ -
│ │ │ │ +
#include <config.h>
│ │ │ │ +#include <dune/geometry/referenceelementimplementation.hh>
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Namespaces

namespace  Dune
 
namespace  Dune::Geo
 
│ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -6,23 +6,19 @@ │ │ │ │ │ dune-geometry 2.9.0 │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ -refinement.hh File Reference │ │ │ │ │ -This file simply includes all Refinement implementations so you don't have to │ │ │ │ │ -do them separately. More... │ │ │ │ │ -#include "refinement/base.cc" │ │ │ │ │ -#include "refinement/hcube.cc" │ │ │ │ │ -#include "refinement/simplex.cc" │ │ │ │ │ -#include "refinement/hcubetriangulation.cc" │ │ │ │ │ -#include "refinement/prismtriangulation.cc" │ │ │ │ │ -#include "refinement/pyramidtriangulation.cc" │ │ │ │ │ -Go_to_the_source_code_of_this_file. │ │ │ │ │ -***** Detailed Description ***** │ │ │ │ │ -This file simply includes all Refinement implementations so you don't have to │ │ │ │ │ -do them separately. │ │ │ │ │ +Namespaces │ │ │ │ │ +referenceelementimplementation.cc File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ + Namespaces │ │ │ │ │ +namespace  Dune │ │ │ │ │ +  │ │ │ │ │ +namespace  Dune::Geo │ │ │ │ │ +  │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00191.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: referenceelements.hh File Reference │ │ │ │ +dune-geometry: typeindex.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -71,74 +71,44 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Typedefs | │ │ │ │ -Functions
│ │ │ │ -
referenceelements.hh File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
typeindex.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <cassert>
│ │ │ │ -#include <algorithm>
│ │ │ │ -#include <limits>
│ │ │ │ -#include <tuple>
│ │ │ │ -#include <utility>
│ │ │ │ -#include <vector>
│ │ │ │ -#include <array>
│ │ │ │ -#include <dune/common/typetraits.hh>
│ │ │ │ -#include <dune/common/std/type_traits.hh>
│ │ │ │ -#include <dune/common/visibility.hh>
│ │ │ │ -#include <dune/geometry/dimension.hh>
│ │ │ │ -#include <dune/geometry/type.hh>
│ │ │ │ -#include <dune/geometry/referenceelement.hh>
│ │ │ │ -#include <dune/geometry/referenceelementimplementation.hh>
│ │ │ │ + │ │ │ │ +

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

│ │ │ │ +
#include <cstddef>
│ │ │ │ +#include <dune/common/indices.hh>
│ │ │ │ +#include <dune/common/hybridutilities.hh>
│ │ │ │ +#include "type.hh"
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

struct  Dune::Geo::ReferenceElements< ctype_, dim >
 Class providing access to the singletons of the reference elements. 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...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::Geo
 
namespace  Dune::Transitional
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Typedefs

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

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

Detailed Description

│ │ │ │ +

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

│ │ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -6,62 +6,32 @@ │ │ │ │ │ dune-geometry 2.9.0 │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ -Classes | Namespaces | Typedefs | Functions │ │ │ │ │ -referenceelements.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +typeindex.hh File Reference │ │ │ │ │ +Helper classes to provide indices for geometrytypes for use in a vector. │ │ │ │ │ +More... │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include "type.hh" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -struct  Dune::Geo::ReferenceElements<_ctype_,_dim_> │ │ │ │ │ -  Class providing access to the singletons of the reference elements. │ │ │ │ │ - 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... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ -namespace  Dune::Geo │ │ │ │ │ -  │ │ │ │ │ -namespace  Dune::Transitional │ │ │ │ │ -  │ │ │ │ │ - Typedefs │ │ │ │ │ -template │ │ │ │ │ -using Dune::ReferenceElement = unspecified-type │ │ │ │ │ -  Returns the type of reference element for the argument type T. │ │ │ │ │ -  │ │ │ │ │ - Functions │ │ │ │ │ -template │ │ │ │ │ -unspecified value type Dune::referenceElement (T &&... t) │ │ │ │ │ -  Returns a reference element for the objects t.... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ - auto Dune::referenceElement (const Dune::GeometryType >, │ │ │ │ │ - Dune::Dim< dim >={}) │ │ │ │ │ -  Returns a reference element of dimension dim for the │ │ │ │ │ - given geometry type and coordinate field type. │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ ->::value, int > = 0> │ │ │ │ │ - auto Dune::referenceElement (const T &, const Dune:: │ │ │ │ │ - GeometryType >, Dune::Dim< dim >) │ │ │ │ │ -  Returns a reference element of dimension dim for the │ │ │ │ │ - given geometry type and coordinate field type. │ │ │ │ │ -  │ │ │ │ │ +***** Detailed Description ***** │ │ │ │ │ +Helper classes to provide indices for geometrytypes for use in a vector. │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00191_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: referenceelements.hh Source File │ │ │ │ +dune-geometry: typeindex.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,421 +74,161 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
referenceelements.hh
│ │ │ │ +
typeindex.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
│ │ │ │ -
5#ifndef DUNE_GEOMETRY_REFERENCEELEMENTS_HH
│ │ │ │ -
6#define DUNE_GEOMETRY_REFERENCEELEMENTS_HH
│ │ │ │ +
5#ifndef DUNE_GEOMETRY_TYPEINDEX_HH
│ │ │ │ +
6#define DUNE_GEOMETRY_TYPEINDEX_HH
│ │ │ │
7
│ │ │ │ -
8#include <cassert>
│ │ │ │ -
9
│ │ │ │ -
10#include <algorithm>
│ │ │ │ -
11#include <limits>
│ │ │ │ -
12#include <tuple>
│ │ │ │ -
13#include <utility>
│ │ │ │ -
14#include <vector>
│ │ │ │ -
15#include <array>
│ │ │ │ -
16
│ │ │ │ -
17#include <dune/common/typetraits.hh>
│ │ │ │ -
18#include <dune/common/std/type_traits.hh>
│ │ │ │ -
19#include <dune/common/visibility.hh>
│ │ │ │ +
14#include <cstddef>
│ │ │ │ +
15
│ │ │ │ +
16#include <dune/common/indices.hh>
│ │ │ │ +
17#include <dune/common/hybridutilities.hh>
│ │ │ │ +
18
│ │ │ │ +
19#include "type.hh"
│ │ │ │
20
│ │ │ │ - │ │ │ │ -
22#include <dune/geometry/type.hh>
│ │ │ │ - │ │ │ │ - │ │ │ │ -
25
│ │ │ │ -
26namespace Dune
│ │ │ │ -
27{
│ │ │ │ -
28
│ │ │ │ -
29 namespace Geo
│ │ │ │ -
30 {
│ │ │ │ -
31
│ │ │ │ -
32#ifndef DOXYGEN
│ │ │ │ -
33
│ │ │ │ -
34
│ │ │ │ -
35 template<typename ctype, int dim>
│ │ │ │ -
36 class DeprecatedReferenceElement
│ │ │ │ -
37 : public ReferenceElement<ReferenceElementImplementation<ctype,dim>>
│ │ │ │ -
38 {
│ │ │ │ -
39
│ │ │ │ -
40 protected:
│ │ │ │ -
41
│ │ │ │ -
42 DeprecatedReferenceElement() = default;
│ │ │ │ -
43
│ │ │ │ -
44 public:
│ │ │ │ -
45
│ │ │ │ -
46 DeprecatedReferenceElement(const DeprecatedReferenceElement&) = delete;
│ │ │ │ -
47 DeprecatedReferenceElement& operator=(const DeprecatedReferenceElement&) = delete;
│ │ │ │ -
48
│ │ │ │ -
49 DeprecatedReferenceElement(const ReferenceElementImplementation<ctype,dim>& impl)
│ │ │ │ -
50 : ReferenceElement<ReferenceElementImplementation<ctype,dim>>(impl)
│ │ │ │ -
51 {}
│ │ │ │ -
52
│ │ │ │ -
53 };
│ │ │ │ +
21namespace Dune
│ │ │ │ +
22{
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
25 {
│ │ │ │ +
32 inline static constexpr std::size_t regular_size(std::size_t dim)
│ │ │ │ +
33 {
│ │ │ │ +
34 // The following expression is derived from the expression for
│ │ │ │ +
35 // GlobalGeometryTypeIndex::regular_offset(). Subtracting
│ │ │ │ +
36 // regular_offset(dim+1)-regular_offset(dim) we get:
│ │ │ │ +
37 //
│ │ │ │ +
38 // ((1 << dim+1) >> 1) - ((1 << dim) >> 1)
│ │ │ │ +
39 //
│ │ │ │ +
40 // We always have
│ │ │ │ +
41 //
│ │ │ │ +
42 // dim >= 0,
│ │ │ │ +
43 //
│ │ │ │ +
44 // so
│ │ │ │ +
45 //
│ │ │ │ +
46 // (1 << dim+1) >= 2 and (1 << dim+2) % 2 == 0.
│ │ │ │ +
47 //
│ │ │ │ +
48 // So if we apply a single right-shift to that, we will never lose any
│ │ │ │ +
49 // set bits, thus
│ │ │ │ +
50 //
│ │ │ │ +
51 // ((1 << dim+1) >> 1) == (1 << dim)
│ │ │ │ +
52 return (1 << dim) - ((1 << dim) >> 1);
│ │ │ │ +
53 }
│ │ │ │
54
│ │ │ │ -
55
│ │ │ │ -
56 template<typename ctype, int dim>
│ │ │ │ -
57 class ConstructibleDeprecatedReferenceElement
│ │ │ │ -
58 : public DeprecatedReferenceElement<ctype,dim>
│ │ │ │ -
59 {
│ │ │ │ -
60 public:
│ │ │ │ -
61 ConstructibleDeprecatedReferenceElement() = default;
│ │ │ │ -
62 };
│ │ │ │ -
63
│ │ │ │ -
64
│ │ │ │ -
65 namespace Impl
│ │ │ │ -
66 {
│ │ │ │ -
67
│ │ │ │ -
68 // ReferenceElementContainer
│ │ │ │ -
69 // -------------------------
│ │ │ │ -
70
│ │ │ │ -
71 template< class ctype, int dim >
│ │ │ │ -
72 class ReferenceElementContainer
│ │ │ │ -
73 {
│ │ │ │ -
74 static const unsigned int numTopologies = dim >= 0 ? (1u << dim) : 0;
│ │ │ │ -
75
│ │ │ │ -
76 using Implementation = ReferenceElementImplementation< ctype, dim >;
│ │ │ │ -
77 using ConstructibleDeprecatedReferenceElement = Dune::Geo::ConstructibleDeprecatedReferenceElement<ctype,dim>;
│ │ │ │ -
78
│ │ │ │ -
79 public:
│ │ │ │ -
80
│ │ │ │ -
81 using DeprecatedReferenceElement = Dune::Geo::DeprecatedReferenceElement<ctype,dim>;
│ │ │ │ -
82
│ │ │ │ -
83 using ReferenceElement = Dune::Geo::ReferenceElement< Implementation >;
│ │ │ │ -
84 using value_type = ReferenceElement;
│ │ │ │ -
85 using const_iterator = const value_type*;
│ │ │ │ -
86
│ │ │ │ -
87 ReferenceElementContainer ()
│ │ │ │ -
88 {
│ │ │ │ -
89 for( unsigned int topologyId = 0; topologyId < numTopologies; ++topologyId )
│ │ │ │ -
90 {
│ │ │ │ -
91 implementations_[ topologyId ].initialize( topologyId );
│ │ │ │ -
92 reference_elements_[ topologyId ].setImplementation( implementations_[ topologyId ] );
│ │ │ │ -
93 }
│ │ │ │ -
94 }
│ │ │ │ -
95
│ │ │ │ -
96 const ReferenceElement& operator() ( const GeometryType &type ) const
│ │ │ │ -
97 {
│ │ │ │ -
98 assert( type.dim() == dim );
│ │ │ │ -
99 return reference_elements_[ type.id() ];
│ │ │ │ -
100 }
│ │ │ │ -
101
│ │ │ │ -
102 const ReferenceElement& simplex () const
│ │ │ │ -
103 {
│ │ │ │ -
104 return reference_elements_[ Dune::GeometryTypes::simplex(dim).id() ];
│ │ │ │ -
105 }
│ │ │ │ -
106
│ │ │ │ -
107 const ReferenceElement& cube () const
│ │ │ │ -
108 {
│ │ │ │ -
109 return reference_elements_[ Dune::GeometryTypes::cube(dim).id() ];
│ │ │ │ -
110 }
│ │ │ │ -
111
│ │ │ │ -
112 const ReferenceElement& pyramid () const
│ │ │ │ -
113 {
│ │ │ │ -
114 return reference_elements_[ Dune::GeometryTypes::pyramid.id() ];
│ │ │ │ -
115 }
│ │ │ │ -
116
│ │ │ │ -
117 const ReferenceElement& prism () const
│ │ │ │ -
118 {
│ │ │ │ -
119 return reference_elements_[ Dune::GeometryTypes::prism.id() ];
│ │ │ │ -
120 }
│ │ │ │ -
121
│ │ │ │ -
122 const_iterator begin () const
│ │ │ │ -
123 {
│ │ │ │ -
124 return reference_elements_.data();
│ │ │ │ -
125 }
│ │ │ │ -
126
│ │ │ │ -
127 const_iterator end () const
│ │ │ │ -
128 {
│ │ │ │ -
129 return reference_elements_.data() + numTopologies;
│ │ │ │ -
130 }
│ │ │ │ -
131
│ │ │ │ -
132 // here, we make sure to actually return a const reference to something
│ │ │ │ -
133 // that is guaranteed not to become invalid, as otherwise, we might run
│ │ │ │ -
134 // straight into debugging hell when a user binds the return value to a
│ │ │ │ -
135 // const ref and the temporary goes out of scope.
│ │ │ │ -
136 const DeprecatedReferenceElement& deprecated(const ReferenceElement& v) const
│ │ │ │ -
137 {
│ │ │ │ -
138 return reference_elements_[v.impl().type(0,0).id()];
│ │ │ │ -
139 }
│ │ │ │ -
140
│ │ │ │ -
141 private:
│ │ │ │ -
142
│ │ │ │ -
143 std::array<Implementation,numTopologies> implementations_;
│ │ │ │ -
144 std::array<ConstructibleDeprecatedReferenceElement,numTopologies> reference_elements_;
│ │ │ │ +
55 public:
│ │ │ │ +
│ │ │ │ +
61 inline static constexpr std::size_t size(std::size_t dim)
│ │ │ │ +
62 {
│ │ │ │ +
63 // one for "none"
│ │ │ │ +
64 return regular_size(dim) + 1;
│ │ │ │ +
65 }
│ │ │ │ +
│ │ │ │ +
66
│ │ │ │ +
│ │ │ │ +
73 inline static constexpr std::size_t index(const GeometryType &gt)
│ │ │ │ +
74 {
│ │ │ │ +
75 return gt.isNone() ? regular_size(gt.dim()) : (gt.id() >> 1);
│ │ │ │ +
76 }
│ │ │ │ +
│ │ │ │ +
77
│ │ │ │ +
│ │ │ │ +
79 inline static constexpr GeometryType type(std::size_t dim, std::size_t index) {
│ │ │ │ +
80 return (index == regular_size(dim)) ?
│ │ │ │ +
81 GeometryTypes::none(dim) :
│ │ │ │ +
82 // the cast to unsigned makes sure this is interpreted as the topology
│ │ │ │ +
83 // ID constructor
│ │ │ │ +
84 GeometryType(static_cast< unsigned int >(index << 1), dim);
│ │ │ │ +
85 }
│ │ │ │ +
│ │ │ │ +
86 };
│ │ │ │ +
│ │ │ │ +
87
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
90 {
│ │ │ │ +
98 inline static constexpr std::size_t regular_offset(std::size_t dim)
│ │ │ │ +
99 {
│ │ │ │ +
100 // The number of regular geometry types in a given dimension is
│ │ │ │ +
101 // 2^(dim-1). For dim==0 this would yield 1/2 geometry types (which is
│ │ │ │ +
102 // obviously bogus, dim==0 has one regular geometry type, the point).
│ │ │ │ +
103 // The following expression relies on 1 >> 1 == 0 to treat dim==0
│ │ │ │ +
104 // specially.
│ │ │ │ +
105 return (1 << dim) >> 1;
│ │ │ │ +
106 }
│ │ │ │ +
107
│ │ │ │ +
108 public:
│ │ │ │ +
│ │ │ │ +
113 inline static constexpr std::size_t offset(std::size_t dim)
│ │ │ │ +
114 {
│ │ │ │ +
115 // dim times "none"
│ │ │ │ +
116 return regular_offset(dim) + dim;
│ │ │ │ +
117 }
│ │ │ │ +
│ │ │ │ +
118
│ │ │ │ +
│ │ │ │ +
125 inline static constexpr std::size_t size(std::size_t maxdim)
│ │ │ │ +
126 {
│ │ │ │ +
127 return offset(maxdim+1);
│ │ │ │ +
128 }
│ │ │ │ +
│ │ │ │ +
129
│ │ │ │ +
│ │ │ │ +
138 inline static constexpr std::size_t index(const GeometryType &gt)
│ │ │ │ +
139 {
│ │ │ │ +
140 return offset(gt.dim()) + LocalGeometryTypeIndex::index(gt);
│ │ │ │ +
141 }
│ │ │ │ +
│ │ │ │ +
142 };
│ │ │ │ +
│ │ │ │ +
143
│ │ │ │ +
144 namespace Impl {
│ │ │ │
145
│ │ │ │ -
146 };
│ │ │ │ -
147
│ │ │ │ -
148
│ │ │ │ -
149 } // namespace Impl
│ │ │ │ -
150
│ │ │ │ -
151
│ │ │ │ -
152#endif // DOXYGEN
│ │ │ │ -
153
│ │ │ │ -
154
│ │ │ │ -
155 // ReferenceElements
│ │ │ │ -
156 // ------------------------
│ │ │ │ -
157
│ │ │ │ -
168 template< class ctype_, int dim >
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
170 {
│ │ │ │ -
171
│ │ │ │ -
173 using ctype = ctype_;
│ │ │ │ -
174
│ │ │ │ - │ │ │ │ -
177
│ │ │ │ -
179 static constexpr int dimension = dim;
│ │ │ │ -
180
│ │ │ │ -
181 private:
│ │ │ │ -
182
│ │ │ │ -
183 using Container = Impl::ReferenceElementContainer< ctype, dim >;
│ │ │ │ -
184
│ │ │ │ -
185 public:
│ │ │ │ -
186
│ │ │ │ -
188 using ReferenceElement = typename Container::ReferenceElement;
│ │ │ │ -
189
│ │ │ │ -
191 using Iterator = typename Container::const_iterator;
│ │ │ │ -
192
│ │ │ │ - │ │ │ │ -
195
│ │ │ │ -
197 static const ReferenceElement&
│ │ │ │ -
│ │ │ │ -
198 general ( const GeometryType& type )
│ │ │ │ -
199 {
│ │ │ │ -
200 return container() ( type );
│ │ │ │ -
201 }
│ │ │ │ -
│ │ │ │ -
202
│ │ │ │ -
│ │ │ │ -
204 static const ReferenceElement& simplex ()
│ │ │ │ -
205 {
│ │ │ │ -
206 return container().simplex();
│ │ │ │ -
207 }
│ │ │ │ -
│ │ │ │ -
208
│ │ │ │ -
│ │ │ │ -
210 static const ReferenceElement& cube ()
│ │ │ │ -
211 {
│ │ │ │ -
212 return container().cube();
│ │ │ │ -
213 }
│ │ │ │ -
│ │ │ │ -
214
│ │ │ │ -
│ │ │ │ -
215 static Iterator begin ()
│ │ │ │ -
216 {
│ │ │ │ -
217 return container().begin();
│ │ │ │ -
218 }
│ │ │ │ -
│ │ │ │ -
219
│ │ │ │ -
│ │ │ │ -
220 static Iterator end ()
│ │ │ │ -
221 {
│ │ │ │ -
222 return container().end();
│ │ │ │ -
223 }
│ │ │ │ -
│ │ │ │ -
224
│ │ │ │ -
225#ifndef DOXYGEN
│ │ │ │ -
226 static const typename Container::DeprecatedReferenceElement&
│ │ │ │ -
227 deprecated(const ReferenceElement& v)
│ │ │ │ -
228 {
│ │ │ │ -
229 return container().deprecated(v);
│ │ │ │ -
230 }
│ │ │ │ -
231#endif // DOXYGEN
│ │ │ │ -
232
│ │ │ │ -
233 private:
│ │ │ │ -
234
│ │ │ │ -
235 DUNE_EXPORT static const Container& container ()
│ │ │ │ -
236 {
│ │ │ │ -
237 static Container container;
│ │ │ │ -
238 return container;
│ │ │ │ -
239 }
│ │ │ │ -
240 };
│ │ │ │ -
│ │ │ │ -
241
│ │ │ │ -
242 } // namespace Geo
│ │ │ │ -
243
│ │ │ │ -
245 using Geo::ReferenceElements;
│ │ │ │ -
246
│ │ │ │ -
247
│ │ │ │ -
248#ifdef DOXYGEN
│ │ │ │ -
249
│ │ │ │ -
251
│ │ │ │ -
294 template<typename... T>
│ │ │ │ -
295 unspecified-value-type referenceElement(T&&... t);
│ │ │ │ -
296
│ │ │ │ -
297#endif
│ │ │ │ -
298
│ │ │ │ -
299
│ │ │ │ -
301
│ │ │ │ -
314 template<typename T, int dim>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
316 {
│ │ │ │ - │ │ │ │ -
318 }
│ │ │ │ -
│ │ │ │ -
319
│ │ │ │ -
320
│ │ │ │ -
322
│ │ │ │ -
334 template<typename T, int dim, std::enable_if_t<IsNumber<std::decay_t<T>>::value, int> = 0>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
336 {
│ │ │ │ - │ │ │ │ -
338 }
│ │ │ │ -
│ │ │ │ -
339
│ │ │ │ -
340
│ │ │ │ -
341#ifndef DOXYGEN
│ │ │ │ -
342
│ │ │ │ -
343 // helpers for the ReferenceElement<> meta function
│ │ │ │ -
344
│ │ │ │ -
345 namespace Impl {
│ │ │ │ -
346
│ │ │ │ -
347 // Evaluates to the correct reference element iff <T...> matches the pattern <number_type,Dim<int>>
│ │ │ │ -
348 // otherwise, it's ill-formed. Should be used with detected_or and friends.
│ │ │ │ -
349
│ │ │ │ -
350 template<typename... T>
│ │ │ │ -
351 struct DefaultReferenceElementExtractor;
│ │ │ │ -
352
│ │ │ │ -
353 template<typename T, typename std::enable_if<IsNumber<T>::value,int>::type dim>
│ │ │ │ -
354 struct DefaultReferenceElementExtractor<T,Dim<dim>>
│ │ │ │ -
355 {
│ │ │ │ - │ │ │ │ -
357 };
│ │ │ │ -
358
│ │ │ │ -
359 template<typename... T>
│ │ │ │ -
360 using DefaultReferenceElement = typename DefaultReferenceElementExtractor<T...>::type;
│ │ │ │ -
361
│ │ │ │ -
362 }
│ │ │ │ -
363
│ │ │ │ -
364 // looks up the type of a reference element by trying to instantiate the correct overload
│ │ │ │ -
365 // of referenceElement() for the given arguments. This will fail if there is no valid
│ │ │ │ -
366 // overload and should be used with detected_or or some other utility that places the
│ │ │ │ -
367 // instantiation in SFINAE context.
│ │ │ │ -
368 //
│ │ │ │ -
369 // this is placed directly in namespace Dune to avoid any weird surprises
│ │ │ │ -
370
│ │ │ │ -
371 template<typename... T>
│ │ │ │ -
372 using LookupReferenceElement = decltype(referenceElement(std::declval<T>()...));
│ │ │ │ -
373
│ │ │ │ -
374#endif // DOXYGEN
│ │ │ │ -
375
│ │ │ │ -
│ │ │ │ -
376 namespace Transitional {
│ │ │ │ -
377
│ │ │ │ -
378#ifndef DOXYGEN
│ │ │ │ -
379
│ │ │ │ -
380 // this abomination checks whether the template signature matches the special case
│ │ │ │ -
381 // ReferenceElement<number_type,Dune::Dim<int>> and otherwise defers the type lookup
│ │ │ │ -
382 // to a decltype on a call to referenceElement(std::declval<T>())
│ │ │ │ -
383
│ │ │ │ -
384 template<typename... T>
│ │ │ │ -
385 using ReferenceElement = Std::detected_or_t<
│ │ │ │ -
386 Std::detected_t<LookupReferenceElement,T...>,
│ │ │ │ -
387 Impl::DefaultReferenceElement,
│ │ │ │ -
388 T...
│ │ │ │ -
389 >;
│ │ │ │ -
390
│ │ │ │ -
391#else // DOXYGEN
│ │ │ │ -
392
│ │ │ │ -
394
│ │ │ │ -
416 template<typename... T>
│ │ │ │ -
417 using ReferenceElement = unspecified-type;
│ │ │ │ -
418
│ │ │ │ -
419#endif //DOXYGEN
│ │ │ │ -
420
│ │ │ │ -
421 }
│ │ │ │ -
│ │ │ │ -
422
│ │ │ │ -
423#ifndef DOXYGEN
│ │ │ │ -
424
│ │ │ │ -
425 namespace Impl {
│ │ │ │ -
426
│ │ │ │ -
427 // helpers for triggering a deprecation warning for occurrences of the old
│ │ │ │ -
428 // ReferenceElement syntax (Dune::ReferenceElement<T,int>)
│ │ │ │ -
429
│ │ │ │ -
430 // this looks a little weird, encoding the type in the return type of a nested function,
│ │ │ │ -
431 // but it was the only reliable way to trigger the warning iff the compiler encounters
│ │ │ │ -
432 // an invalid use. Other solutions either miss some (or all) uses or trigger false alarms.
│ │ │ │ -
433
│ │ │ │ -
434 template<typename T>
│ │ │ │ -
435 struct ValidReferenceElementTypeSignature
│ │ │ │ -
436 {
│ │ │ │ -
437 Transitional::ReferenceElement<T> check();
│ │ │ │ -
438 };
│ │ │ │ -
439
│ │ │ │ -
440 template<typename T>
│ │ │ │ -
441 struct DeprecatedReferenceElementTypeSignature
│ │ │ │ -
442 {
│ │ │ │ -
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();
│ │ │ │ -
444 };
│ │ │ │ -
445
│ │ │ │ -
446 } // namespace Impl
│ │ │ │ -
447
│ │ │ │ -
448 // This just makes sure the user doesn't use invalid syntax (by checking against the -1 default for
│ │ │ │ -
449 // the dimension, and then either hands back the old-style type along with a deprecation warning or
│ │ │ │ -
450 // forwards to the transitional version
│ │ │ │ -
451 template<typename T, int dim = -1>
│ │ │ │ -
452 using ReferenceElement = decltype(
│ │ │ │ -
453 std::declval<
│ │ │ │ -
454 typename std::conditional<
│ │ │ │ -
455 dim == -1,
│ │ │ │ -
456 Impl::ValidReferenceElementTypeSignature<T>,
│ │ │ │ -
457 Impl::DeprecatedReferenceElementTypeSignature<Geo::DeprecatedReferenceElement<T,dim>>
│ │ │ │ -
458 >::type
│ │ │ │ -
459 >().check());
│ │ │ │ -
460
│ │ │ │ -
461#else // DOXYGEN
│ │ │ │ -
462
│ │ │ │ -
464
│ │ │ │ -
496 template<typename T, int dim>
│ │ │ │ -
497 using ReferenceElement = unspecified-type;
│ │ │ │ -
498
│ │ │ │ -
499#endif // DOXYGEN
│ │ │ │ -
500
│ │ │ │ -
501
│ │ │ │ -
502
│ │ │ │ -
503} // namespace Dune
│ │ │ │ -
504
│ │ │ │ -
505#endif // #ifndef DUNE_GEOMETRY_REFERENCEELEMENTS_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
A unique label for each type of element that can occur in a grid.
│ │ │ │ -
unspecified value type referenceElement(T &&... t)
Returns a reference element for the objects t....
│ │ │ │ -
unspecified-type ReferenceElement
Returns the type of reference element for the argument type T.
Definition referenceelements.hh:497
│ │ │ │ +
146 // Map a dynamic GeometryType to a static integral_constant<GeometryType::Id, ...>
│ │ │ │ +
147 template<int dim, class F>
│ │ │ │ +
148 static auto toGeometryTypeIdConstant(const GeometryType& gt, F&& f) {
│ │ │ │ +
149 // Transform LocalGeometryTypeIndex to GeometryType::Id
│ │ │ │ +
150 auto callWithId = [&](auto index) {
│ │ │ │ +
151 static constexpr auto id = LocalGeometryTypeIndex::type(dim, decltype(index)::value).toId();
│ │ │ │ +
152 return f(std::integral_constant<GeometryType::Id, id>{});
│ │ │ │ +
153 };
│ │ │ │ +
154 // switchCases needs a fallback to determine the return type.
│ │ │ │ +
155 auto fallBack = [&]() { return callWithId(Dune::Indices::_0); };
│ │ │ │ +
156 // Iterate over all _regular_ GeometryType indices for given dimension
│ │ │ │ +
157 auto allIndices = std::make_index_sequence<LocalGeometryTypeIndex::size(dim)-1>{};
│ │ │ │ +
158 return Dune::Hybrid::switchCases(allIndices, LocalGeometryTypeIndex::index(gt), callWithId, fallBack);
│ │ │ │ +
159 }
│ │ │ │ +
160
│ │ │ │ +
161 } // namespace Impl
│ │ │ │ +
162} // namespace Dune
│ │ │ │ +
163
│ │ │ │ +
164#endif // DUNE_GEOMETRY_TYPEINDEX_HH
│ │ │ │ +
A unique label for each type of element that can occur in a grid.
│ │ │ │
Definition affinegeometry.hh:21
│ │ │ │ -
This class provides access to geometric and topological properties of a reference element.
Definition referenceelement.hh:52
│ │ │ │ -
Class providing access to the singletons of the reference elements.
Definition referenceelements.hh:170
│ │ │ │ -
static Iterator begin()
Definition referenceelements.hh:215
│ │ │ │ -
Iterator iterator
Iterator over available reference elements.
Definition referenceelements.hh:194
│ │ │ │ -
typename Container::ReferenceElement ReferenceElement
The reference element type.
Definition referenceelements.hh:188
│ │ │ │ -
static const ReferenceElement & cube()
get hypercube reference elements
Definition referenceelements.hh:210
│ │ │ │ -
static Iterator end()
Definition referenceelements.hh:220
│ │ │ │ -
ctype_ ctype
The coordinate field type of the contained reference elements.
Definition referenceelements.hh:173
│ │ │ │ -
static const ReferenceElement & general(const GeometryType &type)
get general reference elements
Definition referenceelements.hh:198
│ │ │ │ -
static const ReferenceElement & simplex()
get simplex reference elements
Definition referenceelements.hh:204
│ │ │ │ -
typename Container::const_iterator Iterator
Iterator over available reference elements.
Definition referenceelements.hh:191
│ │ │ │ -
static constexpr int dimension
The dimension of the contained reference elements.
Definition referenceelements.hh:179
│ │ │ │ -
ctype CoordinateField
The coordinate field type of the contained reference elements.
Definition referenceelements.hh:176
│ │ │ │ -
Static tag representing a dimension.
Definition dimension.hh:16
│ │ │ │
Unique label for each type of entities that can occur in DUNE grids.
Definition type.hh:126
│ │ │ │ +
constexpr Id toId() const
Create an Id representation of this GeometryType.
Definition type.hh:222
│ │ │ │ +
constexpr unsigned int dim() const
Return dimension of the type.
Definition type.hh:372
│ │ │ │
constexpr unsigned int id() const
Return the topology id of the type.
Definition type.hh:377
│ │ │ │ +
constexpr bool isNone() const
Return true if entity is a singular of any dimension.
Definition type.hh:367
│ │ │ │ +
Compute per-dimension indices for geometry types.
Definition typeindex.hh:25
│ │ │ │ +
static constexpr std::size_t size(std::size_t dim)
Compute total number of geometry types for the given dimension.
Definition typeindex.hh:61
│ │ │ │ +
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
│ │ │ │ +
static constexpr std::size_t index(const GeometryType &gt)
Compute the index for the given geometry type within its dimension.
Definition typeindex.hh:73
│ │ │ │ +
Compute indices for geometry types, taking the dimension into account.
Definition typeindex.hh:90
│ │ │ │ +
static constexpr std::size_t index(const GeometryType &gt)
Compute the index for the given geometry type over all dimensions.
Definition typeindex.hh:138
│ │ │ │ +
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
│ │ │ │ +
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
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -7,480 +7,185 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ -referenceelements.hh │ │ │ │ │ +typeindex.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception │ │ │ │ │ - 5#ifndef DUNE_GEOMETRY_REFERENCEELEMENTS_HH │ │ │ │ │ - 6#define DUNE_GEOMETRY_REFERENCEELEMENTS_HH │ │ │ │ │ + 5#ifndef DUNE_GEOMETRY_TYPEINDEX_HH │ │ │ │ │ + 6#define DUNE_GEOMETRY_TYPEINDEX_HH │ │ │ │ │ 7 │ │ │ │ │ - 8#include │ │ │ │ │ - 9 │ │ │ │ │ - 10#include │ │ │ │ │ - 11#include │ │ │ │ │ - 12#include │ │ │ │ │ - 13#include │ │ │ │ │ - 14#include │ │ │ │ │ - 15#include │ │ │ │ │ - 16 │ │ │ │ │ - 17#include │ │ │ │ │ - 18#include │ │ │ │ │ - 19#include │ │ │ │ │ + 14#include │ │ │ │ │ + 15 │ │ │ │ │ + 16#include │ │ │ │ │ + 17#include │ │ │ │ │ + 18 │ │ │ │ │ + 19#include "type.hh" │ │ │ │ │ 20 │ │ │ │ │ - 21#include │ │ │ │ │ - 22#include │ │ │ │ │ - 23#include │ │ │ │ │ - 24#include │ │ │ │ │ - 25 │ │ │ │ │ - 26namespace Dune │ │ │ │ │ - 27{ │ │ │ │ │ - 28 │ │ │ │ │ - 29 namespace Geo │ │ │ │ │ - 30 { │ │ │ │ │ - 31 │ │ │ │ │ - 32#ifndef DOXYGEN │ │ │ │ │ - 33 │ │ │ │ │ - 34 │ │ │ │ │ - 35 template │ │ │ │ │ - 36 class DeprecatedReferenceElement │ │ │ │ │ - 37 : public ReferenceElement> │ │ │ │ │ - 38 { │ │ │ │ │ - 39 │ │ │ │ │ - 40 protected: │ │ │ │ │ - 41 │ │ │ │ │ - 42 DeprecatedReferenceElement() = default; │ │ │ │ │ - 43 │ │ │ │ │ - 44 public: │ │ │ │ │ - 45 │ │ │ │ │ - 46 DeprecatedReferenceElement(const DeprecatedReferenceElement&) = delete; │ │ │ │ │ - 47 DeprecatedReferenceElement& operator=(const DeprecatedReferenceElement&) = │ │ │ │ │ -delete; │ │ │ │ │ - 48 │ │ │ │ │ - 49 DeprecatedReferenceElement(const ReferenceElementImplementation& │ │ │ │ │ -impl) │ │ │ │ │ - 50 : ReferenceElement>(impl) │ │ │ │ │ - 51 {} │ │ │ │ │ - 52 │ │ │ │ │ - 53 }; │ │ │ │ │ + 21namespace Dune │ │ │ │ │ + 22{ │ │ │ │ │ +24 class LocalGeometryTypeIndex │ │ │ │ │ + 25 { │ │ │ │ │ + 32 inline static constexpr std::size_t regular_size(std::size_t dim) │ │ │ │ │ + 33 { │ │ │ │ │ + 34 // The following expression is derived from the expression for │ │ │ │ │ + 35 // GlobalGeometryTypeIndex::regular_offset(). Subtracting │ │ │ │ │ + 36 // regular_offset(dim+1)-regular_offset(dim) we get: │ │ │ │ │ + 37 // │ │ │ │ │ + 38 // ((1 << dim+1) >> 1) - ((1 << dim) >> 1) │ │ │ │ │ + 39 // │ │ │ │ │ + 40 // We always have │ │ │ │ │ + 41 // │ │ │ │ │ + 42 // dim >= 0, │ │ │ │ │ + 43 // │ │ │ │ │ + 44 // so │ │ │ │ │ + 45 // │ │ │ │ │ + 46 // (1 << dim+1) >= 2 and (1 << dim+2) % 2 == 0. │ │ │ │ │ + 47 // │ │ │ │ │ + 48 // So if we apply a single right-shift to that, we will never lose any │ │ │ │ │ + 49 // set bits, thus │ │ │ │ │ + 50 // │ │ │ │ │ + 51 // ((1 << dim+1) >> 1) == (1 << dim) │ │ │ │ │ + 52 return (1 << dim) - ((1 << dim) >> 1); │ │ │ │ │ + 53 } │ │ │ │ │ 54 │ │ │ │ │ - 55 │ │ │ │ │ - 56 template │ │ │ │ │ - 57 class ConstructibleDeprecatedReferenceElement │ │ │ │ │ - 58 : public DeprecatedReferenceElement │ │ │ │ │ - 59 { │ │ │ │ │ - 60 public: │ │ │ │ │ - 61 ConstructibleDeprecatedReferenceElement() = default; │ │ │ │ │ - 62 }; │ │ │ │ │ - 63 │ │ │ │ │ - 64 │ │ │ │ │ - 65 namespace Impl │ │ │ │ │ - 66 { │ │ │ │ │ - 67 │ │ │ │ │ - 68 // ReferenceElementContainer │ │ │ │ │ - 69 // ------------------------- │ │ │ │ │ - 70 │ │ │ │ │ - 71 template< class ctype, int dim > │ │ │ │ │ - 72 class ReferenceElementContainer │ │ │ │ │ - 73 { │ │ │ │ │ - 74 static const unsigned int numTopologies = dim >= 0 ? (1u << dim) : 0; │ │ │ │ │ - 75 │ │ │ │ │ - 76 using Implementation = ReferenceElementImplementation< ctype, dim >; │ │ │ │ │ - 77 using ConstructibleDeprecatedReferenceElement = Dune::Geo:: │ │ │ │ │ -ConstructibleDeprecatedReferenceElement; │ │ │ │ │ - 78 │ │ │ │ │ - 79 public: │ │ │ │ │ - 80 │ │ │ │ │ - 81 using DeprecatedReferenceElement = Dune::Geo:: │ │ │ │ │ -DeprecatedReferenceElement; │ │ │ │ │ - 82 │ │ │ │ │ - 83 using ReferenceElement = Dune::Geo::ReferenceElement<_Implementation_>; │ │ │ │ │ - 84 using value_type = ReferenceElement; │ │ │ │ │ - 85 using const_iterator = const value_type*; │ │ │ │ │ - 86 │ │ │ │ │ - 87 ReferenceElementContainer () │ │ │ │ │ - 88 { │ │ │ │ │ - 89 for( unsigned int topologyId = 0; topologyId < numTopologies; ++topologyId │ │ │ │ │ -) │ │ │ │ │ + 55 public: │ │ │ │ │ +61 inline static constexpr std::size_t size(std::size_t dim) │ │ │ │ │ + 62 { │ │ │ │ │ + 63 // one for "none" │ │ │ │ │ + 64 return regular_size(dim) + 1; │ │ │ │ │ + 65 } │ │ │ │ │ + 66 │ │ │ │ │ +73 inline static constexpr std::size_t index(const GeometryType >) │ │ │ │ │ + 74 { │ │ │ │ │ + 75 return gt.isNone() ? regular_size(gt.dim()) : (gt.id() >> 1); │ │ │ │ │ + 76 } │ │ │ │ │ + 77 │ │ │ │ │ +79 inline static constexpr GeometryType type(std::size_t dim, std::size_t │ │ │ │ │ +index) { │ │ │ │ │ + 80 return (index == regular_size(dim)) ? │ │ │ │ │ + 81 GeometryTypes::none(dim) : │ │ │ │ │ + 82 // the cast to unsigned makes sure this is interpreted as the topology │ │ │ │ │ + 83 // ID constructor │ │ │ │ │ + 84 GeometryType(static_cast< unsigned int >(index << 1), dim); │ │ │ │ │ + 85 } │ │ │ │ │ + 86 }; │ │ │ │ │ + 87 │ │ │ │ │ +89 class GlobalGeometryTypeIndex │ │ │ │ │ 90 { │ │ │ │ │ - 91 implementations_[ topologyId ].initialize( topologyId ); │ │ │ │ │ - 92 reference_elements_[ topologyId ].setImplementation( implementations_ │ │ │ │ │ -[ topologyId ] ); │ │ │ │ │ - 93 } │ │ │ │ │ - 94 } │ │ │ │ │ - 95 │ │ │ │ │ - 96 const ReferenceElement& operator() ( const GeometryType &type ) const │ │ │ │ │ - 97 { │ │ │ │ │ - 98 assert( type.dim() == dim ); │ │ │ │ │ - 99 return reference_elements_[ type.id() ]; │ │ │ │ │ - 100 } │ │ │ │ │ - 101 │ │ │ │ │ - 102 const ReferenceElement& simplex () const │ │ │ │ │ - 103 { │ │ │ │ │ - 104 return reference_elements_[ Dune::GeometryTypes::simplex(dim).id() ]; │ │ │ │ │ - 105 } │ │ │ │ │ - 106 │ │ │ │ │ - 107 const ReferenceElement& cube () const │ │ │ │ │ - 108 { │ │ │ │ │ - 109 return reference_elements_[ Dune::GeometryTypes::cube(dim).id() ]; │ │ │ │ │ - 110 } │ │ │ │ │ - 111 │ │ │ │ │ - 112 const ReferenceElement& pyramid () const │ │ │ │ │ - 113 { │ │ │ │ │ - 114 return reference_elements_[ Dune::GeometryTypes::pyramid.id() ]; │ │ │ │ │ - 115 } │ │ │ │ │ - 116 │ │ │ │ │ - 117 const ReferenceElement& prism () const │ │ │ │ │ - 118 { │ │ │ │ │ - 119 return reference_elements_[ Dune::GeometryTypes::prism.id() ]; │ │ │ │ │ - 120 } │ │ │ │ │ - 121 │ │ │ │ │ - 122 const_iterator begin () const │ │ │ │ │ - 123 { │ │ │ │ │ - 124 return reference_elements_.data(); │ │ │ │ │ - 125 } │ │ │ │ │ - 126 │ │ │ │ │ - 127 const_iterator end () const │ │ │ │ │ - 128 { │ │ │ │ │ - 129 return reference_elements_.data() + numTopologies; │ │ │ │ │ - 130 } │ │ │ │ │ - 131 │ │ │ │ │ - 132 // here, we make sure to actually return a const reference to something │ │ │ │ │ - 133 // that is guaranteed not to become invalid, as otherwise, we might run │ │ │ │ │ - 134 // straight into debugging hell when a user binds the return value to a │ │ │ │ │ - 135 // const ref and the temporary goes out of scope. │ │ │ │ │ - 136 const DeprecatedReferenceElement& deprecated(const ReferenceElement& v) │ │ │ │ │ -const │ │ │ │ │ - 137 { │ │ │ │ │ - 138 return reference_elements_[v.impl().type(0,0).id()]; │ │ │ │ │ - 139 } │ │ │ │ │ - 140 │ │ │ │ │ - 141 private: │ │ │ │ │ - 142 │ │ │ │ │ - 143 std::array implementations_; │ │ │ │ │ - 144 std::array │ │ │ │ │ -reference_elements_; │ │ │ │ │ + 98 inline static constexpr std::size_t regular_offset(std::size_t dim) │ │ │ │ │ + 99 { │ │ │ │ │ + 100 // The number of regular geometry types in a given dimension is │ │ │ │ │ + 101 // 2^(dim-1). For dim==0 this would yield 1/2 geometry types (which is │ │ │ │ │ + 102 // obviously bogus, dim==0 has one regular geometry type, the point). │ │ │ │ │ + 103 // The following expression relies on 1 >> 1 == 0 to treat dim==0 │ │ │ │ │ + 104 // specially. │ │ │ │ │ + 105 return (1 << dim) >> 1; │ │ │ │ │ + 106 } │ │ │ │ │ + 107 │ │ │ │ │ + 108 public: │ │ │ │ │ +113 inline static constexpr std::size_t offset(std::size_t dim) │ │ │ │ │ + 114 { │ │ │ │ │ + 115 // dim times "none" │ │ │ │ │ + 116 return regular_offset(dim) + dim; │ │ │ │ │ + 117 } │ │ │ │ │ + 118 │ │ │ │ │ +125 inline static constexpr std::size_t size(std::size_t maxdim) │ │ │ │ │ + 126 { │ │ │ │ │ + 127 return offset(maxdim+1); │ │ │ │ │ + 128 } │ │ │ │ │ + 129 │ │ │ │ │ +138 inline static constexpr std::size_t index(const GeometryType >) │ │ │ │ │ + 139 { │ │ │ │ │ + 140 return offset(gt.dim()) + LocalGeometryTypeIndex::index(gt); │ │ │ │ │ + 141 } │ │ │ │ │ + 142 }; │ │ │ │ │ + 143 │ │ │ │ │ + 144 namespace Impl { │ │ │ │ │ 145 │ │ │ │ │ - 146 }; │ │ │ │ │ - 147 │ │ │ │ │ - 148 │ │ │ │ │ - 149 } // namespace Impl │ │ │ │ │ - 150 │ │ │ │ │ - 151 │ │ │ │ │ - 152#endif // DOXYGEN │ │ │ │ │ - 153 │ │ │ │ │ - 154 │ │ │ │ │ - 155 // ReferenceElements │ │ │ │ │ - 156 // ------------------------ │ │ │ │ │ - 157 │ │ │ │ │ - 168 template< class ctype_, int dim > │ │ │ │ │ -169 struct ReferenceElements │ │ │ │ │ - 170 { │ │ │ │ │ - 171 │ │ │ │ │ -173 using ctype = ctype_; │ │ │ │ │ - 174 │ │ │ │ │ -176 using CoordinateField = ctype; │ │ │ │ │ - 177 │ │ │ │ │ -179 static constexpr int dimension = dim; │ │ │ │ │ - 180 │ │ │ │ │ - 181 private: │ │ │ │ │ - 182 │ │ │ │ │ - 183 using Container = Impl::ReferenceElementContainer< ctype, dim >; │ │ │ │ │ - 184 │ │ │ │ │ - 185 public: │ │ │ │ │ - 186 │ │ │ │ │ -188 using ReferenceElement = typename Container::ReferenceElement; │ │ │ │ │ - 189 │ │ │ │ │ -191 using Iterator = typename Container::const_iterator; │ │ │ │ │ - 192 │ │ │ │ │ -194 using iterator = Iterator; │ │ │ │ │ - 195 │ │ │ │ │ - 197 static const ReferenceElement& │ │ │ │ │ -198 general ( const GeometryType& type ) │ │ │ │ │ - 199 { │ │ │ │ │ - 200 return container() ( type ); │ │ │ │ │ - 201 } │ │ │ │ │ - 202 │ │ │ │ │ -204 static const ReferenceElement& simplex () │ │ │ │ │ - 205 { │ │ │ │ │ - 206 return container().simplex(); │ │ │ │ │ - 207 } │ │ │ │ │ - 208 │ │ │ │ │ -210 static const ReferenceElement& cube () │ │ │ │ │ - 211 { │ │ │ │ │ - 212 return container().cube(); │ │ │ │ │ - 213 } │ │ │ │ │ - 214 │ │ │ │ │ -215 static Iterator begin () │ │ │ │ │ - 216 { │ │ │ │ │ - 217 return container().begin(); │ │ │ │ │ - 218 } │ │ │ │ │ - 219 │ │ │ │ │ -220 static Iterator end () │ │ │ │ │ - 221 { │ │ │ │ │ - 222 return container().end(); │ │ │ │ │ - 223 } │ │ │ │ │ - 224 │ │ │ │ │ - 225#ifndef DOXYGEN │ │ │ │ │ - 226 static const typename Container::DeprecatedReferenceElement& │ │ │ │ │ - 227 deprecated(const ReferenceElement& v) │ │ │ │ │ - 228 { │ │ │ │ │ - 229 return container().deprecated(v); │ │ │ │ │ - 230 } │ │ │ │ │ - 231#endif // DOXYGEN │ │ │ │ │ - 232 │ │ │ │ │ - 233 private: │ │ │ │ │ - 234 │ │ │ │ │ - 235 DUNE_EXPORT static const Container& container () │ │ │ │ │ - 236 { │ │ │ │ │ - 237 static Container container; │ │ │ │ │ - 238 return container; │ │ │ │ │ - 239 } │ │ │ │ │ - 240 }; │ │ │ │ │ - 241 │ │ │ │ │ - 242 } // namespace Geo │ │ │ │ │ - 243 │ │ │ │ │ - 245 using Geo::ReferenceElements; │ │ │ │ │ - 246 │ │ │ │ │ - 247 │ │ │ │ │ - 248#ifdef DOXYGEN │ │ │ │ │ - 249 │ │ │ │ │ - 251 │ │ │ │ │ - 294 template │ │ │ │ │ -295 unspecified-value-type referenceElement(T&&... t); │ │ │ │ │ - 296 │ │ │ │ │ - 297#endif │ │ │ │ │ - 298 │ │ │ │ │ - 299 │ │ │ │ │ - 301 │ │ │ │ │ - 314 template │ │ │ │ │ -315 auto referenceElement(const Dune::GeometryType& gt, Dune::Dim = {}) │ │ │ │ │ - 316 { │ │ │ │ │ - 317 return ReferenceElements::general(gt); │ │ │ │ │ - 318 } │ │ │ │ │ - 319 │ │ │ │ │ - 320 │ │ │ │ │ - 322 │ │ │ │ │ - 334 template>:: │ │ │ │ │ -value, int> = 0> │ │ │ │ │ -335 auto referenceElement(const T&, const Dune::GeometryType& gt, Dune:: │ │ │ │ │ -Dim) │ │ │ │ │ - 336 { │ │ │ │ │ - 337 return ReferenceElements::general(gt); │ │ │ │ │ - 338 } │ │ │ │ │ - 339 │ │ │ │ │ - 340 │ │ │ │ │ - 341#ifndef DOXYGEN │ │ │ │ │ - 342 │ │ │ │ │ - 343 // helpers for the ReferenceElement<> meta function │ │ │ │ │ - 344 │ │ │ │ │ - 345 namespace Impl { │ │ │ │ │ - 346 │ │ │ │ │ - 347 // Evaluates to the correct reference element iff matches the │ │ │ │ │ -pattern > │ │ │ │ │ - 348 // otherwise, it's ill-formed. Should be used with detected_or and │ │ │ │ │ -friends. │ │ │ │ │ - 349 │ │ │ │ │ - 350 template │ │ │ │ │ - 351 struct DefaultReferenceElementExtractor; │ │ │ │ │ - 352 │ │ │ │ │ - 353 template::value,int>::type │ │ │ │ │ -dim> │ │ │ │ │ - 354 struct DefaultReferenceElementExtractor> │ │ │ │ │ - 355 { │ │ │ │ │ - 356 using type = typename Dune::Geo::ReferenceElements:: │ │ │ │ │ -ReferenceElement; │ │ │ │ │ - 357 }; │ │ │ │ │ - 358 │ │ │ │ │ - 359 template │ │ │ │ │ - 360 using DefaultReferenceElement = typename │ │ │ │ │ -DefaultReferenceElementExtractor::type; │ │ │ │ │ - 361 │ │ │ │ │ - 362 } │ │ │ │ │ - 363 │ │ │ │ │ - 364 // looks up the type of a reference element by trying to instantiate the │ │ │ │ │ -correct overload │ │ │ │ │ - 365 // of referenceElement() for the given arguments. This will fail if there │ │ │ │ │ -is no valid │ │ │ │ │ - 366 // overload and should be used with detected_or or some other utility that │ │ │ │ │ -places the │ │ │ │ │ - 367 // instantiation in SFINAE context. │ │ │ │ │ - 368 // │ │ │ │ │ - 369 // this is placed directly in namespace Dune to avoid any weird surprises │ │ │ │ │ - 370 │ │ │ │ │ - 371 template │ │ │ │ │ - 372 using LookupReferenceElement = decltype(referenceElement(std::declval │ │ │ │ │ -()...)); │ │ │ │ │ - 373 │ │ │ │ │ - 374#endif // DOXYGEN │ │ │ │ │ - 375 │ │ │ │ │ -376 namespace Transitional { │ │ │ │ │ - 377 │ │ │ │ │ - 378#ifndef DOXYGEN │ │ │ │ │ - 379 │ │ │ │ │ - 380 // this abomination checks whether the template signature matches the │ │ │ │ │ -special case │ │ │ │ │ - 381 // ReferenceElement> and otherwise defers the │ │ │ │ │ -type lookup │ │ │ │ │ - 382 // to a decltype on a call to referenceElement(std::declval()) │ │ │ │ │ - 383 │ │ │ │ │ - 384 template │ │ │ │ │ - 385 using ReferenceElement = Std::detected_or_t< │ │ │ │ │ - 386 Std::detected_t, │ │ │ │ │ - 387 Impl::DefaultReferenceElement, │ │ │ │ │ - 388 T... │ │ │ │ │ - 389 >; │ │ │ │ │ - 390 │ │ │ │ │ - 391#else // DOXYGEN │ │ │ │ │ - 392 │ │ │ │ │ - 394 │ │ │ │ │ - 416 template │ │ │ │ │ - 417 using ReferenceElement = unspecified-type; │ │ │ │ │ - 418 │ │ │ │ │ - 419#endif //DOXYGEN │ │ │ │ │ - 420 │ │ │ │ │ - 421 } │ │ │ │ │ - 422 │ │ │ │ │ - 423#ifndef DOXYGEN │ │ │ │ │ - 424 │ │ │ │ │ - 425 namespace Impl { │ │ │ │ │ - 426 │ │ │ │ │ - 427 // helpers for triggering a deprecation warning for occurrences of the old │ │ │ │ │ - 428 // ReferenceElement syntax (Dune::ReferenceElement) │ │ │ │ │ - 429 │ │ │ │ │ - 430 // this looks a little weird, encoding the type in the return type of a │ │ │ │ │ -nested function, │ │ │ │ │ - 431 // but it was the only reliable way to trigger the warning iff the │ │ │ │ │ -compiler encounters │ │ │ │ │ - 432 // an invalid use. Other solutions either miss some (or all) uses or │ │ │ │ │ -trigger false alarms. │ │ │ │ │ - 433 │ │ │ │ │ - 434 template │ │ │ │ │ - 435 struct ValidReferenceElementTypeSignature │ │ │ │ │ - 436 { │ │ │ │ │ - 437 Transitional::ReferenceElement check(); │ │ │ │ │ - 438 }; │ │ │ │ │ - 439 │ │ │ │ │ - 440 template │ │ │ │ │ - 441 struct DeprecatedReferenceElementTypeSignature │ │ │ │ │ - 442 { │ │ │ │ │ - 443 [[deprecated("Dune::ReferenceElement is deprecated, please use │ │ │ │ │ -Dune::ReferenceElement (if you have a geometry), Dune:: │ │ │ │ │ -ReferenceElements::ReferenceElement or Dune::Transitional:: │ │ │ │ │ -ReferenceElement> instead. After Dune 2.6, you will be able to │ │ │ │ │ -use Dune::ReferenceElement>.")]] T check(); │ │ │ │ │ - 444 }; │ │ │ │ │ - 445 │ │ │ │ │ - 446 } // namespace Impl │ │ │ │ │ - 447 │ │ │ │ │ - 448 // This just makes sure the user doesn't use invalid syntax (by checking │ │ │ │ │ -against the -1 default for │ │ │ │ │ - 449 // the dimension, and then either hands back the old-style type along with │ │ │ │ │ -a deprecation warning or │ │ │ │ │ - 450 // forwards to the transitional version │ │ │ │ │ - 451 template │ │ │ │ │ - 452 using ReferenceElement = decltype( │ │ │ │ │ - 453 std::declval< │ │ │ │ │ - 454 typename std::conditional< │ │ │ │ │ - 455 dim == -1, │ │ │ │ │ - 456 Impl::ValidReferenceElementTypeSignature, │ │ │ │ │ - 457 Impl::DeprecatedReferenceElementTypeSignature> │ │ │ │ │ - 458 >::type │ │ │ │ │ - 459 >().check()); │ │ │ │ │ - 460 │ │ │ │ │ - 461#else // DOXYGEN │ │ │ │ │ - 462 │ │ │ │ │ - 464 │ │ │ │ │ - 496 template │ │ │ │ │ -497 using ReferenceElement = unspecified-type; │ │ │ │ │ - 498 │ │ │ │ │ - 499#endif // DOXYGEN │ │ │ │ │ - 500 │ │ │ │ │ - 501 │ │ │ │ │ - 502 │ │ │ │ │ - 503} // namespace Dune │ │ │ │ │ - 504 │ │ │ │ │ - 505#endif // #ifndef DUNE_GEOMETRY_REFERENCEELEMENTS_HH │ │ │ │ │ -dimension.hh │ │ │ │ │ -referenceelementimplementation.hh │ │ │ │ │ -referenceelement.hh │ │ │ │ │ + 146 // Map a dynamic GeometryType to a static integral_constant │ │ │ │ │ + 147 template │ │ │ │ │ + 148 static auto toGeometryTypeIdConstant(const GeometryType& gt, F&& f) { │ │ │ │ │ + 149 // Transform LocalGeometryTypeIndex to GeometryType::Id │ │ │ │ │ + 150 auto callWithId = [&](auto index) { │ │ │ │ │ + 151 static constexpr auto id = LocalGeometryTypeIndex::type(dim, decltype │ │ │ │ │ +(index)::value).toId(); │ │ │ │ │ + 152 return f(std::integral_constant{}); │ │ │ │ │ + 153 }; │ │ │ │ │ + 154 // switchCases needs a fallback to determine the return type. │ │ │ │ │ + 155 auto fallBack = [&]() { return callWithId(Dune::Indices::_0); }; │ │ │ │ │ + 156 // Iterate over all _regular_ GeometryType indices for given dimension │ │ │ │ │ + 157 auto allIndices = std::make_index_sequence{}; │ │ │ │ │ + 158 return Dune::Hybrid::switchCases(allIndices, LocalGeometryTypeIndex::index │ │ │ │ │ +(gt), callWithId, fallBack); │ │ │ │ │ + 159 } │ │ │ │ │ + 160 │ │ │ │ │ + 161 } // namespace Impl │ │ │ │ │ + 162} // namespace Dune │ │ │ │ │ + 163 │ │ │ │ │ + 164#endif // DUNE_GEOMETRY_TYPEINDEX_HH │ │ │ │ │ type.hh │ │ │ │ │ A unique label for each type of element that can occur in a grid. │ │ │ │ │ -Dune::referenceElement │ │ │ │ │ -unspecified value type referenceElement(T &&... t) │ │ │ │ │ -Returns a reference element for the objects t.... │ │ │ │ │ -Dune::ReferenceElement │ │ │ │ │ -unspecified-type ReferenceElement │ │ │ │ │ -Returns the type of reference element for the argument type T. │ │ │ │ │ -Definition referenceelements.hh:497 │ │ │ │ │ Dune │ │ │ │ │ Definition affinegeometry.hh:21 │ │ │ │ │ -Dune::Geo::ReferenceElement │ │ │ │ │ -This class provides access to geometric and topological properties of a │ │ │ │ │ -reference element. │ │ │ │ │ -Definition referenceelement.hh:52 │ │ │ │ │ -Dune::Geo::ReferenceElements │ │ │ │ │ -Class providing access to the singletons of the reference elements. │ │ │ │ │ -Definition referenceelements.hh:170 │ │ │ │ │ -Dune::Geo::ReferenceElements::begin │ │ │ │ │ -static Iterator begin() │ │ │ │ │ -Definition referenceelements.hh:215 │ │ │ │ │ -Dune::Geo::ReferenceElements::iterator │ │ │ │ │ -Iterator iterator │ │ │ │ │ -Iterator over available reference elements. │ │ │ │ │ -Definition referenceelements.hh:194 │ │ │ │ │ -Dune::Geo::ReferenceElements::ReferenceElement │ │ │ │ │ -typename Container::ReferenceElement ReferenceElement │ │ │ │ │ -The reference element type. │ │ │ │ │ -Definition referenceelements.hh:188 │ │ │ │ │ -Dune::Geo::ReferenceElements::cube │ │ │ │ │ -static const ReferenceElement & cube() │ │ │ │ │ -get hypercube reference elements │ │ │ │ │ -Definition referenceelements.hh:210 │ │ │ │ │ -Dune::Geo::ReferenceElements::end │ │ │ │ │ -static Iterator end() │ │ │ │ │ -Definition referenceelements.hh:220 │ │ │ │ │ -Dune::Geo::ReferenceElements::ctype │ │ │ │ │ -ctype_ ctype │ │ │ │ │ -The coordinate field type of the contained reference elements. │ │ │ │ │ -Definition referenceelements.hh:173 │ │ │ │ │ -Dune::Geo::ReferenceElements::general │ │ │ │ │ -static const ReferenceElement & general(const GeometryType &type) │ │ │ │ │ -get general reference elements │ │ │ │ │ -Definition referenceelements.hh:198 │ │ │ │ │ -Dune::Geo::ReferenceElements::simplex │ │ │ │ │ -static const ReferenceElement & simplex() │ │ │ │ │ -get simplex reference elements │ │ │ │ │ -Definition referenceelements.hh:204 │ │ │ │ │ -Dune::Geo::ReferenceElements::Iterator │ │ │ │ │ -typename Container::const_iterator Iterator │ │ │ │ │ -Iterator over available reference elements. │ │ │ │ │ -Definition referenceelements.hh:191 │ │ │ │ │ -Dune::Geo::ReferenceElements::dimension │ │ │ │ │ -static constexpr int dimension │ │ │ │ │ -The dimension of the contained reference elements. │ │ │ │ │ -Definition referenceelements.hh:179 │ │ │ │ │ -Dune::Geo::ReferenceElements::CoordinateField │ │ │ │ │ -ctype CoordinateField │ │ │ │ │ -The coordinate field type of the contained reference elements. │ │ │ │ │ -Definition referenceelements.hh:176 │ │ │ │ │ -Dune::Dim │ │ │ │ │ -Static tag representing a dimension. │ │ │ │ │ -Definition dimension.hh:16 │ │ │ │ │ Dune::GeometryType │ │ │ │ │ Unique label for each type of entities that can occur in DUNE grids. │ │ │ │ │ Definition type.hh:126 │ │ │ │ │ +Dune::GeometryType::toId │ │ │ │ │ +constexpr Id toId() const │ │ │ │ │ +Create an Id representation of this GeometryType. │ │ │ │ │ +Definition type.hh:222 │ │ │ │ │ +Dune::GeometryType::dim │ │ │ │ │ +constexpr unsigned int dim() const │ │ │ │ │ +Return dimension of the type. │ │ │ │ │ +Definition type.hh:372 │ │ │ │ │ Dune::GeometryType::id │ │ │ │ │ constexpr unsigned int id() const │ │ │ │ │ Return the topology id of the type. │ │ │ │ │ Definition type.hh:377 │ │ │ │ │ +Dune::GeometryType::isNone │ │ │ │ │ +constexpr bool isNone() const │ │ │ │ │ +Return true if entity is a singular of any dimension. │ │ │ │ │ +Definition type.hh:367 │ │ │ │ │ +Dune::LocalGeometryTypeIndex │ │ │ │ │ +Compute per-dimension indices for geometry types. │ │ │ │ │ +Definition typeindex.hh:25 │ │ │ │ │ +Dune::LocalGeometryTypeIndex::size │ │ │ │ │ +static constexpr std::size_t size(std::size_t dim) │ │ │ │ │ +Compute total number of geometry types for the given dimension. │ │ │ │ │ +Definition typeindex.hh:61 │ │ │ │ │ +Dune::LocalGeometryTypeIndex::type │ │ │ │ │ +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 │ │ │ │ │ +Dune::LocalGeometryTypeIndex::index │ │ │ │ │ +static constexpr std::size_t index(const GeometryType >) │ │ │ │ │ +Compute the index for the given geometry type within its dimension. │ │ │ │ │ +Definition typeindex.hh:73 │ │ │ │ │ +Dune::GlobalGeometryTypeIndex │ │ │ │ │ +Compute indices for geometry types, taking the dimension into account. │ │ │ │ │ +Definition typeindex.hh:90 │ │ │ │ │ +Dune::GlobalGeometryTypeIndex::index │ │ │ │ │ +static constexpr std::size_t index(const GeometryType >) │ │ │ │ │ +Compute the index for the given geometry type over all dimensions. │ │ │ │ │ +Definition typeindex.hh:138 │ │ │ │ │ +Dune::GlobalGeometryTypeIndex::offset │ │ │ │ │ +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 │ │ │ │ │ +Dune::GlobalGeometryTypeIndex::size │ │ │ │ │ +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 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00194.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: multilineargeometry.hh File Reference │ │ │ │ +dune-geometry: generalvertexorder.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -71,56 +71,50 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
multilineargeometry.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Functions
│ │ │ │ +
generalvertexorder.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <cassert>
│ │ │ │ -#include <functional>
│ │ │ │ +
#include <algorithm>
│ │ │ │ +#include <cassert>
│ │ │ │ +#include <cstddef>
│ │ │ │ #include <iterator>
│ │ │ │ -#include <limits>
│ │ │ │ #include <vector>
│ │ │ │ -#include <dune/common/fmatrix.hh>
│ │ │ │ -#include <dune/common/fvector.hh>
│ │ │ │ -#include <dune/common/typetraits.hh>
│ │ │ │ -#include <dune/geometry/affinegeometry.hh>
│ │ │ │ -#include <dune/geometry/referenceelements.hh>
│ │ │ │ -#include <dune/geometry/type.hh>
│ │ │ │ +#include <dune/common/iteratorfacades.hh>
│ │ │ │ +#include "type.hh"
│ │ │ │ +#include <dune/geometry/referenceelements.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

struct  Dune::MultiLinearGeometryTraits< ct >
 default traits class for MultiLinearGeometry More...
class  Dune::GeneralVertexOrder< dim, Index_ >
 Class providing information on the ordering of vertices. 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...
class  Dune::GeneralVertexOrder< dim, Index_ >::iterator
 Iterate over the vertex indices of some sub-entity. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ │ Namespaces

namespace  Dune
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +Functions

template<class InIterator , class OutIterator >
void Dune::reduceOrder (const InIterator &inBegin, const InIterator &inEnd, OutIterator outIt)
 Algorithm to reduce vertex order information.
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -6,46 +6,37 @@ │ │ │ │ │ dune-geometry 2.9.0 │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -multilineargeometry.hh File Reference │ │ │ │ │ +Classes | Namespaces | Functions │ │ │ │ │ +generalvertexorder.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ +#include "type.hh" │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -struct  Dune::MultiLinearGeometryTraits<_ct_> │ │ │ │ │ -  default traits class for MultiLinearGeometry More... │ │ │ │ │ +class  Dune::GeneralVertexOrder<_dim,_Index__> │ │ │ │ │ +  Class providing information on the ordering of vertices. 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... │ │ │ │ │ +class  Dune::GeneralVertexOrder<_dim,_Index__>::iterator │ │ │ │ │ +  Iterate over the vertex indices of some sub-entity. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ + Functions │ │ │ │ │ +template │ │ │ │ │ +void Dune::reduceOrder (const InIterator &inBegin, const InIterator &inEnd, │ │ │ │ │ + OutIterator outIt) │ │ │ │ │ +  Algorithm to reduce vertex order information. │ │ │ │ │ +  │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00194_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: multilineargeometry.hh Source File │ │ │ │ +dune-geometry: generalvertexorder.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,839 +74,186 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
multilineargeometry.hh
│ │ │ │ +
generalvertexorder.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
│ │ │ │ -
5#ifndef DUNE_GEOMETRY_MULTILINEARGEOMETRY_HH
│ │ │ │ -
6#define DUNE_GEOMETRY_MULTILINEARGEOMETRY_HH
│ │ │ │ -
7
│ │ │ │ -
8#include <cassert>
│ │ │ │ -
9#include <functional>
│ │ │ │ -
10#include <iterator>
│ │ │ │ -
11#include <limits>
│ │ │ │ -
12#include <vector>
│ │ │ │ -
13
│ │ │ │ -
14#include <dune/common/fmatrix.hh>
│ │ │ │ -
15#include <dune/common/fvector.hh>
│ │ │ │ -
16#include <dune/common/typetraits.hh>
│ │ │ │ -
17
│ │ │ │ - │ │ │ │ - │ │ │ │ -
20#include <dune/geometry/type.hh>
│ │ │ │ +
5
│ │ │ │ +
6#ifndef DUNE_GEOMETRY_GENERALVERTEXORDER_HH
│ │ │ │ +
7#define DUNE_GEOMETRY_GENERALVERTEXORDER_HH
│ │ │ │ +
8
│ │ │ │ +
9#include <algorithm>
│ │ │ │ +
10#include <cassert>
│ │ │ │ +
11#include <cstddef>
│ │ │ │ +
12#include <iterator>
│ │ │ │ +
13#include <vector>
│ │ │ │ +
14
│ │ │ │ +
15#include <dune/common/iteratorfacades.hh>
│ │ │ │ +
16
│ │ │ │ +
17#include "type.hh"
│ │ │ │ + │ │ │ │ +
19
│ │ │ │ +
20namespace Dune {
│ │ │ │
21
│ │ │ │ -
22namespace Dune
│ │ │ │ -
23{
│ │ │ │ -
24
│ │ │ │ -
25 // MultiLinearGeometryTraits
│ │ │ │ -
26 // -------------------------
│ │ │ │ -
27
│ │ │ │ -
37 template< class ct >
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
39 {
│ │ │ │ -
58 typedef Impl::FieldMatrixHelper< ct > MatrixHelper;
│ │ │ │ -
59
│ │ │ │ -
61 static ct tolerance () { return ct( 16 ) * std::numeric_limits< ct >::epsilon(); }
│ │ │ │ -
62
│ │ │ │ -
127 template< int mydim, int cdim >
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
129 {
│ │ │ │ -
130 typedef std::vector< FieldVector< ct, cdim > > Type;
│ │ │ │ -
131 };
│ │ │ │ -
│ │ │ │ -
132
│ │ │ │ -
146 template< int dim >
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
148 {
│ │ │ │ -
149 static const bool v = false;
│ │ │ │ -
150 static const unsigned int topologyId = ~0u;
│ │ │ │ -
151 };
│ │ │ │ -
│ │ │ │ -
152 };
│ │ │ │ -
│ │ │ │ -
153
│ │ │ │ +
39 template<class InIterator, class OutIterator>
│ │ │ │ +
│ │ │ │ +
40 void reduceOrder(const InIterator& inBegin, const InIterator& inEnd,
│ │ │ │ +
41 OutIterator outIt)
│ │ │ │ +
42 {
│ │ │ │ +
43 for(InIterator inIt = inBegin; inIt != inEnd; ++inIt, ++outIt)
│ │ │ │ +
44 *outIt = std::count_if(inBegin, inEnd, [&](const auto& v)
│ │ │ │ +
45 {
│ │ │ │ +
46 return v < *inIt;
│ │ │ │ +
47 });
│ │ │ │ +
48 }
│ │ │ │ +
│ │ │ │ +
49
│ │ │ │ +
51
│ │ │ │ +
66 template<std::size_t dim, class Index_ = std::size_t>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
68 typedef ReferenceElements<double, dim> RefElems;
│ │ │ │ +
69 typedef typename RefElems::ReferenceElement RefElem;
│ │ │ │ +
70
│ │ │ │ +
71 RefElem refelem;
│ │ │ │ +
72 GeometryType gt;
│ │ │ │ +
73 std::vector<Index_> vertexOrder;
│ │ │ │ +
74
│ │ │ │ +
75 public:
│ │ │ │ +
77 typedef Index_ Index;
│ │ │ │ +
78
│ │ │ │ +
80 class iterator;
│ │ │ │ +
81
│ │ │ │ +
83 static const std::size_t dimension = dim;
│ │ │ │ +
85 const GeometryType &type() const { return gt; }
│ │ │ │ +
86
│ │ │ │ +
88
│ │ │ │ +
96 template<class InIterator>
│ │ │ │ +
│ │ │ │ +
97 GeneralVertexOrder(const GeometryType& gt_, const InIterator &inBegin,
│ │ │ │ +
98 const InIterator &inEnd) :
│ │ │ │ +
99 refelem(RefElems::general(gt_)), gt(gt_),
│ │ │ │ +
100 vertexOrder(refelem.size(dim))
│ │ │ │ +
101 { reduceOrder(inBegin, inEnd, vertexOrder.begin()); }
│ │ │ │ +
│ │ │ │ +
102
│ │ │ │ +
104
│ │ │ │ +
│ │ │ │ +
108 iterator begin(std::size_t codim, std::size_t subEntity) const
│ │ │ │ +
109 { return iterator(*this, codim, subEntity); }
│ │ │ │ +
│ │ │ │ +
111
│ │ │ │ +
│ │ │ │ +
115 iterator end(std::size_t codim, std::size_t subEntity) const {
│ │ │ │ +
116 return iterator(*this, codim, subEntity,
│ │ │ │ +
117 refelem.size(subEntity, codim, dim));
│ │ │ │ +
118 }
│ │ │ │ +
│ │ │ │ +
119
│ │ │ │ +
121
│ │ │ │ +
│ │ │ │ +
128 void getReduced(std::size_t codim, std::size_t subEntity,
│ │ │ │ +
129 std::vector<Index>& order) const
│ │ │ │ +
130 {
│ │ │ │ +
131 order.resize(refelem.size(subEntity, codim, dim));
│ │ │ │ +
132 reduceOrder(begin(codim, subEntity), end(codim, subEntity),
│ │ │ │ +
133 order.begin());
│ │ │ │ +
134 }
│ │ │ │ +
│ │ │ │ +
135 };
│ │ │ │ +
│ │ │ │ +
136
│ │ │ │ +
138
│ │ │ │ +
141 template<std::size_t dim, class Index_>
│ │ │ │ +
│ │ │ │ +
142 class GeneralVertexOrder<dim, Index_>::iterator :
│ │ │ │ +
143 public Dune::RandomAccessIteratorFacade<iterator, const Index_>
│ │ │ │ +
144 {
│ │ │ │ +
145 const GeneralVertexOrder *order;
│ │ │ │ +
146 std::size_t codim;
│ │ │ │ +
147 std::size_t subEntity;
│ │ │ │ +
148 std::size_t vertex;
│ │ │ │ +
149
│ │ │ │ +
150 iterator(const GeneralVertexOrder &order_, std::size_t codim_,
│ │ │ │ +
151 std::size_t subEntity_, std::size_t vertex_ = 0) :
│ │ │ │ +
152 order(&order_), codim(codim_), subEntity(subEntity_), vertex(vertex_)
│ │ │ │ +
153 { }
│ │ │ │
154
│ │ │ │ -
155
│ │ │ │ -
156 // MultiLinearGeometry
│ │ │ │ -
157 // -------------------
│ │ │ │ -
158
│ │ │ │ -
179 template< class ct, int mydim, int cdim, class Traits = MultiLinearGeometryTraits< ct > >
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
181 {
│ │ │ │ - │ │ │ │ -
183
│ │ │ │ -
184 public:
│ │ │ │ -
186 typedef ct ctype;
│ │ │ │ -
187
│ │ │ │ -
189 static const int mydimension= mydim;
│ │ │ │ -
191 static const int coorddimension = cdim;
│ │ │ │ -
192
│ │ │ │ -
194 typedef FieldVector< ctype, mydimension > LocalCoordinate;
│ │ │ │ -
196 typedef FieldVector< ctype, coorddimension > GlobalCoordinate;
│ │ │ │ -
198 typedef ctype Volume;
│ │ │ │ -
199
│ │ │ │ -
201 typedef FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed;
│ │ │ │ -
202
│ │ │ │ - │ │ │ │ -
205
│ │ │ │ -
207 typedef FieldMatrix< ctype, coorddimension, mydimension > Jacobian;
│ │ │ │ -
208
│ │ │ │ -
210 typedef FieldMatrix< ctype, mydimension, coorddimension > JacobianInverse;
│ │ │ │ -
211
│ │ │ │ -
212 protected:
│ │ │ │ -
213
│ │ │ │ - │ │ │ │ -
215
│ │ │ │ -
216 public:
│ │ │ │ -
217
│ │ │ │ - │ │ │ │ -
220
│ │ │ │ -
221 private:
│ │ │ │ -
222 static const bool hasSingleGeometryType = Traits::template hasSingleGeometryType< mydimension >::v;
│ │ │ │ -
223
│ │ │ │ -
224 protected:
│ │ │ │ -
225 typedef typename Traits::MatrixHelper MatrixHelper;
│ │ │ │ -
226 typedef typename std::conditional< hasSingleGeometryType, std::integral_constant< unsigned int, Traits::template hasSingleGeometryType< mydimension >::topologyId >, unsigned int >::type TopologyId;
│ │ │ │ -
227
│ │ │ │ -
228 public:
│ │ │ │ -
238 template< class Corners >
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
240 const Corners &corners )
│ │ │ │ -
241 : refElement_( refElement ),
│ │ │ │ -
242 corners_( corners )
│ │ │ │ -
243 {}
│ │ │ │ -
│ │ │ │ -
244
│ │ │ │ -
254 template< class Corners >
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
256 const Corners &corners )
│ │ │ │ -
257 : refElement_( ReferenceElements::general( gt ) ),
│ │ │ │ -
258 corners_( corners )
│ │ │ │ -
259 {}
│ │ │ │ -
│ │ │ │ -
260
│ │ │ │ -
│ │ │ │ -
262 bool affine () const
│ │ │ │ -
263 {
│ │ │ │ - │ │ │ │ -
265 return affine( jt );
│ │ │ │ -
266 }
│ │ │ │ -
│ │ │ │ -
267
│ │ │ │ -
269 Dune::GeometryType type () const { return GeometryType( toUnsignedInt(topologyId()), mydimension ); }
│ │ │ │ -
270
│ │ │ │ -
272 int corners () const { return refElement().size( mydimension ); }
│ │ │ │ -
273
│ │ │ │ -
│ │ │ │ -
275 GlobalCoordinate corner ( int i ) const
│ │ │ │ -
276 {
│ │ │ │ -
277 assert( (i >= 0) && (i < corners()) );
│ │ │ │ -
278 return std::cref(corners_).get()[ i ];
│ │ │ │ -
279 }
│ │ │ │ -
│ │ │ │ -
280
│ │ │ │ -
282 GlobalCoordinate center () const { return global( refElement().position( 0, 0 ) ); }
│ │ │ │ -
283
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
291 {
│ │ │ │ -
292 using std::begin;
│ │ │ │ -
293
│ │ │ │ -
294 auto cit = begin(std::cref(corners_).get());
│ │ │ │ - │ │ │ │ -
296 global< false >( topologyId(), std::integral_constant< int, mydimension >(), cit, ctype( 1 ), local, ctype( 1 ), y );
│ │ │ │ -
297 return y;
│ │ │ │ -
298 }
│ │ │ │ -
│ │ │ │ -
299
│ │ │ │ -
│ │ │ │ -
312 LocalCoordinate local ( const GlobalCoordinate &globalCoord ) const
│ │ │ │ -
313 {
│ │ │ │ -
314 const ctype tolerance = Traits::tolerance();
│ │ │ │ -
315 LocalCoordinate x = refElement().position( 0, 0 );
│ │ │ │ - │ │ │ │ -
317 const bool affineMapping = this->affine();
│ │ │ │ -
318 do
│ │ │ │ -
319 {
│ │ │ │ -
320 // Newton's method: DF^n dx^n = F^n, x^{n+1} -= dx^n
│ │ │ │ -
321 const GlobalCoordinate dglobal = (*this).global( x ) - globalCoord;
│ │ │ │ -
322 const bool invertible =
│ │ │ │ -
323 MatrixHelper::template xTRightInvA< mydimension, coorddimension >( jacobianTransposed( x ), dglobal, dx );
│ │ │ │ -
324 if( ! invertible )
│ │ │ │ -
325 return LocalCoordinate( std::numeric_limits< ctype > :: max() );
│ │ │ │ -
326
│ │ │ │ -
327 // update x with correction
│ │ │ │ -
328 x -= dx;
│ │ │ │ -
329
│ │ │ │ -
330 // for affine mappings only one iteration is needed
│ │ │ │ -
331 if ( affineMapping ) break;
│ │ │ │ -
332 } while( dx.two_norm2() > tolerance );
│ │ │ │ -
333 return x;
│ │ │ │ -
334 }
│ │ │ │ -
│ │ │ │ -
335
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
351 {
│ │ │ │ -
352 return MatrixHelper::template sqrtDetAAT< mydimension, coorddimension >( jacobianTransposed( local ) );
│ │ │ │ -
353 }
│ │ │ │ -
│ │ │ │ -
354
│ │ │ │ -
│ │ │ │ -
363 Volume volume () const
│ │ │ │ -
364 {
│ │ │ │ -
365 return integrationElement( refElement().position( 0, 0 ) ) * refElement().volume();
│ │ │ │ -
366 }
│ │ │ │ -
│ │ │ │ -
367
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
378 {
│ │ │ │ -
379 using std::begin;
│ │ │ │ -
380
│ │ │ │ - │ │ │ │ -
382 auto cit = begin(std::cref(corners_).get());
│ │ │ │ -
383 jacobianTransposed< false >( topologyId(), std::integral_constant< int, mydimension >(), cit, ctype( 1 ), local, ctype( 1 ), jt );
│ │ │ │ -
384 return jt;
│ │ │ │ -
385 }
│ │ │ │ -
│ │ │ │ -
386
│ │ │ │ -
│ │ │ │ -
393 JacobianInverseTransposed jacobianInverseTransposed ( const LocalCoordinate &local ) const;
│ │ │ │ -
394
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
396 {
│ │ │ │ -
397 return geometry.refElement();
│ │ │ │ -
398 }
│ │ │ │ -
│ │ │ │ -
399
│ │ │ │ -
400
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
408 {
│ │ │ │ -
409 return jacobianTransposed(local).transposed();
│ │ │ │ -
410 }
│ │ │ │ -
│ │ │ │ -
411
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
419 {
│ │ │ │ -
420 return jacobianInverseTransposed(local).transposed();
│ │ │ │ -
421 }
│ │ │ │ -
│ │ │ │ -
422
│ │ │ │ -
423 protected:
│ │ │ │ -
424
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
426 {
│ │ │ │ -
427 return refElement_;
│ │ │ │ -
428 }
│ │ │ │ -
│ │ │ │ -
429
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
431 {
│ │ │ │ -
432 return topologyId( std::integral_constant< bool, hasSingleGeometryType >() );
│ │ │ │ -
433 }
│ │ │ │ -
│ │ │ │ -
434
│ │ │ │ -
435 template< bool add, int dim, class CornerIterator >
│ │ │ │ -
│ │ │ │ -
436 static void global ( TopologyId topologyId, std::integral_constant< int, dim >,
│ │ │ │ -
437 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,
│ │ │ │ -
438 const ctype &rf, GlobalCoordinate &y );
│ │ │ │ -
439 template< bool add, class CornerIterator >
│ │ │ │ -
│ │ │ │ -
440 static void global ( TopologyId topologyId, std::integral_constant< int, 0 >,
│ │ │ │ -
441 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,
│ │ │ │ -
442 const ctype &rf, GlobalCoordinate &y );
│ │ │ │ -
443
│ │ │ │ -
444 template< bool add, int rows, int dim, class CornerIterator >
│ │ │ │ -
│ │ │ │ -
445 static void jacobianTransposed ( TopologyId topologyId, std::integral_constant< int, dim >,
│ │ │ │ -
446 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,
│ │ │ │ -
447 const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt );
│ │ │ │ -
448 template< bool add, int rows, class CornerIterator >
│ │ │ │ -
│ │ │ │ -
449 static void jacobianTransposed ( TopologyId topologyId, std::integral_constant< int, 0 >,
│ │ │ │ -
450 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,
│ │ │ │ -
451 const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt );
│ │ │ │ -
452
│ │ │ │ -
453 template< int dim, class CornerIterator >
│ │ │ │ -
│ │ │ │ -
454 static bool affine ( TopologyId topologyId, std::integral_constant< int, dim >, CornerIterator &cit, JacobianTransposed &jt );
│ │ │ │ -
455 template< class CornerIterator >
│ │ │ │ -
│ │ │ │ -
456 static bool affine ( TopologyId topologyId, std::integral_constant< int, 0 >, CornerIterator &cit, JacobianTransposed &jt );
│ │ │ │ -
457
│ │ │ │ -
│ │ │ │ -
458 bool affine ( JacobianTransposed &jacobianT ) const
│ │ │ │ -
459 {
│ │ │ │ -
460 using std::begin;
│ │ │ │ -
461
│ │ │ │ -
462 auto cit = begin(std::cref(corners_).get());
│ │ │ │ -
463 return affine( topologyId(), std::integral_constant< int, mydimension >(), cit, jacobianT );
│ │ │ │ -
464 }
│ │ │ │ -
│ │ │ │ -
465
│ │ │ │ -
466 private:
│ │ │ │ -
467 // The following methods are needed to convert the return type of topologyId to
│ │ │ │ -
468 // unsigned int with g++-4.4. It has problems casting integral_constant to the
│ │ │ │ -
469 // integral type.
│ │ │ │ -
470 static unsigned int toUnsignedInt(unsigned int i) { return i; }
│ │ │ │ -
471 template<unsigned int v>
│ │ │ │ -
472 static unsigned int toUnsignedInt(std::integral_constant<unsigned int,v> ) { return v; }
│ │ │ │ -
473 TopologyId topologyId ( std::integral_constant< bool, true > ) const { return TopologyId(); }
│ │ │ │ -
474 unsigned int topologyId ( std::integral_constant< bool, false > ) const { return refElement().type().id(); }
│ │ │ │ -
475
│ │ │ │ -
476 ReferenceElement refElement_;
│ │ │ │ -
477 typename Traits::template CornerStorage< mydimension, coorddimension >::Type corners_;
│ │ │ │ -
478 };
│ │ │ │ -
479
│ │ │ │ -
480
│ │ │ │ -
481
│ │ │ │ -
482 // MultiLinearGeometry::JacobianInverseTransposed
│ │ │ │ -
483 // ----------------------------------------------
│ │ │ │ -
484
│ │ │ │ -
485 template< class ct, int mydim, int cdim, class Traits >
│ │ │ │ -
│ │ │ │ -
486 class MultiLinearGeometry< ct, mydim, cdim, Traits >::JacobianInverseTransposed
│ │ │ │ -
487 : public FieldMatrix< ctype, coorddimension, mydimension >
│ │ │ │ -
488 {
│ │ │ │ -
489 typedef FieldMatrix< ctype, coorddimension, mydimension > Base;
│ │ │ │ -
490
│ │ │ │ -
491 public:
│ │ │ │ -
│ │ │ │ -
492 void setup ( const JacobianTransposed &jt )
│ │ │ │ -
493 {
│ │ │ │ -
494 detInv_ = MatrixHelper::template rightInvA< mydimension, coorddimension >( jt, static_cast< Base & >( *this ) );
│ │ │ │ -
495 }
│ │ │ │ -
│ │ │ │ -
496
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
498 {
│ │ │ │ -
499 detInv_ = MatrixHelper::template sqrtDetAAT< mydimension, coorddimension >( jt );
│ │ │ │ -
500 }
│ │ │ │ -
│ │ │ │ -
501
│ │ │ │ -
502 ctype det () const { return ctype( 1 ) / detInv_; }
│ │ │ │ -
503 ctype detInv () const { return detInv_; }
│ │ │ │ -
504
│ │ │ │ -
505 private:
│ │ │ │ -
506 ctype detInv_;
│ │ │ │ -
507 };
│ │ │ │ -
│ │ │ │ -
508
│ │ │ │ -
509
│ │ │ │ -
510
│ │ │ │ -
523 template< class ct, int mydim, int cdim, class Traits = MultiLinearGeometryTraits< ct > >
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
525 : public MultiLinearGeometry< ct, mydim, cdim, Traits >
│ │ │ │ -
526 {
│ │ │ │ - │ │ │ │ - │ │ │ │ -
529
│ │ │ │ -
530 protected:
│ │ │ │ - │ │ │ │ -
532
│ │ │ │ -
533 public:
│ │ │ │ - │ │ │ │ -
535
│ │ │ │ -
536 typedef typename Base::ctype ctype;
│ │ │ │ -
537
│ │ │ │ -
538 using Base::mydimension;
│ │ │ │ - │ │ │ │ -
540
│ │ │ │ - │ │ │ │ - │ │ │ │ -
543 typedef typename Base::Volume Volume;
│ │ │ │ -
544
│ │ │ │ - │ │ │ │ - │ │ │ │ -
547 typedef typename Base::Jacobian Jacobian;
│ │ │ │ - │ │ │ │ -
549
│ │ │ │ -
550 template< class CornerStorage >
│ │ │ │ -
│ │ │ │ -
551 CachedMultiLinearGeometry ( const ReferenceElement &referenceElement, const CornerStorage &cornerStorage )
│ │ │ │ -
552 : Base( referenceElement, cornerStorage ),
│ │ │ │ -
553 affine_( Base::affine( jacobianTransposed_ ) ),
│ │ │ │ -
554 jacobianInverseTransposedComputed_( false ),
│ │ │ │ -
555 integrationElementComputed_( false )
│ │ │ │ -
556 {}
│ │ │ │ -
│ │ │ │ -
557
│ │ │ │ -
558 template< class CornerStorage >
│ │ │ │ -
│ │ │ │ -
559 CachedMultiLinearGeometry ( Dune::GeometryType gt, const CornerStorage &cornerStorage )
│ │ │ │ -
560 : Base( gt, cornerStorage ),
│ │ │ │ -
561 affine_( Base::affine( jacobianTransposed_ ) ),
│ │ │ │ -
562 jacobianInverseTransposedComputed_( false ),
│ │ │ │ -
563 integrationElementComputed_( false )
│ │ │ │ -
564 {}
│ │ │ │ -
│ │ │ │ -
565
│ │ │ │ -
567 bool affine () const { return affine_; }
│ │ │ │ -
568
│ │ │ │ -
569 using Base::corner;
│ │ │ │ -
570
│ │ │ │ -
572 GlobalCoordinate center () const { return global( refElement().position( 0, 0 ) ); }
│ │ │ │ -
573
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
581 {
│ │ │ │ -
582 if( affine() )
│ │ │ │ -
583 {
│ │ │ │ - │ │ │ │ -
585 jacobianTransposed_.umtv( local, global );
│ │ │ │ -
586 return global;
│ │ │ │ -
587 }
│ │ │ │ -
588 else
│ │ │ │ -
589 return Base::global( local );
│ │ │ │ -
590 }
│ │ │ │ -
│ │ │ │ -
591
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
605 {
│ │ │ │ -
606 if( affine() )
│ │ │ │ -
607 {
│ │ │ │ - │ │ │ │ -
609 if( jacobianInverseTransposedComputed_ )
│ │ │ │ -
610 jacobianInverseTransposed_.mtv( global - corner( 0 ), local );
│ │ │ │ -
611 else
│ │ │ │ -
612 MatrixHelper::template xTRightInvA< mydimension, coorddimension >( jacobianTransposed_, global - corner( 0 ), local );
│ │ │ │ -
613 return local;
│ │ │ │ -
614 }
│ │ │ │ -
615 else
│ │ │ │ -
616 return Base::local( global );
│ │ │ │ -
617 }
│ │ │ │ -
│ │ │ │ -
618
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
634 {
│ │ │ │ -
635 if( affine() )
│ │ │ │ -
636 {
│ │ │ │ -
637 if( !integrationElementComputed_ )
│ │ │ │ -
638 {
│ │ │ │ -
639 jacobianInverseTransposed_.setupDeterminant( jacobianTransposed_ );
│ │ │ │ -
640 integrationElementComputed_ = true;
│ │ │ │ -
641 }
│ │ │ │ -
642 return jacobianInverseTransposed_.detInv();
│ │ │ │ -
643 }
│ │ │ │ -
644 else
│ │ │ │ - │ │ │ │ -
646 }
│ │ │ │ -
│ │ │ │ -
647
│ │ │ │ -
│ │ │ │ -
649 Volume volume () const
│ │ │ │ -
650 {
│ │ │ │ -
651 if( affine() )
│ │ │ │ -
652 return integrationElement( refElement().position( 0, 0 ) ) * refElement().volume();
│ │ │ │ -
653 else
│ │ │ │ -
654 return Base::volume();
│ │ │ │ -
655 }
│ │ │ │ -
│ │ │ │ -
656
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
667 {
│ │ │ │ -
668 if( affine() )
│ │ │ │ -
669 return jacobianTransposed_;
│ │ │ │ -
670 else
│ │ │ │ - │ │ │ │ -
672 }
│ │ │ │ -
│ │ │ │ -
673
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
681 {
│ │ │ │ -
682 if( affine() )
│ │ │ │ -
683 {
│ │ │ │ -
684 if( !jacobianInverseTransposedComputed_ )
│ │ │ │ -
685 {
│ │ │ │ -
686 jacobianInverseTransposed_.setup( jacobianTransposed_ );
│ │ │ │ -
687 jacobianInverseTransposedComputed_ = true;
│ │ │ │ -
688 integrationElementComputed_ = true;
│ │ │ │ -
689 }
│ │ │ │ -
690 return jacobianInverseTransposed_;
│ │ │ │ -
691 }
│ │ │ │ -
692 else
│ │ │ │ - │ │ │ │ -
694 }
│ │ │ │ -
│ │ │ │ -
695
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
703 {
│ │ │ │ -
704 return jacobianTransposed(local).transposed();
│ │ │ │ -
705 }
│ │ │ │ -
│ │ │ │ -
706
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
714 {
│ │ │ │ -
715 return jacobianInverseTransposed(local).transposed();
│ │ │ │ -
716 }
│ │ │ │ -
│ │ │ │ -
717
│ │ │ │ -
718 protected:
│ │ │ │ -
719 using Base::refElement;
│ │ │ │ -
720
│ │ │ │ -
721 private:
│ │ │ │ -
722 mutable JacobianTransposed jacobianTransposed_;
│ │ │ │ -
723 mutable JacobianInverseTransposed jacobianInverseTransposed_;
│ │ │ │ -
724
│ │ │ │ -
725 mutable bool affine_ : 1;
│ │ │ │ -
726
│ │ │ │ -
727 mutable bool jacobianInverseTransposedComputed_ : 1;
│ │ │ │ -
728 mutable bool integrationElementComputed_ : 1;
│ │ │ │ -
729 };
│ │ │ │ -
│ │ │ │ -
730
│ │ │ │ -
731
│ │ │ │ -
732
│ │ │ │ -
733 // Implementation of MultiLinearGeometry
│ │ │ │ -
734 // -------------------------------------
│ │ │ │ -
735
│ │ │ │ -
736 template< class ct, int mydim, int cdim, class Traits >
│ │ │ │ -
737 inline typename MultiLinearGeometry< ct, mydim, cdim, Traits >::JacobianInverseTransposed
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
739 {
│ │ │ │ - │ │ │ │ -
741 jit.setup( jacobianTransposed( local ) );
│ │ │ │ -
742 return jit;
│ │ │ │ -
743 }
│ │ │ │ -
│ │ │ │ -
744
│ │ │ │ -
745
│ │ │ │ -
746 template< class ct, int mydim, int cdim, class Traits >
│ │ │ │ -
747 template< bool add, int dim, class CornerIterator >
│ │ │ │ - │ │ │ │ -
│ │ │ │ -
749 ::global ( TopologyId topologyId, std::integral_constant< int, dim >,
│ │ │ │ -
750 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,
│ │ │ │ -
751 const ctype &rf, GlobalCoordinate &y )
│ │ │ │ -
752 {
│ │ │ │ -
753 const ctype xn = df*x[ dim-1 ];
│ │ │ │ -
754 const ctype cxn = ctype( 1 ) - xn;
│ │ │ │ -
755
│ │ │ │ -
756 if( Impl::isPrism( toUnsignedInt(topologyId), mydimension, mydimension-dim ) )
│ │ │ │ -
757 {
│ │ │ │ -
758 // apply (1-xn) times mapping for bottom
│ │ │ │ -
759 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit, df, x, rf*cxn, y );
│ │ │ │ -
760 // apply xn times mapping for top
│ │ │ │ -
761 global< true >( topologyId, std::integral_constant< int, dim-1 >(), cit, df, x, rf*xn, y );
│ │ │ │ -
762 }
│ │ │ │ -
763 else
│ │ │ │ -
764 {
│ │ │ │ -
765 assert( Impl::isPyramid( toUnsignedInt(topologyId), mydimension, mydimension-dim ) );
│ │ │ │ -
766 // apply (1-xn) times mapping for bottom (with argument x/(1-xn))
│ │ │ │ -
767 if( cxn > Traits::tolerance() || cxn < -Traits::tolerance() )
│ │ │ │ -
768 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit, df/cxn, x, rf*cxn, y );
│ │ │ │ -
769 else
│ │ │ │ -
770 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit, df, x, ctype( 0 ), y );
│ │ │ │ -
771 // apply xn times the tip
│ │ │ │ -
772 y.axpy( rf*xn, *cit );
│ │ │ │ -
773 ++cit;
│ │ │ │ -
774 }
│ │ │ │ -
775 }
│ │ │ │ -
│ │ │ │ -
776
│ │ │ │ -
777 template< class ct, int mydim, int cdim, class Traits >
│ │ │ │ -
778 template< bool add, class CornerIterator >
│ │ │ │ - │ │ │ │ -
│ │ │ │ -
780 ::global ( TopologyId, std::integral_constant< int, 0 >,
│ │ │ │ -
781 CornerIterator &cit, const ctype &, const LocalCoordinate &,
│ │ │ │ -
782 const ctype &rf, GlobalCoordinate &y )
│ │ │ │ -
783 {
│ │ │ │ -
784 const GlobalCoordinate &origin = *cit;
│ │ │ │ -
785 ++cit;
│ │ │ │ -
786 for( int i = 0; i < coorddimension; ++i )
│ │ │ │ -
787 y[ i ] = (add ? y[ i ] + rf*origin[ i ] : rf*origin[ i ]);
│ │ │ │ -
788 }
│ │ │ │ -
│ │ │ │ -
789
│ │ │ │ -
790
│ │ │ │ -
791 template< class ct, int mydim, int cdim, class Traits >
│ │ │ │ -
792 template< bool add, int rows, int dim, class CornerIterator >
│ │ │ │ - │ │ │ │ -
│ │ │ │ -
794 ::jacobianTransposed ( TopologyId topologyId, std::integral_constant< int, dim >,
│ │ │ │ -
795 CornerIterator &cit, const ctype &df, const LocalCoordinate &x,
│ │ │ │ -
796 const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt )
│ │ │ │ -
797 {
│ │ │ │ -
798 assert( rows >= dim );
│ │ │ │ -
799
│ │ │ │ -
800 const ctype xn = df*x[ dim-1 ];
│ │ │ │ -
801 const ctype cxn = ctype( 1 ) - xn;
│ │ │ │ -
802
│ │ │ │ -
803 auto cit2( cit );
│ │ │ │ -
804 if( Impl::isPrism( toUnsignedInt(topologyId), mydimension, mydimension-dim ) )
│ │ │ │ -
805 {
│ │ │ │ -
806 // apply (1-xn) times Jacobian for bottom
│ │ │ │ -
807 jacobianTransposed< add >( topologyId, std::integral_constant< int, dim-1 >(), cit2, df, x, rf*cxn, jt );
│ │ │ │ -
808 // apply xn times Jacobian for top
│ │ │ │ -
809 jacobianTransposed< true >( topologyId, std::integral_constant< int, dim-1 >(), cit2, df, x, rf*xn, jt );
│ │ │ │ -
810 // compute last row as difference between top value and bottom value
│ │ │ │ -
811 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit, df, x, -rf, jt[ dim-1 ] );
│ │ │ │ -
812 global< true >( topologyId, std::integral_constant< int, dim-1 >(), cit, df, x, rf, jt[ dim-1 ] );
│ │ │ │ -
813 }
│ │ │ │ -
814 else
│ │ │ │ -
815 {
│ │ │ │ -
816 assert( Impl::isPyramid( toUnsignedInt(topologyId), mydimension, mydimension-dim ) );
│ │ │ │ -
817 /*
│ │ │ │ -
818 * In the pyramid case, we need a transformation Tb: B -> R^n for the
│ │ │ │ -
819 * base B \subset R^{n-1}. The pyramid transformation is then defined as
│ │ │ │ -
820 * T: P \subset R^n -> R^n
│ │ │ │ -
821 * (x, xn) |-> (1-xn) Tb(x*) + xn t (x \in R^{n-1}, xn \in R)
│ │ │ │ -
822 * with the tip of the pyramid mapped to t and x* = x/(1-xn)
│ │ │ │ -
823 * the projection of (x,xn) onto the base.
│ │ │ │ -
824 *
│ │ │ │ -
825 * For the Jacobi matrix DT we get
│ │ │ │ -
826 * DT = ( A | b )
│ │ │ │ -
827 * with A = DTb(x*) (n x n-1 matrix)
│ │ │ │ -
828 * and b = dT/dxn (n-dim column vector).
│ │ │ │ -
829 * Furthermore
│ │ │ │ -
830 * b = -Tb(x*) + t + \sum_i dTb/dx_i(x^*) x_i/(1-xn)
│ │ │ │ -
831 *
│ │ │ │ -
832 * Note that both A and b are not defined in the pyramid tip (x=0, xn=1)!
│ │ │ │ -
833 * Indeed for B the unit square, Tb mapping B to the quadrilateral given
│ │ │ │ -
834 * by the vertices (0,0,0), (2,0,0), (0,1,0), (1,1,0) and t=(0,0,1), we get
│ │ │ │ -
835 *
│ │ │ │ -
836 * T(x,y,xn) = ( x(2-y/(1-xn)), y, xn )
│ │ │ │ -
837 * / 2-y/(1-xn) -x 0 \
│ │ │ │ -
838 * DT(x,y,xn) = | 0 1 0 |
│ │ │ │ -
839 * \ 0 0 1 /
│ │ │ │ -
840 * which is not continuous for xn -> 1, choose for example
│ │ │ │ -
841 * x=0, y=1-xn, xn -> 1 --> DT -> diag(1,1,1)
│ │ │ │ -
842 * x=1-xn, y=0, xn -> 1 --> DT -> diag(2,1,1)
│ │ │ │ -
843 *
│ │ │ │ -
844 * However, for Tb affine-linear, Tb(y) = My + y0, DTb = M:
│ │ │ │ -
845 * A = M
│ │ │ │ -
846 * b = -M x* - y0 + t + \sum_i M_i x_i/(1-xn)
│ │ │ │ -
847 * = -M x* - y0 + t + M x*
│ │ │ │ -
848 * = -y0 + t
│ │ │ │ -
849 * which is continuous for xn -> 1. Note that this b is also given by
│ │ │ │ -
850 * b = -Tb(0) + t + \sum_i dTb/dx_i(0) x_i/1
│ │ │ │ -
851 * that is replacing x* by 1 and 1-xn by 1 in the formular above.
│ │ │ │ -
852 *
│ │ │ │ -
853 * For xn -> 1, we can thus set x*=0, "1-xn"=1 (or anything != 0) and get
│ │ │ │ -
854 * the right result in case Tb is affine-linear.
│ │ │ │ -
855 */
│ │ │ │ -
856
│ │ │ │ -
857 /* The second case effectively results in x* = 0 */
│ │ │ │ -
858 ctype dfcxn = (cxn > Traits::tolerance() || cxn < -Traits::tolerance()) ? ctype(df / cxn) : ctype(0);
│ │ │ │ -
859
│ │ │ │ -
860 // initialize last row
│ │ │ │ -
861 // b = -Tb(x*)
│ │ │ │ -
862 // (b = -Tb(0) = -y0 in case xn -> 1 and Tb affine-linear)
│ │ │ │ -
863 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit, dfcxn, x, -rf, jt[ dim-1 ] );
│ │ │ │ -
864 // b += t
│ │ │ │ -
865 jt[ dim-1 ].axpy( rf, *cit );
│ │ │ │ -
866 ++cit;
│ │ │ │ -
867 // apply Jacobian for bottom (with argument x/(1-xn)) and correct last row
│ │ │ │ -
868 if( add )
│ │ │ │ -
869 {
│ │ │ │ -
870 FieldMatrix< ctype, dim-1, coorddimension > jt2;
│ │ │ │ -
871 // jt2 = dTb/dx_i(x*)
│ │ │ │ -
872 jacobianTransposed< false >( topologyId, std::integral_constant< int, dim-1 >(), cit2, dfcxn, x, rf, jt2 );
│ │ │ │ -
873 // A = dTb/dx_i(x*) (jt[j], j=0..dim-1)
│ │ │ │ -
874 // b += \sum_i dTb/dx_i(x*) x_i/(1-xn) (jt[dim-1])
│ │ │ │ -
875 // (b += 0 in case xn -> 1)
│ │ │ │ -
876 for( int j = 0; j < dim-1; ++j )
│ │ │ │ -
877 {
│ │ │ │ -
878 jt[ j ] += jt2[ j ];
│ │ │ │ -
879 jt[ dim-1 ].axpy( dfcxn*x[ j ], jt2[ j ] );
│ │ │ │ -
880 }
│ │ │ │ -
881 }
│ │ │ │ -
882 else
│ │ │ │ -
883 {
│ │ │ │ -
884 // jt = dTb/dx_i(x*)
│ │ │ │ -
885 jacobianTransposed< false >( topologyId, std::integral_constant< int, dim-1 >(), cit2, dfcxn, x, rf, jt );
│ │ │ │ -
886 // b += \sum_i dTb/dx_i(x*) x_i/(1-xn)
│ │ │ │ -
887 for( int j = 0; j < dim-1; ++j )
│ │ │ │ -
888 jt[ dim-1 ].axpy( dfcxn*x[ j ], jt[ j ] );
│ │ │ │ -
889 }
│ │ │ │ -
890 }
│ │ │ │ -
891 }
│ │ │ │ -
│ │ │ │ -
892
│ │ │ │ -
893 template< class ct, int mydim, int cdim, class Traits >
│ │ │ │ -
894 template< bool add, int rows, class CornerIterator >
│ │ │ │ - │ │ │ │ -
│ │ │ │ -
896 ::jacobianTransposed ( TopologyId, std::integral_constant< int, 0 >,
│ │ │ │ -
897 CornerIterator &cit, const ctype &, const LocalCoordinate &,
│ │ │ │ -
898 const ctype &, FieldMatrix< ctype, rows, cdim > & )
│ │ │ │ -
899 {
│ │ │ │ -
900 ++cit;
│ │ │ │ -
901 }
│ │ │ │ -
│ │ │ │ -
902
│ │ │ │ -
903
│ │ │ │ -
904
│ │ │ │ -
905 template< class ct, int mydim, int cdim, class Traits >
│ │ │ │ -
906 template< int dim, class CornerIterator >
│ │ │ │ - │ │ │ │ -
│ │ │ │ -
908 ::affine ( TopologyId topologyId, std::integral_constant< int, dim >, CornerIterator &cit, JacobianTransposed &jt )
│ │ │ │ -
909 {
│ │ │ │ -
910 const GlobalCoordinate &orgBottom = *cit;
│ │ │ │ -
911 if( !affine( topologyId, std::integral_constant< int, dim-1 >(), cit, jt ) )
│ │ │ │ -
912 return false;
│ │ │ │ -
913 const GlobalCoordinate &orgTop = *cit;
│ │ │ │ -
914
│ │ │ │ -
915 if( Impl::isPrism( toUnsignedInt(topologyId), mydimension, mydimension-dim ) )
│ │ │ │ -
916 {
│ │ │ │ -
917 JacobianTransposed jtTop;
│ │ │ │ -
918 if( !affine( topologyId, std::integral_constant< int, dim-1 >(), cit, jtTop ) )
│ │ │ │ -
919 return false;
│ │ │ │ -
920
│ │ │ │ -
921 // check whether both jacobians are identical
│ │ │ │ -
922 ctype norm( 0 );
│ │ │ │ -
923 for( int i = 0; i < dim-1; ++i )
│ │ │ │ -
924 norm += (jtTop[ i ] - jt[ i ]).two_norm2();
│ │ │ │ -
925 if( norm >= Traits::tolerance() )
│ │ │ │ -
926 return false;
│ │ │ │ -
927 }
│ │ │ │ -
928 else
│ │ │ │ -
929 ++cit;
│ │ │ │ -
930 jt[ dim-1 ] = orgTop - orgBottom;
│ │ │ │ -
931 return true;
│ │ │ │ -
932 }
│ │ │ │ -
│ │ │ │ -
933
│ │ │ │ -
934 template< class ct, int mydim, int cdim, class Traits >
│ │ │ │ -
935 template< class CornerIterator >
│ │ │ │ - │ │ │ │ -
│ │ │ │ -
937 ::affine ( TopologyId, std::integral_constant< int, 0 >, CornerIterator &cit, JacobianTransposed & )
│ │ │ │ -
938 {
│ │ │ │ -
939 ++cit;
│ │ │ │ -
940 return true;
│ │ │ │ -
941 }
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
942
│ │ │ │ -
943} // namespace Dune
│ │ │ │ -
944
│ │ │ │ -
945#endif // #ifndef DUNE_GEOMETRY_MULTILINEARGEOMETRY_HH
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
An implementation of the Geometry interface for affine geometries.
│ │ │ │ -
A unique label for each type of element that can occur in a grid.
│ │ │ │ +
155 public:
│ │ │ │ +
│ │ │ │ +
156 const Index &dereference() const {
│ │ │ │ +
157 return order->vertexOrder[order->refelem.subEntity(subEntity, codim,
│ │ │ │ +
158 vertex, dim)];
│ │ │ │ +
159 }
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
160 const Index &elementAt(std::ptrdiff_t n) const {
│ │ │ │ +
161 return order->vertexOrder[order->refelem.subEntity(subEntity, codim,
│ │ │ │ +
162 vertex+n, dim)];
│ │ │ │ +
163 }
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
164 bool equals(const iterator &other) const {
│ │ │ │ +
165 return order == other.order && codim == other.codim &&
│ │ │ │ +
166 subEntity == other.subEntity && vertex == other.vertex;
│ │ │ │ +
167 }
│ │ │ │ +
│ │ │ │ +
168 void increment() { ++vertex; }
│ │ │ │ +
169 void decrement() { --vertex; }
│ │ │ │ +
170 void advance(std::ptrdiff_t n) { vertex += n; }
│ │ │ │ +
│ │ │ │ +
171 std::ptrdiff_t distanceTo(const iterator &other) const {
│ │ │ │ +
172 // make sure we reference the same container
│ │ │ │ +
173 assert(order == other.order && codim == other.codim &&
│ │ │ │ +
174 subEntity == other.subEntity);
│ │ │ │ +
175 if(vertex < other.vertex) return other.vertex - vertex;
│ │ │ │ +
176 else return -static_cast<std::ptrdiff_t>(vertex - other.vertex);
│ │ │ │ +
177 }
│ │ │ │ +
│ │ │ │ +
178
│ │ │ │ +
179 friend class GeneralVertexOrder<dim, Index>;
│ │ │ │ +
180
│ │ │ │ +
182
│ │ │ │ + │ │ │ │ +
188 };
│ │ │ │ +
│ │ │ │ +
189} // namespace Dune
│ │ │ │ +
190
│ │ │ │ +
191#endif // DUNE_GEOMETRY_GENERALVERTEXORDER_HH
│ │ │ │ + │ │ │ │ +
A unique label for each type of element that can occur in a grid.
│ │ │ │
Definition affinegeometry.hh:21
│ │ │ │ +
void reduceOrder(const InIterator &inBegin, const InIterator &inEnd, OutIterator outIt)
Algorithm to reduce vertex order information.
Definition generalvertexorder.hh:40
│ │ │ │
Class providing access to the singletons of the reference elements.
Definition referenceelements.hh:170
│ │ │ │
typename Container::ReferenceElement ReferenceElement
The reference element type.
Definition referenceelements.hh:188
│ │ │ │ -
default traits class for MultiLinearGeometry
Definition multilineargeometry.hh:39
│ │ │ │ -
Impl::FieldMatrixHelper< ct > MatrixHelper
helper structure containing some matrix routines
Definition multilineargeometry.hh:58
│ │ │ │ -
static ct tolerance()
tolerance to numerical algorithms
Definition multilineargeometry.hh:61
│ │ │ │ -
template specifying the storage for the corners
Definition multilineargeometry.hh:129
│ │ │ │ -
std::vector< FieldVector< ct, cdim > > Type
Definition multilineargeometry.hh:130
│ │ │ │ -
will there be only one geometry type for a dimension?
Definition multilineargeometry.hh:148
│ │ │ │ -
static const unsigned int topologyId
Definition multilineargeometry.hh:150
│ │ │ │ -
static const bool v
Definition multilineargeometry.hh:149
│ │ │ │ -
generic geometry implementation based on corner coordinates
Definition multilineargeometry.hh:181
│ │ │ │ -
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
│ │ │ │ -
static const int mydimension
geometry dimension
Definition multilineargeometry.hh:189
│ │ │ │ -
Dune::GeometryType type() const
obtain the name of the reference element
Definition multilineargeometry.hh:269
│ │ │ │ -
Traits::MatrixHelper MatrixHelper
Definition multilineargeometry.hh:225
│ │ │ │ -
FieldVector< ctype, coorddimension > GlobalCoordinate
type of global coordinates
Definition multilineargeometry.hh:196
│ │ │ │ -
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
│ │ │ │ -
JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const
obtain the transposed of the Jacobian
Definition multilineargeometry.hh:377
│ │ │ │ -
ReferenceElement refElement() const
Definition multilineargeometry.hh:425
│ │ │ │ -
GlobalCoordinate global(const LocalCoordinate &local) const
evaluate the mapping
Definition multilineargeometry.hh:290
│ │ │ │ -
GlobalCoordinate center() const
obtain the centroid of the mapping's image
Definition multilineargeometry.hh:282
│ │ │ │ -
GlobalCoordinate corner(int i) const
obtain coordinates of the i-th corner
Definition multilineargeometry.hh:275
│ │ │ │ -
Dune::ReferenceElements< ctype, mydimension > ReferenceElements
Definition multilineargeometry.hh:214
│ │ │ │ -
ct ctype
coordinate type
Definition multilineargeometry.hh:186
│ │ │ │ -
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
│ │ │ │ -
static const int coorddimension
coordinate dimension
Definition multilineargeometry.hh:191
│ │ │ │ -
int corners() const
obtain number of corners of the corresponding reference element
Definition multilineargeometry.hh:272
│ │ │ │ -
TopologyId topologyId() const
Definition multilineargeometry.hh:430
│ │ │ │ -
friend ReferenceElement referenceElement(const MultiLinearGeometry &geometry)
Definition multilineargeometry.hh:395
│ │ │ │ -
LocalCoordinate local(const GlobalCoordinate &globalCoord) const
evaluate the inverse mapping
Definition multilineargeometry.hh:312
│ │ │ │ -
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
│ │ │ │ -
Volume volume() const
obtain the volume of the mapping's image
Definition multilineargeometry.hh:363
│ │ │ │ -
FieldVector< ctype, mydimension > LocalCoordinate
type of local coordinates
Definition multilineargeometry.hh:194
│ │ │ │ -
MultiLinearGeometry(const ReferenceElement &refElement, const Corners &corners)
constructor
Definition multilineargeometry.hh:239
│ │ │ │ -
static bool affine(TopologyId topologyId, std::integral_constant< int, 0 >, CornerIterator &cit, JacobianTransposed &jt)
Definition multilineargeometry.hh:937
│ │ │ │ -
std::conditional< hasSingleGeometryType, std::integral_constant< unsignedint, Traits::templatehasSingleGeometryType< mydimension >::topologyId >, unsignedint >::type TopologyId
Definition multilineargeometry.hh:226
│ │ │ │ -
ctype Volume
type of volume
Definition multilineargeometry.hh:198
│ │ │ │ -
static bool affine(TopologyId topologyId, std::integral_constant< int, dim >, CornerIterator &cit, JacobianTransposed &jt)
Definition multilineargeometry.hh:908
│ │ │ │ -
JacobianInverse jacobianInverse(const LocalCoordinate &local) const
Obtain the Jacobian's inverse.
Definition multilineargeometry.hh:418
│ │ │ │ -
MultiLinearGeometry(Dune::GeometryType gt, const Corners &corners)
constructor
Definition multilineargeometry.hh:255
│ │ │ │ -
FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed
type of jacobian transposed
Definition multilineargeometry.hh:201
│ │ │ │ -
ReferenceElements::ReferenceElement ReferenceElement
type of reference element
Definition multilineargeometry.hh:219
│ │ │ │ -
JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate &local) const
obtain the transposed of the Jacobian's inverse
Definition multilineargeometry.hh:738
│ │ │ │ -
FieldMatrix< ctype, coorddimension, mydimension > Jacobian
Type for the Jacobian matrix.
Definition multilineargeometry.hh:207
│ │ │ │ -
bool affine() const
is this mapping affine?
Definition multilineargeometry.hh:262
│ │ │ │ -
FieldMatrix< ctype, mydimension, coorddimension > JacobianInverse
Type for the inverse Jacobian matrix.
Definition multilineargeometry.hh:210
│ │ │ │ -
bool affine(JacobianTransposed &jacobianT) const
Definition multilineargeometry.hh:458
│ │ │ │ -
Volume integrationElement(const LocalCoordinate &local) const
obtain the integration element
Definition multilineargeometry.hh:350
│ │ │ │ -
Jacobian jacobian(const LocalCoordinate &local) const
Obtain the Jacobian.
Definition multilineargeometry.hh:407
│ │ │ │ -
Definition multilineargeometry.hh:488
│ │ │ │ -
void setup(const JacobianTransposed &jt)
Definition multilineargeometry.hh:492
│ │ │ │ -
ctype det() const
Definition multilineargeometry.hh:502
│ │ │ │ -
ctype detInv() const
Definition multilineargeometry.hh:503
│ │ │ │ -
void setupDeterminant(const JacobianTransposed &jt)
Definition multilineargeometry.hh:497
│ │ │ │ -
Implement a MultiLinearGeometry with additional caching.
Definition multilineargeometry.hh:526
│ │ │ │ -
GlobalCoordinate global(const LocalCoordinate &local) const
evaluate the mapping
Definition multilineargeometry.hh:580
│ │ │ │ -
Base::ReferenceElement ReferenceElement
Definition multilineargeometry.hh:534
│ │ │ │ -
bool affine() const
is this mapping affine?
Definition multilineargeometry.hh:567
│ │ │ │ -
CachedMultiLinearGeometry(const ReferenceElement &referenceElement, const CornerStorage &cornerStorage)
Definition multilineargeometry.hh:551
│ │ │ │ -
ReferenceElement refElement() const
Definition multilineargeometry.hh:425
│ │ │ │ -
LocalCoordinate local(const GlobalCoordinate &global) const
evaluate the inverse mapping
Definition multilineargeometry.hh:604
│ │ │ │ -
Base::MatrixHelper MatrixHelper
Definition multilineargeometry.hh:531
│ │ │ │ -
Base::LocalCoordinate LocalCoordinate
Definition multilineargeometry.hh:541
│ │ │ │ -
JacobianInverse jacobianInverse(const LocalCoordinate &local) const
Obtain the Jacobian's inverse.
Definition multilineargeometry.hh:713
│ │ │ │ -
JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const
obtain the transposed of the Jacobian
Definition multilineargeometry.hh:666
│ │ │ │ -
GlobalCoordinate corner(int i) const
obtain coordinates of the i-th corner
Definition multilineargeometry.hh:275
│ │ │ │ -
Volume volume() const
obtain the volume of the mapping's image
Definition multilineargeometry.hh:649
│ │ │ │ -
CachedMultiLinearGeometry(Dune::GeometryType gt, const CornerStorage &cornerStorage)
Definition multilineargeometry.hh:559
│ │ │ │ -
ctype integrationElement(const LocalCoordinate &local) const
obtain the integration element
Definition multilineargeometry.hh:633
│ │ │ │ -
Base::ctype ctype
Definition multilineargeometry.hh:536
│ │ │ │ -
Jacobian jacobian(const LocalCoordinate &local) const
Obtain the Jacobian.
Definition multilineargeometry.hh:702
│ │ │ │ -
Base::JacobianInverseTransposed JacobianInverseTransposed
Definition multilineargeometry.hh:546
│ │ │ │ -
Base::JacobianTransposed JacobianTransposed
Definition multilineargeometry.hh:545
│ │ │ │ -
Base::JacobianInverse JacobianInverse
Definition multilineargeometry.hh:548
│ │ │ │ -
Base::Jacobian Jacobian
Definition multilineargeometry.hh:547
│ │ │ │ -
Base::Volume Volume
Definition multilineargeometry.hh:543
│ │ │ │ -
Base::GlobalCoordinate GlobalCoordinate
Definition multilineargeometry.hh:542
│ │ │ │ -
GlobalCoordinate center() const
obtain the centroid of the mapping's image
Definition multilineargeometry.hh:572
│ │ │ │ -
JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate &local) const
obtain the transposed of the Jacobian's inverse
Definition multilineargeometry.hh:680
│ │ │ │ +
Class providing information on the ordering of vertices.
Definition generalvertexorder.hh:67
│ │ │ │ +
Index_ Index
Type of indices.
Definition generalvertexorder.hh:77
│ │ │ │ +
const GeometryType & type() const
get type of the entity's geometry
Definition generalvertexorder.hh:85
│ │ │ │ +
static const std::size_t dimension
export the dimension of the entity we provide information for
Definition generalvertexorder.hh:83
│ │ │ │ +
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
│ │ │ │ +
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
│ │ │ │ +
GeneralVertexOrder(const GeometryType &gt_, const InIterator &inBegin, const InIterator &inEnd)
construct a GeneralVertexOrder
Definition generalvertexorder.hh:97
│ │ │ │ +
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
│ │ │ │ +
Iterate over the vertex indices of some sub-entity.
Definition generalvertexorder.hh:144
│ │ │ │ +
iterator()
public default constructor
Definition generalvertexorder.hh:187
│ │ │ │ +
void decrement()
Definition generalvertexorder.hh:169
│ │ │ │ +
void advance(std::ptrdiff_t n)
Definition generalvertexorder.hh:170
│ │ │ │ +
const Index & dereference() const
Definition generalvertexorder.hh:156
│ │ │ │ +
void increment()
Definition generalvertexorder.hh:168
│ │ │ │ +
bool equals(const iterator &other) const
Definition generalvertexorder.hh:164
│ │ │ │ +
std::ptrdiff_t distanceTo(const iterator &other) const
Definition generalvertexorder.hh:171
│ │ │ │ +
const Index & elementAt(std::ptrdiff_t n) const
Definition generalvertexorder.hh:160
│ │ │ │
Unique label for each type of entities that can occur in DUNE grids.
Definition type.hh:126
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -7,1024 +7,218 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ -multilineargeometry.hh │ │ │ │ │ +generalvertexorder.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception │ │ │ │ │ - 5#ifndef DUNE_GEOMETRY_MULTILINEARGEOMETRY_HH │ │ │ │ │ - 6#define DUNE_GEOMETRY_MULTILINEARGEOMETRY_HH │ │ │ │ │ - 7 │ │ │ │ │ - 8#include │ │ │ │ │ - 9#include │ │ │ │ │ - 10#include │ │ │ │ │ - 11#include │ │ │ │ │ - 12#include │ │ │ │ │ - 13 │ │ │ │ │ - 14#include │ │ │ │ │ - 15#include │ │ │ │ │ - 16#include │ │ │ │ │ - 17 │ │ │ │ │ - 18#include │ │ │ │ │ - 19#include │ │ │ │ │ - 20#include │ │ │ │ │ + 5 │ │ │ │ │ + 6#ifndef DUNE_GEOMETRY_GENERALVERTEXORDER_HH │ │ │ │ │ + 7#define DUNE_GEOMETRY_GENERALVERTEXORDER_HH │ │ │ │ │ + 8 │ │ │ │ │ + 9#include │ │ │ │ │ + 10#include │ │ │ │ │ + 11#include │ │ │ │ │ + 12#include │ │ │ │ │ + 13#include │ │ │ │ │ + 14 │ │ │ │ │ + 15#include │ │ │ │ │ + 16 │ │ │ │ │ + 17#include "type.hh" │ │ │ │ │ + 18#include │ │ │ │ │ + 19 │ │ │ │ │ + 20namespace Dune { │ │ │ │ │ 21 │ │ │ │ │ - 22namespace Dune │ │ │ │ │ - 23{ │ │ │ │ │ - 24 │ │ │ │ │ - 25 // MultiLinearGeometryTraits │ │ │ │ │ - 26 // ------------------------- │ │ │ │ │ - 27 │ │ │ │ │ - 37 template< class ct > │ │ │ │ │ -38 struct MultiLinearGeometryTraits │ │ │ │ │ - 39 { │ │ │ │ │ -58 typedef Impl::FieldMatrixHelper< ct > MatrixHelper; │ │ │ │ │ - 59 │ │ │ │ │ -61 static ct tolerance () { return ct( 16 ) * std::numeric_limits< ct >:: │ │ │ │ │ -epsilon(); } │ │ │ │ │ - 62 │ │ │ │ │ - 127 template< int mydim, int cdim > │ │ │ │ │ -128 struct CornerStorage │ │ │ │ │ - 129 { │ │ │ │ │ -130 typedef std::vector< FieldVector< ct, cdim > > Type; │ │ │ │ │ - 131 }; │ │ │ │ │ - 132 │ │ │ │ │ - 146 template< int dim > │ │ │ │ │ -147 struct hasSingleGeometryType │ │ │ │ │ - 148 { │ │ │ │ │ -149 static const bool v = false; │ │ │ │ │ -150 static const unsigned int topologyId = ~0u; │ │ │ │ │ - 151 }; │ │ │ │ │ - 152 }; │ │ │ │ │ - 153 │ │ │ │ │ + 39 template │ │ │ │ │ +40 void reduceOrder(const InIterator& inBegin, const InIterator& inEnd, │ │ │ │ │ + 41 OutIterator outIt) │ │ │ │ │ + 42 { │ │ │ │ │ + 43 for(InIterator inIt = inBegin; inIt != inEnd; ++inIt, ++outIt) │ │ │ │ │ + 44 *outIt = std::count_if(inBegin, inEnd, [&](const auto& v) │ │ │ │ │ + 45 { │ │ │ │ │ + 46 return v < *inIt; │ │ │ │ │ + 47 }); │ │ │ │ │ + 48 } │ │ │ │ │ + 49 │ │ │ │ │ + 51 │ │ │ │ │ + 66 template │ │ │ │ │ +67 class GeneralVertexOrder { │ │ │ │ │ + 68 typedef ReferenceElements RefElems; │ │ │ │ │ + 69 typedef typename RefElems::ReferenceElement RefElem; │ │ │ │ │ + 70 │ │ │ │ │ + 71 RefElem refelem; │ │ │ │ │ + 72 GeometryType gt; │ │ │ │ │ + 73 std::vector vertexOrder; │ │ │ │ │ + 74 │ │ │ │ │ + 75 public: │ │ │ │ │ +77 typedef Index_ Index; │ │ │ │ │ + 78 │ │ │ │ │ + 80 class iterator; │ │ │ │ │ + 81 │ │ │ │ │ +83 static const std::size_t dimension = dim; │ │ │ │ │ +85 const GeometryType &type() const { return gt; } │ │ │ │ │ + 86 │ │ │ │ │ + 88 │ │ │ │ │ + 96 template │ │ │ │ │ +97 GeneralVertexOrder(const GeometryType& gt_, const InIterator &inBegin, │ │ │ │ │ + 98 const InIterator &inEnd) : │ │ │ │ │ + 99 refelem(RefElems::general(gt_)), gt(gt_), │ │ │ │ │ + 100 vertexOrder(refelem.size(dim)) │ │ │ │ │ + 101 { reduceOrder(inBegin, inEnd, vertexOrder.begin()); } │ │ │ │ │ + 102 │ │ │ │ │ + 104 │ │ │ │ │ +108 iterator begin(std::size_t codim, std::size_t subEntity) const │ │ │ │ │ + 109 { return iterator(*this, codim, subEntity); } │ │ │ │ │ + 111 │ │ │ │ │ +115 iterator end(std::size_t codim, std::size_t subEntity) const { │ │ │ │ │ + 116 return iterator(*this, codim, subEntity, │ │ │ │ │ + 117 refelem.size(subEntity, codim, dim)); │ │ │ │ │ + 118 } │ │ │ │ │ + 119 │ │ │ │ │ + 121 │ │ │ │ │ +128 void getReduced(std::size_t codim, std::size_t subEntity, │ │ │ │ │ + 129 std::vector& order) const │ │ │ │ │ + 130 { │ │ │ │ │ + 131 order.resize(refelem.size(subEntity, codim, dim)); │ │ │ │ │ + 132 reduceOrder(begin(codim, subEntity), end(codim, subEntity), │ │ │ │ │ + 133 order.begin()); │ │ │ │ │ + 134 } │ │ │ │ │ + 135 }; │ │ │ │ │ + 136 │ │ │ │ │ + 138 │ │ │ │ │ + 141 template │ │ │ │ │ +142 class GeneralVertexOrder::iterator : │ │ │ │ │ + 143 public Dune::RandomAccessIteratorFacade │ │ │ │ │ + 144 { │ │ │ │ │ + 145 const GeneralVertexOrder *order; │ │ │ │ │ + 146 std::size_t codim; │ │ │ │ │ + 147 std::size_t subEntity; │ │ │ │ │ + 148 std::size_t vertex; │ │ │ │ │ + 149 │ │ │ │ │ + 150 iterator(const GeneralVertexOrder &order_, std::size_t codim_, │ │ │ │ │ + 151 std::size_t subEntity_, std::size_t vertex_ = 0) : │ │ │ │ │ + 152 order(&order_), codim(codim_), subEntity(subEntity_), vertex(vertex_) │ │ │ │ │ + 153 { } │ │ │ │ │ 154 │ │ │ │ │ - 155 │ │ │ │ │ - 156 // MultiLinearGeometry │ │ │ │ │ - 157 // ------------------- │ │ │ │ │ - 158 │ │ │ │ │ - 179 template< class ct, int mydim, int cdim, class Traits = │ │ │ │ │ -MultiLinearGeometryTraits< ct > > │ │ │ │ │ -180 class MultiLinearGeometry │ │ │ │ │ - 181 { │ │ │ │ │ - 182 typedef MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_> This; │ │ │ │ │ - 183 │ │ │ │ │ - 184 public: │ │ │ │ │ -186 typedef ct ctype; │ │ │ │ │ - 187 │ │ │ │ │ -189 static const int mydimension= mydim; │ │ │ │ │ -191 static const int coorddimension = cdim; │ │ │ │ │ - 192 │ │ │ │ │ -194 typedef FieldVector< ctype, mydimension > LocalCoordinate; │ │ │ │ │ -196 typedef FieldVector< ctype, coorddimension > GlobalCoordinate; │ │ │ │ │ -198 typedef ctype Volume; │ │ │ │ │ - 199 │ │ │ │ │ -201 typedef FieldMatrix< ctype, mydimension, coorddimension > │ │ │ │ │ -JacobianTransposed; │ │ │ │ │ - 202 │ │ │ │ │ - 204 class JacobianInverseTransposed; │ │ │ │ │ - 205 │ │ │ │ │ -207 typedef FieldMatrix< ctype, coorddimension, mydimension > Jacobian; │ │ │ │ │ - 208 │ │ │ │ │ -210 typedef FieldMatrix< ctype, mydimension, coorddimension > JacobianInverse; │ │ │ │ │ - 211 │ │ │ │ │ - 212 protected: │ │ │ │ │ - 213 │ │ │ │ │ -214 typedef Dune::ReferenceElements<_ctype,_mydimension_> ReferenceElements; │ │ │ │ │ - 215 │ │ │ │ │ - 216 public: │ │ │ │ │ - 217 │ │ │ │ │ -219 typedef typename ReferenceElements::ReferenceElement ReferenceElement; │ │ │ │ │ - 220 │ │ │ │ │ - 221 private: │ │ │ │ │ - 222 static const bool hasSingleGeometryType = Traits::template │ │ │ │ │ -hasSingleGeometryType< mydimension >::v; │ │ │ │ │ - 223 │ │ │ │ │ - 224 protected: │ │ │ │ │ -225 typedef typename Traits::MatrixHelper MatrixHelper; │ │ │ │ │ -226 typedef typename std::conditional< hasSingleGeometryType, std:: │ │ │ │ │ -integral_constant< unsigned int, Traits::template hasSingleGeometryType< │ │ │ │ │ -mydimension >::topologyId >, unsigned int >::type TopologyId; │ │ │ │ │ - 227 │ │ │ │ │ - 228 public: │ │ │ │ │ - 238 template< class Corners > │ │ │ │ │ -239 MultiLinearGeometry ( const ReferenceElement &refElement, │ │ │ │ │ - 240 const Corners &corners ) │ │ │ │ │ - 241 : refElement_( refElement ), │ │ │ │ │ - 242 corners_( corners ) │ │ │ │ │ - 243 {} │ │ │ │ │ - 244 │ │ │ │ │ - 254 template< class Corners > │ │ │ │ │ -255 MultiLinearGeometry ( Dune::GeometryType gt, │ │ │ │ │ - 256 const Corners &corners ) │ │ │ │ │ - 257 : refElement_( ReferenceElements::general( gt ) ), │ │ │ │ │ - 258 corners_( corners ) │ │ │ │ │ - 259 {} │ │ │ │ │ - 260 │ │ │ │ │ -262 bool affine () const │ │ │ │ │ - 263 { │ │ │ │ │ - 264 JacobianTransposed jt; │ │ │ │ │ - 265 return affine( jt ); │ │ │ │ │ - 266 } │ │ │ │ │ - 267 │ │ │ │ │ -269 Dune::GeometryType type () const { return GeometryType( toUnsignedInt │ │ │ │ │ -(topologyId()), mydimension ); } │ │ │ │ │ - 270 │ │ │ │ │ -272 int corners () const { return refElement().size( mydimension ); } │ │ │ │ │ - 273 │ │ │ │ │ -275 GlobalCoordinate corner ( int i ) const │ │ │ │ │ - 276 { │ │ │ │ │ - 277 assert( (i >= 0) && (i < corners()) ); │ │ │ │ │ - 278 return std::cref(corners_).get()[ i ]; │ │ │ │ │ - 279 } │ │ │ │ │ - 280 │ │ │ │ │ -282 GlobalCoordinate center () const { return global( refElement().position( 0, │ │ │ │ │ -0 ) ); } │ │ │ │ │ - 283 │ │ │ │ │ -290 GlobalCoordinate global ( const LocalCoordinate &local ) const │ │ │ │ │ - 291 { │ │ │ │ │ - 292 using std::begin; │ │ │ │ │ - 293 │ │ │ │ │ - 294 auto cit = begin(std::cref(corners_).get()); │ │ │ │ │ - 295 GlobalCoordinate y; │ │ │ │ │ - 296 global< false >( topologyId(), std::integral_constant< int, mydimension > │ │ │ │ │ -(), cit, ctype( 1 ), local, ctype( 1 ), y ); │ │ │ │ │ - 297 return y; │ │ │ │ │ - 298 } │ │ │ │ │ - 299 │ │ │ │ │ -312 LocalCoordinate local ( const GlobalCoordinate &globalCoord ) const │ │ │ │ │ - 313 { │ │ │ │ │ - 314 const ctype tolerance = Traits::tolerance(); │ │ │ │ │ - 315 LocalCoordinate x = refElement().position( 0, 0 ); │ │ │ │ │ - 316 LocalCoordinate dx; │ │ │ │ │ - 317 const bool affineMapping = this->affine(); │ │ │ │ │ - 318 do │ │ │ │ │ - 319 { │ │ │ │ │ - 320 // Newton's method: DF^n dx^n = F^n, x^{n+1} -= dx^n │ │ │ │ │ - 321 const GlobalCoordinate dglobal = (*this).global( x ) - globalCoord; │ │ │ │ │ - 322 const bool invertible = │ │ │ │ │ - 323 MatrixHelper::template xTRightInvA< mydimension, coorddimension > │ │ │ │ │ -( jacobianTransposed( x ), dglobal, dx ); │ │ │ │ │ - 324 if( ! invertible ) │ │ │ │ │ - 325 return LocalCoordinate( std::numeric_limits< ctype > :: max() ); │ │ │ │ │ - 326 │ │ │ │ │ - 327 // update x with correction │ │ │ │ │ - 328 x -= dx; │ │ │ │ │ - 329 │ │ │ │ │ - 330 // for affine mappings only one iteration is needed │ │ │ │ │ - 331 if ( affineMapping ) break; │ │ │ │ │ - 332 } while( dx.two_norm2() > tolerance ); │ │ │ │ │ - 333 return x; │ │ │ │ │ - 334 } │ │ │ │ │ - 335 │ │ │ │ │ -350 Volume integrationElement ( const LocalCoordinate &local ) const │ │ │ │ │ - 351 { │ │ │ │ │ - 352 return MatrixHelper::template sqrtDetAAT< mydimension, coorddimension > │ │ │ │ │ -( jacobianTransposed( local ) ); │ │ │ │ │ - 353 } │ │ │ │ │ - 354 │ │ │ │ │ -363 Volume volume () const │ │ │ │ │ - 364 { │ │ │ │ │ - 365 return integrationElement( refElement().position( 0, 0 ) ) * refElement │ │ │ │ │ -().volume(); │ │ │ │ │ - 366 } │ │ │ │ │ - 367 │ │ │ │ │ -377 JacobianTransposed jacobianTransposed ( const LocalCoordinate &local ) │ │ │ │ │ -const │ │ │ │ │ - 378 { │ │ │ │ │ - 379 using std::begin; │ │ │ │ │ - 380 │ │ │ │ │ - 381 JacobianTransposed jt; │ │ │ │ │ - 382 auto cit = begin(std::cref(corners_).get()); │ │ │ │ │ - 383 jacobianTransposed< false >( topologyId(), std::integral_constant< int, │ │ │ │ │ -mydimension >(), cit, ctype( 1 ), local, ctype( 1 ), jt ); │ │ │ │ │ - 384 return jt; │ │ │ │ │ - 385 } │ │ │ │ │ - 386 │ │ │ │ │ -393 JacobianInverseTransposed jacobianInverseTransposed ( const LocalCoordinate │ │ │ │ │ -&local ) const; │ │ │ │ │ - 394 │ │ │ │ │ -395 friend ReferenceElement referenceElement ( const MultiLinearGeometry │ │ │ │ │ -&geometry ) │ │ │ │ │ - 396 { │ │ │ │ │ - 397 return geometry.refElement(); │ │ │ │ │ - 398 } │ │ │ │ │ - 399 │ │ │ │ │ - 400 │ │ │ │ │ -407 Jacobian jacobian (const LocalCoordinate &local) const │ │ │ │ │ - 408 { │ │ │ │ │ - 409 return jacobianTransposed(local).transposed(); │ │ │ │ │ - 410 } │ │ │ │ │ - 411 │ │ │ │ │ -418 JacobianInverse jacobianInverse (const LocalCoordinate &local) const │ │ │ │ │ - 419 { │ │ │ │ │ - 420 return jacobianInverseTransposed(local).transposed(); │ │ │ │ │ - 421 } │ │ │ │ │ - 422 │ │ │ │ │ - 423 protected: │ │ │ │ │ - 424 │ │ │ │ │ -425 ReferenceElement refElement () const │ │ │ │ │ - 426 { │ │ │ │ │ - 427 return refElement_; │ │ │ │ │ - 428 } │ │ │ │ │ - 429 │ │ │ │ │ -430 TopologyId topologyId () const │ │ │ │ │ - 431 { │ │ │ │ │ - 432 return topologyId( std::integral_constant< bool, hasSingleGeometryType >() │ │ │ │ │ -); │ │ │ │ │ - 433 } │ │ │ │ │ - 434 │ │ │ │ │ - 435 template< bool add, int dim, class CornerIterator > │ │ │ │ │ -436 static void global ( TopologyId topologyId, std::integral_constant< int, │ │ │ │ │ -dim >, │ │ │ │ │ - 437 CornerIterator &cit, const ctype &df, const LocalCoordinate &x, │ │ │ │ │ - 438 const ctype &rf, GlobalCoordinate &y ); │ │ │ │ │ - 439 template< bool add, class CornerIterator > │ │ │ │ │ -440 static void global ( TopologyId topologyId, std::integral_constant< int, 0 │ │ │ │ │ ->, │ │ │ │ │ - 441 CornerIterator &cit, const ctype &df, const LocalCoordinate &x, │ │ │ │ │ - 442 const ctype &rf, GlobalCoordinate &y ); │ │ │ │ │ - 443 │ │ │ │ │ - 444 template< bool add, int rows, int dim, class CornerIterator > │ │ │ │ │ -445 static void jacobianTransposed ( TopologyId topologyId, std:: │ │ │ │ │ -integral_constant< int, dim >, │ │ │ │ │ - 446 CornerIterator &cit, const ctype &df, const LocalCoordinate &x, │ │ │ │ │ - 447 const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt ); │ │ │ │ │ - 448 template< bool add, int rows, class CornerIterator > │ │ │ │ │ -449 static void jacobianTransposed ( TopologyId topologyId, std:: │ │ │ │ │ -integral_constant< int, 0 >, │ │ │ │ │ - 450 CornerIterator &cit, const ctype &df, const LocalCoordinate &x, │ │ │ │ │ - 451 const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt ); │ │ │ │ │ - 452 │ │ │ │ │ - 453 template< int dim, class CornerIterator > │ │ │ │ │ -454 static bool affine ( TopologyId topologyId, std::integral_constant< int, │ │ │ │ │ -dim >, CornerIterator &cit, JacobianTransposed &jt ); │ │ │ │ │ - 455 template< class CornerIterator > │ │ │ │ │ -456 static bool affine ( TopologyId topologyId, std::integral_constant< int, 0 │ │ │ │ │ ->, CornerIterator &cit, JacobianTransposed &jt ); │ │ │ │ │ - 457 │ │ │ │ │ -458 bool affine ( JacobianTransposed &jacobianT ) const │ │ │ │ │ - 459 { │ │ │ │ │ - 460 using std::begin; │ │ │ │ │ - 461 │ │ │ │ │ - 462 auto cit = begin(std::cref(corners_).get()); │ │ │ │ │ - 463 return affine( topologyId(), std::integral_constant< int, mydimension >(), │ │ │ │ │ -cit, jacobianT ); │ │ │ │ │ - 464 } │ │ │ │ │ - 465 │ │ │ │ │ - 466 private: │ │ │ │ │ - 467 // The following methods are needed to convert the return type of │ │ │ │ │ -topologyId to │ │ │ │ │ - 468 // unsigned int with g++-4.4. It has problems casting integral_constant to │ │ │ │ │ -the │ │ │ │ │ - 469 // integral type. │ │ │ │ │ - 470 static unsigned int toUnsignedInt(unsigned int i) { return i; } │ │ │ │ │ - 471 template │ │ │ │ │ - 472 static unsigned int toUnsignedInt(std::integral_constant ) │ │ │ │ │ -{ return v; } │ │ │ │ │ - 473 TopologyId topologyId ( std::integral_constant< bool, true > ) const │ │ │ │ │ -{ return TopologyId(); } │ │ │ │ │ - 474 unsigned int topologyId ( std::integral_constant< bool, false > ) const │ │ │ │ │ -{ return refElement().type().id(); } │ │ │ │ │ - 475 │ │ │ │ │ - 476 ReferenceElement refElement_; │ │ │ │ │ - 477 typename Traits::template CornerStorage< mydimension, coorddimension >:: │ │ │ │ │ -Type corners_; │ │ │ │ │ - 478 }; │ │ │ │ │ - 479 │ │ │ │ │ - 480 │ │ │ │ │ - 481 │ │ │ │ │ - 482 // MultiLinearGeometry::JacobianInverseTransposed │ │ │ │ │ - 483 // ---------------------------------------------- │ │ │ │ │ - 484 │ │ │ │ │ - 485 template< class ct, int mydim, int cdim, class Traits > │ │ │ │ │ -486 class MultiLinearGeometry< ct, mydim, cdim, Traits >:: │ │ │ │ │ -JacobianInverseTransposed │ │ │ │ │ - 487 : public FieldMatrix< ctype, coorddimension, mydimension > │ │ │ │ │ - 488 { │ │ │ │ │ - 489 typedef FieldMatrix< ctype, coorddimension, mydimension > Base; │ │ │ │ │ - 490 │ │ │ │ │ - 491 public: │ │ │ │ │ -492 void setup ( const JacobianTransposed &jt ) │ │ │ │ │ - 493 { │ │ │ │ │ - 494 detInv_ = MatrixHelper::template rightInvA< mydimension, coorddimension > │ │ │ │ │ -( jt, static_cast< Base & >( *this ) ); │ │ │ │ │ - 495 } │ │ │ │ │ - 496 │ │ │ │ │ -497 void setupDeterminant ( const JacobianTransposed &jt ) │ │ │ │ │ - 498 { │ │ │ │ │ - 499 detInv_ = MatrixHelper::template sqrtDetAAT< mydimension, coorddimension > │ │ │ │ │ -( jt ); │ │ │ │ │ - 500 } │ │ │ │ │ - 501 │ │ │ │ │ -502 ctype det () const { return ctype( 1 ) / detInv_; } │ │ │ │ │ -503 ctype detInv () const { return detInv_; } │ │ │ │ │ - 504 │ │ │ │ │ - 505 private: │ │ │ │ │ - 506 ctype detInv_; │ │ │ │ │ - 507 }; │ │ │ │ │ - 508 │ │ │ │ │ - 509 │ │ │ │ │ - 510 │ │ │ │ │ - 523 template< class ct, int mydim, int cdim, class Traits = │ │ │ │ │ -MultiLinearGeometryTraits< ct > > │ │ │ │ │ -524 class CachedMultiLinearGeometry │ │ │ │ │ - 525 : public MultiLinearGeometry< ct, mydim, cdim, Traits > │ │ │ │ │ - 526 { │ │ │ │ │ - 527 typedef CachedMultiLinearGeometry<_ct,_mydim,_cdim,_Traits_> This; │ │ │ │ │ - 528 typedef MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_> Base; │ │ │ │ │ - 529 │ │ │ │ │ - 530 protected: │ │ │ │ │ -531 typedef typename Base::MatrixHelper MatrixHelper; │ │ │ │ │ - 532 │ │ │ │ │ - 533 public: │ │ │ │ │ -534 typedef typename Base::ReferenceElement ReferenceElement; │ │ │ │ │ - 535 │ │ │ │ │ -536 typedef typename Base::ctype ctype; │ │ │ │ │ - 537 │ │ │ │ │ - 538 using Base::mydimension; │ │ │ │ │ - 539 using Base::coorddimension; │ │ │ │ │ - 540 │ │ │ │ │ -541 typedef typename Base::LocalCoordinate LocalCoordinate; │ │ │ │ │ -542 typedef typename Base::GlobalCoordinate GlobalCoordinate; │ │ │ │ │ -543 typedef typename Base::Volume Volume; │ │ │ │ │ - 544 │ │ │ │ │ -545 typedef typename Base::JacobianTransposed JacobianTransposed; │ │ │ │ │ -546 typedef typename Base::JacobianInverseTransposed JacobianInverseTransposed; │ │ │ │ │ -547 typedef typename Base::Jacobian Jacobian; │ │ │ │ │ -548 typedef typename Base::JacobianInverse JacobianInverse; │ │ │ │ │ - 549 │ │ │ │ │ - 550 template< class CornerStorage > │ │ │ │ │ -551 CachedMultiLinearGeometry ( const ReferenceElement &referenceElement, const │ │ │ │ │ -CornerStorage &cornerStorage ) │ │ │ │ │ - 552 : Base( referenceElement, cornerStorage ), │ │ │ │ │ - 553 affine_( Base::affine( jacobianTransposed_ ) ), │ │ │ │ │ - 554 jacobianInverseTransposedComputed_( false ), │ │ │ │ │ - 555 integrationElementComputed_( false ) │ │ │ │ │ - 556 {} │ │ │ │ │ - 557 │ │ │ │ │ - 558 template< class CornerStorage > │ │ │ │ │ -559 CachedMultiLinearGeometry ( Dune::GeometryType gt, const CornerStorage │ │ │ │ │ -&cornerStorage ) │ │ │ │ │ - 560 : Base( gt, cornerStorage ), │ │ │ │ │ - 561 affine_( Base::affine( jacobianTransposed_ ) ), │ │ │ │ │ - 562 jacobianInverseTransposedComputed_( false ), │ │ │ │ │ - 563 integrationElementComputed_( false ) │ │ │ │ │ - 564 {} │ │ │ │ │ - 565 │ │ │ │ │ -567 bool affine () const { return affine_; } │ │ │ │ │ - 568 │ │ │ │ │ - 569 using Base::corner; │ │ │ │ │ - 570 │ │ │ │ │ -572 GlobalCoordinate center () const { return global( refElement().position( 0, │ │ │ │ │ -0 ) ); } │ │ │ │ │ - 573 │ │ │ │ │ -580 GlobalCoordinate global ( const LocalCoordinate &local ) const │ │ │ │ │ - 581 { │ │ │ │ │ - 582 if( affine() ) │ │ │ │ │ - 583 { │ │ │ │ │ - 584 GlobalCoordinate global( corner( 0 ) ); │ │ │ │ │ - 585 jacobianTransposed_.umtv( local, global ); │ │ │ │ │ - 586 return global; │ │ │ │ │ - 587 } │ │ │ │ │ - 588 else │ │ │ │ │ - 589 return Base::global( local ); │ │ │ │ │ - 590 } │ │ │ │ │ - 591 │ │ │ │ │ -604 LocalCoordinate local ( const GlobalCoordinate &global ) const │ │ │ │ │ - 605 { │ │ │ │ │ - 606 if( affine() ) │ │ │ │ │ - 607 { │ │ │ │ │ - 608 LocalCoordinate local; │ │ │ │ │ - 609 if( jacobianInverseTransposedComputed_ ) │ │ │ │ │ - 610 jacobianInverseTransposed_.mtv( global - corner( 0 ), local ); │ │ │ │ │ - 611 else │ │ │ │ │ - 612 MatrixHelper::template xTRightInvA< mydimension, coorddimension > │ │ │ │ │ -( jacobianTransposed_, global - corner( 0 ), local ); │ │ │ │ │ - 613 return local; │ │ │ │ │ - 614 } │ │ │ │ │ - 615 else │ │ │ │ │ - 616 return Base::local( global ); │ │ │ │ │ - 617 } │ │ │ │ │ - 618 │ │ │ │ │ -633 ctype integrationElement ( const LocalCoordinate &local ) const │ │ │ │ │ - 634 { │ │ │ │ │ - 635 if( affine() ) │ │ │ │ │ - 636 { │ │ │ │ │ - 637 if( !integrationElementComputed_ ) │ │ │ │ │ - 638 { │ │ │ │ │ - 639 jacobianInverseTransposed_.setupDeterminant( jacobianTransposed_ ); │ │ │ │ │ - 640 integrationElementComputed_ = true; │ │ │ │ │ - 641 } │ │ │ │ │ - 642 return jacobianInverseTransposed_.detInv(); │ │ │ │ │ - 643 } │ │ │ │ │ - 644 else │ │ │ │ │ - 645 return Base::integrationElement( local ); │ │ │ │ │ - 646 } │ │ │ │ │ - 647 │ │ │ │ │ -649 Volume volume () const │ │ │ │ │ - 650 { │ │ │ │ │ - 651 if( affine() ) │ │ │ │ │ - 652 return integrationElement( refElement().position( 0, 0 ) ) * refElement │ │ │ │ │ -().volume(); │ │ │ │ │ - 653 else │ │ │ │ │ - 654 return Base::volume(); │ │ │ │ │ - 655 } │ │ │ │ │ - 656 │ │ │ │ │ -666 JacobianTransposed jacobianTransposed ( const LocalCoordinate &local ) │ │ │ │ │ -const │ │ │ │ │ - 667 { │ │ │ │ │ - 668 if( affine() ) │ │ │ │ │ - 669 return jacobianTransposed_; │ │ │ │ │ - 670 else │ │ │ │ │ - 671 return Base::jacobianTransposed( local ); │ │ │ │ │ - 672 } │ │ │ │ │ - 673 │ │ │ │ │ -680 JacobianInverseTransposed jacobianInverseTransposed ( const LocalCoordinate │ │ │ │ │ -&local ) const │ │ │ │ │ - 681 { │ │ │ │ │ - 682 if( affine() ) │ │ │ │ │ - 683 { │ │ │ │ │ - 684 if( !jacobianInverseTransposedComputed_ ) │ │ │ │ │ - 685 { │ │ │ │ │ - 686 jacobianInverseTransposed_.setup( jacobianTransposed_ ); │ │ │ │ │ - 687 jacobianInverseTransposedComputed_ = true; │ │ │ │ │ - 688 integrationElementComputed_ = true; │ │ │ │ │ - 689 } │ │ │ │ │ - 690 return jacobianInverseTransposed_; │ │ │ │ │ - 691 } │ │ │ │ │ - 692 else │ │ │ │ │ - 693 return Base::jacobianInverseTransposed( local ); │ │ │ │ │ - 694 } │ │ │ │ │ - 695 │ │ │ │ │ -702 Jacobian jacobian (const LocalCoordinate &local) const │ │ │ │ │ - 703 { │ │ │ │ │ - 704 return jacobianTransposed(local).transposed(); │ │ │ │ │ - 705 } │ │ │ │ │ - 706 │ │ │ │ │ -713 JacobianInverse jacobianInverse (const LocalCoordinate &local) const │ │ │ │ │ - 714 { │ │ │ │ │ - 715 return jacobianInverseTransposed(local).transposed(); │ │ │ │ │ - 716 } │ │ │ │ │ - 717 │ │ │ │ │ - 718 protected: │ │ │ │ │ - 719 using Base::refElement; │ │ │ │ │ - 720 │ │ │ │ │ - 721 private: │ │ │ │ │ - 722 mutable JacobianTransposed jacobianTransposed_; │ │ │ │ │ - 723 mutable JacobianInverseTransposed jacobianInverseTransposed_; │ │ │ │ │ - 724 │ │ │ │ │ - 725 mutable bool affine_ : 1; │ │ │ │ │ - 726 │ │ │ │ │ - 727 mutable bool jacobianInverseTransposedComputed_ : 1; │ │ │ │ │ - 728 mutable bool integrationElementComputed_ : 1; │ │ │ │ │ - 729 }; │ │ │ │ │ - 730 │ │ │ │ │ - 731 │ │ │ │ │ - 732 │ │ │ │ │ - 733 // Implementation of MultiLinearGeometry │ │ │ │ │ - 734 // ------------------------------------- │ │ │ │ │ - 735 │ │ │ │ │ - 736 template< class ct, int mydim, int cdim, class Traits > │ │ │ │ │ - 737 inline typename MultiLinearGeometry< ct, mydim, cdim, Traits >:: │ │ │ │ │ -JacobianInverseTransposed │ │ │ │ │ -738 MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_>::jacobianInverseTransposed │ │ │ │ │ -( const LocalCoordinate &local ) const │ │ │ │ │ - 739 { │ │ │ │ │ - 740 JacobianInverseTransposed jit; │ │ │ │ │ - 741 jit.setup( jacobianTransposed( local ) ); │ │ │ │ │ - 742 return jit; │ │ │ │ │ - 743 } │ │ │ │ │ - 744 │ │ │ │ │ - 745 │ │ │ │ │ - 746 template< class ct, int mydim, int cdim, class Traits > │ │ │ │ │ - 747 template< bool add, int dim, class CornerIterator > │ │ │ │ │ - 748 inline void MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_> │ │ │ │ │ -749::global ( TopologyId topologyId, std::integral_constant< int, dim >, │ │ │ │ │ - 750 CornerIterator &cit, const ctype &df, const LocalCoordinate &x, │ │ │ │ │ - 751 const ctype &rf, GlobalCoordinate &y ) │ │ │ │ │ - 752 { │ │ │ │ │ - 753 const ctype xn = df*x[ dim-1 ]; │ │ │ │ │ - 754 const ctype cxn = ctype( 1 ) - xn; │ │ │ │ │ - 755 │ │ │ │ │ - 756 if( Impl::isPrism( toUnsignedInt(topologyId), mydimension, mydimension-dim │ │ │ │ │ -) ) │ │ │ │ │ - 757 { │ │ │ │ │ - 758 // apply (1-xn) times mapping for bottom │ │ │ │ │ - 759 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit, │ │ │ │ │ -df, x, rf*cxn, y ); │ │ │ │ │ - 760 // apply xn times mapping for top │ │ │ │ │ - 761 global< true >( topologyId, std::integral_constant< int, dim-1 >(), cit, │ │ │ │ │ -df, x, rf*xn, y ); │ │ │ │ │ - 762 } │ │ │ │ │ - 763 else │ │ │ │ │ - 764 { │ │ │ │ │ - 765 assert( Impl::isPyramid( toUnsignedInt(topologyId), mydimension, │ │ │ │ │ -mydimension-dim ) ); │ │ │ │ │ - 766 // apply (1-xn) times mapping for bottom (with argument x/(1-xn)) │ │ │ │ │ - 767 if( cxn > Traits::tolerance() || cxn < -Traits::tolerance() ) │ │ │ │ │ - 768 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit, │ │ │ │ │ -df/cxn, x, rf*cxn, y ); │ │ │ │ │ - 769 else │ │ │ │ │ - 770 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit, │ │ │ │ │ -df, x, ctype( 0 ), y ); │ │ │ │ │ - 771 // apply xn times the tip │ │ │ │ │ - 772 y.axpy( rf*xn, *cit ); │ │ │ │ │ - 773 ++cit; │ │ │ │ │ - 774 } │ │ │ │ │ - 775 } │ │ │ │ │ - 776 │ │ │ │ │ - 777 template< class ct, int mydim, int cdim, class Traits > │ │ │ │ │ - 778 template< bool add, class CornerIterator > │ │ │ │ │ - 779 inline void MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_> │ │ │ │ │ -780::global ( TopologyId, std::integral_constant< int, 0 >, │ │ │ │ │ - 781 CornerIterator &cit, const ctype &, const LocalCoordinate &, │ │ │ │ │ - 782 const ctype &rf, GlobalCoordinate &y ) │ │ │ │ │ - 783 { │ │ │ │ │ - 784 const GlobalCoordinate &origin = *cit; │ │ │ │ │ - 785 ++cit; │ │ │ │ │ - 786 for( int i = 0; i < coorddimension; ++i ) │ │ │ │ │ - 787 y[ i ] = (add ? y[ i ] + rf*origin[ i ] : rf*origin[ i ]); │ │ │ │ │ - 788 } │ │ │ │ │ - 789 │ │ │ │ │ - 790 │ │ │ │ │ - 791 template< class ct, int mydim, int cdim, class Traits > │ │ │ │ │ - 792 template< bool add, int rows, int dim, class CornerIterator > │ │ │ │ │ - 793 inline void MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_> │ │ │ │ │ -794::jacobianTransposed ( TopologyId topologyId, std::integral_constant< int, │ │ │ │ │ -dim >, │ │ │ │ │ - 795 CornerIterator &cit, const ctype &df, const LocalCoordinate &x, │ │ │ │ │ - 796 const ctype &rf, FieldMatrix< ctype, rows, cdim > &jt ) │ │ │ │ │ - 797 { │ │ │ │ │ - 798 assert( rows >= dim ); │ │ │ │ │ - 799 │ │ │ │ │ - 800 const ctype xn = df*x[ dim-1 ]; │ │ │ │ │ - 801 const ctype cxn = ctype( 1 ) - xn; │ │ │ │ │ - 802 │ │ │ │ │ - 803 auto cit2( cit ); │ │ │ │ │ - 804 if( Impl::isPrism( toUnsignedInt(topologyId), mydimension, mydimension-dim │ │ │ │ │ -) ) │ │ │ │ │ - 805 { │ │ │ │ │ - 806 // apply (1-xn) times Jacobian for bottom │ │ │ │ │ - 807 jacobianTransposed< add >( topologyId, std::integral_constant< int, dim- │ │ │ │ │ -1 >(), cit2, df, x, rf*cxn, jt ); │ │ │ │ │ - 808 // apply xn times Jacobian for top │ │ │ │ │ - 809 jacobianTransposed< true >( topologyId, std::integral_constant< int, dim- │ │ │ │ │ -1 >(), cit2, df, x, rf*xn, jt ); │ │ │ │ │ - 810 // compute last row as difference between top value and bottom value │ │ │ │ │ - 811 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit, │ │ │ │ │ -df, x, -rf, jt[ dim-1 ] ); │ │ │ │ │ - 812 global< true >( topologyId, std::integral_constant< int, dim-1 >(), cit, │ │ │ │ │ -df, x, rf, jt[ dim-1 ] ); │ │ │ │ │ - 813 } │ │ │ │ │ - 814 else │ │ │ │ │ - 815 { │ │ │ │ │ - 816 assert( Impl::isPyramid( toUnsignedInt(topologyId), mydimension, │ │ │ │ │ -mydimension-dim ) ); │ │ │ │ │ - 817 /* │ │ │ │ │ - 818 * In the pyramid case, we need a transformation Tb: B -> R^n for the │ │ │ │ │ - 819 * base B \subset R^{n-1}. The pyramid transformation is then defined as │ │ │ │ │ - 820 * T: P \subset R^n -> R^n │ │ │ │ │ - 821 * (x, xn) |-> (1-xn) Tb(x*) + xn t (x \in R^{n-1}, xn \in R) │ │ │ │ │ - 822 * with the tip of the pyramid mapped to t and x* = x/(1-xn) │ │ │ │ │ - 823 * the projection of (x,xn) onto the base. │ │ │ │ │ - 824 * │ │ │ │ │ - 825 * For the Jacobi matrix DT we get │ │ │ │ │ - 826 * DT = ( A | b ) │ │ │ │ │ - 827 * with A = DTb(x*) (n x n-1 matrix) │ │ │ │ │ - 828 * and b = dT/dxn (n-dim column vector). │ │ │ │ │ - 829 * Furthermore │ │ │ │ │ - 830 * b = -Tb(x*) + t + \sum_i dTb/dx_i(x^*) x_i/(1-xn) │ │ │ │ │ - 831 * │ │ │ │ │ - 832 * Note that both A and b are not defined in the pyramid tip (x=0, xn=1)! │ │ │ │ │ - 833 * Indeed for B the unit square, Tb mapping B to the quadrilateral given │ │ │ │ │ - 834 * by the vertices (0,0,0), (2,0,0), (0,1,0), (1,1,0) and t=(0,0,1), we get │ │ │ │ │ - 835 * │ │ │ │ │ - 836 * T(x,y,xn) = ( x(2-y/(1-xn)), y, xn ) │ │ │ │ │ - 837 * / 2-y/(1-xn) -x 0 \ │ │ │ │ │ - 838 * DT(x,y,xn) = | 0 1 0 | │ │ │ │ │ - 839 * \ 0 0 1 / │ │ │ │ │ - 840 * which is not continuous for xn -> 1, choose for example │ │ │ │ │ - 841 * x=0, y=1-xn, xn -> 1 --> DT -> diag(1,1,1) │ │ │ │ │ - 842 * x=1-xn, y=0, xn -> 1 --> DT -> diag(2,1,1) │ │ │ │ │ - 843 * │ │ │ │ │ - 844 * However, for Tb affine-linear, Tb(y) = My + y0, DTb = M: │ │ │ │ │ - 845 * A = M │ │ │ │ │ - 846 * b = -M x* - y0 + t + \sum_i M_i x_i/(1-xn) │ │ │ │ │ - 847 * = -M x* - y0 + t + M x* │ │ │ │ │ - 848 * = -y0 + t │ │ │ │ │ - 849 * which is continuous for xn -> 1. Note that this b is also given by │ │ │ │ │ - 850 * b = -Tb(0) + t + \sum_i dTb/dx_i(0) x_i/1 │ │ │ │ │ - 851 * that is replacing x* by 1 and 1-xn by 1 in the formular above. │ │ │ │ │ - 852 * │ │ │ │ │ - 853 * For xn -> 1, we can thus set x*=0, "1-xn"=1 (or anything != 0) and get │ │ │ │ │ - 854 * the right result in case Tb is affine-linear. │ │ │ │ │ - 855 */ │ │ │ │ │ - 856 │ │ │ │ │ - 857 /* The second case effectively results in x* = 0 */ │ │ │ │ │ - 858 ctype dfcxn = (cxn > Traits::tolerance() || cxn < -Traits::tolerance()) ? │ │ │ │ │ -ctype(df / cxn) : ctype(0); │ │ │ │ │ - 859 │ │ │ │ │ - 860 // initialize last row │ │ │ │ │ - 861 // b = -Tb(x*) │ │ │ │ │ - 862 // (b = -Tb(0) = -y0 in case xn -> 1 and Tb affine-linear) │ │ │ │ │ - 863 global< add >( topologyId, std::integral_constant< int, dim-1 >(), cit, │ │ │ │ │ -dfcxn, x, -rf, jt[ dim-1 ] ); │ │ │ │ │ - 864 // b += t │ │ │ │ │ - 865 jt[ dim-1 ].axpy( rf, *cit ); │ │ │ │ │ - 866 ++cit; │ │ │ │ │ - 867 // apply Jacobian for bottom (with argument x/(1-xn)) and correct last row │ │ │ │ │ - 868 if( add ) │ │ │ │ │ - 869 { │ │ │ │ │ - 870 FieldMatrix< ctype, dim-1, coorddimension > jt2; │ │ │ │ │ - 871 // jt2 = dTb/dx_i(x*) │ │ │ │ │ - 872 jacobianTransposed< false >( topologyId, std::integral_constant< int, dim- │ │ │ │ │ -1 >(), cit2, dfcxn, x, rf, jt2 ); │ │ │ │ │ - 873 // A = dTb/dx_i(x*) (jt[j], j=0..dim-1) │ │ │ │ │ - 874 // b += \sum_i dTb/dx_i(x*) x_i/(1-xn) (jt[dim-1]) │ │ │ │ │ - 875 // (b += 0 in case xn -> 1) │ │ │ │ │ - 876 for( int j = 0; j < dim-1; ++j ) │ │ │ │ │ - 877 { │ │ │ │ │ - 878 jt[ j ] += jt2[ j ]; │ │ │ │ │ - 879 jt[ dim-1 ].axpy( dfcxn*x[ j ], jt2[ j ] ); │ │ │ │ │ - 880 } │ │ │ │ │ - 881 } │ │ │ │ │ - 882 else │ │ │ │ │ - 883 { │ │ │ │ │ - 884 // jt = dTb/dx_i(x*) │ │ │ │ │ - 885 jacobianTransposed< false >( topologyId, std::integral_constant< int, dim- │ │ │ │ │ -1 >(), cit2, dfcxn, x, rf, jt ); │ │ │ │ │ - 886 // b += \sum_i dTb/dx_i(x*) x_i/(1-xn) │ │ │ │ │ - 887 for( int j = 0; j < dim-1; ++j ) │ │ │ │ │ - 888 jt[ dim-1 ].axpy( dfcxn*x[ j ], jt[ j ] ); │ │ │ │ │ - 889 } │ │ │ │ │ - 890 } │ │ │ │ │ - 891 } │ │ │ │ │ - 892 │ │ │ │ │ - 893 template< class ct, int mydim, int cdim, class Traits > │ │ │ │ │ - 894 template< bool add, int rows, class CornerIterator > │ │ │ │ │ - 895 inline void MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_> │ │ │ │ │ -896::jacobianTransposed ( TopologyId, std::integral_constant< int, 0 >, │ │ │ │ │ - 897 CornerIterator &cit, const ctype &, const LocalCoordinate &, │ │ │ │ │ - 898 const ctype &, FieldMatrix< ctype, rows, cdim > & ) │ │ │ │ │ - 899 { │ │ │ │ │ - 900 ++cit; │ │ │ │ │ - 901 } │ │ │ │ │ - 902 │ │ │ │ │ - 903 │ │ │ │ │ - 904 │ │ │ │ │ - 905 template< class ct, int mydim, int cdim, class Traits > │ │ │ │ │ - 906 template< int dim, class CornerIterator > │ │ │ │ │ - 907 inline bool MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_> │ │ │ │ │ -908::affine ( TopologyId topologyId, std::integral_constant< int, dim >, │ │ │ │ │ -CornerIterator &cit, JacobianTransposed &jt ) │ │ │ │ │ - 909 { │ │ │ │ │ - 910 const GlobalCoordinate &orgBottom = *cit; │ │ │ │ │ - 911 if( !affine( topologyId, std::integral_constant< int, dim-1 >(), cit, jt ) │ │ │ │ │ -) │ │ │ │ │ - 912 return false; │ │ │ │ │ - 913 const GlobalCoordinate &orgTop = *cit; │ │ │ │ │ - 914 │ │ │ │ │ - 915 if( Impl::isPrism( toUnsignedInt(topologyId), mydimension, mydimension-dim │ │ │ │ │ -) ) │ │ │ │ │ - 916 { │ │ │ │ │ - 917 JacobianTransposed jtTop; │ │ │ │ │ - 918 if( !affine( topologyId, std::integral_constant< int, dim-1 >(), cit, │ │ │ │ │ -jtTop ) ) │ │ │ │ │ - 919 return false; │ │ │ │ │ - 920 │ │ │ │ │ - 921 // check whether both jacobians are identical │ │ │ │ │ - 922 ctype norm( 0 ); │ │ │ │ │ - 923 for( int i = 0; i < dim-1; ++i ) │ │ │ │ │ - 924 norm += (jtTop[ i ] - jt[ i ]).two_norm2(); │ │ │ │ │ - 925 if( norm >= Traits::tolerance() ) │ │ │ │ │ - 926 return false; │ │ │ │ │ - 927 } │ │ │ │ │ - 928 else │ │ │ │ │ - 929 ++cit; │ │ │ │ │ - 930 jt[ dim-1 ] = orgTop - orgBottom; │ │ │ │ │ - 931 return true; │ │ │ │ │ - 932 } │ │ │ │ │ - 933 │ │ │ │ │ - 934 template< class ct, int mydim, int cdim, class Traits > │ │ │ │ │ - 935 template< class CornerIterator > │ │ │ │ │ - 936 inline bool MultiLinearGeometry<_ct,_mydim,_cdim,_Traits_> │ │ │ │ │ -937::affine ( TopologyId, std::integral_constant< int, 0 >, CornerIterator │ │ │ │ │ -&cit, JacobianTransposed & ) │ │ │ │ │ - 938 { │ │ │ │ │ - 939 ++cit; │ │ │ │ │ - 940 return true; │ │ │ │ │ - 941 } │ │ │ │ │ - 942 │ │ │ │ │ - 943} // namespace Dune │ │ │ │ │ - 944 │ │ │ │ │ - 945#endif // #ifndef DUNE_GEOMETRY_MULTILINEARGEOMETRY_HH │ │ │ │ │ + 155 public: │ │ │ │ │ +156 const Index &dereference() const { │ │ │ │ │ + 157 return order->vertexOrder[order->refelem.subEntity(subEntity, codim, │ │ │ │ │ + 158 vertex, dim)]; │ │ │ │ │ + 159 } │ │ │ │ │ +160 const Index &elementAt(std::ptrdiff_t n) const { │ │ │ │ │ + 161 return order->vertexOrder[order->refelem.subEntity(subEntity, codim, │ │ │ │ │ + 162 vertex+n, dim)]; │ │ │ │ │ + 163 } │ │ │ │ │ +164 bool equals(const iterator &other) const { │ │ │ │ │ + 165 return order == other.order && codim == other.codim && │ │ │ │ │ + 166 subEntity == other.subEntity && vertex == other.vertex; │ │ │ │ │ + 167 } │ │ │ │ │ +168 void increment() { ++vertex; } │ │ │ │ │ +169 void decrement() { --vertex; } │ │ │ │ │ +170 void advance(std::ptrdiff_t n) { vertex += n; } │ │ │ │ │ +171 std::ptrdiff_t distanceTo(const iterator &other) const { │ │ │ │ │ + 172 // make sure we reference the same container │ │ │ │ │ + 173 assert(order == other.order && codim == other.codim && │ │ │ │ │ + 174 subEntity == other.subEntity); │ │ │ │ │ + 175 if(vertex < other.vertex) return other.vertex - vertex; │ │ │ │ │ + 176 else return -static_cast(vertex - other.vertex); │ │ │ │ │ + 177 } │ │ │ │ │ + 178 │ │ │ │ │ + 179 friend class GeneralVertexOrder; │ │ │ │ │ + 180 │ │ │ │ │ + 182 │ │ │ │ │ +187 iterator() { } │ │ │ │ │ + 188 }; │ │ │ │ │ + 189} // namespace Dune │ │ │ │ │ + 190 │ │ │ │ │ + 191#endif // DUNE_GEOMETRY_GENERALVERTEXORDER_HH │ │ │ │ │ referenceelements.hh │ │ │ │ │ -affinegeometry.hh │ │ │ │ │ -An implementation of the Geometry interface for affine geometries. │ │ │ │ │ type.hh │ │ │ │ │ A unique label for each type of element that can occur in a grid. │ │ │ │ │ Dune │ │ │ │ │ Definition affinegeometry.hh:21 │ │ │ │ │ +Dune::reduceOrder │ │ │ │ │ +void reduceOrder(const InIterator &inBegin, const InIterator &inEnd, │ │ │ │ │ +OutIterator outIt) │ │ │ │ │ +Algorithm to reduce vertex order information. │ │ │ │ │ +Definition generalvertexorder.hh:40 │ │ │ │ │ Dune::Geo::ReferenceElements │ │ │ │ │ Class providing access to the singletons of the reference elements. │ │ │ │ │ Definition referenceelements.hh:170 │ │ │ │ │ Dune::Geo::ReferenceElements::ReferenceElement │ │ │ │ │ typename Container::ReferenceElement ReferenceElement │ │ │ │ │ The reference element type. │ │ │ │ │ Definition referenceelements.hh:188 │ │ │ │ │ -Dune::MultiLinearGeometryTraits │ │ │ │ │ -default traits class for MultiLinearGeometry │ │ │ │ │ -Definition multilineargeometry.hh:39 │ │ │ │ │ -Dune::MultiLinearGeometryTraits::MatrixHelper │ │ │ │ │ -Impl::FieldMatrixHelper< ct > MatrixHelper │ │ │ │ │ -helper structure containing some matrix routines │ │ │ │ │ -Definition multilineargeometry.hh:58 │ │ │ │ │ -Dune::MultiLinearGeometryTraits::tolerance │ │ │ │ │ -static ct tolerance() │ │ │ │ │ -tolerance to numerical algorithms │ │ │ │ │ -Definition multilineargeometry.hh:61 │ │ │ │ │ -Dune::MultiLinearGeometryTraits::CornerStorage │ │ │ │ │ -template specifying the storage for the corners │ │ │ │ │ -Definition multilineargeometry.hh:129 │ │ │ │ │ -Dune::MultiLinearGeometryTraits::CornerStorage::Type │ │ │ │ │ -std::vector< FieldVector< ct, cdim > > Type │ │ │ │ │ -Definition multilineargeometry.hh:130 │ │ │ │ │ -Dune::MultiLinearGeometryTraits::hasSingleGeometryType │ │ │ │ │ -will there be only one geometry type for a dimension? │ │ │ │ │ -Definition multilineargeometry.hh:148 │ │ │ │ │ -Dune::MultiLinearGeometryTraits::hasSingleGeometryType::topologyId │ │ │ │ │ -static const unsigned int topologyId │ │ │ │ │ -Definition multilineargeometry.hh:150 │ │ │ │ │ -Dune::MultiLinearGeometryTraits::hasSingleGeometryType::v │ │ │ │ │ -static const bool v │ │ │ │ │ -Definition multilineargeometry.hh:149 │ │ │ │ │ -Dune::MultiLinearGeometry │ │ │ │ │ -generic geometry implementation based on corner coordinates │ │ │ │ │ -Definition multilineargeometry.hh:181 │ │ │ │ │ -Dune::MultiLinearGeometry::global │ │ │ │ │ -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 │ │ │ │ │ -Dune::MultiLinearGeometry::mydimension │ │ │ │ │ -static const int mydimension │ │ │ │ │ -geometry dimension │ │ │ │ │ -Definition multilineargeometry.hh:189 │ │ │ │ │ -Dune::MultiLinearGeometry::type │ │ │ │ │ -Dune::GeometryType type() const │ │ │ │ │ -obtain the name of the reference element │ │ │ │ │ -Definition multilineargeometry.hh:269 │ │ │ │ │ -Dune::MultiLinearGeometry::MatrixHelper │ │ │ │ │ -Traits::MatrixHelper MatrixHelper │ │ │ │ │ -Definition multilineargeometry.hh:225 │ │ │ │ │ -Dune::MultiLinearGeometry::GlobalCoordinate │ │ │ │ │ -FieldVector< ctype, coorddimension > GlobalCoordinate │ │ │ │ │ -type of global coordinates │ │ │ │ │ -Definition multilineargeometry.hh:196 │ │ │ │ │ -Dune::MultiLinearGeometry::jacobianTransposed │ │ │ │ │ -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 │ │ │ │ │ -Dune::MultiLinearGeometry::jacobianTransposed │ │ │ │ │ -JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const │ │ │ │ │ -obtain the transposed of the Jacobian │ │ │ │ │ -Definition multilineargeometry.hh:377 │ │ │ │ │ -Dune::MultiLinearGeometry::refElement │ │ │ │ │ -ReferenceElement refElement() const │ │ │ │ │ -Definition multilineargeometry.hh:425 │ │ │ │ │ -Dune::MultiLinearGeometry::global │ │ │ │ │ -GlobalCoordinate global(const LocalCoordinate &local) const │ │ │ │ │ -evaluate the mapping │ │ │ │ │ -Definition multilineargeometry.hh:290 │ │ │ │ │ -Dune::MultiLinearGeometry::center │ │ │ │ │ -GlobalCoordinate center() const │ │ │ │ │ -obtain the centroid of the mapping's image │ │ │ │ │ -Definition multilineargeometry.hh:282 │ │ │ │ │ -Dune::MultiLinearGeometry::corner │ │ │ │ │ -GlobalCoordinate corner(int i) const │ │ │ │ │ -obtain coordinates of the i-th corner │ │ │ │ │ -Definition multilineargeometry.hh:275 │ │ │ │ │ -Dune::MultiLinearGeometry::ReferenceElements │ │ │ │ │ -Dune::ReferenceElements< ctype, mydimension > ReferenceElements │ │ │ │ │ -Definition multilineargeometry.hh:214 │ │ │ │ │ -Dune::MultiLinearGeometry::ctype │ │ │ │ │ -ct ctype │ │ │ │ │ -coordinate type │ │ │ │ │ -Definition multilineargeometry.hh:186 │ │ │ │ │ -Dune::MultiLinearGeometry::jacobianTransposed │ │ │ │ │ -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 │ │ │ │ │ -Dune::MultiLinearGeometry::coorddimension │ │ │ │ │ -static const int coorddimension │ │ │ │ │ -coordinate dimension │ │ │ │ │ -Definition multilineargeometry.hh:191 │ │ │ │ │ -Dune::MultiLinearGeometry::corners │ │ │ │ │ -int corners() const │ │ │ │ │ -obtain number of corners of the corresponding reference element │ │ │ │ │ -Definition multilineargeometry.hh:272 │ │ │ │ │ -Dune::MultiLinearGeometry::topologyId │ │ │ │ │ -TopologyId topologyId() const │ │ │ │ │ -Definition multilineargeometry.hh:430 │ │ │ │ │ -Dune::MultiLinearGeometry::referenceElement │ │ │ │ │ -friend ReferenceElement referenceElement(const MultiLinearGeometry &geometry) │ │ │ │ │ -Definition multilineargeometry.hh:395 │ │ │ │ │ -Dune::MultiLinearGeometry::local │ │ │ │ │ -LocalCoordinate local(const GlobalCoordinate &globalCoord) const │ │ │ │ │ -evaluate the inverse mapping │ │ │ │ │ -Definition multilineargeometry.hh:312 │ │ │ │ │ -Dune::MultiLinearGeometry::global │ │ │ │ │ -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 │ │ │ │ │ -Dune::MultiLinearGeometry::volume │ │ │ │ │ -Volume volume() const │ │ │ │ │ -obtain the volume of the mapping's image │ │ │ │ │ -Definition multilineargeometry.hh:363 │ │ │ │ │ -Dune::MultiLinearGeometry::LocalCoordinate │ │ │ │ │ -FieldVector< ctype, mydimension > LocalCoordinate │ │ │ │ │ -type of local coordinates │ │ │ │ │ -Definition multilineargeometry.hh:194 │ │ │ │ │ -Dune::MultiLinearGeometry::MultiLinearGeometry │ │ │ │ │ -MultiLinearGeometry(const ReferenceElement &refElement, const Corners &corners) │ │ │ │ │ -constructor │ │ │ │ │ -Definition multilineargeometry.hh:239 │ │ │ │ │ -Dune::MultiLinearGeometry::affine │ │ │ │ │ -static bool affine(TopologyId topologyId, std::integral_constant< int, 0 >, │ │ │ │ │ -CornerIterator &cit, JacobianTransposed &jt) │ │ │ │ │ -Definition multilineargeometry.hh:937 │ │ │ │ │ -Dune::MultiLinearGeometry::TopologyId │ │ │ │ │ -std::conditional< hasSingleGeometryType, std::integral_constant< unsignedint, │ │ │ │ │ -Traits::templatehasSingleGeometryType< mydimension >::topologyId >, unsignedint │ │ │ │ │ ->::type TopologyId │ │ │ │ │ -Definition multilineargeometry.hh:226 │ │ │ │ │ -Dune::MultiLinearGeometry::Volume │ │ │ │ │ -ctype Volume │ │ │ │ │ -type of volume │ │ │ │ │ -Definition multilineargeometry.hh:198 │ │ │ │ │ -Dune::MultiLinearGeometry::affine │ │ │ │ │ -static bool affine(TopologyId topologyId, std::integral_constant< int, dim >, │ │ │ │ │ -CornerIterator &cit, JacobianTransposed &jt) │ │ │ │ │ -Definition multilineargeometry.hh:908 │ │ │ │ │ -Dune::MultiLinearGeometry::jacobianInverse │ │ │ │ │ -JacobianInverse jacobianInverse(const LocalCoordinate &local) const │ │ │ │ │ -Obtain the Jacobian's inverse. │ │ │ │ │ -Definition multilineargeometry.hh:418 │ │ │ │ │ -Dune::MultiLinearGeometry::MultiLinearGeometry │ │ │ │ │ -MultiLinearGeometry(Dune::GeometryType gt, const Corners &corners) │ │ │ │ │ -constructor │ │ │ │ │ -Definition multilineargeometry.hh:255 │ │ │ │ │ -Dune::MultiLinearGeometry::JacobianTransposed │ │ │ │ │ -FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed │ │ │ │ │ -type of jacobian transposed │ │ │ │ │ -Definition multilineargeometry.hh:201 │ │ │ │ │ -Dune::MultiLinearGeometry::ReferenceElement │ │ │ │ │ -ReferenceElements::ReferenceElement ReferenceElement │ │ │ │ │ -type of reference element │ │ │ │ │ -Definition multilineargeometry.hh:219 │ │ │ │ │ -Dune::MultiLinearGeometry::jacobianInverseTransposed │ │ │ │ │ -JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate │ │ │ │ │ -&local) const │ │ │ │ │ -obtain the transposed of the Jacobian's inverse │ │ │ │ │ -Definition multilineargeometry.hh:738 │ │ │ │ │ -Dune::MultiLinearGeometry::Jacobian │ │ │ │ │ -FieldMatrix< ctype, coorddimension, mydimension > Jacobian │ │ │ │ │ -Type for the Jacobian matrix. │ │ │ │ │ -Definition multilineargeometry.hh:207 │ │ │ │ │ -Dune::MultiLinearGeometry::affine │ │ │ │ │ -bool affine() const │ │ │ │ │ -is this mapping affine? │ │ │ │ │ -Definition multilineargeometry.hh:262 │ │ │ │ │ -Dune::MultiLinearGeometry::JacobianInverse │ │ │ │ │ -FieldMatrix< ctype, mydimension, coorddimension > JacobianInverse │ │ │ │ │ -Type for the inverse Jacobian matrix. │ │ │ │ │ -Definition multilineargeometry.hh:210 │ │ │ │ │ -Dune::MultiLinearGeometry::affine │ │ │ │ │ -bool affine(JacobianTransposed &jacobianT) const │ │ │ │ │ -Definition multilineargeometry.hh:458 │ │ │ │ │ -Dune::MultiLinearGeometry::integrationElement │ │ │ │ │ -Volume integrationElement(const LocalCoordinate &local) const │ │ │ │ │ -obtain the integration element │ │ │ │ │ -Definition multilineargeometry.hh:350 │ │ │ │ │ -Dune::MultiLinearGeometry::jacobian │ │ │ │ │ -Jacobian jacobian(const LocalCoordinate &local) const │ │ │ │ │ -Obtain the Jacobian. │ │ │ │ │ -Definition multilineargeometry.hh:407 │ │ │ │ │ -Dune::MultiLinearGeometry::JacobianInverseTransposed │ │ │ │ │ -Definition multilineargeometry.hh:488 │ │ │ │ │ -Dune::MultiLinearGeometry::JacobianInverseTransposed::setup │ │ │ │ │ -void setup(const JacobianTransposed &jt) │ │ │ │ │ -Definition multilineargeometry.hh:492 │ │ │ │ │ -Dune::MultiLinearGeometry::JacobianInverseTransposed::det │ │ │ │ │ -ctype det() const │ │ │ │ │ -Definition multilineargeometry.hh:502 │ │ │ │ │ -Dune::MultiLinearGeometry::JacobianInverseTransposed::detInv │ │ │ │ │ -ctype detInv() const │ │ │ │ │ -Definition multilineargeometry.hh:503 │ │ │ │ │ -Dune::MultiLinearGeometry::JacobianInverseTransposed::setupDeterminant │ │ │ │ │ -void setupDeterminant(const JacobianTransposed &jt) │ │ │ │ │ -Definition multilineargeometry.hh:497 │ │ │ │ │ -Dune::CachedMultiLinearGeometry │ │ │ │ │ -Implement a MultiLinearGeometry with additional caching. │ │ │ │ │ -Definition multilineargeometry.hh:526 │ │ │ │ │ -Dune::CachedMultiLinearGeometry::global │ │ │ │ │ -GlobalCoordinate global(const LocalCoordinate &local) const │ │ │ │ │ -evaluate the mapping │ │ │ │ │ -Definition multilineargeometry.hh:580 │ │ │ │ │ -Dune::CachedMultiLinearGeometry::ReferenceElement │ │ │ │ │ -Base::ReferenceElement ReferenceElement │ │ │ │ │ -Definition multilineargeometry.hh:534 │ │ │ │ │ -Dune::CachedMultiLinearGeometry::affine │ │ │ │ │ -bool affine() const │ │ │ │ │ -is this mapping affine? │ │ │ │ │ -Definition multilineargeometry.hh:567 │ │ │ │ │ -Dune::CachedMultiLinearGeometry::CachedMultiLinearGeometry │ │ │ │ │ -CachedMultiLinearGeometry(const ReferenceElement &referenceElement, const │ │ │ │ │ -CornerStorage &cornerStorage) │ │ │ │ │ -Definition multilineargeometry.hh:551 │ │ │ │ │ -Dune::CachedMultiLinearGeometry::refElement │ │ │ │ │ -ReferenceElement refElement() const │ │ │ │ │ -Definition multilineargeometry.hh:425 │ │ │ │ │ -Dune::CachedMultiLinearGeometry::local │ │ │ │ │ -LocalCoordinate local(const GlobalCoordinate &global) const │ │ │ │ │ -evaluate the inverse mapping │ │ │ │ │ -Definition multilineargeometry.hh:604 │ │ │ │ │ -Dune::CachedMultiLinearGeometry::MatrixHelper │ │ │ │ │ -Base::MatrixHelper MatrixHelper │ │ │ │ │ -Definition multilineargeometry.hh:531 │ │ │ │ │ -Dune::CachedMultiLinearGeometry::LocalCoordinate │ │ │ │ │ -Base::LocalCoordinate LocalCoordinate │ │ │ │ │ -Definition multilineargeometry.hh:541 │ │ │ │ │ -Dune::CachedMultiLinearGeometry::jacobianInverse │ │ │ │ │ -JacobianInverse jacobianInverse(const LocalCoordinate &local) const │ │ │ │ │ -Obtain the Jacobian's inverse. │ │ │ │ │ -Definition multilineargeometry.hh:713 │ │ │ │ │ -Dune::CachedMultiLinearGeometry::jacobianTransposed │ │ │ │ │ -JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const │ │ │ │ │ -obtain the transposed of the Jacobian │ │ │ │ │ -Definition multilineargeometry.hh:666 │ │ │ │ │ -Dune::CachedMultiLinearGeometry::corner │ │ │ │ │ -GlobalCoordinate corner(int i) const │ │ │ │ │ -obtain coordinates of the i-th corner │ │ │ │ │ -Definition multilineargeometry.hh:275 │ │ │ │ │ -Dune::CachedMultiLinearGeometry::volume │ │ │ │ │ -Volume volume() const │ │ │ │ │ -obtain the volume of the mapping's image │ │ │ │ │ -Definition multilineargeometry.hh:649 │ │ │ │ │ -Dune::CachedMultiLinearGeometry::CachedMultiLinearGeometry │ │ │ │ │ -CachedMultiLinearGeometry(Dune::GeometryType gt, const CornerStorage │ │ │ │ │ -&cornerStorage) │ │ │ │ │ -Definition multilineargeometry.hh:559 │ │ │ │ │ -Dune::CachedMultiLinearGeometry::integrationElement │ │ │ │ │ -ctype integrationElement(const LocalCoordinate &local) const │ │ │ │ │ -obtain the integration element │ │ │ │ │ -Definition multilineargeometry.hh:633 │ │ │ │ │ -Dune::CachedMultiLinearGeometry::ctype │ │ │ │ │ -Base::ctype ctype │ │ │ │ │ -Definition multilineargeometry.hh:536 │ │ │ │ │ -Dune::CachedMultiLinearGeometry::jacobian │ │ │ │ │ -Jacobian jacobian(const LocalCoordinate &local) const │ │ │ │ │ -Obtain the Jacobian. │ │ │ │ │ -Definition multilineargeometry.hh:702 │ │ │ │ │ -Dune::CachedMultiLinearGeometry::JacobianInverseTransposed │ │ │ │ │ -Base::JacobianInverseTransposed JacobianInverseTransposed │ │ │ │ │ -Definition multilineargeometry.hh:546 │ │ │ │ │ -Dune::CachedMultiLinearGeometry::JacobianTransposed │ │ │ │ │ -Base::JacobianTransposed JacobianTransposed │ │ │ │ │ -Definition multilineargeometry.hh:545 │ │ │ │ │ -Dune::CachedMultiLinearGeometry::JacobianInverse │ │ │ │ │ -Base::JacobianInverse JacobianInverse │ │ │ │ │ -Definition multilineargeometry.hh:548 │ │ │ │ │ -Dune::CachedMultiLinearGeometry::Jacobian │ │ │ │ │ -Base::Jacobian Jacobian │ │ │ │ │ -Definition multilineargeometry.hh:547 │ │ │ │ │ -Dune::CachedMultiLinearGeometry::Volume │ │ │ │ │ -Base::Volume Volume │ │ │ │ │ -Definition multilineargeometry.hh:543 │ │ │ │ │ -Dune::CachedMultiLinearGeometry::GlobalCoordinate │ │ │ │ │ -Base::GlobalCoordinate GlobalCoordinate │ │ │ │ │ -Definition multilineargeometry.hh:542 │ │ │ │ │ -Dune::CachedMultiLinearGeometry::center │ │ │ │ │ -GlobalCoordinate center() const │ │ │ │ │ -obtain the centroid of the mapping's image │ │ │ │ │ -Definition multilineargeometry.hh:572 │ │ │ │ │ -Dune::CachedMultiLinearGeometry::jacobianInverseTransposed │ │ │ │ │ -JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate │ │ │ │ │ -&local) const │ │ │ │ │ -obtain the transposed of the Jacobian's inverse │ │ │ │ │ -Definition multilineargeometry.hh:680 │ │ │ │ │ +Dune::GeneralVertexOrder │ │ │ │ │ +Class providing information on the ordering of vertices. │ │ │ │ │ +Definition generalvertexorder.hh:67 │ │ │ │ │ +Dune::GeneralVertexOrder::Index │ │ │ │ │ +Index_ Index │ │ │ │ │ +Type of indices. │ │ │ │ │ +Definition generalvertexorder.hh:77 │ │ │ │ │ +Dune::GeneralVertexOrder::type │ │ │ │ │ +const GeometryType & type() const │ │ │ │ │ +get type of the entity's geometry │ │ │ │ │ +Definition generalvertexorder.hh:85 │ │ │ │ │ +Dune::GeneralVertexOrder::dimension │ │ │ │ │ +static const std::size_t dimension │ │ │ │ │ +export the dimension of the entity we provide information for │ │ │ │ │ +Definition generalvertexorder.hh:83 │ │ │ │ │ +Dune::GeneralVertexOrder::getReduced │ │ │ │ │ +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 │ │ │ │ │ +Dune::GeneralVertexOrder::end │ │ │ │ │ +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 │ │ │ │ │ +Dune::GeneralVertexOrder::GeneralVertexOrder │ │ │ │ │ +GeneralVertexOrder(const GeometryType >_, const InIterator &inBegin, const │ │ │ │ │ +InIterator &inEnd) │ │ │ │ │ +construct a GeneralVertexOrder │ │ │ │ │ +Definition generalvertexorder.hh:97 │ │ │ │ │ +Dune::GeneralVertexOrder::begin │ │ │ │ │ +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 │ │ │ │ │ +Dune::GeneralVertexOrder::iterator │ │ │ │ │ +Iterate over the vertex indices of some sub-entity. │ │ │ │ │ +Definition generalvertexorder.hh:144 │ │ │ │ │ +Dune::GeneralVertexOrder::iterator::iterator │ │ │ │ │ +iterator() │ │ │ │ │ +public default constructor │ │ │ │ │ +Definition generalvertexorder.hh:187 │ │ │ │ │ +Dune::GeneralVertexOrder::iterator::decrement │ │ │ │ │ +void decrement() │ │ │ │ │ +Definition generalvertexorder.hh:169 │ │ │ │ │ +Dune::GeneralVertexOrder::iterator::advance │ │ │ │ │ +void advance(std::ptrdiff_t n) │ │ │ │ │ +Definition generalvertexorder.hh:170 │ │ │ │ │ +Dune::GeneralVertexOrder::iterator::dereference │ │ │ │ │ +const Index & dereference() const │ │ │ │ │ +Definition generalvertexorder.hh:156 │ │ │ │ │ +Dune::GeneralVertexOrder::iterator::increment │ │ │ │ │ +void increment() │ │ │ │ │ +Definition generalvertexorder.hh:168 │ │ │ │ │ +Dune::GeneralVertexOrder::iterator::equals │ │ │ │ │ +bool equals(const iterator &other) const │ │ │ │ │ +Definition generalvertexorder.hh:164 │ │ │ │ │ +Dune::GeneralVertexOrder::iterator::distanceTo │ │ │ │ │ +std::ptrdiff_t distanceTo(const iterator &other) const │ │ │ │ │ +Definition generalvertexorder.hh:171 │ │ │ │ │ +Dune::GeneralVertexOrder::iterator::elementAt │ │ │ │ │ +const Index & elementAt(std::ptrdiff_t n) const │ │ │ │ │ +Definition generalvertexorder.hh:160 │ │ │ │ │ Dune::GeometryType │ │ │ │ │ Unique label for each type of entities that can occur in DUNE grids. │ │ │ │ │ Definition type.hh:126 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00197.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: dimension.hh File Reference │ │ │ │ +dune-geometry: virtualrefinement.cc File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -71,36 +71,96 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
dimension.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Macros | │ │ │ │ +Functions
│ │ │ │ +
virtualrefinement.cc File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <type_traits>
│ │ │ │ + │ │ │ │ +

This file contains the virtual wrapper around refinement. │ │ │ │ +More...

│ │ │ │ +
#include <cassert>
│ │ │ │ +#include <typeinfo>
│ │ │ │ +#include <dune/common/exceptions.hh>
│ │ │ │ +#include <dune/common/fvector.hh>
│ │ │ │ +#include <dune/common/iteratorfacades.hh>
│ │ │ │ +#include "type.hh"
│ │ │ │ +#include "refinement.hh"
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

struct  Dune::Dim< dim >
 Static tag representing a dimension. 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 >
 
struct  Dune::Codim< codim >
 Static tag representing a codimension. 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 >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ │ Namespaces

namespace  Dune
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Macros

#define DUNE_GEOMETRY_VIRTUALREFINEMENT_CC
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

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

Detailed Description

│ │ │ │ +

This file contains the virtual wrapper around refinement.

│ │ │ │ +

Macro Definition Documentation

│ │ │ │ + │ │ │ │ +

◆ DUNE_GEOMETRY_VIRTUALREFINEMENT_CC

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

This file contains the virtual wrapper around refinement. │ │ │ │ +

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

│ │ │ │ -
#include <vector>
│ │ │ │ -#include <dune/common/fvector.hh>
│ │ │ │ -#include "refinement.hh"
│ │ │ │ -#include "type.hh"
│ │ │ │ -#include "virtualrefinement.cc"
│ │ │ │ +
#include "refinement/base.cc"
│ │ │ │ +#include "refinement/hcube.cc"
│ │ │ │ +#include "refinement/simplex.cc"
│ │ │ │ +#include "refinement/hcubetriangulation.cc"
│ │ │ │ +#include "refinement/prismtriangulation.cc"
│ │ │ │ +#include "refinement/pyramidtriangulation.cc"
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ -Classes

class  Dune::VirtualRefinement< dimension, CoordType >
 VirtualRefinement base class. More...
 
struct  Dune::VirtualRefinement< dimension, CoordType >::Codim< codimension >
 codim database of VirtualRefinement More...
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Namespaces

namespace  Dune
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

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

Detailed Description

│ │ │ │ -

This file contains the virtual wrapper around refinement.

│ │ │ │ +

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

│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -6,39 +6,23 @@ │ │ │ │ │ dune-geometry 2.9.0 │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ -Classes | Namespaces | Functions │ │ │ │ │ -virtualrefinement.hh File Reference │ │ │ │ │ -This file contains the virtual wrapper around refinement. More... │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include "refinement.hh" │ │ │ │ │ -#include "type.hh" │ │ │ │ │ -#include "virtualrefinement.cc" │ │ │ │ │ +refinement.hh File Reference │ │ │ │ │ +This file simply includes all Refinement implementations so you don't have to │ │ │ │ │ +do them separately. More... │ │ │ │ │ +#include "refinement/base.cc" │ │ │ │ │ +#include "refinement/hcube.cc" │ │ │ │ │ +#include "refinement/simplex.cc" │ │ │ │ │ +#include "refinement/hcubetriangulation.cc" │ │ │ │ │ +#include "refinement/prismtriangulation.cc" │ │ │ │ │ +#include "refinement/pyramidtriangulation.cc" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ - Classes │ │ │ │ │ - class  Dune::VirtualRefinement<_dimension,_CoordType_> │ │ │ │ │ -  VirtualRefinement base class. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::VirtualRefinement<_dimension,_CoordType_>::Codim<_codimension_> │ │ │ │ │ -  codim database of VirtualRefinement More... │ │ │ │ │ -  │ │ │ │ │ - Namespaces │ │ │ │ │ -namespace  Dune │ │ │ │ │ -  │ │ │ │ │ - Functions │ │ │ │ │ -template │ │ │ │ │ -VirtualRefinement< dimension, CoordType > Dune::buildRefinement (GeometryType │ │ │ │ │ - & geometryType, GeometryType coerceTo) │ │ │ │ │ - return a reference to the │ │ │ │ │ -  VirtualRefinement according to the │ │ │ │ │ - parameters │ │ │ │ │ -  │ │ │ │ │ ***** Detailed Description ***** │ │ │ │ │ -This file contains the virtual wrapper around refinement. │ │ │ │ │ +This file simply includes all Refinement implementations so you don't have to │ │ │ │ │ +do them separately. │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00200_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: virtualrefinement.hh Source File │ │ │ │ +dune-geometry: refinement.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,135 +74,42 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
virtualrefinement.hh
│ │ │ │ +
refinement.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
│ │ │ │ -
5#ifndef DUNE_GEOMETRY_VIRTUALREFINEMENT_HH
│ │ │ │ -
6#define DUNE_GEOMETRY_VIRTUALREFINEMENT_HH
│ │ │ │ +
5#ifndef DUNE_GEOMETRY_REFINEMENT_HH
│ │ │ │ +
6#define DUNE_GEOMETRY_REFINEMENT_HH
│ │ │ │
7
│ │ │ │ -
268#include <vector>
│ │ │ │ -
269
│ │ │ │ -
270#include <dune/common/fvector.hh>
│ │ │ │ -
271
│ │ │ │ -
272#include "refinement.hh"
│ │ │ │ -
273#include "type.hh"
│ │ │ │ -
274
│ │ │ │ -
275namespace Dune
│ │ │ │ -
276{
│ │ │ │ -
277 // //////////////////////////////////////////
│ │ │ │ -
278 //
│ │ │ │ -
279 // The virtual base class and its iterators
│ │ │ │ -
280 //
│ │ │ │ -
281
│ │ │ │ -
282 //
│ │ │ │ -
283 // Refinement
│ │ │ │ -
284 //
│ │ │ │ -
285
│ │ │ │ -
292 template<int dimension, class CoordType>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
294 {
│ │ │ │ -
295 public:
│ │ │ │ -
296 template<int codimension>
│ │ │ │ -
297 struct Codim;
│ │ │ │ - │ │ │ │ - │ │ │ │ -
302
│ │ │ │ -
308 typedef FieldVector<CoordType, dimension> CoordVector;
│ │ │ │ -
314 typedef std::vector<int> IndexVector;
│ │ │ │ -
315
│ │ │ │ -
316 template<int codimension>
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
320
│ │ │ │ -
326 virtual int nVertices(Dune::RefinementIntervals tag) const = 0;
│ │ │ │ -
327
│ │ │ │ - │ │ │ │ -
334
│ │ │ │ - │ │ │ │ -
341
│ │ │ │ -
347 virtual int nElements(Dune::RefinementIntervals tag) const = 0;
│ │ │ │ -
348
│ │ │ │ - │ │ │ │ -
355
│ │ │ │ - │ │ │ │ -
362
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
365 {}
│ │ │ │ -
│ │ │ │ -
366
│ │ │ │ -
367 protected:
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
372 };
│ │ │ │ -
│ │ │ │ -
373
│ │ │ │ -
375 template<int dimension, class CoordType>
│ │ │ │ -
376 template<int codimension>
│ │ │ │ -
│ │ │ │ -
377 struct VirtualRefinement<dimension, CoordType>::Codim
│ │ │ │ -
378 {
│ │ │ │ -
379 class SubEntityIterator;
│ │ │ │ -
380 };
│ │ │ │ -
│ │ │ │ -
381
│ │ │ │ -
382 // ////////////////////////
│ │ │ │ -
383 //
│ │ │ │ -
384 // The refinement builder
│ │ │ │ -
385 //
│ │ │ │ -
386
│ │ │ │ -
387 template<int dimension, class CoordType>
│ │ │ │ - │ │ │ │ -
389 buildRefinement(GeometryType geometryType, GeometryType coerceTo);
│ │ │ │ -
390
│ │ │ │ -
391} // namespace Dune
│ │ │ │ -
392
│ │ │ │ -
393#include "virtualrefinement.cc"
│ │ │ │ -
394
│ │ │ │ -
395#endif // DUNE_GEOMETRY_VIRTUALREFINEMENT_HH
│ │ │ │ -
This file contains the virtual wrapper around refinement.
│ │ │ │ -
This file simply includes all Refinement implementations so you don't have to do them separately.
│ │ │ │ -
A unique label for each type of element that can occur in a grid.
│ │ │ │ -
Definition affinegeometry.hh:21
│ │ │ │ -
VirtualRefinement< dimension, CoordType > & buildRefinement(GeometryType geometryType, GeometryType coerceTo)
return a reference to the VirtualRefinement according to the parameters
Definition virtualrefinement.cc:503
│ │ │ │ -
Holds the number of refined intervals per axis needed for virtual and static refinement.
Definition base.cc:94
│ │ │ │ -
Unique label for each type of entities that can occur in DUNE grids.
Definition type.hh:126
│ │ │ │ -
Definition virtualrefinement.cc:231
│ │ │ │ -
VirtualRefinement base class.
Definition virtualrefinement.hh:294
│ │ │ │ -
SubEntityIteratorBack< dimension > VertexIteratorBack
Definition virtualrefinement.hh:318
│ │ │ │ -
virtual ElementIteratorBack * eEndBack(Dune::RefinementIntervals tag) const =0
│ │ │ │ -
VertexIterator vBegin(Dune::RefinementIntervals tag) const
Get an VertexIterator.
Definition virtualrefinement.cc:38
│ │ │ │ -
ElementIterator eBegin(Dune::RefinementIntervals tag) const
Get an ElementIterator.
Definition virtualrefinement.cc:54
│ │ │ │ -
virtual int nElements(Dune::RefinementIntervals tag) const =0
Get the number of Elements.
│ │ │ │ -
ElementIterator eEnd(Dune::RefinementIntervals tag) const
Get an ElementIterator.
Definition virtualrefinement.cc:62
│ │ │ │ -
Codim< 0 >::SubEntityIterator ElementIterator
The ElementIterator of the VirtualRefinement.
Definition virtualrefinement.hh:301
│ │ │ │ -
virtual ~VirtualRefinement()
Destructor.
Definition virtualrefinement.hh:364
│ │ │ │ -
VertexIterator vEnd(Dune::RefinementIntervals tag) const
Get an VertexIterator.
Definition virtualrefinement.cc:46
│ │ │ │ -
FieldVector< CoordType, dimension > CoordVector
The CoordVector of the VirtualRefinement.
Definition virtualrefinement.hh:308
│ │ │ │ -
virtual int nVertices(Dune::RefinementIntervals tag) const =0
Get the number of Vertices.
│ │ │ │ -
std::vector< int > IndexVector
The IndexVector of the VirtualRefinement.
Definition virtualrefinement.hh:314
│ │ │ │ -
Codim< dimension >::SubEntityIterator VertexIterator
The VertexIterator of the VirtualRefinement.
Definition virtualrefinement.hh:299
│ │ │ │ -
virtual VertexIteratorBack * vEndBack(Dune::RefinementIntervals tag) const =0
│ │ │ │ -
SubEntityIteratorBack< 0 > ElementIteratorBack
Definition virtualrefinement.hh:319
│ │ │ │ -
virtual ElementIteratorBack * eBeginBack(Dune::RefinementIntervals tag) const =0
│ │ │ │ -
virtual VertexIteratorBack * vBeginBack(Dune::RefinementIntervals tag) const =0
│ │ │ │ -
codim database of VirtualRefinement
Definition virtualrefinement.hh:378
│ │ │ │ +
250// The interface (template<...> class StaticRefinement) is not included here
│ │ │ │ +
251// since it derives from parts which I consider implementation. Look
│ │ │ │ +
252// into refinement/base.cc if the documentation is above is not enough.
│ │ │ │ +
253#include "refinement/base.cc"
│ │ │ │ +
254
│ │ │ │ +
255#include "refinement/hcube.cc"
│ │ │ │ +
256#include "refinement/simplex.cc"
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
260
│ │ │ │ +
261#endif // DUNE_GEOMETRY_REFINEMENT_HH
│ │ │ │ +
This file contains the parts independent of a particular Refinement implementation.
│ │ │ │ + │ │ │ │ + │ │ │ │ +
This file contains the Refinement implementation for hypercubes (quadrilaterals, hexahedrons,...
│ │ │ │ +
This file contains the Refinement implementation for simplices (triangles, tetrahedrons....
│ │ │ │ +
This file contains the Refinement implementation for triangulating hypercubes (quadrilateral -> trian...
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -7,188 +7,47 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ -virtualrefinement.hh │ │ │ │ │ +refinement.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception │ │ │ │ │ - 5#ifndef DUNE_GEOMETRY_VIRTUALREFINEMENT_HH │ │ │ │ │ - 6#define DUNE_GEOMETRY_VIRTUALREFINEMENT_HH │ │ │ │ │ + 5#ifndef DUNE_GEOMETRY_REFINEMENT_HH │ │ │ │ │ + 6#define DUNE_GEOMETRY_REFINEMENT_HH │ │ │ │ │ 7 │ │ │ │ │ - 268#include │ │ │ │ │ - 269 │ │ │ │ │ - 270#include │ │ │ │ │ - 271 │ │ │ │ │ - 272#include "refinement.hh" │ │ │ │ │ - 273#include "type.hh" │ │ │ │ │ - 274 │ │ │ │ │ - 275namespace Dune │ │ │ │ │ - 276{ │ │ │ │ │ - 277 // ////////////////////////////////////////// │ │ │ │ │ - 278 // │ │ │ │ │ - 279 // The virtual base class and its iterators │ │ │ │ │ - 280 // │ │ │ │ │ - 281 │ │ │ │ │ - 282 // │ │ │ │ │ - 283 // Refinement │ │ │ │ │ - 284 // │ │ │ │ │ - 285 │ │ │ │ │ - 292 template │ │ │ │ │ -293 class VirtualRefinement │ │ │ │ │ - 294 { │ │ │ │ │ - 295 public: │ │ │ │ │ - 296 template │ │ │ │ │ - 297 struct Codim; │ │ │ │ │ -299 typedef typename Codim::SubEntityIterator VertexIterator; │ │ │ │ │ -301 typedef typename Codim<0>::SubEntityIterator ElementIterator; │ │ │ │ │ - 302 │ │ │ │ │ -308 typedef FieldVector CoordVector; │ │ │ │ │ -314 typedef std::vector IndexVector; │ │ │ │ │ - 315 │ │ │ │ │ - 316 template │ │ │ │ │ - 317 class SubEntityIteratorBack; │ │ │ │ │ -318 typedef SubEntityIteratorBack VertexIteratorBack; │ │ │ │ │ -319 typedef SubEntityIteratorBack<0> ElementIteratorBack; │ │ │ │ │ - 320 │ │ │ │ │ -326 virtual int nVertices(Dune::RefinementIntervals tag) const = 0; │ │ │ │ │ - 327 │ │ │ │ │ - 333 VertexIterator vBegin(Dune::RefinementIntervals tag) const; │ │ │ │ │ - 334 │ │ │ │ │ - 340 VertexIterator vEnd(Dune::RefinementIntervals tag) const; │ │ │ │ │ - 341 │ │ │ │ │ -347 virtual int nElements(Dune::RefinementIntervals tag) const = 0; │ │ │ │ │ - 348 │ │ │ │ │ - 354 ElementIterator eBegin(Dune::RefinementIntervals tag) const; │ │ │ │ │ - 355 │ │ │ │ │ - 361 ElementIterator eEnd(Dune::RefinementIntervals tag) const; │ │ │ │ │ - 362 │ │ │ │ │ -364 virtual ~VirtualRefinement() │ │ │ │ │ - 365 {} │ │ │ │ │ - 366 │ │ │ │ │ - 367 protected: │ │ │ │ │ -368 virtual VertexIteratorBack *vBeginBack(Dune::RefinementIntervals tag) const │ │ │ │ │ -= 0; │ │ │ │ │ -369 virtual VertexIteratorBack *vEndBack(Dune::RefinementIntervals tag) const = │ │ │ │ │ -0; │ │ │ │ │ -370 virtual ElementIteratorBack *eBeginBack(Dune::RefinementIntervals tag) │ │ │ │ │ -const = 0; │ │ │ │ │ -371 virtual ElementIteratorBack *eEndBack(Dune::RefinementIntervals tag) const │ │ │ │ │ -= 0; │ │ │ │ │ - 372 }; │ │ │ │ │ - 373 │ │ │ │ │ - 375 template │ │ │ │ │ - 376 template │ │ │ │ │ -377 struct VirtualRefinement::Codim │ │ │ │ │ - 378 { │ │ │ │ │ - 379 class SubEntityIterator; │ │ │ │ │ - 380 }; │ │ │ │ │ - 381 │ │ │ │ │ - 382 // //////////////////////// │ │ │ │ │ - 383 // │ │ │ │ │ - 384 // The refinement builder │ │ │ │ │ - 385 // │ │ │ │ │ - 386 │ │ │ │ │ - 387 template │ │ │ │ │ - 388 VirtualRefinement & │ │ │ │ │ - 389 buildRefinement(GeometryType geometryType, GeometryType coerceTo); │ │ │ │ │ - 390 │ │ │ │ │ - 391} // namespace Dune │ │ │ │ │ - 392 │ │ │ │ │ - 393#include "virtualrefinement.cc" │ │ │ │ │ - 394 │ │ │ │ │ - 395#endif // DUNE_GEOMETRY_VIRTUALREFINEMENT_HH │ │ │ │ │ -virtualrefinement.cc │ │ │ │ │ -This file contains the virtual wrapper around refinement. │ │ │ │ │ -refinement.hh │ │ │ │ │ -This file simply includes all Refinement implementations so you don't have to │ │ │ │ │ -do them separately. │ │ │ │ │ -type.hh │ │ │ │ │ -A unique label for each type of element that can occur in a grid. │ │ │ │ │ -Dune │ │ │ │ │ -Definition affinegeometry.hh:21 │ │ │ │ │ -Dune::buildRefinement │ │ │ │ │ -VirtualRefinement< dimension, CoordType > & buildRefinement(GeometryType │ │ │ │ │ -geometryType, GeometryType coerceTo) │ │ │ │ │ -return a reference to the VirtualRefinement according to the parameters │ │ │ │ │ -Definition virtualrefinement.cc:503 │ │ │ │ │ -Dune::RefinementIntervals │ │ │ │ │ -Holds the number of refined intervals per axis needed for virtual and static │ │ │ │ │ -refinement. │ │ │ │ │ -Definition base.cc:94 │ │ │ │ │ -Dune::GeometryType │ │ │ │ │ -Unique label for each type of entities that can occur in DUNE grids. │ │ │ │ │ -Definition type.hh:126 │ │ │ │ │ -Dune::VirtualRefinement::SubEntityIteratorBack │ │ │ │ │ -Definition virtualrefinement.cc:231 │ │ │ │ │ -Dune::VirtualRefinement │ │ │ │ │ -VirtualRefinement base class. │ │ │ │ │ -Definition virtualrefinement.hh:294 │ │ │ │ │ -Dune::VirtualRefinement::VertexIteratorBack │ │ │ │ │ -SubEntityIteratorBack< dimension > VertexIteratorBack │ │ │ │ │ -Definition virtualrefinement.hh:318 │ │ │ │ │ -Dune::VirtualRefinement::eEndBack │ │ │ │ │ -virtual ElementIteratorBack * eEndBack(Dune::RefinementIntervals tag) const =0 │ │ │ │ │ -Dune::VirtualRefinement::vBegin │ │ │ │ │ -VertexIterator vBegin(Dune::RefinementIntervals tag) const │ │ │ │ │ -Get an VertexIterator. │ │ │ │ │ -Definition virtualrefinement.cc:38 │ │ │ │ │ -Dune::VirtualRefinement::eBegin │ │ │ │ │ -ElementIterator eBegin(Dune::RefinementIntervals tag) const │ │ │ │ │ -Get an ElementIterator. │ │ │ │ │ -Definition virtualrefinement.cc:54 │ │ │ │ │ -Dune::VirtualRefinement::nElements │ │ │ │ │ -virtual int nElements(Dune::RefinementIntervals tag) const =0 │ │ │ │ │ -Get the number of Elements. │ │ │ │ │ -Dune::VirtualRefinement::eEnd │ │ │ │ │ -ElementIterator eEnd(Dune::RefinementIntervals tag) const │ │ │ │ │ -Get an ElementIterator. │ │ │ │ │ -Definition virtualrefinement.cc:62 │ │ │ │ │ -Dune::VirtualRefinement::ElementIterator │ │ │ │ │ -Codim< 0 >::SubEntityIterator ElementIterator │ │ │ │ │ -The ElementIterator of the VirtualRefinement. │ │ │ │ │ -Definition virtualrefinement.hh:301 │ │ │ │ │ -Dune::VirtualRefinement::~VirtualRefinement │ │ │ │ │ -virtual ~VirtualRefinement() │ │ │ │ │ -Destructor. │ │ │ │ │ -Definition virtualrefinement.hh:364 │ │ │ │ │ -Dune::VirtualRefinement::vEnd │ │ │ │ │ -VertexIterator vEnd(Dune::RefinementIntervals tag) const │ │ │ │ │ -Get an VertexIterator. │ │ │ │ │ -Definition virtualrefinement.cc:46 │ │ │ │ │ -Dune::VirtualRefinement::CoordVector │ │ │ │ │ -FieldVector< CoordType, dimension > CoordVector │ │ │ │ │ -The CoordVector of the VirtualRefinement. │ │ │ │ │ -Definition virtualrefinement.hh:308 │ │ │ │ │ -Dune::VirtualRefinement::nVertices │ │ │ │ │ -virtual int nVertices(Dune::RefinementIntervals tag) const =0 │ │ │ │ │ -Get the number of Vertices. │ │ │ │ │ -Dune::VirtualRefinement::IndexVector │ │ │ │ │ -std::vector< int > IndexVector │ │ │ │ │ -The IndexVector of the VirtualRefinement. │ │ │ │ │ -Definition virtualrefinement.hh:314 │ │ │ │ │ -Dune::VirtualRefinement::VertexIterator │ │ │ │ │ -Codim< dimension >::SubEntityIterator VertexIterator │ │ │ │ │ -The VertexIterator of the VirtualRefinement. │ │ │ │ │ -Definition virtualrefinement.hh:299 │ │ │ │ │ -Dune::VirtualRefinement::vEndBack │ │ │ │ │ -virtual VertexIteratorBack * vEndBack(Dune::RefinementIntervals tag) const =0 │ │ │ │ │ -Dune::VirtualRefinement::ElementIteratorBack │ │ │ │ │ -SubEntityIteratorBack< 0 > ElementIteratorBack │ │ │ │ │ -Definition virtualrefinement.hh:319 │ │ │ │ │ -Dune::VirtualRefinement::eBeginBack │ │ │ │ │ -virtual ElementIteratorBack * eBeginBack(Dune::RefinementIntervals tag) const │ │ │ │ │ -=0 │ │ │ │ │ -Dune::VirtualRefinement::vBeginBack │ │ │ │ │ -virtual VertexIteratorBack * vBeginBack(Dune::RefinementIntervals tag) const =0 │ │ │ │ │ -Dune::VirtualRefinement::Codim │ │ │ │ │ -codim database of VirtualRefinement │ │ │ │ │ -Definition virtualrefinement.hh:378 │ │ │ │ │ + 250// The interface (template<...> class StaticRefinement) is not included │ │ │ │ │ +here │ │ │ │ │ + 251// since it derives from parts which I consider implementation. Look │ │ │ │ │ + 252// into refinement/base.cc if the documentation is above is not enough. │ │ │ │ │ + 253#include "refinement/base.cc" │ │ │ │ │ + 254 │ │ │ │ │ + 255#include "refinement/hcube.cc" │ │ │ │ │ + 256#include "refinement/simplex.cc" │ │ │ │ │ + 257#include "refinement/hcubetriangulation.cc" │ │ │ │ │ + 258#include "refinement/prismtriangulation.cc" │ │ │ │ │ + 259#include "refinement/pyramidtriangulation.cc" │ │ │ │ │ + 260 │ │ │ │ │ + 261#endif // DUNE_GEOMETRY_REFINEMENT_HH │ │ │ │ │ +base.cc │ │ │ │ │ +This file contains the parts independent of a particular Refinement │ │ │ │ │ +implementation. │ │ │ │ │ +pyramidtriangulation.cc │ │ │ │ │ +prismtriangulation.cc │ │ │ │ │ +hcube.cc │ │ │ │ │ +This file contains the Refinement implementation for hypercubes │ │ │ │ │ +(quadrilaterals, hexahedrons,... │ │ │ │ │ +simplex.cc │ │ │ │ │ +This file contains the Refinement implementation for simplices (triangles, │ │ │ │ │ +tetrahedrons.... │ │ │ │ │ +hcubetriangulation.cc │ │ │ │ │ +This file contains the Refinement implementation for triangulating hypercubes │ │ │ │ │ +(quadrilateral -> trian... │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00203.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: referenceelementimplementation.hh File Reference │ │ │ │ +dune-geometry: type.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,45 +70,57 @@ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -Namespaces
│ │ │ │ -
referenceelementimplementation.hh File Reference
│ │ │ │ +Classes | │ │ │ │ +Namespaces | │ │ │ │ +Functions
│ │ │ │ +
type.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ + │ │ │ │ +

A unique label for each type of element that can occur in a grid. │ │ │ │ +More...

│ │ │ │
#include <cassert>
│ │ │ │ -#include <algorithm>
│ │ │ │ -#include <limits>
│ │ │ │ -#include <tuple>
│ │ │ │ -#include <utility>
│ │ │ │ -#include <vector>
│ │ │ │ -#include <array>
│ │ │ │ -#include <bitset>
│ │ │ │ -#include <dune/common/fmatrix.hh>
│ │ │ │ -#include <dune/common/fvector.hh>
│ │ │ │ -#include <dune/common/hybridutilities.hh>
│ │ │ │ +#include <cstdint>
│ │ │ │ +#include <string>
│ │ │ │ +#include <type_traits>
│ │ │ │ +#include <dune/common/exceptions.hh>
│ │ │ │ +#include <dune/common/keywords.hh>
│ │ │ │ #include <dune/common/typetraits.hh>
│ │ │ │ -#include <dune/common/iteratorrange.hh>
│ │ │ │ -#include <dune/common/math.hh>
│ │ │ │ -#include <dune/geometry/referenceelement.hh>
│ │ │ │ -#include <dune/geometry/affinegeometry.hh>
│ │ │ │ -#include <dune/geometry/type.hh>
│ │ │ │ +#include <dune/common/unused.hh>
│ │ │ │ +#include <dune/geometry/deprecated_topology.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ +Classes

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

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::Geo
namespace  Dune::GeometryTypes
 Predefined GeometryTypes for common geometries.
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +Functions

std::ostream & Dune::operator<< (std::ostream &s, const GeometryType &a)
 Prints the type to an output stream.
 
│ │ │ │ -
│ │ │ │ +

Detailed Description

│ │ │ │ +

A unique label for each type of element that can occur in a grid.

│ │ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -6,35 +6,40 @@ │ │ │ │ │ dune-geometry 2.9.0 │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ -Namespaces │ │ │ │ │ -referenceelementimplementation.hh File Reference │ │ │ │ │ +Classes | Namespaces | Functions │ │ │ │ │ +type.hh File Reference │ │ │ │ │ +A unique label for each type of element that can occur in a grid. More... │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ + Classes │ │ │ │ │ +class  Dune::GeometryType │ │ │ │ │ +  Unique label for each type of entities that can occur in DUNE grids. │ │ │ │ │ + More... │ │ │ │ │ +  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ -namespace  Dune::Geo │ │ │ │ │ +namespace  Dune::GeometryTypes │ │ │ │ │ +  Predefined GeometryTypes for common geometries. │ │ │ │ │ +  │ │ │ │ │ + Functions │ │ │ │ │ +std::ostream & Dune::operator<< (std::ostream &s, const GeometryType &a) │ │ │ │ │ +  Prints the type to an output stream. │ │ │ │ │   │ │ │ │ │ +***** Detailed Description ***** │ │ │ │ │ +A unique label for each type of element that can occur in a grid. │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00203_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: referenceelementimplementation.hh Source File │ │ │ │ +dune-geometry: type.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,721 +74,496 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
referenceelementimplementation.hh
│ │ │ │ +
type.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
│ │ │ │ -
5#ifndef DUNE_GEOMETRY_REFERENCEELEMENTIMPLEMENTATION_HH
│ │ │ │ -
6#define DUNE_GEOMETRY_REFERENCEELEMENTIMPLEMENTATION_HH
│ │ │ │ +
5#ifndef DUNE_GEOMETRY_TYPE_HH
│ │ │ │ +
6#define DUNE_GEOMETRY_TYPE_HH
│ │ │ │
7
│ │ │ │ -
8#include <cassert>
│ │ │ │ -
9
│ │ │ │ -
10#include <algorithm>
│ │ │ │ -
11#include <limits>
│ │ │ │ -
12#include <tuple>
│ │ │ │ -
13#include <utility>
│ │ │ │ -
14#include <vector>
│ │ │ │ -
15#include <array>
│ │ │ │ -
16#include <bitset>
│ │ │ │ +
12#include <cassert>
│ │ │ │ +
13#include <cstdint>
│ │ │ │ +
14
│ │ │ │ +
15#include <string>
│ │ │ │ +
16#include <type_traits>
│ │ │ │
17
│ │ │ │ -
18#include <dune/common/fmatrix.hh>
│ │ │ │ -
19#include <dune/common/fvector.hh>
│ │ │ │ -
20#include <dune/common/hybridutilities.hh>
│ │ │ │ -
21#include <dune/common/typetraits.hh>
│ │ │ │ -
22#include <dune/common/iteratorrange.hh>
│ │ │ │ -
23#include <dune/common/math.hh>
│ │ │ │ -
24
│ │ │ │ - │ │ │ │ - │ │ │ │ -
27#include <dune/geometry/type.hh>
│ │ │ │ +
18#include <dune/common/exceptions.hh>
│ │ │ │ +
19#include <dune/common/keywords.hh>
│ │ │ │ +
20#include <dune/common/typetraits.hh>
│ │ │ │ +
21#include <dune/common/unused.hh>
│ │ │ │ +
22
│ │ │ │ +
23namespace Dune
│ │ │ │ +
24{
│ │ │ │ +
25
│ │ │ │ +
26 namespace Impl
│ │ │ │ +
27 {
│ │ │ │
28
│ │ │ │ -
29namespace Dune
│ │ │ │ -
30{
│ │ │ │ -
31
│ │ │ │ -
32 namespace Geo
│ │ │ │ -
33 {
│ │ │ │ -
34
│ │ │ │ -
35#ifndef DOXYGEN
│ │ │ │ -
36
│ │ │ │ -
37 // Internal Forward Declarations
│ │ │ │ -
38 // -----------------------------
│ │ │ │ -
39
│ │ │ │ -
40 namespace Impl
│ │ │ │ -
41 {
│ │ │ │ -
42 template< class ctype, int dim >
│ │ │ │ -
43 class ReferenceElementContainer;
│ │ │ │ -
44 }
│ │ │ │ -
45
│ │ │ │ -
46 template< class ctype, int dim >
│ │ │ │ -
47 struct ReferenceElements;
│ │ │ │ -
48
│ │ │ │ -
49
│ │ │ │ -
50
│ │ │ │ -
51 namespace Impl
│ │ │ │ -
52 {
│ │ │ │ -
53
│ │ │ │ -
54 using Dune::Impl::isPrism;
│ │ │ │ -
55 using Dune::Impl::isPyramid;
│ │ │ │ -
56 using Dune::Impl::baseTopologyId;
│ │ │ │ -
57 using Dune::Impl::prismConstruction;
│ │ │ │ -
58 using Dune::Impl::pyramidConstruction;
│ │ │ │ -
59 using Dune::Impl::numTopologies;
│ │ │ │ -
60
│ │ │ │ -
62 unsigned int size ( unsigned int topologyId, int dim, int codim );
│ │ │ │ -
63
│ │ │ │ +
29 enum TopologyConstruction { pyramidConstruction = 0, prismConstruction = 1 };
│ │ │ │ +
30
│ │ │ │ +
31 // Dynamic Topology Properties
│ │ │ │ +
32 // ---------------------------
│ │ │ │ +
33
│ │ │ │ +
42 inline static unsigned int numTopologies ( int dim ) noexcept
│ │ │ │ +
43 {
│ │ │ │ +
44 return (1u << dim);
│ │ │ │ +
45 }
│ │ │ │ +
46
│ │ │ │ +
58 inline bool static isPyramid ( unsigned int topologyId, int dim, int codim = 0 ) noexcept
│ │ │ │ +
59 {
│ │ │ │ +
60 assert( (dim > 0) && (topologyId < numTopologies( dim )) );
│ │ │ │ +
61 assert( (0 <= codim) && (codim < dim) );
│ │ │ │ +
62 return (((topologyId & ~1) & (1u << (dim-codim-1))) == 0);
│ │ │ │ +
63 }
│ │ │ │
64
│ │ │ │ -
65
│ │ │ │ -
73 unsigned int subTopologyId ( unsigned int topologyId, int dim, int codim, unsigned int i );
│ │ │ │ -
74
│ │ │ │ -
75
│ │ │ │ -
76
│ │ │ │ -
77 // subTopologyNumbering
│ │ │ │ -
78 // --------------------
│ │ │ │ -
79
│ │ │ │ -
80 void subTopologyNumbering ( unsigned int topologyId, int dim, int codim, unsigned int i, int subcodim,
│ │ │ │ -
81 unsigned int *beginOut, unsigned int *endOut );
│ │ │ │ +
76 inline static bool isPrism ( unsigned int topologyId, int dim, int codim = 0 ) noexcept
│ │ │ │ +
77 {
│ │ │ │ +
78 assert( (dim > 0) && (topologyId < numTopologies( dim )) );
│ │ │ │ +
79 assert( (0 <= codim) && (codim < dim) );
│ │ │ │ +
80 return (( (topologyId | 1) & (1u << (dim-codim-1))) != 0);
│ │ │ │ +
81 }
│ │ │ │
82
│ │ │ │ -
83
│ │ │ │ -
84
│ │ │ │ -
85
│ │ │ │ -
86 // checkInside
│ │ │ │ -
87 // -----------
│ │ │ │ -
88
│ │ │ │ -
89 template< class ct, int cdim >
│ │ │ │ -
90 inline bool
│ │ │ │ -
91 checkInside ( unsigned int topologyId, int dim, const FieldVector< ct, cdim > &x, ct tolerance, ct factor = ct( 1 ) )
│ │ │ │ -
92 {
│ │ │ │ -
93 assert( (dim >= 0) && (dim <= cdim) );
│ │ │ │ -
94 assert( topologyId < numTopologies( dim ) );
│ │ │ │ -
95
│ │ │ │ -
96 if( dim > 0 )
│ │ │ │ -
97 {
│ │ │ │ -
98 const ct baseFactor = (isPrism( topologyId, dim ) ? factor : factor - x[ dim-1 ]);
│ │ │ │ -
99 if( (x[ dim-1 ] > -tolerance) && (factor - x[ dim-1 ] > -tolerance) )
│ │ │ │ -
100 return checkInside< ct, cdim >( baseTopologyId( topologyId, dim ), dim-1, x, tolerance, baseFactor );
│ │ │ │ -
101 else
│ │ │ │ -
102 return false;
│ │ │ │ -
103 }
│ │ │ │ -
104 else
│ │ │ │ -
105 return true;
│ │ │ │ -
106 }
│ │ │ │ -
107
│ │ │ │ -
108
│ │ │ │ +
90 inline static unsigned int baseTopologyId ( unsigned int topologyId, int dim, int codim = 1 ) noexcept
│ │ │ │ +
91 {
│ │ │ │ +
92 assert( (dim >= 0) && (topologyId < numTopologies( dim )) );
│ │ │ │ +
93 assert( (0 <= codim) && (codim <= dim) );
│ │ │ │ +
94 return topologyId & ((1u << (dim-codim)) - 1);
│ │ │ │ +
95 }
│ │ │ │ +
96
│ │ │ │ +
97 } // namespace Impl
│ │ │ │ +
98
│ │ │ │ +
99// the Topology classes are deprecated and will be removed for the 2.8.
│ │ │ │ +
100// Temporarily a header 'deprecated_topology.hh' is provided which will be removed after the 2.9 release.
│ │ │ │ +
101#if __GNUC__ >= 7
│ │ │ │ +
102# pragma GCC diagnostic push
│ │ │ │ +
103# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
│ │ │ │ +
104#endif
│ │ │ │ + │ │ │ │ +
106#if __GNUC__ >= 7
│ │ │ │ +
107# pragma GCC diagnostic pop
│ │ │ │ +
108#endif
│ │ │ │
109
│ │ │ │ -
110 // referenceCorners
│ │ │ │ -
111 // ----------------
│ │ │ │ +
110 // GeometryType
│ │ │ │ +
111 // -------------
│ │ │ │
112
│ │ │ │ -
113 template< class ct, int cdim >
│ │ │ │ -
114 inline unsigned int
│ │ │ │ -
115 referenceCorners ( unsigned int topologyId, int dim, FieldVector< ct, cdim > *corners )
│ │ │ │ -
116 {
│ │ │ │ -
117 assert( (dim >= 0) && (dim <= cdim) );
│ │ │ │ -
118 assert( topologyId < numTopologies( dim ) );
│ │ │ │ -
119
│ │ │ │ -
120 if( dim > 0 )
│ │ │ │ -
121 {
│ │ │ │ -
122 const unsigned int nBaseCorners
│ │ │ │ -
123 = referenceCorners( baseTopologyId( topologyId, dim ), dim-1, corners );
│ │ │ │ -
124 assert( nBaseCorners == size( baseTopologyId( topologyId, dim ), dim-1, dim-1 ) );
│ │ │ │ -
125 if( isPrism( topologyId, dim ) )
│ │ │ │ -
126 {
│ │ │ │ -
127 std::copy( corners, corners + nBaseCorners, corners + nBaseCorners );
│ │ │ │ -
128 for( unsigned int i = 0; i < nBaseCorners; ++i )
│ │ │ │ -
129 corners[ i+nBaseCorners ][ dim-1 ] = ct( 1 );
│ │ │ │ -
130 return 2*nBaseCorners;
│ │ │ │ -
131 }
│ │ │ │ -
132 else
│ │ │ │ -
133 {
│ │ │ │ -
134 corners[ nBaseCorners ] = FieldVector< ct, cdim >( ct( 0 ) );
│ │ │ │ -
135 corners[ nBaseCorners ][ dim-1 ] = ct( 1 );
│ │ │ │ -
136 return nBaseCorners+1;
│ │ │ │ -
137 }
│ │ │ │ -
138 }
│ │ │ │ -
139 else
│ │ │ │ -
140 {
│ │ │ │ -
141 *corners = FieldVector< ct, cdim >( ct( 0 ) );
│ │ │ │ -
142 return 1;
│ │ │ │ -
143 }
│ │ │ │ -
144 }
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
126 {
│ │ │ │ +
127 public:
│ │ │ │ +
128
│ │ │ │ +
│ │ │ │ +
131 enum
│ │ │ │ +
132 BasicType {
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
138 none
│ │ │ │ +
139 };
│ │ │ │ +
│ │ │ │ +
140
│ │ │ │ +
141 private:
│ │ │ │ +
142
│ │ │ │ +
144 unsigned char dim_;
│ │ │ │
145
│ │ │ │ -
146
│ │ │ │ -
147
│ │ │ │ -
148 // referenceVolume
│ │ │ │ -
149 // ---------------
│ │ │ │ -
150
│ │ │ │ -
151 unsigned long referenceVolumeInverse ( unsigned int topologyId, int dim );
│ │ │ │ -
152
│ │ │ │ -
153 template< class ct >
│ │ │ │ -
154 inline ct referenceVolume ( unsigned int topologyId, int dim )
│ │ │ │ -
155 {
│ │ │ │ -
156 return ct( 1 ) / ct( referenceVolumeInverse( topologyId, dim ) );
│ │ │ │ -
157 }
│ │ │ │ -
158
│ │ │ │ -
159
│ │ │ │ +
147 bool none_;
│ │ │ │ +
148
│ │ │ │ +
150 unsigned int topologyId_;
│ │ │ │ +
151
│ │ │ │ +
152 // Internal type used for the Id. The exact nature of this type is kept
│ │ │ │ +
153 // as an implementation detail on purpose. We use a scoped enum here because scoped enums
│ │ │ │ +
154 // can be used as template parameters, but are not implicitly converted to other integral
│ │ │ │ +
155 // types by the compiler. That way, we avoid unfortunate implicit conversion chains, e.g.
│ │ │ │ +
156 // people trying to work with GlobalGeometryTypeIndex, but forgetting to actually call
│ │ │ │ +
157 // GlobalGeometryTypeIndex::index(gt) and just using gt directly.
│ │ │ │ +
158 enum class IdType : std::uint64_t
│ │ │ │ +
159 {};
│ │ │ │
160
│ │ │ │ -
161 // referenceOrigins
│ │ │ │ -
162 // ----------------
│ │ │ │ -
163
│ │ │ │ -
164 template< class ct, int cdim >
│ │ │ │ -
165 inline unsigned int
│ │ │ │ -
166 referenceOrigins ( unsigned int topologyId, int dim, int codim, FieldVector< ct, cdim > *origins )
│ │ │ │ -
167 {
│ │ │ │ -
168 assert( (dim >= 0) && (dim <= cdim) );
│ │ │ │ -
169 assert( topologyId < numTopologies( dim ) );
│ │ │ │ -
170 assert( (codim >= 0) && (codim <= dim) );
│ │ │ │ -
171
│ │ │ │ -
172 if( codim > 0 )
│ │ │ │ -
173 {
│ │ │ │ -
174 const unsigned int baseId = baseTopologyId( topologyId, dim );
│ │ │ │ -
175 if( isPrism( topologyId, dim ) )
│ │ │ │ -
176 {
│ │ │ │ -
177 const unsigned int n = (codim < dim ? referenceOrigins( baseId, dim-1, codim, origins ) : 0);
│ │ │ │ -
178 const unsigned int m = referenceOrigins( baseId, dim-1, codim-1, origins+n );
│ │ │ │ -
179 for( unsigned int i = 0; i < m; ++i )
│ │ │ │ -
180 {
│ │ │ │ -
181 origins[ n+m+i ] = origins[ n+i ];
│ │ │ │ -
182 origins[ n+m+i ][ dim-1 ] = ct( 1 );
│ │ │ │ -
183 }
│ │ │ │ -
184 return n+2*m;
│ │ │ │ -
185 }
│ │ │ │ -
186 else
│ │ │ │ -
187 {
│ │ │ │ -
188 const unsigned int m = referenceOrigins( baseId, dim-1, codim-1, origins );
│ │ │ │ -
189 if( codim == dim )
│ │ │ │ -
190 {
│ │ │ │ -
191 origins[ m ] = FieldVector< ct, cdim >( ct( 0 ) );
│ │ │ │ -
192 origins[ m ][ dim-1 ] = ct( 1 );
│ │ │ │ -
193 return m+1;
│ │ │ │ -
194 }
│ │ │ │ -
195 else
│ │ │ │ -
196 return m+referenceOrigins( baseId, dim-1, codim, origins+m );
│ │ │ │ -
197 }
│ │ │ │ -
198 }
│ │ │ │ -
199 else
│ │ │ │ -
200 {
│ │ │ │ -
201 origins[ 0 ] = FieldVector< ct, cdim >( ct( 0 ) );
│ │ │ │ -
202 return 1;
│ │ │ │ -
203 }
│ │ │ │ -
204 }
│ │ │ │ -
205
│ │ │ │ -
206
│ │ │ │ -
207
│ │ │ │ -
208 // referenceEmbeddings
│ │ │ │ -
209 // -------------------
│ │ │ │ -
210
│ │ │ │ -
211 template< class ct, int cdim, int mydim >
│ │ │ │ -
212 inline unsigned int
│ │ │ │ -
213 referenceEmbeddings ( unsigned int topologyId, int dim, int codim,
│ │ │ │ -
214 FieldVector< ct, cdim > *origins,
│ │ │ │ -
215 FieldMatrix< ct, mydim, cdim > *jacobianTransposeds )
│ │ │ │ -
216 {
│ │ │ │ -
217 assert( (0 <= codim) && (codim <= dim) && (dim <= cdim) );
│ │ │ │ -
218 assert( (dim - codim <= mydim) && (mydim <= cdim) );
│ │ │ │ -
219 assert( topologyId < numTopologies( dim ) );
│ │ │ │ -
220
│ │ │ │ -
221 if( codim > 0 )
│ │ │ │ -
222 {
│ │ │ │ -
223 const unsigned int baseId = baseTopologyId( topologyId, dim );
│ │ │ │ -
224 if( isPrism( topologyId, dim ) )
│ │ │ │ -
225 {
│ │ │ │ -
226 const unsigned int n = (codim < dim ? referenceEmbeddings( baseId, dim-1, codim, origins, jacobianTransposeds ) : 0);
│ │ │ │ -
227 for( unsigned int i = 0; i < n; ++i )
│ │ │ │ -
228 jacobianTransposeds[ i ][ dim-codim-1 ][ dim-1 ] = ct( 1 );
│ │ │ │ -
229
│ │ │ │ -
230 const unsigned int m = referenceEmbeddings( baseId, dim-1, codim-1, origins+n, jacobianTransposeds+n );
│ │ │ │ -
231 std::copy( origins+n, origins+n+m, origins+n+m );
│ │ │ │ -
232 std::copy( jacobianTransposeds+n, jacobianTransposeds+n+m, jacobianTransposeds+n+m );
│ │ │ │ -
233 for( unsigned int i = 0; i < m; ++i )
│ │ │ │ -
234 origins[ n+m+i ][ dim-1 ] = ct( 1 );
│ │ │ │ -
235
│ │ │ │ -
236 return n+2*m;
│ │ │ │ -
237 }
│ │ │ │ -
238 else
│ │ │ │ -
239 {
│ │ │ │ -
240 const unsigned int m = referenceEmbeddings( baseId, dim-1, codim-1, origins, jacobianTransposeds );
│ │ │ │ -
241 if( codim == dim )
│ │ │ │ -
242 {
│ │ │ │ -
243 origins[ m ] = FieldVector< ct, cdim >( ct( 0 ) );
│ │ │ │ -
244 origins[ m ][ dim-1 ] = ct( 1 );
│ │ │ │ -
245 jacobianTransposeds[ m ] = FieldMatrix< ct, mydim, cdim >( ct( 0 ) );
│ │ │ │ -
246 return m+1;
│ │ │ │ -
247 }
│ │ │ │ -
248 else
│ │ │ │ -
249 {
│ │ │ │ -
250 const unsigned int n = referenceEmbeddings( baseId, dim-1, codim, origins+m, jacobianTransposeds+m );
│ │ │ │ -
251 for( unsigned int i = 0; i < n; ++i )
│ │ │ │ -
252 {
│ │ │ │ -
253 for( int k = 0; k < dim-1; ++k )
│ │ │ │ -
254 jacobianTransposeds[ m+i ][ dim-codim-1 ][ k ] = -origins[ m+i ][ k ];
│ │ │ │ -
255 jacobianTransposeds[ m+i ][ dim-codim-1 ][ dim-1 ] = ct( 1 );
│ │ │ │ -
256 }
│ │ │ │ -
257 return m+n;
│ │ │ │ -
258 }
│ │ │ │ -
259 }
│ │ │ │ -
260 }
│ │ │ │ -
261 else
│ │ │ │ -
262 {
│ │ │ │ -
263 origins[ 0 ] = FieldVector< ct, cdim >( ct( 0 ) );
│ │ │ │ -
264 jacobianTransposeds[ 0 ] = FieldMatrix< ct, mydim, cdim >( ct( 0 ) );
│ │ │ │ -
265 for( int k = 0; k < dim; ++k )
│ │ │ │ -
266 jacobianTransposeds[ 0 ][ k ][ k ] = ct( 1 );
│ │ │ │ -
267 return 1;
│ │ │ │ -
268 }
│ │ │ │ -
269 }
│ │ │ │ -
270
│ │ │ │ -
271
│ │ │ │ -
272
│ │ │ │ -
273 // referenceIntegrationOuterNormals
│ │ │ │ -
274 // --------------------------------
│ │ │ │ -
275
│ │ │ │ -
276 template< class ct, int cdim >
│ │ │ │ -
277 inline unsigned int
│ │ │ │ -
278 referenceIntegrationOuterNormals ( unsigned int topologyId, int dim,
│ │ │ │ -
279 const FieldVector< ct, cdim > *origins,
│ │ │ │ -
280 FieldVector< ct, cdim > *normals )
│ │ │ │ -
281 {
│ │ │ │ -
282 assert( (dim > 0) && (dim <= cdim) );
│ │ │ │ -
283 assert( topologyId < numTopologies( dim ) );
│ │ │ │ +
161 public:
│ │ │ │ +
162
│ │ │ │ +
193 using Id = IdType;
│ │ │ │ +
194
│ │ │ │ +
│ │ │ │ +
202 constexpr operator Id() const
│ │ │ │ +
203 {
│ │ │ │ +
204 // recreate the exact storage layout that this class is using, making conversion
│ │ │ │ +
205 // extremely cheap
│ │ │ │ +
206 std::uint64_t id = dim_ | (std::uint64_t(none_) << 8) | (std::uint64_t(topologyId_) << 32);
│ │ │ │ +
207 return static_cast<Id>(id);
│ │ │ │ +
208 }
│ │ │ │ +
│ │ │ │ +
209
│ │ │ │ +
│ │ │ │ +
222 constexpr Id toId() const
│ │ │ │ +
223 {
│ │ │ │ +
224 return static_cast<Id>(*this);
│ │ │ │ +
225 }
│ │ │ │ +
│ │ │ │ +
226
│ │ │ │ +
│ │ │ │ +
234 constexpr GeometryType(Id id)
│ │ │ │ +
235 : dim_(static_cast<std::uint64_t>(id) & 0xFF)
│ │ │ │ +
236 , none_(static_cast<std::uint64_t>(id) & 0x100)
│ │ │ │ +
237 , topologyId_(static_cast<std::uint64_t>(id) >> 32)
│ │ │ │ +
238 {}
│ │ │ │ +
│ │ │ │ +
239
│ │ │ │ +
242
│ │ │ │ +
│ │ │ │ +
244 constexpr GeometryType ()
│ │ │ │ +
245 : dim_(0), none_(true), topologyId_(0)
│ │ │ │ +
246 {}
│ │ │ │ +
│ │ │ │ +
247
│ │ │ │ +
│ │ │ │ +
254 constexpr GeometryType(unsigned int topologyId, unsigned int dim, bool isNone)
│ │ │ │ +
255 : dim_(dim), none_(isNone), topologyId_(topologyId)
│ │ │ │ +
256 {}
│ │ │ │ +
│ │ │ │ +
257
│ │ │ │ +
│ │ │ │ +
263 constexpr GeometryType(unsigned int topologyId, unsigned int dim)
│ │ │ │ +
264 : dim_(dim), none_(false), topologyId_(topologyId)
│ │ │ │ +
265 {}
│ │ │ │ +
│ │ │ │ +
266
│ │ │ │ +
277 template<class TopologyType,
│ │ │ │ +
278 class = std::void_t<decltype(TopologyType::dimension), decltype(TopologyType::id)>>
│ │ │ │ +
│ │ │ │ +
279 explicit GeometryType(TopologyType t)
│ │ │ │ +
280 : dim_(TopologyType::dimension), none_(false), topologyId_(TopologyType::id)
│ │ │ │ +
281 {
│ │ │ │ +
282 DUNE_UNUSED_PARAMETER(t);
│ │ │ │ +
283 }
│ │ │ │ +
│ │ │ │
284
│ │ │ │ -
285 if( dim > 1 )
│ │ │ │ -
286 {
│ │ │ │ -
287 const unsigned int baseId = baseTopologyId( topologyId, dim );
│ │ │ │ -
288 if( isPrism( topologyId, dim ) )
│ │ │ │ -
289 {
│ │ │ │ -
290 const unsigned int numBaseFaces
│ │ │ │ -
291 = referenceIntegrationOuterNormals( baseId, dim-1, origins, normals );
│ │ │ │ -
292
│ │ │ │ -
293 for( unsigned int i = 0; i < 2; ++i )
│ │ │ │ -
294 {
│ │ │ │ -
295 normals[ numBaseFaces+i ] = FieldVector< ct, cdim >( ct( 0 ) );
│ │ │ │ -
296 normals[ numBaseFaces+i ][ dim-1 ] = ct( 2*int( i )-1 );
│ │ │ │ -
297 }
│ │ │ │ -
298
│ │ │ │ -
299 return numBaseFaces+2;
│ │ │ │ -
300 }
│ │ │ │ -
301 else
│ │ │ │ -
302 {
│ │ │ │ -
303 normals[ 0 ] = FieldVector< ct, cdim >( ct( 0 ) );
│ │ │ │ -
304 normals[ 0 ][ dim-1 ] = ct( -1 );
│ │ │ │ -
305
│ │ │ │ -
306 const unsigned int numBaseFaces
│ │ │ │ -
307 = referenceIntegrationOuterNormals( baseId, dim-1, origins+1, normals+1 );
│ │ │ │ -
308 for( unsigned int i = 1; i <= numBaseFaces; ++i )
│ │ │ │ -
309 normals[ i ][ dim-1 ] = normals[ i ]*origins[ i ];
│ │ │ │ -
310
│ │ │ │ -
311 return numBaseFaces+1;
│ │ │ │ -
312 }
│ │ │ │ -
313 }
│ │ │ │ -
314 else
│ │ │ │ -
315 {
│ │ │ │ -
316 for( unsigned int i = 0; i < 2; ++i )
│ │ │ │ -
317 {
│ │ │ │ -
318 normals[ i ] = FieldVector< ct, cdim >( ct( 0 ) );
│ │ │ │ -
319 normals[ i ][ 0 ] = ct( 2*int( i )-1 );
│ │ │ │ -
320 }
│ │ │ │ -
321
│ │ │ │ -
322 return 2;
│ │ │ │ -
323 }
│ │ │ │ -
324 }
│ │ │ │ -
325
│ │ │ │ -
326 template< class ct, int cdim >
│ │ │ │ -
327 inline unsigned int
│ │ │ │ -
328 referenceIntegrationOuterNormals ( unsigned int topologyId, int dim,
│ │ │ │ -
329 FieldVector< ct, cdim > *normals )
│ │ │ │ -
330 {
│ │ │ │ -
331 assert( (dim > 0) && (dim <= cdim) );
│ │ │ │ -
332
│ │ │ │ -
333 FieldVector< ct, cdim > *origins
│ │ │ │ -
334 = new FieldVector< ct, cdim >[ size( topologyId, dim, 1 ) ];
│ │ │ │ -
335 referenceOrigins( topologyId, dim, 1, origins );
│ │ │ │ -
336
│ │ │ │ -
337 const unsigned int numFaces
│ │ │ │ -
338 = referenceIntegrationOuterNormals( topologyId, dim, origins, normals );
│ │ │ │ -
339 assert( numFaces == size( topologyId, dim, 1 ) );
│ │ │ │ -
340
│ │ │ │ -
341 delete[] origins;
│ │ │ │ -
342
│ │ │ │ -
343 return numFaces;
│ │ │ │ -
344 }
│ │ │ │ -
345
│ │ │ │ -
346 } // namespace Impl
│ │ │ │ -
347
│ │ │ │ -
348
│ │ │ │ -
349
│ │ │ │ -
350 // ReferenceElement
│ │ │ │ -
351 // ----------------
│ │ │ │ +
│ │ │ │ +
291 constexpr bool isVertex() const {
│ │ │ │ +
292 return dim_==0;
│ │ │ │ +
293 }
│ │ │ │ +
│ │ │ │ +
294
│ │ │ │ +
│ │ │ │ +
296 constexpr bool isLine() const {
│ │ │ │ +
297 return dim_==1;
│ │ │ │ +
298 }
│ │ │ │ +
│ │ │ │ +
299
│ │ │ │ +
│ │ │ │ +
301 constexpr bool isTriangle() const {
│ │ │ │ +
302 return ! none_ && dim_==2 && (topologyId_ | 1) == 0b0001;
│ │ │ │ +
303 }
│ │ │ │ +
│ │ │ │ +
304
│ │ │ │ +
│ │ │ │ +
306 constexpr bool isQuadrilateral() const {
│ │ │ │ +
307 return ! none_ && dim_==2 && (topologyId_ | 1) == 0b0011;
│ │ │ │ +
308 }
│ │ │ │ +
│ │ │ │ +
309
│ │ │ │ +
│ │ │ │ +
311 constexpr bool isTetrahedron() const {
│ │ │ │ +
312 return ! none_ && dim_==3 && (topologyId_ | 1) == 0b0001;
│ │ │ │ +
313 }
│ │ │ │ +
│ │ │ │ +
314
│ │ │ │ +
│ │ │ │ +
316 constexpr bool isPyramid() const {
│ │ │ │ +
317 return ! none_ && dim_==3 && (topologyId_ | 1) == 0b0011;
│ │ │ │ +
318 }
│ │ │ │ +
│ │ │ │ +
319
│ │ │ │ +
│ │ │ │ +
321 constexpr bool isPrism() const {
│ │ │ │ +
322 return ! none_ && dim_==3 && (topologyId_ | 1) == 0b0101;
│ │ │ │ +
323 }
│ │ │ │ +
│ │ │ │ +
324
│ │ │ │ +
│ │ │ │ +
326 constexpr bool isHexahedron() const {
│ │ │ │ +
327 return ! none_ && dim_==3 && (topologyId_ | 1) == 0b0111;
│ │ │ │ +
328 }
│ │ │ │ +
│ │ │ │ +
329
│ │ │ │ +
│ │ │ │ +
331 constexpr bool isSimplex() const {
│ │ │ │ +
332 return ! none_ && (topologyId_ | 1) == 1;
│ │ │ │ +
333 }
│ │ │ │ +
│ │ │ │ +
334
│ │ │ │ +
│ │ │ │ +
336 constexpr bool isCube() const {
│ │ │ │ +
337 return ! none_ && ((topologyId_ ^ ((1 << dim_)-1)) >> 1 == 0);
│ │ │ │ +
338 }
│ │ │ │ +
│ │ │ │ +
339
│ │ │ │ +
│ │ │ │ +
341 constexpr bool isConical() const {
│ │ │ │ +
342 return ! none_ && (((topologyId_ & ~1) & (1u << (dim_-1))) == 0);
│ │ │ │ +
343 }
│ │ │ │ +
│ │ │ │ +
344
│ │ │ │ +
│ │ │ │ +
349 constexpr bool isConical(const int& step) const {
│ │ │ │ +
350 return ! none_ && (((topologyId_ & ~1) & (1u << step)) == 0);
│ │ │ │ +
351 }
│ │ │ │ +
│ │ │ │
352
│ │ │ │ -
371 template< class ctype_, int dim >
│ │ │ │ -
372 class ReferenceElementImplementation
│ │ │ │ -
373 {
│ │ │ │ -
374
│ │ │ │ -
375 public:
│ │ │ │ -
376
│ │ │ │ -
378 using ctype = ctype_;
│ │ │ │ -
379
│ │ │ │ -
381 using CoordinateField = ctype;
│ │ │ │ -
382
│ │ │ │ -
384 using Coordinate = Dune::FieldVector<ctype,dim>;
│ │ │ │ -
385
│ │ │ │ -
387 static constexpr int dimension = dim;
│ │ │ │ -
388
│ │ │ │ -
390 typedef ctype Volume;
│ │ │ │ -
391
│ │ │ │ -
392 private:
│ │ │ │ -
393
│ │ │ │ -
394 friend class Impl::ReferenceElementContainer< ctype, dim >;
│ │ │ │ -
395
│ │ │ │ -
396 struct SubEntityInfo;
│ │ │ │ +
│ │ │ │ +
354 constexpr bool isPrismatic() const {
│ │ │ │ +
355 return ! none_ && (( (topologyId_ | 1) & (1u << (dim_-1))) != 0);
│ │ │ │ +
356 }
│ │ │ │ +
│ │ │ │ +
357
│ │ │ │ +
│ │ │ │ +
362 constexpr bool isPrismatic(const int& step) const {
│ │ │ │ +
363 return ! none_ && (( (topologyId_ | 1) & (1u << step)) != 0);
│ │ │ │ +
364 }
│ │ │ │ +
│ │ │ │ +
365
│ │ │ │ +
│ │ │ │ +
367 constexpr bool isNone() const {
│ │ │ │ +
368 return none_;
│ │ │ │ +
369 }
│ │ │ │ +
│ │ │ │ +
370
│ │ │ │ +
│ │ │ │ +
372 constexpr unsigned int dim() const {
│ │ │ │ +
373 return dim_;
│ │ │ │ +
374 }
│ │ │ │ +
│ │ │ │ +
375
│ │ │ │ +
│ │ │ │ +
377 constexpr unsigned int id() const {
│ │ │ │ +
378 return topologyId_;
│ │ │ │ +
379 }
│ │ │ │ +
│ │ │ │ +
380
│ │ │ │ +
│ │ │ │ +
388 constexpr bool operator==(const GeometryType& other) const {
│ │ │ │ +
389 return ( ( none_ == other.none_ )
│ │ │ │ +
390 && ( ( none_ == true )
│ │ │ │ +
391 || ( ( dim_ == other.dim_ )
│ │ │ │ +
392 && ( (topologyId_ >> 1) == (other.topologyId_ >> 1) )
│ │ │ │ +
393 )
│ │ │ │ +
394 )
│ │ │ │ +
395 );
│ │ │ │ +
396 }
│ │ │ │ +
│ │ │ │
397
│ │ │ │ -
398 template< int codim > struct CreateGeometries;
│ │ │ │ -
399
│ │ │ │ -
400 public:
│ │ │ │ -
402 template< int codim >
│ │ │ │ -
403 struct Codim
│ │ │ │ -
404 {
│ │ │ │ -
406 typedef AffineGeometry< ctype, dim-codim, dim > Geometry;
│ │ │ │ -
407 };
│ │ │ │ -
408
│ │ │ │ -
409 // ReferenceElement cannot be copied.
│ │ │ │ -
410 ReferenceElementImplementation ( const ReferenceElementImplementation& ) = delete;
│ │ │ │ -
411
│ │ │ │ -
412 // ReferenceElementImplementation cannot be copied.
│ │ │ │ -
413 ReferenceElementImplementation& operator= ( const ReferenceElementImplementation& ) = delete;
│ │ │ │ -
414
│ │ │ │ -
415 // ReferenceElementImplementation is default-constructible (required for storage in std::array)
│ │ │ │ -
416 ReferenceElementImplementation () = default;
│ │ │ │ -
417
│ │ │ │ -
422 int size ( int c ) const
│ │ │ │ -
423 {
│ │ │ │ -
424 assert( (c >= 0) && (c <= dim) );
│ │ │ │ -
425 return info_[ c ].size();
│ │ │ │ -
426 }
│ │ │ │ -
427
│ │ │ │ -
439 int size ( int i, int c, int cc ) const
│ │ │ │ -
440 {
│ │ │ │ -
441 assert( (i >= 0) && (i < size( c )) );
│ │ │ │ -
442 return info_[ c ][ i ].size( cc );
│ │ │ │ -
443 }
│ │ │ │ -
444
│ │ │ │ -
458 int subEntity ( int i, int c, int ii, int cc ) const
│ │ │ │ -
459 {
│ │ │ │ -
460 assert( (i >= 0) && (i < size( c )) );
│ │ │ │ -
461 return info_[ c ][ i ].number( ii, cc );
│ │ │ │ -
462 }
│ │ │ │ -
463
│ │ │ │ -
479 auto subEntities ( int i, int c, int cc ) const
│ │ │ │ -
480 {
│ │ │ │ -
481 assert( (i >= 0) && (i < size( c )) );
│ │ │ │ -
482 return info_[ c ][ i ].numbers( cc );
│ │ │ │ -
483 }
│ │ │ │ -
484
│ │ │ │ -
493 const GeometryType &type ( int i, int c ) const
│ │ │ │ -
494 {
│ │ │ │ -
495 assert( (i >= 0) && (i < size( c )) );
│ │ │ │ -
496 return info_[ c ][ i ].type();
│ │ │ │ -
497 }
│ │ │ │ +
│ │ │ │ +
399 constexpr bool operator!=(const GeometryType& other) const {
│ │ │ │ +
400 return ! ((*this)==other);
│ │ │ │ +
401 }
│ │ │ │ +
│ │ │ │ +
402
│ │ │ │ +
│ │ │ │ +
404 constexpr bool operator < (const GeometryType& other) const {
│ │ │ │ +
405 return ( ( none_ < other.none_ )
│ │ │ │ +
406 || ( !( other.none_ < none_ )
│ │ │ │ +
407 && ( ( dim_ < other.dim_ )
│ │ │ │ +
408 || ( (other.dim_ == dim_)
│ │ │ │ +
409 && ((topologyId_ >> 1) < (other.topologyId_ >> 1) )
│ │ │ │ +
410 )
│ │ │ │ +
411 )
│ │ │ │ +
412 )
│ │ │ │ +
413 );
│ │ │ │ +
414 }
│ │ │ │ +
│ │ │ │ +
415
│ │ │ │ +
418 };
│ │ │ │ +
│ │ │ │ +
419
│ │ │ │ +
│ │ │ │ +
421 inline std::ostream& operator<< (std::ostream& s, const GeometryType& a)
│ │ │ │ +
422 {
│ │ │ │ +
423 if (a.isSimplex())
│ │ │ │ +
424 {
│ │ │ │ +
425 s << "(simplex, " << a.dim() << ")";
│ │ │ │ +
426 return s;
│ │ │ │ +
427 }
│ │ │ │ +
428 if (a.isCube())
│ │ │ │ +
429 {
│ │ │ │ +
430 s << "(cube, " << a.dim() << ")";
│ │ │ │ +
431 return s;
│ │ │ │ +
432 }
│ │ │ │ +
433 if (a.isPyramid())
│ │ │ │ +
434 {
│ │ │ │ +
435 s << "(pyramid, 3)";
│ │ │ │ +
436 return s;
│ │ │ │ +
437 }
│ │ │ │ +
438 if (a.isPrism())
│ │ │ │ +
439 {
│ │ │ │ +
440 s << "(prism, 3)";
│ │ │ │ +
441 return s;
│ │ │ │ +
442 }
│ │ │ │ +
443 if (a.isNone())
│ │ │ │ +
444 {
│ │ │ │ +
445 s << "(none, " << a.dim() << ")";
│ │ │ │ +
446 return s;
│ │ │ │ +
447 }
│ │ │ │ +
448 s << "(other [" << a.id() << "], " << a.dim() << ")";
│ │ │ │ +
449 return s;
│ │ │ │ +
450 }
│ │ │ │ +
│ │ │ │ +
451
│ │ │ │ +
452
│ │ │ │ +
454
│ │ │ │ +
│ │ │ │ +
458 namespace GeometryTypes {
│ │ │ │ +
459
│ │ │ │ +
461
│ │ │ │ +
464 inline constexpr GeometryType simplex(unsigned int dim)
│ │ │ │ +
465 {
│ │ │ │ +
466 return GeometryType(0,dim,false);
│ │ │ │ +
467 }
│ │ │ │ +
468
│ │ │ │ +
470
│ │ │ │ +
473 inline constexpr GeometryType cube(unsigned int dim)
│ │ │ │ +
474 {
│ │ │ │ +
475 return GeometryType(((dim>1) ? ((1 << dim) - 1) : 0),dim,false);
│ │ │ │ +
476 }
│ │ │ │ +
477
│ │ │ │ +
479
│ │ │ │ +
482 inline constexpr GeometryType none(unsigned int dim)
│ │ │ │ +
483 {
│ │ │ │ +
484 return GeometryType(0,dim,true);
│ │ │ │ +
485 }
│ │ │ │ +
486
│ │ │ │ +
488 inline constexpr GeometryType conicalExtension(const GeometryType& gt)
│ │ │ │ +
489 {
│ │ │ │ +
490 return GeometryType(gt.id(), gt.dim()+1, gt.isNone());
│ │ │ │ +
491 }
│ │ │ │ +
492
│ │ │ │ +
494 inline constexpr GeometryType prismaticExtension(const GeometryType& gt)
│ │ │ │ +
495 {
│ │ │ │ +
496 return GeometryType(gt.id() | ((1 << gt.dim())), gt.dim()+1, gt.isNone());
│ │ │ │ +
497 }
│ │ │ │
498
│ │ │ │ -
500 const GeometryType &type () const { return type( 0, 0 ); }
│ │ │ │ -
501
│ │ │ │ -
511 const Coordinate &position( int i, int c ) const
│ │ │ │ -
512 {
│ │ │ │ -
513 assert( (c >= 0) && (c <= dim) );
│ │ │ │ -
514 return baryCenters_[ c ][ i ];
│ │ │ │ -
515 }
│ │ │ │ +
499#ifndef __cpp_inline_variables
│ │ │ │ +
500 namespace {
│ │ │ │ +
501#endif
│ │ │ │ +
502
│ │ │ │ +
504
│ │ │ │ +
507 DUNE_INLINE_VARIABLE constexpr GeometryType vertex = GeometryType(0,0,false);
│ │ │ │ +
508
│ │ │ │ +
510
│ │ │ │ +
513 DUNE_INLINE_VARIABLE constexpr GeometryType line = GeometryType(0,1,false);
│ │ │ │ +
514
│ │ │ │
516
│ │ │ │ -
524 bool checkInside ( const Coordinate &local ) const
│ │ │ │ -
525 {
│ │ │ │ -
526 const ctype tolerance = ctype( 64 ) * std::numeric_limits< ctype >::epsilon();
│ │ │ │ -
527 return Impl::template checkInside< ctype, dim >( type().id(), dim, local, tolerance );
│ │ │ │ -
528 }
│ │ │ │ -
529
│ │ │ │ -
541 template< int codim >
│ │ │ │ -
542 typename Codim< codim >::Geometry geometry ( int i ) const
│ │ │ │ -
543 {
│ │ │ │ -
544 return std::get< codim >( geometries_ )[ i ];
│ │ │ │ -
545 }
│ │ │ │ +
519 DUNE_INLINE_VARIABLE constexpr GeometryType triangle = simplex(2);
│ │ │ │ +
520
│ │ │ │ +
522
│ │ │ │ +
525 DUNE_INLINE_VARIABLE constexpr GeometryType quadrilateral = cube(2);
│ │ │ │ +
526
│ │ │ │ +
528
│ │ │ │ +
531 DUNE_INLINE_VARIABLE constexpr GeometryType tetrahedron = simplex(3);
│ │ │ │ +
532
│ │ │ │ +
534
│ │ │ │ +
537 DUNE_INLINE_VARIABLE constexpr GeometryType pyramid = GeometryType(0b0011,3,false);
│ │ │ │ +
538
│ │ │ │ +
540
│ │ │ │ +
543 DUNE_INLINE_VARIABLE constexpr GeometryType prism = GeometryType(0b0101,3,false);
│ │ │ │ +
544
│ │ │ │
546
│ │ │ │ -
548 Volume volume () const
│ │ │ │ -
549 {
│ │ │ │ -
550 return volume_;
│ │ │ │ -
551 }
│ │ │ │ -
552
│ │ │ │ -
560 const Coordinate &integrationOuterNormal ( int face ) const
│ │ │ │ -
561 {
│ │ │ │ -
562 assert( (face >= 0) && (face < int( integrationNormals_.size() )) );
│ │ │ │ -
563 return integrationNormals_[ face ];
│ │ │ │ -
564 }
│ │ │ │ +
549 DUNE_INLINE_VARIABLE constexpr GeometryType hexahedron = cube(3);
│ │ │ │ +
550
│ │ │ │ +
551#ifndef __cpp_inline_variables
│ │ │ │ +
552 }
│ │ │ │ +
553#endif
│ │ │ │ +
554
│ │ │ │ +
555 }
│ │ │ │ +
│ │ │ │ +
556
│ │ │ │ +
557 namespace Impl
│ │ │ │ +
558 {
│ │ │ │ +
559
│ │ │ │ +
561 inline constexpr GeometryType getBase(const GeometryType& gt) {
│ │ │ │ +
562 return GeometryType(gt.id() & ((1 << (gt.dim()-1))-1), gt.dim()-1, gt.isNone());
│ │ │ │ +
563 }
│ │ │ │ +
564
│ │ │ │
565
│ │ │ │ -
566 private:
│ │ │ │ -
567 void initialize ( unsigned int topologyId )
│ │ │ │ -
568 {
│ │ │ │ -
569 assert( topologyId < Impl::numTopologies( dim ) );
│ │ │ │ -
570
│ │ │ │ -
571 // set up subentities
│ │ │ │ -
572 for( int codim = 0; codim <= dim; ++codim )
│ │ │ │ -
573 {
│ │ │ │ -
574 const unsigned int size = Impl::size( topologyId, dim, codim );
│ │ │ │ -
575 info_[ codim ].resize( size );
│ │ │ │ -
576 for( unsigned int i = 0; i < size; ++i )
│ │ │ │ -
577 info_[ codim ][ i ].initialize( topologyId, codim, i );
│ │ │ │ -
578 }
│ │ │ │ -
579
│ │ │ │ -
580 // compute corners
│ │ │ │ -
581 const unsigned int numVertices = size( dim );
│ │ │ │ -
582 baryCenters_[ dim ].resize( numVertices );
│ │ │ │ -
583 Impl::referenceCorners( topologyId, dim, &(baryCenters_[ dim ][ 0 ]) );
│ │ │ │ +
566 // IfGeometryType
│ │ │ │ +
567 // ----------
│ │ │ │ +
568
│ │ │ │ +
569 template< template< GeometryType::Id > class Operation, int dim, GeometryType::Id geometryId = GeometryTypes::vertex >
│ │ │ │ +
570 struct IfGeometryType
│ │ │ │ +
571 {
│ │ │ │ +
572 static constexpr GeometryType geometry = geometryId;
│ │ │ │ +
573 template< class... Args >
│ │ │ │ +
574 static auto apply ( GeometryType gt, Args &&... args )
│ │ │ │ +
575 {
│ │ │ │ +
576 GeometryType lowerGeometry(gt.id() >>1 , gt.dim()-1, gt.isNone());
│ │ │ │ +
577
│ │ │ │ +
578 if( gt.id() & 1 )
│ │ │ │ +
579 return IfGeometryType< Operation, dim-1, GeometryTypes::prismaticExtension(geometry).toId() >::apply( lowerGeometry, std::forward< Args >( args )... );
│ │ │ │ +
580 else
│ │ │ │ +
581 return IfGeometryType< Operation, dim-1, GeometryTypes::conicalExtension(geometry).toId() >::apply( lowerGeometry, std::forward< Args >( args )... );
│ │ │ │ +
582 }
│ │ │ │ +
583 };
│ │ │ │
584
│ │ │ │ -
585 // compute barycenters
│ │ │ │ -
586 for( int codim = 0; codim < dim; ++codim )
│ │ │ │ -
587 {
│ │ │ │ -
588 baryCenters_[ codim ].resize( size(codim) );
│ │ │ │ -
589 for( int i = 0; i < size( codim ); ++i )
│ │ │ │ -
590 {
│ │ │ │ -
591 baryCenters_[ codim ][ i ] = Coordinate( ctype( 0 ) );
│ │ │ │ -
592 const unsigned int numCorners = size( i, codim, dim );
│ │ │ │ -
593 for( unsigned int j = 0; j < numCorners; ++j )
│ │ │ │ -
594 baryCenters_[ codim ][ i ] += baryCenters_[ dim ][ subEntity( i, codim, j, dim ) ];
│ │ │ │ -
595 baryCenters_[ codim ][ i ] *= ctype( 1 ) / ctype( numCorners );
│ │ │ │ -
596 }
│ │ │ │ -
597 }
│ │ │ │ -
598
│ │ │ │ -
599 // compute reference element volume
│ │ │ │ -
600 volume_ = Impl::template referenceVolume< ctype >( topologyId, dim );
│ │ │ │ -
601
│ │ │ │ -
602 // compute integration outer normals
│ │ │ │ -
603 if( dim > 0 )
│ │ │ │ -
604 {
│ │ │ │ -
605 integrationNormals_.resize( size( 1 ) );
│ │ │ │ -
606 Impl::referenceIntegrationOuterNormals( topologyId, dim, &(integrationNormals_[ 0 ]) );
│ │ │ │ -
607 }
│ │ │ │ -
608
│ │ │ │ -
609 // set up geometries
│ │ │ │ -
610 Hybrid::forEach( std::make_index_sequence< dim+1 >{}, [ & ]( auto i ){ CreateGeometries< i >::apply( *this, geometries_ ); } );
│ │ │ │ -
611 }
│ │ │ │ -
612
│ │ │ │ -
613 template< int... codim >
│ │ │ │ -
614 static std::tuple< std::vector< typename Codim< codim >::Geometry >... >
│ │ │ │ -
615 makeGeometryTable ( std::integer_sequence< int, codim... > );
│ │ │ │ -
616
│ │ │ │ -
618 typedef decltype( makeGeometryTable( std::make_integer_sequence< int, dim+1 >() ) ) GeometryTable;
│ │ │ │ -
619
│ │ │ │ -
621 ctype volume_;
│ │ │ │ -
622
│ │ │ │ -
623 std::vector< Coordinate > baryCenters_[ dim+1 ];
│ │ │ │ -
624 std::vector< Coordinate > integrationNormals_;
│ │ │ │ -
625
│ │ │ │ -
627 GeometryTable geometries_;
│ │ │ │ -
628
│ │ │ │ -
629 std::vector< SubEntityInfo > info_[ dim+1 ];
│ │ │ │ -
630 };
│ │ │ │ -
631
│ │ │ │ -
633 template< class ctype, int dim >
│ │ │ │ -
634 struct ReferenceElementImplementation< ctype, dim >::SubEntityInfo
│ │ │ │ -
635 {
│ │ │ │ -
636 // Compute upper bound for the number of subsentities.
│ │ │ │ -
637 // If someone knows an explicit formal feel free to
│ │ │ │ -
638 // implement it here.
│ │ │ │ -
639 static constexpr std::size_t maxSubEntityCount()
│ │ │ │ -
640 {
│ │ │ │ -
641 std::size_t maxCount=0;
│ │ │ │ -
642 for(std::size_t codim=0; codim<=dim; ++codim)
│ │ │ │ -
643 maxCount = std::max(maxCount, binomial(std::size_t(dim),codim)*(1 << codim));
│ │ │ │ -
644 return maxCount;
│ │ │ │ -
645 }
│ │ │ │ -
646
│ │ │ │ -
647 using SubEntityFlags = std::bitset<maxSubEntityCount()>;
│ │ │ │ -
648
│ │ │ │ -
649 class SubEntityRange
│ │ │ │ -
650 : public Dune::IteratorRange<const unsigned int*>
│ │ │ │ -
651 {
│ │ │ │ -
652 using Base = typename Dune::IteratorRange<const unsigned int*>;
│ │ │ │ -
653
│ │ │ │ -
654 public:
│ │ │ │ -
655
│ │ │ │ -
656 using iterator = Base::iterator;
│ │ │ │ -
657 using const_iterator = Base::const_iterator;
│ │ │ │ -
658
│ │ │ │ -
659 SubEntityRange(const iterator& begin, const iterator& end, const SubEntityFlags& contains) :
│ │ │ │ -
660 Base(begin, end),
│ │ │ │ -
661 containsPtr_(&contains),
│ │ │ │ -
662 size_(end-begin)
│ │ │ │ -
663 {}
│ │ │ │ -
664
│ │ │ │ -
665 SubEntityRange() :
│ │ │ │ -
666 Base(),
│ │ │ │ -
667 containsPtr_(nullptr),
│ │ │ │ -
668 size_(0)
│ │ │ │ -
669 {}
│ │ │ │ -
670
│ │ │ │ -
671 std::size_t size() const
│ │ │ │ -
672 {
│ │ │ │ -
673 return size_;
│ │ │ │ -
674 }
│ │ │ │ -
675
│ │ │ │ -
676 bool contains(std::size_t i) const
│ │ │ │ -
677 {
│ │ │ │ -
678 return (*containsPtr_)[i];
│ │ │ │ -
679 }
│ │ │ │ -
680
│ │ │ │ -
681 private:
│ │ │ │ -
682 const SubEntityFlags* containsPtr_;
│ │ │ │ -
683 std::size_t size_;
│ │ │ │ -
684 std::size_t offset_;
│ │ │ │ -
685 };
│ │ │ │ -
686
│ │ │ │ -
687 using NumberRange = typename Dune::IteratorRange<const unsigned int*>;
│ │ │ │ -
688
│ │ │ │ -
689 SubEntityInfo ()
│ │ │ │ -
690 : numbering_( nullptr )
│ │ │ │ -
691 {
│ │ │ │ -
692 std::fill( offset_.begin(), offset_.end(), 0 );
│ │ │ │ -
693 }
│ │ │ │ -
694
│ │ │ │ -
695 SubEntityInfo ( const SubEntityInfo &other )
│ │ │ │ -
696 : offset_( other.offset_ ),
│ │ │ │ -
697 type_( other.type_ ),
│ │ │ │ -
698 containsSubentity_( other.containsSubentity_ )
│ │ │ │ -
699 {
│ │ │ │ -
700 numbering_ = allocate();
│ │ │ │ -
701 std::copy( other.numbering_, other.numbering_ + capacity(), numbering_ );
│ │ │ │ -
702 }
│ │ │ │ -
703
│ │ │ │ -
704 ~SubEntityInfo () { deallocate( numbering_ ); }
│ │ │ │ -
705
│ │ │ │ -
706 const SubEntityInfo &operator= ( const SubEntityInfo &other )
│ │ │ │ -
707 {
│ │ │ │ -
708 type_ = other.type_;
│ │ │ │ -
709 offset_ = other.offset_;
│ │ │ │ -
710
│ │ │ │ -
711 deallocate( numbering_ );
│ │ │ │ -
712 numbering_ = allocate();
│ │ │ │ -
713 std::copy( other.numbering_, other.numbering_ + capacity(), numbering_ );
│ │ │ │ -
714
│ │ │ │ -
715 containsSubentity_ = other.containsSubentity_;
│ │ │ │ -
716
│ │ │ │ -
717 return *this;
│ │ │ │ -
718 }
│ │ │ │ -
719
│ │ │ │ -
720 int size ( int cc ) const
│ │ │ │ -
721 {
│ │ │ │ -
722 assert( (cc >= 0) && (cc <= dim) );
│ │ │ │ -
723 return (offset_[ cc+1 ] - offset_[ cc ]);
│ │ │ │ -
724 }
│ │ │ │ -
725
│ │ │ │ -
726 int number ( int ii, int cc ) const
│ │ │ │ -
727 {
│ │ │ │ -
728 assert( (ii >= 0) && (ii < size( cc )) );
│ │ │ │ -
729 return numbering_[ offset_[ cc ] + ii ];
│ │ │ │ -
730 }
│ │ │ │ -
731
│ │ │ │ -
732 auto numbers ( int cc ) const
│ │ │ │ -
733 {
│ │ │ │ -
734 return SubEntityRange( numbering_ + offset_[ cc ], numbering_ + offset_[ cc+1 ], containsSubentity_[cc]);
│ │ │ │ -
735 }
│ │ │ │ -
736
│ │ │ │ -
737 const GeometryType &type () const { return type_; }
│ │ │ │ -
738
│ │ │ │ -
739 void initialize ( unsigned int topologyId, int codim, unsigned int i )
│ │ │ │ -
740 {
│ │ │ │ -
741 const unsigned int subId = Impl::subTopologyId( topologyId, dim, codim, i );
│ │ │ │ -
742 type_ = GeometryType( subId, dim-codim );
│ │ │ │ -
743
│ │ │ │ -
744 // compute offsets
│ │ │ │ -
745 for( int cc = 0; cc <= codim; ++cc )
│ │ │ │ -
746 offset_[ cc ] = 0;
│ │ │ │ -
747 for( int cc = codim; cc <= dim; ++cc )
│ │ │ │ -
748 offset_[ cc+1 ] = offset_[ cc ] + Impl::size( subId, dim-codim, cc-codim );
│ │ │ │ -
749
│ │ │ │ -
750 // compute subnumbering
│ │ │ │ -
751 deallocate( numbering_ );
│ │ │ │ -
752 numbering_ = allocate();
│ │ │ │ -
753 for( int cc = codim; cc <= dim; ++cc )
│ │ │ │ -
754 Impl::subTopologyNumbering( topologyId, dim, codim, i, cc-codim, numbering_+offset_[ cc ], numbering_+offset_[ cc+1 ] );
│ │ │ │ -
755
│ │ │ │ -
756 // initialize containsSubentity lookup-table
│ │ │ │ -
757 for(std::size_t cc=0; cc<= dim; ++cc)
│ │ │ │ -
758 {
│ │ │ │ -
759 containsSubentity_[cc].reset();
│ │ │ │ -
760 for(std::size_t idx=0; idx<std::size_t(size(cc)); ++idx)
│ │ │ │ -
761 containsSubentity_[cc][number(idx,cc)] = true;
│ │ │ │ -
762 }
│ │ │ │ -
763 }
│ │ │ │ -
764
│ │ │ │ -
765 protected:
│ │ │ │ -
766 int codim () const { return dim - type().dim(); }
│ │ │ │ -
767
│ │ │ │ -
768 unsigned int *allocate () { return (capacity() != 0 ? new unsigned int[ capacity() ] : nullptr); }
│ │ │ │ -
769 void deallocate ( unsigned int *ptr ) { delete[] ptr; }
│ │ │ │ -
770 unsigned int capacity () const { return offset_[ dim+1 ]; }
│ │ │ │ -
771
│ │ │ │ -
772 private:
│ │ │ │ -
773 unsigned int *numbering_;
│ │ │ │ -
774 std::array< unsigned int, dim+2 > offset_;
│ │ │ │ -
775 GeometryType type_;
│ │ │ │ -
776 std::array< SubEntityFlags, dim+1> containsSubentity_;
│ │ │ │ -
777 };
│ │ │ │ -
778
│ │ │ │ -
779
│ │ │ │ -
780 template< class ctype, int dim >
│ │ │ │ -
781 template< int codim >
│ │ │ │ -
782 struct ReferenceElementImplementation< ctype, dim >::CreateGeometries
│ │ │ │ -
783 {
│ │ │ │ -
784 template< int cc >
│ │ │ │ -
785 static typename ReferenceElements< ctype, dim-cc >::ReferenceElement
│ │ │ │ -
786 subRefElement( const ReferenceElementImplementation< ctype, dim > &refElement, int i, std::integral_constant< int, cc > )
│ │ │ │ -
787 {
│ │ │ │ -
788 return ReferenceElements< ctype, dim-cc >::general( refElement.type( i, cc ) );
│ │ │ │ -
789 }
│ │ │ │ -
790
│ │ │ │ - │ │ │ │ -
792 subRefElement(const ReferenceElementImplementation< ctype, dim > &refElement,
│ │ │ │ -
793 [[maybe_unused]] int i, std::integral_constant<int, 0>)
│ │ │ │ -
794 {
│ │ │ │ -
795 return refElement;
│ │ │ │ -
796 }
│ │ │ │ -
797
│ │ │ │ -
798 static void apply ( const ReferenceElementImplementation< ctype, dim > &refElement, GeometryTable &geometries )
│ │ │ │ -
799 {
│ │ │ │ -
800 const int size = refElement.size( codim );
│ │ │ │ -
801 std::vector< FieldVector< ctype, dim > > origins( size );
│ │ │ │ -
802 std::vector< FieldMatrix< ctype, dim - codim, dim > > jacobianTransposeds( size );
│ │ │ │ -
803 Impl::referenceEmbeddings( refElement.type().id(), dim, codim, &(origins[ 0 ]), &(jacobianTransposeds[ 0 ]) );
│ │ │ │ -
804
│ │ │ │ -
805 std::get< codim >( geometries ).reserve( size );
│ │ │ │ -
806 for( int i = 0; i < size; ++i )
│ │ │ │ -
807 {
│ │ │ │ -
808 typename Codim< codim >::Geometry geometry( subRefElement( refElement, i, std::integral_constant< int, codim >() ), origins[ i ], jacobianTransposeds[ i ] );
│ │ │ │ -
809 std::get< codim >( geometries ).push_back( geometry );
│ │ │ │ -
810 }
│ │ │ │ -
811 }
│ │ │ │ -
812 };
│ │ │ │ -
813
│ │ │ │ -
814#endif // DOXYGEN
│ │ │ │ -
815
│ │ │ │ -
816 } // namespace Geo
│ │ │ │ -
817
│ │ │ │ -
818} // namespace Dune
│ │ │ │ -
819
│ │ │ │ -
820#endif // #ifndef DUNE_GEOMETRY_REFERENCEELEMENTIMPLEMENTATION_HH
│ │ │ │ - │ │ │ │ -
An implementation of the Geometry interface for affine geometries.
│ │ │ │ -
A unique label for each type of element that can occur in a grid.
│ │ │ │ +
585 template< template< GeometryType::Id > class Operation, GeometryType::Id geometryId >
│ │ │ │ +
586 struct IfGeometryType< Operation, 0, geometryId>
│ │ │ │ +
587 {
│ │ │ │ +
588 template< class... Args >
│ │ │ │ +
589 static auto apply ([[maybe_unused]] GeometryType gt, Args &&... args )
│ │ │ │ +
590 {
│ │ │ │ +
591 return Operation< geometryId >::apply( std::forward< Args >( args )... );
│ │ │ │ +
592 }
│ │ │ │ +
593 };
│ │ │ │ +
594 } // namespace Impl
│ │ │ │ +
595} // namespace Dune
│ │ │ │ +
596
│ │ │ │ +
597#endif // DUNE_GEOMETRY_TYPE_HH
│ │ │ │ + │ │ │ │
Definition affinegeometry.hh:21
│ │ │ │ -
@ size
Definition quadraturerules.hh:145
│ │ │ │ -
int binomial(int upper, int lower)
calculate
Definition simplex.cc:305
│ │ │ │ -
typename Container::ReferenceElement ReferenceElement
The reference element type.
Definition referenceelements.hh:188
│ │ │ │ -
static const ReferenceElement & general(const GeometryType &type)
get general reference elements
Definition referenceelements.hh:198
│ │ │ │ +
std::ostream & operator<<(std::ostream &s, const GeometryType &a)
Prints the type to an output stream.
Definition type.hh:421
│ │ │ │ +
Unique label for each type of entities that can occur in DUNE grids.
Definition type.hh:126
│ │ │ │ +
constexpr GeometryType(unsigned int topologyId, unsigned int dim)
Constructor, using the topologyId (integer) and the dimension.
Definition type.hh:263
│ │ │ │ +
constexpr bool operator<(const GeometryType &other) const
less-than operation for use with maps
Definition type.hh:404
│ │ │ │ +
constexpr bool operator!=(const GeometryType &other) const
Check for inequality.
Definition type.hh:399
│ │ │ │ +
constexpr bool isPyramid() const
Return true if entity is a pyramid.
Definition type.hh:316
│ │ │ │ +
constexpr bool isTetrahedron() const
Return true if entity is a tetrahedron.
Definition type.hh:311
│ │ │ │ +
constexpr bool isPrism() const
Return true if entity is a prism.
Definition type.hh:321
│ │ │ │ +
constexpr bool isVertex() const
Return true if entity is a vertex.
Definition type.hh:291
│ │ │ │ +
constexpr bool operator==(const GeometryType &other) const
Check for equality. This method knows that in dimension 0 and 1 all BasicTypes are equal.
Definition type.hh:388
│ │ │ │ +
constexpr Id toId() const
Create an Id representation of this GeometryType.
Definition type.hh:222
│ │ │ │ +
constexpr bool isConical(const int &step) const
Return true if entity was constructed with a conical product in the chosen step.
Definition type.hh:349
│ │ │ │ +
constexpr unsigned int dim() const
Return dimension of the type.
Definition type.hh:372
│ │ │ │ +
constexpr bool isPrismatic(const int &step) const
Return true if entity was constructed with a prismatic product in the chosen step.
Definition type.hh:362
│ │ │ │ +
constexpr bool isTriangle() const
Return true if entity is a triangle.
Definition type.hh:301
│ │ │ │ +
GeometryType(TopologyType t)
Constructor from static TopologyType class.
Definition type.hh:279
│ │ │ │ +
constexpr GeometryType(unsigned int topologyId, unsigned int dim, bool isNone)
Constructor, using the topologyId (integer), the dimension and a flag for type none.
Definition type.hh:254
│ │ │ │ +
BasicType
Each entity can be tagged by one of these basic types plus its space dimension.
Definition type.hh:132
│ │ │ │ +
@ cube
Cube element in any nonnegative dimension.
Definition type.hh:134
│ │ │ │ +
@ simplex
Simplicial element in any nonnegative dimension.
Definition type.hh:133
│ │ │ │ +
@ pyramid
Four sided pyramid in three dimensions.
Definition type.hh:135
│ │ │ │ +
@ extended
Other, more general topology, representable as topologyId.
Definition type.hh:137
│ │ │ │ +
@ none
Even more general topology, cannot be specified by a topologyId. Two GeometryTypes with 'none' type a...
Definition type.hh:138
│ │ │ │ +
@ prism
Prism element in three dimensions.
Definition type.hh:136
│ │ │ │ +
constexpr GeometryType(Id id)
Reconstruct a Geometry type from a GeometryType::Id.
Definition type.hh:234
│ │ │ │ +
constexpr bool isCube() const
Return true if entity is a cube of any dimension.
Definition type.hh:336
│ │ │ │ +
constexpr GeometryType()
Default constructor, not initializing anything.
Definition type.hh:244
│ │ │ │ +
constexpr bool isConical() const
Return true if entity was constructed with a conical product in the last step.
Definition type.hh:341
│ │ │ │ +
constexpr bool isLine() const
Return true if entity is a line segment.
Definition type.hh:296
│ │ │ │ +
constexpr bool isQuadrilateral() const
Return true if entity is a quadrilateral.
Definition type.hh:306
│ │ │ │ +
constexpr bool isPrismatic() const
Return true if entity was constructed with a prismatic product in the last step.
Definition type.hh:354
│ │ │ │ +
constexpr unsigned int id() const
Return the topology id of the type.
Definition type.hh:377
│ │ │ │ +
constexpr bool isNone() const
Return true if entity is a singular of any dimension.
Definition type.hh:367
│ │ │ │ +
constexpr bool isHexahedron() const
Return true if entity is a hexahedron.
Definition type.hh:326
│ │ │ │ +
constexpr bool isSimplex() const
Return true if entity is a simplex of any dimension.
Definition type.hh:331
│ │ │ │ +
IdType Id
An integral id representing a GeometryType.
Definition type.hh:193
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -7,771 +7,567 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ -referenceelementimplementation.hh │ │ │ │ │ +type.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception │ │ │ │ │ - 5#ifndef DUNE_GEOMETRY_REFERENCEELEMENTIMPLEMENTATION_HH │ │ │ │ │ - 6#define DUNE_GEOMETRY_REFERENCEELEMENTIMPLEMENTATION_HH │ │ │ │ │ + 5#ifndef DUNE_GEOMETRY_TYPE_HH │ │ │ │ │ + 6#define DUNE_GEOMETRY_TYPE_HH │ │ │ │ │ 7 │ │ │ │ │ - 8#include │ │ │ │ │ - 9 │ │ │ │ │ - 10#include │ │ │ │ │ - 11#include │ │ │ │ │ - 12#include │ │ │ │ │ - 13#include │ │ │ │ │ - 14#include │ │ │ │ │ - 15#include │ │ │ │ │ - 16#include │ │ │ │ │ + 12#include │ │ │ │ │ + 13#include │ │ │ │ │ + 14 │ │ │ │ │ + 15#include │ │ │ │ │ + 16#include │ │ │ │ │ 17 │ │ │ │ │ - 18#include │ │ │ │ │ - 19#include │ │ │ │ │ - 20#include │ │ │ │ │ - 21#include │ │ │ │ │ - 22#include │ │ │ │ │ - 23#include │ │ │ │ │ - 24 │ │ │ │ │ - 25#include │ │ │ │ │ - 26#include │ │ │ │ │ - 27#include │ │ │ │ │ + 18#include │ │ │ │ │ + 19#include │ │ │ │ │ + 20#include │ │ │ │ │ + 21#include │ │ │ │ │ + 22 │ │ │ │ │ + 23namespace Dune │ │ │ │ │ + 24{ │ │ │ │ │ + 25 │ │ │ │ │ + 26 namespace Impl │ │ │ │ │ + 27 { │ │ │ │ │ 28 │ │ │ │ │ - 29namespace Dune │ │ │ │ │ - 30{ │ │ │ │ │ - 31 │ │ │ │ │ - 32 namespace Geo │ │ │ │ │ - 33 { │ │ │ │ │ - 34 │ │ │ │ │ - 35#ifndef DOXYGEN │ │ │ │ │ - 36 │ │ │ │ │ - 37 // Internal Forward Declarations │ │ │ │ │ - 38 // ----------------------------- │ │ │ │ │ - 39 │ │ │ │ │ - 40 namespace Impl │ │ │ │ │ - 41 { │ │ │ │ │ - 42 template< class ctype, int dim > │ │ │ │ │ - 43 class ReferenceElementContainer; │ │ │ │ │ - 44 } │ │ │ │ │ - 45 │ │ │ │ │ - 46 template< class ctype, int dim > │ │ │ │ │ - 47 struct ReferenceElements; │ │ │ │ │ - 48 │ │ │ │ │ - 49 │ │ │ │ │ - 50 │ │ │ │ │ - 51 namespace Impl │ │ │ │ │ - 52 { │ │ │ │ │ - 53 │ │ │ │ │ - 54 using Dune::Impl::isPrism; │ │ │ │ │ - 55 using Dune::Impl::isPyramid; │ │ │ │ │ - 56 using Dune::Impl::baseTopologyId; │ │ │ │ │ - 57 using Dune::Impl::prismConstruction; │ │ │ │ │ - 58 using Dune::Impl::pyramidConstruction; │ │ │ │ │ - 59 using Dune::Impl::numTopologies; │ │ │ │ │ - 60 │ │ │ │ │ - 62 unsigned int size ( unsigned int topologyId, int dim, int codim ); │ │ │ │ │ - 63 │ │ │ │ │ + 29 enum TopologyConstruction { pyramidConstruction = 0, prismConstruction = 1 │ │ │ │ │ +}; │ │ │ │ │ + 30 │ │ │ │ │ + 31 // Dynamic Topology Properties │ │ │ │ │ + 32 // --------------------------- │ │ │ │ │ + 33 │ │ │ │ │ + 42 inline static unsigned int numTopologies ( int dim ) noexcept │ │ │ │ │ + 43 { │ │ │ │ │ + 44 return (1u << dim); │ │ │ │ │ + 45 } │ │ │ │ │ + 46 │ │ │ │ │ + 58 inline bool static isPyramid ( unsigned int topologyId, int dim, int codim │ │ │ │ │ += 0 ) noexcept │ │ │ │ │ + 59 { │ │ │ │ │ + 60 assert( (dim > 0) && (topologyId < numTopologies( dim )) ); │ │ │ │ │ + 61 assert( (0 <= codim) && (codim < dim) ); │ │ │ │ │ + 62 return (((topologyId & ~1) & (1u << (dim-codim-1))) == 0); │ │ │ │ │ + 63 } │ │ │ │ │ 64 │ │ │ │ │ - 65 │ │ │ │ │ - 73 unsigned int subTopologyId ( unsigned int topologyId, int dim, int codim, │ │ │ │ │ -unsigned int i ); │ │ │ │ │ - 74 │ │ │ │ │ - 75 │ │ │ │ │ - 76 │ │ │ │ │ - 77 // subTopologyNumbering │ │ │ │ │ - 78 // -------------------- │ │ │ │ │ - 79 │ │ │ │ │ - 80 void subTopologyNumbering ( unsigned int topologyId, int dim, int codim, │ │ │ │ │ -unsigned int i, int subcodim, │ │ │ │ │ - 81 unsigned int *beginOut, unsigned int *endOut ); │ │ │ │ │ + 76 inline static bool isPrism ( unsigned int topologyId, int dim, int codim = │ │ │ │ │ +0 ) noexcept │ │ │ │ │ + 77 { │ │ │ │ │ + 78 assert( (dim > 0) && (topologyId < numTopologies( dim )) ); │ │ │ │ │ + 79 assert( (0 <= codim) && (codim < dim) ); │ │ │ │ │ + 80 return (( (topologyId | 1) & (1u << (dim-codim-1))) != 0); │ │ │ │ │ + 81 } │ │ │ │ │ 82 │ │ │ │ │ - 83 │ │ │ │ │ - 84 │ │ │ │ │ - 85 │ │ │ │ │ - 86 // checkInside │ │ │ │ │ - 87 // ----------- │ │ │ │ │ - 88 │ │ │ │ │ - 89 template< class ct, int cdim > │ │ │ │ │ - 90 inline bool │ │ │ │ │ - 91 checkInside ( unsigned int topologyId, int dim, const FieldVector< ct, cdim │ │ │ │ │ -> &x, ct tolerance, ct factor = ct( 1 ) ) │ │ │ │ │ - 92 { │ │ │ │ │ - 93 assert( (dim >= 0) && (dim <= cdim) ); │ │ │ │ │ - 94 assert( topologyId < numTopologies( dim ) ); │ │ │ │ │ - 95 │ │ │ │ │ - 96 if( dim > 0 ) │ │ │ │ │ - 97 { │ │ │ │ │ - 98 const ct baseFactor = (isPrism( topologyId, dim ) ? factor : factor - x │ │ │ │ │ -[ dim-1 ]); │ │ │ │ │ - 99 if( (x[ dim-1 ] > -tolerance) && (factor - x[ dim-1 ] > -tolerance) ) │ │ │ │ │ - 100 return checkInside< ct, cdim >( baseTopologyId( topologyId, dim ), dim-1, │ │ │ │ │ -x, tolerance, baseFactor ); │ │ │ │ │ - 101 else │ │ │ │ │ - 102 return false; │ │ │ │ │ - 103 } │ │ │ │ │ - 104 else │ │ │ │ │ - 105 return true; │ │ │ │ │ - 106 } │ │ │ │ │ - 107 │ │ │ │ │ - 108 │ │ │ │ │ + 90 inline static unsigned int baseTopologyId ( unsigned int topologyId, int │ │ │ │ │ +dim, int codim = 1 ) noexcept │ │ │ │ │ + 91 { │ │ │ │ │ + 92 assert( (dim >= 0) && (topologyId < numTopologies( dim )) ); │ │ │ │ │ + 93 assert( (0 <= codim) && (codim <= dim) ); │ │ │ │ │ + 94 return topologyId & ((1u << (dim-codim)) - 1); │ │ │ │ │ + 95 } │ │ │ │ │ + 96 │ │ │ │ │ + 97 } // namespace Impl │ │ │ │ │ + 98 │ │ │ │ │ + 99// the Topology classes are deprecated and will be removed for the 2.8. │ │ │ │ │ + 100// Temporarily a header 'deprecated_topology.hh' is provided which will be │ │ │ │ │ +removed after the 2.9 release. │ │ │ │ │ + 101#if __GNUC__ >= 7 │ │ │ │ │ + 102# pragma GCC diagnostic push │ │ │ │ │ + 103# pragma GCC diagnostic ignored "-Wdeprecated-declarations" │ │ │ │ │ + 104#endif │ │ │ │ │ + 105#include │ │ │ │ │ + 106#if __GNUC__ >= 7 │ │ │ │ │ + 107# pragma GCC diagnostic pop │ │ │ │ │ + 108#endif │ │ │ │ │ 109 │ │ │ │ │ - 110 // referenceCorners │ │ │ │ │ - 111 // ---------------- │ │ │ │ │ + 110 // GeometryType │ │ │ │ │ + 111 // ------------- │ │ │ │ │ 112 │ │ │ │ │ - 113 template< class ct, int cdim > │ │ │ │ │ - 114 inline unsigned int │ │ │ │ │ - 115 referenceCorners ( unsigned int topologyId, int dim, FieldVector< ct, cdim │ │ │ │ │ -> *corners ) │ │ │ │ │ - 116 { │ │ │ │ │ - 117 assert( (dim >= 0) && (dim <= cdim) ); │ │ │ │ │ - 118 assert( topologyId < numTopologies( dim ) ); │ │ │ │ │ - 119 │ │ │ │ │ - 120 if( dim > 0 ) │ │ │ │ │ - 121 { │ │ │ │ │ - 122 const unsigned int nBaseCorners │ │ │ │ │ - 123 = referenceCorners( baseTopologyId( topologyId, dim ), dim-1, corners ); │ │ │ │ │ - 124 assert( nBaseCorners == size( baseTopologyId( topologyId, dim ), dim-1, │ │ │ │ │ -dim-1 ) ); │ │ │ │ │ - 125 if( isPrism( topologyId, dim ) ) │ │ │ │ │ +125 class GeometryType │ │ │ │ │ 126 { │ │ │ │ │ - 127 std::copy( corners, corners + nBaseCorners, corners + nBaseCorners ); │ │ │ │ │ - 128 for( unsigned int i = 0; i < nBaseCorners; ++i ) │ │ │ │ │ - 129 corners[ i+nBaseCorners ][ dim-1 ] = ct( 1 ); │ │ │ │ │ - 130 return 2*nBaseCorners; │ │ │ │ │ - 131 } │ │ │ │ │ - 132 else │ │ │ │ │ - 133 { │ │ │ │ │ - 134 corners[ nBaseCorners ] = FieldVector< ct, cdim >( ct( 0 ) ); │ │ │ │ │ - 135 corners[ nBaseCorners ][ dim-1 ] = ct( 1 ); │ │ │ │ │ - 136 return nBaseCorners+1; │ │ │ │ │ - 137 } │ │ │ │ │ - 138 } │ │ │ │ │ - 139 else │ │ │ │ │ - 140 { │ │ │ │ │ - 141 *corners = FieldVector< ct, cdim >( ct( 0 ) ); │ │ │ │ │ - 142 return 1; │ │ │ │ │ - 143 } │ │ │ │ │ - 144 } │ │ │ │ │ + 127 public: │ │ │ │ │ + 128 │ │ │ │ │ +131 enum │ │ │ │ │ + 132 BasicType { │ │ │ │ │ +133 simplex, │ │ │ │ │ +134 cube, │ │ │ │ │ +135 pyramid, │ │ │ │ │ +136 prism, │ │ │ │ │ +137 extended, │ │ │ │ │ + 138 none │ │ │ │ │ +139 }; │ │ │ │ │ + 140 │ │ │ │ │ + 141 private: │ │ │ │ │ + 142 │ │ │ │ │ + 144 unsigned char dim_; │ │ │ │ │ 145 │ │ │ │ │ - 146 │ │ │ │ │ - 147 │ │ │ │ │ - 148 // referenceVolume │ │ │ │ │ - 149 // --------------- │ │ │ │ │ - 150 │ │ │ │ │ - 151 unsigned long referenceVolumeInverse ( unsigned int topologyId, int dim ); │ │ │ │ │ - 152 │ │ │ │ │ - 153 template< class ct > │ │ │ │ │ - 154 inline ct referenceVolume ( unsigned int topologyId, int dim ) │ │ │ │ │ - 155 { │ │ │ │ │ - 156 return ct( 1 ) / ct( referenceVolumeInverse( topologyId, dim ) ); │ │ │ │ │ - 157 } │ │ │ │ │ - 158 │ │ │ │ │ - 159 │ │ │ │ │ + 147 bool none_; │ │ │ │ │ + 148 │ │ │ │ │ + 150 unsigned int topologyId_; │ │ │ │ │ + 151 │ │ │ │ │ + 152 // Internal type used for the Id. The exact nature of this type is kept │ │ │ │ │ + 153 // as an implementation detail on purpose. We use a scoped enum here │ │ │ │ │ +because scoped enums │ │ │ │ │ + 154 // can be used as template parameters, but are not implicitly converted to │ │ │ │ │ +other integral │ │ │ │ │ + 155 // types by the compiler. That way, we avoid unfortunate implicit │ │ │ │ │ +conversion chains, e.g. │ │ │ │ │ + 156 // people trying to work with GlobalGeometryTypeIndex, but forgetting to │ │ │ │ │ +actually call │ │ │ │ │ + 157 // GlobalGeometryTypeIndex::index(gt) and just using gt directly. │ │ │ │ │ + 158 enum class IdType : std::uint64_t │ │ │ │ │ + 159 {}; │ │ │ │ │ 160 │ │ │ │ │ - 161 // referenceOrigins │ │ │ │ │ - 162 // ---------------- │ │ │ │ │ - 163 │ │ │ │ │ - 164 template< class ct, int cdim > │ │ │ │ │ - 165 inline unsigned int │ │ │ │ │ - 166 referenceOrigins ( unsigned int topologyId, int dim, int codim, │ │ │ │ │ -FieldVector< ct, cdim > *origins ) │ │ │ │ │ - 167 { │ │ │ │ │ - 168 assert( (dim >= 0) && (dim <= cdim) ); │ │ │ │ │ - 169 assert( topologyId < numTopologies( dim ) ); │ │ │ │ │ - 170 assert( (codim >= 0) && (codim <= dim) ); │ │ │ │ │ - 171 │ │ │ │ │ - 172 if( codim > 0 ) │ │ │ │ │ - 173 { │ │ │ │ │ - 174 const unsigned int baseId = baseTopologyId( topologyId, dim ); │ │ │ │ │ - 175 if( isPrism( topologyId, dim ) ) │ │ │ │ │ - 176 { │ │ │ │ │ - 177 const unsigned int n = (codim < dim ? referenceOrigins( baseId, dim-1, │ │ │ │ │ -codim, origins ) : 0); │ │ │ │ │ - 178 const unsigned int m = referenceOrigins( baseId, dim-1, codim-1, origins+n │ │ │ │ │ -); │ │ │ │ │ - 179 for( unsigned int i = 0; i < m; ++i ) │ │ │ │ │ - 180 { │ │ │ │ │ - 181 origins[ n+m+i ] = origins[ n+i ]; │ │ │ │ │ - 182 origins[ n+m+i ][ dim-1 ] = ct( 1 ); │ │ │ │ │ - 183 } │ │ │ │ │ - 184 return n+2*m; │ │ │ │ │ - 185 } │ │ │ │ │ - 186 else │ │ │ │ │ - 187 { │ │ │ │ │ - 188 const unsigned int m = referenceOrigins( baseId, dim-1, codim-1, origins │ │ │ │ │ -); │ │ │ │ │ - 189 if( codim == dim ) │ │ │ │ │ - 190 { │ │ │ │ │ - 191 origins[ m ] = FieldVector< ct, cdim >( ct( 0 ) ); │ │ │ │ │ - 192 origins[ m ][ dim-1 ] = ct( 1 ); │ │ │ │ │ - 193 return m+1; │ │ │ │ │ - 194 } │ │ │ │ │ - 195 else │ │ │ │ │ - 196 return m+referenceOrigins( baseId, dim-1, codim, origins+m ); │ │ │ │ │ - 197 } │ │ │ │ │ - 198 } │ │ │ │ │ - 199 else │ │ │ │ │ - 200 { │ │ │ │ │ - 201 origins[ 0 ] = FieldVector< ct, cdim >( ct( 0 ) ); │ │ │ │ │ - 202 return 1; │ │ │ │ │ - 203 } │ │ │ │ │ - 204 } │ │ │ │ │ - 205 │ │ │ │ │ - 206 │ │ │ │ │ - 207 │ │ │ │ │ - 208 // referenceEmbeddings │ │ │ │ │ - 209 // ------------------- │ │ │ │ │ - 210 │ │ │ │ │ - 211 template< class ct, int cdim, int mydim > │ │ │ │ │ - 212 inline unsigned int │ │ │ │ │ - 213 referenceEmbeddings ( unsigned int topologyId, int dim, int codim, │ │ │ │ │ - 214 FieldVector< ct, cdim > *origins, │ │ │ │ │ - 215 FieldMatrix< ct, mydim, cdim > *jacobianTransposeds ) │ │ │ │ │ - 216 { │ │ │ │ │ - 217 assert( (0 <= codim) && (codim <= dim) && (dim <= cdim) ); │ │ │ │ │ - 218 assert( (dim - codim <= mydim) && (mydim <= cdim) ); │ │ │ │ │ - 219 assert( topologyId < numTopologies( dim ) ); │ │ │ │ │ - 220 │ │ │ │ │ - 221 if( codim > 0 ) │ │ │ │ │ - 222 { │ │ │ │ │ - 223 const unsigned int baseId = baseTopologyId( topologyId, dim ); │ │ │ │ │ - 224 if( isPrism( topologyId, dim ) ) │ │ │ │ │ - 225 { │ │ │ │ │ - 226 const unsigned int n = (codim < dim ? referenceEmbeddings( baseId, dim-1, │ │ │ │ │ -codim, origins, jacobianTransposeds ) : 0); │ │ │ │ │ - 227 for( unsigned int i = 0; i < n; ++i ) │ │ │ │ │ - 228 jacobianTransposeds[ i ][ dim-codim-1 ][ dim-1 ] = ct( 1 ); │ │ │ │ │ - 229 │ │ │ │ │ - 230 const unsigned int m = referenceEmbeddings( baseId, dim-1, codim-1, │ │ │ │ │ -origins+n, jacobianTransposeds+n ); │ │ │ │ │ - 231 std::copy( origins+n, origins+n+m, origins+n+m ); │ │ │ │ │ - 232 std::copy( jacobianTransposeds+n, jacobianTransposeds+n+m, │ │ │ │ │ -jacobianTransposeds+n+m ); │ │ │ │ │ - 233 for( unsigned int i = 0; i < m; ++i ) │ │ │ │ │ - 234 origins[ n+m+i ][ dim-1 ] = ct( 1 ); │ │ │ │ │ - 235 │ │ │ │ │ - 236 return n+2*m; │ │ │ │ │ - 237 } │ │ │ │ │ - 238 else │ │ │ │ │ - 239 { │ │ │ │ │ - 240 const unsigned int m = referenceEmbeddings( baseId, dim-1, codim-1, │ │ │ │ │ -origins, jacobianTransposeds ); │ │ │ │ │ - 241 if( codim == dim ) │ │ │ │ │ - 242 { │ │ │ │ │ - 243 origins[ m ] = FieldVector< ct, cdim >( ct( 0 ) ); │ │ │ │ │ - 244 origins[ m ][ dim-1 ] = ct( 1 ); │ │ │ │ │ - 245 jacobianTransposeds[ m ] = FieldMatrix< ct, mydim, cdim >( ct( 0 ) ); │ │ │ │ │ - 246 return m+1; │ │ │ │ │ - 247 } │ │ │ │ │ - 248 else │ │ │ │ │ - 249 { │ │ │ │ │ - 250 const unsigned int n = referenceEmbeddings( baseId, dim-1, codim, │ │ │ │ │ -origins+m, jacobianTransposeds+m ); │ │ │ │ │ - 251 for( unsigned int i = 0; i < n; ++i ) │ │ │ │ │ - 252 { │ │ │ │ │ - 253 for( int k = 0; k < dim-1; ++k ) │ │ │ │ │ - 254 jacobianTransposeds[ m+i ][ dim-codim-1 ][ k ] = -origins[ m+i ][ k ]; │ │ │ │ │ - 255 jacobianTransposeds[ m+i ][ dim-codim-1 ][ dim-1 ] = ct( 1 ); │ │ │ │ │ - 256 } │ │ │ │ │ - 257 return m+n; │ │ │ │ │ - 258 } │ │ │ │ │ - 259 } │ │ │ │ │ - 260 } │ │ │ │ │ - 261 else │ │ │ │ │ - 262 { │ │ │ │ │ - 263 origins[ 0 ] = FieldVector< ct, cdim >( ct( 0 ) ); │ │ │ │ │ - 264 jacobianTransposeds[ 0 ] = FieldMatrix< ct, mydim, cdim >( ct( 0 ) ); │ │ │ │ │ - 265 for( int k = 0; k < dim; ++k ) │ │ │ │ │ - 266 jacobianTransposeds[ 0 ][ k ][ k ] = ct( 1 ); │ │ │ │ │ - 267 return 1; │ │ │ │ │ - 268 } │ │ │ │ │ - 269 } │ │ │ │ │ - 270 │ │ │ │ │ - 271 │ │ │ │ │ - 272 │ │ │ │ │ - 273 // referenceIntegrationOuterNormals │ │ │ │ │ - 274 // -------------------------------- │ │ │ │ │ - 275 │ │ │ │ │ - 276 template< class ct, int cdim > │ │ │ │ │ - 277 inline unsigned int │ │ │ │ │ - 278 referenceIntegrationOuterNormals ( unsigned int topologyId, int dim, │ │ │ │ │ - 279 const FieldVector< ct, cdim > *origins, │ │ │ │ │ - 280 FieldVector< ct, cdim > *normals ) │ │ │ │ │ + 161 public: │ │ │ │ │ + 162 │ │ │ │ │ +193 using Id = IdType; │ │ │ │ │ + 194 │ │ │ │ │ +202 constexpr operator Id() const │ │ │ │ │ + 203 { │ │ │ │ │ + 204 // recreate the exact storage layout that this class is using, making │ │ │ │ │ +conversion │ │ │ │ │ + 205 // extremely cheap │ │ │ │ │ + 206 std::uint64_t id = dim_ | (std::uint64_t(none_) << 8) | (std::uint64_t │ │ │ │ │ +(topologyId_) << 32); │ │ │ │ │ + 207 return static_cast(id); │ │ │ │ │ + 208 } │ │ │ │ │ + 209 │ │ │ │ │ +222 constexpr Id toId() const │ │ │ │ │ + 223 { │ │ │ │ │ + 224 return static_cast(*this); │ │ │ │ │ + 225 } │ │ │ │ │ + 226 │ │ │ │ │ +234 constexpr GeometryType(Id id) │ │ │ │ │ + 235 : dim_(static_cast(id) & 0xFF) │ │ │ │ │ + 236 , none_(static_cast(id) & 0x100) │ │ │ │ │ + 237 , topologyId_(static_cast(id) >> 32) │ │ │ │ │ + 238 {} │ │ │ │ │ + 239 │ │ │ │ │ + 242 │ │ │ │ │ +244 constexpr GeometryType () │ │ │ │ │ + 245 : dim_(0), none_(true), topologyId_(0) │ │ │ │ │ + 246 {} │ │ │ │ │ + 247 │ │ │ │ │ +254 constexpr GeometryType(unsigned int topologyId, unsigned int dim, bool │ │ │ │ │ +isNone) │ │ │ │ │ + 255 : dim_(dim), none_(isNone), topologyId_(topologyId) │ │ │ │ │ + 256 {} │ │ │ │ │ + 257 │ │ │ │ │ +263 constexpr GeometryType(unsigned int topologyId, unsigned int dim) │ │ │ │ │ + 264 : dim_(dim), none_(false), topologyId_(topologyId) │ │ │ │ │ + 265 {} │ │ │ │ │ + 266 │ │ │ │ │ + 277 template> │ │ │ │ │ +279 explicit GeometryType(TopologyType t) │ │ │ │ │ + 280 : dim_(TopologyType::dimension), none_(false), topologyId_(TopologyType:: │ │ │ │ │ +id) │ │ │ │ │ 281 { │ │ │ │ │ - 282 assert( (dim > 0) && (dim <= cdim) ); │ │ │ │ │ - 283 assert( topologyId < numTopologies( dim ) ); │ │ │ │ │ + 282 DUNE_UNUSED_PARAMETER(t); │ │ │ │ │ + 283 } │ │ │ │ │ 284 │ │ │ │ │ - 285 if( dim > 1 ) │ │ │ │ │ - 286 { │ │ │ │ │ - 287 const unsigned int baseId = baseTopologyId( topologyId, dim ); │ │ │ │ │ - 288 if( isPrism( topologyId, dim ) ) │ │ │ │ │ - 289 { │ │ │ │ │ - 290 const unsigned int numBaseFaces │ │ │ │ │ - 291 = referenceIntegrationOuterNormals( baseId, dim-1, origins, normals ); │ │ │ │ │ - 292 │ │ │ │ │ - 293 for( unsigned int i = 0; i < 2; ++i ) │ │ │ │ │ - 294 { │ │ │ │ │ - 295 normals[ numBaseFaces+i ] = FieldVector< ct, cdim >( ct( 0 ) ); │ │ │ │ │ - 296 normals[ numBaseFaces+i ][ dim-1 ] = ct( 2*int( i )-1 ); │ │ │ │ │ - 297 } │ │ │ │ │ - 298 │ │ │ │ │ - 299 return numBaseFaces+2; │ │ │ │ │ - 300 } │ │ │ │ │ - 301 else │ │ │ │ │ - 302 { │ │ │ │ │ - 303 normals[ 0 ] = FieldVector< ct, cdim >( ct( 0 ) ); │ │ │ │ │ - 304 normals[ 0 ][ dim-1 ] = ct( -1 ); │ │ │ │ │ - 305 │ │ │ │ │ - 306 const unsigned int numBaseFaces │ │ │ │ │ - 307 = referenceIntegrationOuterNormals( baseId, dim-1, origins+1, normals+1 ); │ │ │ │ │ - 308 for( unsigned int i = 1; i <= numBaseFaces; ++i ) │ │ │ │ │ - 309 normals[ i ][ dim-1 ] = normals[ i ]*origins[ i ]; │ │ │ │ │ - 310 │ │ │ │ │ - 311 return numBaseFaces+1; │ │ │ │ │ - 312 } │ │ │ │ │ +291 constexpr bool isVertex() const { │ │ │ │ │ + 292 return dim_==0; │ │ │ │ │ + 293 } │ │ │ │ │ + 294 │ │ │ │ │ +296 constexpr bool isLine() const { │ │ │ │ │ + 297 return dim_==1; │ │ │ │ │ + 298 } │ │ │ │ │ + 299 │ │ │ │ │ +301 constexpr bool isTriangle() const { │ │ │ │ │ + 302 return ! none_ && dim_==2 && (topologyId_ | 1) == 0b0001; │ │ │ │ │ + 303 } │ │ │ │ │ + 304 │ │ │ │ │ +306 constexpr bool isQuadrilateral() const { │ │ │ │ │ + 307 return ! none_ && dim_==2 && (topologyId_ | 1) == 0b0011; │ │ │ │ │ + 308 } │ │ │ │ │ + 309 │ │ │ │ │ +311 constexpr bool isTetrahedron() const { │ │ │ │ │ + 312 return ! none_ && dim_==3 && (topologyId_ | 1) == 0b0001; │ │ │ │ │ 313 } │ │ │ │ │ - 314 else │ │ │ │ │ - 315 { │ │ │ │ │ - 316 for( unsigned int i = 0; i < 2; ++i ) │ │ │ │ │ - 317 { │ │ │ │ │ - 318 normals[ i ] = FieldVector< ct, cdim >( ct( 0 ) ); │ │ │ │ │ - 319 normals[ i ][ 0 ] = ct( 2*int( i )-1 ); │ │ │ │ │ - 320 } │ │ │ │ │ - 321 │ │ │ │ │ - 322 return 2; │ │ │ │ │ + 314 │ │ │ │ │ +316 constexpr bool isPyramid() const { │ │ │ │ │ + 317 return ! none_ && dim_==3 && (topologyId_ | 1) == 0b0011; │ │ │ │ │ + 318 } │ │ │ │ │ + 319 │ │ │ │ │ +321 constexpr bool isPrism() const { │ │ │ │ │ + 322 return ! none_ && dim_==3 && (topologyId_ | 1) == 0b0101; │ │ │ │ │ 323 } │ │ │ │ │ - 324 } │ │ │ │ │ - 325 │ │ │ │ │ - 326 template< class ct, int cdim > │ │ │ │ │ - 327 inline unsigned int │ │ │ │ │ - 328 referenceIntegrationOuterNormals ( unsigned int topologyId, int dim, │ │ │ │ │ - 329 FieldVector< ct, cdim > *normals ) │ │ │ │ │ - 330 { │ │ │ │ │ - 331 assert( (dim > 0) && (dim <= cdim) ); │ │ │ │ │ - 332 │ │ │ │ │ - 333 FieldVector< ct, cdim > *origins │ │ │ │ │ - 334 = new FieldVector< ct, cdim >[ size( topologyId, dim, 1 ) ]; │ │ │ │ │ - 335 referenceOrigins( topologyId, dim, 1, origins ); │ │ │ │ │ - 336 │ │ │ │ │ - 337 const unsigned int numFaces │ │ │ │ │ - 338 = referenceIntegrationOuterNormals( topologyId, dim, origins, normals ); │ │ │ │ │ - 339 assert( numFaces == size( topologyId, dim, 1 ) ); │ │ │ │ │ - 340 │ │ │ │ │ - 341 delete[] origins; │ │ │ │ │ - 342 │ │ │ │ │ - 343 return numFaces; │ │ │ │ │ - 344 } │ │ │ │ │ - 345 │ │ │ │ │ - 346 } // namespace Impl │ │ │ │ │ - 347 │ │ │ │ │ - 348 │ │ │ │ │ - 349 │ │ │ │ │ - 350 // ReferenceElement │ │ │ │ │ - 351 // ---------------- │ │ │ │ │ + 324 │ │ │ │ │ +326 constexpr bool isHexahedron() const { │ │ │ │ │ + 327 return ! none_ && dim_==3 && (topologyId_ | 1) == 0b0111; │ │ │ │ │ + 328 } │ │ │ │ │ + 329 │ │ │ │ │ +331 constexpr bool isSimplex() const { │ │ │ │ │ + 332 return ! none_ && (topologyId_ | 1) == 1; │ │ │ │ │ + 333 } │ │ │ │ │ + 334 │ │ │ │ │ +336 constexpr bool isCube() const { │ │ │ │ │ + 337 return ! none_ && ((topologyId_ ^ ((1 << dim_)-1)) >> 1 == 0); │ │ │ │ │ + 338 } │ │ │ │ │ + 339 │ │ │ │ │ +341 constexpr bool isConical() const { │ │ │ │ │ + 342 return ! none_ && (((topologyId_ & ~1) & (1u << (dim_-1))) == 0); │ │ │ │ │ + 343 } │ │ │ │ │ + 344 │ │ │ │ │ +349 constexpr bool isConical(const int& step) const { │ │ │ │ │ + 350 return ! none_ && (((topologyId_ & ~1) & (1u << step)) == 0); │ │ │ │ │ + 351 } │ │ │ │ │ 352 │ │ │ │ │ - 371 template< class ctype_, int dim > │ │ │ │ │ - 372 class ReferenceElementImplementation │ │ │ │ │ - 373 { │ │ │ │ │ - 374 │ │ │ │ │ - 375 public: │ │ │ │ │ - 376 │ │ │ │ │ - 378 using ctype = ctype_; │ │ │ │ │ - 379 │ │ │ │ │ - 381 using CoordinateField = ctype; │ │ │ │ │ - 382 │ │ │ │ │ - 384 using Coordinate = Dune::FieldVector; │ │ │ │ │ - 385 │ │ │ │ │ - 387 static constexpr int dimension = dim; │ │ │ │ │ - 388 │ │ │ │ │ - 390 typedef ctype Volume; │ │ │ │ │ - 391 │ │ │ │ │ - 392 private: │ │ │ │ │ - 393 │ │ │ │ │ - 394 friend class Impl::ReferenceElementContainer< ctype, dim >; │ │ │ │ │ - 395 │ │ │ │ │ - 396 struct SubEntityInfo; │ │ │ │ │ +354 constexpr bool isPrismatic() const { │ │ │ │ │ + 355 return ! none_ && (( (topologyId_ | 1) & (1u << (dim_-1))) != 0); │ │ │ │ │ + 356 } │ │ │ │ │ + 357 │ │ │ │ │ +362 constexpr bool isPrismatic(const int& step) const { │ │ │ │ │ + 363 return ! none_ && (( (topologyId_ | 1) & (1u << step)) != 0); │ │ │ │ │ + 364 } │ │ │ │ │ + 365 │ │ │ │ │ +367 constexpr bool isNone() const { │ │ │ │ │ + 368 return none_; │ │ │ │ │ + 369 } │ │ │ │ │ + 370 │ │ │ │ │ +372 constexpr unsigned int dim() const { │ │ │ │ │ + 373 return dim_; │ │ │ │ │ + 374 } │ │ │ │ │ + 375 │ │ │ │ │ +377 constexpr unsigned int id() const { │ │ │ │ │ + 378 return topologyId_; │ │ │ │ │ + 379 } │ │ │ │ │ + 380 │ │ │ │ │ +388 constexpr bool operator==(const GeometryType& other) const { │ │ │ │ │ + 389 return ( ( none_ == other.none_ ) │ │ │ │ │ + 390 && ( ( none_ == true ) │ │ │ │ │ + 391 || ( ( dim_ == other.dim_ ) │ │ │ │ │ + 392 && ( (topologyId_ >> 1) == (other.topologyId_ >> 1) ) │ │ │ │ │ + 393 ) │ │ │ │ │ + 394 ) │ │ │ │ │ + 395 ); │ │ │ │ │ + 396 } │ │ │ │ │ 397 │ │ │ │ │ - 398 template< int codim > struct CreateGeometries; │ │ │ │ │ - 399 │ │ │ │ │ - 400 public: │ │ │ │ │ - 402 template< int codim > │ │ │ │ │ - 403 struct Codim │ │ │ │ │ - 404 { │ │ │ │ │ - 406 typedef AffineGeometry< ctype, dim-codim, dim > Geometry; │ │ │ │ │ - 407 }; │ │ │ │ │ - 408 │ │ │ │ │ - 409 // ReferenceElement cannot be copied. │ │ │ │ │ - 410 ReferenceElementImplementation ( const ReferenceElementImplementation& ) = │ │ │ │ │ -delete; │ │ │ │ │ - 411 │ │ │ │ │ - 412 // ReferenceElementImplementation cannot be copied. │ │ │ │ │ - 413 ReferenceElementImplementation& operator= ( const │ │ │ │ │ -ReferenceElementImplementation& ) = delete; │ │ │ │ │ - 414 │ │ │ │ │ - 415 // ReferenceElementImplementation is default-constructible (required for │ │ │ │ │ -storage in std::array) │ │ │ │ │ - 416 ReferenceElementImplementation () = default; │ │ │ │ │ - 417 │ │ │ │ │ - 422 int size ( int c ) const │ │ │ │ │ - 423 { │ │ │ │ │ - 424 assert( (c >= 0) && (c <= dim) ); │ │ │ │ │ - 425 return info_[ c ].size(); │ │ │ │ │ - 426 } │ │ │ │ │ - 427 │ │ │ │ │ - 439 int size ( int i, int c, int cc ) const │ │ │ │ │ - 440 { │ │ │ │ │ - 441 assert( (i >= 0) && (i < size( c )) ); │ │ │ │ │ - 442 return info_[ c ][ i ].size( cc ); │ │ │ │ │ - 443 } │ │ │ │ │ - 444 │ │ │ │ │ - 458 int subEntity ( int i, int c, int ii, int cc ) const │ │ │ │ │ - 459 { │ │ │ │ │ - 460 assert( (i >= 0) && (i < size( c )) ); │ │ │ │ │ - 461 return info_[ c ][ i ].number( ii, cc ); │ │ │ │ │ - 462 } │ │ │ │ │ - 463 │ │ │ │ │ - 479 auto subEntities ( int i, int c, int cc ) const │ │ │ │ │ - 480 { │ │ │ │ │ - 481 assert( (i >= 0) && (i < size( c )) ); │ │ │ │ │ - 482 return info_[ c ][ i ].numbers( cc ); │ │ │ │ │ - 483 } │ │ │ │ │ - 484 │ │ │ │ │ - 493 const GeometryType &type ( int i, int c ) const │ │ │ │ │ - 494 { │ │ │ │ │ - 495 assert( (i >= 0) && (i < size( c )) ); │ │ │ │ │ - 496 return info_[ c ][ i ].type(); │ │ │ │ │ +399 constexpr bool operator!=(const GeometryType& other) const { │ │ │ │ │ + 400 return ! ((*this)==other); │ │ │ │ │ + 401 } │ │ │ │ │ + 402 │ │ │ │ │ +404 constexpr bool operator_<(const GeometryType& other) const { │ │ │ │ │ + 405 return ( ( none_ < other.none_ ) │ │ │ │ │ + 406 || ( !( other.none_ < none_ ) │ │ │ │ │ + 407 && ( ( dim_ < other.dim_ ) │ │ │ │ │ + 408 || ( (other.dim_ == dim_) │ │ │ │ │ + 409 && ((topologyId_ >> 1) < (other.topologyId_ >> 1) ) │ │ │ │ │ + 410 ) │ │ │ │ │ + 411 ) │ │ │ │ │ + 412 ) │ │ │ │ │ + 413 ); │ │ │ │ │ + 414 } │ │ │ │ │ + 415 │ │ │ │ │ + 418 }; │ │ │ │ │ + 419 │ │ │ │ │ +421 inline std::ostream& operator<<(std::ostream& s, const GeometryType& a) │ │ │ │ │ + 422 { │ │ │ │ │ + 423 if (a.isSimplex()) │ │ │ │ │ + 424 { │ │ │ │ │ + 425 s << "(simplex, " << a.dim() << ")"; │ │ │ │ │ + 426 return s; │ │ │ │ │ + 427 } │ │ │ │ │ + 428 if (a.isCube()) │ │ │ │ │ + 429 { │ │ │ │ │ + 430 s << "(cube, " << a.dim() << ")"; │ │ │ │ │ + 431 return s; │ │ │ │ │ + 432 } │ │ │ │ │ + 433 if (a.isPyramid()) │ │ │ │ │ + 434 { │ │ │ │ │ + 435 s << "(pyramid, 3)"; │ │ │ │ │ + 436 return s; │ │ │ │ │ + 437 } │ │ │ │ │ + 438 if (a.isPrism()) │ │ │ │ │ + 439 { │ │ │ │ │ + 440 s << "(prism, 3)"; │ │ │ │ │ + 441 return s; │ │ │ │ │ + 442 } │ │ │ │ │ + 443 if (a.isNone()) │ │ │ │ │ + 444 { │ │ │ │ │ + 445 s << "(none, " << a.dim() << ")"; │ │ │ │ │ + 446 return s; │ │ │ │ │ + 447 } │ │ │ │ │ + 448 s << "(other [" << a.id() << "], " << a.dim() << ")"; │ │ │ │ │ + 449 return s; │ │ │ │ │ + 450 } │ │ │ │ │ + 451 │ │ │ │ │ + 452 │ │ │ │ │ + 454 │ │ │ │ │ +458 namespace GeometryTypes { │ │ │ │ │ + 459 │ │ │ │ │ + 461 │ │ │ │ │ + 464 inline constexpr GeometryType simplex(unsigned int dim) │ │ │ │ │ + 465 { │ │ │ │ │ + 466 return GeometryType(0,dim,false); │ │ │ │ │ + 467 } │ │ │ │ │ + 468 │ │ │ │ │ + 470 │ │ │ │ │ + 473 inline constexpr GeometryType cube(unsigned int dim) │ │ │ │ │ + 474 { │ │ │ │ │ + 475 return GeometryType(((dim>1) ? ((1 << dim) - 1) : 0),dim,false); │ │ │ │ │ + 476 } │ │ │ │ │ + 477 │ │ │ │ │ + 479 │ │ │ │ │ + 482 inline constexpr GeometryType none(unsigned int dim) │ │ │ │ │ + 483 { │ │ │ │ │ + 484 return GeometryType(0,dim,true); │ │ │ │ │ + 485 } │ │ │ │ │ + 486 │ │ │ │ │ + 488 inline constexpr GeometryType conicalExtension(const GeometryType& gt) │ │ │ │ │ + 489 { │ │ │ │ │ + 490 return GeometryType(gt.id(), gt.dim()+1, gt.isNone()); │ │ │ │ │ + 491 } │ │ │ │ │ + 492 │ │ │ │ │ + 494 inline constexpr GeometryType prismaticExtension(const GeometryType& gt) │ │ │ │ │ + 495 { │ │ │ │ │ + 496 return GeometryType(gt.id() | ((1 << gt.dim())), gt.dim()+1, gt.isNone()); │ │ │ │ │ 497 } │ │ │ │ │ 498 │ │ │ │ │ - 500 const GeometryType &type () const { return type( 0, 0 ); } │ │ │ │ │ - 501 │ │ │ │ │ - 511 const Coordinate &position( int i, int c ) const │ │ │ │ │ - 512 { │ │ │ │ │ - 513 assert( (c >= 0) && (c <= dim) ); │ │ │ │ │ - 514 return baryCenters_[ c ][ i ]; │ │ │ │ │ - 515 } │ │ │ │ │ + 499#ifndef __cpp_inline_variables │ │ │ │ │ + 500 namespace { │ │ │ │ │ + 501#endif │ │ │ │ │ + 502 │ │ │ │ │ + 504 │ │ │ │ │ + 507 DUNE_INLINE_VARIABLE constexpr GeometryType vertex = GeometryType │ │ │ │ │ +(0,0,false); │ │ │ │ │ + 508 │ │ │ │ │ + 510 │ │ │ │ │ + 513 DUNE_INLINE_VARIABLE constexpr GeometryType line = GeometryType │ │ │ │ │ +(0,1,false); │ │ │ │ │ + 514 │ │ │ │ │ 516 │ │ │ │ │ - 524 bool checkInside ( const Coordinate &local ) const │ │ │ │ │ - 525 { │ │ │ │ │ - 526 const ctype tolerance = ctype( 64 ) * std::numeric_limits< ctype >:: │ │ │ │ │ -epsilon(); │ │ │ │ │ - 527 return Impl::template checkInside< ctype, dim >( type().id(), dim, local, │ │ │ │ │ -tolerance ); │ │ │ │ │ - 528 } │ │ │ │ │ - 529 │ │ │ │ │ - 541 template< int codim > │ │ │ │ │ - 542 typename Codim< codim >::Geometry geometry ( int i ) const │ │ │ │ │ - 543 { │ │ │ │ │ - 544 return std::get< codim >( geometries_ )[ i ]; │ │ │ │ │ - 545 } │ │ │ │ │ + 519 DUNE_INLINE_VARIABLE constexpr GeometryType triangle = simplex(2); │ │ │ │ │ + 520 │ │ │ │ │ + 522 │ │ │ │ │ + 525 DUNE_INLINE_VARIABLE constexpr GeometryType quadrilateral = cube(2); │ │ │ │ │ + 526 │ │ │ │ │ + 528 │ │ │ │ │ + 531 DUNE_INLINE_VARIABLE constexpr GeometryType tetrahedron = simplex(3); │ │ │ │ │ + 532 │ │ │ │ │ + 534 │ │ │ │ │ + 537 DUNE_INLINE_VARIABLE constexpr GeometryType pyramid = GeometryType │ │ │ │ │ +(0b0011,3,false); │ │ │ │ │ + 538 │ │ │ │ │ + 540 │ │ │ │ │ + 543 DUNE_INLINE_VARIABLE constexpr GeometryType prism = GeometryType │ │ │ │ │ +(0b0101,3,false); │ │ │ │ │ + 544 │ │ │ │ │ 546 │ │ │ │ │ - 548 Volume volume () const │ │ │ │ │ - 549 { │ │ │ │ │ - 550 return volume_; │ │ │ │ │ - 551 } │ │ │ │ │ - 552 │ │ │ │ │ - 560 const Coordinate &integrationOuterNormal ( int face ) const │ │ │ │ │ - 561 { │ │ │ │ │ - 562 assert( (face >= 0) && (face < int( integrationNormals_.size() )) ); │ │ │ │ │ - 563 return integrationNormals_[ face ]; │ │ │ │ │ - 564 } │ │ │ │ │ + 549 DUNE_INLINE_VARIABLE constexpr GeometryType hexahedron = cube(3); │ │ │ │ │ + 550 │ │ │ │ │ + 551#ifndef __cpp_inline_variables │ │ │ │ │ + 552 } │ │ │ │ │ + 553#endif │ │ │ │ │ + 554 │ │ │ │ │ + 555 } │ │ │ │ │ + 556 │ │ │ │ │ + 557 namespace Impl │ │ │ │ │ + 558 { │ │ │ │ │ + 559 │ │ │ │ │ + 561 inline constexpr GeometryType getBase(const GeometryType& gt) { │ │ │ │ │ + 562 return GeometryType(gt.id() & ((1 << (gt.dim()-1))-1), gt.dim()-1, │ │ │ │ │ +gt.isNone()); │ │ │ │ │ + 563 } │ │ │ │ │ + 564 │ │ │ │ │ 565 │ │ │ │ │ - 566 private: │ │ │ │ │ - 567 void initialize ( unsigned int topologyId ) │ │ │ │ │ - 568 { │ │ │ │ │ - 569 assert( topologyId < Impl::numTopologies( dim ) ); │ │ │ │ │ - 570 │ │ │ │ │ - 571 // set up subentities │ │ │ │ │ - 572 for( int codim = 0; codim <= dim; ++codim ) │ │ │ │ │ - 573 { │ │ │ │ │ - 574 const unsigned int size = Impl::size( topologyId, dim, codim ); │ │ │ │ │ - 575 info_[ codim ].resize( size ); │ │ │ │ │ - 576 for( unsigned int i = 0; i < size; ++i ) │ │ │ │ │ - 577 info_[ codim ][ i ].initialize( topologyId, codim, i ); │ │ │ │ │ - 578 } │ │ │ │ │ - 579 │ │ │ │ │ - 580 // compute corners │ │ │ │ │ - 581 const unsigned int numVertices = size( dim ); │ │ │ │ │ - 582 baryCenters_[ dim ].resize( numVertices ); │ │ │ │ │ - 583 Impl::referenceCorners( topologyId, dim, &(baryCenters_[ dim ][ 0 ]) ); │ │ │ │ │ + 566 // IfGeometryType │ │ │ │ │ + 567 // ---------- │ │ │ │ │ + 568 │ │ │ │ │ + 569 template< template< GeometryType::Id > class Operation, int dim, │ │ │ │ │ +GeometryType::Id geometryId = GeometryTypes::vertex > │ │ │ │ │ + 570 struct IfGeometryType │ │ │ │ │ + 571 { │ │ │ │ │ + 572 static constexpr GeometryType geometry = geometryId; │ │ │ │ │ + 573 template< class... Args > │ │ │ │ │ + 574 static auto apply ( GeometryType gt, Args &&... args ) │ │ │ │ │ + 575 { │ │ │ │ │ + 576 GeometryType lowerGeometry(gt.id() >>1 , gt.dim()-1, gt.isNone()); │ │ │ │ │ + 577 │ │ │ │ │ + 578 if( gt.id() & 1 ) │ │ │ │ │ + 579 return IfGeometryType< Operation, dim-1, GeometryTypes::prismaticExtension │ │ │ │ │ +(geometry).toId() >::apply( lowerGeometry, std::forward< Args >( args )... ); │ │ │ │ │ + 580 else │ │ │ │ │ + 581 return IfGeometryType< Operation, dim-1, GeometryTypes::conicalExtension │ │ │ │ │ +(geometry).toId() >::apply( lowerGeometry, std::forward< Args >( args )... ); │ │ │ │ │ + 582 } │ │ │ │ │ + 583 }; │ │ │ │ │ 584 │ │ │ │ │ - 585 // compute barycenters │ │ │ │ │ - 586 for( int codim = 0; codim < dim; ++codim ) │ │ │ │ │ + 585 template< template< GeometryType::Id > class Operation, GeometryType::Id │ │ │ │ │ +geometryId > │ │ │ │ │ + 586 struct IfGeometryType< Operation, 0, geometryId> │ │ │ │ │ 587 { │ │ │ │ │ - 588 baryCenters_[ codim ].resize( size(codim) ); │ │ │ │ │ - 589 for( int i = 0; i < size( codim ); ++i ) │ │ │ │ │ + 588 template< class... Args > │ │ │ │ │ + 589 static auto apply ([[maybe_unused]] GeometryType gt, Args &&... args ) │ │ │ │ │ 590 { │ │ │ │ │ - 591 baryCenters_[ codim ][ i ] = Coordinate( ctype( 0 ) ); │ │ │ │ │ - 592 const unsigned int numCorners = size( i, codim, dim ); │ │ │ │ │ - 593 for( unsigned int j = 0; j < numCorners; ++j ) │ │ │ │ │ - 594 baryCenters_[ codim ][ i ] += baryCenters_[ dim ][ subEntity( i, codim, j, │ │ │ │ │ -dim ) ]; │ │ │ │ │ - 595 baryCenters_[ codim ][ i ] *= ctype( 1 ) / ctype( numCorners ); │ │ │ │ │ - 596 } │ │ │ │ │ - 597 } │ │ │ │ │ - 598 │ │ │ │ │ - 599 // compute reference element volume │ │ │ │ │ - 600 volume_ = Impl::template referenceVolume< ctype >( topologyId, dim ); │ │ │ │ │ - 601 │ │ │ │ │ - 602 // compute integration outer normals │ │ │ │ │ - 603 if( dim > 0 ) │ │ │ │ │ - 604 { │ │ │ │ │ - 605 integrationNormals_.resize( size( 1 ) ); │ │ │ │ │ - 606 Impl::referenceIntegrationOuterNormals( topologyId, dim, & │ │ │ │ │ -(integrationNormals_[ 0 ]) ); │ │ │ │ │ - 607 } │ │ │ │ │ - 608 │ │ │ │ │ - 609 // set up geometries │ │ │ │ │ - 610 Hybrid::forEach( std::make_index_sequence< dim+1 >{}, [ & ]( auto i ) │ │ │ │ │ -{ CreateGeometries< i >::apply( *this, geometries_ ); } ); │ │ │ │ │ - 611 } │ │ │ │ │ - 612 │ │ │ │ │ - 613 template< int... codim > │ │ │ │ │ - 614 static std::tuple< std::vector< typename Codim< codim >::Geometry >... > │ │ │ │ │ - 615 makeGeometryTable ( std::integer_sequence< int, codim... > ); │ │ │ │ │ - 616 │ │ │ │ │ - 618 typedef decltype( makeGeometryTable( std::make_integer_sequence< int, │ │ │ │ │ -dim+1 >() ) ) GeometryTable; │ │ │ │ │ - 619 │ │ │ │ │ - 621 ctype volume_; │ │ │ │ │ - 622 │ │ │ │ │ - 623 std::vector< Coordinate > baryCenters_[ dim+1 ]; │ │ │ │ │ - 624 std::vector< Coordinate > integrationNormals_; │ │ │ │ │ - 625 │ │ │ │ │ - 627 GeometryTable geometries_; │ │ │ │ │ - 628 │ │ │ │ │ - 629 std::vector< SubEntityInfo > info_[ dim+1 ]; │ │ │ │ │ - 630 }; │ │ │ │ │ - 631 │ │ │ │ │ - 633 template< class ctype, int dim > │ │ │ │ │ - 634 struct ReferenceElementImplementation< ctype, dim >::SubEntityInfo │ │ │ │ │ - 635 { │ │ │ │ │ - 636 // Compute upper bound for the number of subsentities. │ │ │ │ │ - 637 // If someone knows an explicit formal feel free to │ │ │ │ │ - 638 // implement it here. │ │ │ │ │ - 639 static constexpr std::size_t maxSubEntityCount() │ │ │ │ │ - 640 { │ │ │ │ │ - 641 std::size_t maxCount=0; │ │ │ │ │ - 642 for(std::size_t codim=0; codim<=dim; ++codim) │ │ │ │ │ - 643 maxCount = std::max(maxCount, binomial(std::size_t(dim),codim)*(1 << │ │ │ │ │ -codim)); │ │ │ │ │ - 644 return maxCount; │ │ │ │ │ - 645 } │ │ │ │ │ - 646 │ │ │ │ │ - 647 using SubEntityFlags = std::bitset; │ │ │ │ │ - 648 │ │ │ │ │ - 649 class SubEntityRange │ │ │ │ │ - 650 : public Dune::IteratorRange │ │ │ │ │ - 651 { │ │ │ │ │ - 652 using Base = typename Dune::IteratorRange; │ │ │ │ │ - 653 │ │ │ │ │ - 654 public: │ │ │ │ │ - 655 │ │ │ │ │ - 656 using iterator = Base::iterator; │ │ │ │ │ - 657 using const_iterator = Base::const_iterator; │ │ │ │ │ - 658 │ │ │ │ │ - 659 SubEntityRange(const iterator& begin, const iterator& end, const │ │ │ │ │ -SubEntityFlags& contains) : │ │ │ │ │ - 660 Base(begin, end), │ │ │ │ │ - 661 containsPtr_(&contains), │ │ │ │ │ - 662 size_(end-begin) │ │ │ │ │ - 663 {} │ │ │ │ │ - 664 │ │ │ │ │ - 665 SubEntityRange() : │ │ │ │ │ - 666 Base(), │ │ │ │ │ - 667 containsPtr_(nullptr), │ │ │ │ │ - 668 size_(0) │ │ │ │ │ - 669 {} │ │ │ │ │ - 670 │ │ │ │ │ - 671 std::size_t size() const │ │ │ │ │ - 672 { │ │ │ │ │ - 673 return size_; │ │ │ │ │ - 674 } │ │ │ │ │ - 675 │ │ │ │ │ - 676 bool contains(std::size_t i) const │ │ │ │ │ - 677 { │ │ │ │ │ - 678 return (*containsPtr_)[i]; │ │ │ │ │ - 679 } │ │ │ │ │ - 680 │ │ │ │ │ - 681 private: │ │ │ │ │ - 682 const SubEntityFlags* containsPtr_; │ │ │ │ │ - 683 std::size_t size_; │ │ │ │ │ - 684 std::size_t offset_; │ │ │ │ │ - 685 }; │ │ │ │ │ - 686 │ │ │ │ │ - 687 using NumberRange = typename Dune::IteratorRange; │ │ │ │ │ - 688 │ │ │ │ │ - 689 SubEntityInfo () │ │ │ │ │ - 690 : numbering_( nullptr ) │ │ │ │ │ - 691 { │ │ │ │ │ - 692 std::fill( offset_.begin(), offset_.end(), 0 ); │ │ │ │ │ - 693 } │ │ │ │ │ - 694 │ │ │ │ │ - 695 SubEntityInfo ( const SubEntityInfo &other ) │ │ │ │ │ - 696 : offset_( other.offset_ ), │ │ │ │ │ - 697 type_( other.type_ ), │ │ │ │ │ - 698 containsSubentity_( other.containsSubentity_ ) │ │ │ │ │ - 699 { │ │ │ │ │ - 700 numbering_ = allocate(); │ │ │ │ │ - 701 std::copy( other.numbering_, other.numbering_ + capacity(), numbering_ ); │ │ │ │ │ - 702 } │ │ │ │ │ - 703 │ │ │ │ │ - 704 ~SubEntityInfo () { deallocate( numbering_ ); } │ │ │ │ │ - 705 │ │ │ │ │ - 706 const SubEntityInfo &operator= ( const SubEntityInfo &other ) │ │ │ │ │ - 707 { │ │ │ │ │ - 708 type_ = other.type_; │ │ │ │ │ - 709 offset_ = other.offset_; │ │ │ │ │ - 710 │ │ │ │ │ - 711 deallocate( numbering_ ); │ │ │ │ │ - 712 numbering_ = allocate(); │ │ │ │ │ - 713 std::copy( other.numbering_, other.numbering_ + capacity(), numbering_ ); │ │ │ │ │ - 714 │ │ │ │ │ - 715 containsSubentity_ = other.containsSubentity_; │ │ │ │ │ - 716 │ │ │ │ │ - 717 return *this; │ │ │ │ │ - 718 } │ │ │ │ │ - 719 │ │ │ │ │ - 720 int size ( int cc ) const │ │ │ │ │ - 721 { │ │ │ │ │ - 722 assert( (cc >= 0) && (cc <= dim) ); │ │ │ │ │ - 723 return (offset_[ cc+1 ] - offset_[ cc ]); │ │ │ │ │ - 724 } │ │ │ │ │ - 725 │ │ │ │ │ - 726 int number ( int ii, int cc ) const │ │ │ │ │ - 727 { │ │ │ │ │ - 728 assert( (ii >= 0) && (ii < size( cc )) ); │ │ │ │ │ - 729 return numbering_[ offset_[ cc ] + ii ]; │ │ │ │ │ - 730 } │ │ │ │ │ - 731 │ │ │ │ │ - 732 auto numbers ( int cc ) const │ │ │ │ │ - 733 { │ │ │ │ │ - 734 return SubEntityRange( numbering_ + offset_[ cc ], numbering_ + offset_ │ │ │ │ │ -[ cc+1 ], containsSubentity_[cc]); │ │ │ │ │ - 735 } │ │ │ │ │ - 736 │ │ │ │ │ - 737 const GeometryType &type () const { return type_; } │ │ │ │ │ - 738 │ │ │ │ │ - 739 void initialize ( unsigned int topologyId, int codim, unsigned int i ) │ │ │ │ │ - 740 { │ │ │ │ │ - 741 const unsigned int subId = Impl::subTopologyId( topologyId, dim, codim, i │ │ │ │ │ -); │ │ │ │ │ - 742 type_ = GeometryType( subId, dim-codim ); │ │ │ │ │ - 743 │ │ │ │ │ - 744 // compute offsets │ │ │ │ │ - 745 for( int cc = 0; cc <= codim; ++cc ) │ │ │ │ │ - 746 offset_[ cc ] = 0; │ │ │ │ │ - 747 for( int cc = codim; cc <= dim; ++cc ) │ │ │ │ │ - 748 offset_[ cc+1 ] = offset_[ cc ] + Impl::size( subId, dim-codim, cc-codim │ │ │ │ │ -); │ │ │ │ │ - 749 │ │ │ │ │ - 750 // compute subnumbering │ │ │ │ │ - 751 deallocate( numbering_ ); │ │ │ │ │ - 752 numbering_ = allocate(); │ │ │ │ │ - 753 for( int cc = codim; cc <= dim; ++cc ) │ │ │ │ │ - 754 Impl::subTopologyNumbering( topologyId, dim, codim, i, cc-codim, │ │ │ │ │ -numbering_+offset_[ cc ], numbering_+offset_[ cc+1 ] ); │ │ │ │ │ - 755 │ │ │ │ │ - 756 // initialize containsSubentity lookup-table │ │ │ │ │ - 757 for(std::size_t cc=0; cc<= dim; ++cc) │ │ │ │ │ - 758 { │ │ │ │ │ - 759 containsSubentity_[cc].reset(); │ │ │ │ │ - 760 for(std::size_t idx=0; idx offset_; │ │ │ │ │ - 775 GeometryType type_; │ │ │ │ │ - 776 std::array< SubEntityFlags, dim+1> containsSubentity_; │ │ │ │ │ - 777 }; │ │ │ │ │ - 778 │ │ │ │ │ - 779 │ │ │ │ │ - 780 template< class ctype, int dim > │ │ │ │ │ - 781 template< int codim > │ │ │ │ │ - 782 struct ReferenceElementImplementation< ctype, dim >::CreateGeometries │ │ │ │ │ - 783 { │ │ │ │ │ - 784 template< int cc > │ │ │ │ │ - 785 static typename ReferenceElements< ctype, dim-cc >::ReferenceElement │ │ │ │ │ - 786 subRefElement( const ReferenceElementImplementation< ctype, dim > │ │ │ │ │ -&refElement, int i, std::integral_constant< int, cc > ) │ │ │ │ │ - 787 { │ │ │ │ │ - 788 return ReferenceElements<_ctype,_dim-cc_>::general( refElement.type( i, cc │ │ │ │ │ -) ); │ │ │ │ │ - 789 } │ │ │ │ │ - 790 │ │ │ │ │ - 791 static typename ReferenceElements<_ctype,_dim_>::ReferenceElement │ │ │ │ │ - 792 subRefElement(const ReferenceElementImplementation< ctype, dim > │ │ │ │ │ -&refElement, │ │ │ │ │ - 793 [[maybe_unused]] int i, std::integral_constant) │ │ │ │ │ - 794 { │ │ │ │ │ - 795 return refElement; │ │ │ │ │ - 796 } │ │ │ │ │ - 797 │ │ │ │ │ - 798 static void apply ( const ReferenceElementImplementation< ctype, dim > │ │ │ │ │ -&refElement, GeometryTable &geometries ) │ │ │ │ │ - 799 { │ │ │ │ │ - 800 const int size = refElement.size( codim ); │ │ │ │ │ - 801 std::vector< FieldVector< ctype, dim > > origins( size ); │ │ │ │ │ - 802 std::vector< FieldMatrix< ctype, dim - codim, dim > > jacobianTransposeds │ │ │ │ │ -( size ); │ │ │ │ │ - 803 Impl::referenceEmbeddings( refElement.type().id(), dim, codim, &(origins │ │ │ │ │ -[ 0 ]), &(jacobianTransposeds[ 0 ]) ); │ │ │ │ │ - 804 │ │ │ │ │ - 805 std::get< codim >( geometries ).reserve( size ); │ │ │ │ │ - 806 for( int i = 0; i < size; ++i ) │ │ │ │ │ - 807 { │ │ │ │ │ - 808 typename Codim< codim >::Geometry geometry( subRefElement( refElement, i, │ │ │ │ │ -std::integral_constant< int, codim >() ), origins[ i ], jacobianTransposeds[ i │ │ │ │ │ -] ); │ │ │ │ │ - 809 std::get< codim >( geometries ).push_back( geometry ); │ │ │ │ │ - 810 } │ │ │ │ │ - 811 } │ │ │ │ │ - 812 }; │ │ │ │ │ - 813 │ │ │ │ │ - 814#endif // DOXYGEN │ │ │ │ │ - 815 │ │ │ │ │ - 816 } // namespace Geo │ │ │ │ │ - 817 │ │ │ │ │ - 818} // namespace Dune │ │ │ │ │ - 819 │ │ │ │ │ - 820#endif // #ifndef DUNE_GEOMETRY_REFERENCEELEMENTIMPLEMENTATION_HH │ │ │ │ │ -referenceelement.hh │ │ │ │ │ -affinegeometry.hh │ │ │ │ │ -An implementation of the Geometry interface for affine geometries. │ │ │ │ │ -type.hh │ │ │ │ │ -A unique label for each type of element that can occur in a grid. │ │ │ │ │ + 591 return Operation< geometryId >::apply( std::forward< Args >( args )... ); │ │ │ │ │ + 592 } │ │ │ │ │ + 593 }; │ │ │ │ │ + 594 } // namespace Impl │ │ │ │ │ + 595} // namespace Dune │ │ │ │ │ + 596 │ │ │ │ │ + 597#endif // DUNE_GEOMETRY_TYPE_HH │ │ │ │ │ +deprecated_topology.hh │ │ │ │ │ Dune │ │ │ │ │ Definition affinegeometry.hh:21 │ │ │ │ │ -Dune::QuadratureType::size │ │ │ │ │ -@ size │ │ │ │ │ -Definition quadraturerules.hh:145 │ │ │ │ │ -Dune::RefinementImp::Simplex::binomial │ │ │ │ │ -int binomial(int upper, int lower) │ │ │ │ │ -calculate │ │ │ │ │ -Definition simplex.cc:305 │ │ │ │ │ -Dune::Geo::ReferenceElements::ReferenceElement │ │ │ │ │ -typename Container::ReferenceElement ReferenceElement │ │ │ │ │ -The reference element type. │ │ │ │ │ -Definition referenceelements.hh:188 │ │ │ │ │ -Dune::Geo::ReferenceElements::general │ │ │ │ │ -static const ReferenceElement & general(const GeometryType &type) │ │ │ │ │ -get general reference elements │ │ │ │ │ -Definition referenceelements.hh:198 │ │ │ │ │ +Dune::operator<< │ │ │ │ │ +std::ostream & operator<<(std::ostream &s, const GeometryType &a) │ │ │ │ │ +Prints the type to an output stream. │ │ │ │ │ +Definition type.hh:421 │ │ │ │ │ +Dune::GeometryType │ │ │ │ │ +Unique label for each type of entities that can occur in DUNE grids. │ │ │ │ │ +Definition type.hh:126 │ │ │ │ │ +Dune::GeometryType::GeometryType │ │ │ │ │ +constexpr GeometryType(unsigned int topologyId, unsigned int dim) │ │ │ │ │ +Constructor, using the topologyId (integer) and the dimension. │ │ │ │ │ +Definition type.hh:263 │ │ │ │ │ +Dune::GeometryType::operator< │ │ │ │ │ +constexpr bool operator<(const GeometryType &other) const │ │ │ │ │ +less-than operation for use with maps │ │ │ │ │ +Definition type.hh:404 │ │ │ │ │ +Dune::GeometryType::operator!= │ │ │ │ │ +constexpr bool operator!=(const GeometryType &other) const │ │ │ │ │ +Check for inequality. │ │ │ │ │ +Definition type.hh:399 │ │ │ │ │ +Dune::GeometryType::isPyramid │ │ │ │ │ +constexpr bool isPyramid() const │ │ │ │ │ +Return true if entity is a pyramid. │ │ │ │ │ +Definition type.hh:316 │ │ │ │ │ +Dune::GeometryType::isTetrahedron │ │ │ │ │ +constexpr bool isTetrahedron() const │ │ │ │ │ +Return true if entity is a tetrahedron. │ │ │ │ │ +Definition type.hh:311 │ │ │ │ │ +Dune::GeometryType::isPrism │ │ │ │ │ +constexpr bool isPrism() const │ │ │ │ │ +Return true if entity is a prism. │ │ │ │ │ +Definition type.hh:321 │ │ │ │ │ +Dune::GeometryType::isVertex │ │ │ │ │ +constexpr bool isVertex() const │ │ │ │ │ +Return true if entity is a vertex. │ │ │ │ │ +Definition type.hh:291 │ │ │ │ │ +Dune::GeometryType::operator== │ │ │ │ │ +constexpr bool operator==(const GeometryType &other) const │ │ │ │ │ +Check for equality. This method knows that in dimension 0 and 1 all BasicTypes │ │ │ │ │ +are equal. │ │ │ │ │ +Definition type.hh:388 │ │ │ │ │ +Dune::GeometryType::toId │ │ │ │ │ +constexpr Id toId() const │ │ │ │ │ +Create an Id representation of this GeometryType. │ │ │ │ │ +Definition type.hh:222 │ │ │ │ │ +Dune::GeometryType::isConical │ │ │ │ │ +constexpr bool isConical(const int &step) const │ │ │ │ │ +Return true if entity was constructed with a conical product in the chosen │ │ │ │ │ +step. │ │ │ │ │ +Definition type.hh:349 │ │ │ │ │ +Dune::GeometryType::dim │ │ │ │ │ +constexpr unsigned int dim() const │ │ │ │ │ +Return dimension of the type. │ │ │ │ │ +Definition type.hh:372 │ │ │ │ │ +Dune::GeometryType::isPrismatic │ │ │ │ │ +constexpr bool isPrismatic(const int &step) const │ │ │ │ │ +Return true if entity was constructed with a prismatic product in the chosen │ │ │ │ │ +step. │ │ │ │ │ +Definition type.hh:362 │ │ │ │ │ +Dune::GeometryType::isTriangle │ │ │ │ │ +constexpr bool isTriangle() const │ │ │ │ │ +Return true if entity is a triangle. │ │ │ │ │ +Definition type.hh:301 │ │ │ │ │ +Dune::GeometryType::GeometryType │ │ │ │ │ +GeometryType(TopologyType t) │ │ │ │ │ +Constructor from static TopologyType class. │ │ │ │ │ +Definition type.hh:279 │ │ │ │ │ +Dune::GeometryType::GeometryType │ │ │ │ │ +constexpr GeometryType(unsigned int topologyId, unsigned int dim, bool isNone) │ │ │ │ │ +Constructor, using the topologyId (integer), the dimension and a flag for type │ │ │ │ │ +none. │ │ │ │ │ +Definition type.hh:254 │ │ │ │ │ +Dune::GeometryType::BasicType │ │ │ │ │ +BasicType │ │ │ │ │ +Each entity can be tagged by one of these basic types plus its space dimension. │ │ │ │ │ +Definition type.hh:132 │ │ │ │ │ +Dune::GeometryType::cube │ │ │ │ │ +@ cube │ │ │ │ │ +Cube element in any nonnegative dimension. │ │ │ │ │ +Definition type.hh:134 │ │ │ │ │ +Dune::GeometryType::simplex │ │ │ │ │ +@ simplex │ │ │ │ │ +Simplicial element in any nonnegative dimension. │ │ │ │ │ +Definition type.hh:133 │ │ │ │ │ +Dune::GeometryType::pyramid │ │ │ │ │ +@ pyramid │ │ │ │ │ +Four sided pyramid in three dimensions. │ │ │ │ │ +Definition type.hh:135 │ │ │ │ │ +Dune::GeometryType::extended │ │ │ │ │ +@ extended │ │ │ │ │ +Other, more general topology, representable as topologyId. │ │ │ │ │ +Definition type.hh:137 │ │ │ │ │ +Dune::GeometryType::none │ │ │ │ │ +@ none │ │ │ │ │ +Even more general topology, cannot be specified by a topologyId. Two │ │ │ │ │ +GeometryTypes with 'none' type a... │ │ │ │ │ +Definition type.hh:138 │ │ │ │ │ +Dune::GeometryType::prism │ │ │ │ │ +@ prism │ │ │ │ │ +Prism element in three dimensions. │ │ │ │ │ +Definition type.hh:136 │ │ │ │ │ +Dune::GeometryType::GeometryType │ │ │ │ │ +constexpr GeometryType(Id id) │ │ │ │ │ +Reconstruct a Geometry type from a GeometryType::Id. │ │ │ │ │ +Definition type.hh:234 │ │ │ │ │ +Dune::GeometryType::isCube │ │ │ │ │ +constexpr bool isCube() const │ │ │ │ │ +Return true if entity is a cube of any dimension. │ │ │ │ │ +Definition type.hh:336 │ │ │ │ │ +Dune::GeometryType::GeometryType │ │ │ │ │ +constexpr GeometryType() │ │ │ │ │ +Default constructor, not initializing anything. │ │ │ │ │ +Definition type.hh:244 │ │ │ │ │ +Dune::GeometryType::isConical │ │ │ │ │ +constexpr bool isConical() const │ │ │ │ │ +Return true if entity was constructed with a conical product in the last step. │ │ │ │ │ +Definition type.hh:341 │ │ │ │ │ +Dune::GeometryType::isLine │ │ │ │ │ +constexpr bool isLine() const │ │ │ │ │ +Return true if entity is a line segment. │ │ │ │ │ +Definition type.hh:296 │ │ │ │ │ +Dune::GeometryType::isQuadrilateral │ │ │ │ │ +constexpr bool isQuadrilateral() const │ │ │ │ │ +Return true if entity is a quadrilateral. │ │ │ │ │ +Definition type.hh:306 │ │ │ │ │ +Dune::GeometryType::isPrismatic │ │ │ │ │ +constexpr bool isPrismatic() const │ │ │ │ │ +Return true if entity was constructed with a prismatic product in the last │ │ │ │ │ +step. │ │ │ │ │ +Definition type.hh:354 │ │ │ │ │ +Dune::GeometryType::id │ │ │ │ │ +constexpr unsigned int id() const │ │ │ │ │ +Return the topology id of the type. │ │ │ │ │ +Definition type.hh:377 │ │ │ │ │ +Dune::GeometryType::isNone │ │ │ │ │ +constexpr bool isNone() const │ │ │ │ │ +Return true if entity is a singular of any dimension. │ │ │ │ │ +Definition type.hh:367 │ │ │ │ │ +Dune::GeometryType::isHexahedron │ │ │ │ │ +constexpr bool isHexahedron() const │ │ │ │ │ +Return true if entity is a hexahedron. │ │ │ │ │ +Definition type.hh:326 │ │ │ │ │ +Dune::GeometryType::isSimplex │ │ │ │ │ +constexpr bool isSimplex() const │ │ │ │ │ +Return true if entity is a simplex of any dimension. │ │ │ │ │ +Definition type.hh:331 │ │ │ │ │ +Dune::GeometryType::Id │ │ │ │ │ +IdType Id │ │ │ │ │ +An integral id representing a GeometryType. │ │ │ │ │ +Definition type.hh:193 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00206.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: hcube.cc File Reference │ │ │ │ +dune-geometry: typefromvertexcount.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,88 +65,39 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ Namespaces | │ │ │ │ -Macros
│ │ │ │ -
hcube.cc File Reference
│ │ │ │ +Functions
│ │ │ │ +
typefromvertexcount.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ - │ │ │ │ -

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

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

Go to the source code of this file.

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

│ │ │ │ -Classes

class  Dune::RefinementImp::HCube::RefinementImp< dimension_, CoordType >
 Refinement implementation for hypercubes More...
 
struct  Dune::RefinementImp::HCube::RefinementImp< dimension_, CoordType >::Codim< codimension >
 
class  Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial< dimension, CoordType, codimension >
 SubEntityIterator base class for hypercube refinement. More...
 
class  Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial< dimension, CoordType, dimension >
 
class  Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial< dimension, CoordType, 0 >
 
class  Dune::RefinementImp::HCube::RefinementImp< dimension_, CoordType >::Codim< codimension >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::RefinementImp
 This namespace contains the implementation of Refinement.
 
namespace  Dune::RefinementImp::HCube
 This namespace contains the Refinement implementation for hypercubes (GeometryType::cube).
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ -Macros

#define DUNE_GEOMETRY_REFINEMENT_HCUBE_CC
 

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

Detailed Description

│ │ │ │ -

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

│ │ │ │ -

See Refinement implementation for hypercubes.

│ │ │ │ -

Macro Definition Documentation

│ │ │ │ - │ │ │ │ -

◆ DUNE_GEOMETRY_REFINEMENT_HCUBE_CC

│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
#define DUNE_GEOMETRY_REFINEMENT_HCUBE_CC
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -6,62 +6,24 @@ │ │ │ │ │ dune-geometry 2.9.0 │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ - * refinement │ │ │ │ │ -Classes | Namespaces | Macros │ │ │ │ │ -hcube.cc File Reference │ │ │ │ │ -This file contains the Refinement implementation for hypercubes │ │ │ │ │ -(quadrilaterals, hexahedrons, etc.). More... │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include "base.cc" │ │ │ │ │ + * utility │ │ │ │ │ +Namespaces | Functions │ │ │ │ │ +typefromvertexcount.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ - Classes │ │ │ │ │ - class  Dune::RefinementImp::HCube::RefinementImp<_dimension_,_CoordType_> │ │ │ │ │ -  Refinement implementation for hypercubes More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::RefinementImp::HCube::RefinementImp<_dimension_,_CoordType_>:: │ │ │ │ │ - Codim<_codimension_> │ │ │ │ │ -  │ │ │ │ │ - class  Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial< │ │ │ │ │ - dimension,_CoordType,_codimension_> │ │ │ │ │ -  SubEntityIterator base class for hypercube refinement. More... │ │ │ │ │ -  │ │ │ │ │ - class  Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial< │ │ │ │ │ - dimension,_CoordType,_dimension_> │ │ │ │ │ -  │ │ │ │ │ - class  Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial< │ │ │ │ │ - dimension,_CoordType,_0_> │ │ │ │ │ -  │ │ │ │ │ - class  Dune::RefinementImp::HCube::RefinementImp<_dimension_,_CoordType_>:: │ │ │ │ │ - Codim<_codimension_> │ │ │ │ │ -  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ -namespace  Dune::RefinementImp │ │ │ │ │ -  This namespace contains the implementation of Refinement. │ │ │ │ │ -  │ │ │ │ │ -namespace  Dune::RefinementImp::HCube │ │ │ │ │ -  This namespace contains the Refinement implementation for │ │ │ │ │ - hypercubes (GeometryType::cube). │ │ │ │ │ -  │ │ │ │ │ - Macros │ │ │ │ │ -#define DUNE_GEOMETRY_REFINEMENT_HCUBE_CC │ │ │ │ │ + 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. │ │ │ │ │   │ │ │ │ │ -***** Detailed Description ***** │ │ │ │ │ -This file contains the Refinement implementation for hypercubes │ │ │ │ │ -(quadrilaterals, hexahedrons, etc.). │ │ │ │ │ -See Refinement_implementation_for_hypercubes. │ │ │ │ │ -***** Macro Definition Documentation ***** │ │ │ │ │ -***** ◆ DUNE_GEOMETRY_REFINEMENT_HCUBE_CC ***** │ │ │ │ │ -#define DUNE_GEOMETRY_REFINEMENT_HCUBE_CC │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00206_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: hcube.cc Source File │ │ │ │ +dune-geometry: typefromvertexcount.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,477 +70,77 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
hcube.cc
│ │ │ │ +
typefromvertexcount.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
│ │ │ │ -
5#ifndef DUNE_GEOMETRY_REFINEMENT_HCUBE_CC
│ │ │ │ -
6#define DUNE_GEOMETRY_REFINEMENT_HCUBE_CC
│ │ │ │ +
5#ifndef DUNE_GEOMETRY_TYPE_FROM_VERTEX_COUNT_HH
│ │ │ │ +
6#define DUNE_GEOMETRY_TYPE_FROM_VERTEX_COUNT_HH
│ │ │ │
7
│ │ │ │ -
42#include <cassert>
│ │ │ │ -
43
│ │ │ │ -
44#include <dune/common/fvector.hh>
│ │ │ │ -
45#include <dune/common/iteratorfacades.hh>
│ │ │ │ -
46
│ │ │ │ - │ │ │ │ - │ │ │ │ -
49
│ │ │ │ -
50#include "base.cc" // for RefinementTraits
│ │ │ │ -
51
│ │ │ │ -
52namespace Dune
│ │ │ │ -
53{
│ │ │ │ -
54 namespace RefinementImp
│ │ │ │ -
55 {
│ │ │ │ -
│ │ │ │ -
62 namespace HCube
│ │ │ │ -
63 {
│ │ │ │ -
73 template<int dimension_, class CoordType>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
75 {
│ │ │ │ -
76 public:
│ │ │ │ -
78 constexpr static int dimension = dimension_;
│ │ │ │ -
79 //- Know yourself
│ │ │ │ - │ │ │ │ -
81
│ │ │ │ -
82 template<int codimension>
│ │ │ │ -
83 struct Codim;
│ │ │ │ - │ │ │ │ -
85 typedef FieldVector<CoordType, dimension> CoordVector;
│ │ │ │ - │ │ │ │ -
87 typedef FieldVector<int, (1<<dimension)> IndexVector;
│ │ │ │ -
88
│ │ │ │ -
89 static unsigned nVertices(unsigned nIntervals);
│ │ │ │ -
90 static VertexIterator vBegin(unsigned nIntervals);
│ │ │ │ -
91 static VertexIterator vEnd(unsigned nIntervals);
│ │ │ │ -
92
│ │ │ │ -
93 static unsigned nElements(unsigned nIntervals);
│ │ │ │ -
94 static ElementIterator eBegin(unsigned nIntervals);
│ │ │ │ -
95 static ElementIterator eEnd(unsigned nIntervals);
│ │ │ │ -
96 };
│ │ │ │ -
│ │ │ │ -
97
│ │ │ │ -
98 template<int dimension, class CoordType>
│ │ │ │ -
99 template<int codimension>
│ │ │ │ -
│ │ │ │ -
100 struct RefinementImp<dimension, CoordType>::Codim
│ │ │ │ -
101 {
│ │ │ │ -
102 class SubEntityIterator;
│ │ │ │ - │ │ │ │ -
104 };
│ │ │ │ -
│ │ │ │ -
105
│ │ │ │ -
106 template<int dimension, class CoordType>
│ │ │ │ -
107 unsigned
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
109 nVertices(unsigned nIntervals)
│ │ │ │ -
110 {
│ │ │ │ -
111 // return (nIntervals + 1)^dim
│ │ │ │ -
112 return Dune::power(nIntervals+1u, unsigned(dimension));
│ │ │ │ -
113 }
│ │ │ │ -
│ │ │ │ -
114
│ │ │ │ -
115 template<int dimension, class CoordType>
│ │ │ │ - │ │ │ │ -
│ │ │ │ - │ │ │ │ -
118 vBegin(unsigned nIntervals)
│ │ │ │ -
119 {
│ │ │ │ -
120 return VertexIterator(0,nIntervals);
│ │ │ │ -
121 }
│ │ │ │ -
│ │ │ │ -
122
│ │ │ │ -
123 template<int dimension, class CoordType>
│ │ │ │ - │ │ │ │ -
│ │ │ │ - │ │ │ │ -
126 vEnd(unsigned nIntervals)
│ │ │ │ -
127 {
│ │ │ │ -
128 return VertexIterator(nVertices(nIntervals),nIntervals);
│ │ │ │ -
129 }
│ │ │ │ -
│ │ │ │ -
130
│ │ │ │ -
131 template<int dimension, class CoordType>
│ │ │ │ -
132 unsigned
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
134 nElements(unsigned nIntervals)
│ │ │ │ -
135 {
│ │ │ │ -
136 static_assert(dimension >= 0,
│ │ │ │ -
137 "Negative dimension given, what the heck is that supposed to mean?");
│ │ │ │ -
138 // return nIntervals^dim
│ │ │ │ -
139 return Dune::power(nIntervals, unsigned(dimension));
│ │ │ │ -
140 }
│ │ │ │ -
│ │ │ │ -
141
│ │ │ │ -
142 template<int dimension, class CoordType>
│ │ │ │ - │ │ │ │ -
│ │ │ │ - │ │ │ │ -
145 eBegin(unsigned nIntervals)
│ │ │ │ -
146 {
│ │ │ │ -
147 return ElementIterator(0,nIntervals);
│ │ │ │ -
148 }
│ │ │ │ -
│ │ │ │ -
149
│ │ │ │ -
150 template<int dimension, class CoordType>
│ │ │ │ - │ │ │ │ -
│ │ │ │ - │ │ │ │ -
153 eEnd(unsigned nIntervals)
│ │ │ │ -
154 {
│ │ │ │ -
155 return ElementIterator(nElements(nIntervals),nIntervals);
│ │ │ │ -
156 }
│ │ │ │ + │ │ │ │ +
9
│ │ │ │ +
10namespace Dune {
│ │ │ │ +
11
│ │ │ │ +
16 inline
│ │ │ │ +
│ │ │ │ +
17 GeometryType geometryTypeFromVertexCount(unsigned int dim, unsigned int vertices)
│ │ │ │ +
18 {
│ │ │ │ +
19 switch (dim)
│ │ │ │ +
20 {
│ │ │ │ +
21 case 0 :
│ │ │ │ +
22 return GeometryTypes::vertex;
│ │ │ │ +
23 case 1 :
│ │ │ │ +
24 return GeometryTypes::line;
│ │ │ │ +
25 case 2 :
│ │ │ │ +
26 switch (vertices) {
│ │ │ │ +
27 case 3 :
│ │ │ │ +
28 return GeometryTypes::triangle;
│ │ │ │ +
29 case 4 :
│ │ │ │ +
30 return GeometryTypes::quadrilateral;
│ │ │ │ +
31 default :
│ │ │ │ +
32 DUNE_THROW(NotImplemented, "2d elements with " << vertices << " corners are not supported!");
│ │ │ │ +
33 }
│ │ │ │ +
34 case 3 :
│ │ │ │ +
35 switch (vertices) {
│ │ │ │ +
36 case 4 :
│ │ │ │ +
37 return GeometryTypes::tetrahedron;
│ │ │ │ +
38 case 5 :
│ │ │ │ +
39 return GeometryTypes::pyramid;
│ │ │ │ +
40 case 6 :
│ │ │ │ +
41 return GeometryTypes::prism;
│ │ │ │ +
42 case 8 :
│ │ │ │ +
43 return GeometryTypes::hexahedron;
│ │ │ │ +
44 default :
│ │ │ │ +
45 DUNE_THROW(NotImplemented, "3d elements with " << vertices << " corners are not supported!");
│ │ │ │ +
46 }
│ │ │ │ +
47 default :
│ │ │ │ +
48 DUNE_THROW(NotImplemented, "geometryTypeFromVertexCount works only up to dim=3");
│ │ │ │ +
49 }
│ │ │ │ +
50 }
│ │ │ │
│ │ │ │ -
157
│ │ │ │ -
158 //
│ │ │ │ -
159 // The iterators
│ │ │ │ -
160 //
│ │ │ │ -
161
│ │ │ │ -
162#ifdef DOXYGEN
│ │ │ │ -
174 template<int dimension, class CoordType, int codimension>
│ │ │ │ - │ │ │ │ -
176#else
│ │ │ │ -
177 template<int dimension, class CoordType, int codimension>
│ │ │ │ - │ │ │ │ -
179#endif //DOXYGEN
│ │ │ │ -
180
│ │ │ │ -
181 // for vertices
│ │ │ │ -
182
│ │ │ │ -
183 template<int dimension, class CoordType>
│ │ │ │ -
│ │ │ │ -
184 class RefinementSubEntityIteratorSpecial<dimension, CoordType, dimension>
│ │ │ │ -
185 {
│ │ │ │ -
186 public:
│ │ │ │ - │ │ │ │ -
188 typedef typename Refinement::template Codim<dimension>::SubEntityIterator Common;
│ │ │ │ -
189 typedef typename Refinement::CoordVector CoordVector;
│ │ │ │ -
190
│ │ │ │ -
191 CoordVector coords() const;
│ │ │ │ -
192
│ │ │ │ -
193 private:
│ │ │ │ -
194 const Common & asCommon() const
│ │ │ │ -
195 {
│ │ │ │ -
196 return *static_cast<const Common*>(this);
│ │ │ │ -
197 }
│ │ │ │ -
198 };
│ │ │ │ -
│ │ │ │ -
199
│ │ │ │ -
200 template<int dimension, class CoordType>
│ │ │ │ -
201 typename RefinementSubEntityIteratorSpecial<dimension, CoordType, dimension>::CoordVector
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
203 coords() const
│ │ │ │ -
204 {
│ │ │ │ -
205 std::array<unsigned int, dimension> v(asCommon().vertexCoord());
│ │ │ │ -
206 CoordVector c;
│ │ │ │ -
207 for (int d = 0; d < dimension; d++)
│ │ │ │ -
208 {
│ │ │ │ -
209 c[d] = v[d]*1.0 / asCommon()._nIntervals;
│ │ │ │ -
210 }
│ │ │ │ -
211 return c;
│ │ │ │ -
212 }
│ │ │ │ -
│ │ │ │ -
213
│ │ │ │ -
214 // for elements
│ │ │ │ -
215
│ │ │ │ -
216 template<int dimension, class CoordType>
│ │ │ │ -
│ │ │ │ -
217 class RefinementSubEntityIteratorSpecial<dimension, CoordType, 0>
│ │ │ │ -
218 {
│ │ │ │ -
219 public:
│ │ │ │ - │ │ │ │ -
221 typedef typename Refinement::template Codim<0>::SubEntityIterator Common;
│ │ │ │ -
222 typedef typename Refinement::IndexVector IndexVector;
│ │ │ │ -
223 typedef typename Refinement::CoordVector CoordVector;
│ │ │ │ -
224
│ │ │ │ -
225 IndexVector vertexIndices() const;
│ │ │ │ -
226 CoordVector coords() const;
│ │ │ │ -
227
│ │ │ │ -
228 private:
│ │ │ │ -
229 const Common & asCommon() const
│ │ │ │ -
230 {
│ │ │ │ -
231 return *static_cast<const Common*>(this);
│ │ │ │ -
232 }
│ │ │ │ -
233 };
│ │ │ │ -
│ │ │ │ -
234
│ │ │ │ -
235 template<int dimension, class CoordType>
│ │ │ │ -
236 typename RefinementSubEntityIteratorSpecial<dimension, CoordType, 0>::IndexVector
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
238 vertexIndices() const
│ │ │ │ -
239 {
│ │ │ │ -
240 constexpr static int nIndices = 1 << dimension;
│ │ │ │ -
241
│ │ │ │ -
242 // cell index tuple
│ │ │ │ -
243 std::array<unsigned int, dimension> e(asCommon().cellCoord());
│ │ │ │ -
244
│ │ │ │ -
245 // vertices
│ │ │ │ -
246 IndexVector vec;
│ │ │ │ -
247 for(int i = 0; i < nIndices; ++i)
│ │ │ │ -
248 {
│ │ │ │ -
249 int base = 1;
│ │ │ │ -
250 std::array<unsigned int, dimension> alpha(asCommon().idx2multiidx(i));
│ │ │ │ -
251 for (int d = 0; d < dimension; d++) {
│ │ │ │ -
252 vec[i] += (alpha[d] + e[d]) * base;
│ │ │ │ -
253 base *= asCommon()._nIntervals+1;
│ │ │ │ -
254 }
│ │ │ │ -
255 }
│ │ │ │ -
256 return vec;
│ │ │ │ -
257 }
│ │ │ │ -
│ │ │ │ -
258
│ │ │ │ -
259 template<int dimension, class CoordType>
│ │ │ │ - │ │ │ │ -
│ │ │ │ - │ │ │ │ -
262 coords() const
│ │ │ │ -
263 {
│ │ │ │ -
264 std::array<unsigned int, dimension> v(asCommon().cellCoord());
│ │ │ │ -
265 CoordVector c;
│ │ │ │ -
266 for (int d=0; d<dimension; d++)
│ │ │ │ -
267 {
│ │ │ │ -
268 c[d] = (v[d]*1.0 + 0.5) / asCommon()._nIntervals;
│ │ │ │ -
269 }
│ │ │ │ -
270 return c;
│ │ │ │ -
271 }
│ │ │ │ -
│ │ │ │ -
272
│ │ │ │ -
273 // common
│ │ │ │ -
274 template<int dimension, class CoordType>
│ │ │ │ -
275 template<int codimension>
│ │ │ │ -
│ │ │ │ -
276 class RefinementImp<dimension, CoordType>::Codim<codimension>::SubEntityIterator
│ │ │ │ -
277 : public ForwardIteratorFacade<typename RefinementImp<dimension,
│ │ │ │ -
278 CoordType>::template Codim<codimension>::SubEntityIterator, int>,
│ │ │ │ -
279 public RefinementSubEntityIteratorSpecial<dimension, CoordType, codimension>
│ │ │ │ -
280 {
│ │ │ │ -
281 public:
│ │ │ │ - │ │ │ │ -
283 typedef typename Refinement::template Codim<codimension>::SubEntityIterator This;
│ │ │ │ -
284
│ │ │ │ -
285 SubEntityIterator(unsigned int index, unsigned int nIntervals);
│ │ │ │ -
286
│ │ │ │ -
287 bool equals(const This &other) const;
│ │ │ │ -
288 void increment();
│ │ │ │ -
289
│ │ │ │ -
290 int index() const;
│ │ │ │ -
291 Geometry geometry () const;
│ │ │ │ -
292 private:
│ │ │ │ -
293 friend class RefinementSubEntityIteratorSpecial<dimension, CoordType, codimension>;
│ │ │ │ -
294 unsigned int _index;
│ │ │ │ -
295 unsigned int _nIntervals;
│ │ │ │ -
296
│ │ │ │ -
297 std::array<unsigned int, dimension>
│ │ │ │ -
298 cellCoord(unsigned int idx) const
│ │ │ │ -
299 {
│ │ │ │ -
300 return idx2coord(idx, _nIntervals);
│ │ │ │ -
301 }
│ │ │ │ -
302
│ │ │ │ -
303 std::array<unsigned int, dimension>
│ │ │ │ -
304 vertexCoord(unsigned int idx) const
│ │ │ │ -
305 {
│ │ │ │ -
306 return idx2coord(idx, _nIntervals+1u);
│ │ │ │ -
307 }
│ │ │ │ -
308
│ │ │ │ -
309 std::array<unsigned int, dimension>
│ │ │ │ -
310 cellCoord() const
│ │ │ │ -
311 {
│ │ │ │ -
312 return cellCoord(_index);
│ │ │ │ -
313 }
│ │ │ │ -
314
│ │ │ │ -
315 std::array<unsigned int, dimension>
│ │ │ │ -
316 vertexCoord() const
│ │ │ │ -
317 {
│ │ │ │ -
318 return vertexCoord(_index);
│ │ │ │ -
319 }
│ │ │ │ -
320
│ │ │ │ -
321 std::array<unsigned int, dimension>
│ │ │ │ -
322 idx2coord(unsigned int idx, unsigned int w) const
│ │ │ │ -
323 {
│ │ │ │ -
324 std::array<unsigned int, dimension> c;
│ │ │ │ -
325 for (unsigned int d = 0; d < dimension; d++)
│ │ │ │ -
326 {
│ │ │ │ -
327 c[d] = idx%w;
│ │ │ │ -
328 idx = idx/w;
│ │ │ │ -
329 }
│ │ │ │ -
330 return c;
│ │ │ │ -
331 }
│ │ │ │ -
332
│ │ │ │ -
333 unsigned int
│ │ │ │ -
334 coord2idx(std::array<unsigned int, dimension> c, unsigned int w) const
│ │ │ │ -
335 {
│ │ │ │ -
336 unsigned int i = 0;
│ │ │ │ -
337 for (unsigned int d = dimension; d > 0; d--)
│ │ │ │ -
338 {
│ │ │ │ -
339 i *= w;
│ │ │ │ -
340 i += c[d-1];
│ │ │ │ -
341 }
│ │ │ │ -
342 return i;
│ │ │ │ -
343 }
│ │ │ │ -
344
│ │ │ │ -
345 std::array<unsigned int, dimension>
│ │ │ │ -
346 idx2multiidx(unsigned int idx) const
│ │ │ │ -
347 {
│ │ │ │ -
348 std::array<unsigned int, dimension> alpha;
│ │ │ │ -
349 for (unsigned int i = 0; i < dimension; ++i)
│ │ │ │ -
350 alpha[i] = (idx >> i) & 1u;
│ │ │ │ -
351 return alpha;
│ │ │ │ -
352 }
│ │ │ │ -
353 };
│ │ │ │ -
│ │ │ │ -
354
│ │ │ │ -
355#ifndef DOXYGEN
│ │ │ │ -
356 template<int dimension, class CoordType>
│ │ │ │ -
357 template<int codimension>
│ │ │ │ -
358 RefinementImp<dimension, CoordType>::Codim<codimension>::SubEntityIterator::
│ │ │ │ -
359 SubEntityIterator(unsigned int index, unsigned int nIntervals)
│ │ │ │ -
360 : _index(index), _nIntervals(nIntervals)
│ │ │ │ -
361 {}
│ │ │ │ -
362
│ │ │ │ -
363 template<int dimension, class CoordType>
│ │ │ │ -
364 template<int codimension>
│ │ │ │ -
365 bool
│ │ │ │ -
366 RefinementImp<dimension, CoordType>::Codim<codimension>::SubEntityIterator::
│ │ │ │ -
367 equals(const This &other) const
│ │ │ │ -
368 {
│ │ │ │ -
369 return ((_index == other._index) && (_nIntervals == other._nIntervals));
│ │ │ │ -
370 }
│ │ │ │ -
371
│ │ │ │ -
372 template<int dimension, class CoordType>
│ │ │ │ -
373 template<int codimension>
│ │ │ │ -
374 void
│ │ │ │ -
375 RefinementImp<dimension, CoordType>::Codim<codimension>::SubEntityIterator::
│ │ │ │ -
376 increment()
│ │ │ │ -
377 {
│ │ │ │ -
378 ++_index;
│ │ │ │ -
379 }
│ │ │ │ -
380
│ │ │ │ -
381 template<int dimension, class CoordType>
│ │ │ │ -
382 template<int codimension>
│ │ │ │ -
383 int
│ │ │ │ -
384 RefinementImp<dimension, CoordType>::Codim<codimension>::SubEntityIterator::
│ │ │ │ -
385 index() const
│ │ │ │ -
386 {
│ │ │ │ -
387 return _index;
│ │ │ │ -
388 }
│ │ │ │ -
389
│ │ │ │ -
390 template<int dimension, class CoordType>
│ │ │ │ -
391 template<int codimension>
│ │ │ │ -
392 typename RefinementImp<dimension, CoordType>::template Codim<codimension>::Geometry
│ │ │ │ -
393 RefinementImp<dimension, CoordType>::Codim<codimension>::SubEntityIterator::geometry () const
│ │ │ │ -
394 {
│ │ │ │ -
395 std::array<unsigned int,dimension> intCoords = idx2coord(_index,_nIntervals);
│ │ │ │ -
396
│ │ │ │ -
397 Dune::FieldVector<CoordType,dimension> lower;
│ │ │ │ -
398 Dune::FieldVector<CoordType,dimension> upper;
│ │ │ │ -
399
│ │ │ │ -
400 assert(codimension == 0 or codimension == dimension);
│ │ │ │ -
401
│ │ │ │ -
402 if constexpr (codimension == 0) {
│ │ │ │ -
403 for (size_t j = 0; j < dimension; j++)
│ │ │ │ -
404 {
│ │ │ │ -
405 lower[j] = double(intCoords[j]) / double(_nIntervals);
│ │ │ │ -
406 upper[j] = double(intCoords[j] + 1) / double(_nIntervals);
│ │ │ │ -
407 }
│ │ │ │ -
408
│ │ │ │ -
409 return typename RefinementImp<dimension,
│ │ │ │ -
410 CoordType>::template Codim<codimension>::Geometry(lower,upper);
│ │ │ │ -
411 } else {
│ │ │ │ -
412 for (size_t j = 0; j < dimension; j++)
│ │ │ │ -
413 lower[j] = upper[j] = double(intCoords[j]) / double(_nIntervals);
│ │ │ │ -
414
│ │ │ │ -
415 return typename RefinementImp<dimension,
│ │ │ │ -
416 CoordType>::template Codim<codimension>::Geometry(lower,upper,std::bitset<dimension>(0));
│ │ │ │ -
417 }
│ │ │ │ -
418 }
│ │ │ │ -
419
│ │ │ │ -
420#endif // DOXYGEN
│ │ │ │ -
421
│ │ │ │ -
422 } // namespace HCube
│ │ │ │ -
│ │ │ │ -
423
│ │ │ │ -
424 // ///////////////////////
│ │ │ │ -
425 //
│ │ │ │ -
426 // The refinement traits
│ │ │ │ -
427 //
│ │ │ │ -
428
│ │ │ │ -
429#ifndef DOXYGEN
│ │ │ │ -
430 template<unsigned topologyId, class CoordType, unsigned coerceToId,
│ │ │ │ -
431 int dim>
│ │ │ │ -
432 struct Traits<
│ │ │ │ -
433 topologyId, CoordType, coerceToId, dim,
│ │ │ │ -
434 typename std::enable_if<
│ │ │ │ -
435 (dim >= 2 &&
│ │ │ │ -
436 (GeometryTypes::cube(dim).id() >> 1) ==
│ │ │ │ -
437 (topologyId >> 1) &&
│ │ │ │ -
438 (GeometryTypes::cube(dim).id() >> 1) ==
│ │ │ │ -
439 (coerceToId >> 1)
│ │ │ │ -
440 )>::type
│ │ │ │ -
441 >
│ │ │ │ -
442 {
│ │ │ │ -
443 typedef HCube::RefinementImp<dim, CoordType> Imp;
│ │ │ │ -
444 };
│ │ │ │ -
445#endif
│ │ │ │ -
446
│ │ │ │ -
447 } // namespace RefinementImp
│ │ │ │ -
448
│ │ │ │ -
449} // namespace Dune
│ │ │ │ -
450
│ │ │ │ -
451#endif // DUNE_GEOMETRY_REFINEMENT_HCUBE_CC
│ │ │ │ - │ │ │ │ -
This file contains the parts independent of a particular Refinement implementation.
│ │ │ │ -
A geometry implementation for axis-aligned hypercubes.
│ │ │ │ +
51
│ │ │ │ +
52}
│ │ │ │ +
53
│ │ │ │ +
54#endif // DUNE_GEOMETRY_TYPE_FROM_VERTEX_COUNT_HH
│ │ │ │ +
A unique label for each type of element that can occur in a grid.
│ │ │ │
Definition affinegeometry.hh:21
│ │ │ │ -
A geometry implementation for axis-aligned hypercubes.
Definition axisalignedcubegeometry.hh:50
│ │ │ │ -
Static tag representing a codimension.
Definition dimension.hh:24
│ │ │ │ -
Refinement implementation for hypercubes
Definition hcube.cc:75
│ │ │ │ -
Codim< 0 >::SubEntityIterator ElementIterator
Definition hcube.cc:86
│ │ │ │ -
static ElementIterator eEnd(unsigned nIntervals)
Definition hcube.cc:153
│ │ │ │ -
static unsigned nVertices(unsigned nIntervals)
Definition hcube.cc:109
│ │ │ │ -
static VertexIterator vEnd(unsigned nIntervals)
Definition hcube.cc:126
│ │ │ │ -
FieldVector< int,(1<< dimension)> IndexVector
Definition hcube.cc:87
│ │ │ │ -
Codim< dimension >::SubEntityIterator VertexIterator
Definition hcube.cc:84
│ │ │ │ -
FieldVector< CoordType, dimension > CoordVector
Definition hcube.cc:85
│ │ │ │ -
static unsigned nElements(unsigned nIntervals)
Definition hcube.cc:134
│ │ │ │ -
RefinementImp< dimension, CoordType > Refinement
Definition hcube.cc:80
│ │ │ │ -
static ElementIterator eBegin(unsigned nIntervals)
Definition hcube.cc:145
│ │ │ │ -
static constexpr int dimension
Know your own dimension.
Definition hcube.cc:78
│ │ │ │ -
static VertexIterator vBegin(unsigned nIntervals)
Definition hcube.cc:118
│ │ │ │ - │ │ │ │ -
Dune::AxisAlignedCubeGeometry< CoordType, dimension-codimension, dimension > Geometry
Definition hcube.cc:103
│ │ │ │ -
SubEntityIterator base class for hypercube refinement.
Definition hcube.cc:175
│ │ │ │ - │ │ │ │ -
Refinement::template Codim< dimension >::SubEntityIterator Common
Definition hcube.cc:188
│ │ │ │ - │ │ │ │ -
RefinementImp< dimension, CoordType > Refinement
Definition hcube.cc:220
│ │ │ │ -
Refinement::template Codim< 0 >::SubEntityIterator Common
Definition hcube.cc:221
│ │ │ │ - │ │ │ │ - │ │ │ │ -
SubEntityIterator(unsigned int index, unsigned int nIntervals)
│ │ │ │ - │ │ │ │ - │ │ │ │ -
RefinementImp< dimension, CoordType > Refinement
Definition hcube.cc:282
│ │ │ │ - │ │ │ │ - │ │ │ │ -
Refinement::template Codim< codimension >::SubEntityIterator This
Definition hcube.cc:283
│ │ │ │ +
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
│ │ │ │ +
Unique label for each type of entities that can occur in DUNE grids.
Definition type.hh:126
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -7,529 +7,81 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ - * refinement │ │ │ │ │ -hcube.cc │ │ │ │ │ + * utility │ │ │ │ │ +typefromvertexcount.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception │ │ │ │ │ - 5#ifndef DUNE_GEOMETRY_REFINEMENT_HCUBE_CC │ │ │ │ │ -6#define DUNE_GEOMETRY_REFINEMENT_HCUBE_CC │ │ │ │ │ + 5#ifndef DUNE_GEOMETRY_TYPE_FROM_VERTEX_COUNT_HH │ │ │ │ │ + 6#define DUNE_GEOMETRY_TYPE_FROM_VERTEX_COUNT_HH │ │ │ │ │ 7 │ │ │ │ │ - 42#include │ │ │ │ │ - 43 │ │ │ │ │ - 44#include │ │ │ │ │ - 45#include │ │ │ │ │ - 46 │ │ │ │ │ - 47#include │ │ │ │ │ - 48#include │ │ │ │ │ - 49 │ │ │ │ │ - 50#include "base.cc" // for RefinementTraits │ │ │ │ │ + 8#include │ │ │ │ │ + 9 │ │ │ │ │ + 10namespace Dune { │ │ │ │ │ + 11 │ │ │ │ │ + 16 inline │ │ │ │ │ +17 GeometryType geometryTypeFromVertexCount(unsigned int dim, unsigned int │ │ │ │ │ +vertices) │ │ │ │ │ + 18 { │ │ │ │ │ + 19 switch (dim) │ │ │ │ │ + 20 { │ │ │ │ │ + 21 case 0 : │ │ │ │ │ + 22 return GeometryTypes::vertex; │ │ │ │ │ + 23 case 1 : │ │ │ │ │ + 24 return GeometryTypes::line; │ │ │ │ │ + 25 case 2 : │ │ │ │ │ + 26 switch (vertices) { │ │ │ │ │ + 27 case 3 : │ │ │ │ │ + 28 return GeometryTypes::triangle; │ │ │ │ │ + 29 case 4 : │ │ │ │ │ + 30 return GeometryTypes::quadrilateral; │ │ │ │ │ + 31 default : │ │ │ │ │ + 32 DUNE_THROW(NotImplemented, "2d elements with " << vertices << " corners are │ │ │ │ │ +not supported!"); │ │ │ │ │ + 33 } │ │ │ │ │ + 34 case 3 : │ │ │ │ │ + 35 switch (vertices) { │ │ │ │ │ + 36 case 4 : │ │ │ │ │ + 37 return GeometryTypes::tetrahedron; │ │ │ │ │ + 38 case 5 : │ │ │ │ │ + 39 return GeometryTypes::pyramid; │ │ │ │ │ + 40 case 6 : │ │ │ │ │ + 41 return GeometryTypes::prism; │ │ │ │ │ + 42 case 8 : │ │ │ │ │ + 43 return GeometryTypes::hexahedron; │ │ │ │ │ + 44 default : │ │ │ │ │ + 45 DUNE_THROW(NotImplemented, "3d elements with " << vertices << " corners are │ │ │ │ │ +not supported!"); │ │ │ │ │ + 46 } │ │ │ │ │ + 47 default : │ │ │ │ │ + 48 DUNE_THROW(NotImplemented, "geometryTypeFromVertexCount works only up to │ │ │ │ │ +dim=3"); │ │ │ │ │ + 49 } │ │ │ │ │ + 50 } │ │ │ │ │ 51 │ │ │ │ │ - 52namespace Dune │ │ │ │ │ - 53{ │ │ │ │ │ - 54 namespace RefinementImp │ │ │ │ │ - 55 { │ │ │ │ │ -62 namespace HCube │ │ │ │ │ - 63 { │ │ │ │ │ - 73 template │ │ │ │ │ -74 class RefinementImp │ │ │ │ │ - 75 { │ │ │ │ │ - 76 public: │ │ │ │ │ -78 constexpr static int dimension = dimension_; │ │ │ │ │ - 79 //- Know yourself │ │ │ │ │ -80 typedef RefinementImp Refinement; │ │ │ │ │ - 81 │ │ │ │ │ - 82 template │ │ │ │ │ - 83 struct Codim; │ │ │ │ │ -84 typedef typename Codim::SubEntityIterator VertexIterator; │ │ │ │ │ -85 typedef FieldVector CoordVector; │ │ │ │ │ -86 typedef typename Codim<0>::SubEntityIterator ElementIterator; │ │ │ │ │ -87 typedef FieldVector IndexVector; │ │ │ │ │ - 88 │ │ │ │ │ - 89 static unsigned nVertices(unsigned nIntervals); │ │ │ │ │ - 90 static VertexIterator vBegin(unsigned nIntervals); │ │ │ │ │ - 91 static VertexIterator vEnd(unsigned nIntervals); │ │ │ │ │ - 92 │ │ │ │ │ - 93 static unsigned nElements(unsigned nIntervals); │ │ │ │ │ - 94 static ElementIterator eBegin(unsigned nIntervals); │ │ │ │ │ - 95 static ElementIterator eEnd(unsigned nIntervals); │ │ │ │ │ - 96 }; │ │ │ │ │ - 97 │ │ │ │ │ - 98 template │ │ │ │ │ - 99 template │ │ │ │ │ -100 struct RefinementImp::Codim │ │ │ │ │ - 101 { │ │ │ │ │ - 102 class SubEntityIterator; │ │ │ │ │ -103 typedef Dune::AxisAlignedCubeGeometry Geometry; │ │ │ │ │ - 104 }; │ │ │ │ │ - 105 │ │ │ │ │ - 106 template │ │ │ │ │ - 107 unsigned │ │ │ │ │ -108 RefinementImp:: │ │ │ │ │ - 109nVertices(unsigned nIntervals) │ │ │ │ │ - 110 { │ │ │ │ │ - 111 // return (nIntervals + 1)^dim │ │ │ │ │ - 112 return Dune::power(nIntervals+1u, unsigned(dimension)); │ │ │ │ │ - 113 } │ │ │ │ │ - 114 │ │ │ │ │ - 115 template │ │ │ │ │ - 116 typename RefinementImp::VertexIterator │ │ │ │ │ -117 RefinementImp:: │ │ │ │ │ - 118vBegin(unsigned nIntervals) │ │ │ │ │ - 119 { │ │ │ │ │ - 120 return VertexIterator(0,nIntervals); │ │ │ │ │ - 121 } │ │ │ │ │ - 122 │ │ │ │ │ - 123 template │ │ │ │ │ - 124 typename RefinementImp::VertexIterator │ │ │ │ │ -125 RefinementImp:: │ │ │ │ │ - 126vEnd(unsigned nIntervals) │ │ │ │ │ - 127 { │ │ │ │ │ - 128 return VertexIterator(nVertices(nIntervals),nIntervals); │ │ │ │ │ - 129 } │ │ │ │ │ - 130 │ │ │ │ │ - 131 template │ │ │ │ │ - 132 unsigned │ │ │ │ │ -133 RefinementImp:: │ │ │ │ │ - 134nElements(unsigned nIntervals) │ │ │ │ │ - 135 { │ │ │ │ │ - 136 static_assert(dimension >= 0, │ │ │ │ │ - 137 "Negative dimension given, what the heck is that supposed to mean?"); │ │ │ │ │ - 138 // return nIntervals^dim │ │ │ │ │ - 139 return Dune::power(nIntervals, unsigned(dimension)); │ │ │ │ │ - 140 } │ │ │ │ │ - 141 │ │ │ │ │ - 142 template │ │ │ │ │ - 143 typename RefinementImp::ElementIterator │ │ │ │ │ -144 RefinementImp:: │ │ │ │ │ - 145eBegin(unsigned nIntervals) │ │ │ │ │ - 146 { │ │ │ │ │ - 147 return ElementIterator(0,nIntervals); │ │ │ │ │ - 148 } │ │ │ │ │ - 149 │ │ │ │ │ - 150 template │ │ │ │ │ - 151 typename RefinementImp::ElementIterator │ │ │ │ │ -152 RefinementImp:: │ │ │ │ │ - 153eEnd(unsigned nIntervals) │ │ │ │ │ - 154 { │ │ │ │ │ - 155 return ElementIterator(nElements(nIntervals),nIntervals); │ │ │ │ │ - 156 } │ │ │ │ │ - 157 │ │ │ │ │ - 158 // │ │ │ │ │ - 159 // The iterators │ │ │ │ │ - 160 // │ │ │ │ │ - 161 │ │ │ │ │ - 162#ifdef DOXYGEN │ │ │ │ │ - 174 template │ │ │ │ │ -175 class RefinementSubEntityIteratorSpecial {}; │ │ │ │ │ - 176#else │ │ │ │ │ - 177 template │ │ │ │ │ - 178 class RefinementSubEntityIteratorSpecial; │ │ │ │ │ - 179#endif //DOXYGEN │ │ │ │ │ - 180 │ │ │ │ │ - 181 // for vertices │ │ │ │ │ - 182 │ │ │ │ │ - 183 template │ │ │ │ │ -184 class RefinementSubEntityIteratorSpecial │ │ │ │ │ - 185 { │ │ │ │ │ - 186 public: │ │ │ │ │ -187 typedef RefinementImp Refinement; │ │ │ │ │ -188 typedef typename Refinement::template Codim::SubEntityIterator │ │ │ │ │ -Common; │ │ │ │ │ -189 typedef typename Refinement::CoordVector CoordVector; │ │ │ │ │ - 190 │ │ │ │ │ - 191 CoordVector coords() const; │ │ │ │ │ - 192 │ │ │ │ │ - 193 private: │ │ │ │ │ - 194 const Common & asCommon() const │ │ │ │ │ - 195 { │ │ │ │ │ - 196 return *static_cast(this); │ │ │ │ │ - 197 } │ │ │ │ │ - 198 }; │ │ │ │ │ - 199 │ │ │ │ │ - 200 template │ │ │ │ │ - 201 typename RefinementSubEntityIteratorSpecial::CoordVector │ │ │ │ │ -202 RefinementSubEntityIteratorSpecial:: │ │ │ │ │ - 203coords() const │ │ │ │ │ - 204 { │ │ │ │ │ - 205 std::array v(asCommon().vertexCoord()); │ │ │ │ │ - 206 CoordVector c; │ │ │ │ │ - 207 for (int d = 0; d < dimension; d++) │ │ │ │ │ - 208 { │ │ │ │ │ - 209 c[d] = v[d]*1.0 / asCommon()._nIntervals; │ │ │ │ │ - 210 } │ │ │ │ │ - 211 return c; │ │ │ │ │ - 212 } │ │ │ │ │ - 213 │ │ │ │ │ - 214 // for elements │ │ │ │ │ - 215 │ │ │ │ │ - 216 template │ │ │ │ │ -217 class RefinementSubEntityIteratorSpecial │ │ │ │ │ - 218 { │ │ │ │ │ - 219 public: │ │ │ │ │ -220 typedef RefinementImp Refinement; │ │ │ │ │ -221 typedef typename Refinement::template Codim<0>::SubEntityIterator Common; │ │ │ │ │ -222 typedef typename Refinement::IndexVector IndexVector; │ │ │ │ │ -223 typedef typename Refinement::CoordVector CoordVector; │ │ │ │ │ - 224 │ │ │ │ │ - 225 IndexVector vertexIndices() const; │ │ │ │ │ - 226 CoordVector coords() const; │ │ │ │ │ - 227 │ │ │ │ │ - 228 private: │ │ │ │ │ - 229 const Common & asCommon() const │ │ │ │ │ - 230 { │ │ │ │ │ - 231 return *static_cast(this); │ │ │ │ │ - 232 } │ │ │ │ │ - 233 }; │ │ │ │ │ - 234 │ │ │ │ │ - 235 template │ │ │ │ │ - 236 typename RefinementSubEntityIteratorSpecial:: │ │ │ │ │ -IndexVector │ │ │ │ │ -237 RefinementSubEntityIteratorSpecial:: │ │ │ │ │ - 238vertexIndices() const │ │ │ │ │ - 239 { │ │ │ │ │ - 240 constexpr static int nIndices = 1 << dimension; │ │ │ │ │ - 241 │ │ │ │ │ - 242 // cell index tuple │ │ │ │ │ - 243 std::array e(asCommon().cellCoord()); │ │ │ │ │ - 244 │ │ │ │ │ - 245 // vertices │ │ │ │ │ - 246 IndexVector vec; │ │ │ │ │ - 247 for(int i = 0; i < nIndices; ++i) │ │ │ │ │ - 248 { │ │ │ │ │ - 249 int base = 1; │ │ │ │ │ - 250 std::array alpha(asCommon().idx2multiidx(i)); │ │ │ │ │ - 251 for (int d = 0; d < dimension; d++) { │ │ │ │ │ - 252 vec[i] += (alpha[d] + e[d]) * base; │ │ │ │ │ - 253 base *= asCommon()._nIntervals+1; │ │ │ │ │ - 254 } │ │ │ │ │ - 255 } │ │ │ │ │ - 256 return vec; │ │ │ │ │ - 257 } │ │ │ │ │ - 258 │ │ │ │ │ - 259 template │ │ │ │ │ - 260 typename RefinementSubEntityIteratorSpecial:: │ │ │ │ │ -CoordVector │ │ │ │ │ -261 RefinementSubEntityIteratorSpecial:: │ │ │ │ │ - 262coords() const │ │ │ │ │ - 263 { │ │ │ │ │ - 264 std::array v(asCommon().cellCoord()); │ │ │ │ │ - 265 CoordVector c; │ │ │ │ │ - 266 for (int d=0; d │ │ │ │ │ - 275 template │ │ │ │ │ -276 class RefinementImp::Codim:: │ │ │ │ │ -SubEntityIterator │ │ │ │ │ - 277 : public ForwardIteratorFacade::template Codim::SubEntityIterator, int>, │ │ │ │ │ - 279 public RefinementSubEntityIteratorSpecial │ │ │ │ │ - 280 { │ │ │ │ │ - 281 public: │ │ │ │ │ -282 typedef RefinementImp Refinement; │ │ │ │ │ -283 typedef typename Refinement::template Codim::SubEntityIterator │ │ │ │ │ -This; │ │ │ │ │ - 284 │ │ │ │ │ -285 SubEntityIterator(unsigned int index, unsigned int nIntervals); │ │ │ │ │ - 286 │ │ │ │ │ -287 bool equals(const This &other) const; │ │ │ │ │ -288 void increment(); │ │ │ │ │ - 289 │ │ │ │ │ -290 int index() const; │ │ │ │ │ -291 Geometry geometry () const; │ │ │ │ │ - 292 private: │ │ │ │ │ - 293 friend class RefinementSubEntityIteratorSpecial; │ │ │ │ │ - 294 unsigned int _index; │ │ │ │ │ - 295 unsigned int _nIntervals; │ │ │ │ │ - 296 │ │ │ │ │ - 297 std::array │ │ │ │ │ - 298 cellCoord(unsigned int idx) const │ │ │ │ │ - 299 { │ │ │ │ │ - 300 return idx2coord(idx, _nIntervals); │ │ │ │ │ - 301 } │ │ │ │ │ - 302 │ │ │ │ │ - 303 std::array │ │ │ │ │ - 304 vertexCoord(unsigned int idx) const │ │ │ │ │ - 305 { │ │ │ │ │ - 306 return idx2coord(idx, _nIntervals+1u); │ │ │ │ │ - 307 } │ │ │ │ │ - 308 │ │ │ │ │ - 309 std::array │ │ │ │ │ - 310 cellCoord() const │ │ │ │ │ - 311 { │ │ │ │ │ - 312 return cellCoord(_index); │ │ │ │ │ - 313 } │ │ │ │ │ - 314 │ │ │ │ │ - 315 std::array │ │ │ │ │ - 316 vertexCoord() const │ │ │ │ │ - 317 { │ │ │ │ │ - 318 return vertexCoord(_index); │ │ │ │ │ - 319 } │ │ │ │ │ - 320 │ │ │ │ │ - 321 std::array │ │ │ │ │ - 322 idx2coord(unsigned int idx, unsigned int w) const │ │ │ │ │ - 323 { │ │ │ │ │ - 324 std::array c; │ │ │ │ │ - 325 for (unsigned int d = 0; d < dimension; d++) │ │ │ │ │ - 326 { │ │ │ │ │ - 327 c[d] = idx%w; │ │ │ │ │ - 328 idx = idx/w; │ │ │ │ │ - 329 } │ │ │ │ │ - 330 return c; │ │ │ │ │ - 331 } │ │ │ │ │ - 332 │ │ │ │ │ - 333 unsigned int │ │ │ │ │ - 334 coord2idx(std::array c, unsigned int w) const │ │ │ │ │ - 335 { │ │ │ │ │ - 336 unsigned int i = 0; │ │ │ │ │ - 337 for (unsigned int d = dimension; d > 0; d--) │ │ │ │ │ - 338 { │ │ │ │ │ - 339 i *= w; │ │ │ │ │ - 340 i += c[d-1]; │ │ │ │ │ - 341 } │ │ │ │ │ - 342 return i; │ │ │ │ │ - 343 } │ │ │ │ │ - 344 │ │ │ │ │ - 345 std::array │ │ │ │ │ - 346 idx2multiidx(unsigned int idx) const │ │ │ │ │ - 347 { │ │ │ │ │ - 348 std::array alpha; │ │ │ │ │ - 349 for (unsigned int i = 0; i < dimension; ++i) │ │ │ │ │ - 350 alpha[i] = (idx >> i) & 1u; │ │ │ │ │ - 351 return alpha; │ │ │ │ │ - 352 } │ │ │ │ │ - 353 }; │ │ │ │ │ - 354 │ │ │ │ │ - 355#ifndef DOXYGEN │ │ │ │ │ - 356 template │ │ │ │ │ - 357 template │ │ │ │ │ - 358 RefinementImp::Codim:: │ │ │ │ │ -SubEntityIterator:: │ │ │ │ │ - 359 SubEntityIterator(unsigned int index, unsigned int nIntervals) │ │ │ │ │ - 360 : _index(index), _nIntervals(nIntervals) │ │ │ │ │ - 361 {} │ │ │ │ │ - 362 │ │ │ │ │ - 363 template │ │ │ │ │ - 364 template │ │ │ │ │ - 365 bool │ │ │ │ │ - 366 RefinementImp::Codim:: │ │ │ │ │ -SubEntityIterator:: │ │ │ │ │ - 367 equals(const This &other) const │ │ │ │ │ - 368 { │ │ │ │ │ - 369 return ((_index == other._index) && (_nIntervals == other._nIntervals)); │ │ │ │ │ - 370 } │ │ │ │ │ - 371 │ │ │ │ │ - 372 template │ │ │ │ │ - 373 template │ │ │ │ │ - 374 void │ │ │ │ │ - 375 RefinementImp::Codim:: │ │ │ │ │ -SubEntityIterator:: │ │ │ │ │ - 376 increment() │ │ │ │ │ - 377 { │ │ │ │ │ - 378 ++_index; │ │ │ │ │ - 379 } │ │ │ │ │ - 380 │ │ │ │ │ - 381 template │ │ │ │ │ - 382 template │ │ │ │ │ - 383 int │ │ │ │ │ - 384 RefinementImp::Codim:: │ │ │ │ │ -SubEntityIterator:: │ │ │ │ │ - 385 index() const │ │ │ │ │ - 386 { │ │ │ │ │ - 387 return _index; │ │ │ │ │ - 388 } │ │ │ │ │ - 389 │ │ │ │ │ - 390 template │ │ │ │ │ - 391 template │ │ │ │ │ - 392 typename RefinementImp::template │ │ │ │ │ -Codim::Geometry │ │ │ │ │ - 393 RefinementImp::Codim:: │ │ │ │ │ -SubEntityIterator::geometry () const │ │ │ │ │ - 394 { │ │ │ │ │ - 395 std::array intCoords = idx2coord │ │ │ │ │ -(_index,_nIntervals); │ │ │ │ │ - 396 │ │ │ │ │ - 397 Dune::FieldVector lower; │ │ │ │ │ - 398 Dune::FieldVector upper; │ │ │ │ │ - 399 │ │ │ │ │ - 400 assert(codimension == 0 or codimension == dimension); │ │ │ │ │ - 401 │ │ │ │ │ - 402 if constexpr (codimension == 0) { │ │ │ │ │ - 403 for (size_t j = 0; j < dimension; j++) │ │ │ │ │ - 404 { │ │ │ │ │ - 405 lower[j] = double(intCoords[j]) / double(_nIntervals); │ │ │ │ │ - 406 upper[j] = double(intCoords[j] + 1) / double(_nIntervals); │ │ │ │ │ - 407 } │ │ │ │ │ - 408 │ │ │ │ │ - 409 return typename RefinementImp::template Codim::Geometry(lower,upper); │ │ │ │ │ - 411 } else { │ │ │ │ │ - 412 for (size_t j = 0; j < dimension; j++) │ │ │ │ │ - 413 lower[j] = upper[j] = double(intCoords[j]) / double(_nIntervals); │ │ │ │ │ - 414 │ │ │ │ │ - 415 return typename RefinementImp::template Codim::Geometry(lower,upper,std:: │ │ │ │ │ -bitset(0)); │ │ │ │ │ - 417 } │ │ │ │ │ - 418 } │ │ │ │ │ - 419 │ │ │ │ │ - 420#endif // DOXYGEN │ │ │ │ │ - 421 │ │ │ │ │ - 422 } // namespace HCube │ │ │ │ │ - 423 │ │ │ │ │ - 424 // /////////////////////// │ │ │ │ │ - 425 // │ │ │ │ │ - 426 // The refinement traits │ │ │ │ │ - 427 // │ │ │ │ │ - 428 │ │ │ │ │ - 429#ifndef DOXYGEN │ │ │ │ │ - 430 template │ │ │ │ │ - 432 struct Traits< │ │ │ │ │ - 433 topologyId, CoordType, coerceToId, dim, │ │ │ │ │ - 434 typename std::enable_if< │ │ │ │ │ - 435 (dim >= 2 && │ │ │ │ │ - 436 (GeometryTypes::cube(dim).id() >> 1) == │ │ │ │ │ - 437 (topologyId >> 1) && │ │ │ │ │ - 438 (GeometryTypes::cube(dim).id() >> 1) == │ │ │ │ │ - 439 (coerceToId >> 1) │ │ │ │ │ - 440 )>::type │ │ │ │ │ - 441 > │ │ │ │ │ - 442 { │ │ │ │ │ - 443 typedef HCube::RefinementImp Imp; │ │ │ │ │ - 444 }; │ │ │ │ │ - 445#endif │ │ │ │ │ - 446 │ │ │ │ │ - 447 } // namespace RefinementImp │ │ │ │ │ - 448 │ │ │ │ │ - 449} // namespace Dune │ │ │ │ │ - 450 │ │ │ │ │ - 451#endif // DUNE_GEOMETRY_REFINEMENT_HCUBE_CC │ │ │ │ │ -referenceelements.hh │ │ │ │ │ -base.cc │ │ │ │ │ -This file contains the parts independent of a particular Refinement │ │ │ │ │ -implementation. │ │ │ │ │ -axisalignedcubegeometry.hh │ │ │ │ │ -A geometry implementation for axis-aligned hypercubes. │ │ │ │ │ + 52} │ │ │ │ │ + 53 │ │ │ │ │ + 54#endif // DUNE_GEOMETRY_TYPE_FROM_VERTEX_COUNT_HH │ │ │ │ │ +type.hh │ │ │ │ │ +A unique label for each type of element that can occur in a grid. │ │ │ │ │ Dune │ │ │ │ │ Definition affinegeometry.hh:21 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry │ │ │ │ │ -A geometry implementation for axis-aligned hypercubes. │ │ │ │ │ -Definition axisalignedcubegeometry.hh:50 │ │ │ │ │ -Dune::Codim │ │ │ │ │ -Static tag representing a codimension. │ │ │ │ │ -Definition dimension.hh:24 │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementImp │ │ │ │ │ -Refinement implementation for hypercubes │ │ │ │ │ -Definition hcube.cc:75 │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementImp::ElementIterator │ │ │ │ │ -Codim< 0 >::SubEntityIterator ElementIterator │ │ │ │ │ -Definition hcube.cc:86 │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementImp::eEnd │ │ │ │ │ -static ElementIterator eEnd(unsigned nIntervals) │ │ │ │ │ -Definition hcube.cc:153 │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementImp::nVertices │ │ │ │ │ -static unsigned nVertices(unsigned nIntervals) │ │ │ │ │ -Definition hcube.cc:109 │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementImp::vEnd │ │ │ │ │ -static VertexIterator vEnd(unsigned nIntervals) │ │ │ │ │ -Definition hcube.cc:126 │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementImp::IndexVector │ │ │ │ │ -FieldVector< int,(1<< dimension)> IndexVector │ │ │ │ │ -Definition hcube.cc:87 │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementImp::VertexIterator │ │ │ │ │ -Codim< dimension >::SubEntityIterator VertexIterator │ │ │ │ │ -Definition hcube.cc:84 │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementImp::CoordVector │ │ │ │ │ -FieldVector< CoordType, dimension > CoordVector │ │ │ │ │ -Definition hcube.cc:85 │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementImp::nElements │ │ │ │ │ -static unsigned nElements(unsigned nIntervals) │ │ │ │ │ -Definition hcube.cc:134 │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementImp::Refinement │ │ │ │ │ -RefinementImp< dimension, CoordType > Refinement │ │ │ │ │ -Definition hcube.cc:80 │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementImp::eBegin │ │ │ │ │ -static ElementIterator eBegin(unsigned nIntervals) │ │ │ │ │ -Definition hcube.cc:145 │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementImp::dimension │ │ │ │ │ -static constexpr int dimension │ │ │ │ │ -Know your own dimension. │ │ │ │ │ -Definition hcube.cc:78 │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementImp::vBegin │ │ │ │ │ -static VertexIterator vBegin(unsigned nIntervals) │ │ │ │ │ -Definition hcube.cc:118 │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementImp::Codim │ │ │ │ │ -Definition hcube.cc:101 │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementImp::Codim::Geometry │ │ │ │ │ -Dune::AxisAlignedCubeGeometry< CoordType, dimension-codimension, dimension > │ │ │ │ │ -Geometry │ │ │ │ │ -Definition hcube.cc:103 │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial │ │ │ │ │ -SubEntityIterator base class for hypercube refinement. │ │ │ │ │ -Definition hcube.cc:175 │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_dimension_>::CoordVector │ │ │ │ │ -Refinement::CoordVector CoordVector │ │ │ │ │ -Definition hcube.cc:189 │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_dimension_>::Common │ │ │ │ │ -Refinement::template Codim< dimension >::SubEntityIterator Common │ │ │ │ │ -Definition hcube.cc:188 │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_dimension_>::Refinement │ │ │ │ │ -RefinementImp< dimension, CoordType > Refinement │ │ │ │ │ -Definition hcube.cc:187 │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_0_>::Refinement │ │ │ │ │ -RefinementImp< dimension, CoordType > Refinement │ │ │ │ │ -Definition hcube.cc:220 │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_0_>::Common │ │ │ │ │ -Refinement::template Codim< 0 >::SubEntityIterator Common │ │ │ │ │ -Definition hcube.cc:221 │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_0_>::CoordVector │ │ │ │ │ -Refinement::CoordVector CoordVector │ │ │ │ │ -Definition hcube.cc:223 │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_0_>::IndexVector │ │ │ │ │ -Refinement::IndexVector IndexVector │ │ │ │ │ -Definition hcube.cc:222 │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementImp::Codim<_codimension_>:: │ │ │ │ │ -SubEntityIterator │ │ │ │ │ -SubEntityIterator(unsigned int index, unsigned int nIntervals) │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementImp::Codim<_codimension_>::equals │ │ │ │ │ -bool equals(const This &other) const │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementImp::Codim<_codimension_>::geometry │ │ │ │ │ -Geometry geometry() const │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementImp::Codim<_codimension_>::Refinement │ │ │ │ │ -RefinementImp< dimension, CoordType > Refinement │ │ │ │ │ -Definition hcube.cc:282 │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementImp::Codim<_codimension_>::index │ │ │ │ │ -int index() const │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementImp::Codim<_codimension_>::increment │ │ │ │ │ -void increment() │ │ │ │ │ -Dune::RefinementImp::HCube::RefinementImp::Codim<_codimension_>::This │ │ │ │ │ -Refinement::template Codim< codimension >::SubEntityIterator This │ │ │ │ │ -Definition hcube.cc:283 │ │ │ │ │ +Dune::geometryTypeFromVertexCount │ │ │ │ │ +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 │ │ │ │ │ +Dune::GeometryType │ │ │ │ │ +Unique label for each type of entities that can occur in DUNE grids. │ │ │ │ │ +Definition type.hh:126 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00209.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: hcubetriangulation.cc File Reference │ │ │ │ +dune-geometry: topologyfactory.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,82 +65,49 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Macros
│ │ │ │ -
hcubetriangulation.cc File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
topologyfactory.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ - │ │ │ │ -

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

│ │ │ │ -
#include <dune/geometry/referenceelements.hh>
│ │ │ │ -#include <dune/geometry/type.hh>
│ │ │ │ -#include "base.cc"
│ │ │ │ -#include "simplex.cc"
│ │ │ │ +
#include <cassert>
│ │ │ │ +#include <array>
│ │ │ │ +#include <map>
│ │ │ │ +#include <memory>
│ │ │ │ +#include <type_traits>
│ │ │ │ +#include <vector>
│ │ │ │ +#include <dune/geometry/type.hh>
│ │ │ │ +#include <dune/geometry/typeindex.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::RefinementImp::HCubeTriangulation::RefinementImp< dimension_, CoordType >
 
struct  Dune::RefinementImp::HCubeTriangulation::RefinementImp< dimension_, CoordType >::Codim< codimension >
 
class  Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial< dimension, CoordType, dimension >
struct  Dune::TopologyFactory< Traits >
 Provide a factory over the generic topologies. More...
 
class  Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial< dimension, CoordType, 0 >
 
class  Dune::RefinementImp::HCubeTriangulation::RefinementImp< dimension_, CoordType >::Codim< codimension >
struct  Dune::TopologySingletonFactory< Factory >
 A wrapper for a TopologyFactory providing singleton storage. Same usage as TopologyFactory but with empty release method an internal storage. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::RefinementImp
 This namespace contains the implementation of Refinement.
 
namespace  Dune::RefinementImp::HCubeTriangulation
 This namespace contains the Refinement implementation for triangulating hypercubes (GeometryType::cube -> GeometryType::simplex)
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -Macros

#define DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC
 
│ │ │ │ -

Detailed Description

│ │ │ │ -

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

│ │ │ │ -

See Refinement implementation for triangulating hypercubes.

│ │ │ │ -

Macro Definition Documentation

│ │ │ │ - │ │ │ │ -

◆ DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC

│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
#define DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -6,57 +6,33 @@ │ │ │ │ │ dune-geometry 2.9.0 │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ - * refinement │ │ │ │ │ -Classes | Namespaces | Macros │ │ │ │ │ -hcubetriangulation.cc File Reference │ │ │ │ │ -This file contains the Refinement implementation for triangulating hypercubes │ │ │ │ │ -(quadrilateral -> triangle, hexahedron -> tetrahedron) More... │ │ │ │ │ -#include │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +topologyfactory.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ -#include "base.cc" │ │ │ │ │ -#include "simplex.cc" │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ - class  Dune::RefinementImp::HCubeTriangulation::RefinementImp<_dimension_, │ │ │ │ │ - CoordType_> │ │ │ │ │ +struct  Dune::TopologyFactory<_Traits_> │ │ │ │ │ +  Provide a factory over the generic topologies. More... │ │ │ │ │   │ │ │ │ │ -struct  Dune::RefinementImp::HCubeTriangulation::RefinementImp<_dimension_, │ │ │ │ │ - CoordType_>::Codim<_codimension_> │ │ │ │ │ -  │ │ │ │ │ - class  Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial< │ │ │ │ │ - dimension,_CoordType,_dimension_> │ │ │ │ │ -  │ │ │ │ │ - class  Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial< │ │ │ │ │ - dimension,_CoordType,_0_> │ │ │ │ │ -  │ │ │ │ │ - class  Dune::RefinementImp::HCubeTriangulation::RefinementImp<_dimension_, │ │ │ │ │ - CoordType_>::Codim<_codimension_> │ │ │ │ │ +struct  Dune::TopologySingletonFactory<_Factory_> │ │ │ │ │ + A wrapper for a TopologyFactory providing singleton storage. Same │ │ │ │ │ +  usage as TopologyFactory but with empty release method an internal │ │ │ │ │ + storage. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ -namespace  Dune::RefinementImp │ │ │ │ │ -  This namespace contains the implementation of Refinement. │ │ │ │ │ -  │ │ │ │ │ -namespace  Dune::RefinementImp::HCubeTriangulation │ │ │ │ │ - This namespace contains the Refinement implementation for │ │ │ │ │ -  triangulating hypercubes (GeometryType::cube -> GeometryType:: │ │ │ │ │ - simplex) │ │ │ │ │ -  │ │ │ │ │ - Macros │ │ │ │ │ -#define DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC │ │ │ │ │ -  │ │ │ │ │ -***** Detailed Description ***** │ │ │ │ │ -This file contains the Refinement implementation for triangulating hypercubes │ │ │ │ │ -(quadrilateral -> triangle, hexahedron -> tetrahedron) │ │ │ │ │ -See Refinement_implementation_for_triangulating_hypercubes. │ │ │ │ │ -***** Macro Definition Documentation ***** │ │ │ │ │ -***** ◆ DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC ***** │ │ │ │ │ -#define DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00209_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: hcubetriangulation.cc Source File │ │ │ │ +dune-geometry: topologyfactory.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,508 +70,198 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
hcubetriangulation.cc
│ │ │ │ +
topologyfactory.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
│ │ │ │ -
5#ifndef DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC
│ │ │ │ -
6#define DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC
│ │ │ │ +
5#ifndef DUNE_GEOMETRY_TOPOLOGYFACTORY_HH
│ │ │ │ +
6#define DUNE_GEOMETRY_TOPOLOGYFACTORY_HH
│ │ │ │
7
│ │ │ │ - │ │ │ │ -
30#include <dune/geometry/type.hh>
│ │ │ │ -
31
│ │ │ │ -
32#include "base.cc"
│ │ │ │ -
33#include "simplex.cc"
│ │ │ │ -
34
│ │ │ │ -
35namespace Dune
│ │ │ │ -
36{
│ │ │ │ -
37 namespace RefinementImp
│ │ │ │ -
38 {
│ │ │ │ -
│ │ │ │ -
46 namespace HCubeTriangulation {
│ │ │ │ -
47
│ │ │ │ -
48 // ////////////
│ │ │ │ -
49 //
│ │ │ │ -
50 // Utilities
│ │ │ │ -
51 //
│ │ │ │ -
52
│ │ │ │ - │ │ │ │ - │ │ │ │ -
55
│ │ │ │ -
56 // ////////////////////////////////////
│ │ │ │ -
57 //
│ │ │ │ -
58 // Refine a hypercube with simplices
│ │ │ │ -
59 //
│ │ │ │ -
60
│ │ │ │ -
61 // forward declaration of the iterator base
│ │ │ │ -
62 template<int dimension, class CoordType, int codimension>
│ │ │ │ - │ │ │ │ -
64
│ │ │ │ -
65 template<int dimension_, class CoordType>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
67 {
│ │ │ │ -
68 public:
│ │ │ │ -
69 constexpr static int dimension = dimension_;
│ │ │ │ -
70
│ │ │ │ -
71 typedef CoordType ctype;
│ │ │ │ -
72
│ │ │ │ -
73 template<int codimension>
│ │ │ │ -
74 struct Codim;
│ │ │ │ - │ │ │ │ -
76 typedef FieldVector<CoordType, dimension> CoordVector;
│ │ │ │ - │ │ │ │ -
78 typedef FieldVector<int, dimension+1> IndexVector;
│ │ │ │ -
79
│ │ │ │ -
80 static int nVertices(int nIntervals);
│ │ │ │ -
81 static VertexIterator vBegin(int nIntervals);
│ │ │ │ -
82 static VertexIterator vEnd(int nIntervals);
│ │ │ │ -
83
│ │ │ │ -
84 static int nElements(int nIntervals);
│ │ │ │ -
85 static ElementIterator eBegin(int nIntervals);
│ │ │ │ -
86 static ElementIterator eEnd(int nIntervals);
│ │ │ │ -
87 private:
│ │ │ │ -
88 friend class RefinementIteratorSpecial<dimension, CoordType, 0>;
│ │ │ │ -
89 friend class RefinementIteratorSpecial<dimension, CoordType, dimension>;
│ │ │ │ -
90
│ │ │ │ - │ │ │ │ -
92 };
│ │ │ │ -
│ │ │ │ -
93
│ │ │ │ -
94 template<int dimension, class CoordType>
│ │ │ │ -
95 template<int codimension>
│ │ │ │ -
│ │ │ │ -
96 struct RefinementImp<dimension, CoordType>::Codim
│ │ │ │ -
97 {
│ │ │ │ -
98 class SubEntityIterator;
│ │ │ │ -
99 typedef Dune::MultiLinearGeometry<CoordType,dimension-codimension,dimension> Geometry;
│ │ │ │ -
100 };
│ │ │ │ -
│ │ │ │ -
101
│ │ │ │ -
102 template<int dimension, class CoordType>
│ │ │ │ -
103 int
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
105 nVertices(int nIntervals)
│ │ │ │ -
106 {
│ │ │ │ -
107 return BackendRefinement::nVertices(nIntervals) * factorial(int(dimension));
│ │ │ │ -
108 }
│ │ │ │ -
│ │ │ │ -
109
│ │ │ │ -
110 template<int dimension, class CoordType>
│ │ │ │ - │ │ │ │ -
│ │ │ │ - │ │ │ │ -
113 vBegin(int nIntervals)
│ │ │ │ -
114 {
│ │ │ │ -
115 return VertexIterator(nIntervals);
│ │ │ │ -
116 }
│ │ │ │ -
│ │ │ │ -
117
│ │ │ │ -
118 template<int dimension, class CoordType>
│ │ │ │ - │ │ │ │ -
│ │ │ │ - │ │ │ │ -
121 vEnd(int nIntervals)
│ │ │ │ -
122 {
│ │ │ │ -
123 return VertexIterator(nIntervals, true);
│ │ │ │ -
124 }
│ │ │ │ -
│ │ │ │ -
125
│ │ │ │ -
126 template<int dimension, class CoordType>
│ │ │ │ -
127 int
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
129 nElements(int nIntervals)
│ │ │ │ -
130 {
│ │ │ │ -
131 return BackendRefinement::nElements(nIntervals) * factorial(int(dimension));
│ │ │ │ -
132 }
│ │ │ │ -
│ │ │ │ -
133
│ │ │ │ -
134 template<int dimension, class CoordType>
│ │ │ │ - │ │ │ │ -
│ │ │ │ - │ │ │ │ -
137 eBegin(int nIntervals)
│ │ │ │ -
138 {
│ │ │ │ -
139 return ElementIterator(nIntervals);
│ │ │ │ -
140 }
│ │ │ │ -
│ │ │ │ -
141
│ │ │ │ -
142 template<int dimension, class CoordType>
│ │ │ │ - │ │ │ │ -
│ │ │ │ - │ │ │ │ -
145 eEnd(int nIntervals)
│ │ │ │ -
146 {
│ │ │ │ -
147 return ElementIterator(nIntervals, true);
│ │ │ │ -
148 }
│ │ │ │ -
│ │ │ │ -
149
│ │ │ │ -
150 // //////////////
│ │ │ │ -
151 //
│ │ │ │ -
152 // The iterator
│ │ │ │ -
153 //
│ │ │ │ -
154
│ │ │ │ -
155 // vertices
│ │ │ │ -
156 template<int dimension, class CoordType>
│ │ │ │ -
│ │ │ │ -
157 class RefinementIteratorSpecial<dimension, CoordType, dimension>
│ │ │ │ -
158 {
│ │ │ │ -
159 public:
│ │ │ │ - │ │ │ │ -
161 typedef typename Refinement::CoordVector CoordVector;
│ │ │ │ -
162 typedef typename Refinement::template Codim<dimension>::Geometry Geometry;
│ │ │ │ -
163
│ │ │ │ -
164 RefinementIteratorSpecial(int nIntervals, bool end = false);
│ │ │ │ +
8#include <cassert>
│ │ │ │ +
9
│ │ │ │ +
10#include <array>
│ │ │ │ +
11#include <map>
│ │ │ │ +
12#include <memory>
│ │ │ │ +
13#include <type_traits>
│ │ │ │ +
14#include <vector>
│ │ │ │ +
15
│ │ │ │ +
16#include <dune/geometry/type.hh>
│ │ │ │ + │ │ │ │ +
18
│ │ │ │ +
19namespace Dune
│ │ │ │ +
20{
│ │ │ │ +
21
│ │ │ │ +
40 template <class Traits>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
42 {
│ │ │ │ +
43 // extract types from Traits class
│ │ │ │ +
44 static const unsigned int dimension = Traits::dimension;
│ │ │ │ +
45 typedef typename Traits::Key Key;
│ │ │ │ +
46 typedef typename Traits::Object Object;
│ │ │ │ +
47 typedef typename Traits::Factory Factory;
│ │ │ │ +
48
│ │ │ │ +
│ │ │ │ +
50 static Object *create ( const Dune::GeometryType &gt, const Key &key )
│ │ │ │ +
51 {
│ │ │ │ +
52 return Impl::toGeometryTypeIdConstant<dimension>(gt, [&](auto id) {
│ │ │ │ +
53 return create<decltype(id)::value>(key);
│ │ │ │ +
54 });
│ │ │ │ +
55 }
│ │ │ │ +
│ │ │ │ +
57 template< GeometryType::Id geometryId >
│ │ │ │ +
│ │ │ │ +
58 static Object *create ( const Key &key )
│ │ │ │ +
59 {
│ │ │ │ +
60 return Factory::template createObject< geometryId >( key );
│ │ │ │ +
61 }
│ │ │ │ +
│ │ │ │ +
62
│ │ │ │ +
64 template< class Topology >
│ │ │ │ +
│ │ │ │ +
65 static Object *create ( const Key &key )
│ │ │ │ +
66 {
│ │ │ │ +
67 return Factory::template createObject< Topology >( key );
│ │ │ │ +
68 }
│ │ │ │ +
│ │ │ │ +
69
│ │ │ │ +
71 static void release( Object *object ) { delete object; }
│ │ │ │ +
72 };
│ │ │ │ +
│ │ │ │ +
73
│ │ │ │ +
74
│ │ │ │ +
75
│ │ │ │ +
80 template <class Factory>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
82 {
│ │ │ │ +
83 static const unsigned int dimension = Factory::dimension;
│ │ │ │ +
84 typedef typename Factory::Key Key;
│ │ │ │ +
85 typedef const typename Factory::Object Object;
│ │ │ │ +
86
│ │ │ │ +
│ │ │ │ +
88 static Object *create ( const Dune::GeometryType &gt, const Key &key )
│ │ │ │ +
89 {
│ │ │ │ +
90 assert( gt.id() < numTopologies );
│ │ │ │ +
91 return instance().getObject( gt, key );
│ │ │ │ +
92 }
│ │ │ │ +
│ │ │ │ +
94 template< GeometryType::Id geometryId >
│ │ │ │ +
│ │ │ │ +
95 static auto create ( const Key &key )
│ │ │ │ +
96 -> std::enable_if_t< static_cast<GeometryType>(geometryId).dim() == dimension, Object * >
│ │ │ │ +
97 {
│ │ │ │ +
98 return instance().template getObject< geometryId >( key );
│ │ │ │ +
99 }
│ │ │ │ +
│ │ │ │ +
100
│ │ │ │ +
102 template< class Topology >
│ │ │ │ +
│ │ │ │ +
103 static auto create ( const Key &key )
│ │ │ │ +
104 -> std::enable_if_t< Topology::dimension == dimension, Object * >
│ │ │ │ +
105 {
│ │ │ │ +
106 return instance().template getObject< Topology >( key );
│ │ │ │ +
107 }
│ │ │ │ +
│ │ │ │ +
108
│ │ │ │ +
│ │ │ │ +
110 static void release ( Object *object )
│ │ │ │ +
111 {}
│ │ │ │ +
│ │ │ │ +
112
│ │ │ │ +
113 private:
│ │ │ │ +
114 struct ObjectDeleter
│ │ │ │ +
115 {
│ │ │ │ +
116 void operator() ( Object *ptr ) const { Factory::release( ptr ); }
│ │ │ │ +
117 };
│ │ │ │ +
118
│ │ │ │ +
119 static TopologySingletonFactory &instance ()
│ │ │ │ +
120 {
│ │ │ │ +
121 static TopologySingletonFactory instance;
│ │ │ │ +
122 return instance;
│ │ │ │ +
123 }
│ │ │ │ +
124
│ │ │ │ +
125 static const unsigned int numTopologies = (1 << dimension);
│ │ │ │ +
126 typedef std::array< std::unique_ptr< Object, ObjectDeleter >, numTopologies > Array;
│ │ │ │ +
127 typedef std::map< Key, Array > Storage;
│ │ │ │ +
128
│ │ │ │ +
129 TopologySingletonFactory () = default;
│ │ │ │ +
130
│ │ │ │ +
131 std::unique_ptr< Object, ObjectDeleter > &find ( const unsigned int topologyId, const Key &key )
│ │ │ │ +
132 {
│ │ │ │ +
133 return storage_[ key ][ topologyId ];
│ │ │ │ +
134 }
│ │ │ │ +
135
│ │ │ │ +
136 Object *getObject ( const Dune::GeometryType &gt, const Key &key )
│ │ │ │ +
137 {
│ │ │ │ +
138 auto &object = find( gt.id(), key );
│ │ │ │ +
139 if( !object )
│ │ │ │ +
140 object.reset( Factory::create( gt, key ) );
│ │ │ │ +
141 return object.get();
│ │ │ │ +
142 }
│ │ │ │ +
143
│ │ │ │ +
144 template< GeometryType::Id geometryId >
│ │ │ │ +
145 Object *getObject ( const Key &key )
│ │ │ │ +
146 {
│ │ │ │ +
147 static constexpr GeometryType geometry = geometryId;
│ │ │ │ +
148 auto &object = find( geometry.id(), key );
│ │ │ │ +
149 if( !object )
│ │ │ │ +
150 object.reset( Factory::template create< geometry >( key ) );
│ │ │ │ +
151 return object.get();
│ │ │ │ +
152 }
│ │ │ │ +
153
│ │ │ │ +
154 template< class Topology >
│ │ │ │ +
155 Object *getObject ( const Key &key )
│ │ │ │ +
156 {
│ │ │ │ +
157 auto &object = find( Topology::id, key );
│ │ │ │ +
158 if( !object )
│ │ │ │ +
159 object.reset( Factory::template create< Topology >( key ) );
│ │ │ │ +
160 return object.get();
│ │ │ │ +
161 }
│ │ │ │ +
162
│ │ │ │ +
163 Storage storage_;
│ │ │ │ +
164 };
│ │ │ │ +
│ │ │ │
165
│ │ │ │ -
166 void increment();
│ │ │ │ +
166}
│ │ │ │
167
│ │ │ │ -
168 CoordVector coords() const;
│ │ │ │ -
169
│ │ │ │ -
170 Geometry geometry() const;
│ │ │ │ -
171
│ │ │ │ -
172 int index() const;
│ │ │ │ -
173 protected:
│ │ │ │ -
174 typedef typename Refinement::BackendRefinement BackendRefinement;
│ │ │ │ -
175 typedef typename BackendRefinement::template Codim<dimension>::SubEntityIterator BackendIterator;
│ │ │ │ -
176 constexpr static int nKuhnSimplices = factorial(int(dimension));
│ │ │ │ -
177
│ │ │ │ - │ │ │ │ -
179
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
183 };
│ │ │ │ -
│ │ │ │ -
184
│ │ │ │ -
185 template<int dimension, class CoordType>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
187 RefinementIteratorSpecial(int nIntervals, bool end)
│ │ │ │ -
188 : nIntervals_(nIntervals), kuhnIndex(0),
│ │ │ │ -
189 backend(BackendRefinement::vBegin(nIntervals_)),
│ │ │ │ -
190 backendEnd(BackendRefinement::vEnd(nIntervals_))
│ │ │ │ -
191 {
│ │ │ │ -
192 if (end)
│ │ │ │ -
193 kuhnIndex = nKuhnSimplices;
│ │ │ │ -
194 }
│ │ │ │ -
│ │ │ │ -
195
│ │ │ │ -
196 template<int dimension, class CoordType>
│ │ │ │ -
197 void
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ -
200 {
│ │ │ │ -
201 ++backend;
│ │ │ │ -
202 if (backend == backendEnd)
│ │ │ │ -
203 {
│ │ │ │ -
204 backend = BackendRefinement::vBegin(nIntervals_);
│ │ │ │ -
205 ++kuhnIndex;
│ │ │ │ -
206 }
│ │ │ │ -
207 }
│ │ │ │ -
│ │ │ │ -
208
│ │ │ │ -
209 template<int dimension, class CoordType>
│ │ │ │ - │ │ │ │ -
│ │ │ │ - │ │ │ │ -
212 coords() const
│ │ │ │ -
213 {
│ │ │ │ -
214 return referenceToKuhn(backend.coords(), getPermutation<dimension>(kuhnIndex));
│ │ │ │ -
215 }
│ │ │ │ -
│ │ │ │ -
216
│ │ │ │ -
217 template<int dimension, class CoordType>
│ │ │ │ - │ │ │ │ -
│ │ │ │ - │ │ │ │ -
220 {
│ │ │ │ -
221 std::vector<CoordVector> corners(1);
│ │ │ │ -
222 corners[0] = referenceToKuhn(backend.coords(), getPermutation<dimension>(kuhnIndex));
│ │ │ │ -
223 return Geometry(GeometryTypes::vertex, corners);
│ │ │ │ -
224 }
│ │ │ │ -
│ │ │ │ -
225
│ │ │ │ -
226 template<int dimension, class CoordType>
│ │ │ │ -
227 int
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
229 index() const
│ │ │ │ -
230 {
│ │ │ │ -
231 return kuhnIndex*BackendRefinement::nVertices(nIntervals_) + backend.index();
│ │ │ │ -
232 }
│ │ │ │ -
│ │ │ │ -
233
│ │ │ │ -
234 // elements
│ │ │ │ -
235 template<int dimension, class CoordType>
│ │ │ │ -
│ │ │ │ -
236 class RefinementIteratorSpecial<dimension, CoordType, 0>
│ │ │ │ -
237 {
│ │ │ │ -
238 public:
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
242 typedef typename Refinement::template Codim<0>::Geometry Geometry;
│ │ │ │ -
243
│ │ │ │ -
244 RefinementIteratorSpecial(int nIntervals_, bool end = false);
│ │ │ │ - │ │ │ │ -
246
│ │ │ │ -
247 void increment();
│ │ │ │ -
248
│ │ │ │ -
249 IndexVector vertexIndices() const;
│ │ │ │ -
250 int index() const;
│ │ │ │ -
251 CoordVector coords() const;
│ │ │ │ -
252
│ │ │ │ -
253 Geometry geometry() const;
│ │ │ │ -
254
│ │ │ │ -
255 private:
│ │ │ │ -
256 CoordVector global(const CoordVector &local) const;
│ │ │ │ -
257
│ │ │ │ -
258 protected:
│ │ │ │ - │ │ │ │ -
260 typedef typename BackendRefinement::template Codim<0>::SubEntityIterator BackendIterator;
│ │ │ │ -
261 constexpr static int nKuhnSimplices = factorial(dimension);
│ │ │ │ -
262
│ │ │ │ - │ │ │ │ -
264
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
268 };
│ │ │ │ -
│ │ │ │ -
269
│ │ │ │ -
270 template<int dimension, class CoordType>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
272 RefinementIteratorSpecial(int nIntervals, bool end)
│ │ │ │ -
273 : nIntervals_(nIntervals), kuhnIndex(0),
│ │ │ │ -
274 backend(BackendRefinement::eBegin(nIntervals_)),
│ │ │ │ -
275 backendEnd(BackendRefinement::eEnd(nIntervals_))
│ │ │ │ -
276 {
│ │ │ │ -
277 if (end)
│ │ │ │ -
278 kuhnIndex = nKuhnSimplices;
│ │ │ │ -
279 }
│ │ │ │ -
│ │ │ │ -
280 template<int dimension, class CoordType>
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ -
283 : nIntervals_(other.nIntervals_), kuhnIndex(other.kuhnIndex),
│ │ │ │ -
284 backend(other.backend),
│ │ │ │ -
285 backendEnd(other.backendEnd)
│ │ │ │ -
286 {}
│ │ │ │ -
│ │ │ │ -
287
│ │ │ │ -
288 template<int dimension, class CoordType>
│ │ │ │ -
289 void
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ -
292 {
│ │ │ │ -
293 ++backend;
│ │ │ │ -
294 if (backend == backendEnd)
│ │ │ │ -
295 {
│ │ │ │ -
296 backend = BackendRefinement::eBegin(nIntervals_);
│ │ │ │ -
297 ++kuhnIndex;
│ │ │ │ -
298 }
│ │ │ │ -
299 }
│ │ │ │ -
│ │ │ │ -
300
│ │ │ │ -
301 template<int dimension, class CoordType>
│ │ │ │ - │ │ │ │ -
│ │ │ │ - │ │ │ │ -
304 vertexIndices() const
│ │ │ │ -
305 {
│ │ │ │ -
306 IndexVector indices = backend.vertexIndices();
│ │ │ │ -
307
│ │ │ │ -
308 int base = kuhnIndex * BackendRefinement::nVertices(nIntervals_);
│ │ │ │ -
309 indices += base;
│ │ │ │ -
310
│ │ │ │ -
311 return indices;
│ │ │ │ -
312 }
│ │ │ │ -
│ │ │ │ -
313
│ │ │ │ -
314 template<int dimension, class CoordType>
│ │ │ │ -
315 int
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
317 index() const
│ │ │ │ -
318 {
│ │ │ │ -
319 return kuhnIndex*BackendRefinement::nElements(nIntervals_) + backend.index();
│ │ │ │ -
320 }
│ │ │ │ -
│ │ │ │ -
321
│ │ │ │ -
322 template<int dimension, class CoordType>
│ │ │ │ - │ │ │ │ -
│ │ │ │ - │ │ │ │ -
325 coords() const
│ │ │ │ -
326 {
│ │ │ │ -
327 return global(backend.coords());
│ │ │ │ -
328 }
│ │ │ │ -
│ │ │ │ -
329
│ │ │ │ -
330 template<int dimension, class CoordType>
│ │ │ │ - │ │ │ │ -
│ │ │ │ - │ │ │ │ -
333 {
│ │ │ │ -
334 const typename BackendIterator::Geometry &bgeo =
│ │ │ │ -
335 backend.geometry();
│ │ │ │ -
336 std::vector<CoordVector> corners(dimension+1);
│ │ │ │ -
337 for(int i = 0; i <= dimension; ++i)
│ │ │ │ -
338 corners[i] = global(bgeo.corner(i));
│ │ │ │ -
339
│ │ │ │ -
340 return Geometry(bgeo.type(), corners);
│ │ │ │ -
341 }
│ │ │ │ -
│ │ │ │ -
342
│ │ │ │ -
343 template<int dimension, class CoordType>
│ │ │ │ - │ │ │ │ - │ │ │ │ -
346 global(const CoordVector &local) const
│ │ │ │ -
347 {
│ │ │ │ -
348 return referenceToKuhn(local, getPermutation<dimension>(kuhnIndex));
│ │ │ │ -
349 }
│ │ │ │ -
350
│ │ │ │ -
351 // common
│ │ │ │ -
352 template<int dimension, class CoordType>
│ │ │ │ -
353 template<int codimension>
│ │ │ │ -
│ │ │ │ -
354 class RefinementImp<dimension, CoordType>::Codim<codimension>::SubEntityIterator
│ │ │ │ -
355 : public ForwardIteratorFacade<typename RefinementImp<dimension, CoordType>::template Codim<codimension>::SubEntityIterator, int>,
│ │ │ │ -
356 public RefinementIteratorSpecial<dimension, CoordType, codimension>
│ │ │ │ -
357 {
│ │ │ │ -
358 public:
│ │ │ │ - │ │ │ │ -
360 typedef SubEntityIterator This;
│ │ │ │ -
361
│ │ │ │ -
362 SubEntityIterator(int nIntervals, bool end = false);
│ │ │ │ -
363
│ │ │ │ -
364 bool equals(const This &other) const;
│ │ │ │ -
365 protected:
│ │ │ │ -
366 using RefinementIteratorSpecial<dimension, CoordType, codimension>::kuhnIndex;
│ │ │ │ -
367 using RefinementIteratorSpecial<dimension, CoordType, codimension>::backend;
│ │ │ │ -
368 };
│ │ │ │ -
│ │ │ │ -
369
│ │ │ │ -
370#ifndef DOXYGEN
│ │ │ │ -
371 template<int dimension, class CoordType>
│ │ │ │ -
372 template<int codimension>
│ │ │ │ - │ │ │ │ -
374 SubEntityIterator(int nIntervals, bool end)
│ │ │ │ -
375 : RefinementIteratorSpecial<dimension, CoordType, codimension>(nIntervals, end)
│ │ │ │ -
376 {}
│ │ │ │ -
377
│ │ │ │ -
378 template<int dimension, class CoordType>
│ │ │ │ -
379 template<int codimension>
│ │ │ │ -
380 bool
│ │ │ │ - │ │ │ │ -
382 equals(const This &other) const
│ │ │ │ -
383 { return kuhnIndex == other.kuhnIndex && backend == other.backend; }
│ │ │ │ -
384
│ │ │ │ -
385#endif // DOXYGEN
│ │ │ │ -
386
│ │ │ │ -
387 } // namespace HCubeTriangulation
│ │ │ │ -
│ │ │ │ -
388 } // namespace RefinementImp
│ │ │ │ -
389
│ │ │ │ -
390 namespace RefinementImp
│ │ │ │ -
391 {
│ │ │ │ -
392 // ///////////////////////
│ │ │ │ -
393 //
│ │ │ │ -
394 // The refinement traits
│ │ │ │ -
395 //
│ │ │ │ -
396
│ │ │ │ -
397#ifndef DOXYGEN
│ │ │ │ -
398 template<unsigned topologyId, class CoordType, unsigned coerceToId,
│ │ │ │ -
399 int dim>
│ │ │ │ -
400 struct Traits<
│ │ │ │ -
401 topologyId, CoordType, coerceToId, dim,
│ │ │ │ -
402 typename std::enable_if<
│ │ │ │ -
403 (dim >= 2 &&
│ │ │ │ -
404 (GeometryTypes::cube(dim).id() >> 1) ==
│ │ │ │ -
405 (topologyId >> 1) &&
│ │ │ │ -
406 (GeometryTypes::simplex(dim).id() >> 1) ==
│ │ │ │ -
407 (coerceToId >> 1)
│ │ │ │ -
408 )>::type
│ │ │ │ -
409 >
│ │ │ │ -
410 {
│ │ │ │ -
411 typedef HCubeTriangulation::RefinementImp<dim, CoordType> Imp;
│ │ │ │ -
412 };
│ │ │ │ -
413#endif
│ │ │ │ -
414
│ │ │ │ -
415 } // namespace RefinementImp
│ │ │ │ -
416} // namespace Dune
│ │ │ │ -
417
│ │ │ │ -
418#endif // DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC
│ │ │ │ - │ │ │ │ -
This file contains the Refinement implementation for simplices (triangles, tetrahedrons....
│ │ │ │ -
This file contains the parts independent of a particular Refinement implementation.
│ │ │ │ -
A unique label for each type of element that can occur in a grid.
│ │ │ │ +
168#endif // #ifndef DUNE_GEOMETRY_TOPOLOGYFACTORY_HH
│ │ │ │ +
Helper classes to provide indices for geometrytypes for use in a vector.
│ │ │ │ +
A unique label for each type of element that can occur in a grid.
│ │ │ │
Definition affinegeometry.hh:21
│ │ │ │ -
FieldVector< int, n > getPermutation(int m)
Calculate permutation from it's index.
Definition simplex.cc:336
│ │ │ │ -
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
│ │ │ │ -
Static tag representing a codimension.
Definition dimension.hh:24
│ │ │ │ -
generic geometry implementation based on corner coordinates
Definition multilineargeometry.hh:181
│ │ │ │ - │ │ │ │ - │ │ │ │ -
static VertexIterator vEnd(int nIntervals)
Definition hcubetriangulation.cc:121
│ │ │ │ -
static VertexIterator vBegin(int nIntervals)
Definition hcubetriangulation.cc:113
│ │ │ │ -
static int nElements(int nIntervals)
Definition hcubetriangulation.cc:129
│ │ │ │ -
FieldVector< CoordType, dimension > CoordVector
Definition hcubetriangulation.cc:76
│ │ │ │ -
CoordType ctype
Definition hcubetriangulation.cc:71
│ │ │ │ -
Codim< 0 >::SubEntityIterator ElementIterator
Definition hcubetriangulation.cc:77
│ │ │ │ -
FieldVector< int, dimension+1 > IndexVector
Definition hcubetriangulation.cc:78
│ │ │ │ -
static ElementIterator eBegin(int nIntervals)
Definition hcubetriangulation.cc:137
│ │ │ │ -
static ElementIterator eEnd(int nIntervals)
Definition hcubetriangulation.cc:145
│ │ │ │ -
static constexpr int dimension
Definition hcubetriangulation.cc:69
│ │ │ │ -
Codim< dimension >::SubEntityIterator VertexIterator
Definition hcubetriangulation.cc:75
│ │ │ │ -
static int nVertices(int nIntervals)
Definition hcubetriangulation.cc:105
│ │ │ │ - │ │ │ │ -
Dune::MultiLinearGeometry< CoordType, dimension-codimension, dimension > Geometry
Definition hcubetriangulation.cc:99
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
Refinement::template Codim< dimension >::Geometry Geometry
Definition hcubetriangulation.cc:162
│ │ │ │ -
BackendRefinement::template Codim< dimension >::SubEntityIterator BackendIterator
Definition hcubetriangulation.cc:175
│ │ │ │ -
Refinement::BackendRefinement BackendRefinement
Definition hcubetriangulation.cc:174
│ │ │ │ - │ │ │ │ -
RefinementImp< dimension, CoordType > Refinement
Definition hcubetriangulation.cc:160
│ │ │ │ - │ │ │ │ -
BackendRefinement::template Codim< 0 >::SubEntityIterator BackendIterator
Definition hcubetriangulation.cc:260
│ │ │ │ - │ │ │ │ -
Refinement::CoordVector CoordVector
Definition hcubetriangulation.cc:241
│ │ │ │ - │ │ │ │ - │ │ │ │ -
Refinement::BackendRefinement BackendRefinement
Definition hcubetriangulation.cc:259
│ │ │ │ - │ │ │ │ -
Refinement::IndexVector IndexVector
Definition hcubetriangulation.cc:240
│ │ │ │ -
RefinementImp< dimension, CoordType > Refinement
Definition hcubetriangulation.cc:239
│ │ │ │ -
Refinement::template Codim< 0 >::Geometry Geometry
Definition hcubetriangulation.cc:242
│ │ │ │ - │ │ │ │ - │ │ │ │ -
RefinementImp< dimension, CoordType > Refinement
Definition hcubetriangulation.cc:359
│ │ │ │ -
SubEntityIterator This
Definition hcubetriangulation.cc:360
│ │ │ │ - │ │ │ │ +
Provide a factory over the generic topologies.
Definition topologyfactory.hh:42
│ │ │ │ +
Traits::Factory Factory
Definition topologyfactory.hh:47
│ │ │ │ +
static Object * create(const Dune::GeometryType &gt, const Key &key)
dynamically create objects
Definition topologyfactory.hh:50
│ │ │ │ +
static const unsigned int dimension
Definition topologyfactory.hh:44
│ │ │ │ +
static Object * create(const Key &key)
statically create objects
Definition topologyfactory.hh:58
│ │ │ │ +
static void release(Object *object)
release the object returned by the create methods
Definition topologyfactory.hh:71
│ │ │ │ +
Traits::Key Key
Definition topologyfactory.hh:45
│ │ │ │ +
Traits::Object Object
Definition topologyfactory.hh:46
│ │ │ │ +
A wrapper for a TopologyFactory providing singleton storage. Same usage as TopologyFactory but with e...
Definition topologyfactory.hh:82
│ │ │ │ +
static auto create(const Key &key) -> std::enable_if_t< Topology::dimension==dimension, Object * >
Definition topologyfactory.hh:103
│ │ │ │ +
static Object * create(const Dune::GeometryType &gt, const Key &key)
Definition topologyfactory.hh:88
│ │ │ │ +
static void release(Object *object)
release the object returned by the create methods
Definition topologyfactory.hh:110
│ │ │ │ +
const Factory::Object Object
Definition topologyfactory.hh:85
│ │ │ │ +
Factory::Key Key
Definition topologyfactory.hh:84
│ │ │ │ +
static auto create(const Key &key) -> std::enable_if_t< static_cast< GeometryType >(geometryId).dim()==dimension, Object * >
Definition topologyfactory.hh:95
│ │ │ │ +
static const unsigned int dimension
Definition topologyfactory.hh:83
│ │ │ │ +
Unique label for each type of entities that can occur in DUNE grids.
Definition type.hh:126
│ │ │ │ +
constexpr unsigned int id() const
Return the topology id of the type.
Definition type.hh:377
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -7,590 +7,222 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ - * refinement │ │ │ │ │ -hcubetriangulation.cc │ │ │ │ │ +topologyfactory.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception │ │ │ │ │ - 5#ifndef DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC │ │ │ │ │ -6#define DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC │ │ │ │ │ + 5#ifndef DUNE_GEOMETRY_TOPOLOGYFACTORY_HH │ │ │ │ │ + 6#define DUNE_GEOMETRY_TOPOLOGYFACTORY_HH │ │ │ │ │ 7 │ │ │ │ │ - 29#include │ │ │ │ │ - 30#include │ │ │ │ │ - 31 │ │ │ │ │ - 32#include "base.cc" │ │ │ │ │ - 33#include "simplex.cc" │ │ │ │ │ - 34 │ │ │ │ │ - 35namespace Dune │ │ │ │ │ - 36{ │ │ │ │ │ - 37 namespace RefinementImp │ │ │ │ │ - 38 { │ │ │ │ │ -46 namespace HCubeTriangulation { │ │ │ │ │ - 47 │ │ │ │ │ - 48 // //////////// │ │ │ │ │ - 49 // │ │ │ │ │ - 50 // Utilities │ │ │ │ │ - 51 // │ │ │ │ │ - 52 │ │ │ │ │ - 53 using Simplex::getPermutation; │ │ │ │ │ - 54 using Simplex::referenceToKuhn; │ │ │ │ │ - 55 │ │ │ │ │ - 56 // //////////////////////////////////// │ │ │ │ │ - 57 // │ │ │ │ │ - 58 // Refine a hypercube with simplices │ │ │ │ │ - 59 // │ │ │ │ │ - 60 │ │ │ │ │ - 61 // forward declaration of the iterator base │ │ │ │ │ - 62 template │ │ │ │ │ -63 class RefinementIteratorSpecial; │ │ │ │ │ - 64 │ │ │ │ │ - 65 template │ │ │ │ │ -66 class RefinementImp │ │ │ │ │ - 67 { │ │ │ │ │ - 68 public: │ │ │ │ │ -69 constexpr static int dimension = dimension_; │ │ │ │ │ - 70 │ │ │ │ │ -71 typedef CoordType ctype; │ │ │ │ │ - 72 │ │ │ │ │ - 73 template │ │ │ │ │ - 74 struct Codim; │ │ │ │ │ -75 typedef typename Codim::SubEntityIterator VertexIterator; │ │ │ │ │ -76 typedef FieldVector CoordVector; │ │ │ │ │ -77 typedef typename Codim<0>::SubEntityIterator ElementIterator; │ │ │ │ │ -78 typedef FieldVector IndexVector; │ │ │ │ │ - 79 │ │ │ │ │ - 80 static int nVertices(int nIntervals); │ │ │ │ │ - 81 static VertexIterator vBegin(int nIntervals); │ │ │ │ │ - 82 static VertexIterator vEnd(int nIntervals); │ │ │ │ │ - 83 │ │ │ │ │ - 84 static int nElements(int nIntervals); │ │ │ │ │ - 85 static ElementIterator eBegin(int nIntervals); │ │ │ │ │ -86 static ElementIterator eEnd(int nIntervals); │ │ │ │ │ - 87 private: │ │ │ │ │ - 88 friend class RefinementIteratorSpecial; │ │ │ │ │ - 89 friend class RefinementIteratorSpecial; │ │ │ │ │ - 90 │ │ │ │ │ - 91 typedef Simplex::RefinementImp BackendRefinement; │ │ │ │ │ - 92 }; │ │ │ │ │ - 93 │ │ │ │ │ - 94 template │ │ │ │ │ - 95 template │ │ │ │ │ -96 struct RefinementImp::Codim │ │ │ │ │ + 8#include │ │ │ │ │ + 9 │ │ │ │ │ + 10#include │ │ │ │ │ + 11#include │ │ │ │ │ + 12#include │ │ │ │ │ + 13#include │ │ │ │ │ + 14#include │ │ │ │ │ + 15 │ │ │ │ │ + 16#include │ │ │ │ │ + 17#include │ │ │ │ │ + 18 │ │ │ │ │ + 19namespace Dune │ │ │ │ │ + 20{ │ │ │ │ │ + 21 │ │ │ │ │ + 40 template │ │ │ │ │ +41 struct TopologyFactory │ │ │ │ │ + 42 { │ │ │ │ │ + 43 // extract types from Traits class │ │ │ │ │ +44 static const unsigned int dimension = Traits::dimension; │ │ │ │ │ +45 typedef typename Traits::Key Key; │ │ │ │ │ +46 typedef typename Traits::Object Object; │ │ │ │ │ +47 typedef typename Traits::Factory Factory; │ │ │ │ │ + 48 │ │ │ │ │ +50 static Object *create ( const Dune::GeometryType >, const Key &key ) │ │ │ │ │ + 51 { │ │ │ │ │ + 52 return Impl::toGeometryTypeIdConstant(gt, [&](auto id) { │ │ │ │ │ + 53 return create(key); │ │ │ │ │ + 54 }); │ │ │ │ │ + 55 } │ │ │ │ │ + 57 template< GeometryType::Id geometryId > │ │ │ │ │ +58 static Object *create ( const Key &key ) │ │ │ │ │ + 59 { │ │ │ │ │ + 60 return Factory::template createObject< geometryId >( key ); │ │ │ │ │ + 61 } │ │ │ │ │ + 62 │ │ │ │ │ + 64 template< class Topology > │ │ │ │ │ +65 static Object *create ( const Key &key ) │ │ │ │ │ + 66 { │ │ │ │ │ + 67 return Factory::template createObject< Topology >( key ); │ │ │ │ │ + 68 } │ │ │ │ │ + 69 │ │ │ │ │ +71 static void release( Object *object ) { delete object; } │ │ │ │ │ + 72 }; │ │ │ │ │ + 73 │ │ │ │ │ + 74 │ │ │ │ │ + 75 │ │ │ │ │ + 80 template │ │ │ │ │ +81 struct TopologySingletonFactory │ │ │ │ │ + 82 { │ │ │ │ │ +83 static const unsigned int dimension = Factory::dimension; │ │ │ │ │ +84 typedef typename Factory::Key Key; │ │ │ │ │ +85 typedef const typename Factory::Object Object; │ │ │ │ │ + 86 │ │ │ │ │ +88 static Object *create ( const Dune::GeometryType >, const Key &key ) │ │ │ │ │ + 89 { │ │ │ │ │ + 90 assert( gt.id() < numTopologies ); │ │ │ │ │ + 91 return instance().getObject( gt, key ); │ │ │ │ │ + 92 } │ │ │ │ │ + 94 template< GeometryType::Id geometryId > │ │ │ │ │ +95 static auto create ( const Key &key ) │ │ │ │ │ + 96 -> std::enable_if_t< static_cast(geometryId).dim() == │ │ │ │ │ +dimension, Object * > │ │ │ │ │ 97 { │ │ │ │ │ - 98 class SubEntityIterator; │ │ │ │ │ -99 typedef Dune::MultiLinearGeometry │ │ │ │ │ -Geometry; │ │ │ │ │ - 100 }; │ │ │ │ │ - 101 │ │ │ │ │ - 102 template │ │ │ │ │ - 103 int │ │ │ │ │ -104 RefinementImp:: │ │ │ │ │ - 105nVertices(int nIntervals) │ │ │ │ │ - 106 { │ │ │ │ │ - 107 return BackendRefinement::nVertices(nIntervals) * factorial(int │ │ │ │ │ -(dimension)); │ │ │ │ │ - 108 } │ │ │ │ │ - 109 │ │ │ │ │ - 110 template │ │ │ │ │ - 111 typename RefinementImp::VertexIterator │ │ │ │ │ -112 RefinementImp:: │ │ │ │ │ - 113vBegin(int nIntervals) │ │ │ │ │ - 114 { │ │ │ │ │ - 115 return VertexIterator(nIntervals); │ │ │ │ │ - 116 } │ │ │ │ │ - 117 │ │ │ │ │ - 118 template │ │ │ │ │ - 119 typename RefinementImp::VertexIterator │ │ │ │ │ -120 RefinementImp:: │ │ │ │ │ - 121vEnd(int nIntervals) │ │ │ │ │ - 122 { │ │ │ │ │ - 123 return VertexIterator(nIntervals, true); │ │ │ │ │ - 124 } │ │ │ │ │ - 125 │ │ │ │ │ - 126 template │ │ │ │ │ - 127 int │ │ │ │ │ -128 RefinementImp:: │ │ │ │ │ - 129nElements(int nIntervals) │ │ │ │ │ - 130 { │ │ │ │ │ - 131 return BackendRefinement::nElements(nIntervals) * factorial(int │ │ │ │ │ -(dimension)); │ │ │ │ │ - 132 } │ │ │ │ │ - 133 │ │ │ │ │ - 134 template │ │ │ │ │ - 135 typename RefinementImp::ElementIterator │ │ │ │ │ -136 RefinementImp:: │ │ │ │ │ - 137eBegin(int nIntervals) │ │ │ │ │ - 138 { │ │ │ │ │ - 139 return ElementIterator(nIntervals); │ │ │ │ │ - 140 } │ │ │ │ │ - 141 │ │ │ │ │ - 142 template │ │ │ │ │ - 143 typename RefinementImp::ElementIterator │ │ │ │ │ -144 RefinementImp:: │ │ │ │ │ - 145eEnd(int nIntervals) │ │ │ │ │ + 98 return instance().template getObject< geometryId >( key ); │ │ │ │ │ + 99 } │ │ │ │ │ + 100 │ │ │ │ │ + 102 template< class Topology > │ │ │ │ │ +103 static auto create ( const Key &key ) │ │ │ │ │ + 104 -> std::enable_if_t< Topology::dimension == dimension, Object * > │ │ │ │ │ + 105 { │ │ │ │ │ + 106 return instance().template getObject< Topology >( key ); │ │ │ │ │ + 107 } │ │ │ │ │ + 108 │ │ │ │ │ +110 static void release ( Object *object ) │ │ │ │ │ + 111 {} │ │ │ │ │ + 112 │ │ │ │ │ + 113 private: │ │ │ │ │ + 114 struct ObjectDeleter │ │ │ │ │ + 115 { │ │ │ │ │ + 116 void operator() ( Object *ptr ) const { Factory::release( ptr ); } │ │ │ │ │ + 117 }; │ │ │ │ │ + 118 │ │ │ │ │ + 119 static TopologySingletonFactory &instance () │ │ │ │ │ + 120 { │ │ │ │ │ + 121 static TopologySingletonFactory instance; │ │ │ │ │ + 122 return instance; │ │ │ │ │ + 123 } │ │ │ │ │ + 124 │ │ │ │ │ + 125 static const unsigned int numTopologies = (1 << dimension); │ │ │ │ │ + 126 typedef std::array< std::unique_ptr< Object, ObjectDeleter >, │ │ │ │ │ +numTopologies > Array; │ │ │ │ │ + 127 typedef std::map< Key, Array > Storage; │ │ │ │ │ + 128 │ │ │ │ │ + 129 TopologySingletonFactory () = default; │ │ │ │ │ + 130 │ │ │ │ │ + 131 std::unique_ptr< Object, ObjectDeleter > &find ( const unsigned int │ │ │ │ │ +topologyId, const Key &key ) │ │ │ │ │ + 132 { │ │ │ │ │ + 133 return storage_[ key ][ topologyId ]; │ │ │ │ │ + 134 } │ │ │ │ │ + 135 │ │ │ │ │ + 136 Object *getObject ( const Dune::GeometryType >, const Key &key ) │ │ │ │ │ + 137 { │ │ │ │ │ + 138 auto &object = find( gt.id(), key ); │ │ │ │ │ + 139 if( !object ) │ │ │ │ │ + 140 object.reset( Factory::create( gt, key ) ); │ │ │ │ │ + 141 return object.get(); │ │ │ │ │ + 142 } │ │ │ │ │ + 143 │ │ │ │ │ + 144 template< GeometryType::Id geometryId > │ │ │ │ │ + 145 Object *getObject ( const Key &key ) │ │ │ │ │ 146 { │ │ │ │ │ - 147 return ElementIterator(nIntervals, true); │ │ │ │ │ - 148 } │ │ │ │ │ - 149 │ │ │ │ │ - 150 // ////////////// │ │ │ │ │ - 151 // │ │ │ │ │ - 152 // The iterator │ │ │ │ │ - 153 // │ │ │ │ │ - 154 │ │ │ │ │ - 155 // vertices │ │ │ │ │ - 156 template │ │ │ │ │ -157 class RefinementIteratorSpecial │ │ │ │ │ - 158 { │ │ │ │ │ - 159 public: │ │ │ │ │ -160 typedef RefinementImp Refinement; │ │ │ │ │ -161 typedef typename Refinement::CoordVector CoordVector; │ │ │ │ │ -162 typedef typename Refinement::template Codim::Geometry Geometry; │ │ │ │ │ - 163 │ │ │ │ │ - 164 RefinementIteratorSpecial(int nIntervals, bool end = false); │ │ │ │ │ + 147 static constexpr GeometryType geometry = geometryId; │ │ │ │ │ + 148 auto &object = find( geometry.id(), key ); │ │ │ │ │ + 149 if( !object ) │ │ │ │ │ + 150 object.reset( Factory::template create< geometry >( key ) ); │ │ │ │ │ + 151 return object.get(); │ │ │ │ │ + 152 } │ │ │ │ │ + 153 │ │ │ │ │ + 154 template< class Topology > │ │ │ │ │ + 155 Object *getObject ( const Key &key ) │ │ │ │ │ + 156 { │ │ │ │ │ + 157 auto &object = find( Topology::id, key ); │ │ │ │ │ + 158 if( !object ) │ │ │ │ │ + 159 object.reset( Factory::template create< Topology >( key ) ); │ │ │ │ │ + 160 return object.get(); │ │ │ │ │ + 161 } │ │ │ │ │ + 162 │ │ │ │ │ + 163 Storage storage_; │ │ │ │ │ + 164 }; │ │ │ │ │ 165 │ │ │ │ │ - 166 void increment(); │ │ │ │ │ + 166} │ │ │ │ │ 167 │ │ │ │ │ - 168 CoordVector coords() const; │ │ │ │ │ - 169 │ │ │ │ │ - 170 Geometry geometry() const; │ │ │ │ │ - 171 │ │ │ │ │ - 172 int index() const; │ │ │ │ │ - 173 protected: │ │ │ │ │ -174 typedef typename Refinement::BackendRefinement BackendRefinement; │ │ │ │ │ -175 typedef typename BackendRefinement::template Codim:: │ │ │ │ │ -SubEntityIterator BackendIterator; │ │ │ │ │ -176 constexpr static int nKuhnSimplices = factorial(int(dimension)); │ │ │ │ │ - 177 │ │ │ │ │ -178 int nIntervals_; │ │ │ │ │ - 179 │ │ │ │ │ -180 int kuhnIndex; │ │ │ │ │ -181 BackendIterator backend; │ │ │ │ │ -182 const BackendIterator backendEnd; │ │ │ │ │ - 183 }; │ │ │ │ │ - 184 │ │ │ │ │ - 185 template │ │ │ │ │ -186 RefinementIteratorSpecial:: │ │ │ │ │ - 187RefinementIteratorSpecial(int nIntervals, bool end) │ │ │ │ │ - 188 : nIntervals_(nIntervals), kuhnIndex(0), │ │ │ │ │ - 189 backend(BackendRefinement::vBegin(nIntervals_)), │ │ │ │ │ - 190 backendEnd(BackendRefinement::vEnd(nIntervals_)) │ │ │ │ │ - 191 { │ │ │ │ │ - 192 if (end) │ │ │ │ │ - 193 kuhnIndex = nKuhnSimplices; │ │ │ │ │ - 194 } │ │ │ │ │ - 195 │ │ │ │ │ - 196 template │ │ │ │ │ - 197 void │ │ │ │ │ -198 RefinementIteratorSpecial:: │ │ │ │ │ - 199increment() │ │ │ │ │ - 200 { │ │ │ │ │ - 201 ++backend; │ │ │ │ │ - 202 if (backend == backendEnd) │ │ │ │ │ - 203 { │ │ │ │ │ - 204 backend = BackendRefinement::vBegin(nIntervals_); │ │ │ │ │ - 205 ++kuhnIndex; │ │ │ │ │ - 206 } │ │ │ │ │ - 207 } │ │ │ │ │ - 208 │ │ │ │ │ - 209 template │ │ │ │ │ - 210 typename RefinementIteratorSpecial:: │ │ │ │ │ -CoordVector │ │ │ │ │ -211 RefinementIteratorSpecial:: │ │ │ │ │ - 212coords() const │ │ │ │ │ - 213 { │ │ │ │ │ - 214 return referenceToKuhn(backend.coords(), getPermutation │ │ │ │ │ -(kuhnIndex)); │ │ │ │ │ - 215 } │ │ │ │ │ - 216 │ │ │ │ │ - 217 template │ │ │ │ │ - 218 typename RefinementIteratorSpecial:: │ │ │ │ │ -Geometry │ │ │ │ │ -219 RefinementIteratorSpecial::geometry () │ │ │ │ │ -const │ │ │ │ │ - 220 { │ │ │ │ │ - 221 std::vector corners(1); │ │ │ │ │ - 222 corners[0] = referenceToKuhn(backend.coords(), getPermutation │ │ │ │ │ -(kuhnIndex)); │ │ │ │ │ - 223 return Geometry(GeometryTypes::vertex, corners); │ │ │ │ │ - 224 } │ │ │ │ │ - 225 │ │ │ │ │ - 226 template │ │ │ │ │ - 227 int │ │ │ │ │ -228 RefinementIteratorSpecial:: │ │ │ │ │ - 229index() const │ │ │ │ │ - 230 { │ │ │ │ │ - 231 return kuhnIndex*BackendRefinement::nVertices(nIntervals_) + backend.index │ │ │ │ │ -(); │ │ │ │ │ - 232 } │ │ │ │ │ - 233 │ │ │ │ │ - 234 // elements │ │ │ │ │ - 235 template │ │ │ │ │ -236 class RefinementIteratorSpecial │ │ │ │ │ - 237 { │ │ │ │ │ - 238 public: │ │ │ │ │ -239 typedef RefinementImp Refinement; │ │ │ │ │ -240 typedef typename Refinement::IndexVector IndexVector; │ │ │ │ │ -241 typedef typename Refinement::CoordVector CoordVector; │ │ │ │ │ -242 typedef typename Refinement::template Codim<0>::Geometry Geometry; │ │ │ │ │ - 243 │ │ │ │ │ - 244 RefinementIteratorSpecial(int nIntervals_, bool end = false); │ │ │ │ │ - 245 RefinementIteratorSpecial(const RefinementIteratorSpecial &other); │ │ │ │ │ - 246 │ │ │ │ │ - 247 void increment(); │ │ │ │ │ - 248 │ │ │ │ │ - 249 IndexVector vertexIndices() const; │ │ │ │ │ - 250 int index() const; │ │ │ │ │ - 251 CoordVector coords() const; │ │ │ │ │ - 252 │ │ │ │ │ - 253 Geometry geometry() const; │ │ │ │ │ - 254 │ │ │ │ │ - 255 private: │ │ │ │ │ - 256 CoordVector global(const CoordVector &local) const; │ │ │ │ │ - 257 │ │ │ │ │ - 258 protected: │ │ │ │ │ -259 typedef typename Refinement::BackendRefinement BackendRefinement; │ │ │ │ │ -260 typedef typename BackendRefinement::template Codim<0>::SubEntityIterator │ │ │ │ │ -BackendIterator; │ │ │ │ │ -261 constexpr static int nKuhnSimplices = factorial(dimension); │ │ │ │ │ - 262 │ │ │ │ │ -263 int nIntervals_; │ │ │ │ │ - 264 │ │ │ │ │ -265 int kuhnIndex; │ │ │ │ │ -266 BackendIterator backend; │ │ │ │ │ -267 const BackendIterator backendEnd; │ │ │ │ │ - 268 }; │ │ │ │ │ - 269 │ │ │ │ │ - 270 template │ │ │ │ │ -271 RefinementIteratorSpecial:: │ │ │ │ │ - 272RefinementIteratorSpecial(int nIntervals, bool end) │ │ │ │ │ - 273 : nIntervals_(nIntervals), kuhnIndex(0), │ │ │ │ │ - 274 backend(BackendRefinement::eBegin(nIntervals_)), │ │ │ │ │ - 275 backendEnd(BackendRefinement::eEnd(nIntervals_)) │ │ │ │ │ - 276 { │ │ │ │ │ - 277 if (end) │ │ │ │ │ - 278 kuhnIndex = nKuhnSimplices; │ │ │ │ │ - 279 } │ │ │ │ │ - 280 template │ │ │ │ │ -281 RefinementIteratorSpecial:: │ │ │ │ │ - 282RefinementIteratorSpecial(const RefinementIteratorSpecial &other) │ │ │ │ │ - 283 : nIntervals_(other.nIntervals_), kuhnIndex(other.kuhnIndex), │ │ │ │ │ - 284 backend(other.backend), │ │ │ │ │ - 285 backendEnd(other.backendEnd) │ │ │ │ │ - 286 {} │ │ │ │ │ - 287 │ │ │ │ │ - 288 template │ │ │ │ │ - 289 void │ │ │ │ │ -290 RefinementIteratorSpecial:: │ │ │ │ │ - 291increment() │ │ │ │ │ - 292 { │ │ │ │ │ - 293 ++backend; │ │ │ │ │ - 294 if (backend == backendEnd) │ │ │ │ │ - 295 { │ │ │ │ │ - 296 backend = BackendRefinement::eBegin(nIntervals_); │ │ │ │ │ - 297 ++kuhnIndex; │ │ │ │ │ - 298 } │ │ │ │ │ - 299 } │ │ │ │ │ - 300 │ │ │ │ │ - 301 template │ │ │ │ │ - 302 typename RefinementIteratorSpecial::IndexVector │ │ │ │ │ -303 RefinementIteratorSpecial:: │ │ │ │ │ - 304vertexIndices() const │ │ │ │ │ - 305 { │ │ │ │ │ - 306 IndexVector indices = backend.vertexIndices(); │ │ │ │ │ - 307 │ │ │ │ │ - 308 int base = kuhnIndex * BackendRefinement::nVertices(nIntervals_); │ │ │ │ │ - 309 indices += base; │ │ │ │ │ - 310 │ │ │ │ │ - 311 return indices; │ │ │ │ │ - 312 } │ │ │ │ │ - 313 │ │ │ │ │ - 314 template │ │ │ │ │ - 315 int │ │ │ │ │ -316 RefinementIteratorSpecial:: │ │ │ │ │ - 317index() const │ │ │ │ │ - 318 { │ │ │ │ │ - 319 return kuhnIndex*BackendRefinement::nElements(nIntervals_) + backend.index │ │ │ │ │ -(); │ │ │ │ │ - 320 } │ │ │ │ │ - 321 │ │ │ │ │ - 322 template │ │ │ │ │ - 323 typename RefinementIteratorSpecial::CoordVector │ │ │ │ │ -324 RefinementIteratorSpecial:: │ │ │ │ │ - 325coords() const │ │ │ │ │ - 326 { │ │ │ │ │ - 327 return global(backend.coords()); │ │ │ │ │ - 328 } │ │ │ │ │ - 329 │ │ │ │ │ - 330 template │ │ │ │ │ - 331 typename RefinementIteratorSpecial::Geometry │ │ │ │ │ -332 RefinementIteratorSpecial::geometry () const │ │ │ │ │ - 333 { │ │ │ │ │ - 334 const typename BackendIterator::Geometry &bgeo = │ │ │ │ │ - 335 backend.geometry(); │ │ │ │ │ - 336 std::vector corners(dimension+1); │ │ │ │ │ - 337 for(int i = 0; i <= dimension; ++i) │ │ │ │ │ - 338 corners[i] = global(bgeo.corner(i)); │ │ │ │ │ - 339 │ │ │ │ │ - 340 return Geometry(bgeo.type(), corners); │ │ │ │ │ - 341 } │ │ │ │ │ - 342 │ │ │ │ │ - 343 template │ │ │ │ │ - 344 typename RefinementIteratorSpecial::CoordVector │ │ │ │ │ - 345 RefinementIteratorSpecial:: │ │ │ │ │ - 346global(const CoordVector &local) const │ │ │ │ │ - 347 { │ │ │ │ │ - 348 return referenceToKuhn(local, getPermutation(kuhnIndex)); │ │ │ │ │ - 349 } │ │ │ │ │ - 350 │ │ │ │ │ - 351 // common │ │ │ │ │ - 352 template │ │ │ │ │ - 353 template │ │ │ │ │ -354 class RefinementImp::Codim:: │ │ │ │ │ -SubEntityIterator │ │ │ │ │ - 355 : public ForwardIteratorFacade::template Codim::SubEntityIterator, int>, │ │ │ │ │ - 356 public RefinementIteratorSpecial │ │ │ │ │ - 357 { │ │ │ │ │ - 358 public: │ │ │ │ │ -359 typedef RefinementImp Refinement; │ │ │ │ │ -360 typedef SubEntityIterator This; │ │ │ │ │ - 361 │ │ │ │ │ -362 SubEntityIterator(int nIntervals, bool end = false); │ │ │ │ │ - 363 │ │ │ │ │ -364 bool equals(const This &other) const; │ │ │ │ │ - 365 protected: │ │ │ │ │ - 366 using RefinementIteratorSpecial:: │ │ │ │ │ -kuhnIndex; │ │ │ │ │ - 367 using RefinementIteratorSpecial:: │ │ │ │ │ -backend; │ │ │ │ │ - 368 }; │ │ │ │ │ - 369 │ │ │ │ │ - 370#ifndef DOXYGEN │ │ │ │ │ - 371 template │ │ │ │ │ - 372 template │ │ │ │ │ - 373 RefinementImp::Codim:: │ │ │ │ │ -SubEntityIterator:: │ │ │ │ │ - 374SubEntityIterator(int nIntervals, bool end) │ │ │ │ │ - 375 : RefinementIteratorSpecial(nIntervals, │ │ │ │ │ -end) │ │ │ │ │ - 376 {} │ │ │ │ │ - 377 │ │ │ │ │ - 378 template │ │ │ │ │ - 379 template │ │ │ │ │ - 380 bool │ │ │ │ │ - 381 RefinementImp::Codim:: │ │ │ │ │ -SubEntityIterator:: │ │ │ │ │ - 382equals(const This &other) const │ │ │ │ │ - 383 { return kuhnIndex == other.kuhnIndex && backend == other.backend; } │ │ │ │ │ - 384 │ │ │ │ │ - 385#endif // DOXYGEN │ │ │ │ │ - 386 │ │ │ │ │ - 387 } // namespace HCubeTriangulation │ │ │ │ │ - 388 } // namespace RefinementImp │ │ │ │ │ - 389 │ │ │ │ │ - 390 namespace RefinementImp │ │ │ │ │ - 391 { │ │ │ │ │ - 392 // /////////////////////// │ │ │ │ │ - 393 // │ │ │ │ │ - 394 // The refinement traits │ │ │ │ │ - 395 // │ │ │ │ │ - 396 │ │ │ │ │ - 397#ifndef DOXYGEN │ │ │ │ │ - 398 template │ │ │ │ │ - 400 struct Traits< │ │ │ │ │ - 401 topologyId, CoordType, coerceToId, dim, │ │ │ │ │ - 402 typename std::enable_if< │ │ │ │ │ - 403 (dim >= 2 && │ │ │ │ │ - 404 (GeometryTypes::cube(dim).id() >> 1) == │ │ │ │ │ - 405 (topologyId >> 1) && │ │ │ │ │ - 406 (GeometryTypes::simplex(dim).id() >> 1) == │ │ │ │ │ - 407 (coerceToId >> 1) │ │ │ │ │ - 408 )>::type │ │ │ │ │ - 409 > │ │ │ │ │ - 410 { │ │ │ │ │ - 411 typedef HCubeTriangulation::RefinementImp Imp; │ │ │ │ │ - 412 }; │ │ │ │ │ - 413#endif │ │ │ │ │ - 414 │ │ │ │ │ - 415 } // namespace RefinementImp │ │ │ │ │ - 416} // namespace Dune │ │ │ │ │ - 417 │ │ │ │ │ - 418#endif // DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC │ │ │ │ │ -referenceelements.hh │ │ │ │ │ -simplex.cc │ │ │ │ │ -This file contains the Refinement implementation for simplices (triangles, │ │ │ │ │ -tetrahedrons.... │ │ │ │ │ -base.cc │ │ │ │ │ -This file contains the parts independent of a particular Refinement │ │ │ │ │ -implementation. │ │ │ │ │ + 168#endif // #ifndef DUNE_GEOMETRY_TOPOLOGYFACTORY_HH │ │ │ │ │ +typeindex.hh │ │ │ │ │ +Helper classes to provide indices for geometrytypes for use in a vector. │ │ │ │ │ type.hh │ │ │ │ │ A unique label for each type of element that can occur in a grid. │ │ │ │ │ Dune │ │ │ │ │ Definition affinegeometry.hh:21 │ │ │ │ │ -Dune::RefinementImp::Simplex::getPermutation │ │ │ │ │ -FieldVector< int, n > getPermutation(int m) │ │ │ │ │ -Calculate permutation from it's index. │ │ │ │ │ -Definition simplex.cc:336 │ │ │ │ │ -Dune::RefinementImp::Simplex::referenceToKuhn │ │ │ │ │ -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 │ │ │ │ │ -Dune::Codim │ │ │ │ │ -Static tag representing a codimension. │ │ │ │ │ -Definition dimension.hh:24 │ │ │ │ │ -Dune::MultiLinearGeometry │ │ │ │ │ -generic geometry implementation based on corner coordinates │ │ │ │ │ -Definition multilineargeometry.hh:181 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial │ │ │ │ │ -Definition hcubetriangulation.cc:63 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementImp │ │ │ │ │ -Definition hcubetriangulation.cc:67 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementImp::vEnd │ │ │ │ │ -static VertexIterator vEnd(int nIntervals) │ │ │ │ │ -Definition hcubetriangulation.cc:121 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementImp::vBegin │ │ │ │ │ -static VertexIterator vBegin(int nIntervals) │ │ │ │ │ -Definition hcubetriangulation.cc:113 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementImp::nElements │ │ │ │ │ -static int nElements(int nIntervals) │ │ │ │ │ -Definition hcubetriangulation.cc:129 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementImp::CoordVector │ │ │ │ │ -FieldVector< CoordType, dimension > CoordVector │ │ │ │ │ -Definition hcubetriangulation.cc:76 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementImp::ctype │ │ │ │ │ -CoordType ctype │ │ │ │ │ -Definition hcubetriangulation.cc:71 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementImp::ElementIterator │ │ │ │ │ -Codim< 0 >::SubEntityIterator ElementIterator │ │ │ │ │ -Definition hcubetriangulation.cc:77 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementImp::IndexVector │ │ │ │ │ -FieldVector< int, dimension+1 > IndexVector │ │ │ │ │ -Definition hcubetriangulation.cc:78 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementImp::eBegin │ │ │ │ │ -static ElementIterator eBegin(int nIntervals) │ │ │ │ │ -Definition hcubetriangulation.cc:137 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementImp::eEnd │ │ │ │ │ -static ElementIterator eEnd(int nIntervals) │ │ │ │ │ -Definition hcubetriangulation.cc:145 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementImp::dimension │ │ │ │ │ -static constexpr int dimension │ │ │ │ │ -Definition hcubetriangulation.cc:69 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementImp::VertexIterator │ │ │ │ │ -Codim< dimension >::SubEntityIterator VertexIterator │ │ │ │ │ -Definition hcubetriangulation.cc:75 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementImp::nVertices │ │ │ │ │ -static int nVertices(int nIntervals) │ │ │ │ │ -Definition hcubetriangulation.cc:105 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementImp::Codim │ │ │ │ │ -Definition hcubetriangulation.cc:97 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementImp::Codim::Geometry │ │ │ │ │ -Dune::MultiLinearGeometry< CoordType, dimension-codimension, dimension > │ │ │ │ │ -Geometry │ │ │ │ │ -Definition hcubetriangulation.cc:99 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_dimension_>::nIntervals_ │ │ │ │ │ -int nIntervals_ │ │ │ │ │ -Definition hcubetriangulation.cc:178 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_dimension_>::kuhnIndex │ │ │ │ │ -int kuhnIndex │ │ │ │ │ -Definition hcubetriangulation.cc:180 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_dimension_>::CoordVector │ │ │ │ │ -Refinement::CoordVector CoordVector │ │ │ │ │ -Definition hcubetriangulation.cc:161 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_dimension_>::Geometry │ │ │ │ │ -Refinement::template Codim< dimension >::Geometry Geometry │ │ │ │ │ -Definition hcubetriangulation.cc:162 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_dimension_>::BackendIterator │ │ │ │ │ -BackendRefinement::template Codim< dimension >::SubEntityIterator │ │ │ │ │ -BackendIterator │ │ │ │ │ -Definition hcubetriangulation.cc:175 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_dimension_>::BackendRefinement │ │ │ │ │ -Refinement::BackendRefinement BackendRefinement │ │ │ │ │ -Definition hcubetriangulation.cc:174 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_dimension_>::backend │ │ │ │ │ -BackendIterator backend │ │ │ │ │ -Definition hcubetriangulation.cc:181 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_dimension_>::Refinement │ │ │ │ │ -RefinementImp< dimension, CoordType > Refinement │ │ │ │ │ -Definition hcubetriangulation.cc:160 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_dimension_>::backendEnd │ │ │ │ │ -const BackendIterator backendEnd │ │ │ │ │ -Definition hcubetriangulation.cc:182 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_0_>::BackendIterator │ │ │ │ │ -BackendRefinement::template Codim< 0 >::SubEntityIterator BackendIterator │ │ │ │ │ -Definition hcubetriangulation.cc:260 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_0_>::backend │ │ │ │ │ -BackendIterator backend │ │ │ │ │ -Definition hcubetriangulation.cc:266 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_0_>::CoordVector │ │ │ │ │ -Refinement::CoordVector CoordVector │ │ │ │ │ -Definition hcubetriangulation.cc:241 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_0_>::backendEnd │ │ │ │ │ -const BackendIterator backendEnd │ │ │ │ │ -Definition hcubetriangulation.cc:267 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_0_>::kuhnIndex │ │ │ │ │ -int kuhnIndex │ │ │ │ │ -Definition hcubetriangulation.cc:265 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_0_>::BackendRefinement │ │ │ │ │ -Refinement::BackendRefinement BackendRefinement │ │ │ │ │ -Definition hcubetriangulation.cc:259 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_0_>::nIntervals_ │ │ │ │ │ -int nIntervals_ │ │ │ │ │ -Definition hcubetriangulation.cc:263 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_0_>::IndexVector │ │ │ │ │ -Refinement::IndexVector IndexVector │ │ │ │ │ -Definition hcubetriangulation.cc:240 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_0_>::Refinement │ │ │ │ │ -RefinementImp< dimension, CoordType > Refinement │ │ │ │ │ -Definition hcubetriangulation.cc:239 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_0_>::Geometry │ │ │ │ │ -Refinement::template Codim< 0 >::Geometry Geometry │ │ │ │ │ -Definition hcubetriangulation.cc:242 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementImp::Codim<_codimension_>:: │ │ │ │ │ -equals │ │ │ │ │ -bool equals(const This &other) const │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementImp::Codim<_codimension_>:: │ │ │ │ │ -SubEntityIterator │ │ │ │ │ -SubEntityIterator(int nIntervals, bool end=false) │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementImp::Codim<_codimension_>:: │ │ │ │ │ -Refinement │ │ │ │ │ -RefinementImp< dimension, CoordType > Refinement │ │ │ │ │ -Definition hcubetriangulation.cc:359 │ │ │ │ │ -Dune::RefinementImp::HCubeTriangulation::RefinementImp::Codim<_codimension_>:: │ │ │ │ │ -This │ │ │ │ │ -SubEntityIterator This │ │ │ │ │ -Definition hcubetriangulation.cc:360 │ │ │ │ │ -Dune::RefinementImp::Simplex::RefinementImp │ │ │ │ │ -Definition simplex.cc:433 │ │ │ │ │ +Dune::TopologyFactory │ │ │ │ │ +Provide a factory over the generic topologies. │ │ │ │ │ +Definition topologyfactory.hh:42 │ │ │ │ │ +Dune::TopologyFactory::Factory │ │ │ │ │ +Traits::Factory Factory │ │ │ │ │ +Definition topologyfactory.hh:47 │ │ │ │ │ +Dune::TopologyFactory::create │ │ │ │ │ +static Object * create(const Dune::GeometryType >, const Key &key) │ │ │ │ │ +dynamically create objects │ │ │ │ │ +Definition topologyfactory.hh:50 │ │ │ │ │ +Dune::TopologyFactory::dimension │ │ │ │ │ +static const unsigned int dimension │ │ │ │ │ +Definition topologyfactory.hh:44 │ │ │ │ │ +Dune::TopologyFactory::create │ │ │ │ │ +static Object * create(const Key &key) │ │ │ │ │ +statically create objects │ │ │ │ │ +Definition topologyfactory.hh:58 │ │ │ │ │ +Dune::TopologyFactory::release │ │ │ │ │ +static void release(Object *object) │ │ │ │ │ +release the object returned by the create methods │ │ │ │ │ +Definition topologyfactory.hh:71 │ │ │ │ │ +Dune::TopologyFactory::Key │ │ │ │ │ +Traits::Key Key │ │ │ │ │ +Definition topologyfactory.hh:45 │ │ │ │ │ +Dune::TopologyFactory::Object │ │ │ │ │ +Traits::Object Object │ │ │ │ │ +Definition topologyfactory.hh:46 │ │ │ │ │ +Dune::TopologySingletonFactory │ │ │ │ │ +A wrapper for a TopologyFactory providing singleton storage. Same usage as │ │ │ │ │ +TopologyFactory but with e... │ │ │ │ │ +Definition topologyfactory.hh:82 │ │ │ │ │ +Dune::TopologySingletonFactory::create │ │ │ │ │ +static auto create(const Key &key) -> std::enable_if_t< Topology:: │ │ │ │ │ +dimension==dimension, Object * > │ │ │ │ │ +Definition topologyfactory.hh:103 │ │ │ │ │ +Dune::TopologySingletonFactory::create │ │ │ │ │ +static Object * create(const Dune::GeometryType >, const Key &key) │ │ │ │ │ +Definition topologyfactory.hh:88 │ │ │ │ │ +Dune::TopologySingletonFactory::release │ │ │ │ │ +static void release(Object *object) │ │ │ │ │ +release the object returned by the create methods │ │ │ │ │ +Definition topologyfactory.hh:110 │ │ │ │ │ +Dune::TopologySingletonFactory::Object │ │ │ │ │ +const Factory::Object Object │ │ │ │ │ +Definition topologyfactory.hh:85 │ │ │ │ │ +Dune::TopologySingletonFactory::Key │ │ │ │ │ +Factory::Key Key │ │ │ │ │ +Definition topologyfactory.hh:84 │ │ │ │ │ +Dune::TopologySingletonFactory::create │ │ │ │ │ +static auto create(const Key &key) -> std::enable_if_t< static_cast< │ │ │ │ │ +GeometryType >(geometryId).dim()==dimension, Object * > │ │ │ │ │ +Definition topologyfactory.hh:95 │ │ │ │ │ +Dune::TopologySingletonFactory::dimension │ │ │ │ │ +static const unsigned int dimension │ │ │ │ │ +Definition topologyfactory.hh:83 │ │ │ │ │ +Dune::GeometryType │ │ │ │ │ +Unique label for each type of entities that can occur in DUNE grids. │ │ │ │ │ +Definition type.hh:126 │ │ │ │ │ +Dune::GeometryType::id │ │ │ │ │ +constexpr unsigned int id() const │ │ │ │ │ +Return the topology id of the type. │ │ │ │ │ +Definition type.hh:377 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00212.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: prismtriangulation.cc File Reference │ │ │ │ +dune-geometry: axisalignedcubegeometry.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,86 +65,49 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Macros | │ │ │ │ -Functions
│ │ │ │ -
prismtriangulation.cc File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
axisalignedcubegeometry.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <dune/common/fvector.hh>
│ │ │ │ -#include <dune/common/typetraits.hh>
│ │ │ │ -#include <dune/geometry/referenceelements.hh>
│ │ │ │ -#include <dune/geometry/type.hh>
│ │ │ │ -#include "base.cc"
│ │ │ │ -#include "simplex.cc"
│ │ │ │ + │ │ │ │ +

A geometry implementation for axis-aligned hypercubes. │ │ │ │ +More...

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

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::RefinementImp::PrismTriangulation::RefinementImp< dimension_, CoordType >
 Implementation of the refinement of a prism into simplices. More...
 
struct  Dune::RefinementImp::PrismTriangulation::RefinementImp< dimension_, CoordType >::Codim< codimension >
 
class  Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial< dimension, CoordType, dimension >
 
class  Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial< dimension, CoordType, 0 >
 
class  Dune::RefinementImp::PrismTriangulation::RefinementImp< dimension_, CoordType >::Codim< codimension >
class  Dune::AxisAlignedCubeGeometry< CoordType, dim, coorddim >
 A geometry implementation for axis-aligned hypercubes. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::RefinementImp
 This namespace contains the implementation of Refinement.
 
namespace  Dune::RefinementImp::PrismTriangulation
 This namespace contains the Refinement implementation for triangulating prisms (GeometryType::prism -> GeometryType::simplex)
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Macros

#define DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -Functions

template<int dimension, class CoordType >
FieldVector< CoordType, dimension > Dune::RefinementImp::PrismTriangulation::transformCoordinate (FieldVector< CoordType, dimension > point)
 
│ │ │ │ -

Macro Definition Documentation

│ │ │ │ - │ │ │ │ -

◆ DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC

│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
#define DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ +

Detailed Description

│ │ │ │ +

A geometry implementation for axis-aligned hypercubes.

│ │ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -6,60 +6,29 @@ │ │ │ │ │ dune-geometry 2.9.0 │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ - * refinement │ │ │ │ │ -Classes | Namespaces | Macros | Functions │ │ │ │ │ -prismtriangulation.cc File Reference │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +axisalignedcubegeometry.hh File Reference │ │ │ │ │ +A geometry implementation for axis-aligned hypercubes. More... │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ #include │ │ │ │ │ -#include "base.cc" │ │ │ │ │ -#include "simplex.cc" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ - class  Dune::RefinementImp::PrismTriangulation::RefinementImp<_dimension_, │ │ │ │ │ - CoordType_> │ │ │ │ │ -  Implementation of the refinement of a prism into simplices. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::RefinementImp::PrismTriangulation::RefinementImp<_dimension_, │ │ │ │ │ - CoordType_>::Codim<_codimension_> │ │ │ │ │ -  │ │ │ │ │ - class  Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial< │ │ │ │ │ - dimension,_CoordType,_dimension_> │ │ │ │ │ -  │ │ │ │ │ - class  Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial< │ │ │ │ │ - dimension,_CoordType,_0_> │ │ │ │ │ -  │ │ │ │ │ - class  Dune::RefinementImp::PrismTriangulation::RefinementImp<_dimension_, │ │ │ │ │ - CoordType_>::Codim<_codimension_> │ │ │ │ │ +class  Dune::AxisAlignedCubeGeometry<_CoordType,_dim,_coorddim_> │ │ │ │ │ +  A geometry implementation for axis-aligned hypercubes. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ -namespace  Dune::RefinementImp │ │ │ │ │ -  This namespace contains the implementation of Refinement. │ │ │ │ │ -  │ │ │ │ │ -namespace  Dune::RefinementImp::PrismTriangulation │ │ │ │ │ - This namespace contains the Refinement implementation for │ │ │ │ │ -  triangulating prisms (GeometryType::prism -> GeometryType::simplex) │ │ │ │ │ - │ │ │ │ │ -  │ │ │ │ │ - Macros │ │ │ │ │ -#define DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC │ │ │ │ │ -  │ │ │ │ │ - Functions │ │ │ │ │ -template │ │ │ │ │ -FieldVector< CoordType, dimension > Dune::RefinementImp::PrismTriangulation:: │ │ │ │ │ - transformCoordinate (FieldVector< │ │ │ │ │ - CoordType, dimension > point) │ │ │ │ │ -  │ │ │ │ │ -***** Macro Definition Documentation ***** │ │ │ │ │ -***** ◆ DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC ***** │ │ │ │ │ -#define DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC │ │ │ │ │ +***** Detailed Description ***** │ │ │ │ │ +A geometry implementation for axis-aligned hypercubes. │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00212_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: prismtriangulation.cc Source File │ │ │ │ +dune-geometry: axisalignedcubegeometry.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,520 +70,360 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
prismtriangulation.cc
│ │ │ │ +
axisalignedcubegeometry.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
│ │ │ │ -
5#ifndef DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC
│ │ │ │ -
6#define DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC
│ │ │ │ -
7
│ │ │ │ -
8#include <dune/common/fvector.hh>
│ │ │ │ -
9#include <dune/common/typetraits.hh>
│ │ │ │ -
10
│ │ │ │ - │ │ │ │ -
12#include <dune/geometry/type.hh>
│ │ │ │ -
13
│ │ │ │ -
14#include "base.cc"
│ │ │ │ -
15#include "simplex.cc"
│ │ │ │ -
16
│ │ │ │ -
17namespace Dune
│ │ │ │ -
18{
│ │ │ │ -
19 namespace RefinementImp
│ │ │ │ -
20 {
│ │ │ │ -
│ │ │ │ -
26 namespace PrismTriangulation
│ │ │ │ -
27 {
│ │ │ │ -
28 // ////////////
│ │ │ │ -
29 //
│ │ │ │ -
30 // Utilities
│ │ │ │ -
31 //
│ │ │ │ -
32
│ │ │ │ - │ │ │ │ - │ │ │ │ -
35
│ │ │ │ -
36 // ////////////////////////////////////
│ │ │ │ -
37 //
│ │ │ │ -
38 // Refine a prism with simplices
│ │ │ │ -
39 //
│ │ │ │ -
40
│ │ │ │ -
41 // forward declaration of the iterator base
│ │ │ │ -
42 template<int dimension, class CoordType, int codimension>
│ │ │ │ - │ │ │ │ -
44 /*
│ │ │ │ -
45 * The permutations 0,2 and 3 of the Kuhn-decomposition of a cube into simplices form a prism.
│ │ │ │ -
46 * The resulting prism is not oriented the same as the reference prism and so the Kuhn-coordinates
│ │ │ │ -
47 * have to be transformed using the method below.
│ │ │ │ -
48 */
│ │ │ │ -
49 template<int dimension, class CoordType> FieldVector<CoordType, dimension>
│ │ │ │ -
│ │ │ │ -
50 transformCoordinate(FieldVector<CoordType, dimension> point)
│ │ │ │ -
51 {
│ │ │ │ -
52 FieldVector<CoordType, dimension> transform;
│ │ │ │ -
53 transform[0] = point[1];
│ │ │ │ -
54 transform[1] = 1 - point[0];
│ │ │ │ -
55 transform[2] = point[2];
│ │ │ │ -
56 return transform;
│ │ │ │ -
57 }
│ │ │ │ -
│ │ │ │ -
58
│ │ │ │ -
65 template<int dimension_, class CoordType>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
67 {
│ │ │ │ -
68 public:
│ │ │ │ -
69 constexpr static int dimension = dimension_;
│ │ │ │ -
70
│ │ │ │ -
71 typedef CoordType ctype;
│ │ │ │ +
5
│ │ │ │ +
6#ifndef DUNE_GEOMETRY_AXISALIGNED_CUBE_GEOMETRY_HH
│ │ │ │ +
7#define DUNE_GEOMETRY_AXISALIGNED_CUBE_GEOMETRY_HH
│ │ │ │ +
8
│ │ │ │ +
13#include <bitset>
│ │ │ │ +
14
│ │ │ │ +
15#include <dune/common/fvector.hh>
│ │ │ │ +
16#include <dune/common/fmatrix.hh>
│ │ │ │ +
17#include <dune/common/diagonalmatrix.hh>
│ │ │ │ +
18
│ │ │ │ + │ │ │ │ +
20#include <dune/geometry/type.hh>
│ │ │ │ +
21
│ │ │ │ +
22
│ │ │ │ +
23namespace Dune {
│ │ │ │ +
24
│ │ │ │ +
48 template <class CoordType, unsigned int dim, unsigned int coorddim>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
50 {
│ │ │ │ +
51
│ │ │ │ +
52
│ │ │ │ +
53 public:
│ │ │ │ +
54
│ │ │ │ +
56 constexpr static int mydimension = dim;
│ │ │ │ +
57
│ │ │ │ +
59 constexpr static int coorddimension = coorddim;
│ │ │ │ +
60
│ │ │ │ +
62 typedef CoordType ctype;
│ │ │ │ +
63
│ │ │ │ +
65 typedef FieldVector<ctype,dim> LocalCoordinate;
│ │ │ │ +
66
│ │ │ │ +
68 typedef FieldVector<ctype,coorddim> GlobalCoordinate;
│ │ │ │ +
69
│ │ │ │ +
71 typedef ctype Volume;
│ │ │ │
72
│ │ │ │ -
73 template<int codimension>
│ │ │ │ -
74 struct Codim;
│ │ │ │ - │ │ │ │ -
76 typedef FieldVector<CoordType, dimension> CoordVector;
│ │ │ │ - │ │ │ │ -
78 typedef FieldVector<int, dimension+1> IndexVector;
│ │ │ │ -
79
│ │ │ │ -
80 static int nVertices(int nIntervals);
│ │ │ │ -
81 static VertexIterator vBegin(int nIntervals);
│ │ │ │ -
82 static VertexIterator vEnd(int nIntervals);
│ │ │ │ -
83
│ │ │ │ -
84 static int nElements(int nIntervals);
│ │ │ │ -
85 static ElementIterator eBegin(int nIntervals);
│ │ │ │ -
86 static ElementIterator eEnd(int nIntervals);
│ │ │ │ -
87
│ │ │ │ -
88 private:
│ │ │ │ -
89 friend class RefinementIteratorSpecial<dimension, CoordType, 0>;
│ │ │ │ -
90 friend class RefinementIteratorSpecial<dimension, CoordType, dimension>;
│ │ │ │ -
91
│ │ │ │ - │ │ │ │ -
93 };
│ │ │ │ -
│ │ │ │ -
94
│ │ │ │ -
95 template<int dimension, class CoordType>
│ │ │ │ -
96 template<int codimension>
│ │ │ │ -
│ │ │ │ -
97 struct RefinementImp<dimension, CoordType>::Codim
│ │ │ │ -
98 {
│ │ │ │ -
99 class SubEntityIterator;
│ │ │ │ - │ │ │ │ -
101 };
│ │ │ │ -
│ │ │ │ -
102
│ │ │ │ -
103 template<int dimension, class CoordType>
│ │ │ │ -
104 int
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
106 nVertices(int nIntervals)
│ │ │ │ -
107 {
│ │ │ │ -
108 return BackendRefinement::nVertices(nIntervals) * 3;
│ │ │ │ -
109 }
│ │ │ │ -
│ │ │ │ +
79 typedef typename std::conditional<dim==coorddim,
│ │ │ │ +
80 DiagonalMatrix<ctype,dim>,
│ │ │ │ +
81 FieldMatrix<ctype,dim,coorddim> >::type JacobianTransposed;
│ │ │ │ +
82
│ │ │ │ +
89 typedef typename std::conditional<dim==coorddim,
│ │ │ │ +
90 DiagonalMatrix<ctype,dim>,
│ │ │ │ +
91 FieldMatrix<ctype,coorddim,dim> >::type JacobianInverseTransposed;
│ │ │ │ +
92
│ │ │ │ +
100 using Jacobian = std::conditional_t<dim==coorddim, DiagonalMatrix<ctype,dim>, FieldMatrix<ctype,coorddim,dim> >;
│ │ │ │ +
101
│ │ │ │ +
109 using JacobianInverse = std::conditional_t<dim==coorddim, DiagonalMatrix<ctype,dim>, FieldMatrix<ctype,dim,coorddim> >;
│ │ │ │
110
│ │ │ │ -
111 template<int dimension, class CoordType>
│ │ │ │ - │ │ │ │ -
│ │ │ │ - │ │ │ │ -
114 vBegin(int nIntervals)
│ │ │ │ -
115 {
│ │ │ │ -
116 return VertexIterator(nIntervals);
│ │ │ │ -
117 }
│ │ │ │ -
│ │ │ │ -
118
│ │ │ │ -
119 template<int dimension, class CoordType>
│ │ │ │ - │ │ │ │ -
│ │ │ │ - │ │ │ │ -
122 vEnd(int nIntervals)
│ │ │ │ -
123 {
│ │ │ │ -
124 return VertexIterator(nIntervals, true);
│ │ │ │ -
125 }
│ │ │ │ -
│ │ │ │ -
126
│ │ │ │ -
127 template<int dimension, class CoordType>
│ │ │ │ -
128 int
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
130 nElements(int nIntervals)
│ │ │ │ -
131 {
│ │ │ │ -
132 return BackendRefinement::nElements(nIntervals) * 3;
│ │ │ │ -
133 }
│ │ │ │ -
│ │ │ │ -
134
│ │ │ │ -
135 template<int dimension, class CoordType>
│ │ │ │ - │ │ │ │ -
│ │ │ │ - │ │ │ │ -
138 eBegin(int nIntervals)
│ │ │ │ -
139 {
│ │ │ │ -
140 return ElementIterator(nIntervals);
│ │ │ │ -
141 }
│ │ │ │ -
│ │ │ │ -
142
│ │ │ │ -
143 template<int dimension, class CoordType>
│ │ │ │ - │ │ │ │ -
│ │ │ │ - │ │ │ │ -
146 eEnd(int nIntervals)
│ │ │ │ -
147 {
│ │ │ │ -
148 return ElementIterator(nIntervals, true);
│ │ │ │ -
149 }
│ │ │ │ -
│ │ │ │ -
150
│ │ │ │ -
151 // //////////////
│ │ │ │ -
152 //
│ │ │ │ -
153 // The iterator
│ │ │ │ -
154 //
│ │ │ │ -
155
│ │ │ │ -
156 // vertices
│ │ │ │ -
157 template<int dimension, class CoordType>
│ │ │ │ -
│ │ │ │ -
158 class RefinementIteratorSpecial<dimension, CoordType, dimension>
│ │ │ │ -
159 {
│ │ │ │ -
160 public:
│ │ │ │ - │ │ │ │ -
162 typedef typename Refinement::CoordVector CoordVector;
│ │ │ │ -
163 typedef typename Refinement::template Codim<dimension>::Geometry Geometry;
│ │ │ │ -
164
│ │ │ │ -
165 RefinementIteratorSpecial(int nIntervals, bool end = false);
│ │ │ │ -
166
│ │ │ │ -
167 void increment();
│ │ │ │ -
168
│ │ │ │ -
169 CoordVector coords() const;
│ │ │ │ -
170 Geometry geometry () const;
│ │ │ │ -
171
│ │ │ │ -
172 int index() const;
│ │ │ │ -
173 protected:
│ │ │ │ -
174 typedef typename Refinement::BackendRefinement BackendRefinement;
│ │ │ │ -
175 typedef typename BackendRefinement::template Codim<dimension>::SubEntityIterator BackendIterator;
│ │ │ │ -
176 constexpr static int nKuhnSimplices = 3;
│ │ │ │ -
177
│ │ │ │ - │ │ │ │ -
179
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
183 };
│ │ │ │ -
│ │ │ │ -
184
│ │ │ │ -
185 template<int dimension, class CoordType>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
187 RefinementIteratorSpecial(int nIntervals, bool end)
│ │ │ │ -
188 : nIntervals_(nIntervals), kuhnIndex(0),
│ │ │ │ -
189 backend(BackendRefinement::vBegin(nIntervals_)),
│ │ │ │ -
190 backendEnd(BackendRefinement::vEnd(nIntervals_))
│ │ │ │ -
191 {
│ │ │ │ -
192 if (end)
│ │ │ │ -
193 kuhnIndex = nKuhnSimplices;
│ │ │ │ -
194 }
│ │ │ │ -
│ │ │ │ -
195
│ │ │ │ -
196 template<int dimension, class CoordType>
│ │ │ │ -
197 void
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ -
200 {
│ │ │ │ -
201 ++backend;
│ │ │ │ -
202 if (backend == backendEnd)
│ │ │ │ -
203 {
│ │ │ │ -
204 backend = BackendRefinement::vBegin(nIntervals_);
│ │ │ │ -
205 ++kuhnIndex;
│ │ │ │ -
206 }
│ │ │ │ -
207 }
│ │ │ │ -
│ │ │ │ -
208
│ │ │ │ -
209 template<int dimension, class CoordType>
│ │ │ │ - │ │ │ │ -
│ │ │ │ - │ │ │ │ -
212 coords() const
│ │ │ │ -
213 {
│ │ │ │ -
214 // while the kuhnIndex runs from 0,1,2 the actual permutations we need are 0,2,3
│ │ │ │ -
215 return transformCoordinate(referenceToKuhn(backend.coords(),
│ │ │ │ -
216 getPermutation<dimension>((kuhnIndex + 2) % 4)));
│ │ │ │ -
217 }
│ │ │ │ +
│ │ │ │ +
115 AxisAlignedCubeGeometry(const Dune::FieldVector<ctype,coorddim> lower,
│ │ │ │ +
116 const Dune::FieldVector<ctype,coorddim> upper)
│ │ │ │ +
117 : lower_(lower),
│ │ │ │ +
118 upper_(upper),
│ │ │ │ +
119 axes_()
│ │ │ │ +
120 {
│ │ │ │ +
121 static_assert(dim==coorddim, "Use this constructor only if dim==coorddim!");
│ │ │ │ +
122 // all 'true', but is never actually used
│ │ │ │ +
123 axes_ = (1<<coorddim)-1;
│ │ │ │ +
124 }
│ │ │ │ +
│ │ │ │ +
125
│ │ │ │ +
│ │ │ │ +
133 AxisAlignedCubeGeometry(const Dune::FieldVector<ctype,coorddim> lower,
│ │ │ │ +
134 const Dune::FieldVector<ctype,coorddim> upper,
│ │ │ │ +
135 const std::bitset<coorddim>& axes)
│ │ │ │ +
136 : lower_(lower),
│ │ │ │ +
137 upper_(upper),
│ │ │ │ +
138 axes_(axes)
│ │ │ │ +
139 {
│ │ │ │ +
140 assert(axes.count()==dim);
│ │ │ │ +
141 for (size_t i=0; i<coorddim; i++)
│ │ │ │ +
142 if (not axes_[i])
│ │ │ │ +
143 upper_[i] = lower_[i];
│ │ │ │ +
144 }
│ │ │ │ +
│ │ │ │ +
145
│ │ │ │ +
│ │ │ │ +
150 AxisAlignedCubeGeometry(const Dune::FieldVector<ctype,coorddim> lower)
│ │ │ │ +
151 : lower_(lower)
│ │ │ │ +
152 {}
│ │ │ │ +
│ │ │ │ +
153
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
156 {
│ │ │ │ +
157 return GeometryTypes::cube(dim);
│ │ │ │ +
158 }
│ │ │ │ +
│ │ │ │ +
159
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
162 {
│ │ │ │ +
163 GlobalCoordinate result;
│ │ │ │ +
164 if (dim == coorddim) { // fast case
│ │ │ │ +
165 for (size_t i=0; i<coorddim; i++)
│ │ │ │ +
166 result[i] = lower_[i] + local[i]*(upper_[i] - lower_[i]);
│ │ │ │ +
167 } else if (dim == 0) { // a vertex -- the other fast case
│ │ │ │ +
168 result = lower_; // hope for named-return-type-optimization
│ │ │ │ +
169 } else { // slow case
│ │ │ │ +
170 size_t lc=0;
│ │ │ │ +
171 for (size_t i=0; i<coorddim; i++)
│ │ │ │ +
172 result[i] = (axes_[i])
│ │ │ │ +
173 ? lower_[i] + local[lc++]*(upper_[i] - lower_[i])
│ │ │ │ +
174 : lower_[i];
│ │ │ │ +
175 }
│ │ │ │ +
176 return result;
│ │ │ │ +
177 }
│ │ │ │ +
│ │ │ │ +
178
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
181 {
│ │ │ │ +
182 LocalCoordinate result;
│ │ │ │ +
183 if (dim == coorddim) { // fast case
│ │ │ │ +
184 for (size_t i=0; i<dim; i++)
│ │ │ │ +
185 result[i] = (global[i] - lower_[i]) / (upper_[i] - lower_[i]);
│ │ │ │ +
186 } else if (dim != 0) { // slow case
│ │ │ │ +
187 size_t lc=0;
│ │ │ │ +
188 for (size_t i=0; i<coorddim; i++)
│ │ │ │ +
189 if (axes_[i])
│ │ │ │ +
190 result[lc++] = (global[i] - lower_[i]) / (upper_[i] - lower_[i]);
│ │ │ │ +
191 }
│ │ │ │ +
192 return result;
│ │ │ │ +
193 }
│ │ │ │ +
│ │ │ │ +
194
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
197 {
│ │ │ │ +
198 JacobianTransposed result;
│ │ │ │ +
199
│ │ │ │ +
200 // Actually compute the result. Uses different methods depending
│ │ │ │ +
201 // on what kind of matrix JacobianTransposed is.
│ │ │ │ +
202 jacobianTransposed(result);
│ │ │ │ +
203
│ │ │ │ +
204 return result;
│ │ │ │ +
205 }
│ │ │ │ +
│ │ │ │ +
206
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
209 {
│ │ │ │ + │ │ │ │ +
211
│ │ │ │ +
212 // Actually compute the result. Uses different methods depending
│ │ │ │ +
213 // on what kind of matrix JacobianTransposed is.
│ │ │ │ + │ │ │ │ +
215
│ │ │ │ +
216 return result;
│ │ │ │ +
217 }
│ │ │ │
│ │ │ │
218
│ │ │ │ -
219 template<int dimension, class CoordType>
│ │ │ │ - │ │ │ │ -
│ │ │ │ - │ │ │ │ -
222 {
│ │ │ │ -
223 std::vector<CoordVector> corners(1);
│ │ │ │ -
224 corners[0] = transformCoordinate(referenceToKuhn(backend.coords(),
│ │ │ │ -
225 getPermutation<dimension>((kuhnIndex + 2) % 4)));
│ │ │ │ -
226 return Geometry(GeometryTypes::vertex, corners);
│ │ │ │ -
227 }
│ │ │ │ -
│ │ │ │ -
228
│ │ │ │ -
229 template<int dimension, class CoordType>
│ │ │ │ -
230 int
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
232 index() const
│ │ │ │ -
233 {
│ │ │ │ -
234 return kuhnIndex*BackendRefinement::nVertices(nIntervals_) + backend.index();
│ │ │ │ -
235 }
│ │ │ │ -
│ │ │ │ -
236
│ │ │ │ -
237 // elements
│ │ │ │ -
238 template<int dimension, class CoordType>
│ │ │ │ -
│ │ │ │ -
239 class RefinementIteratorSpecial<dimension, CoordType, 0>
│ │ │ │ -
240 {
│ │ │ │ -
241 public:
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
245 typedef typename Refinement::template Codim<0>::Geometry Geometry;
│ │ │ │ -
246
│ │ │ │ -
247 RefinementIteratorSpecial(int nIntervals, bool end = false);
│ │ │ │ -
248
│ │ │ │ -
249 void increment();
│ │ │ │ -
250
│ │ │ │ -
251 IndexVector vertexIndices() const;
│ │ │ │ -
252 int index() const;
│ │ │ │ -
253 CoordVector coords() const;
│ │ │ │ -
254
│ │ │ │ -
255 Geometry geometry () const;
│ │ │ │ -
256
│ │ │ │ -
257 private:
│ │ │ │ -
258 CoordVector global(const CoordVector &local) const;
│ │ │ │ -
259
│ │ │ │ -
260 protected:
│ │ │ │ - │ │ │ │ -
262 typedef typename BackendRefinement::template Codim<0>::SubEntityIterator BackendIterator;
│ │ │ │ -
263 constexpr static int nKuhnSimplices = 3;
│ │ │ │ -
264
│ │ │ │ - │ │ │ │ -
266
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
270 };
│ │ │ │ -
│ │ │ │ -
271
│ │ │ │ -
272 template<int dimension, class CoordType>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
274 RefinementIteratorSpecial(int nIntervals, bool end)
│ │ │ │ -
275 : nIntervals_(nIntervals), kuhnIndex(0),
│ │ │ │ -
276 backend(BackendRefinement::eBegin(nIntervals_)),
│ │ │ │ -
277 backendEnd(BackendRefinement::eEnd(nIntervals_))
│ │ │ │ -
278 {
│ │ │ │ -
279 if (end)
│ │ │ │ -
280 kuhnIndex = nKuhnSimplices;
│ │ │ │ -
281 }
│ │ │ │ -
│ │ │ │ -
282
│ │ │ │ -
283 template<int dimension, class CoordType>
│ │ │ │ -
284 void
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ -
287 {
│ │ │ │ -
288 ++backend;
│ │ │ │ -
289 if (backend == backendEnd)
│ │ │ │ -
290 {
│ │ │ │ -
291 backend = BackendRefinement::eBegin(nIntervals_);
│ │ │ │ -
292 ++kuhnIndex;
│ │ │ │ -
293 }
│ │ │ │ -
294 }
│ │ │ │ -
│ │ │ │ -
295
│ │ │ │ -
296 template<int dimension, class CoordType>
│ │ │ │ - │ │ │ │ -
│ │ │ │ - │ │ │ │ -
299 vertexIndices() const
│ │ │ │ -
300 {
│ │ │ │ -
301 IndexVector indices = backend.vertexIndices();
│ │ │ │ -
302
│ │ │ │ -
303 int base = kuhnIndex * BackendRefinement::nVertices(nIntervals_);
│ │ │ │ -
304 indices += base;
│ │ │ │ -
305
│ │ │ │ -
306 return indices;
│ │ │ │ -
307 }
│ │ │ │ -
│ │ │ │ -
308
│ │ │ │ -
309 template<int dimension, class CoordType>
│ │ │ │ -
310 int
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
312 index() const
│ │ │ │ -
313 {
│ │ │ │ -
314 return kuhnIndex*BackendRefinement::nElements(nIntervals_) + backend.index();
│ │ │ │ -
315 }
│ │ │ │ -
│ │ │ │ -
316
│ │ │ │ -
317 template<int dimension, class CoordType>
│ │ │ │ - │ │ │ │ -
│ │ │ │ - │ │ │ │ -
320 coords() const
│ │ │ │ -
321 {
│ │ │ │ -
322 return global(backend.coords());
│ │ │ │ -
323 }
│ │ │ │ -
│ │ │ │ -
324
│ │ │ │ -
325 template<int dimension, class CoordType>
│ │ │ │ - │ │ │ │ -
│ │ │ │ - │ │ │ │ -
328 {
│ │ │ │ -
329 const typename BackendIterator::Geometry &bgeo =
│ │ │ │ -
330 backend.geometry();
│ │ │ │ -
331 std::vector<CoordVector> corners(dimension+1);
│ │ │ │ -
332 for(int i = 0; i <= dimension; ++i)
│ │ │ │ -
333 corners[i] = global(bgeo.corner(i));
│ │ │ │ -
334
│ │ │ │ -
335 return Geometry(bgeo.type(), corners);
│ │ │ │ -
336 }
│ │ │ │ -
│ │ │ │ -
337
│ │ │ │ -
338 template<int dimension, class CoordType>
│ │ │ │ - │ │ │ │ - │ │ │ │ -
341 global(const CoordVector &local) const
│ │ │ │ -
342 {
│ │ │ │ -
343 // while the kuhnIndex runs from 0,1,2 the actual permutations we need are 0,2,3
│ │ │ │ -
344 return transformCoordinate(referenceToKuhn(local, getPermutation<dimension>((kuhnIndex+2)%4)));
│ │ │ │ -
345 }
│ │ │ │ -
346
│ │ │ │ -
347 // common
│ │ │ │ -
348 template<int dimension, class CoordType>
│ │ │ │ -
349 template<int codimension>
│ │ │ │ -
│ │ │ │ -
350 class RefinementImp<dimension, CoordType>::Codim<codimension>::SubEntityIterator
│ │ │ │ -
351 : public ForwardIteratorFacade<typename RefinementImp<dimension, CoordType>::template Codim<codimension>::SubEntityIterator, int>,
│ │ │ │ -
352 public RefinementIteratorSpecial<dimension, CoordType, codimension>
│ │ │ │ -
353 {
│ │ │ │ -
354 public:
│ │ │ │ - │ │ │ │ -
356 typedef SubEntityIterator This;
│ │ │ │ +
│ │ │ │ +
220 Jacobian jacobian([[maybe_unused]] const LocalCoordinate& local) const
│ │ │ │ +
221 {
│ │ │ │ +
222 return jacobianTransposed(local).transposed();
│ │ │ │ +
223 }
│ │ │ │ +
│ │ │ │ +
224
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
227 {
│ │ │ │ +
228 return jacobianInverseTransposed(local).transposed();
│ │ │ │ +
229 }
│ │ │ │ +
│ │ │ │ +
230
│ │ │ │ +
│ │ │ │ +
234 Volume integrationElement([[maybe_unused]] const LocalCoordinate& local) const
│ │ │ │ +
235 {
│ │ │ │ +
236 return volume();
│ │ │ │ +
237 }
│ │ │ │ +
│ │ │ │ +
238
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
241 {
│ │ │ │ +
242 GlobalCoordinate result;
│ │ │ │ +
243 if (dim==0)
│ │ │ │ +
244 result = lower_;
│ │ │ │ +
245 else {
│ │ │ │ +
246 // Since lower_==upper_ for unused coordinates, this always does the right thing
│ │ │ │ +
247 for (size_t i=0; i<coorddim; i++)
│ │ │ │ +
248 result[i] = CoordType(0.5) * (lower_[i] + upper_[i]);
│ │ │ │ +
249 }
│ │ │ │ +
250 return result;
│ │ │ │ +
251 }
│ │ │ │ +
│ │ │ │ +
252
│ │ │ │ +
│ │ │ │ +
254 int corners() const
│ │ │ │ +
255 {
│ │ │ │ +
256 return 1<<dim;
│ │ │ │ +
257 }
│ │ │ │ +
│ │ │ │ +
258
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
261 {
│ │ │ │ +
262 GlobalCoordinate result;
│ │ │ │ +
263 if (dim == coorddim) { // fast case
│ │ │ │ +
264 for (size_t i=0; i<coorddim; i++)
│ │ │ │ +
265 result[i] = (k & (1<<i)) ? upper_[i] : lower_[i];
│ │ │ │ +
266 } else if (dim == 0) { // vertex
│ │ │ │ +
267 result = lower_; // rely on named return-type optimization
│ │ │ │ +
268 } else { // slow case
│ │ │ │ +
269 unsigned int mask = 1;
│ │ │ │ +
270
│ │ │ │ +
271 for (size_t i=0; i<coorddim; i++) {
│ │ │ │ +
272 if (not axes_[i])
│ │ │ │ +
273 result[i] = lower_[i];
│ │ │ │ +
274 else {
│ │ │ │ +
275 result[i] = (k & mask) ? upper_[i] : lower_[i];
│ │ │ │ +
276 mask = (mask<<1);
│ │ │ │ +
277 }
│ │ │ │ +
278 }
│ │ │ │ +
279 }
│ │ │ │ +
280
│ │ │ │ +
281
│ │ │ │ +
282 return result;
│ │ │ │ +
283 }
│ │ │ │ +
│ │ │ │ +
284
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
287 {
│ │ │ │ +
288 ctype vol = 1;
│ │ │ │ +
289 if (dim == coorddim) { // fast case
│ │ │ │ +
290 for (size_t i=0; i<dim; i++)
│ │ │ │ +
291 vol *= upper_[i] - lower_[i];
│ │ │ │ +
292 // do nothing if dim == 0
│ │ │ │ +
293 } else if (dim != 0) { // slow case
│ │ │ │ +
294 for (size_t i=0; i<coorddim; i++)
│ │ │ │ +
295 if (axes_[i])
│ │ │ │ +
296 vol *= upper_[i] - lower_[i];
│ │ │ │ +
297 }
│ │ │ │ +
298 return vol;
│ │ │ │ +
299 }
│ │ │ │ +
│ │ │ │ +
300
│ │ │ │ +
│ │ │ │ +
302 bool affine() const
│ │ │ │ +
303 {
│ │ │ │ +
304 return true;
│ │ │ │ +
305 }
│ │ │ │ +
│ │ │ │ +
306
│ │ │ │ +
│ │ │ │ +
307 friend Dune::Transitional::ReferenceElement< ctype, Dim<dim> > referenceElement ( const AxisAlignedCubeGeometry & /* geometry */ )
│ │ │ │ +
308 {
│ │ │ │ + │ │ │ │ +
310 }
│ │ │ │ +
│ │ │ │ +
311
│ │ │ │ +
312 private:
│ │ │ │ +
313 // jacobianTransposed: fast case --> diagonal matrix
│ │ │ │ +
314 void jacobianTransposed ( DiagonalMatrix<ctype,dim> &jacobianTransposed ) const
│ │ │ │ +
315 {
│ │ │ │ +
316 for (size_t i=0; i<dim; i++)
│ │ │ │ +
317 jacobianTransposed.diagonal()[i] = upper_[i] - lower_[i];
│ │ │ │ +
318 }
│ │ │ │ +
319
│ │ │ │ +
320 // jacobianTransposed: slow case --> dense matrix
│ │ │ │ +
321 void jacobianTransposed ( FieldMatrix<ctype,dim,coorddim> &jacobianTransposed ) const
│ │ │ │ +
322 {
│ │ │ │ +
323 if (dim==0)
│ │ │ │ +
324 return;
│ │ │ │ +
325
│ │ │ │ +
326 size_t lc = 0;
│ │ │ │ +
327 for (size_t i=0; i<coorddim; i++)
│ │ │ │ +
328 if (axes_[i])
│ │ │ │ +
329 jacobianTransposed[lc++][i] = upper_[i] - lower_[i];
│ │ │ │ +
330 }
│ │ │ │ +
331
│ │ │ │ +
332 // jacobianInverseTransposed: fast case --> diagonal matrix
│ │ │ │ +
333 void jacobianInverseTransposed ( DiagonalMatrix<ctype,dim> &jacobianInverseTransposed ) const
│ │ │ │ +
334 {
│ │ │ │ +
335 for (size_t i=0; i<dim; i++)
│ │ │ │ +
336 jacobianInverseTransposed.diagonal()[i] = CoordType(1.0) / (upper_[i] - lower_[i]);
│ │ │ │ +
337 }
│ │ │ │ +
338
│ │ │ │ +
339 // jacobianInverseTransposed: slow case --> dense matrix
│ │ │ │ +
340 void jacobianInverseTransposed ( FieldMatrix<ctype,coorddim,dim> &jacobianInverseTransposed ) const
│ │ │ │ +
341 {
│ │ │ │ +
342 if (dim==0)
│ │ │ │ +
343 return;
│ │ │ │ +
344
│ │ │ │ +
345 size_t lc = 0;
│ │ │ │ +
346 for (size_t i=0; i<coorddim; i++)
│ │ │ │ +
347 if (axes_[i])
│ │ │ │ +
348 jacobianInverseTransposed[i][lc++] = CoordType(1.0) / (upper_[i] - lower_[i]);
│ │ │ │ +
349 }
│ │ │ │ +
350
│ │ │ │ +
351 Dune::FieldVector<ctype,coorddim> lower_;
│ │ │ │ +
352
│ │ │ │ +
353 Dune::FieldVector<ctype,coorddim> upper_;
│ │ │ │ +
354
│ │ │ │ +
355 std::bitset<coorddim> axes_;
│ │ │ │ +
356 };
│ │ │ │ +
│ │ │ │
357
│ │ │ │ -
358 SubEntityIterator(int nIntervals, bool end = false);
│ │ │ │ -
359
│ │ │ │ -
360 bool equals(const This &other) const;
│ │ │ │ -
361 protected:
│ │ │ │ -
362 using RefinementIteratorSpecial<dimension, CoordType, codimension>::kuhnIndex;
│ │ │ │ -
363 using RefinementIteratorSpecial<dimension, CoordType, codimension>::backend;
│ │ │ │ -
364 };
│ │ │ │ -
│ │ │ │ -
365
│ │ │ │ -
366#ifndef DOXYGEN
│ │ │ │ -
367 template<int dimension, class CoordType>
│ │ │ │ -
368 template<int codimension>
│ │ │ │ - │ │ │ │ -
370 SubEntityIterator(int nIntervals, bool end)
│ │ │ │ -
371 : RefinementIteratorSpecial<dimension, CoordType, codimension>(nIntervals, end)
│ │ │ │ -
372 {}
│ │ │ │ -
373
│ │ │ │ -
374 template<int dimension, class CoordType>
│ │ │ │ -
375 template<int codimension>
│ │ │ │ -
376 bool
│ │ │ │ - │ │ │ │ -
378 equals(const This &other) const
│ │ │ │ -
379 {
│ │ │ │ -
380 return ((kuhnIndex == other.kuhnIndex) && (backend == other.backend));
│ │ │ │ -
381 }
│ │ │ │ -
382#endif
│ │ │ │ -
383
│ │ │ │ -
384 } // namespace PrismTriangulation
│ │ │ │ -
│ │ │ │ -
385 } // namespace RefinementImp
│ │ │ │ -
386
│ │ │ │ -
387 namespace RefinementImp
│ │ │ │ -
388 {
│ │ │ │ -
389 // ///////////////////////
│ │ │ │ -
390 //
│ │ │ │ -
391 // The refinement traits
│ │ │ │ -
392 //
│ │ │ │ -
393
│ │ │ │ -
394#ifndef DOXYGEN
│ │ │ │ -
395 template<unsigned topologyId, class CoordType, unsigned coerceToId>
│ │ │ │ -
396 struct Traits<
│ │ │ │ -
397 topologyId, CoordType, coerceToId, 3,
│ │ │ │ -
398 typename std::enable_if<
│ │ │ │ -
399 (GeometryTypes::prism.id() >> 1) ==
│ │ │ │ -
400 (topologyId >> 1) &&
│ │ │ │ -
401 (GeometryTypes::simplex(3).id() >> 1) ==
│ │ │ │ -
402 (coerceToId >> 1)
│ │ │ │ -
403 >::type>
│ │ │ │ -
404 {
│ │ │ │ -
405 typedef PrismTriangulation::RefinementImp<3, CoordType> Imp;
│ │ │ │ -
406 };
│ │ │ │ -
407#endif
│ │ │ │ -
408
│ │ │ │ -
409 } // namespace RefinementImp
│ │ │ │ -
410} // namespace Dune
│ │ │ │ -
411
│ │ │ │ -
412#endif // DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC
│ │ │ │ - │ │ │ │ -
This file contains the Refinement implementation for simplices (triangles, tetrahedrons....
│ │ │ │ -
This file contains the parts independent of a particular Refinement implementation.
│ │ │ │ -
A unique label for each type of element that can occur in a grid.
│ │ │ │ +
358} // namespace Dune
│ │ │ │ +
359#endif
│ │ │ │ + │ │ │ │ +
A unique label for each type of element that can occur in a grid.
│ │ │ │
Definition affinegeometry.hh:21
│ │ │ │ -
FieldVector< CoordType, dimension > transformCoordinate(FieldVector< CoordType, dimension > point)
Definition prismtriangulation.cc:50
│ │ │ │ -
FieldVector< int, n > getPermutation(int m)
Calculate permutation from it's index.
Definition simplex.cc:336
│ │ │ │ -
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
│ │ │ │ -
Static tag representing a codimension.
Definition dimension.hh:24
│ │ │ │ -
generic geometry implementation based on corner coordinates
Definition multilineargeometry.hh:181
│ │ │ │ - │ │ │ │ -
Implementation of the refinement of a prism into simplices.
Definition prismtriangulation.cc:67
│ │ │ │ -
static constexpr int dimension
Definition prismtriangulation.cc:69
│ │ │ │ -
CoordType ctype
Definition prismtriangulation.cc:71
│ │ │ │ -
static VertexIterator vEnd(int nIntervals)
Definition prismtriangulation.cc:122
│ │ │ │ -
FieldVector< int, dimension+1 > IndexVector
Definition prismtriangulation.cc:78
│ │ │ │ -
static ElementIterator eEnd(int nIntervals)
Definition prismtriangulation.cc:146
│ │ │ │ -
static int nVertices(int nIntervals)
Definition prismtriangulation.cc:106
│ │ │ │ -
FieldVector< CoordType, dimension > CoordVector
Definition prismtriangulation.cc:76
│ │ │ │ -
static int nElements(int nIntervals)
Definition prismtriangulation.cc:130
│ │ │ │ -
Codim< 0 >::SubEntityIterator ElementIterator
Definition prismtriangulation.cc:77
│ │ │ │ -
Codim< dimension >::SubEntityIterator VertexIterator
Definition prismtriangulation.cc:75
│ │ │ │ -
static ElementIterator eBegin(int nIntervals)
Definition prismtriangulation.cc:138
│ │ │ │ -
static VertexIterator vBegin(int nIntervals)
Definition prismtriangulation.cc:114
│ │ │ │ - │ │ │ │ -
Dune::MultiLinearGeometry< CoordType, dimension-codimension, dimension > Geometry
Definition prismtriangulation.cc:100
│ │ │ │ - │ │ │ │ -
Refinement::template Codim< dimension >::Geometry Geometry
Definition prismtriangulation.cc:163
│ │ │ │ -
Refinement::BackendRefinement BackendRefinement
Definition prismtriangulation.cc:174
│ │ │ │ -
BackendRefinement::template Codim< dimension >::SubEntityIterator BackendIterator
Definition prismtriangulation.cc:175
│ │ │ │ - │ │ │ │ - │ │ │ │ -
RefinementImp< dimension, CoordType > Refinement
Definition prismtriangulation.cc:161
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
Refinement::template Codim< 0 >::Geometry Geometry
Definition prismtriangulation.cc:245
│ │ │ │ - │ │ │ │ -
Refinement::IndexVector IndexVector
Definition prismtriangulation.cc:243
│ │ │ │ -
BackendRefinement::template Codim< 0 >::SubEntityIterator BackendIterator
Definition prismtriangulation.cc:262
│ │ │ │ - │ │ │ │ -
Refinement::CoordVector CoordVector
Definition prismtriangulation.cc:244
│ │ │ │ -
RefinementImp< dimension, CoordType > Refinement
Definition prismtriangulation.cc:242
│ │ │ │ - │ │ │ │ -
Refinement::BackendRefinement BackendRefinement
Definition prismtriangulation.cc:261
│ │ │ │ -
SubEntityIterator This
Definition prismtriangulation.cc:356
│ │ │ │ - │ │ │ │ -
RefinementImp< dimension, CoordType > Refinement
Definition prismtriangulation.cc:355
│ │ │ │ - │ │ │ │ - │ │ │ │ +
static const ReferenceElement & cube()
get hypercube reference elements
Definition referenceelements.hh:210
│ │ │ │ +
A geometry implementation for axis-aligned hypercubes.
Definition axisalignedcubegeometry.hh:50
│ │ │ │ +
Volume volume() const
Return the element volume.
Definition axisalignedcubegeometry.hh:286
│ │ │ │ +
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
│ │ │ │ +
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
│ │ │ │ +
JacobianInverse jacobianInverse(const LocalCoordinate &local) const
Inverse Jacobian of the transformation from local to global coordinates.
Definition axisalignedcubegeometry.hh:226
│ │ │ │ +
JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate &local) const
Inverse Jacobian transposed of the transformation from local to global coordinates.
Definition axisalignedcubegeometry.hh:208
│ │ │ │ +
std::conditional< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< ctype, dim, coorddim > >::type JacobianTransposed
Return type of jacobianTransposed.
Definition axisalignedcubegeometry.hh:81
│ │ │ │ +
AxisAlignedCubeGeometry(const Dune::FieldVector< ctype, coorddim > lower)
Constructor from a single point only.
Definition axisalignedcubegeometry.hh:150
│ │ │ │ +
static constexpr int mydimension
Dimension of the cube element.
Definition axisalignedcubegeometry.hh:56
│ │ │ │ +
static constexpr int coorddimension
Dimension of the world space that the cube element is embedded in.
Definition axisalignedcubegeometry.hh:59
│ │ │ │ +
GlobalCoordinate corner(int k) const
Return world coordinates of the k-th corner of the element.
Definition axisalignedcubegeometry.hh:260
│ │ │ │ +
ctype Volume
Type used for volume.
Definition axisalignedcubegeometry.hh:71
│ │ │ │ +
FieldVector< ctype, dim > LocalCoordinate
Type used for a vector of element coordinates.
Definition axisalignedcubegeometry.hh:65
│ │ │ │ +
friend Dune::Transitional::ReferenceElement< ctype, Dim< dim > > referenceElement(const AxisAlignedCubeGeometry &)
Definition axisalignedcubegeometry.hh:307
│ │ │ │ +
JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const
Jacobian transposed of the transformation from local to global coordinates.
Definition axisalignedcubegeometry.hh:196
│ │ │ │ +
FieldVector< ctype, coorddim > GlobalCoordinate
Type used for a vector of world coordinates.
Definition axisalignedcubegeometry.hh:68
│ │ │ │ +
LocalCoordinate local(const GlobalCoordinate &global) const
Map a point in global (world) coordinates to element coordinates.
Definition axisalignedcubegeometry.hh:180
│ │ │ │ +
CoordType ctype
Type used for single coordinate coefficients.
Definition axisalignedcubegeometry.hh:62
│ │ │ │ +
std::conditional_t< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< ctype, coorddim, dim > > Jacobian
Return type of jacobian.
Definition axisalignedcubegeometry.hh:100
│ │ │ │ +
GeometryType type() const
Type of the cube. Here: a hypercube of the correct dimension.
Definition axisalignedcubegeometry.hh:155
│ │ │ │ +
int corners() const
Return the number of corners of the element.
Definition axisalignedcubegeometry.hh:254
│ │ │ │ +
Jacobian jacobian(const LocalCoordinate &local) const
Jacobian of the transformation from local to global coordinates.
Definition axisalignedcubegeometry.hh:220
│ │ │ │ +
std::conditional< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< ctype, coorddim, dim > >::type JacobianInverseTransposed
Return type of jacobianInverseTransposed.
Definition axisalignedcubegeometry.hh:91
│ │ │ │ +
Volume integrationElement(const LocalCoordinate &local) const
Return the integration element, i.e., the determinant term in the integral transformation formula.
Definition axisalignedcubegeometry.hh:234
│ │ │ │ +
GlobalCoordinate center() const
Return center of mass of the element.
Definition axisalignedcubegeometry.hh:240
│ │ │ │ +
bool affine() const
Return if the element is affine. Here: yes.
Definition axisalignedcubegeometry.hh:302
│ │ │ │ +
std::conditional_t< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< ctype, dim, coorddim > > JacobianInverse
Return type of jacobianInverse.
Definition axisalignedcubegeometry.hh:109
│ │ │ │ +
GlobalCoordinate global(const LocalCoordinate &local) const
Map a point in local (element) coordinates to world coordinates.
Definition axisalignedcubegeometry.hh:161
│ │ │ │ +
Unique label for each type of entities that can occur in DUNE grids.
Definition type.hh:126
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -7,605 +7,431 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ - * refinement │ │ │ │ │ -prismtriangulation.cc │ │ │ │ │ +axisalignedcubegeometry.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception │ │ │ │ │ - 5#ifndef DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC │ │ │ │ │ -6#define DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC │ │ │ │ │ - 7 │ │ │ │ │ - 8#include │ │ │ │ │ - 9#include │ │ │ │ │ - 10 │ │ │ │ │ - 11#include │ │ │ │ │ - 12#include │ │ │ │ │ - 13 │ │ │ │ │ - 14#include "base.cc" │ │ │ │ │ - 15#include "simplex.cc" │ │ │ │ │ - 16 │ │ │ │ │ - 17namespace Dune │ │ │ │ │ - 18{ │ │ │ │ │ - 19 namespace RefinementImp │ │ │ │ │ - 20 { │ │ │ │ │ -26 namespace PrismTriangulation │ │ │ │ │ - 27 { │ │ │ │ │ - 28 // //////////// │ │ │ │ │ - 29 // │ │ │ │ │ - 30 // Utilities │ │ │ │ │ - 31 // │ │ │ │ │ - 32 │ │ │ │ │ - 33 using Simplex::getPermutation; │ │ │ │ │ - 34 using Simplex::referenceToKuhn; │ │ │ │ │ - 35 │ │ │ │ │ - 36 // //////////////////////////////////// │ │ │ │ │ - 37 // │ │ │ │ │ - 38 // Refine a prism with simplices │ │ │ │ │ - 39 // │ │ │ │ │ - 40 │ │ │ │ │ - 41 // forward declaration of the iterator base │ │ │ │ │ - 42 template │ │ │ │ │ -43 class RefinementIteratorSpecial; │ │ │ │ │ - 44 /* │ │ │ │ │ - 45 * The permutations 0,2 and 3 of the Kuhn-decomposition of a cube into │ │ │ │ │ -simplices form a prism. │ │ │ │ │ - 46 * The resulting prism is not oriented the same as the reference prism and │ │ │ │ │ -so the Kuhn-coordinates │ │ │ │ │ - 47 * have to be transformed using the method below. │ │ │ │ │ - 48 */ │ │ │ │ │ - 49 template FieldVector │ │ │ │ │ -50 transformCoordinate(FieldVector point) │ │ │ │ │ - 51 { │ │ │ │ │ - 52 FieldVector transform; │ │ │ │ │ - 53 transform[0] = point[1]; │ │ │ │ │ - 54 transform[1] = 1 - point[0]; │ │ │ │ │ - 55 transform[2] = point[2]; │ │ │ │ │ - 56 return transform; │ │ │ │ │ - 57 } │ │ │ │ │ - 58 │ │ │ │ │ - 65 template │ │ │ │ │ -66 class RefinementImp │ │ │ │ │ - 67 { │ │ │ │ │ - 68 public: │ │ │ │ │ -69 constexpr static int dimension = dimension_; │ │ │ │ │ - 70 │ │ │ │ │ -71 typedef CoordType ctype; │ │ │ │ │ + 5 │ │ │ │ │ + 6#ifndef DUNE_GEOMETRY_AXISALIGNED_CUBE_GEOMETRY_HH │ │ │ │ │ + 7#define DUNE_GEOMETRY_AXISALIGNED_CUBE_GEOMETRY_HH │ │ │ │ │ + 8 │ │ │ │ │ + 13#include │ │ │ │ │ + 14 │ │ │ │ │ + 15#include │ │ │ │ │ + 16#include │ │ │ │ │ + 17#include │ │ │ │ │ + 18 │ │ │ │ │ + 19#include │ │ │ │ │ + 20#include │ │ │ │ │ + 21 │ │ │ │ │ + 22 │ │ │ │ │ + 23namespace Dune { │ │ │ │ │ + 24 │ │ │ │ │ + 48 template │ │ │ │ │ +49 class AxisAlignedCubeGeometry │ │ │ │ │ + 50 { │ │ │ │ │ + 51 │ │ │ │ │ + 52 │ │ │ │ │ + 53 public: │ │ │ │ │ + 54 │ │ │ │ │ +56 constexpr static int mydimension = dim; │ │ │ │ │ + 57 │ │ │ │ │ +59 constexpr static int coorddimension = coorddim; │ │ │ │ │ + 60 │ │ │ │ │ +62 typedef CoordType ctype; │ │ │ │ │ + 63 │ │ │ │ │ +65 typedef FieldVector LocalCoordinate; │ │ │ │ │ + 66 │ │ │ │ │ +68 typedef FieldVector GlobalCoordinate; │ │ │ │ │ + 69 │ │ │ │ │ +71 typedef ctype Volume; │ │ │ │ │ 72 │ │ │ │ │ - 73 template │ │ │ │ │ - 74 struct Codim; │ │ │ │ │ -75 typedef typename Codim::SubEntityIterator VertexIterator; │ │ │ │ │ -76 typedef FieldVector CoordVector; │ │ │ │ │ -77 typedef typename Codim<0>::SubEntityIterator ElementIterator; │ │ │ │ │ -78 typedef FieldVector IndexVector; │ │ │ │ │ - 79 │ │ │ │ │ - 80 static int nVertices(int nIntervals); │ │ │ │ │ - 81 static VertexIterator vBegin(int nIntervals); │ │ │ │ │ - 82 static VertexIterator vEnd(int nIntervals); │ │ │ │ │ - 83 │ │ │ │ │ - 84 static int nElements(int nIntervals); │ │ │ │ │ - 85 static ElementIterator eBegin(int nIntervals); │ │ │ │ │ -86 static ElementIterator eEnd(int nIntervals); │ │ │ │ │ - 87 │ │ │ │ │ - 88 private: │ │ │ │ │ - 89 friend class RefinementIteratorSpecial; │ │ │ │ │ - 90 friend class RefinementIteratorSpecial; │ │ │ │ │ - 91 │ │ │ │ │ - 92 typedef Simplex::RefinementImp BackendRefinement; │ │ │ │ │ - 93 }; │ │ │ │ │ - 94 │ │ │ │ │ - 95 template │ │ │ │ │ - 96 template │ │ │ │ │ -97 struct RefinementImp::Codim │ │ │ │ │ - 98 { │ │ │ │ │ - 99 class SubEntityIterator; │ │ │ │ │ -100 typedef Dune::MultiLinearGeometry Geometry; │ │ │ │ │ - 101 }; │ │ │ │ │ - 102 │ │ │ │ │ - 103 template │ │ │ │ │ - 104 int │ │ │ │ │ -105 RefinementImp:: │ │ │ │ │ - 106nVertices(int nIntervals) │ │ │ │ │ - 107 { │ │ │ │ │ - 108 return BackendRefinement::nVertices(nIntervals) * 3; │ │ │ │ │ - 109 } │ │ │ │ │ + 79 typedef typename std::conditional, │ │ │ │ │ +81 FieldMatrix >::type JacobianTransposed; │ │ │ │ │ + 82 │ │ │ │ │ + 89 typedef typename std::conditional, │ │ │ │ │ +91 FieldMatrix >::type JacobianInverseTransposed; │ │ │ │ │ + 92 │ │ │ │ │ +100 using Jacobian = std::conditional_t, FieldMatrix >; │ │ │ │ │ + 101 │ │ │ │ │ +109 using JacobianInverse = std::conditional_t, FieldMatrix >; │ │ │ │ │ 110 │ │ │ │ │ - 111 template │ │ │ │ │ - 112 typename RefinementImp::VertexIterator │ │ │ │ │ -113 RefinementImp:: │ │ │ │ │ - 114vBegin(int nIntervals) │ │ │ │ │ - 115 { │ │ │ │ │ - 116 return VertexIterator(nIntervals); │ │ │ │ │ - 117 } │ │ │ │ │ - 118 │ │ │ │ │ - 119 template │ │ │ │ │ - 120 typename RefinementImp::VertexIterator │ │ │ │ │ -121 RefinementImp:: │ │ │ │ │ - 122vEnd(int nIntervals) │ │ │ │ │ - 123 { │ │ │ │ │ - 124 return VertexIterator(nIntervals, true); │ │ │ │ │ - 125 } │ │ │ │ │ - 126 │ │ │ │ │ - 127 template │ │ │ │ │ - 128 int │ │ │ │ │ -129 RefinementImp:: │ │ │ │ │ - 130nElements(int nIntervals) │ │ │ │ │ - 131 { │ │ │ │ │ - 132 return BackendRefinement::nElements(nIntervals) * 3; │ │ │ │ │ - 133 } │ │ │ │ │ - 134 │ │ │ │ │ - 135 template │ │ │ │ │ - 136 typename RefinementImp::ElementIterator │ │ │ │ │ -137 RefinementImp:: │ │ │ │ │ - 138eBegin(int nIntervals) │ │ │ │ │ +115 AxisAlignedCubeGeometry(const Dune::FieldVector lower, │ │ │ │ │ + 116 const Dune::FieldVector upper) │ │ │ │ │ + 117 : lower_(lower), │ │ │ │ │ + 118 upper_(upper), │ │ │ │ │ + 119 axes_() │ │ │ │ │ + 120 { │ │ │ │ │ + 121 static_assert(dim==coorddim, "Use this constructor only if │ │ │ │ │ +dim==coorddim!"); │ │ │ │ │ + 122 // all 'true', but is never actually used │ │ │ │ │ + 123 axes_ = (1< lower, │ │ │ │ │ + 134 const Dune::FieldVector upper, │ │ │ │ │ + 135 const std::bitset& axes) │ │ │ │ │ + 136 : lower_(lower), │ │ │ │ │ + 137 upper_(upper), │ │ │ │ │ + 138 axes_(axes) │ │ │ │ │ 139 { │ │ │ │ │ - 140 return ElementIterator(nIntervals); │ │ │ │ │ - 141 } │ │ │ │ │ - 142 │ │ │ │ │ - 143 template │ │ │ │ │ - 144 typename RefinementImp::ElementIterator │ │ │ │ │ -145 RefinementImp:: │ │ │ │ │ - 146eEnd(int nIntervals) │ │ │ │ │ - 147 { │ │ │ │ │ - 148 return ElementIterator(nIntervals, true); │ │ │ │ │ - 149 } │ │ │ │ │ - 150 │ │ │ │ │ - 151 // ////////////// │ │ │ │ │ - 152 // │ │ │ │ │ - 153 // The iterator │ │ │ │ │ - 154 // │ │ │ │ │ - 155 │ │ │ │ │ - 156 // vertices │ │ │ │ │ - 157 template │ │ │ │ │ -158 class RefinementIteratorSpecial │ │ │ │ │ - 159 { │ │ │ │ │ - 160 public: │ │ │ │ │ -161 typedef RefinementImp Refinement; │ │ │ │ │ -162 typedef typename Refinement::CoordVector CoordVector; │ │ │ │ │ -163 typedef typename Refinement::template Codim::Geometry Geometry; │ │ │ │ │ - 164 │ │ │ │ │ - 165 RefinementIteratorSpecial(int nIntervals, bool end = false); │ │ │ │ │ - 166 │ │ │ │ │ - 167 void increment(); │ │ │ │ │ - 168 │ │ │ │ │ - 169 CoordVector coords() const; │ │ │ │ │ - 170 Geometry geometry () const; │ │ │ │ │ - 171 │ │ │ │ │ - 172 int index() const; │ │ │ │ │ - 173 protected: │ │ │ │ │ -174 typedef typename Refinement::BackendRefinement BackendRefinement; │ │ │ │ │ -175 typedef typename BackendRefinement::template Codim:: │ │ │ │ │ -SubEntityIterator BackendIterator; │ │ │ │ │ -176 constexpr static int nKuhnSimplices = 3; │ │ │ │ │ - 177 │ │ │ │ │ -178 int nIntervals_; │ │ │ │ │ - 179 │ │ │ │ │ -180 int kuhnIndex; │ │ │ │ │ -181 BackendIterator backend; │ │ │ │ │ -182 const BackendIterator backendEnd; │ │ │ │ │ - 183 }; │ │ │ │ │ - 184 │ │ │ │ │ - 185 template │ │ │ │ │ -186 RefinementIteratorSpecial:: │ │ │ │ │ - 187RefinementIteratorSpecial(int nIntervals, bool end) │ │ │ │ │ - 188 : nIntervals_(nIntervals), kuhnIndex(0), │ │ │ │ │ - 189 backend(BackendRefinement::vBegin(nIntervals_)), │ │ │ │ │ - 190 backendEnd(BackendRefinement::vEnd(nIntervals_)) │ │ │ │ │ - 191 { │ │ │ │ │ - 192 if (end) │ │ │ │ │ - 193 kuhnIndex = nKuhnSimplices; │ │ │ │ │ - 194 } │ │ │ │ │ - 195 │ │ │ │ │ - 196 template │ │ │ │ │ - 197 void │ │ │ │ │ -198 RefinementIteratorSpecial:: │ │ │ │ │ - 199increment() │ │ │ │ │ - 200 { │ │ │ │ │ - 201 ++backend; │ │ │ │ │ - 202 if (backend == backendEnd) │ │ │ │ │ - 203 { │ │ │ │ │ - 204 backend = BackendRefinement::vBegin(nIntervals_); │ │ │ │ │ - 205 ++kuhnIndex; │ │ │ │ │ - 206 } │ │ │ │ │ - 207 } │ │ │ │ │ - 208 │ │ │ │ │ - 209 template │ │ │ │ │ - 210 typename RefinementIteratorSpecial:: │ │ │ │ │ -CoordVector │ │ │ │ │ -211 RefinementIteratorSpecial:: │ │ │ │ │ - 212coords() const │ │ │ │ │ - 213 { │ │ │ │ │ - 214 // while the kuhnIndex runs from 0,1,2 the actual permutations we need are │ │ │ │ │ -0,2,3 │ │ │ │ │ - 215 return transformCoordinate(referenceToKuhn(backend.coords(), │ │ │ │ │ - 216 getPermutation((kuhnIndex + 2) % 4))); │ │ │ │ │ + 140 assert(axes.count()==dim); │ │ │ │ │ + 141 for (size_t i=0; i lower) │ │ │ │ │ + 151 : lower_(lower) │ │ │ │ │ + 152 {} │ │ │ │ │ + 153 │ │ │ │ │ +155 GeometryType type() const │ │ │ │ │ + 156 { │ │ │ │ │ + 157 return GeometryTypes::cube(dim); │ │ │ │ │ + 158 } │ │ │ │ │ + 159 │ │ │ │ │ +161 GlobalCoordinate global(const LocalCoordinate& local) const │ │ │ │ │ + 162 { │ │ │ │ │ + 163 GlobalCoordinate result; │ │ │ │ │ + 164 if (dim == coorddim) { // fast case │ │ │ │ │ + 165 for (size_t i=0; i │ │ │ │ │ - 220 typename RefinementIteratorSpecial:: │ │ │ │ │ -Geometry │ │ │ │ │ -221 RefinementIteratorSpecial::geometry () │ │ │ │ │ +220 Jacobian jacobian([[maybe_unused]] const LocalCoordinate& local) const │ │ │ │ │ + 221 { │ │ │ │ │ + 222 return jacobianTransposed(local).transposed(); │ │ │ │ │ + 223 } │ │ │ │ │ + 224 │ │ │ │ │ +226 JacobianInverse jacobianInverse([[maybe_unused]] const LocalCoordinate& │ │ │ │ │ +local) const │ │ │ │ │ + 227 { │ │ │ │ │ + 228 return jacobianInverseTransposed(local).transposed(); │ │ │ │ │ + 229 } │ │ │ │ │ + 230 │ │ │ │ │ +234 Volume integrationElement([[maybe_unused]] const LocalCoordinate& local) │ │ │ │ │ const │ │ │ │ │ - 222 { │ │ │ │ │ - 223 std::vector corners(1); │ │ │ │ │ - 224 corners[0] = transformCoordinate(referenceToKuhn(backend.coords(), │ │ │ │ │ - 225 getPermutation((kuhnIndex + 2) % 4))); │ │ │ │ │ - 226 return Geometry(GeometryTypes::vertex, corners); │ │ │ │ │ - 227 } │ │ │ │ │ - 228 │ │ │ │ │ - 229 template │ │ │ │ │ - 230 int │ │ │ │ │ -231 RefinementIteratorSpecial:: │ │ │ │ │ - 232index() const │ │ │ │ │ - 233 { │ │ │ │ │ - 234 return kuhnIndex*BackendRefinement::nVertices(nIntervals_) + backend.index │ │ │ │ │ -(); │ │ │ │ │ - 235 } │ │ │ │ │ - 236 │ │ │ │ │ - 237 // elements │ │ │ │ │ - 238 template │ │ │ │ │ -239 class RefinementIteratorSpecial │ │ │ │ │ - 240 { │ │ │ │ │ - 241 public: │ │ │ │ │ -242 typedef RefinementImp Refinement; │ │ │ │ │ -243 typedef typename Refinement::IndexVector IndexVector; │ │ │ │ │ -244 typedef typename Refinement::CoordVector CoordVector; │ │ │ │ │ -245 typedef typename Refinement::template Codim<0>::Geometry Geometry; │ │ │ │ │ - 246 │ │ │ │ │ - 247 RefinementIteratorSpecial(int nIntervals, bool end = false); │ │ │ │ │ - 248 │ │ │ │ │ - 249 void increment(); │ │ │ │ │ - 250 │ │ │ │ │ - 251 IndexVector vertexIndices() const; │ │ │ │ │ - 252 int index() const; │ │ │ │ │ - 253 CoordVector coords() const; │ │ │ │ │ - 254 │ │ │ │ │ - 255 Geometry geometry () const; │ │ │ │ │ - 256 │ │ │ │ │ - 257 private: │ │ │ │ │ - 258 CoordVector global(const CoordVector &local) const; │ │ │ │ │ - 259 │ │ │ │ │ - 260 protected: │ │ │ │ │ -261 typedef typename Refinement::BackendRefinement BackendRefinement; │ │ │ │ │ -262 typedef typename BackendRefinement::template Codim<0>::SubEntityIterator │ │ │ │ │ -BackendIterator; │ │ │ │ │ -263 constexpr static int nKuhnSimplices = 3; │ │ │ │ │ - 264 │ │ │ │ │ -265 int nIntervals_; │ │ │ │ │ - 266 │ │ │ │ │ -267 int kuhnIndex; │ │ │ │ │ -268 BackendIterator backend; │ │ │ │ │ -269 const BackendIterator backendEnd; │ │ │ │ │ - 270 }; │ │ │ │ │ - 271 │ │ │ │ │ - 272 template │ │ │ │ │ -273 RefinementIteratorSpecial:: │ │ │ │ │ - 274RefinementIteratorSpecial(int nIntervals, bool end) │ │ │ │ │ - 275 : nIntervals_(nIntervals), kuhnIndex(0), │ │ │ │ │ - 276 backend(BackendRefinement::eBegin(nIntervals_)), │ │ │ │ │ - 277 backendEnd(BackendRefinement::eEnd(nIntervals_)) │ │ │ │ │ - 278 { │ │ │ │ │ - 279 if (end) │ │ │ │ │ - 280 kuhnIndex = nKuhnSimplices; │ │ │ │ │ - 281 } │ │ │ │ │ - 282 │ │ │ │ │ - 283 template │ │ │ │ │ - 284 void │ │ │ │ │ -285 RefinementIteratorSpecial:: │ │ │ │ │ - 286increment() │ │ │ │ │ + 235 { │ │ │ │ │ + 236 return volume(); │ │ │ │ │ + 237 } │ │ │ │ │ + 238 │ │ │ │ │ +240 GlobalCoordinate center() const │ │ │ │ │ + 241 { │ │ │ │ │ + 242 GlobalCoordinate result; │ │ │ │ │ + 243 if (dim==0) │ │ │ │ │ + 244 result = lower_; │ │ │ │ │ + 245 else { │ │ │ │ │ + 246 // Since lower_==upper_ for unused coordinates, this always does the right │ │ │ │ │ +thing │ │ │ │ │ + 247 for (size_t i=0; i │ │ │ │ │ - 297 typename RefinementIteratorSpecial::IndexVector │ │ │ │ │ -298 RefinementIteratorSpecial:: │ │ │ │ │ - 299vertexIndices() const │ │ │ │ │ - 300 { │ │ │ │ │ - 301 IndexVector indices = backend.vertexIndices(); │ │ │ │ │ - 302 │ │ │ │ │ - 303 int base = kuhnIndex * BackendRefinement::nVertices(nIntervals_); │ │ │ │ │ - 304 indices += base; │ │ │ │ │ - 305 │ │ │ │ │ - 306 return indices; │ │ │ │ │ - 307 } │ │ │ │ │ - 308 │ │ │ │ │ - 309 template │ │ │ │ │ - 310 int │ │ │ │ │ -311 RefinementIteratorSpecial:: │ │ │ │ │ - 312index() const │ │ │ │ │ - 313 { │ │ │ │ │ - 314 return kuhnIndex*BackendRefinement::nElements(nIntervals_) + backend.index │ │ │ │ │ -(); │ │ │ │ │ - 315 } │ │ │ │ │ - 316 │ │ │ │ │ - 317 template │ │ │ │ │ - 318 typename RefinementIteratorSpecial::CoordVector │ │ │ │ │ -319 RefinementIteratorSpecial:: │ │ │ │ │ - 320coords() const │ │ │ │ │ - 321 { │ │ │ │ │ - 322 return global(backend.coords()); │ │ │ │ │ - 323 } │ │ │ │ │ - 324 │ │ │ │ │ - 325 template │ │ │ │ │ - 326 typename RefinementIteratorSpecial::Geometry │ │ │ │ │ -327 RefinementIteratorSpecial::geometry () const │ │ │ │ │ - 328 { │ │ │ │ │ - 329 const typename BackendIterator::Geometry &bgeo = │ │ │ │ │ - 330 backend.geometry(); │ │ │ │ │ - 331 std::vector corners(dimension+1); │ │ │ │ │ - 332 for(int i = 0; i <= dimension; ++i) │ │ │ │ │ - 333 corners[i] = global(bgeo.corner(i)); │ │ │ │ │ - 334 │ │ │ │ │ - 335 return Geometry(bgeo.type(), corners); │ │ │ │ │ - 336 } │ │ │ │ │ - 337 │ │ │ │ │ - 338 template │ │ │ │ │ - 339 typename RefinementIteratorSpecial::CoordVector │ │ │ │ │ - 340 RefinementIteratorSpecial:: │ │ │ │ │ - 341global(const CoordVector &local) const │ │ │ │ │ - 342 { │ │ │ │ │ - 343 // while the kuhnIndex runs from 0,1,2 the actual permutations we need are │ │ │ │ │ -0,2,3 │ │ │ │ │ - 344 return transformCoordinate(referenceToKuhn(local, │ │ │ │ │ -getPermutation((kuhnIndex+2)%4))); │ │ │ │ │ - 345 } │ │ │ │ │ - 346 │ │ │ │ │ - 347 // common │ │ │ │ │ - 348 template │ │ │ │ │ - 349 template │ │ │ │ │ -350 class RefinementImp::Codim:: │ │ │ │ │ -SubEntityIterator │ │ │ │ │ - 351 : public ForwardIteratorFacade::template Codim::SubEntityIterator, int>, │ │ │ │ │ - 352 public RefinementIteratorSpecial │ │ │ │ │ - 353 { │ │ │ │ │ - 354 public: │ │ │ │ │ -355 typedef RefinementImp Refinement; │ │ │ │ │ -356 typedef SubEntityIterator This; │ │ │ │ │ + 288 ctype vol = 1; │ │ │ │ │ + 289 if (dim == coorddim) { // fast case │ │ │ │ │ + 290 for (size_t i=0; i > │ │ │ │ │ +referenceElement ( const AxisAlignedCubeGeometry & /* geometry */ ) │ │ │ │ │ + 308 { │ │ │ │ │ + 309 return ReferenceElements<_ctype,_dim_>::cube(); │ │ │ │ │ + 310 } │ │ │ │ │ + 311 │ │ │ │ │ + 312 private: │ │ │ │ │ + 313 // jacobianTransposed: fast case --> diagonal matrix │ │ │ │ │ + 314 void jacobianTransposed ( DiagonalMatrix &jacobianTransposed ) │ │ │ │ │ +const │ │ │ │ │ + 315 { │ │ │ │ │ + 316 for (size_t i=0; i dense matrix │ │ │ │ │ + 321 void jacobianTransposed ( FieldMatrix │ │ │ │ │ +&jacobianTransposed ) const │ │ │ │ │ + 322 { │ │ │ │ │ + 323 if (dim==0) │ │ │ │ │ + 324 return; │ │ │ │ │ + 325 │ │ │ │ │ + 326 size_t lc = 0; │ │ │ │ │ + 327 for (size_t i=0; i diagonal matrix │ │ │ │ │ + 333 void jacobianInverseTransposed ( DiagonalMatrix │ │ │ │ │ +&jacobianInverseTransposed ) const │ │ │ │ │ + 334 { │ │ │ │ │ + 335 for (size_t i=0; i dense matrix │ │ │ │ │ + 340 void jacobianInverseTransposed ( FieldMatrix │ │ │ │ │ +&jacobianInverseTransposed ) const │ │ │ │ │ + 341 { │ │ │ │ │ + 342 if (dim==0) │ │ │ │ │ + 343 return; │ │ │ │ │ + 344 │ │ │ │ │ + 345 size_t lc = 0; │ │ │ │ │ + 346 for (size_t i=0; i lower_; │ │ │ │ │ + 352 │ │ │ │ │ + 353 Dune::FieldVector upper_; │ │ │ │ │ + 354 │ │ │ │ │ + 355 std::bitset axes_; │ │ │ │ │ + 356 }; │ │ │ │ │ 357 │ │ │ │ │ -358 SubEntityIterator(int nIntervals, bool end = false); │ │ │ │ │ - 359 │ │ │ │ │ -360 bool equals(const This &other) const; │ │ │ │ │ - 361 protected: │ │ │ │ │ - 362 using RefinementIteratorSpecial:: │ │ │ │ │ -kuhnIndex; │ │ │ │ │ - 363 using RefinementIteratorSpecial:: │ │ │ │ │ -backend; │ │ │ │ │ - 364 }; │ │ │ │ │ - 365 │ │ │ │ │ - 366#ifndef DOXYGEN │ │ │ │ │ - 367 template │ │ │ │ │ - 368 template │ │ │ │ │ - 369 RefinementImp::Codim:: │ │ │ │ │ -SubEntityIterator:: │ │ │ │ │ - 370SubEntityIterator(int nIntervals, bool end) │ │ │ │ │ - 371 : RefinementIteratorSpecial(nIntervals, │ │ │ │ │ -end) │ │ │ │ │ - 372 {} │ │ │ │ │ - 373 │ │ │ │ │ - 374 template │ │ │ │ │ - 375 template │ │ │ │ │ - 376 bool │ │ │ │ │ - 377 RefinementImp::Codim:: │ │ │ │ │ -SubEntityIterator:: │ │ │ │ │ - 378equals(const This &other) const │ │ │ │ │ - 379 { │ │ │ │ │ - 380 return ((kuhnIndex == other.kuhnIndex) && (backend == other.backend)); │ │ │ │ │ - 381 } │ │ │ │ │ - 382#endif │ │ │ │ │ - 383 │ │ │ │ │ - 384 } // namespace PrismTriangulation │ │ │ │ │ - 385 } // namespace RefinementImp │ │ │ │ │ - 386 │ │ │ │ │ - 387 namespace RefinementImp │ │ │ │ │ - 388 { │ │ │ │ │ - 389 // /////////////////////// │ │ │ │ │ - 390 // │ │ │ │ │ - 391 // The refinement traits │ │ │ │ │ - 392 // │ │ │ │ │ - 393 │ │ │ │ │ - 394#ifndef DOXYGEN │ │ │ │ │ - 395 template │ │ │ │ │ - 396 struct Traits< │ │ │ │ │ - 397 topologyId, CoordType, coerceToId, 3, │ │ │ │ │ - 398 typename std::enable_if< │ │ │ │ │ - 399 (GeometryTypes::prism.id() >> 1) == │ │ │ │ │ - 400 (topologyId >> 1) && │ │ │ │ │ - 401 (GeometryTypes::simplex(3).id() >> 1) == │ │ │ │ │ - 402 (coerceToId >> 1) │ │ │ │ │ - 403 >::type> │ │ │ │ │ - 404 { │ │ │ │ │ - 405 typedef PrismTriangulation::RefinementImp<3, CoordType> Imp; │ │ │ │ │ - 406 }; │ │ │ │ │ - 407#endif │ │ │ │ │ - 408 │ │ │ │ │ - 409 } // namespace RefinementImp │ │ │ │ │ - 410} // namespace Dune │ │ │ │ │ - 411 │ │ │ │ │ - 412#endif // DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC │ │ │ │ │ + 358} // namespace Dune │ │ │ │ │ + 359#endif │ │ │ │ │ referenceelements.hh │ │ │ │ │ -simplex.cc │ │ │ │ │ -This file contains the Refinement implementation for simplices (triangles, │ │ │ │ │ -tetrahedrons.... │ │ │ │ │ -base.cc │ │ │ │ │ -This file contains the parts independent of a particular Refinement │ │ │ │ │ -implementation. │ │ │ │ │ type.hh │ │ │ │ │ A unique label for each type of element that can occur in a grid. │ │ │ │ │ Dune │ │ │ │ │ Definition affinegeometry.hh:21 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::transformCoordinate │ │ │ │ │ -FieldVector< CoordType, dimension > transformCoordinate(FieldVector< CoordType, │ │ │ │ │ -dimension > point) │ │ │ │ │ -Definition prismtriangulation.cc:50 │ │ │ │ │ -Dune::RefinementImp::Simplex::getPermutation │ │ │ │ │ -FieldVector< int, n > getPermutation(int m) │ │ │ │ │ -Calculate permutation from it's index. │ │ │ │ │ -Definition simplex.cc:336 │ │ │ │ │ -Dune::RefinementImp::Simplex::referenceToKuhn │ │ │ │ │ -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 │ │ │ │ │ -Dune::Codim │ │ │ │ │ -Static tag representing a codimension. │ │ │ │ │ -Definition dimension.hh:24 │ │ │ │ │ -Dune::MultiLinearGeometry │ │ │ │ │ -generic geometry implementation based on corner coordinates │ │ │ │ │ -Definition multilineargeometry.hh:181 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial │ │ │ │ │ -Definition prismtriangulation.cc:43 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementImp │ │ │ │ │ -Implementation of the refinement of a prism into simplices. │ │ │ │ │ -Definition prismtriangulation.cc:67 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementImp::dimension │ │ │ │ │ -static constexpr int dimension │ │ │ │ │ -Definition prismtriangulation.cc:69 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementImp::ctype │ │ │ │ │ +Dune::Geo::ReferenceElements::cube │ │ │ │ │ +static const ReferenceElement & cube() │ │ │ │ │ +get hypercube reference elements │ │ │ │ │ +Definition referenceelements.hh:210 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry │ │ │ │ │ +A geometry implementation for axis-aligned hypercubes. │ │ │ │ │ +Definition axisalignedcubegeometry.hh:50 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::volume │ │ │ │ │ +Volume volume() const │ │ │ │ │ +Return the element volume. │ │ │ │ │ +Definition axisalignedcubegeometry.hh:286 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::AxisAlignedCubeGeometry │ │ │ │ │ +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 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::AxisAlignedCubeGeometry │ │ │ │ │ +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 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::jacobianInverse │ │ │ │ │ +JacobianInverse jacobianInverse(const LocalCoordinate &local) const │ │ │ │ │ +Inverse Jacobian of the transformation from local to global coordinates. │ │ │ │ │ +Definition axisalignedcubegeometry.hh:226 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::jacobianInverseTransposed │ │ │ │ │ +JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate │ │ │ │ │ +&local) const │ │ │ │ │ +Inverse Jacobian transposed of the transformation from local to global │ │ │ │ │ +coordinates. │ │ │ │ │ +Definition axisalignedcubegeometry.hh:208 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::JacobianTransposed │ │ │ │ │ +std::conditional< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< │ │ │ │ │ +ctype, dim, coorddim > >::type JacobianTransposed │ │ │ │ │ +Return type of jacobianTransposed. │ │ │ │ │ +Definition axisalignedcubegeometry.hh:81 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::AxisAlignedCubeGeometry │ │ │ │ │ +AxisAlignedCubeGeometry(const Dune::FieldVector< ctype, coorddim > lower) │ │ │ │ │ +Constructor from a single point only. │ │ │ │ │ +Definition axisalignedcubegeometry.hh:150 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::mydimension │ │ │ │ │ +static constexpr int mydimension │ │ │ │ │ +Dimension of the cube element. │ │ │ │ │ +Definition axisalignedcubegeometry.hh:56 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::coorddimension │ │ │ │ │ +static constexpr int coorddimension │ │ │ │ │ +Dimension of the world space that the cube element is embedded in. │ │ │ │ │ +Definition axisalignedcubegeometry.hh:59 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::corner │ │ │ │ │ +GlobalCoordinate corner(int k) const │ │ │ │ │ +Return world coordinates of the k-th corner of the element. │ │ │ │ │ +Definition axisalignedcubegeometry.hh:260 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::Volume │ │ │ │ │ +ctype Volume │ │ │ │ │ +Type used for volume. │ │ │ │ │ +Definition axisalignedcubegeometry.hh:71 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::LocalCoordinate │ │ │ │ │ +FieldVector< ctype, dim > LocalCoordinate │ │ │ │ │ +Type used for a vector of element coordinates. │ │ │ │ │ +Definition axisalignedcubegeometry.hh:65 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::referenceElement │ │ │ │ │ +friend Dune::Transitional::ReferenceElement< ctype, Dim< dim > > │ │ │ │ │ +referenceElement(const AxisAlignedCubeGeometry &) │ │ │ │ │ +Definition axisalignedcubegeometry.hh:307 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::jacobianTransposed │ │ │ │ │ +JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const │ │ │ │ │ +Jacobian transposed of the transformation from local to global coordinates. │ │ │ │ │ +Definition axisalignedcubegeometry.hh:196 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::GlobalCoordinate │ │ │ │ │ +FieldVector< ctype, coorddim > GlobalCoordinate │ │ │ │ │ +Type used for a vector of world coordinates. │ │ │ │ │ +Definition axisalignedcubegeometry.hh:68 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::local │ │ │ │ │ +LocalCoordinate local(const GlobalCoordinate &global) const │ │ │ │ │ +Map a point in global (world) coordinates to element coordinates. │ │ │ │ │ +Definition axisalignedcubegeometry.hh:180 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::ctype │ │ │ │ │ CoordType ctype │ │ │ │ │ -Definition prismtriangulation.cc:71 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementImp::vEnd │ │ │ │ │ -static VertexIterator vEnd(int nIntervals) │ │ │ │ │ -Definition prismtriangulation.cc:122 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementImp::IndexVector │ │ │ │ │ -FieldVector< int, dimension+1 > IndexVector │ │ │ │ │ -Definition prismtriangulation.cc:78 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementImp::eEnd │ │ │ │ │ -static ElementIterator eEnd(int nIntervals) │ │ │ │ │ -Definition prismtriangulation.cc:146 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementImp::nVertices │ │ │ │ │ -static int nVertices(int nIntervals) │ │ │ │ │ -Definition prismtriangulation.cc:106 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementImp::CoordVector │ │ │ │ │ -FieldVector< CoordType, dimension > CoordVector │ │ │ │ │ -Definition prismtriangulation.cc:76 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementImp::nElements │ │ │ │ │ -static int nElements(int nIntervals) │ │ │ │ │ -Definition prismtriangulation.cc:130 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementImp::ElementIterator │ │ │ │ │ -Codim< 0 >::SubEntityIterator ElementIterator │ │ │ │ │ -Definition prismtriangulation.cc:77 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementImp::VertexIterator │ │ │ │ │ -Codim< dimension >::SubEntityIterator VertexIterator │ │ │ │ │ -Definition prismtriangulation.cc:75 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementImp::eBegin │ │ │ │ │ -static ElementIterator eBegin(int nIntervals) │ │ │ │ │ -Definition prismtriangulation.cc:138 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementImp::vBegin │ │ │ │ │ -static VertexIterator vBegin(int nIntervals) │ │ │ │ │ -Definition prismtriangulation.cc:114 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementImp::Codim │ │ │ │ │ -Definition prismtriangulation.cc:98 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementImp::Codim::Geometry │ │ │ │ │ -Dune::MultiLinearGeometry< CoordType, dimension-codimension, dimension > │ │ │ │ │ -Geometry │ │ │ │ │ -Definition prismtriangulation.cc:100 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_dimension_>::nIntervals_ │ │ │ │ │ -int nIntervals_ │ │ │ │ │ -Definition prismtriangulation.cc:178 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_dimension_>::Geometry │ │ │ │ │ -Refinement::template Codim< dimension >::Geometry Geometry │ │ │ │ │ -Definition prismtriangulation.cc:163 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_dimension_>::BackendRefinement │ │ │ │ │ -Refinement::BackendRefinement BackendRefinement │ │ │ │ │ -Definition prismtriangulation.cc:174 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_dimension_>::BackendIterator │ │ │ │ │ -BackendRefinement::template Codim< dimension >::SubEntityIterator │ │ │ │ │ -BackendIterator │ │ │ │ │ -Definition prismtriangulation.cc:175 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_dimension_>::CoordVector │ │ │ │ │ -Refinement::CoordVector CoordVector │ │ │ │ │ -Definition prismtriangulation.cc:162 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_dimension_>::backendEnd │ │ │ │ │ -const BackendIterator backendEnd │ │ │ │ │ -Definition prismtriangulation.cc:182 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_dimension_>::Refinement │ │ │ │ │ -RefinementImp< dimension, CoordType > Refinement │ │ │ │ │ -Definition prismtriangulation.cc:161 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_dimension_>::backend │ │ │ │ │ -BackendIterator backend │ │ │ │ │ -Definition prismtriangulation.cc:181 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_dimension_>::kuhnIndex │ │ │ │ │ -int kuhnIndex │ │ │ │ │ -Definition prismtriangulation.cc:180 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_0_>::nIntervals_ │ │ │ │ │ -int nIntervals_ │ │ │ │ │ -Definition prismtriangulation.cc:265 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_0_>::Geometry │ │ │ │ │ -Refinement::template Codim< 0 >::Geometry Geometry │ │ │ │ │ -Definition prismtriangulation.cc:245 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_0_>::backend │ │ │ │ │ -BackendIterator backend │ │ │ │ │ -Definition prismtriangulation.cc:268 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_0_>::IndexVector │ │ │ │ │ -Refinement::IndexVector IndexVector │ │ │ │ │ -Definition prismtriangulation.cc:243 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_0_>::BackendIterator │ │ │ │ │ -BackendRefinement::template Codim< 0 >::SubEntityIterator BackendIterator │ │ │ │ │ -Definition prismtriangulation.cc:262 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_0_>::kuhnIndex │ │ │ │ │ -int kuhnIndex │ │ │ │ │ -Definition prismtriangulation.cc:267 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_0_>::CoordVector │ │ │ │ │ -Refinement::CoordVector CoordVector │ │ │ │ │ -Definition prismtriangulation.cc:244 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_0_>::Refinement │ │ │ │ │ -RefinementImp< dimension, CoordType > Refinement │ │ │ │ │ -Definition prismtriangulation.cc:242 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_0_>::backendEnd │ │ │ │ │ -const BackendIterator backendEnd │ │ │ │ │ -Definition prismtriangulation.cc:269 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ -CoordType,_0_>::BackendRefinement │ │ │ │ │ -Refinement::BackendRefinement BackendRefinement │ │ │ │ │ -Definition prismtriangulation.cc:261 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementImp::Codim<_codimension_>:: │ │ │ │ │ -This │ │ │ │ │ -SubEntityIterator This │ │ │ │ │ -Definition prismtriangulation.cc:356 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementImp::Codim<_codimension_>:: │ │ │ │ │ -equals │ │ │ │ │ -bool equals(const This &other) const │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementImp::Codim<_codimension_>:: │ │ │ │ │ -Refinement │ │ │ │ │ -RefinementImp< dimension, CoordType > Refinement │ │ │ │ │ -Definition prismtriangulation.cc:355 │ │ │ │ │ -Dune::RefinementImp::PrismTriangulation::RefinementImp::Codim<_codimension_>:: │ │ │ │ │ -SubEntityIterator │ │ │ │ │ -SubEntityIterator(int nIntervals, bool end=false) │ │ │ │ │ -Dune::RefinementImp::Simplex::RefinementImp │ │ │ │ │ -Definition simplex.cc:433 │ │ │ │ │ +Type used for single coordinate coefficients. │ │ │ │ │ +Definition axisalignedcubegeometry.hh:62 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::Jacobian │ │ │ │ │ +std::conditional_t< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< │ │ │ │ │ +ctype, coorddim, dim > > Jacobian │ │ │ │ │ +Return type of jacobian. │ │ │ │ │ +Definition axisalignedcubegeometry.hh:100 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::type │ │ │ │ │ +GeometryType type() const │ │ │ │ │ +Type of the cube. Here: a hypercube of the correct dimension. │ │ │ │ │ +Definition axisalignedcubegeometry.hh:155 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::corners │ │ │ │ │ +int corners() const │ │ │ │ │ +Return the number of corners of the element. │ │ │ │ │ +Definition axisalignedcubegeometry.hh:254 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::jacobian │ │ │ │ │ +Jacobian jacobian(const LocalCoordinate &local) const │ │ │ │ │ +Jacobian of the transformation from local to global coordinates. │ │ │ │ │ +Definition axisalignedcubegeometry.hh:220 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::JacobianInverseTransposed │ │ │ │ │ +std::conditional< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< │ │ │ │ │ +ctype, coorddim, dim > >::type JacobianInverseTransposed │ │ │ │ │ +Return type of jacobianInverseTransposed. │ │ │ │ │ +Definition axisalignedcubegeometry.hh:91 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::integrationElement │ │ │ │ │ +Volume integrationElement(const LocalCoordinate &local) const │ │ │ │ │ +Return the integration element, i.e., the determinant term in the integral │ │ │ │ │ +transformation formula. │ │ │ │ │ +Definition axisalignedcubegeometry.hh:234 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::center │ │ │ │ │ +GlobalCoordinate center() const │ │ │ │ │ +Return center of mass of the element. │ │ │ │ │ +Definition axisalignedcubegeometry.hh:240 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::affine │ │ │ │ │ +bool affine() const │ │ │ │ │ +Return if the element is affine. Here: yes. │ │ │ │ │ +Definition axisalignedcubegeometry.hh:302 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::JacobianInverse │ │ │ │ │ +std::conditional_t< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< │ │ │ │ │ +ctype, dim, coorddim > > JacobianInverse │ │ │ │ │ +Return type of jacobianInverse. │ │ │ │ │ +Definition axisalignedcubegeometry.hh:109 │ │ │ │ │ +Dune::AxisAlignedCubeGeometry::global │ │ │ │ │ +GlobalCoordinate global(const LocalCoordinate &local) const │ │ │ │ │ +Map a point in local (element) coordinates to world coordinates. │ │ │ │ │ +Definition axisalignedcubegeometry.hh:161 │ │ │ │ │ +Dune::GeometryType │ │ │ │ │ +Unique label for each type of entities that can occur in DUNE grids. │ │ │ │ │ +Definition type.hh:126 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00215.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: pyramidtriangulation.cc File Reference │ │ │ │ +dune-geometry: referenceelement.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,86 +65,44 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Macros | │ │ │ │ -Functions
│ │ │ │ -
pyramidtriangulation.cc File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
referenceelement.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <dune/common/fvector.hh>
│ │ │ │ -#include <dune/common/typetraits.hh>
│ │ │ │ -#include <dune/geometry/referenceelements.hh>
│ │ │ │ -#include <dune/geometry/type.hh>
│ │ │ │ -#include "base.cc"
│ │ │ │ -#include "simplex.cc"
│ │ │ │ +
#include <dune/geometry/type.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::RefinementImp::PyramidTriangulation::RefinementImp< dimension_, CoordType >
 Implementation of the refinement of a pyramid into simplices. More...
class  Dune::Geo::ReferenceElement< Implementation >
 This class provides access to geometric and topological properties of a reference element. 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 >
struct  Dune::Geo::ReferenceElement< Implementation >::Codim< codim >
 Collection of types depending on the codimension. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ Namespaces

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

│ │ │ │ -Macros

#define DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -Functions

template<int dimension, class CoordType >
FieldVector< CoordType, dimension > Dune::RefinementImp::PyramidTriangulation::transformCoordinate (FieldVector< CoordType, dimension > point)
 
│ │ │ │ -

Macro Definition Documentation

│ │ │ │ - │ │ │ │ -

◆ DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC

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

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

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

Go to the source code of this file.

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

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

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

│ │ │ │ -Macros

#define DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

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

Detailed Description

│ │ │ │ -

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

│ │ │ │ -

See Refinement implementation for simplices.

│ │ │ │ -

Macro Definition Documentation

│ │ │ │ - │ │ │ │ -

◆ DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC

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

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

│ │ │ │ -
#include <dune/geometry/type.hh>
│ │ │ │ +
#include <dune/geometry/type.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00221_source.html │ │ │ │ @@ -84,15 +84,15 @@ │ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
│ │ │ │
5#ifndef DUNE_GEOMETRY_REFINEMENT_BASE_CC
│ │ │ │
6#define DUNE_GEOMETRY_REFINEMENT_BASE_CC
│ │ │ │
7
│ │ │ │ -
15#include <dune/geometry/type.hh>
│ │ │ │ +
15#include <dune/geometry/type.hh>
│ │ │ │
16
│ │ │ │
17namespace Dune
│ │ │ │
18{
│ │ │ │
│ │ │ │
28 namespace RefinementImp
│ │ │ │
29 {
│ │ │ │
30 // /////////////////////////////////
│ │ │ │ @@ -233,15 +233,15 @@ │ │ │ │
│ │ │ │
251 };
│ │ │ │
│ │ │ │
252
│ │ │ │
254} // namespace Dune
│ │ │ │
255
│ │ │ │
256#endif // DUNE_GEOMETRY_REFINEMENT_BASE_CC
│ │ │ │ -
A unique label for each type of element that can occur in a grid.
│ │ │ │ +
A unique label for each type of element that can occur in a grid.
│ │ │ │
RefinementIntervals refinementIntervals(int intervals)
Creates a RefinementIntervals object.
Definition base.cc:108
│ │ │ │
RefinementIntervals refinementLevels(int levels)
Creates a RefinementIntervals object.
Definition base.cc:117
│ │ │ │
Definition affinegeometry.hh:21
│ │ │ │
Mapping from geometryType, CoordType and coerceTo to a particular Refinement implementation.
Definition base.cc:70
│ │ │ │
Holds the number of refined intervals per axis needed for virtual and static refinement.
Definition base.cc:94
│ │ │ │
RefinementIntervals(int i)
Definition base.cc:98
│ │ │ │
int intervals() const
Definition base.cc:100
│ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00224.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: quadraturerules.hh File Reference │ │ │ │ +dune-geometry: pyramidtriangulation.cc File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,119 +65,80 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces | │ │ │ │ Macros | │ │ │ │ -Enumerations
│ │ │ │ -
quadraturerules.hh File Reference
│ │ │ │ +Functions
│ │ │ │ +
pyramidtriangulation.cc File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <algorithm>
│ │ │ │ -#include <iostream>
│ │ │ │ -#include <limits>
│ │ │ │ -#include <mutex>
│ │ │ │ -#include <utility>
│ │ │ │ -#include <vector>
│ │ │ │ -#include <dune/common/fvector.hh>
│ │ │ │ -#include <dune/common/exceptions.hh>
│ │ │ │ -#include <dune/common/stdstreams.hh>
│ │ │ │ -#include <dune/common/stdthread.hh>
│ │ │ │ -#include <dune/common/visibility.hh>
│ │ │ │ -#include <dune/geometry/type.hh>
│ │ │ │ -#include <dune/geometry/typeindex.hh>
│ │ │ │ -#include "quadraturerules/pointquadrature.hh"
│ │ │ │ -#include "quadraturerules/gausslobattoquadrature.hh"
│ │ │ │ -#include "quadraturerules/gaussquadrature.hh"
│ │ │ │ -#include "quadraturerules/gaussradauleftquadrature.hh"
│ │ │ │ -#include "quadraturerules/gaussradaurightquadrature.hh"
│ │ │ │ -#include "quadraturerules/jacobi1quadrature.hh"
│ │ │ │ -#include "quadraturerules/jacobi2quadrature.hh"
│ │ │ │ -#include "quadraturerules/jacobiNquadrature.hh"
│ │ │ │ -#include "quadraturerules/prismquadrature.hh"
│ │ │ │ -#include "quadraturerules/simplexquadrature.hh"
│ │ │ │ -#include "quadraturerules/tensorproductquadrature.hh"
│ │ │ │ +
#include <dune/common/fvector.hh>
│ │ │ │ +#include <dune/common/typetraits.hh>
│ │ │ │ +#include <dune/geometry/referenceelements.hh>
│ │ │ │ +#include <dune/geometry/type.hh>
│ │ │ │ +#include "base.cc"
│ │ │ │ +#include "simplex.cc"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │

│ │ │ │ Classes

struct  Dune::RefinementImp::Traits< topologyId, CoordType, coerceToId, dimension, Dummy >
 Mapping from geometryType, CoordType and coerceTo to a particular Refinement implementation. More...
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  Dune::QuadratureOrderOutOfRange
 Exception thrown if a desired QuadratureRule is not available, because the requested order is to high. More...
class  Dune::RefinementImp::PyramidTriangulation::RefinementImp< dimension_, CoordType >
 Implementation of the refinement of a pyramid into simplices. More...
 
class  Dune::QuadraturePoint< ct, dim >
 Single evaluation point in a quadrature rule. More...
struct  Dune::RefinementImp::PyramidTriangulation::RefinementImp< dimension_, CoordType >::Codim< codimension >
 
class  Dune::QuadratureRule< ct, dim >
 Abstract base class for quadrature rules. More...
class  Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< dimension, CoordType, dimension >
 
class  Dune::QuadratureRules< ctype, dim >
 A container for all quadrature rules of dimension dim More...
class  Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< dimension, CoordType, 0 >
 
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 >
class  Dune::RefinementImp::PyramidTriangulation::RefinementImp< dimension_, CoordType >::Codim< codimension >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::QuadratureType
 Defines an enum for currently available quadrature rules.
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)
 
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ Macros

#define DUNE_INCLUDING_IMPLEMENTATION
 
#define DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ -Enumerations

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

│ │ │ │ +Functions

template<int dimension, class CoordType >
FieldVector< CoordType, dimension > Dune::RefinementImp::PyramidTriangulation::transformCoordinate (FieldVector< CoordType, dimension > point)
 
│ │ │ │ -

Detailed Description

│ │ │ │ -

Interface for quadrature points and rules

│ │ │ │ -

Macro Definition Documentation

│ │ │ │ - │ │ │ │ -

◆ DUNE_INCLUDING_IMPLEMENTATION

│ │ │ │ +

Macro Definition Documentation

│ │ │ │ + │ │ │ │ +

◆ DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │
#define DUNE_INCLUDING_IMPLEMENTATION#define DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ ├── html2text {} │ │ │ │ │ @@ -6,87 +6,61 @@ │ │ │ │ │ dune-geometry 2.9.0 │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ -Classes | Namespaces | Macros | Enumerations │ │ │ │ │ -quadraturerules.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ + * refinement │ │ │ │ │ +Classes | Namespaces | Macros | Functions │ │ │ │ │ +pyramidtriangulation.cc File Reference │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include "quadraturerules/pointquadrature.hh" │ │ │ │ │ -#include "quadraturerules/gausslobattoquadrature.hh" │ │ │ │ │ -#include "quadraturerules/gaussquadrature.hh" │ │ │ │ │ -#include "quadraturerules/gaussradauleftquadrature.hh" │ │ │ │ │ -#include "quadraturerules/gaussradaurightquadrature.hh" │ │ │ │ │ -#include "quadraturerules/jacobi1quadrature.hh" │ │ │ │ │ -#include "quadraturerules/jacobi2quadrature.hh" │ │ │ │ │ -#include "quadraturerules/jacobiNquadrature.hh" │ │ │ │ │ -#include "quadraturerules/prismquadrature.hh" │ │ │ │ │ -#include "quadraturerules/simplexquadrature.hh" │ │ │ │ │ -#include "quadraturerules/tensorproductquadrature.hh" │ │ │ │ │ +#include "base.cc" │ │ │ │ │ +#include "simplex.cc" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  Dune::QuadratureOrderOutOfRange │ │ │ │ │ -  Exception thrown if a desired QuadratureRule is not available, because │ │ │ │ │ - the requested order is to high. More... │ │ │ │ │ + class  Dune::RefinementImp::PyramidTriangulation::RefinementImp<_dimension_, │ │ │ │ │ + CoordType_> │ │ │ │ │ +  Implementation of the refinement of a pyramid into simplices. More... │ │ │ │ │   │ │ │ │ │ -class  Dune::QuadraturePoint<_ct,_dim_> │ │ │ │ │ -  Single evaluation point in a quadrature rule. More... │ │ │ │ │ +struct  Dune::RefinementImp::PyramidTriangulation::RefinementImp<_dimension_, │ │ │ │ │ + CoordType_>::Codim<_codimension_> │ │ │ │ │   │ │ │ │ │ -class  Dune::QuadratureRule<_ct,_dim_> │ │ │ │ │ -  Abstract base class for quadrature rules. More... │ │ │ │ │ + class  Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< │ │ │ │ │ + dimension,_CoordType,_dimension_> │ │ │ │ │   │ │ │ │ │ -class  Dune::QuadratureRules<_ctype,_dim_> │ │ │ │ │ -  A container for all quadrature rules of dimension dim More... │ │ │ │ │ + class  Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< │ │ │ │ │ + dimension,_CoordType,_0_> │ │ │ │ │   │ │ │ │ │ -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_> │ │ │ │ │ + class  Dune::RefinementImp::PyramidTriangulation::RefinementImp<_dimension_, │ │ │ │ │ + CoordType_>::Codim<_codimension_> │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ -namespace  Dune::QuadratureType │ │ │ │ │ -  Defines an enum for currently available quadrature rules. │ │ │ │ │ +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) │ │ │ │ │   │ │ │ │ │ Macros │ │ │ │ │ -#define DUNE_INCLUDING_IMPLEMENTATION │ │ │ │ │ +#define DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC │ │ │ │ │   │ │ │ │ │ - Enumerations │ │ │ │ │ -enum  Dune::QuadratureType::Enum { │ │ │ │ │ -   Dune::QuadratureType::GaussLegendre = 0 , Dune::QuadratureType:: │ │ │ │ │ - GaussJacobi_1_0 = 1 , Dune::QuadratureType::GaussJacobi_2_0 = 2 , Dune:: │ │ │ │ │ - QuadratureType::GaussJacobi_n_0 = 3 , │ │ │ │ │ -   Dune::QuadratureType::GaussLobatto = 4 , Dune::QuadratureType:: │ │ │ │ │ - GaussRadauLeft = 5 , Dune::QuadratureType::GaussRadauRight = 6 , Dune:: │ │ │ │ │ - QuadratureType::size │ │ │ │ │ - } │ │ │ │ │ + Functions │ │ │ │ │ +template │ │ │ │ │ +FieldVector< CoordType, dimension > Dune::RefinementImp:: │ │ │ │ │ + PyramidTriangulation::transformCoordinate │ │ │ │ │ + (FieldVector< CoordType, dimension > │ │ │ │ │ + point) │ │ │ │ │   │ │ │ │ │ -***** Detailed Description ***** │ │ │ │ │ -Interface for quadrature points and rules │ │ │ │ │ ***** Macro Definition Documentation ***** │ │ │ │ │ -***** ◆ DUNE_INCLUDING_IMPLEMENTATION ***** │ │ │ │ │ -#define DUNE_INCLUDING_IMPLEMENTATION │ │ │ │ │ +***** ◆ DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC ***** │ │ │ │ │ +#define DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00224_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: quadraturerules.hh Source File │ │ │ │ +dune-geometry: pyramidtriangulation.cc Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,478 +70,523 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
quadraturerules.hh
│ │ │ │ +
pyramidtriangulation.cc
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
│ │ │ │ -
5
│ │ │ │ -
6#ifndef DUNE_GEOMETRY_QUADRATURERULES_HH
│ │ │ │ -
7#define DUNE_GEOMETRY_QUADRATURERULES_HH
│ │ │ │ -
8
│ │ │ │ -
9#include <algorithm>
│ │ │ │ -
10#include <iostream>
│ │ │ │ -
11#include <limits>
│ │ │ │ -
12#include <mutex>
│ │ │ │ -
13#include <utility>
│ │ │ │ -
14#include <vector>
│ │ │ │ -
15
│ │ │ │ -
16#include <dune/common/fvector.hh>
│ │ │ │ -
17#include <dune/common/exceptions.hh>
│ │ │ │ -
18#include <dune/common/stdstreams.hh>
│ │ │ │ -
19#include <dune/common/stdthread.hh>
│ │ │ │ -
20#include <dune/common/visibility.hh>
│ │ │ │ -
21
│ │ │ │ -
22#include <dune/geometry/type.hh>
│ │ │ │ - │ │ │ │ -
24
│ │ │ │ -
30namespace Dune {
│ │ │ │ -
31
│ │ │ │ -
36 class QuadratureOrderOutOfRange : public NotImplemented {};
│ │ │ │ -
37
│ │ │ │ -
43 template<typename ct, int dim>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
45 public:
│ │ │ │ -
47 constexpr static int dimension = dim;
│ │ │ │ -
48
│ │ │ │ -
50 typedef ct Field;
│ │ │ │ -
51
│ │ │ │ -
53 typedef Dune::FieldVector<ct,dim> Vector;
│ │ │ │ -
54
│ │ │ │ -
│ │ │ │ -
56 QuadraturePoint (const Vector& x, ct w) : local(x)
│ │ │ │ -
57 {
│ │ │ │ -
58 weight_ = w;
│ │ │ │ -
59 }
│ │ │ │ -
│ │ │ │ -
60
│ │ │ │ -
│ │ │ │ -
62 const Vector& position () const
│ │ │ │ -
63 {
│ │ │ │ -
64 return local;
│ │ │ │ -
65 }
│ │ │ │ -
│ │ │ │ -
66
│ │ │ │ -
│ │ │ │ -
68 const ct &weight () const
│ │ │ │ -
69 {
│ │ │ │ -
70 return weight_;
│ │ │ │ -
71 }
│ │ │ │ -
│ │ │ │ -
72
│ │ │ │ -
73 protected:
│ │ │ │ -
74 FieldVector<ct, dim> local;
│ │ │ │ - │ │ │ │ -
76 };
│ │ │ │ -
│ │ │ │ -
77
│ │ │ │ -
│ │ │ │ -
81 namespace QuadratureType {
│ │ │ │ -
│ │ │ │ -
82 enum Enum {
│ │ │ │ - │ │ │ │ -
93
│ │ │ │ - │ │ │ │ -
100
│ │ │ │ - │ │ │ │ -
107
│ │ │ │ - │ │ │ │ -
120
│ │ │ │ - │ │ │ │ -
128
│ │ │ │ - │ │ │ │ -
136
│ │ │ │ - │ │ │ │ -
145 size
│ │ │ │ -
146 };
│ │ │ │ -
│ │ │ │ -
147 }
│ │ │ │ -
│ │ │ │ -
148
│ │ │ │ -
152 template<typename ct, int dim>
│ │ │ │ -
│ │ │ │ -
153 class QuadratureRule : public std::vector<QuadraturePoint<ct,dim> >
│ │ │ │ -
154 {
│ │ │ │ -
155 public:
│ │ │ │ - │ │ │ │ -
162
│ │ │ │ -
163 protected:
│ │ │ │ - │ │ │ │ -
166
│ │ │ │ - │ │ │ │ -
169 public:
│ │ │ │ -
171 constexpr static int d = dim;
│ │ │ │ -
172
│ │ │ │ -
174 typedef ct CoordType;
│ │ │ │ +
5#ifndef DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC
│ │ │ │ +
6#define DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC
│ │ │ │ +
7
│ │ │ │ +
8#include <dune/common/fvector.hh>
│ │ │ │ +
9#include <dune/common/typetraits.hh>
│ │ │ │ +
10
│ │ │ │ + │ │ │ │ +
12#include <dune/geometry/type.hh>
│ │ │ │ +
13
│ │ │ │ +
14#include "base.cc"
│ │ │ │ +
15#include "simplex.cc"
│ │ │ │ +
16
│ │ │ │ +
17namespace Dune
│ │ │ │ +
18{
│ │ │ │ +
19 namespace RefinementImp
│ │ │ │ +
20 {
│ │ │ │ +
│ │ │ │ +
26 namespace PyramidTriangulation
│ │ │ │ +
27 {
│ │ │ │ +
28 // ////////////
│ │ │ │ +
29 //
│ │ │ │ +
30 // Utilities
│ │ │ │ +
31 //
│ │ │ │ +
32
│ │ │ │ + │ │ │ │ + │ │ │ │ +
35
│ │ │ │ +
36 // ////////////////////////////////////
│ │ │ │ +
37 //
│ │ │ │ +
38 // Refine a pyramid with simplices
│ │ │ │ +
39 //
│ │ │ │ +
40
│ │ │ │ +
41 // forward declaration of the iterator base
│ │ │ │ +
42 template<int dimension, class CoordType, int codimension>
│ │ │ │ + │ │ │ │ +
44
│ │ │ │ +
45 /*
│ │ │ │ +
46 * The permutations 0 and 1 of the Kuhn-decomposition of a cube into simplices form a pyramid.
│ │ │ │ +
47 * The resulting pyramid is not oriented the same as the reference pyramid and so the Kuhn-coordinates
│ │ │ │ +
48 * have to be transformed using the method below.
│ │ │ │ +
49 */
│ │ │ │ +
50 template<int dimension, class CoordType> FieldVector<CoordType, dimension>
│ │ │ │ +
│ │ │ │ +
51 transformCoordinate( FieldVector<CoordType, dimension> point)
│ │ │ │ +
52 {
│ │ │ │ +
53 FieldVector<CoordType, dimension> transform;
│ │ │ │ +
54 transform[0]=1-point[0];
│ │ │ │ +
55 transform[1]=1-point[1];
│ │ │ │ +
56 transform[2]=point[2];
│ │ │ │ +
57 return transform;
│ │ │ │ +
58 }
│ │ │ │ +
│ │ │ │ +
59
│ │ │ │ +
66 template<int dimension_, class CoordType>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
68 {
│ │ │ │ +
69 public:
│ │ │ │ +
70 constexpr static int dimension = dimension_;
│ │ │ │ +
71
│ │ │ │ +
72 typedef CoordType ctype;
│ │ │ │ +
73
│ │ │ │ +
74 template<int codimension>
│ │ │ │ +
75 struct Codim;
│ │ │ │ + │ │ │ │ +
77 typedef FieldVector<CoordType, dimension> CoordVector;
│ │ │ │ + │ │ │ │ +
79 typedef FieldVector<int, dimension+1> IndexVector;
│ │ │ │ +
80
│ │ │ │ +
81 static int nVertices(int nIntervals);
│ │ │ │ +
82 static VertexIterator vBegin(int nIntervals);
│ │ │ │ +
83 static VertexIterator vEnd(int nIntervals);
│ │ │ │ +
84
│ │ │ │ +
85 static int nElements(int nIntervals);
│ │ │ │ +
86 static ElementIterator eBegin(int nIntervals);
│ │ │ │ +
87 static ElementIterator eEnd(int nIntervals);
│ │ │ │ +
88
│ │ │ │ +
89 private:
│ │ │ │ +
90 friend class RefinementIteratorSpecial<dimension, CoordType, 0>;
│ │ │ │ +
91 friend class RefinementIteratorSpecial<dimension, CoordType, dimension>;
│ │ │ │ +
92
│ │ │ │ + │ │ │ │ +
94
│ │ │ │ +
95 constexpr static int nKuhnSimplices = 2;
│ │ │ │ +
96 };
│ │ │ │ +
│ │ │ │ +
97
│ │ │ │ +
98 template<int dimension, class CoordType>
│ │ │ │ +
99 template<int codimension>
│ │ │ │ +
│ │ │ │ +
100 struct RefinementImp<dimension, CoordType>::Codim
│ │ │ │ +
101 {
│ │ │ │ +
102 class SubEntityIterator;
│ │ │ │ + │ │ │ │ +
104 };
│ │ │ │ +
│ │ │ │ +
105
│ │ │ │ +
106 template<int dimension, class CoordType>
│ │ │ │ +
107 int
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
109 nVertices(int nIntervals)
│ │ │ │ +
110 {
│ │ │ │ +
111 return BackendRefinement::nVertices(nIntervals) * nKuhnSimplices;
│ │ │ │ +
112 }
│ │ │ │ +
│ │ │ │ +
113
│ │ │ │ +
114 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
117 vBegin(int nIntervals)
│ │ │ │ +
118 {
│ │ │ │ +
119 return VertexIterator(nIntervals);
│ │ │ │ +
120 }
│ │ │ │ +
│ │ │ │ +
121
│ │ │ │ +
122 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
125 vEnd(int nIntervals)
│ │ │ │ +
126 {
│ │ │ │ +
127 return VertexIterator(nIntervals, true);
│ │ │ │ +
128 }
│ │ │ │ +
│ │ │ │ +
129
│ │ │ │ +
130 template<int dimension, class CoordType>
│ │ │ │ +
131 int
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
133 nElements(int nIntervals)
│ │ │ │ +
134 {
│ │ │ │ +
135 return BackendRefinement::nElements(nIntervals) * nKuhnSimplices;
│ │ │ │ +
136 }
│ │ │ │ +
│ │ │ │ +
137
│ │ │ │ +
138 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
141 eBegin(int nIntervals)
│ │ │ │ +
142 {
│ │ │ │ +
143 return ElementIterator(nIntervals);
│ │ │ │ +
144 }
│ │ │ │ +
│ │ │ │ +
145
│ │ │ │ +
146 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
149 eEnd(int nIntervals)
│ │ │ │ +
150 {
│ │ │ │ +
151 return ElementIterator(nIntervals, true);
│ │ │ │ +
152 }
│ │ │ │ +
│ │ │ │ +
153
│ │ │ │ +
154 // //////////////
│ │ │ │ +
155 //
│ │ │ │ +
156 // The iterator
│ │ │ │ +
157 //
│ │ │ │ +
158
│ │ │ │ +
159 // vertices
│ │ │ │ +
160 template<int dimension, class CoordType>
│ │ │ │ +
│ │ │ │ +
161 class RefinementIteratorSpecial<dimension, CoordType, dimension>
│ │ │ │ +
162 {
│ │ │ │ +
163 public:
│ │ │ │ + │ │ │ │ +
165 typedef typename Refinement::CoordVector CoordVector;
│ │ │ │ +
166 typedef typename Refinement::template Codim<dimension>::Geometry Geometry;
│ │ │ │ +
167
│ │ │ │ +
168 RefinementIteratorSpecial(int nIntervals, bool end = false);
│ │ │ │ +
169
│ │ │ │ +
170 void increment();
│ │ │ │ +
171
│ │ │ │ +
172 CoordVector coords() const;
│ │ │ │ +
173
│ │ │ │ +
174 Geometry geometry() const;
│ │ │ │
175
│ │ │ │ -
177 virtual int order () const { return delivered_order; }
│ │ │ │ -
178
│ │ │ │ -
180 virtual GeometryType type () const { return geometry_type; }
│ │ │ │ -
181 virtual ~QuadratureRule(){}
│ │ │ │ -
182
│ │ │ │ -
185 typedef typename std::vector<QuadraturePoint<ct,dim> >::const_iterator iterator;
│ │ │ │ -
186
│ │ │ │ -
187 protected:
│ │ │ │ - │ │ │ │ - │ │ │ │ -
190 };
│ │ │ │ -
│ │ │ │ -
191
│ │ │ │ -
192 // Forward declaration of the factory class,
│ │ │ │ -
193 // needed internally by the QuadratureRules container class.
│ │ │ │ -
194 template<typename ctype, int dim> class QuadratureRuleFactory;
│ │ │ │ -
195
│ │ │ │ -
199 template<typename ctype, int dim>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
201
│ │ │ │ - │ │ │ │ -
204
│ │ │ │ -
205 // indexed by quadrature order
│ │ │ │ -
206 using QuadratureOrderVector = std::vector<std::pair<std::once_flag, QuadratureRule> >;
│ │ │ │ -
207
│ │ │ │ -
208 // indexed by geometry type
│ │ │ │ -
209 using GeometryTypeVector = std::vector<std::pair<std::once_flag, QuadratureOrderVector> >;
│ │ │ │ -
210
│ │ │ │ -
211 // indexed by quadrature type enum
│ │ │ │ -
212 using QuadratureCacheVector = std::vector<std::pair<std::once_flag, GeometryTypeVector> >;
│ │ │ │ -
213
│ │ │ │ -
215 DUNE_EXPORT const QuadratureRule& _rule(const GeometryType& t, int p, QuadratureType::Enum qt=QuadratureType::GaussLegendre) const
│ │ │ │ -
216 {
│ │ │ │ -
217 assert(t.dim()==dim);
│ │ │ │ -
218
│ │ │ │ -
219 DUNE_ASSERT_CALL_ONCE();
│ │ │ │ -
220
│ │ │ │ -
221 static QuadratureCacheVector quadratureCache(QuadratureType::size);
│ │ │ │ -
222
│ │ │ │ -
223 auto& [ onceFlagQuadratureType, geometryTypes ] = quadratureCache[qt];
│ │ │ │ -
224 // initialize geometry types for this quadrature type once
│ │ │ │ -
225 std::call_once(onceFlagQuadratureType, [&types = geometryTypes]{
│ │ │ │ -
226 types = GeometryTypeVector(LocalGeometryTypeIndex::size(dim));
│ │ │ │ -
227 });
│ │ │ │ -
228
│ │ │ │ -
229 auto& [ onceFlagGeometryType, quadratureOrders ] = geometryTypes[LocalGeometryTypeIndex::index(t)];
│ │ │ │ -
230 // initialize quadrature orders for this geometry type and quadrature type once
│ │ │ │ -
231 std::call_once(onceFlagGeometryType, [&, &orders = quadratureOrders]{
│ │ │ │ -
232 // we only need one quadrature rule for points, not maxint
│ │ │ │ -
233 const auto numRules = dim == 0 ? 1 : QuadratureRuleFactory<ctype,dim>::maxOrder(t, qt)+1;
│ │ │ │ -
234 orders = QuadratureOrderVector(numRules);
│ │ │ │ -
235 });
│ │ │ │ -
236
│ │ │ │ -
237 // we only have one quadrature rule for points
│ │ │ │ -
238 auto& [ onceFlagQuadratureOrder, quadratureRule ] = quadratureOrders[dim == 0 ? 0 : p];
│ │ │ │ -
239 // initialize quadrature rule once
│ │ │ │ -
240 std::call_once(onceFlagQuadratureOrder, [&, &rule = quadratureRule]{
│ │ │ │ - │ │ │ │ -
242 });
│ │ │ │ -
243
│ │ │ │ -
244 return quadratureRule;
│ │ │ │ -
245 }
│ │ │ │ -
246
│ │ │ │ -
248 DUNE_EXPORT static QuadratureRules& instance()
│ │ │ │ -
249 {
│ │ │ │ -
250 static QuadratureRules instance;
│ │ │ │ -
251 return instance;
│ │ │ │ -
252 }
│ │ │ │ -
253
│ │ │ │ -
255 QuadratureRules () = default;
│ │ │ │ -
256 public:
│ │ │ │ -
258 static unsigned
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ -
261 {
│ │ │ │ - │ │ │ │ -
263 }
│ │ │ │ -
│ │ │ │ -
264
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
267 {
│ │ │ │ -
268 return instance()._rule(t,p,qt);
│ │ │ │ -
269 }
│ │ │ │ -
│ │ │ │ -
270
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
273 {
│ │ │ │ -
274 GeometryType gt(t,dim);
│ │ │ │ -
275 return instance()._rule(gt,p,qt);
│ │ │ │ -
276 }
│ │ │ │ -
│ │ │ │ -
277 };
│ │ │ │ -
│ │ │ │ -
278
│ │ │ │ -
279} // end namespace Dune
│ │ │ │ -
280
│ │ │ │ -
281#define DUNE_INCLUDING_IMPLEMENTATION
│ │ │ │ -
282
│ │ │ │ -
283// 0d rules
│ │ │ │ -
284#include "quadraturerules/pointquadrature.hh"
│ │ │ │ -
285// 1d rules
│ │ │ │ -
286#include "quadraturerules/gausslobattoquadrature.hh"
│ │ │ │ -
287#include "quadraturerules/gaussquadrature.hh"
│ │ │ │ -
288#include "quadraturerules/gaussradauleftquadrature.hh"
│ │ │ │ -
289#include "quadraturerules/gaussradaurightquadrature.hh"
│ │ │ │ -
290#include "quadraturerules/jacobi1quadrature.hh"
│ │ │ │ -
291#include "quadraturerules/jacobi2quadrature.hh"
│ │ │ │ -
292#include "quadraturerules/jacobiNquadrature.hh"
│ │ │ │ -
293// 3d rules
│ │ │ │ -
294#include "quadraturerules/prismquadrature.hh"
│ │ │ │ -
295// general rules
│ │ │ │ -
296#include "quadraturerules/simplexquadrature.hh"
│ │ │ │ -
297#include "quadraturerules/tensorproductquadrature.hh"
│ │ │ │ -
298
│ │ │ │ -
299#undef DUNE_INCLUDING_IMPLEMENTATION
│ │ │ │ -
300
│ │ │ │ -
301namespace Dune {
│ │ │ │ -
302
│ │ │ │ -
309 template<typename ctype, int dim>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
311 private:
│ │ │ │ -
312 friend class QuadratureRules<ctype, dim>;
│ │ │ │ -
313 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum qt)
│ │ │ │ -
314 {
│ │ │ │ -
315 return TensorProductQuadratureRule<ctype,dim>::maxOrder(t.id(), qt);
│ │ │ │ -
316 }
│ │ │ │ -
317 static QuadratureRule<ctype, dim> rule(const GeometryType& t, int p, QuadratureType::Enum qt)
│ │ │ │ -
318 {
│ │ │ │ -
319 return TensorProductQuadratureRule<ctype,dim>(t.id(), p, qt);
│ │ │ │ -
320 }
│ │ │ │ -
321 };
│ │ │ │ -
│ │ │ │ -
322
│ │ │ │ -
323 template<typename ctype>
│ │ │ │ -
│ │ │ │ -
324 class QuadratureRuleFactory<ctype, 0> {
│ │ │ │ -
325 private:
│ │ │ │ -
326 constexpr static int dim = 0;
│ │ │ │ -
327 friend class QuadratureRules<ctype, dim>;
│ │ │ │ -
328 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum)
│ │ │ │ -
329 {
│ │ │ │ -
330 if (t.isVertex())
│ │ │ │ -
331 {
│ │ │ │ -
332 return std::numeric_limits<int>::max();
│ │ │ │ -
333 }
│ │ │ │ -
334 DUNE_THROW(Exception, "Unknown GeometryType");
│ │ │ │ -
335 }
│ │ │ │ -
336 static QuadratureRule<ctype, dim> rule(const GeometryType& t, int , QuadratureType::Enum)
│ │ │ │ -
337 {
│ │ │ │ -
338 if (t.isVertex())
│ │ │ │ -
339 {
│ │ │ │ -
340 return PointQuadratureRule<ctype>();
│ │ │ │ -
341 }
│ │ │ │ -
342 DUNE_THROW(Exception, "Unknown GeometryType");
│ │ │ │ -
343 }
│ │ │ │ -
344 };
│ │ │ │ -
│ │ │ │ -
345
│ │ │ │ -
346 template<typename ctype>
│ │ │ │ -
│ │ │ │ -
347 class QuadratureRuleFactory<ctype, 1> {
│ │ │ │ -
348 private:
│ │ │ │ -
349 constexpr static int dim = 1;
│ │ │ │ -
350 friend class QuadratureRules<ctype, dim>;
│ │ │ │ -
351 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum qt)
│ │ │ │ -
352 {
│ │ │ │ -
353 if (t.isLine())
│ │ │ │ -
354 {
│ │ │ │ -
355 switch (qt) {
│ │ │ │ - │ │ │ │ -
357 return GaussQuadratureRule1D<ctype>::highest_order;
│ │ │ │ - │ │ │ │ -
359 return Jacobi1QuadratureRule1D<ctype>::highest_order;
│ │ │ │ - │ │ │ │ -
361 return Jacobi2QuadratureRule1D<ctype>::highest_order;
│ │ │ │ - │ │ │ │ -
363 return GaussLobattoQuadratureRule1D<ctype>::highest_order;
│ │ │ │ - │ │ │ │ -
365 return JacobiNQuadratureRule1D<ctype>::maxOrder();
│ │ │ │ - │ │ │ │ -
367 return GaussRadauLeftQuadratureRule1D<ctype>::highest_order;
│ │ │ │ - │ │ │ │ -
369 return GaussRadauRightQuadratureRule1D<ctype>::highest_order;
│ │ │ │ -
370 default :
│ │ │ │ -
371 DUNE_THROW(Exception, "Unknown QuadratureType");
│ │ │ │ -
372 }
│ │ │ │ -
373 }
│ │ │ │ -
374 DUNE_THROW(Exception, "Unknown GeometryType");
│ │ │ │ -
375 }
│ │ │ │ -
376 static QuadratureRule<ctype, dim> rule(const GeometryType& t, int p, QuadratureType::Enum qt)
│ │ │ │ -
377 {
│ │ │ │ -
378 if (t.isLine())
│ │ │ │ -
379 {
│ │ │ │ -
380 switch (qt) {
│ │ │ │ - │ │ │ │ -
382 return GaussQuadratureRule1D<ctype>(p);
│ │ │ │ - │ │ │ │ -
384 return Jacobi1QuadratureRule1D<ctype>(p);
│ │ │ │ - │ │ │ │ -
386 return Jacobi2QuadratureRule1D<ctype>(p);
│ │ │ │ - │ │ │ │ -
388 return GaussLobattoQuadratureRule1D<ctype>(p);
│ │ │ │ - │ │ │ │ -
390 return JacobiNQuadratureRule1D<ctype>(p);
│ │ │ │ - │ │ │ │ -
392 return GaussRadauLeftQuadratureRule1D<ctype>(p);
│ │ │ │ - │ │ │ │ -
394 return GaussRadauRightQuadratureRule1D<ctype>(p);
│ │ │ │ -
395 default :
│ │ │ │ -
396 DUNE_THROW(Exception, "Unknown QuadratureType");
│ │ │ │ -
397 }
│ │ │ │ -
398 }
│ │ │ │ -
399 DUNE_THROW(Exception, "Unknown GeometryType");
│ │ │ │ -
400 }
│ │ │ │ -
401 };
│ │ │ │ -
│ │ │ │ -
402
│ │ │ │ -
403 template<typename ctype>
│ │ │ │ -
│ │ │ │ -
404 class QuadratureRuleFactory<ctype, 2> {
│ │ │ │ -
405 private:
│ │ │ │ -
406 constexpr static int dim = 2;
│ │ │ │ -
407 friend class QuadratureRules<ctype, dim>;
│ │ │ │ -
408 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum qt)
│ │ │ │ -
409 {
│ │ │ │ -
410 unsigned order =
│ │ │ │ -
411 TensorProductQuadratureRule<ctype,dim>::maxOrder(t.id(), qt);
│ │ │ │ -
412 if (t.isSimplex())
│ │ │ │ -
413 order = std::max
│ │ │ │ -
414 (order, unsigned(SimplexQuadratureRule<ctype,dim>::highest_order));
│ │ │ │ -
415 return order;
│ │ │ │ -
416 }
│ │ │ │ -
417 static QuadratureRule<ctype, dim> rule(const GeometryType& t, int p, QuadratureType::Enum qt)
│ │ │ │ -
418 {
│ │ │ │ -
419 if (t.isSimplex()
│ │ │ │ - │ │ │ │ -
421 && p <= SimplexQuadratureRule<ctype,dim>::highest_order)
│ │ │ │ -
422 {
│ │ │ │ -
423 return SimplexQuadratureRule<ctype,dim>(p);
│ │ │ │ -
424 }
│ │ │ │ -
425 return TensorProductQuadratureRule<ctype,dim>(t.id(), p, qt);
│ │ │ │ -
426 }
│ │ │ │ -
427 };
│ │ │ │ -
│ │ │ │ -
428
│ │ │ │ -
429 template<typename ctype>
│ │ │ │ -
│ │ │ │ -
430 class QuadratureRuleFactory<ctype, 3> {
│ │ │ │ -
431 private:
│ │ │ │ -
432 constexpr static int dim = 3;
│ │ │ │ -
433 friend class QuadratureRules<ctype, dim>;
│ │ │ │ -
434 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum qt)
│ │ │ │ -
435 {
│ │ │ │ -
436 unsigned order =
│ │ │ │ -
437 TensorProductQuadratureRule<ctype,dim>::maxOrder(t.id(), qt);
│ │ │ │ -
438 if (t.isSimplex())
│ │ │ │ -
439 order = std::max
│ │ │ │ -
440 (order, unsigned(SimplexQuadratureRule<ctype,dim>::highest_order));
│ │ │ │ -
441 if (t.isPrism())
│ │ │ │ -
442 order = std::max
│ │ │ │ -
443 (order, unsigned(PrismQuadratureRule<ctype,dim>::highest_order));
│ │ │ │ -
444 return order;
│ │ │ │ -
445 }
│ │ │ │ -
446 static QuadratureRule<ctype, dim> rule(const GeometryType& t, int p, QuadratureType::Enum qt)
│ │ │ │ -
447 {
│ │ │ │ -
448
│ │ │ │ -
449 if (t.isSimplex()
│ │ │ │ - │ │ │ │ -
451 && p <= SimplexQuadratureRule<ctype,dim>::highest_order)
│ │ │ │ -
452 {
│ │ │ │ -
453 return SimplexQuadratureRule<ctype,dim>(p);
│ │ │ │ -
454 }
│ │ │ │ -
455 if (t.isPrism()
│ │ │ │ - │ │ │ │ -
457 && p <= PrismQuadratureRule<ctype,dim>::highest_order)
│ │ │ │ -
458 {
│ │ │ │ -
459 return PrismQuadratureRule<ctype,dim>(p);
│ │ │ │ -
460 }
│ │ │ │ -
461 return TensorProductQuadratureRule<ctype,dim>(t.id(), p, qt);
│ │ │ │ -
462 }
│ │ │ │ -
463 };
│ │ │ │ -
│ │ │ │ -
464
│ │ │ │ -
465#ifndef DUNE_NO_EXTERN_QUADRATURERULES
│ │ │ │ -
466 extern template class GaussLobattoQuadratureRule<double, 1>;
│ │ │ │ -
467 extern template class GaussQuadratureRule<double, 1>;
│ │ │ │ -
468 extern template class GaussRadauLeftQuadratureRule<double, 1>;
│ │ │ │ -
469 extern template class GaussRadauRightQuadratureRule<double, 1>;
│ │ │ │ -
470 extern template class Jacobi1QuadratureRule<double, 1>;
│ │ │ │ -
471 extern template class Jacobi2QuadratureRule<double, 1>;
│ │ │ │ -
472 extern template class JacobiNQuadratureRule<double, 1>;
│ │ │ │ -
473 extern template class PrismQuadratureRule<double, 3>;
│ │ │ │ -
474 extern template class SimplexQuadratureRule<double, 2>;
│ │ │ │ -
475 extern template class SimplexQuadratureRule<double, 3>;
│ │ │ │ -
476#endif // !DUNE_NO_EXTERN_QUADRATURERULES
│ │ │ │ -
477
│ │ │ │ -
478} // end namespace
│ │ │ │ -
479
│ │ │ │ -
480#endif // DUNE_GEOMETRY_QUADRATURERULES_HH
│ │ │ │ -
Helper classes to provide indices for geometrytypes for use in a vector.
│ │ │ │ -
A unique label for each type of element that can occur in a grid.
│ │ │ │ +
176 int index() const;
│ │ │ │ +
177 protected:
│ │ │ │ +
178 typedef typename Refinement::BackendRefinement BackendRefinement;
│ │ │ │ +
179 typedef typename BackendRefinement::template Codim<dimension>::SubEntityIterator BackendIterator;
│ │ │ │ +
180 constexpr static int nKuhnSimplices = 2;
│ │ │ │ +
181
│ │ │ │ + │ │ │ │ +
183
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
187 };
│ │ │ │ +
│ │ │ │ +
188
│ │ │ │ +
189 template<int dimension, class CoordType>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
191 RefinementIteratorSpecial(int nIntervals, bool end)
│ │ │ │ +
192 : nIntervals_(nIntervals), kuhnIndex(0),
│ │ │ │ +
193 backend(BackendRefinement::vBegin(nIntervals_)),
│ │ │ │ +
194 backendEnd(BackendRefinement::vEnd(nIntervals_))
│ │ │ │ +
195 {
│ │ │ │ +
196 if (end)
│ │ │ │ +
197 kuhnIndex = nKuhnSimplices;
│ │ │ │ +
198 }
│ │ │ │ +
│ │ │ │ +
199
│ │ │ │ +
200 template<int dimension, class CoordType>
│ │ │ │ +
201 void
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ +
204 {
│ │ │ │ +
205 ++backend;
│ │ │ │ +
206 if(backend == backendEnd)
│ │ │ │ +
207 {
│ │ │ │ +
208 backend = BackendRefinement::vBegin(nIntervals_);
│ │ │ │ +
209 ++kuhnIndex;
│ │ │ │ +
210 }
│ │ │ │ +
211 }
│ │ │ │ +
│ │ │ │ +
212
│ │ │ │ +
213 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
216 coords() const
│ │ │ │ +
217 {
│ │ │ │ +
218 return transformCoordinate(referenceToKuhn(backend.coords(),
│ │ │ │ +
219 getPermutation<dimension>(kuhnIndex)));
│ │ │ │ +
220 }
│ │ │ │ +
│ │ │ │ +
221
│ │ │ │ +
222 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
225 {
│ │ │ │ +
226 std::vector<CoordVector> corners(1);
│ │ │ │ +
227 corners[0] = referenceToKuhn(backend.coords(), getPermutation<dimension>(kuhnIndex));
│ │ │ │ +
228 return Geometry(GeometryTypes::vertex, corners);
│ │ │ │ +
229 }
│ │ │ │ +
│ │ │ │ +
230
│ │ │ │ +
231 template<int dimension, class CoordType>
│ │ │ │ +
232 int
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
234 index() const
│ │ │ │ +
235 {
│ │ │ │ +
236 return kuhnIndex*BackendRefinement::nVertices(nIntervals_) + backend.index();
│ │ │ │ +
237 }
│ │ │ │ +
│ │ │ │ +
238
│ │ │ │ +
239 // elements
│ │ │ │ +
240 template<int dimension, class CoordType>
│ │ │ │ +
│ │ │ │ +
241 class RefinementIteratorSpecial<dimension, CoordType, 0>
│ │ │ │ +
242 {
│ │ │ │ +
243 public:
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
247 typedef typename Refinement::template Codim<0>::Geometry Geometry;
│ │ │ │ +
248
│ │ │ │ +
249 RefinementIteratorSpecial(int nIntervals, bool end = false);
│ │ │ │ +
250
│ │ │ │ +
251 void increment();
│ │ │ │ +
252
│ │ │ │ +
253 IndexVector vertexIndices() const;
│ │ │ │ +
254 int index() const;
│ │ │ │ +
255 CoordVector coords() const;
│ │ │ │ +
256
│ │ │ │ +
257 Geometry geometry() const;
│ │ │ │ +
258
│ │ │ │ +
259 private:
│ │ │ │ +
260 CoordVector global(const CoordVector &local) const;
│ │ │ │ +
261
│ │ │ │ +
262 protected:
│ │ │ │ + │ │ │ │ +
264 typedef typename BackendRefinement::template Codim<0>::SubEntityIterator BackendIterator;
│ │ │ │ +
265 constexpr static int nKuhnSimplices = 2;
│ │ │ │ +
266
│ │ │ │ + │ │ │ │ +
268
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
272 };
│ │ │ │ +
│ │ │ │ +
273
│ │ │ │ +
274 template<int dimension, class CoordType>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
276 RefinementIteratorSpecial(int nIntervals, bool end)
│ │ │ │ +
277 : nIntervals_(nIntervals), kuhnIndex(0),
│ │ │ │ +
278 backend(BackendRefinement::eBegin(nIntervals_)),
│ │ │ │ +
279 backendEnd(BackendRefinement::eEnd(nIntervals_))
│ │ │ │ +
280 {
│ │ │ │ +
281 if (end)
│ │ │ │ +
282 kuhnIndex = nKuhnSimplices;
│ │ │ │ +
283 }
│ │ │ │ +
│ │ │ │ +
284
│ │ │ │ +
285 template<int dimension, class CoordType>
│ │ │ │ +
286 void
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ +
289 {
│ │ │ │ +
290 ++backend;
│ │ │ │ +
291 if (backend == backendEnd)
│ │ │ │ +
292 {
│ │ │ │ +
293 backend = BackendRefinement::eBegin(nIntervals_);
│ │ │ │ +
294 ++kuhnIndex;
│ │ │ │ +
295 }
│ │ │ │ +
296 }
│ │ │ │ +
│ │ │ │ +
297
│ │ │ │ +
298 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
301 vertexIndices() const
│ │ │ │ +
302 {
│ │ │ │ +
303 IndexVector indices = backend.vertexIndices();
│ │ │ │ +
304
│ │ │ │ +
305 int base = kuhnIndex * BackendRefinement::nVertices(nIntervals_);
│ │ │ │ +
306 indices += base;
│ │ │ │ +
307
│ │ │ │ +
308 return indices;
│ │ │ │ +
309 }
│ │ │ │ +
│ │ │ │ +
310
│ │ │ │ +
311 template<int dimension, class CoordType>
│ │ │ │ +
312 int
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
314 index() const
│ │ │ │ +
315 {
│ │ │ │ +
316 return kuhnIndex*BackendRefinement::nElements(nIntervals_) + backend.index();
│ │ │ │ +
317 }
│ │ │ │ +
│ │ │ │ +
318
│ │ │ │ +
319 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
322 coords() const
│ │ │ │ +
323 {
│ │ │ │ +
324 return global(backend.coords());
│ │ │ │ +
325 }
│ │ │ │ +
│ │ │ │ +
326
│ │ │ │ +
327 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
330 geometry() const
│ │ │ │ +
331 {
│ │ │ │ +
332 const typename BackendIterator::Geometry &
│ │ │ │ +
333 bgeo = backend.geometry();
│ │ │ │ +
334 std::vector<CoordVector> corners(dimension+1);
│ │ │ │ +
335 for(int i = 0; i <= dimension; ++i)
│ │ │ │ +
336 corners[i] = global(bgeo.corner(i));
│ │ │ │ +
337
│ │ │ │ +
338 return Geometry(bgeo.type(), corners);
│ │ │ │ +
339 }
│ │ │ │ +
│ │ │ │ +
340
│ │ │ │ +
341 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
343 CoordVector
│ │ │ │ + │ │ │ │ +
345 global(const CoordVector &local) const
│ │ │ │ +
346 {
│ │ │ │ +
347 return transformCoordinate(referenceToKuhn(local,
│ │ │ │ +
348 getPermutation<dimension>(kuhnIndex)));
│ │ │ │ +
349 }
│ │ │ │ +
350
│ │ │ │ +
351 // common
│ │ │ │ +
352 template<int dimension, class CoordType>
│ │ │ │ +
353 template<int codimension>
│ │ │ │ +
│ │ │ │ +
354 class RefinementImp<dimension, CoordType>::Codim<codimension>::SubEntityIterator
│ │ │ │ +
355 : public ForwardIteratorFacade<typename RefinementImp<dimension, CoordType>::template Codim<codimension>::SubEntityIterator, int>,
│ │ │ │ +
356 public RefinementIteratorSpecial<dimension, CoordType, codimension>
│ │ │ │ +
357 {
│ │ │ │ +
358 public:
│ │ │ │ + │ │ │ │ +
360 typedef SubEntityIterator This;
│ │ │ │ +
361
│ │ │ │ +
362 SubEntityIterator(int nIntervals, bool end = false);
│ │ │ │ +
363
│ │ │ │ +
364 bool equals(const This &other) const;
│ │ │ │ +
365 protected:
│ │ │ │ +
366 using RefinementIteratorSpecial<dimension, CoordType, codimension>::kuhnIndex;
│ │ │ │ +
367 using RefinementIteratorSpecial<dimension, CoordType, codimension>::backend;
│ │ │ │ +
368 };
│ │ │ │ +
│ │ │ │ +
369
│ │ │ │ +
370#ifndef DOXYGEN
│ │ │ │ +
371 template<int dimension, class CoordType>
│ │ │ │ +
372 template<int codimension>
│ │ │ │ + │ │ │ │ +
374 SubEntityIterator(int nIntervals, bool end)
│ │ │ │ +
375 : RefinementIteratorSpecial<dimension, CoordType, codimension>(nIntervals, end)
│ │ │ │ +
376 {}
│ │ │ │ +
377
│ │ │ │ +
378 template<int dimension, class CoordType>
│ │ │ │ +
379 template<int codimension>
│ │ │ │ +
380 bool
│ │ │ │ + │ │ │ │ +
382 equals(const This &other) const
│ │ │ │ +
383 {
│ │ │ │ +
384 return kuhnIndex == other.kuhnIndex && backend == other.backend;
│ │ │ │ +
385 }
│ │ │ │ +
386#endif
│ │ │ │ +
387
│ │ │ │ +
388 } // namespace PyramidTriangulation
│ │ │ │ +
│ │ │ │ +
389 } // namespace RefinementImp
│ │ │ │ +
390
│ │ │ │ +
391 namespace RefinementImp
│ │ │ │ +
392 {
│ │ │ │ +
393 // ///////////////////////
│ │ │ │ +
394 //
│ │ │ │ +
395 // The refinement traits
│ │ │ │ +
396 //
│ │ │ │ +
397#ifndef DOXYGEN
│ │ │ │ +
398 template<unsigned topologyId, class CoordType, unsigned coerceToId>
│ │ │ │ +
399 struct Traits<
│ │ │ │ +
400 topologyId, CoordType, coerceToId, 3,
│ │ │ │ +
401 typename std::enable_if<
│ │ │ │ +
402 (GeometryTypes::pyramid.id() >> 1) ==
│ │ │ │ +
403 (topologyId >> 1) &&
│ │ │ │ +
404 (GeometryTypes::simplex(3).id() >> 1) ==
│ │ │ │ +
405 (coerceToId >> 1)
│ │ │ │ +
406 >::type>
│ │ │ │ +
407 {
│ │ │ │ +
408 typedef PyramidTriangulation::RefinementImp<3, CoordType> Imp;
│ │ │ │ +
409 };
│ │ │ │ +
410#endif
│ │ │ │ +
411
│ │ │ │ +
412 } // namespace RefinementImp
│ │ │ │ +
413} // namespace Dune
│ │ │ │ +
414
│ │ │ │ +
415#endif // DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC
│ │ │ │ + │ │ │ │ +
A unique label for each type of element that can occur in a grid.
│ │ │ │ +
This file contains the parts independent of a particular Refinement implementation.
│ │ │ │ +
This file contains the Refinement implementation for simplices (triangles, tetrahedrons....
│ │ │ │
Definition affinegeometry.hh:21
│ │ │ │ -
Enum
Definition quadraturerules.hh:82
│ │ │ │ -
@ GaussJacobi_n_0
Gauss-Legendre rules with .
Definition quadraturerules.hh:119
│ │ │ │ -
@ GaussJacobi_2_0
Gauss-Legendre rules with .
Definition quadraturerules.hh:106
│ │ │ │ -
@ GaussRadauRight
Gauss-Radau rules including the right endpoint.
Definition quadraturerules.hh:144
│ │ │ │ -
@ GaussJacobi_1_0
Gauss-Jacobi rules with .
Definition quadraturerules.hh:99
│ │ │ │ -
@ size
Definition quadraturerules.hh:145
│ │ │ │ -
@ GaussLobatto
Gauss-Lobatto rules.
Definition quadraturerules.hh:127
│ │ │ │ -
@ GaussRadauLeft
Gauss-Radau rules including the left endpoint.
Definition quadraturerules.hh:135
│ │ │ │ -
@ GaussLegendre
Gauss-Legendre rules (default)
Definition quadraturerules.hh:92
│ │ │ │ -
Exception thrown if a desired QuadratureRule is not available, because the requested order is to high...
Definition quadraturerules.hh:36
│ │ │ │ -
Single evaluation point in a quadrature rule.
Definition quadraturerules.hh:44
│ │ │ │ -
const Vector & position() const
return local coordinates of integration point i
Definition quadraturerules.hh:62
│ │ │ │ -
Dune::FieldVector< ct, dim > Vector
Type used for the position of a quadrature point.
Definition quadraturerules.hh:53
│ │ │ │ -
ct Field
Number type used for coordinates and quadrature weights.
Definition quadraturerules.hh:50
│ │ │ │ -
const ct & weight() const
return weight associated with integration point i
Definition quadraturerules.hh:68
│ │ │ │ -
ct weight_
Definition quadraturerules.hh:75
│ │ │ │ -
static constexpr int dimension
Dimension of the integration domain.
Definition quadraturerules.hh:47
│ │ │ │ -
QuadraturePoint(const Vector &x, ct w)
set up quadrature of given order in d dimensions
Definition quadraturerules.hh:56
│ │ │ │ -
FieldVector< ct, dim > local
Definition quadraturerules.hh:74
│ │ │ │ -
Abstract base class for quadrature rules.
Definition quadraturerules.hh:154
│ │ │ │ -
virtual ~QuadratureRule()
Definition quadraturerules.hh:181
│ │ │ │ -
static constexpr int d
The space dimension.
Definition quadraturerules.hh:171
│ │ │ │ -
virtual GeometryType type() const
return type of element
Definition quadraturerules.hh:180
│ │ │ │ -
int delivered_order
Definition quadraturerules.hh:189
│ │ │ │ -
QuadratureRule(GeometryType t, int order)
Constructor for a given geometry type and a given quadrature order.
Definition quadraturerules.hh:168
│ │ │ │ -
GeometryType geometry_type
Definition quadraturerules.hh:188
│ │ │ │ -
ct CoordType
The type used for coordinates.
Definition quadraturerules.hh:174
│ │ │ │ -
QuadratureRule()
Default constructor.
Definition quadraturerules.hh:161
│ │ │ │ -
virtual int order() const
return order
Definition quadraturerules.hh:177
│ │ │ │ -
QuadratureRule(GeometryType t)
Constructor for a given geometry type. Leaves the quadrature order invalid
Definition quadraturerules.hh:165
│ │ │ │ -
std::vector< QuadraturePoint< ct, dim > >::const_iterator iterator
Definition quadraturerules.hh:185
│ │ │ │ -
Factory class for creation of quadrature rules, depending on GeometryType, order and QuadratureType.
Definition quadraturerules.hh:310
│ │ │ │ -
A container for all quadrature rules of dimension dim
Definition quadraturerules.hh:200
│ │ │ │ -
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
│ │ │ │ -
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
│ │ │ │ -
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
│ │ │ │ -
Unique label for each type of entities that can occur in DUNE grids.
Definition type.hh:126
│ │ │ │ -
constexpr bool isPrism() const
Return true if entity is a prism.
Definition type.hh:321
│ │ │ │ -
constexpr bool isVertex() const
Return true if entity is a vertex.
Definition type.hh:291
│ │ │ │ -
constexpr unsigned int dim() const
Return dimension of the type.
Definition type.hh:372
│ │ │ │ -
BasicType
Each entity can be tagged by one of these basic types plus its space dimension.
Definition type.hh:132
│ │ │ │ -
constexpr bool isLine() const
Return true if entity is a line segment.
Definition type.hh:296
│ │ │ │ -
constexpr unsigned int id() const
Return the topology id of the type.
Definition type.hh:377
│ │ │ │ -
constexpr bool isSimplex() const
Return true if entity is a simplex of any dimension.
Definition type.hh:331
│ │ │ │ -
static constexpr std::size_t size(std::size_t dim)
Compute total number of geometry types for the given dimension.
Definition typeindex.hh:61
│ │ │ │ -
static constexpr std::size_t index(const GeometryType &gt)
Compute the index for the given geometry type within its dimension.
Definition typeindex.hh:73
│ │ │ │ +
FieldVector< CoordType, dimension > transformCoordinate(FieldVector< CoordType, dimension > point)
Definition pyramidtriangulation.cc:51
│ │ │ │ +
FieldVector< int, n > getPermutation(int m)
Calculate permutation from it's index.
Definition simplex.cc:336
│ │ │ │ +
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
│ │ │ │ +
Static tag representing a codimension.
Definition dimension.hh:24
│ │ │ │ +
generic geometry implementation based on corner coordinates
Definition multilineargeometry.hh:181
│ │ │ │ + │ │ │ │ +
Implementation of the refinement of a pyramid into simplices.
Definition pyramidtriangulation.cc:68
│ │ │ │ +
FieldVector< CoordType, dimension > CoordVector
Definition pyramidtriangulation.cc:77
│ │ │ │ +
static int nVertices(int nIntervals)
Definition pyramidtriangulation.cc:109
│ │ │ │ +
static int nElements(int nIntervals)
Definition pyramidtriangulation.cc:133
│ │ │ │ +
CoordType ctype
Definition pyramidtriangulation.cc:72
│ │ │ │ +
Codim< dimension >::SubEntityIterator VertexIterator
Definition pyramidtriangulation.cc:76
│ │ │ │ +
Codim< 0 >::SubEntityIterator ElementIterator
Definition pyramidtriangulation.cc:78
│ │ │ │ +
static constexpr int dimension
Definition pyramidtriangulation.cc:70
│ │ │ │ +
static ElementIterator eBegin(int nIntervals)
Definition pyramidtriangulation.cc:141
│ │ │ │ +
static ElementIterator eEnd(int nIntervals)
Definition pyramidtriangulation.cc:149
│ │ │ │ +
FieldVector< int, dimension+1 > IndexVector
Definition pyramidtriangulation.cc:79
│ │ │ │ +
static VertexIterator vBegin(int nIntervals)
Definition pyramidtriangulation.cc:117
│ │ │ │ +
static VertexIterator vEnd(int nIntervals)
Definition pyramidtriangulation.cc:125
│ │ │ │ + │ │ │ │ +
Dune::MultiLinearGeometry< CoordType, dimension-codimension, dimension > Geometry
Definition pyramidtriangulation.cc:103
│ │ │ │ +
RefinementImp< dimension, CoordType > Refinement
Definition pyramidtriangulation.cc:164
│ │ │ │ +
Refinement::template Codim< dimension >::Geometry Geometry
Definition pyramidtriangulation.cc:166
│ │ │ │ +
Refinement::BackendRefinement BackendRefinement
Definition pyramidtriangulation.cc:178
│ │ │ │ + │ │ │ │ +
BackendRefinement::template Codim< dimension >::SubEntityIterator BackendIterator
Definition pyramidtriangulation.cc:179
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
Refinement::CoordVector CoordVector
Definition pyramidtriangulation.cc:246
│ │ │ │ + │ │ │ │ +
Refinement::template Codim< 0 >::Geometry Geometry
Definition pyramidtriangulation.cc:247
│ │ │ │ +
Refinement::IndexVector IndexVector
Definition pyramidtriangulation.cc:245
│ │ │ │ +
BackendRefinement::template Codim< 0 >::SubEntityIterator BackendIterator
Definition pyramidtriangulation.cc:264
│ │ │ │ + │ │ │ │ + │ │ │ │ +
RefinementImp< dimension, CoordType > Refinement
Definition pyramidtriangulation.cc:244
│ │ │ │ +
Refinement::BackendRefinement BackendRefinement
Definition pyramidtriangulation.cc:263
│ │ │ │ + │ │ │ │ +
SubEntityIterator This
Definition pyramidtriangulation.cc:360
│ │ │ │ + │ │ │ │ +
RefinementImp< dimension, CoordType > Refinement
Definition pyramidtriangulation.cc:359
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -7,589 +7,606 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ -quadraturerules.hh │ │ │ │ │ + * refinement │ │ │ │ │ +pyramidtriangulation.cc │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception │ │ │ │ │ - 5 │ │ │ │ │ - 6#ifndef DUNE_GEOMETRY_QUADRATURERULES_HH │ │ │ │ │ - 7#define DUNE_GEOMETRY_QUADRATURERULES_HH │ │ │ │ │ - 8 │ │ │ │ │ - 9#include │ │ │ │ │ - 10#include │ │ │ │ │ - 11#include │ │ │ │ │ - 12#include │ │ │ │ │ - 13#include │ │ │ │ │ - 14#include │ │ │ │ │ - 15 │ │ │ │ │ - 16#include │ │ │ │ │ - 17#include │ │ │ │ │ - 18#include │ │ │ │ │ - 19#include │ │ │ │ │ - 20#include │ │ │ │ │ - 21 │ │ │ │ │ - 22#include │ │ │ │ │ - 23#include │ │ │ │ │ - 24 │ │ │ │ │ - 30namespace Dune { │ │ │ │ │ - 31 │ │ │ │ │ -36 class QuadratureOrderOutOfRange : public NotImplemented {}; │ │ │ │ │ - 37 │ │ │ │ │ - 43 template │ │ │ │ │ -44 class QuadraturePoint { │ │ │ │ │ - 45 public: │ │ │ │ │ -47 constexpr static int dimension = dim; │ │ │ │ │ - 48 │ │ │ │ │ -50 typedef ct Field; │ │ │ │ │ - 51 │ │ │ │ │ -53 typedef Dune::FieldVector Vector; │ │ │ │ │ - 54 │ │ │ │ │ -56 QuadraturePoint (const Vector& x, ct w) : local(x) │ │ │ │ │ - 57 { │ │ │ │ │ - 58 weight_ = w; │ │ │ │ │ - 59 } │ │ │ │ │ - 60 │ │ │ │ │ -62 const Vector& position () const │ │ │ │ │ - 63 { │ │ │ │ │ - 64 return local; │ │ │ │ │ - 65 } │ │ │ │ │ - 66 │ │ │ │ │ -68 const ct &weight () const │ │ │ │ │ - 69 { │ │ │ │ │ - 70 return weight_; │ │ │ │ │ - 71 } │ │ │ │ │ - 72 │ │ │ │ │ - 73 protected: │ │ │ │ │ -74 FieldVector local; │ │ │ │ │ -75 ct weight_; │ │ │ │ │ - 76 }; │ │ │ │ │ - 77 │ │ │ │ │ -81 namespace QuadratureType { │ │ │ │ │ -82 enum Enum { │ │ │ │ │ -92 GaussLegendre = 0, │ │ │ │ │ - 93 │ │ │ │ │ -99 GaussJacobi_1_0 = 1, │ │ │ │ │ - 100 │ │ │ │ │ -106 GaussJacobi_2_0 = 2, │ │ │ │ │ - 107 │ │ │ │ │ -119 GaussJacobi_n_0 = 3, │ │ │ │ │ - 120 │ │ │ │ │ -127 GaussLobatto = 4, │ │ │ │ │ - 128 │ │ │ │ │ -135 GaussRadauLeft = 5, │ │ │ │ │ - 136 │ │ │ │ │ -144 GaussRadauRight = 6, │ │ │ │ │ - 145 size │ │ │ │ │ -146 }; │ │ │ │ │ - 147 } │ │ │ │ │ - 148 │ │ │ │ │ - 152 template │ │ │ │ │ -153 class QuadratureRule : public std::vector > │ │ │ │ │ - 154 { │ │ │ │ │ - 155 public: │ │ │ │ │ -161 QuadratureRule() : delivered_order(-1) {} │ │ │ │ │ - 162 │ │ │ │ │ - 163 protected: │ │ │ │ │ -165 QuadratureRule(GeometryType t) : geometry_type(t), delivered_order(-1) {} │ │ │ │ │ - 166 │ │ │ │ │ -168 QuadratureRule(GeometryType t, int order) : geometry_type(t), │ │ │ │ │ -delivered_order(order) {} │ │ │ │ │ - 169 public: │ │ │ │ │ -171 constexpr static int d = dim; │ │ │ │ │ - 172 │ │ │ │ │ -174 typedef ct CoordType; │ │ │ │ │ + 5#ifndef DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC │ │ │ │ │ +6#define DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC │ │ │ │ │ + 7 │ │ │ │ │ + 8#include │ │ │ │ │ + 9#include │ │ │ │ │ + 10 │ │ │ │ │ + 11#include │ │ │ │ │ + 12#include │ │ │ │ │ + 13 │ │ │ │ │ + 14#include "base.cc" │ │ │ │ │ + 15#include "simplex.cc" │ │ │ │ │ + 16 │ │ │ │ │ + 17namespace Dune │ │ │ │ │ + 18{ │ │ │ │ │ + 19 namespace RefinementImp │ │ │ │ │ + 20 { │ │ │ │ │ +26 namespace PyramidTriangulation │ │ │ │ │ + 27 { │ │ │ │ │ + 28 // //////////// │ │ │ │ │ + 29 // │ │ │ │ │ + 30 // Utilities │ │ │ │ │ + 31 // │ │ │ │ │ + 32 │ │ │ │ │ + 33 using Simplex::getPermutation; │ │ │ │ │ + 34 using Simplex::referenceToKuhn; │ │ │ │ │ + 35 │ │ │ │ │ + 36 // //////////////////////////////////// │ │ │ │ │ + 37 // │ │ │ │ │ + 38 // Refine a pyramid with simplices │ │ │ │ │ + 39 // │ │ │ │ │ + 40 │ │ │ │ │ + 41 // forward declaration of the iterator base │ │ │ │ │ + 42 template │ │ │ │ │ +43 class RefinementIteratorSpecial; │ │ │ │ │ + 44 │ │ │ │ │ + 45 /* │ │ │ │ │ + 46 * The permutations 0 and 1 of the Kuhn-decomposition of a cube into │ │ │ │ │ +simplices form a pyramid. │ │ │ │ │ + 47 * The resulting pyramid is not oriented the same as the reference pyramid │ │ │ │ │ +and so the Kuhn-coordinates │ │ │ │ │ + 48 * have to be transformed using the method below. │ │ │ │ │ + 49 */ │ │ │ │ │ + 50 template FieldVector │ │ │ │ │ +51 transformCoordinate( FieldVector point) │ │ │ │ │ + 52 { │ │ │ │ │ + 53 FieldVector transform; │ │ │ │ │ + 54 transform[0]=1-point[0]; │ │ │ │ │ + 55 transform[1]=1-point[1]; │ │ │ │ │ + 56 transform[2]=point[2]; │ │ │ │ │ + 57 return transform; │ │ │ │ │ + 58 } │ │ │ │ │ + 59 │ │ │ │ │ + 66 template │ │ │ │ │ +67 class RefinementImp │ │ │ │ │ + 68 { │ │ │ │ │ + 69 public: │ │ │ │ │ +70 constexpr static int dimension = dimension_; │ │ │ │ │ + 71 │ │ │ │ │ +72 typedef CoordType ctype; │ │ │ │ │ + 73 │ │ │ │ │ + 74 template │ │ │ │ │ + 75 struct Codim; │ │ │ │ │ +76 typedef typename Codim::SubEntityIterator VertexIterator; │ │ │ │ │ +77 typedef FieldVector CoordVector; │ │ │ │ │ +78 typedef typename Codim<0>::SubEntityIterator ElementIterator; │ │ │ │ │ +79 typedef FieldVector IndexVector; │ │ │ │ │ + 80 │ │ │ │ │ + 81 static int nVertices(int nIntervals); │ │ │ │ │ + 82 static VertexIterator vBegin(int nIntervals); │ │ │ │ │ + 83 static VertexIterator vEnd(int nIntervals); │ │ │ │ │ + 84 │ │ │ │ │ + 85 static int nElements(int nIntervals); │ │ │ │ │ + 86 static ElementIterator eBegin(int nIntervals); │ │ │ │ │ +87 static ElementIterator eEnd(int nIntervals); │ │ │ │ │ + 88 │ │ │ │ │ + 89 private: │ │ │ │ │ + 90 friend class RefinementIteratorSpecial; │ │ │ │ │ + 91 friend class RefinementIteratorSpecial; │ │ │ │ │ + 92 │ │ │ │ │ + 93 typedef Simplex::RefinementImp BackendRefinement; │ │ │ │ │ + 94 │ │ │ │ │ + 95 constexpr static int nKuhnSimplices = 2; │ │ │ │ │ + 96 }; │ │ │ │ │ + 97 │ │ │ │ │ + 98 template │ │ │ │ │ + 99 template │ │ │ │ │ +100 struct RefinementImp::Codim │ │ │ │ │ + 101 { │ │ │ │ │ + 102 class SubEntityIterator; │ │ │ │ │ +103 typedef Dune::MultiLinearGeometry Geometry; │ │ │ │ │ + 104 }; │ │ │ │ │ + 105 │ │ │ │ │ + 106 template │ │ │ │ │ + 107 int │ │ │ │ │ +108 RefinementImp:: │ │ │ │ │ + 109nVertices(int nIntervals) │ │ │ │ │ + 110 { │ │ │ │ │ + 111 return BackendRefinement::nVertices(nIntervals) * nKuhnSimplices; │ │ │ │ │ + 112 } │ │ │ │ │ + 113 │ │ │ │ │ + 114 template │ │ │ │ │ + 115 typename RefinementImp::VertexIterator │ │ │ │ │ +116 RefinementImp:: │ │ │ │ │ + 117vBegin(int nIntervals) │ │ │ │ │ + 118 { │ │ │ │ │ + 119 return VertexIterator(nIntervals); │ │ │ │ │ + 120 } │ │ │ │ │ + 121 │ │ │ │ │ + 122 template │ │ │ │ │ + 123 typename RefinementImp::VertexIterator │ │ │ │ │ +124 RefinementImp:: │ │ │ │ │ + 125vEnd(int nIntervals) │ │ │ │ │ + 126 { │ │ │ │ │ + 127 return VertexIterator(nIntervals, true); │ │ │ │ │ + 128 } │ │ │ │ │ + 129 │ │ │ │ │ + 130 template │ │ │ │ │ + 131 int │ │ │ │ │ +132 RefinementImp:: │ │ │ │ │ + 133nElements(int nIntervals) │ │ │ │ │ + 134 { │ │ │ │ │ + 135 return BackendRefinement::nElements(nIntervals) * nKuhnSimplices; │ │ │ │ │ + 136 } │ │ │ │ │ + 137 │ │ │ │ │ + 138 template │ │ │ │ │ + 139 typename RefinementImp::ElementIterator │ │ │ │ │ +140 RefinementImp:: │ │ │ │ │ + 141eBegin(int nIntervals) │ │ │ │ │ + 142 { │ │ │ │ │ + 143 return ElementIterator(nIntervals); │ │ │ │ │ + 144 } │ │ │ │ │ + 145 │ │ │ │ │ + 146 template │ │ │ │ │ + 147 typename RefinementImp::ElementIterator │ │ │ │ │ +148 RefinementImp:: │ │ │ │ │ + 149eEnd(int nIntervals) │ │ │ │ │ + 150 { │ │ │ │ │ + 151 return ElementIterator(nIntervals, true); │ │ │ │ │ + 152 } │ │ │ │ │ + 153 │ │ │ │ │ + 154 // ////////////// │ │ │ │ │ + 155 // │ │ │ │ │ + 156 // The iterator │ │ │ │ │ + 157 // │ │ │ │ │ + 158 │ │ │ │ │ + 159 // vertices │ │ │ │ │ + 160 template │ │ │ │ │ +161 class RefinementIteratorSpecial │ │ │ │ │ + 162 { │ │ │ │ │ + 163 public: │ │ │ │ │ +164 typedef RefinementImp Refinement; │ │ │ │ │ +165 typedef typename Refinement::CoordVector CoordVector; │ │ │ │ │ +166 typedef typename Refinement::template Codim::Geometry Geometry; │ │ │ │ │ + 167 │ │ │ │ │ + 168 RefinementIteratorSpecial(int nIntervals, bool end = false); │ │ │ │ │ + 169 │ │ │ │ │ + 170 void increment(); │ │ │ │ │ + 171 │ │ │ │ │ + 172 CoordVector coords() const; │ │ │ │ │ + 173 │ │ │ │ │ + 174 Geometry geometry() const; │ │ │ │ │ 175 │ │ │ │ │ -177 virtual int order () const { return delivered_order; } │ │ │ │ │ - 178 │ │ │ │ │ -180 virtual GeometryType type () const { return geometry_type; } │ │ │ │ │ -181 virtual ~QuadratureRule(){} │ │ │ │ │ - 182 │ │ │ │ │ -185 typedef typename std::vector >::const_iterator │ │ │ │ │ -iterator; │ │ │ │ │ - 186 │ │ │ │ │ - 187 protected: │ │ │ │ │ -188 GeometryType geometry_type; │ │ │ │ │ -189 int delivered_order; │ │ │ │ │ - 190 }; │ │ │ │ │ - 191 │ │ │ │ │ - 192 // Forward declaration of the factory class, │ │ │ │ │ - 193 // needed internally by the QuadratureRules container class. │ │ │ │ │ - 194 template class QuadratureRuleFactory; │ │ │ │ │ - 195 │ │ │ │ │ - 199 template │ │ │ │ │ -200 class QuadratureRules { │ │ │ │ │ - 201 │ │ │ │ │ - 203 using QuadratureRule = Dune::QuadratureRule; │ │ │ │ │ - 204 │ │ │ │ │ - 205 // indexed by quadrature order │ │ │ │ │ - 206 using QuadratureOrderVector = std::vector >; │ │ │ │ │ - 207 │ │ │ │ │ - 208 // indexed by geometry type │ │ │ │ │ - 209 using GeometryTypeVector = std::vector >; │ │ │ │ │ - 210 │ │ │ │ │ - 211 // indexed by quadrature type enum │ │ │ │ │ - 212 using QuadratureCacheVector = std::vector >; │ │ │ │ │ - 213 │ │ │ │ │ - 215 DUNE_EXPORT const QuadratureRule& _rule(const GeometryType& t, int p, │ │ │ │ │ -QuadratureType::Enum qt=QuadratureType::GaussLegendre) const │ │ │ │ │ - 216 { │ │ │ │ │ - 217 assert(t.dim()==dim); │ │ │ │ │ - 218 │ │ │ │ │ - 219 DUNE_ASSERT_CALL_ONCE(); │ │ │ │ │ - 220 │ │ │ │ │ - 221 static QuadratureCacheVector quadratureCache(QuadratureType::size); │ │ │ │ │ - 222 │ │ │ │ │ - 223 auto& [ onceFlagQuadratureType, geometryTypes ] = quadratureCache[qt]; │ │ │ │ │ - 224 // initialize geometry types for this quadrature type once │ │ │ │ │ - 225 std::call_once(onceFlagQuadratureType, [&types = geometryTypes]{ │ │ │ │ │ - 226 types = GeometryTypeVector(LocalGeometryTypeIndex::size(dim)); │ │ │ │ │ - 227 }); │ │ │ │ │ - 228 │ │ │ │ │ - 229 auto& [ onceFlagGeometryType, quadratureOrders ] = geometryTypes │ │ │ │ │ -[LocalGeometryTypeIndex::index(t)]; │ │ │ │ │ - 230 // initialize quadrature orders for this geometry type and quadrature type │ │ │ │ │ -once │ │ │ │ │ - 231 std::call_once(onceFlagGeometryType, [&, &orders = quadratureOrders]{ │ │ │ │ │ - 232 // we only need one quadrature rule for points, not maxint │ │ │ │ │ - 233 const auto numRules = dim == 0 ? 1 : QuadratureRuleFactory:: │ │ │ │ │ -maxOrder(t, qt)+1; │ │ │ │ │ - 234 orders = QuadratureOrderVector(numRules); │ │ │ │ │ - 235 }); │ │ │ │ │ - 236 │ │ │ │ │ - 237 // we only have one quadrature rule for points │ │ │ │ │ - 238 auto& [ onceFlagQuadratureOrder, quadratureRule ] = quadratureOrders[dim │ │ │ │ │ -== 0 ? 0 : p]; │ │ │ │ │ - 239 // initialize quadrature rule once │ │ │ │ │ - 240 std::call_once(onceFlagQuadratureOrder, [&, &rule = quadratureRule]{ │ │ │ │ │ - 241 rule = QuadratureRuleFactory::rule(t, p, qt); │ │ │ │ │ - 242 }); │ │ │ │ │ - 243 │ │ │ │ │ - 244 return quadratureRule; │ │ │ │ │ - 245 } │ │ │ │ │ - 246 │ │ │ │ │ - 248 DUNE_EXPORT static QuadratureRules& instance() │ │ │ │ │ - 249 { │ │ │ │ │ - 250 static QuadratureRules instance; │ │ │ │ │ - 251 return instance; │ │ │ │ │ - 252 } │ │ │ │ │ - 253 │ │ │ │ │ - 255 QuadratureRules () = default; │ │ │ │ │ - 256 public: │ │ │ │ │ - 258 static unsigned │ │ │ │ │ -259 maxOrder(const GeometryType& t, │ │ │ │ │ - 260 QuadratureType::Enum qt=QuadratureType::GaussLegendre) │ │ │ │ │ - 261 { │ │ │ │ │ - 262 return QuadratureRuleFactory::maxOrder(t,qt); │ │ │ │ │ - 263 } │ │ │ │ │ - 264 │ │ │ │ │ -266 static const QuadratureRule& rule(const GeometryType& t, int p, │ │ │ │ │ -QuadratureType::Enum qt=QuadratureType::GaussLegendre) │ │ │ │ │ - 267 { │ │ │ │ │ - 268 return instance()._rule(t,p,qt); │ │ │ │ │ - 269 } │ │ │ │ │ - 270 │ │ │ │ │ -272 static const QuadratureRule& rule(const GeometryType::BasicType t, int p, │ │ │ │ │ -QuadratureType::Enum qt=QuadratureType::GaussLegendre) │ │ │ │ │ - 273 { │ │ │ │ │ - 274 GeometryType gt(t,dim); │ │ │ │ │ - 275 return instance()._rule(gt,p,qt); │ │ │ │ │ - 276 } │ │ │ │ │ - 277 }; │ │ │ │ │ - 278 │ │ │ │ │ - 279} // end namespace Dune │ │ │ │ │ - 280 │ │ │ │ │ -281#define DUNE_INCLUDING_IMPLEMENTATION │ │ │ │ │ - 282 │ │ │ │ │ - 283// 0d rules │ │ │ │ │ - 284#include "quadraturerules/pointquadrature.hh" │ │ │ │ │ - 285// 1d rules │ │ │ │ │ - 286#include "quadraturerules/gausslobattoquadrature.hh" │ │ │ │ │ - 287#include "quadraturerules/gaussquadrature.hh" │ │ │ │ │ - 288#include "quadraturerules/gaussradauleftquadrature.hh" │ │ │ │ │ - 289#include "quadraturerules/gaussradaurightquadrature.hh" │ │ │ │ │ - 290#include "quadraturerules/jacobi1quadrature.hh" │ │ │ │ │ - 291#include "quadraturerules/jacobi2quadrature.hh" │ │ │ │ │ - 292#include "quadraturerules/jacobiNquadrature.hh" │ │ │ │ │ - 293// 3d rules │ │ │ │ │ - 294#include "quadraturerules/prismquadrature.hh" │ │ │ │ │ - 295// general rules │ │ │ │ │ - 296#include "quadraturerules/simplexquadrature.hh" │ │ │ │ │ - 297#include "quadraturerules/tensorproductquadrature.hh" │ │ │ │ │ - 298 │ │ │ │ │ - 299#undef DUNE_INCLUDING_IMPLEMENTATION │ │ │ │ │ - 300 │ │ │ │ │ - 301namespace Dune { │ │ │ │ │ - 302 │ │ │ │ │ - 309 template │ │ │ │ │ -310 class QuadratureRuleFactory { │ │ │ │ │ - 311 private: │ │ │ │ │ - 312 friend class QuadratureRules; │ │ │ │ │ - 313 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum qt) │ │ │ │ │ - 314 { │ │ │ │ │ - 315 return TensorProductQuadratureRule::maxOrder(t.id(), qt); │ │ │ │ │ - 316 } │ │ │ │ │ - 317 static QuadratureRule rule(const GeometryType& t, int p, │ │ │ │ │ -QuadratureType::Enum qt) │ │ │ │ │ - 318 { │ │ │ │ │ - 319 return TensorProductQuadratureRule(t.id(), p, qt); │ │ │ │ │ - 320 } │ │ │ │ │ - 321 }; │ │ │ │ │ - 322 │ │ │ │ │ - 323 template │ │ │ │ │ -324 class QuadratureRuleFactory { │ │ │ │ │ - 325 private: │ │ │ │ │ -326 constexpr static int dim = 0; │ │ │ │ │ - 327 friend class QuadratureRules; │ │ │ │ │ - 328 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum) │ │ │ │ │ - 329 { │ │ │ │ │ - 330 if (t.isVertex()) │ │ │ │ │ + 176 int index() const; │ │ │ │ │ + 177 protected: │ │ │ │ │ +178 typedef typename Refinement::BackendRefinement BackendRefinement; │ │ │ │ │ +179 typedef typename BackendRefinement::template Codim:: │ │ │ │ │ +SubEntityIterator BackendIterator; │ │ │ │ │ +180 constexpr static int nKuhnSimplices = 2; │ │ │ │ │ + 181 │ │ │ │ │ +182 int nIntervals_; │ │ │ │ │ + 183 │ │ │ │ │ +184 int kuhnIndex; │ │ │ │ │ +185 BackendIterator backend; │ │ │ │ │ +186 const BackendIterator backendEnd; │ │ │ │ │ + 187 }; │ │ │ │ │ + 188 │ │ │ │ │ + 189 template │ │ │ │ │ +190 RefinementIteratorSpecial:: │ │ │ │ │ + 191RefinementIteratorSpecial(int nIntervals, bool end) │ │ │ │ │ + 192 : nIntervals_(nIntervals), kuhnIndex(0), │ │ │ │ │ + 193 backend(BackendRefinement::vBegin(nIntervals_)), │ │ │ │ │ + 194 backendEnd(BackendRefinement::vEnd(nIntervals_)) │ │ │ │ │ + 195 { │ │ │ │ │ + 196 if (end) │ │ │ │ │ + 197 kuhnIndex = nKuhnSimplices; │ │ │ │ │ + 198 } │ │ │ │ │ + 199 │ │ │ │ │ + 200 template │ │ │ │ │ + 201 void │ │ │ │ │ +202 RefinementIteratorSpecial:: │ │ │ │ │ + 203increment() │ │ │ │ │ + 204 { │ │ │ │ │ + 205 ++backend; │ │ │ │ │ + 206 if(backend == backendEnd) │ │ │ │ │ + 207 { │ │ │ │ │ + 208 backend = BackendRefinement::vBegin(nIntervals_); │ │ │ │ │ + 209 ++kuhnIndex; │ │ │ │ │ + 210 } │ │ │ │ │ + 211 } │ │ │ │ │ + 212 │ │ │ │ │ + 213 template │ │ │ │ │ + 214 typename RefinementIteratorSpecial:: │ │ │ │ │ +CoordVector │ │ │ │ │ +215 RefinementIteratorSpecial:: │ │ │ │ │ + 216coords() const │ │ │ │ │ + 217 { │ │ │ │ │ + 218 return transformCoordinate(referenceToKuhn(backend.coords(), │ │ │ │ │ + 219 getPermutation(kuhnIndex))); │ │ │ │ │ + 220 } │ │ │ │ │ + 221 │ │ │ │ │ + 222 template │ │ │ │ │ + 223 typename RefinementIteratorSpecial:: │ │ │ │ │ +Geometry │ │ │ │ │ +224 RefinementIteratorSpecial::geometry () │ │ │ │ │ +const │ │ │ │ │ + 225 { │ │ │ │ │ + 226 std::vector corners(1); │ │ │ │ │ + 227 corners[0] = referenceToKuhn(backend.coords(), getPermutation │ │ │ │ │ +(kuhnIndex)); │ │ │ │ │ + 228 return Geometry(GeometryTypes::vertex, corners); │ │ │ │ │ + 229 } │ │ │ │ │ + 230 │ │ │ │ │ + 231 template │ │ │ │ │ + 232 int │ │ │ │ │ +233 RefinementIteratorSpecial:: │ │ │ │ │ + 234index() const │ │ │ │ │ + 235 { │ │ │ │ │ + 236 return kuhnIndex*BackendRefinement::nVertices(nIntervals_) + backend.index │ │ │ │ │ +(); │ │ │ │ │ + 237 } │ │ │ │ │ + 238 │ │ │ │ │ + 239 // elements │ │ │ │ │ + 240 template │ │ │ │ │ +241 class RefinementIteratorSpecial │ │ │ │ │ + 242 { │ │ │ │ │ + 243 public: │ │ │ │ │ +244 typedef RefinementImp Refinement; │ │ │ │ │ +245 typedef typename Refinement::IndexVector IndexVector; │ │ │ │ │ +246 typedef typename Refinement::CoordVector CoordVector; │ │ │ │ │ +247 typedef typename Refinement::template Codim<0>::Geometry Geometry; │ │ │ │ │ + 248 │ │ │ │ │ + 249 RefinementIteratorSpecial(int nIntervals, bool end = false); │ │ │ │ │ + 250 │ │ │ │ │ + 251 void increment(); │ │ │ │ │ + 252 │ │ │ │ │ + 253 IndexVector vertexIndices() const; │ │ │ │ │ + 254 int index() const; │ │ │ │ │ + 255 CoordVector coords() const; │ │ │ │ │ + 256 │ │ │ │ │ + 257 Geometry geometry() const; │ │ │ │ │ + 258 │ │ │ │ │ + 259 private: │ │ │ │ │ + 260 CoordVector global(const CoordVector &local) const; │ │ │ │ │ + 261 │ │ │ │ │ + 262 protected: │ │ │ │ │ +263 typedef typename Refinement::BackendRefinement BackendRefinement; │ │ │ │ │ +264 typedef typename BackendRefinement::template Codim<0>::SubEntityIterator │ │ │ │ │ +BackendIterator; │ │ │ │ │ +265 constexpr static int nKuhnSimplices = 2; │ │ │ │ │ + 266 │ │ │ │ │ +267 int nIntervals_; │ │ │ │ │ + 268 │ │ │ │ │ +269 int kuhnIndex; │ │ │ │ │ +270 BackendIterator backend; │ │ │ │ │ +271 const BackendIterator backendEnd; │ │ │ │ │ + 272 }; │ │ │ │ │ + 273 │ │ │ │ │ + 274 template │ │ │ │ │ +275 RefinementIteratorSpecial:: │ │ │ │ │ + 276RefinementIteratorSpecial(int nIntervals, bool end) │ │ │ │ │ + 277 : nIntervals_(nIntervals), kuhnIndex(0), │ │ │ │ │ + 278 backend(BackendRefinement::eBegin(nIntervals_)), │ │ │ │ │ + 279 backendEnd(BackendRefinement::eEnd(nIntervals_)) │ │ │ │ │ + 280 { │ │ │ │ │ + 281 if (end) │ │ │ │ │ + 282 kuhnIndex = nKuhnSimplices; │ │ │ │ │ + 283 } │ │ │ │ │ + 284 │ │ │ │ │ + 285 template │ │ │ │ │ + 286 void │ │ │ │ │ +287 RefinementIteratorSpecial:: │ │ │ │ │ + 288increment() │ │ │ │ │ + 289 { │ │ │ │ │ + 290 ++backend; │ │ │ │ │ + 291 if (backend == backendEnd) │ │ │ │ │ + 292 { │ │ │ │ │ + 293 backend = BackendRefinement::eBegin(nIntervals_); │ │ │ │ │ + 294 ++kuhnIndex; │ │ │ │ │ + 295 } │ │ │ │ │ + 296 } │ │ │ │ │ + 297 │ │ │ │ │ + 298 template │ │ │ │ │ + 299 typename RefinementIteratorSpecial::IndexVector │ │ │ │ │ +300 RefinementIteratorSpecial:: │ │ │ │ │ + 301vertexIndices() const │ │ │ │ │ + 302 { │ │ │ │ │ + 303 IndexVector indices = backend.vertexIndices(); │ │ │ │ │ + 304 │ │ │ │ │ + 305 int base = kuhnIndex * BackendRefinement::nVertices(nIntervals_); │ │ │ │ │ + 306 indices += base; │ │ │ │ │ + 307 │ │ │ │ │ + 308 return indices; │ │ │ │ │ + 309 } │ │ │ │ │ + 310 │ │ │ │ │ + 311 template │ │ │ │ │ + 312 int │ │ │ │ │ +313 RefinementIteratorSpecial:: │ │ │ │ │ + 314index() const │ │ │ │ │ + 315 { │ │ │ │ │ + 316 return kuhnIndex*BackendRefinement::nElements(nIntervals_) + backend.index │ │ │ │ │ +(); │ │ │ │ │ + 317 } │ │ │ │ │ + 318 │ │ │ │ │ + 319 template │ │ │ │ │ + 320 typename RefinementIteratorSpecial::CoordVector │ │ │ │ │ +321 RefinementIteratorSpecial:: │ │ │ │ │ + 322coords() const │ │ │ │ │ + 323 { │ │ │ │ │ + 324 return global(backend.coords()); │ │ │ │ │ + 325 } │ │ │ │ │ + 326 │ │ │ │ │ + 327 template │ │ │ │ │ + 328 typename RefinementIteratorSpecial::Geometry │ │ │ │ │ +329 RefinementIteratorSpecial:: │ │ │ │ │ + 330geometry() const │ │ │ │ │ 331 { │ │ │ │ │ - 332 return std::numeric_limits::max(); │ │ │ │ │ - 333 } │ │ │ │ │ - 334 DUNE_THROW(Exception, "Unknown GeometryType"); │ │ │ │ │ - 335 } │ │ │ │ │ - 336 static QuadratureRule rule(const GeometryType& t, int , │ │ │ │ │ -QuadratureType::Enum) │ │ │ │ │ - 337 { │ │ │ │ │ - 338 if (t.isVertex()) │ │ │ │ │ - 339 { │ │ │ │ │ - 340 return PointQuadratureRule(); │ │ │ │ │ - 341 } │ │ │ │ │ - 342 DUNE_THROW(Exception, "Unknown GeometryType"); │ │ │ │ │ - 343 } │ │ │ │ │ - 344 }; │ │ │ │ │ - 345 │ │ │ │ │ - 346 template │ │ │ │ │ -347 class QuadratureRuleFactory { │ │ │ │ │ - 348 private: │ │ │ │ │ -349 constexpr static int dim = 1; │ │ │ │ │ - 350 friend class QuadratureRules; │ │ │ │ │ - 351 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum qt) │ │ │ │ │ - 352 { │ │ │ │ │ - 353 if (t.isLine()) │ │ │ │ │ - 354 { │ │ │ │ │ - 355 switch (qt) { │ │ │ │ │ - 356 case QuadratureType::GaussLegendre : │ │ │ │ │ - 357 return GaussQuadratureRule1D::highest_order; │ │ │ │ │ - 358 case QuadratureType::GaussJacobi_1_0 : │ │ │ │ │ - 359 return Jacobi1QuadratureRule1D::highest_order; │ │ │ │ │ - 360 case QuadratureType::GaussJacobi_2_0 : │ │ │ │ │ - 361 return Jacobi2QuadratureRule1D::highest_order; │ │ │ │ │ - 362 case QuadratureType::GaussLobatto : │ │ │ │ │ - 363 return GaussLobattoQuadratureRule1D::highest_order; │ │ │ │ │ - 364 case QuadratureType::GaussJacobi_n_0 : │ │ │ │ │ - 365 return JacobiNQuadratureRule1D::maxOrder(); │ │ │ │ │ - 366 case QuadratureType::GaussRadauLeft : │ │ │ │ │ - 367 return GaussRadauLeftQuadratureRule1D::highest_order; │ │ │ │ │ - 368 case QuadratureType::GaussRadauRight : │ │ │ │ │ - 369 return GaussRadauRightQuadratureRule1D::highest_order; │ │ │ │ │ - 370 default : │ │ │ │ │ - 371 DUNE_THROW(Exception, "Unknown QuadratureType"); │ │ │ │ │ - 372 } │ │ │ │ │ - 373 } │ │ │ │ │ - 374 DUNE_THROW(Exception, "Unknown GeometryType"); │ │ │ │ │ - 375 } │ │ │ │ │ - 376 static QuadratureRule rule(const GeometryType& t, int p, │ │ │ │ │ -QuadratureType::Enum qt) │ │ │ │ │ - 377 { │ │ │ │ │ - 378 if (t.isLine()) │ │ │ │ │ - 379 { │ │ │ │ │ - 380 switch (qt) { │ │ │ │ │ - 381 case QuadratureType::GaussLegendre : │ │ │ │ │ - 382 return GaussQuadratureRule1D(p); │ │ │ │ │ - 383 case QuadratureType::GaussJacobi_1_0 : │ │ │ │ │ - 384 return Jacobi1QuadratureRule1D(p); │ │ │ │ │ - 385 case QuadratureType::GaussJacobi_2_0 : │ │ │ │ │ - 386 return Jacobi2QuadratureRule1D(p); │ │ │ │ │ - 387 case QuadratureType::GaussLobatto : │ │ │ │ │ - 388 return GaussLobattoQuadratureRule1D(p); │ │ │ │ │ - 389 case QuadratureType::GaussJacobi_n_0 : │ │ │ │ │ - 390 return JacobiNQuadratureRule1D(p); │ │ │ │ │ - 391 case QuadratureType::GaussRadauLeft : │ │ │ │ │ - 392 return GaussRadauLeftQuadratureRule1D(p); │ │ │ │ │ - 393 case QuadratureType::GaussRadauRight : │ │ │ │ │ - 394 return GaussRadauRightQuadratureRule1D(p); │ │ │ │ │ - 395 default : │ │ │ │ │ - 396 DUNE_THROW(Exception, "Unknown QuadratureType"); │ │ │ │ │ - 397 } │ │ │ │ │ - 398 } │ │ │ │ │ - 399 DUNE_THROW(Exception, "Unknown GeometryType"); │ │ │ │ │ - 400 } │ │ │ │ │ - 401 }; │ │ │ │ │ - 402 │ │ │ │ │ - 403 template │ │ │ │ │ -404 class QuadratureRuleFactory { │ │ │ │ │ - 405 private: │ │ │ │ │ -406 constexpr static int dim = 2; │ │ │ │ │ - 407 friend class QuadratureRules; │ │ │ │ │ - 408 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum qt) │ │ │ │ │ - 409 { │ │ │ │ │ - 410 unsigned order = │ │ │ │ │ - 411 TensorProductQuadratureRule::maxOrder(t.id(), qt); │ │ │ │ │ - 412 if (t.isSimplex()) │ │ │ │ │ - 413 order = std::max │ │ │ │ │ - 414 (order, unsigned(SimplexQuadratureRule::highest_order)); │ │ │ │ │ - 415 return order; │ │ │ │ │ - 416 } │ │ │ │ │ - 417 static QuadratureRule rule(const GeometryType& t, int p, │ │ │ │ │ -QuadratureType::Enum qt) │ │ │ │ │ - 418 { │ │ │ │ │ - 419 if (t.isSimplex() │ │ │ │ │ - 420 && ( qt == QuadratureType::GaussLegendre || qt == QuadratureType:: │ │ │ │ │ -GaussJacobi_n_0 ) │ │ │ │ │ - 421 && p <= SimplexQuadratureRule::highest_order) │ │ │ │ │ - 422 { │ │ │ │ │ - 423 return SimplexQuadratureRule(p); │ │ │ │ │ - 424 } │ │ │ │ │ - 425 return TensorProductQuadratureRule(t.id(), p, qt); │ │ │ │ │ - 426 } │ │ │ │ │ - 427 }; │ │ │ │ │ - 428 │ │ │ │ │ - 429 template │ │ │ │ │ -430 class QuadratureRuleFactory { │ │ │ │ │ - 431 private: │ │ │ │ │ -432 constexpr static int dim = 3; │ │ │ │ │ - 433 friend class QuadratureRules; │ │ │ │ │ - 434 static unsigned maxOrder(const GeometryType &t, QuadratureType::Enum qt) │ │ │ │ │ - 435 { │ │ │ │ │ - 436 unsigned order = │ │ │ │ │ - 437 TensorProductQuadratureRule::maxOrder(t.id(), qt); │ │ │ │ │ - 438 if (t.isSimplex()) │ │ │ │ │ - 439 order = std::max │ │ │ │ │ - 440 (order, unsigned(SimplexQuadratureRule::highest_order)); │ │ │ │ │ - 441 if (t.isPrism()) │ │ │ │ │ - 442 order = std::max │ │ │ │ │ - 443 (order, unsigned(PrismQuadratureRule::highest_order)); │ │ │ │ │ - 444 return order; │ │ │ │ │ - 445 } │ │ │ │ │ - 446 static QuadratureRule rule(const GeometryType& t, int p, │ │ │ │ │ -QuadratureType::Enum qt) │ │ │ │ │ - 447 { │ │ │ │ │ - 448 │ │ │ │ │ - 449 if (t.isSimplex() │ │ │ │ │ - 450 && ( qt == QuadratureType::GaussLegendre || qt == QuadratureType:: │ │ │ │ │ -GaussJacobi_n_0 ) │ │ │ │ │ - 451 && p <= SimplexQuadratureRule::highest_order) │ │ │ │ │ - 452 { │ │ │ │ │ - 453 return SimplexQuadratureRule(p); │ │ │ │ │ - 454 } │ │ │ │ │ - 455 if (t.isPrism() │ │ │ │ │ - 456 && qt == QuadratureType::GaussLegendre │ │ │ │ │ - 457 && p <= PrismQuadratureRule::highest_order) │ │ │ │ │ - 458 { │ │ │ │ │ - 459 return PrismQuadratureRule(p); │ │ │ │ │ - 460 } │ │ │ │ │ - 461 return TensorProductQuadratureRule(t.id(), p, qt); │ │ │ │ │ - 462 } │ │ │ │ │ - 463 }; │ │ │ │ │ - 464 │ │ │ │ │ - 465#ifndef DUNE_NO_EXTERN_QUADRATURERULES │ │ │ │ │ - 466 extern template class GaussLobattoQuadratureRule; │ │ │ │ │ - 467 extern template class GaussQuadratureRule; │ │ │ │ │ - 468 extern template class GaussRadauLeftQuadratureRule; │ │ │ │ │ - 469 extern template class GaussRadauRightQuadratureRule; │ │ │ │ │ - 470 extern template class Jacobi1QuadratureRule; │ │ │ │ │ - 471 extern template class Jacobi2QuadratureRule; │ │ │ │ │ - 472 extern template class JacobiNQuadratureRule; │ │ │ │ │ - 473 extern template class PrismQuadratureRule; │ │ │ │ │ - 474 extern template class SimplexQuadratureRule; │ │ │ │ │ -475 extern template class SimplexQuadratureRule; │ │ │ │ │ - 476#endif // !DUNE_NO_EXTERN_QUADRATURERULES │ │ │ │ │ - 477 │ │ │ │ │ - 478} // end namespace │ │ │ │ │ - 479 │ │ │ │ │ - 480#endif // DUNE_GEOMETRY_QUADRATURERULES_HH │ │ │ │ │ -typeindex.hh │ │ │ │ │ -Helper classes to provide indices for geometrytypes for use in a vector. │ │ │ │ │ + 332 const typename BackendIterator::Geometry & │ │ │ │ │ + 333 bgeo = backend.geometry(); │ │ │ │ │ + 334 std::vector corners(dimension+1); │ │ │ │ │ + 335 for(int i = 0; i <= dimension; ++i) │ │ │ │ │ + 336 corners[i] = global(bgeo.corner(i)); │ │ │ │ │ + 337 │ │ │ │ │ + 338 return Geometry(bgeo.type(), corners); │ │ │ │ │ + 339 } │ │ │ │ │ + 340 │ │ │ │ │ + 341 template │ │ │ │ │ + 342 typename RefinementIteratorSpecial:: │ │ │ │ │ + 343 CoordVector │ │ │ │ │ + 344 RefinementIteratorSpecial:: │ │ │ │ │ + 345global(const CoordVector &local) const │ │ │ │ │ + 346 { │ │ │ │ │ + 347 return transformCoordinate(referenceToKuhn(local, │ │ │ │ │ + 348 getPermutation(kuhnIndex))); │ │ │ │ │ + 349 } │ │ │ │ │ + 350 │ │ │ │ │ + 351 // common │ │ │ │ │ + 352 template │ │ │ │ │ + 353 template │ │ │ │ │ +354 class RefinementImp::Codim:: │ │ │ │ │ +SubEntityIterator │ │ │ │ │ + 355 : public ForwardIteratorFacade::template Codim::SubEntityIterator, int>, │ │ │ │ │ + 356 public RefinementIteratorSpecial │ │ │ │ │ + 357 { │ │ │ │ │ + 358 public: │ │ │ │ │ +359 typedef RefinementImp Refinement; │ │ │ │ │ +360 typedef SubEntityIterator This; │ │ │ │ │ + 361 │ │ │ │ │ +362 SubEntityIterator(int nIntervals, bool end = false); │ │ │ │ │ + 363 │ │ │ │ │ +364 bool equals(const This &other) const; │ │ │ │ │ + 365 protected: │ │ │ │ │ + 366 using RefinementIteratorSpecial:: │ │ │ │ │ +kuhnIndex; │ │ │ │ │ + 367 using RefinementIteratorSpecial:: │ │ │ │ │ +backend; │ │ │ │ │ + 368 }; │ │ │ │ │ + 369 │ │ │ │ │ + 370#ifndef DOXYGEN │ │ │ │ │ + 371 template │ │ │ │ │ + 372 template │ │ │ │ │ + 373 RefinementImp::Codim:: │ │ │ │ │ +SubEntityIterator:: │ │ │ │ │ + 374SubEntityIterator(int nIntervals, bool end) │ │ │ │ │ + 375 : RefinementIteratorSpecial(nIntervals, │ │ │ │ │ +end) │ │ │ │ │ + 376 {} │ │ │ │ │ + 377 │ │ │ │ │ + 378 template │ │ │ │ │ + 379 template │ │ │ │ │ + 380 bool │ │ │ │ │ + 381 RefinementImp::Codim:: │ │ │ │ │ +SubEntityIterator:: │ │ │ │ │ + 382equals(const This &other) const │ │ │ │ │ + 383 { │ │ │ │ │ + 384 return kuhnIndex == other.kuhnIndex && backend == other.backend; │ │ │ │ │ + 385 } │ │ │ │ │ + 386#endif │ │ │ │ │ + 387 │ │ │ │ │ + 388 } // namespace PyramidTriangulation │ │ │ │ │ + 389 } // namespace RefinementImp │ │ │ │ │ + 390 │ │ │ │ │ + 391 namespace RefinementImp │ │ │ │ │ + 392 { │ │ │ │ │ + 393 // /////////////////////// │ │ │ │ │ + 394 // │ │ │ │ │ + 395 // The refinement traits │ │ │ │ │ + 396 // │ │ │ │ │ + 397#ifndef DOXYGEN │ │ │ │ │ + 398 template │ │ │ │ │ + 399 struct Traits< │ │ │ │ │ + 400 topologyId, CoordType, coerceToId, 3, │ │ │ │ │ + 401 typename std::enable_if< │ │ │ │ │ + 402 (GeometryTypes::pyramid.id() >> 1) == │ │ │ │ │ + 403 (topologyId >> 1) && │ │ │ │ │ + 404 (GeometryTypes::simplex(3).id() >> 1) == │ │ │ │ │ + 405 (coerceToId >> 1) │ │ │ │ │ + 406 >::type> │ │ │ │ │ + 407 { │ │ │ │ │ + 408 typedef PyramidTriangulation::RefinementImp<3, CoordType> Imp; │ │ │ │ │ + 409 }; │ │ │ │ │ + 410#endif │ │ │ │ │ + 411 │ │ │ │ │ + 412 } // namespace RefinementImp │ │ │ │ │ + 413} // namespace Dune │ │ │ │ │ + 414 │ │ │ │ │ + 415#endif // DUNE_GEOMETRY_REFINEMENT_PYRAMIDTRIANGULATION_CC │ │ │ │ │ +referenceelements.hh │ │ │ │ │ type.hh │ │ │ │ │ A unique label for each type of element that can occur in a grid. │ │ │ │ │ +base.cc │ │ │ │ │ +This file contains the parts independent of a particular Refinement │ │ │ │ │ +implementation. │ │ │ │ │ +simplex.cc │ │ │ │ │ +This file contains the Refinement implementation for simplices (triangles, │ │ │ │ │ +tetrahedrons.... │ │ │ │ │ Dune │ │ │ │ │ Definition affinegeometry.hh:21 │ │ │ │ │ -Dune::QuadratureType::Enum │ │ │ │ │ -Enum │ │ │ │ │ -Definition quadraturerules.hh:82 │ │ │ │ │ -Dune::QuadratureType::GaussJacobi_n_0 │ │ │ │ │ -@ GaussJacobi_n_0 │ │ │ │ │ -Gauss-Legendre rules with . │ │ │ │ │ -Definition quadraturerules.hh:119 │ │ │ │ │ -Dune::QuadratureType::GaussJacobi_2_0 │ │ │ │ │ -@ GaussJacobi_2_0 │ │ │ │ │ -Gauss-Legendre rules with . │ │ │ │ │ -Definition quadraturerules.hh:106 │ │ │ │ │ -Dune::QuadratureType::GaussRadauRight │ │ │ │ │ -@ GaussRadauRight │ │ │ │ │ -Gauss-Radau rules including the right endpoint. │ │ │ │ │ -Definition quadraturerules.hh:144 │ │ │ │ │ -Dune::QuadratureType::GaussJacobi_1_0 │ │ │ │ │ -@ GaussJacobi_1_0 │ │ │ │ │ -Gauss-Jacobi rules with . │ │ │ │ │ -Definition quadraturerules.hh:99 │ │ │ │ │ -Dune::QuadratureType::size │ │ │ │ │ -@ size │ │ │ │ │ -Definition quadraturerules.hh:145 │ │ │ │ │ -Dune::QuadratureType::GaussLobatto │ │ │ │ │ -@ GaussLobatto │ │ │ │ │ -Gauss-Lobatto rules. │ │ │ │ │ -Definition quadraturerules.hh:127 │ │ │ │ │ -Dune::QuadratureType::GaussRadauLeft │ │ │ │ │ -@ GaussRadauLeft │ │ │ │ │ -Gauss-Radau rules including the left endpoint. │ │ │ │ │ -Definition quadraturerules.hh:135 │ │ │ │ │ -Dune::QuadratureType::GaussLegendre │ │ │ │ │ -@ GaussLegendre │ │ │ │ │ -Gauss-Legendre rules (default) │ │ │ │ │ -Definition quadraturerules.hh:92 │ │ │ │ │ -Dune::QuadratureOrderOutOfRange │ │ │ │ │ -Exception thrown if a desired QuadratureRule is not available, because the │ │ │ │ │ -requested order is to high... │ │ │ │ │ -Definition quadraturerules.hh:36 │ │ │ │ │ -Dune::QuadraturePoint │ │ │ │ │ -Single evaluation point in a quadrature rule. │ │ │ │ │ -Definition quadraturerules.hh:44 │ │ │ │ │ -Dune::QuadraturePoint::position │ │ │ │ │ -const Vector & position() const │ │ │ │ │ -return local coordinates of integration point i │ │ │ │ │ -Definition quadraturerules.hh:62 │ │ │ │ │ -Dune::QuadraturePoint::Vector │ │ │ │ │ -Dune::FieldVector< ct, dim > Vector │ │ │ │ │ -Type used for the position of a quadrature point. │ │ │ │ │ -Definition quadraturerules.hh:53 │ │ │ │ │ -Dune::QuadraturePoint::Field │ │ │ │ │ -ct Field │ │ │ │ │ -Number type used for coordinates and quadrature weights. │ │ │ │ │ -Definition quadraturerules.hh:50 │ │ │ │ │ -Dune::QuadraturePoint::weight │ │ │ │ │ -const ct & weight() const │ │ │ │ │ -return weight associated with integration point i │ │ │ │ │ -Definition quadraturerules.hh:68 │ │ │ │ │ -Dune::QuadraturePoint::weight_ │ │ │ │ │ -ct weight_ │ │ │ │ │ -Definition quadraturerules.hh:75 │ │ │ │ │ -Dune::QuadraturePoint::dimension │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::transformCoordinate │ │ │ │ │ +FieldVector< CoordType, dimension > transformCoordinate(FieldVector< CoordType, │ │ │ │ │ +dimension > point) │ │ │ │ │ +Definition pyramidtriangulation.cc:51 │ │ │ │ │ +Dune::RefinementImp::Simplex::getPermutation │ │ │ │ │ +FieldVector< int, n > getPermutation(int m) │ │ │ │ │ +Calculate permutation from it's index. │ │ │ │ │ +Definition simplex.cc:336 │ │ │ │ │ +Dune::RefinementImp::Simplex::referenceToKuhn │ │ │ │ │ +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 │ │ │ │ │ +Dune::Codim │ │ │ │ │ +Static tag representing a codimension. │ │ │ │ │ +Definition dimension.hh:24 │ │ │ │ │ +Dune::MultiLinearGeometry │ │ │ │ │ +generic geometry implementation based on corner coordinates │ │ │ │ │ +Definition multilineargeometry.hh:181 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial │ │ │ │ │ +Definition pyramidtriangulation.cc:43 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementImp │ │ │ │ │ +Implementation of the refinement of a pyramid into simplices. │ │ │ │ │ +Definition pyramidtriangulation.cc:68 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementImp::CoordVector │ │ │ │ │ +FieldVector< CoordType, dimension > CoordVector │ │ │ │ │ +Definition pyramidtriangulation.cc:77 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementImp::nVertices │ │ │ │ │ +static int nVertices(int nIntervals) │ │ │ │ │ +Definition pyramidtriangulation.cc:109 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementImp::nElements │ │ │ │ │ +static int nElements(int nIntervals) │ │ │ │ │ +Definition pyramidtriangulation.cc:133 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementImp::ctype │ │ │ │ │ +CoordType ctype │ │ │ │ │ +Definition pyramidtriangulation.cc:72 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementImp::VertexIterator │ │ │ │ │ +Codim< dimension >::SubEntityIterator VertexIterator │ │ │ │ │ +Definition pyramidtriangulation.cc:76 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementImp::ElementIterator │ │ │ │ │ +Codim< 0 >::SubEntityIterator ElementIterator │ │ │ │ │ +Definition pyramidtriangulation.cc:78 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementImp::dimension │ │ │ │ │ static constexpr int dimension │ │ │ │ │ -Dimension of the integration domain. │ │ │ │ │ -Definition quadraturerules.hh:47 │ │ │ │ │ -Dune::QuadraturePoint::QuadraturePoint │ │ │ │ │ -QuadraturePoint(const Vector &x, ct w) │ │ │ │ │ -set up quadrature of given order in d dimensions │ │ │ │ │ -Definition quadraturerules.hh:56 │ │ │ │ │ -Dune::QuadraturePoint::local │ │ │ │ │ -FieldVector< ct, dim > local │ │ │ │ │ -Definition quadraturerules.hh:74 │ │ │ │ │ -Dune::QuadratureRule │ │ │ │ │ -Abstract base class for quadrature rules. │ │ │ │ │ -Definition quadraturerules.hh:154 │ │ │ │ │ -Dune::QuadratureRule::~QuadratureRule │ │ │ │ │ -virtual ~QuadratureRule() │ │ │ │ │ -Definition quadraturerules.hh:181 │ │ │ │ │ -Dune::QuadratureRule::d │ │ │ │ │ -static constexpr int d │ │ │ │ │ -The space dimension. │ │ │ │ │ -Definition quadraturerules.hh:171 │ │ │ │ │ -Dune::QuadratureRule::type │ │ │ │ │ -virtual GeometryType type() const │ │ │ │ │ -return type of element │ │ │ │ │ -Definition quadraturerules.hh:180 │ │ │ │ │ -Dune::QuadratureRule::delivered_order │ │ │ │ │ -int delivered_order │ │ │ │ │ -Definition quadraturerules.hh:189 │ │ │ │ │ -Dune::QuadratureRule::QuadratureRule │ │ │ │ │ -QuadratureRule(GeometryType t, int order) │ │ │ │ │ -Constructor for a given geometry type and a given quadrature order. │ │ │ │ │ -Definition quadraturerules.hh:168 │ │ │ │ │ -Dune::QuadratureRule::geometry_type │ │ │ │ │ -GeometryType geometry_type │ │ │ │ │ -Definition quadraturerules.hh:188 │ │ │ │ │ -Dune::QuadratureRule::CoordType │ │ │ │ │ -ct CoordType │ │ │ │ │ -The type used for coordinates. │ │ │ │ │ -Definition quadraturerules.hh:174 │ │ │ │ │ -Dune::QuadratureRule::QuadratureRule │ │ │ │ │ -QuadratureRule() │ │ │ │ │ -Default constructor. │ │ │ │ │ -Definition quadraturerules.hh:161 │ │ │ │ │ -Dune::QuadratureRule::order │ │ │ │ │ -virtual int order() const │ │ │ │ │ -return order │ │ │ │ │ -Definition quadraturerules.hh:177 │ │ │ │ │ -Dune::QuadratureRule::QuadratureRule │ │ │ │ │ -QuadratureRule(GeometryType t) │ │ │ │ │ -Constructor for a given geometry type. Leaves the quadrature order invalid │ │ │ │ │ -Definition quadraturerules.hh:165 │ │ │ │ │ -Dune::QuadratureRule::iterator │ │ │ │ │ -std::vector< QuadraturePoint< ct, dim > >::const_iterator iterator │ │ │ │ │ -Definition quadraturerules.hh:185 │ │ │ │ │ -Dune::QuadratureRuleFactory │ │ │ │ │ -Factory class for creation of quadrature rules, depending on GeometryType, │ │ │ │ │ -order and QuadratureType. │ │ │ │ │ -Definition quadraturerules.hh:310 │ │ │ │ │ -Dune::QuadratureRules │ │ │ │ │ -A container for all quadrature rules of dimension dim │ │ │ │ │ -Definition quadraturerules.hh:200 │ │ │ │ │ -Dune::QuadratureRules::maxOrder │ │ │ │ │ -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 │ │ │ │ │ -Dune::QuadratureRules::rule │ │ │ │ │ -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 │ │ │ │ │ -Dune::QuadratureRules::rule │ │ │ │ │ -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 │ │ │ │ │ -Dune::GeometryType │ │ │ │ │ -Unique label for each type of entities that can occur in DUNE grids. │ │ │ │ │ -Definition type.hh:126 │ │ │ │ │ -Dune::GeometryType::isPrism │ │ │ │ │ -constexpr bool isPrism() const │ │ │ │ │ -Return true if entity is a prism. │ │ │ │ │ -Definition type.hh:321 │ │ │ │ │ -Dune::GeometryType::isVertex │ │ │ │ │ -constexpr bool isVertex() const │ │ │ │ │ -Return true if entity is a vertex. │ │ │ │ │ -Definition type.hh:291 │ │ │ │ │ -Dune::GeometryType::dim │ │ │ │ │ -constexpr unsigned int dim() const │ │ │ │ │ -Return dimension of the type. │ │ │ │ │ -Definition type.hh:372 │ │ │ │ │ -Dune::GeometryType::BasicType │ │ │ │ │ -BasicType │ │ │ │ │ -Each entity can be tagged by one of these basic types plus its space dimension. │ │ │ │ │ -Definition type.hh:132 │ │ │ │ │ -Dune::GeometryType::isLine │ │ │ │ │ -constexpr bool isLine() const │ │ │ │ │ -Return true if entity is a line segment. │ │ │ │ │ -Definition type.hh:296 │ │ │ │ │ -Dune::GeometryType::id │ │ │ │ │ -constexpr unsigned int id() const │ │ │ │ │ -Return the topology id of the type. │ │ │ │ │ -Definition type.hh:377 │ │ │ │ │ -Dune::GeometryType::isSimplex │ │ │ │ │ -constexpr bool isSimplex() const │ │ │ │ │ -Return true if entity is a simplex of any dimension. │ │ │ │ │ -Definition type.hh:331 │ │ │ │ │ -Dune::LocalGeometryTypeIndex::size │ │ │ │ │ -static constexpr std::size_t size(std::size_t dim) │ │ │ │ │ -Compute total number of geometry types for the given dimension. │ │ │ │ │ -Definition typeindex.hh:61 │ │ │ │ │ -Dune::LocalGeometryTypeIndex::index │ │ │ │ │ -static constexpr std::size_t index(const GeometryType >) │ │ │ │ │ -Compute the index for the given geometry type within its dimension. │ │ │ │ │ -Definition typeindex.hh:73 │ │ │ │ │ +Definition pyramidtriangulation.cc:70 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementImp::eBegin │ │ │ │ │ +static ElementIterator eBegin(int nIntervals) │ │ │ │ │ +Definition pyramidtriangulation.cc:141 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementImp::eEnd │ │ │ │ │ +static ElementIterator eEnd(int nIntervals) │ │ │ │ │ +Definition pyramidtriangulation.cc:149 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementImp::IndexVector │ │ │ │ │ +FieldVector< int, dimension+1 > IndexVector │ │ │ │ │ +Definition pyramidtriangulation.cc:79 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementImp::vBegin │ │ │ │ │ +static VertexIterator vBegin(int nIntervals) │ │ │ │ │ +Definition pyramidtriangulation.cc:117 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementImp::vEnd │ │ │ │ │ +static VertexIterator vEnd(int nIntervals) │ │ │ │ │ +Definition pyramidtriangulation.cc:125 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementImp::Codim │ │ │ │ │ +Definition pyramidtriangulation.cc:101 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementImp::Codim::Geometry │ │ │ │ │ +Dune::MultiLinearGeometry< CoordType, dimension-codimension, dimension > │ │ │ │ │ +Geometry │ │ │ │ │ +Definition pyramidtriangulation.cc:103 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< │ │ │ │ │ +dimension,_CoordType,_dimension_>::Refinement │ │ │ │ │ +RefinementImp< dimension, CoordType > Refinement │ │ │ │ │ +Definition pyramidtriangulation.cc:164 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< │ │ │ │ │ +dimension,_CoordType,_dimension_>::Geometry │ │ │ │ │ +Refinement::template Codim< dimension >::Geometry Geometry │ │ │ │ │ +Definition pyramidtriangulation.cc:166 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< │ │ │ │ │ +dimension,_CoordType,_dimension_>::BackendRefinement │ │ │ │ │ +Refinement::BackendRefinement BackendRefinement │ │ │ │ │ +Definition pyramidtriangulation.cc:178 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< │ │ │ │ │ +dimension,_CoordType,_dimension_>::backend │ │ │ │ │ +BackendIterator backend │ │ │ │ │ +Definition pyramidtriangulation.cc:185 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< │ │ │ │ │ +dimension,_CoordType,_dimension_>::BackendIterator │ │ │ │ │ +BackendRefinement::template Codim< dimension >::SubEntityIterator │ │ │ │ │ +BackendIterator │ │ │ │ │ +Definition pyramidtriangulation.cc:179 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< │ │ │ │ │ +dimension,_CoordType,_dimension_>::kuhnIndex │ │ │ │ │ +int kuhnIndex │ │ │ │ │ +Definition pyramidtriangulation.cc:184 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< │ │ │ │ │ +dimension,_CoordType,_dimension_>::CoordVector │ │ │ │ │ +Refinement::CoordVector CoordVector │ │ │ │ │ +Definition pyramidtriangulation.cc:165 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< │ │ │ │ │ +dimension,_CoordType,_dimension_>::backendEnd │ │ │ │ │ +const BackendIterator backendEnd │ │ │ │ │ +Definition pyramidtriangulation.cc:186 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< │ │ │ │ │ +dimension,_CoordType,_dimension_>::nIntervals_ │ │ │ │ │ +int nIntervals_ │ │ │ │ │ +Definition pyramidtriangulation.cc:182 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< │ │ │ │ │ +dimension,_CoordType,_0_>::backendEnd │ │ │ │ │ +const BackendIterator backendEnd │ │ │ │ │ +Definition pyramidtriangulation.cc:271 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< │ │ │ │ │ +dimension,_CoordType,_0_>::CoordVector │ │ │ │ │ +Refinement::CoordVector CoordVector │ │ │ │ │ +Definition pyramidtriangulation.cc:246 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< │ │ │ │ │ +dimension,_CoordType,_0_>::nIntervals_ │ │ │ │ │ +int nIntervals_ │ │ │ │ │ +Definition pyramidtriangulation.cc:267 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< │ │ │ │ │ +dimension,_CoordType,_0_>::Geometry │ │ │ │ │ +Refinement::template Codim< 0 >::Geometry Geometry │ │ │ │ │ +Definition pyramidtriangulation.cc:247 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< │ │ │ │ │ +dimension,_CoordType,_0_>::IndexVector │ │ │ │ │ +Refinement::IndexVector IndexVector │ │ │ │ │ +Definition pyramidtriangulation.cc:245 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< │ │ │ │ │ +dimension,_CoordType,_0_>::BackendIterator │ │ │ │ │ +BackendRefinement::template Codim< 0 >::SubEntityIterator BackendIterator │ │ │ │ │ +Definition pyramidtriangulation.cc:264 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< │ │ │ │ │ +dimension,_CoordType,_0_>::kuhnIndex │ │ │ │ │ +int kuhnIndex │ │ │ │ │ +Definition pyramidtriangulation.cc:269 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< │ │ │ │ │ +dimension,_CoordType,_0_>::backend │ │ │ │ │ +BackendIterator backend │ │ │ │ │ +Definition pyramidtriangulation.cc:270 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< │ │ │ │ │ +dimension,_CoordType,_0_>::Refinement │ │ │ │ │ +RefinementImp< dimension, CoordType > Refinement │ │ │ │ │ +Definition pyramidtriangulation.cc:244 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementIteratorSpecial< │ │ │ │ │ +dimension,_CoordType,_0_>::BackendRefinement │ │ │ │ │ +Refinement::BackendRefinement BackendRefinement │ │ │ │ │ +Definition pyramidtriangulation.cc:263 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementImp::Codim<_codimension │ │ │ │ │ +>::equals │ │ │ │ │ +bool equals(const This &other) const │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementImp::Codim<_codimension │ │ │ │ │ +>::This │ │ │ │ │ +SubEntityIterator This │ │ │ │ │ +Definition pyramidtriangulation.cc:360 │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementImp::Codim<_codimension │ │ │ │ │ +>::SubEntityIterator │ │ │ │ │ +SubEntityIterator(int nIntervals, bool end=false) │ │ │ │ │ +Dune::RefinementImp::PyramidTriangulation::RefinementImp::Codim<_codimension │ │ │ │ │ +>::Refinement │ │ │ │ │ +RefinementImp< dimension, CoordType > Refinement │ │ │ │ │ +Definition pyramidtriangulation.cc:359 │ │ │ │ │ +Dune::RefinementImp::Simplex::RefinementImp │ │ │ │ │ +Definition simplex.cc:433 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00227.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: axisalignedcubegeometry.hh File Reference │ │ │ │ +dune-geometry: prismtriangulation.cc File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,49 +65,86 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
axisalignedcubegeometry.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Macros | │ │ │ │ +Functions
│ │ │ │ +
prismtriangulation.cc File Reference
│ │ │ │ │ │ │ │
│ │ │ │ - │ │ │ │ -

A geometry implementation for axis-aligned hypercubes. │ │ │ │ -More...

│ │ │ │ -
#include <bitset>
│ │ │ │ -#include <dune/common/fvector.hh>
│ │ │ │ -#include <dune/common/fmatrix.hh>
│ │ │ │ -#include <dune/common/diagonalmatrix.hh>
│ │ │ │ -#include <dune/geometry/referenceelements.hh>
│ │ │ │ -#include <dune/geometry/type.hh>
│ │ │ │ +
#include <dune/common/fvector.hh>
│ │ │ │ +#include <dune/common/typetraits.hh>
│ │ │ │ +#include <dune/geometry/referenceelements.hh>
│ │ │ │ +#include <dune/geometry/type.hh>
│ │ │ │ +#include "base.cc"
│ │ │ │ +#include "simplex.cc"
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::AxisAlignedCubeGeometry< CoordType, dim, coorddim >
 A geometry implementation for axis-aligned hypercubes. More...
class  Dune::RefinementImp::PrismTriangulation::RefinementImp< dimension_, CoordType >
 Implementation of the refinement of a prism into simplices. More...
 
struct  Dune::RefinementImp::PrismTriangulation::RefinementImp< dimension_, CoordType >::Codim< codimension >
 
class  Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial< dimension, CoordType, dimension >
 
class  Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial< dimension, CoordType, 0 >
 
class  Dune::RefinementImp::PrismTriangulation::RefinementImp< dimension_, CoordType >::Codim< codimension >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::RefinementImp
 This namespace contains the implementation of Refinement.
 
namespace  Dune::RefinementImp::PrismTriangulation
 This namespace contains the Refinement implementation for triangulating prisms (GeometryType::prism -> GeometryType::simplex)
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Macros

#define DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +Functions

template<int dimension, class CoordType >
FieldVector< CoordType, dimension > Dune::RefinementImp::PrismTriangulation::transformCoordinate (FieldVector< CoordType, dimension > point)
 
│ │ │ │ -

Detailed Description

│ │ │ │ -

A geometry implementation for axis-aligned hypercubes.

│ │ │ │ -
│ │ │ │ +

Macro Definition Documentation

│ │ │ │ + │ │ │ │ +

◆ DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC

│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
#define DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -6,29 +6,60 @@ │ │ │ │ │ dune-geometry 2.9.0 │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -axisalignedcubegeometry.hh File Reference │ │ │ │ │ -A geometry implementation for axis-aligned hypercubes. More... │ │ │ │ │ -#include │ │ │ │ │ + * refinement │ │ │ │ │ +Classes | Namespaces | Macros | Functions │ │ │ │ │ +prismtriangulation.cc File Reference │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ #include │ │ │ │ │ +#include "base.cc" │ │ │ │ │ +#include "simplex.cc" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  Dune::AxisAlignedCubeGeometry<_CoordType,_dim,_coorddim_> │ │ │ │ │ -  A geometry implementation for axis-aligned hypercubes. More... │ │ │ │ │ + class  Dune::RefinementImp::PrismTriangulation::RefinementImp<_dimension_, │ │ │ │ │ + CoordType_> │ │ │ │ │ +  Implementation of the refinement of a prism into simplices. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::RefinementImp::PrismTriangulation::RefinementImp<_dimension_, │ │ │ │ │ + CoordType_>::Codim<_codimension_> │ │ │ │ │ +  │ │ │ │ │ + class  Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial< │ │ │ │ │ + dimension,_CoordType,_dimension_> │ │ │ │ │ +  │ │ │ │ │ + class  Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial< │ │ │ │ │ + dimension,_CoordType,_0_> │ │ │ │ │ +  │ │ │ │ │ + class  Dune::RefinementImp::PrismTriangulation::RefinementImp<_dimension_, │ │ │ │ │ + CoordType_>::Codim<_codimension_> │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ -***** Detailed Description ***** │ │ │ │ │ -A geometry implementation for axis-aligned hypercubes. │ │ │ │ │ +namespace  Dune::RefinementImp │ │ │ │ │ +  This namespace contains the implementation of Refinement. │ │ │ │ │ +  │ │ │ │ │ +namespace  Dune::RefinementImp::PrismTriangulation │ │ │ │ │ + This namespace contains the Refinement implementation for │ │ │ │ │ +  triangulating prisms (GeometryType::prism -> GeometryType::simplex) │ │ │ │ │ + │ │ │ │ │ +  │ │ │ │ │ + Macros │ │ │ │ │ +#define DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC │ │ │ │ │ +  │ │ │ │ │ + Functions │ │ │ │ │ +template │ │ │ │ │ +FieldVector< CoordType, dimension > Dune::RefinementImp::PrismTriangulation:: │ │ │ │ │ + transformCoordinate (FieldVector< │ │ │ │ │ + CoordType, dimension > point) │ │ │ │ │ +  │ │ │ │ │ +***** Macro Definition Documentation ***** │ │ │ │ │ +***** ◆ DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC ***** │ │ │ │ │ +#define DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00227_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: axisalignedcubegeometry.hh Source File │ │ │ │ +dune-geometry: prismtriangulation.cc Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,360 +70,520 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
axisalignedcubegeometry.hh
│ │ │ │ +
prismtriangulation.cc
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
│ │ │ │ -
5
│ │ │ │ -
6#ifndef DUNE_GEOMETRY_AXISALIGNED_CUBE_GEOMETRY_HH
│ │ │ │ -
7#define DUNE_GEOMETRY_AXISALIGNED_CUBE_GEOMETRY_HH
│ │ │ │ -
8
│ │ │ │ -
13#include <bitset>
│ │ │ │ -
14
│ │ │ │ -
15#include <dune/common/fvector.hh>
│ │ │ │ -
16#include <dune/common/fmatrix.hh>
│ │ │ │ -
17#include <dune/common/diagonalmatrix.hh>
│ │ │ │ -
18
│ │ │ │ - │ │ │ │ -
20#include <dune/geometry/type.hh>
│ │ │ │ -
21
│ │ │ │ -
22
│ │ │ │ -
23namespace Dune {
│ │ │ │ -
24
│ │ │ │ -
48 template <class CoordType, unsigned int dim, unsigned int coorddim>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
50 {
│ │ │ │ -
51
│ │ │ │ -
52
│ │ │ │ -
53 public:
│ │ │ │ -
54
│ │ │ │ -
56 constexpr static int mydimension = dim;
│ │ │ │ -
57
│ │ │ │ -
59 constexpr static int coorddimension = coorddim;
│ │ │ │ -
60
│ │ │ │ -
62 typedef CoordType ctype;
│ │ │ │ -
63
│ │ │ │ -
65 typedef FieldVector<ctype,dim> LocalCoordinate;
│ │ │ │ -
66
│ │ │ │ -
68 typedef FieldVector<ctype,coorddim> GlobalCoordinate;
│ │ │ │ -
69
│ │ │ │ -
71 typedef ctype Volume;
│ │ │ │ +
5#ifndef DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC
│ │ │ │ +
6#define DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC
│ │ │ │ +
7
│ │ │ │ +
8#include <dune/common/fvector.hh>
│ │ │ │ +
9#include <dune/common/typetraits.hh>
│ │ │ │ +
10
│ │ │ │ + │ │ │ │ +
12#include <dune/geometry/type.hh>
│ │ │ │ +
13
│ │ │ │ +
14#include "base.cc"
│ │ │ │ +
15#include "simplex.cc"
│ │ │ │ +
16
│ │ │ │ +
17namespace Dune
│ │ │ │ +
18{
│ │ │ │ +
19 namespace RefinementImp
│ │ │ │ +
20 {
│ │ │ │ +
│ │ │ │ +
26 namespace PrismTriangulation
│ │ │ │ +
27 {
│ │ │ │ +
28 // ////////////
│ │ │ │ +
29 //
│ │ │ │ +
30 // Utilities
│ │ │ │ +
31 //
│ │ │ │ +
32
│ │ │ │ + │ │ │ │ + │ │ │ │ +
35
│ │ │ │ +
36 // ////////////////////////////////////
│ │ │ │ +
37 //
│ │ │ │ +
38 // Refine a prism with simplices
│ │ │ │ +
39 //
│ │ │ │ +
40
│ │ │ │ +
41 // forward declaration of the iterator base
│ │ │ │ +
42 template<int dimension, class CoordType, int codimension>
│ │ │ │ + │ │ │ │ +
44 /*
│ │ │ │ +
45 * The permutations 0,2 and 3 of the Kuhn-decomposition of a cube into simplices form a prism.
│ │ │ │ +
46 * The resulting prism is not oriented the same as the reference prism and so the Kuhn-coordinates
│ │ │ │ +
47 * have to be transformed using the method below.
│ │ │ │ +
48 */
│ │ │ │ +
49 template<int dimension, class CoordType> FieldVector<CoordType, dimension>
│ │ │ │ +
│ │ │ │ +
50 transformCoordinate(FieldVector<CoordType, dimension> point)
│ │ │ │ +
51 {
│ │ │ │ +
52 FieldVector<CoordType, dimension> transform;
│ │ │ │ +
53 transform[0] = point[1];
│ │ │ │ +
54 transform[1] = 1 - point[0];
│ │ │ │ +
55 transform[2] = point[2];
│ │ │ │ +
56 return transform;
│ │ │ │ +
57 }
│ │ │ │ +
│ │ │ │ +
58
│ │ │ │ +
65 template<int dimension_, class CoordType>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
67 {
│ │ │ │ +
68 public:
│ │ │ │ +
69 constexpr static int dimension = dimension_;
│ │ │ │ +
70
│ │ │ │ +
71 typedef CoordType ctype;
│ │ │ │
72
│ │ │ │ -
79 typedef typename std::conditional<dim==coorddim,
│ │ │ │ -
80 DiagonalMatrix<ctype,dim>,
│ │ │ │ -
81 FieldMatrix<ctype,dim,coorddim> >::type JacobianTransposed;
│ │ │ │ -
82
│ │ │ │ -
89 typedef typename std::conditional<dim==coorddim,
│ │ │ │ -
90 DiagonalMatrix<ctype,dim>,
│ │ │ │ -
91 FieldMatrix<ctype,coorddim,dim> >::type JacobianInverseTransposed;
│ │ │ │ -
92
│ │ │ │ -
100 using Jacobian = std::conditional_t<dim==coorddim, DiagonalMatrix<ctype,dim>, FieldMatrix<ctype,coorddim,dim> >;
│ │ │ │ -
101
│ │ │ │ -
109 using JacobianInverse = std::conditional_t<dim==coorddim, DiagonalMatrix<ctype,dim>, FieldMatrix<ctype,dim,coorddim> >;
│ │ │ │ +
73 template<int codimension>
│ │ │ │ +
74 struct Codim;
│ │ │ │ + │ │ │ │ +
76 typedef FieldVector<CoordType, dimension> CoordVector;
│ │ │ │ + │ │ │ │ +
78 typedef FieldVector<int, dimension+1> IndexVector;
│ │ │ │ +
79
│ │ │ │ +
80 static int nVertices(int nIntervals);
│ │ │ │ +
81 static VertexIterator vBegin(int nIntervals);
│ │ │ │ +
82 static VertexIterator vEnd(int nIntervals);
│ │ │ │ +
83
│ │ │ │ +
84 static int nElements(int nIntervals);
│ │ │ │ +
85 static ElementIterator eBegin(int nIntervals);
│ │ │ │ +
86 static ElementIterator eEnd(int nIntervals);
│ │ │ │ +
87
│ │ │ │ +
88 private:
│ │ │ │ +
89 friend class RefinementIteratorSpecial<dimension, CoordType, 0>;
│ │ │ │ +
90 friend class RefinementIteratorSpecial<dimension, CoordType, dimension>;
│ │ │ │ +
91
│ │ │ │ + │ │ │ │ +
93 };
│ │ │ │ +
│ │ │ │ +
94
│ │ │ │ +
95 template<int dimension, class CoordType>
│ │ │ │ +
96 template<int codimension>
│ │ │ │ +
│ │ │ │ +
97 struct RefinementImp<dimension, CoordType>::Codim
│ │ │ │ +
98 {
│ │ │ │ +
99 class SubEntityIterator;
│ │ │ │ + │ │ │ │ +
101 };
│ │ │ │ +
│ │ │ │ +
102
│ │ │ │ +
103 template<int dimension, class CoordType>
│ │ │ │ +
104 int
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
106 nVertices(int nIntervals)
│ │ │ │ +
107 {
│ │ │ │ +
108 return BackendRefinement::nVertices(nIntervals) * 3;
│ │ │ │ +
109 }
│ │ │ │ +
│ │ │ │
110
│ │ │ │ -
│ │ │ │ -
115 AxisAlignedCubeGeometry(const Dune::FieldVector<ctype,coorddim> lower,
│ │ │ │ -
116 const Dune::FieldVector<ctype,coorddim> upper)
│ │ │ │ -
117 : lower_(lower),
│ │ │ │ -
118 upper_(upper),
│ │ │ │ -
119 axes_()
│ │ │ │ -
120 {
│ │ │ │ -
121 static_assert(dim==coorddim, "Use this constructor only if dim==coorddim!");
│ │ │ │ -
122 // all 'true', but is never actually used
│ │ │ │ -
123 axes_ = (1<<coorddim)-1;
│ │ │ │ -
124 }
│ │ │ │ -
│ │ │ │ -
125
│ │ │ │ -
│ │ │ │ -
133 AxisAlignedCubeGeometry(const Dune::FieldVector<ctype,coorddim> lower,
│ │ │ │ -
134 const Dune::FieldVector<ctype,coorddim> upper,
│ │ │ │ -
135 const std::bitset<coorddim>& axes)
│ │ │ │ -
136 : lower_(lower),
│ │ │ │ -
137 upper_(upper),
│ │ │ │ -
138 axes_(axes)
│ │ │ │ -
139 {
│ │ │ │ -
140 assert(axes.count()==dim);
│ │ │ │ -
141 for (size_t i=0; i<coorddim; i++)
│ │ │ │ -
142 if (not axes_[i])
│ │ │ │ -
143 upper_[i] = lower_[i];
│ │ │ │ -
144 }
│ │ │ │ -
│ │ │ │ -
145
│ │ │ │ -
│ │ │ │ -
150 AxisAlignedCubeGeometry(const Dune::FieldVector<ctype,coorddim> lower)
│ │ │ │ -
151 : lower_(lower)
│ │ │ │ -
152 {}
│ │ │ │ -
│ │ │ │ -
153
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
156 {
│ │ │ │ -
157 return GeometryTypes::cube(dim);
│ │ │ │ -
158 }
│ │ │ │ -
│ │ │ │ -
159
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
162 {
│ │ │ │ -
163 GlobalCoordinate result;
│ │ │ │ -
164 if (dim == coorddim) { // fast case
│ │ │ │ -
165 for (size_t i=0; i<coorddim; i++)
│ │ │ │ -
166 result[i] = lower_[i] + local[i]*(upper_[i] - lower_[i]);
│ │ │ │ -
167 } else if (dim == 0) { // a vertex -- the other fast case
│ │ │ │ -
168 result = lower_; // hope for named-return-type-optimization
│ │ │ │ -
169 } else { // slow case
│ │ │ │ -
170 size_t lc=0;
│ │ │ │ -
171 for (size_t i=0; i<coorddim; i++)
│ │ │ │ -
172 result[i] = (axes_[i])
│ │ │ │ -
173 ? lower_[i] + local[lc++]*(upper_[i] - lower_[i])
│ │ │ │ -
174 : lower_[i];
│ │ │ │ -
175 }
│ │ │ │ -
176 return result;
│ │ │ │ -
177 }
│ │ │ │ -
│ │ │ │ -
178
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
181 {
│ │ │ │ -
182 LocalCoordinate result;
│ │ │ │ -
183 if (dim == coorddim) { // fast case
│ │ │ │ -
184 for (size_t i=0; i<dim; i++)
│ │ │ │ -
185 result[i] = (global[i] - lower_[i]) / (upper_[i] - lower_[i]);
│ │ │ │ -
186 } else if (dim != 0) { // slow case
│ │ │ │ -
187 size_t lc=0;
│ │ │ │ -
188 for (size_t i=0; i<coorddim; i++)
│ │ │ │ -
189 if (axes_[i])
│ │ │ │ -
190 result[lc++] = (global[i] - lower_[i]) / (upper_[i] - lower_[i]);
│ │ │ │ -
191 }
│ │ │ │ -
192 return result;
│ │ │ │ -
193 }
│ │ │ │ -
│ │ │ │ -
194
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
197 {
│ │ │ │ -
198 JacobianTransposed result;
│ │ │ │ -
199
│ │ │ │ -
200 // Actually compute the result. Uses different methods depending
│ │ │ │ -
201 // on what kind of matrix JacobianTransposed is.
│ │ │ │ -
202 jacobianTransposed(result);
│ │ │ │ -
203
│ │ │ │ -
204 return result;
│ │ │ │ -
205 }
│ │ │ │ -
│ │ │ │ -
206
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
209 {
│ │ │ │ - │ │ │ │ -
211
│ │ │ │ -
212 // Actually compute the result. Uses different methods depending
│ │ │ │ -
213 // on what kind of matrix JacobianTransposed is.
│ │ │ │ - │ │ │ │ -
215
│ │ │ │ -
216 return result;
│ │ │ │ -
217 }
│ │ │ │ +
111 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
114 vBegin(int nIntervals)
│ │ │ │ +
115 {
│ │ │ │ +
116 return VertexIterator(nIntervals);
│ │ │ │ +
117 }
│ │ │ │ +
│ │ │ │ +
118
│ │ │ │ +
119 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
122 vEnd(int nIntervals)
│ │ │ │ +
123 {
│ │ │ │ +
124 return VertexIterator(nIntervals, true);
│ │ │ │ +
125 }
│ │ │ │ +
│ │ │ │ +
126
│ │ │ │ +
127 template<int dimension, class CoordType>
│ │ │ │ +
128 int
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
130 nElements(int nIntervals)
│ │ │ │ +
131 {
│ │ │ │ +
132 return BackendRefinement::nElements(nIntervals) * 3;
│ │ │ │ +
133 }
│ │ │ │ +
│ │ │ │ +
134
│ │ │ │ +
135 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
138 eBegin(int nIntervals)
│ │ │ │ +
139 {
│ │ │ │ +
140 return ElementIterator(nIntervals);
│ │ │ │ +
141 }
│ │ │ │ +
│ │ │ │ +
142
│ │ │ │ +
143 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
146 eEnd(int nIntervals)
│ │ │ │ +
147 {
│ │ │ │ +
148 return ElementIterator(nIntervals, true);
│ │ │ │ +
149 }
│ │ │ │ +
│ │ │ │ +
150
│ │ │ │ +
151 // //////////////
│ │ │ │ +
152 //
│ │ │ │ +
153 // The iterator
│ │ │ │ +
154 //
│ │ │ │ +
155
│ │ │ │ +
156 // vertices
│ │ │ │ +
157 template<int dimension, class CoordType>
│ │ │ │ +
│ │ │ │ +
158 class RefinementIteratorSpecial<dimension, CoordType, dimension>
│ │ │ │ +
159 {
│ │ │ │ +
160 public:
│ │ │ │ + │ │ │ │ +
162 typedef typename Refinement::CoordVector CoordVector;
│ │ │ │ +
163 typedef typename Refinement::template Codim<dimension>::Geometry Geometry;
│ │ │ │ +
164
│ │ │ │ +
165 RefinementIteratorSpecial(int nIntervals, bool end = false);
│ │ │ │ +
166
│ │ │ │ +
167 void increment();
│ │ │ │ +
168
│ │ │ │ +
169 CoordVector coords() const;
│ │ │ │ +
170 Geometry geometry () const;
│ │ │ │ +
171
│ │ │ │ +
172 int index() const;
│ │ │ │ +
173 protected:
│ │ │ │ +
174 typedef typename Refinement::BackendRefinement BackendRefinement;
│ │ │ │ +
175 typedef typename BackendRefinement::template Codim<dimension>::SubEntityIterator BackendIterator;
│ │ │ │ +
176 constexpr static int nKuhnSimplices = 3;
│ │ │ │ +
177
│ │ │ │ + │ │ │ │ +
179
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
183 };
│ │ │ │ +
│ │ │ │ +
184
│ │ │ │ +
185 template<int dimension, class CoordType>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
187 RefinementIteratorSpecial(int nIntervals, bool end)
│ │ │ │ +
188 : nIntervals_(nIntervals), kuhnIndex(0),
│ │ │ │ +
189 backend(BackendRefinement::vBegin(nIntervals_)),
│ │ │ │ +
190 backendEnd(BackendRefinement::vEnd(nIntervals_))
│ │ │ │ +
191 {
│ │ │ │ +
192 if (end)
│ │ │ │ +
193 kuhnIndex = nKuhnSimplices;
│ │ │ │ +
194 }
│ │ │ │ +
│ │ │ │ +
195
│ │ │ │ +
196 template<int dimension, class CoordType>
│ │ │ │ +
197 void
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ +
200 {
│ │ │ │ +
201 ++backend;
│ │ │ │ +
202 if (backend == backendEnd)
│ │ │ │ +
203 {
│ │ │ │ +
204 backend = BackendRefinement::vBegin(nIntervals_);
│ │ │ │ +
205 ++kuhnIndex;
│ │ │ │ +
206 }
│ │ │ │ +
207 }
│ │ │ │ +
│ │ │ │ +
208
│ │ │ │ +
209 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
212 coords() const
│ │ │ │ +
213 {
│ │ │ │ +
214 // while the kuhnIndex runs from 0,1,2 the actual permutations we need are 0,2,3
│ │ │ │ +
215 return transformCoordinate(referenceToKuhn(backend.coords(),
│ │ │ │ +
216 getPermutation<dimension>((kuhnIndex + 2) % 4)));
│ │ │ │ +
217 }
│ │ │ │
│ │ │ │
218
│ │ │ │ -
│ │ │ │ -
220 Jacobian jacobian([[maybe_unused]] const LocalCoordinate& local) const
│ │ │ │ -
221 {
│ │ │ │ -
222 return jacobianTransposed(local).transposed();
│ │ │ │ -
223 }
│ │ │ │ -
│ │ │ │ -
224
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
227 {
│ │ │ │ -
228 return jacobianInverseTransposed(local).transposed();
│ │ │ │ -
229 }
│ │ │ │ -
│ │ │ │ -
230
│ │ │ │ -
│ │ │ │ -
234 Volume integrationElement([[maybe_unused]] const LocalCoordinate& local) const
│ │ │ │ -
235 {
│ │ │ │ -
236 return volume();
│ │ │ │ -
237 }
│ │ │ │ -
│ │ │ │ -
238
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
241 {
│ │ │ │ -
242 GlobalCoordinate result;
│ │ │ │ -
243 if (dim==0)
│ │ │ │ -
244 result = lower_;
│ │ │ │ -
245 else {
│ │ │ │ -
246 // Since lower_==upper_ for unused coordinates, this always does the right thing
│ │ │ │ -
247 for (size_t i=0; i<coorddim; i++)
│ │ │ │ -
248 result[i] = CoordType(0.5) * (lower_[i] + upper_[i]);
│ │ │ │ -
249 }
│ │ │ │ -
250 return result;
│ │ │ │ -
251 }
│ │ │ │ -
│ │ │ │ -
252
│ │ │ │ -
│ │ │ │ -
254 int corners() const
│ │ │ │ -
255 {
│ │ │ │ -
256 return 1<<dim;
│ │ │ │ -
257 }
│ │ │ │ -
│ │ │ │ -
258
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
261 {
│ │ │ │ -
262 GlobalCoordinate result;
│ │ │ │ -
263 if (dim == coorddim) { // fast case
│ │ │ │ -
264 for (size_t i=0; i<coorddim; i++)
│ │ │ │ -
265 result[i] = (k & (1<<i)) ? upper_[i] : lower_[i];
│ │ │ │ -
266 } else if (dim == 0) { // vertex
│ │ │ │ -
267 result = lower_; // rely on named return-type optimization
│ │ │ │ -
268 } else { // slow case
│ │ │ │ -
269 unsigned int mask = 1;
│ │ │ │ -
270
│ │ │ │ -
271 for (size_t i=0; i<coorddim; i++) {
│ │ │ │ -
272 if (not axes_[i])
│ │ │ │ -
273 result[i] = lower_[i];
│ │ │ │ -
274 else {
│ │ │ │ -
275 result[i] = (k & mask) ? upper_[i] : lower_[i];
│ │ │ │ -
276 mask = (mask<<1);
│ │ │ │ -
277 }
│ │ │ │ -
278 }
│ │ │ │ -
279 }
│ │ │ │ -
280
│ │ │ │ -
281
│ │ │ │ -
282 return result;
│ │ │ │ -
283 }
│ │ │ │ -
│ │ │ │ -
284
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
287 {
│ │ │ │ -
288 ctype vol = 1;
│ │ │ │ -
289 if (dim == coorddim) { // fast case
│ │ │ │ -
290 for (size_t i=0; i<dim; i++)
│ │ │ │ -
291 vol *= upper_[i] - lower_[i];
│ │ │ │ -
292 // do nothing if dim == 0
│ │ │ │ -
293 } else if (dim != 0) { // slow case
│ │ │ │ -
294 for (size_t i=0; i<coorddim; i++)
│ │ │ │ -
295 if (axes_[i])
│ │ │ │ -
296 vol *= upper_[i] - lower_[i];
│ │ │ │ -
297 }
│ │ │ │ -
298 return vol;
│ │ │ │ -
299 }
│ │ │ │ -
│ │ │ │ -
300
│ │ │ │ -
│ │ │ │ -
302 bool affine() const
│ │ │ │ -
303 {
│ │ │ │ -
304 return true;
│ │ │ │ -
305 }
│ │ │ │ -
│ │ │ │ -
306
│ │ │ │ -
│ │ │ │ -
307 friend Dune::Transitional::ReferenceElement< ctype, Dim<dim> > referenceElement ( const AxisAlignedCubeGeometry & /* geometry */ )
│ │ │ │ -
308 {
│ │ │ │ - │ │ │ │ -
310 }
│ │ │ │ -
│ │ │ │ -
311
│ │ │ │ -
312 private:
│ │ │ │ -
313 // jacobianTransposed: fast case --> diagonal matrix
│ │ │ │ -
314 void jacobianTransposed ( DiagonalMatrix<ctype,dim> &jacobianTransposed ) const
│ │ │ │ -
315 {
│ │ │ │ -
316 for (size_t i=0; i<dim; i++)
│ │ │ │ -
317 jacobianTransposed.diagonal()[i] = upper_[i] - lower_[i];
│ │ │ │ -
318 }
│ │ │ │ -
319
│ │ │ │ -
320 // jacobianTransposed: slow case --> dense matrix
│ │ │ │ -
321 void jacobianTransposed ( FieldMatrix<ctype,dim,coorddim> &jacobianTransposed ) const
│ │ │ │ -
322 {
│ │ │ │ -
323 if (dim==0)
│ │ │ │ -
324 return;
│ │ │ │ -
325
│ │ │ │ -
326 size_t lc = 0;
│ │ │ │ -
327 for (size_t i=0; i<coorddim; i++)
│ │ │ │ -
328 if (axes_[i])
│ │ │ │ -
329 jacobianTransposed[lc++][i] = upper_[i] - lower_[i];
│ │ │ │ -
330 }
│ │ │ │ -
331
│ │ │ │ -
332 // jacobianInverseTransposed: fast case --> diagonal matrix
│ │ │ │ -
333 void jacobianInverseTransposed ( DiagonalMatrix<ctype,dim> &jacobianInverseTransposed ) const
│ │ │ │ -
334 {
│ │ │ │ -
335 for (size_t i=0; i<dim; i++)
│ │ │ │ -
336 jacobianInverseTransposed.diagonal()[i] = CoordType(1.0) / (upper_[i] - lower_[i]);
│ │ │ │ -
337 }
│ │ │ │ -
338
│ │ │ │ -
339 // jacobianInverseTransposed: slow case --> dense matrix
│ │ │ │ -
340 void jacobianInverseTransposed ( FieldMatrix<ctype,coorddim,dim> &jacobianInverseTransposed ) const
│ │ │ │ -
341 {
│ │ │ │ -
342 if (dim==0)
│ │ │ │ -
343 return;
│ │ │ │ -
344
│ │ │ │ -
345 size_t lc = 0;
│ │ │ │ -
346 for (size_t i=0; i<coorddim; i++)
│ │ │ │ -
347 if (axes_[i])
│ │ │ │ -
348 jacobianInverseTransposed[i][lc++] = CoordType(1.0) / (upper_[i] - lower_[i]);
│ │ │ │ -
349 }
│ │ │ │ -
350
│ │ │ │ -
351 Dune::FieldVector<ctype,coorddim> lower_;
│ │ │ │ -
352
│ │ │ │ -
353 Dune::FieldVector<ctype,coorddim> upper_;
│ │ │ │ -
354
│ │ │ │ -
355 std::bitset<coorddim> axes_;
│ │ │ │ -
356 };
│ │ │ │ -
│ │ │ │ +
219 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
222 {
│ │ │ │ +
223 std::vector<CoordVector> corners(1);
│ │ │ │ +
224 corners[0] = transformCoordinate(referenceToKuhn(backend.coords(),
│ │ │ │ +
225 getPermutation<dimension>((kuhnIndex + 2) % 4)));
│ │ │ │ +
226 return Geometry(GeometryTypes::vertex, corners);
│ │ │ │ +
227 }
│ │ │ │ +
│ │ │ │ +
228
│ │ │ │ +
229 template<int dimension, class CoordType>
│ │ │ │ +
230 int
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
232 index() const
│ │ │ │ +
233 {
│ │ │ │ +
234 return kuhnIndex*BackendRefinement::nVertices(nIntervals_) + backend.index();
│ │ │ │ +
235 }
│ │ │ │ +
│ │ │ │ +
236
│ │ │ │ +
237 // elements
│ │ │ │ +
238 template<int dimension, class CoordType>
│ │ │ │ +
│ │ │ │ +
239 class RefinementIteratorSpecial<dimension, CoordType, 0>
│ │ │ │ +
240 {
│ │ │ │ +
241 public:
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
245 typedef typename Refinement::template Codim<0>::Geometry Geometry;
│ │ │ │ +
246
│ │ │ │ +
247 RefinementIteratorSpecial(int nIntervals, bool end = false);
│ │ │ │ +
248
│ │ │ │ +
249 void increment();
│ │ │ │ +
250
│ │ │ │ +
251 IndexVector vertexIndices() const;
│ │ │ │ +
252 int index() const;
│ │ │ │ +
253 CoordVector coords() const;
│ │ │ │ +
254
│ │ │ │ +
255 Geometry geometry () const;
│ │ │ │ +
256
│ │ │ │ +
257 private:
│ │ │ │ +
258 CoordVector global(const CoordVector &local) const;
│ │ │ │ +
259
│ │ │ │ +
260 protected:
│ │ │ │ + │ │ │ │ +
262 typedef typename BackendRefinement::template Codim<0>::SubEntityIterator BackendIterator;
│ │ │ │ +
263 constexpr static int nKuhnSimplices = 3;
│ │ │ │ +
264
│ │ │ │ + │ │ │ │ +
266
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
270 };
│ │ │ │ +
│ │ │ │ +
271
│ │ │ │ +
272 template<int dimension, class CoordType>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
274 RefinementIteratorSpecial(int nIntervals, bool end)
│ │ │ │ +
275 : nIntervals_(nIntervals), kuhnIndex(0),
│ │ │ │ +
276 backend(BackendRefinement::eBegin(nIntervals_)),
│ │ │ │ +
277 backendEnd(BackendRefinement::eEnd(nIntervals_))
│ │ │ │ +
278 {
│ │ │ │ +
279 if (end)
│ │ │ │ +
280 kuhnIndex = nKuhnSimplices;
│ │ │ │ +
281 }
│ │ │ │ +
│ │ │ │ +
282
│ │ │ │ +
283 template<int dimension, class CoordType>
│ │ │ │ +
284 void
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ +
287 {
│ │ │ │ +
288 ++backend;
│ │ │ │ +
289 if (backend == backendEnd)
│ │ │ │ +
290 {
│ │ │ │ +
291 backend = BackendRefinement::eBegin(nIntervals_);
│ │ │ │ +
292 ++kuhnIndex;
│ │ │ │ +
293 }
│ │ │ │ +
294 }
│ │ │ │ +
│ │ │ │ +
295
│ │ │ │ +
296 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
299 vertexIndices() const
│ │ │ │ +
300 {
│ │ │ │ +
301 IndexVector indices = backend.vertexIndices();
│ │ │ │ +
302
│ │ │ │ +
303 int base = kuhnIndex * BackendRefinement::nVertices(nIntervals_);
│ │ │ │ +
304 indices += base;
│ │ │ │ +
305
│ │ │ │ +
306 return indices;
│ │ │ │ +
307 }
│ │ │ │ +
│ │ │ │ +
308
│ │ │ │ +
309 template<int dimension, class CoordType>
│ │ │ │ +
310 int
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
312 index() const
│ │ │ │ +
313 {
│ │ │ │ +
314 return kuhnIndex*BackendRefinement::nElements(nIntervals_) + backend.index();
│ │ │ │ +
315 }
│ │ │ │ +
│ │ │ │ +
316
│ │ │ │ +
317 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
320 coords() const
│ │ │ │ +
321 {
│ │ │ │ +
322 return global(backend.coords());
│ │ │ │ +
323 }
│ │ │ │ +
│ │ │ │ +
324
│ │ │ │ +
325 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
328 {
│ │ │ │ +
329 const typename BackendIterator::Geometry &bgeo =
│ │ │ │ +
330 backend.geometry();
│ │ │ │ +
331 std::vector<CoordVector> corners(dimension+1);
│ │ │ │ +
332 for(int i = 0; i <= dimension; ++i)
│ │ │ │ +
333 corners[i] = global(bgeo.corner(i));
│ │ │ │ +
334
│ │ │ │ +
335 return Geometry(bgeo.type(), corners);
│ │ │ │ +
336 }
│ │ │ │ +
│ │ │ │ +
337
│ │ │ │ +
338 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ + │ │ │ │ +
341 global(const CoordVector &local) const
│ │ │ │ +
342 {
│ │ │ │ +
343 // while the kuhnIndex runs from 0,1,2 the actual permutations we need are 0,2,3
│ │ │ │ +
344 return transformCoordinate(referenceToKuhn(local, getPermutation<dimension>((kuhnIndex+2)%4)));
│ │ │ │ +
345 }
│ │ │ │ +
346
│ │ │ │ +
347 // common
│ │ │ │ +
348 template<int dimension, class CoordType>
│ │ │ │ +
349 template<int codimension>
│ │ │ │ +
│ │ │ │ +
350 class RefinementImp<dimension, CoordType>::Codim<codimension>::SubEntityIterator
│ │ │ │ +
351 : public ForwardIteratorFacade<typename RefinementImp<dimension, CoordType>::template Codim<codimension>::SubEntityIterator, int>,
│ │ │ │ +
352 public RefinementIteratorSpecial<dimension, CoordType, codimension>
│ │ │ │ +
353 {
│ │ │ │ +
354 public:
│ │ │ │ + │ │ │ │ +
356 typedef SubEntityIterator This;
│ │ │ │
357
│ │ │ │ -
358} // namespace Dune
│ │ │ │ -
359#endif
│ │ │ │ - │ │ │ │ -
A unique label for each type of element that can occur in a grid.
│ │ │ │ +
358 SubEntityIterator(int nIntervals, bool end = false);
│ │ │ │ +
359
│ │ │ │ +
360 bool equals(const This &other) const;
│ │ │ │ +
361 protected:
│ │ │ │ +
362 using RefinementIteratorSpecial<dimension, CoordType, codimension>::kuhnIndex;
│ │ │ │ +
363 using RefinementIteratorSpecial<dimension, CoordType, codimension>::backend;
│ │ │ │ +
364 };
│ │ │ │ +
│ │ │ │ +
365
│ │ │ │ +
366#ifndef DOXYGEN
│ │ │ │ +
367 template<int dimension, class CoordType>
│ │ │ │ +
368 template<int codimension>
│ │ │ │ + │ │ │ │ +
370 SubEntityIterator(int nIntervals, bool end)
│ │ │ │ +
371 : RefinementIteratorSpecial<dimension, CoordType, codimension>(nIntervals, end)
│ │ │ │ +
372 {}
│ │ │ │ +
373
│ │ │ │ +
374 template<int dimension, class CoordType>
│ │ │ │ +
375 template<int codimension>
│ │ │ │ +
376 bool
│ │ │ │ + │ │ │ │ +
378 equals(const This &other) const
│ │ │ │ +
379 {
│ │ │ │ +
380 return ((kuhnIndex == other.kuhnIndex) && (backend == other.backend));
│ │ │ │ +
381 }
│ │ │ │ +
382#endif
│ │ │ │ +
383
│ │ │ │ +
384 } // namespace PrismTriangulation
│ │ │ │ +
│ │ │ │ +
385 } // namespace RefinementImp
│ │ │ │ +
386
│ │ │ │ +
387 namespace RefinementImp
│ │ │ │ +
388 {
│ │ │ │ +
389 // ///////////////////////
│ │ │ │ +
390 //
│ │ │ │ +
391 // The refinement traits
│ │ │ │ +
392 //
│ │ │ │ +
393
│ │ │ │ +
394#ifndef DOXYGEN
│ │ │ │ +
395 template<unsigned topologyId, class CoordType, unsigned coerceToId>
│ │ │ │ +
396 struct Traits<
│ │ │ │ +
397 topologyId, CoordType, coerceToId, 3,
│ │ │ │ +
398 typename std::enable_if<
│ │ │ │ +
399 (GeometryTypes::prism.id() >> 1) ==
│ │ │ │ +
400 (topologyId >> 1) &&
│ │ │ │ +
401 (GeometryTypes::simplex(3).id() >> 1) ==
│ │ │ │ +
402 (coerceToId >> 1)
│ │ │ │ +
403 >::type>
│ │ │ │ +
404 {
│ │ │ │ +
405 typedef PrismTriangulation::RefinementImp<3, CoordType> Imp;
│ │ │ │ +
406 };
│ │ │ │ +
407#endif
│ │ │ │ +
408
│ │ │ │ +
409 } // namespace RefinementImp
│ │ │ │ +
410} // namespace Dune
│ │ │ │ +
411
│ │ │ │ +
412#endif // DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC
│ │ │ │ + │ │ │ │ +
A unique label for each type of element that can occur in a grid.
│ │ │ │ +
This file contains the parts independent of a particular Refinement implementation.
│ │ │ │ +
This file contains the Refinement implementation for simplices (triangles, tetrahedrons....
│ │ │ │
Definition affinegeometry.hh:21
│ │ │ │ -
static const ReferenceElement & cube()
get hypercube reference elements
Definition referenceelements.hh:210
│ │ │ │ -
A geometry implementation for axis-aligned hypercubes.
Definition axisalignedcubegeometry.hh:50
│ │ │ │ -
Volume volume() const
Return the element volume.
Definition axisalignedcubegeometry.hh:286
│ │ │ │ -
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
│ │ │ │ -
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
│ │ │ │ -
JacobianInverse jacobianInverse(const LocalCoordinate &local) const
Inverse Jacobian of the transformation from local to global coordinates.
Definition axisalignedcubegeometry.hh:226
│ │ │ │ -
JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate &local) const
Inverse Jacobian transposed of the transformation from local to global coordinates.
Definition axisalignedcubegeometry.hh:208
│ │ │ │ -
std::conditional< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< ctype, dim, coorddim > >::type JacobianTransposed
Return type of jacobianTransposed.
Definition axisalignedcubegeometry.hh:81
│ │ │ │ -
AxisAlignedCubeGeometry(const Dune::FieldVector< ctype, coorddim > lower)
Constructor from a single point only.
Definition axisalignedcubegeometry.hh:150
│ │ │ │ -
static constexpr int mydimension
Dimension of the cube element.
Definition axisalignedcubegeometry.hh:56
│ │ │ │ -
static constexpr int coorddimension
Dimension of the world space that the cube element is embedded in.
Definition axisalignedcubegeometry.hh:59
│ │ │ │ -
GlobalCoordinate corner(int k) const
Return world coordinates of the k-th corner of the element.
Definition axisalignedcubegeometry.hh:260
│ │ │ │ -
ctype Volume
Type used for volume.
Definition axisalignedcubegeometry.hh:71
│ │ │ │ -
FieldVector< ctype, dim > LocalCoordinate
Type used for a vector of element coordinates.
Definition axisalignedcubegeometry.hh:65
│ │ │ │ -
friend Dune::Transitional::ReferenceElement< ctype, Dim< dim > > referenceElement(const AxisAlignedCubeGeometry &)
Definition axisalignedcubegeometry.hh:307
│ │ │ │ -
JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const
Jacobian transposed of the transformation from local to global coordinates.
Definition axisalignedcubegeometry.hh:196
│ │ │ │ -
FieldVector< ctype, coorddim > GlobalCoordinate
Type used for a vector of world coordinates.
Definition axisalignedcubegeometry.hh:68
│ │ │ │ -
LocalCoordinate local(const GlobalCoordinate &global) const
Map a point in global (world) coordinates to element coordinates.
Definition axisalignedcubegeometry.hh:180
│ │ │ │ -
CoordType ctype
Type used for single coordinate coefficients.
Definition axisalignedcubegeometry.hh:62
│ │ │ │ -
std::conditional_t< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< ctype, coorddim, dim > > Jacobian
Return type of jacobian.
Definition axisalignedcubegeometry.hh:100
│ │ │ │ -
GeometryType type() const
Type of the cube. Here: a hypercube of the correct dimension.
Definition axisalignedcubegeometry.hh:155
│ │ │ │ -
int corners() const
Return the number of corners of the element.
Definition axisalignedcubegeometry.hh:254
│ │ │ │ -
Jacobian jacobian(const LocalCoordinate &local) const
Jacobian of the transformation from local to global coordinates.
Definition axisalignedcubegeometry.hh:220
│ │ │ │ -
std::conditional< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< ctype, coorddim, dim > >::type JacobianInverseTransposed
Return type of jacobianInverseTransposed.
Definition axisalignedcubegeometry.hh:91
│ │ │ │ -
Volume integrationElement(const LocalCoordinate &local) const
Return the integration element, i.e., the determinant term in the integral transformation formula.
Definition axisalignedcubegeometry.hh:234
│ │ │ │ -
GlobalCoordinate center() const
Return center of mass of the element.
Definition axisalignedcubegeometry.hh:240
│ │ │ │ -
bool affine() const
Return if the element is affine. Here: yes.
Definition axisalignedcubegeometry.hh:302
│ │ │ │ -
std::conditional_t< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< ctype, dim, coorddim > > JacobianInverse
Return type of jacobianInverse.
Definition axisalignedcubegeometry.hh:109
│ │ │ │ -
GlobalCoordinate global(const LocalCoordinate &local) const
Map a point in local (element) coordinates to world coordinates.
Definition axisalignedcubegeometry.hh:161
│ │ │ │ -
Unique label for each type of entities that can occur in DUNE grids.
Definition type.hh:126
│ │ │ │ +
FieldVector< CoordType, dimension > transformCoordinate(FieldVector< CoordType, dimension > point)
Definition prismtriangulation.cc:50
│ │ │ │ +
FieldVector< int, n > getPermutation(int m)
Calculate permutation from it's index.
Definition simplex.cc:336
│ │ │ │ +
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
│ │ │ │ +
Static tag representing a codimension.
Definition dimension.hh:24
│ │ │ │ +
generic geometry implementation based on corner coordinates
Definition multilineargeometry.hh:181
│ │ │ │ + │ │ │ │ +
Implementation of the refinement of a prism into simplices.
Definition prismtriangulation.cc:67
│ │ │ │ +
static constexpr int dimension
Definition prismtriangulation.cc:69
│ │ │ │ +
CoordType ctype
Definition prismtriangulation.cc:71
│ │ │ │ +
static VertexIterator vEnd(int nIntervals)
Definition prismtriangulation.cc:122
│ │ │ │ +
FieldVector< int, dimension+1 > IndexVector
Definition prismtriangulation.cc:78
│ │ │ │ +
static ElementIterator eEnd(int nIntervals)
Definition prismtriangulation.cc:146
│ │ │ │ +
static int nVertices(int nIntervals)
Definition prismtriangulation.cc:106
│ │ │ │ +
FieldVector< CoordType, dimension > CoordVector
Definition prismtriangulation.cc:76
│ │ │ │ +
static int nElements(int nIntervals)
Definition prismtriangulation.cc:130
│ │ │ │ +
Codim< 0 >::SubEntityIterator ElementIterator
Definition prismtriangulation.cc:77
│ │ │ │ +
Codim< dimension >::SubEntityIterator VertexIterator
Definition prismtriangulation.cc:75
│ │ │ │ +
static ElementIterator eBegin(int nIntervals)
Definition prismtriangulation.cc:138
│ │ │ │ +
static VertexIterator vBegin(int nIntervals)
Definition prismtriangulation.cc:114
│ │ │ │ + │ │ │ │ +
Dune::MultiLinearGeometry< CoordType, dimension-codimension, dimension > Geometry
Definition prismtriangulation.cc:100
│ │ │ │ + │ │ │ │ +
Refinement::template Codim< dimension >::Geometry Geometry
Definition prismtriangulation.cc:163
│ │ │ │ +
Refinement::BackendRefinement BackendRefinement
Definition prismtriangulation.cc:174
│ │ │ │ +
BackendRefinement::template Codim< dimension >::SubEntityIterator BackendIterator
Definition prismtriangulation.cc:175
│ │ │ │ + │ │ │ │ + │ │ │ │ +
RefinementImp< dimension, CoordType > Refinement
Definition prismtriangulation.cc:161
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
Refinement::template Codim< 0 >::Geometry Geometry
Definition prismtriangulation.cc:245
│ │ │ │ + │ │ │ │ +
Refinement::IndexVector IndexVector
Definition prismtriangulation.cc:243
│ │ │ │ +
BackendRefinement::template Codim< 0 >::SubEntityIterator BackendIterator
Definition prismtriangulation.cc:262
│ │ │ │ + │ │ │ │ +
Refinement::CoordVector CoordVector
Definition prismtriangulation.cc:244
│ │ │ │ +
RefinementImp< dimension, CoordType > Refinement
Definition prismtriangulation.cc:242
│ │ │ │ + │ │ │ │ +
Refinement::BackendRefinement BackendRefinement
Definition prismtriangulation.cc:261
│ │ │ │ +
SubEntityIterator This
Definition prismtriangulation.cc:356
│ │ │ │ + │ │ │ │ +
RefinementImp< dimension, CoordType > Refinement
Definition prismtriangulation.cc:355
│ │ │ │ + │ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -7,431 +7,605 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ -axisalignedcubegeometry.hh │ │ │ │ │ + * refinement │ │ │ │ │ +prismtriangulation.cc │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception │ │ │ │ │ - 5 │ │ │ │ │ - 6#ifndef DUNE_GEOMETRY_AXISALIGNED_CUBE_GEOMETRY_HH │ │ │ │ │ - 7#define DUNE_GEOMETRY_AXISALIGNED_CUBE_GEOMETRY_HH │ │ │ │ │ - 8 │ │ │ │ │ - 13#include │ │ │ │ │ - 14 │ │ │ │ │ - 15#include │ │ │ │ │ - 16#include │ │ │ │ │ - 17#include │ │ │ │ │ - 18 │ │ │ │ │ - 19#include │ │ │ │ │ - 20#include │ │ │ │ │ - 21 │ │ │ │ │ - 22 │ │ │ │ │ - 23namespace Dune { │ │ │ │ │ - 24 │ │ │ │ │ - 48 template │ │ │ │ │ -49 class AxisAlignedCubeGeometry │ │ │ │ │ - 50 { │ │ │ │ │ - 51 │ │ │ │ │ - 52 │ │ │ │ │ - 53 public: │ │ │ │ │ - 54 │ │ │ │ │ -56 constexpr static int mydimension = dim; │ │ │ │ │ - 57 │ │ │ │ │ -59 constexpr static int coorddimension = coorddim; │ │ │ │ │ - 60 │ │ │ │ │ -62 typedef CoordType ctype; │ │ │ │ │ - 63 │ │ │ │ │ -65 typedef FieldVector LocalCoordinate; │ │ │ │ │ - 66 │ │ │ │ │ -68 typedef FieldVector GlobalCoordinate; │ │ │ │ │ - 69 │ │ │ │ │ -71 typedef ctype Volume; │ │ │ │ │ + 5#ifndef DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC │ │ │ │ │ +6#define DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC │ │ │ │ │ + 7 │ │ │ │ │ + 8#include │ │ │ │ │ + 9#include │ │ │ │ │ + 10 │ │ │ │ │ + 11#include │ │ │ │ │ + 12#include │ │ │ │ │ + 13 │ │ │ │ │ + 14#include "base.cc" │ │ │ │ │ + 15#include "simplex.cc" │ │ │ │ │ + 16 │ │ │ │ │ + 17namespace Dune │ │ │ │ │ + 18{ │ │ │ │ │ + 19 namespace RefinementImp │ │ │ │ │ + 20 { │ │ │ │ │ +26 namespace PrismTriangulation │ │ │ │ │ + 27 { │ │ │ │ │ + 28 // //////////// │ │ │ │ │ + 29 // │ │ │ │ │ + 30 // Utilities │ │ │ │ │ + 31 // │ │ │ │ │ + 32 │ │ │ │ │ + 33 using Simplex::getPermutation; │ │ │ │ │ + 34 using Simplex::referenceToKuhn; │ │ │ │ │ + 35 │ │ │ │ │ + 36 // //////////////////////////////////// │ │ │ │ │ + 37 // │ │ │ │ │ + 38 // Refine a prism with simplices │ │ │ │ │ + 39 // │ │ │ │ │ + 40 │ │ │ │ │ + 41 // forward declaration of the iterator base │ │ │ │ │ + 42 template │ │ │ │ │ +43 class RefinementIteratorSpecial; │ │ │ │ │ + 44 /* │ │ │ │ │ + 45 * The permutations 0,2 and 3 of the Kuhn-decomposition of a cube into │ │ │ │ │ +simplices form a prism. │ │ │ │ │ + 46 * The resulting prism is not oriented the same as the reference prism and │ │ │ │ │ +so the Kuhn-coordinates │ │ │ │ │ + 47 * have to be transformed using the method below. │ │ │ │ │ + 48 */ │ │ │ │ │ + 49 template FieldVector │ │ │ │ │ +50 transformCoordinate(FieldVector point) │ │ │ │ │ + 51 { │ │ │ │ │ + 52 FieldVector transform; │ │ │ │ │ + 53 transform[0] = point[1]; │ │ │ │ │ + 54 transform[1] = 1 - point[0]; │ │ │ │ │ + 55 transform[2] = point[2]; │ │ │ │ │ + 56 return transform; │ │ │ │ │ + 57 } │ │ │ │ │ + 58 │ │ │ │ │ + 65 template │ │ │ │ │ +66 class RefinementImp │ │ │ │ │ + 67 { │ │ │ │ │ + 68 public: │ │ │ │ │ +69 constexpr static int dimension = dimension_; │ │ │ │ │ + 70 │ │ │ │ │ +71 typedef CoordType ctype; │ │ │ │ │ 72 │ │ │ │ │ - 79 typedef typename std::conditional, │ │ │ │ │ -81 FieldMatrix >::type JacobianTransposed; │ │ │ │ │ - 82 │ │ │ │ │ - 89 typedef typename std::conditional, │ │ │ │ │ -91 FieldMatrix >::type JacobianInverseTransposed; │ │ │ │ │ - 92 │ │ │ │ │ -100 using Jacobian = std::conditional_t, FieldMatrix >; │ │ │ │ │ - 101 │ │ │ │ │ -109 using JacobianInverse = std::conditional_t, FieldMatrix >; │ │ │ │ │ + 73 template │ │ │ │ │ + 74 struct Codim; │ │ │ │ │ +75 typedef typename Codim::SubEntityIterator VertexIterator; │ │ │ │ │ +76 typedef FieldVector CoordVector; │ │ │ │ │ +77 typedef typename Codim<0>::SubEntityIterator ElementIterator; │ │ │ │ │ +78 typedef FieldVector IndexVector; │ │ │ │ │ + 79 │ │ │ │ │ + 80 static int nVertices(int nIntervals); │ │ │ │ │ + 81 static VertexIterator vBegin(int nIntervals); │ │ │ │ │ + 82 static VertexIterator vEnd(int nIntervals); │ │ │ │ │ + 83 │ │ │ │ │ + 84 static int nElements(int nIntervals); │ │ │ │ │ + 85 static ElementIterator eBegin(int nIntervals); │ │ │ │ │ +86 static ElementIterator eEnd(int nIntervals); │ │ │ │ │ + 87 │ │ │ │ │ + 88 private: │ │ │ │ │ + 89 friend class RefinementIteratorSpecial; │ │ │ │ │ + 90 friend class RefinementIteratorSpecial; │ │ │ │ │ + 91 │ │ │ │ │ + 92 typedef Simplex::RefinementImp BackendRefinement; │ │ │ │ │ + 93 }; │ │ │ │ │ + 94 │ │ │ │ │ + 95 template │ │ │ │ │ + 96 template │ │ │ │ │ +97 struct RefinementImp::Codim │ │ │ │ │ + 98 { │ │ │ │ │ + 99 class SubEntityIterator; │ │ │ │ │ +100 typedef Dune::MultiLinearGeometry Geometry; │ │ │ │ │ + 101 }; │ │ │ │ │ + 102 │ │ │ │ │ + 103 template │ │ │ │ │ + 104 int │ │ │ │ │ +105 RefinementImp:: │ │ │ │ │ + 106nVertices(int nIntervals) │ │ │ │ │ + 107 { │ │ │ │ │ + 108 return BackendRefinement::nVertices(nIntervals) * 3; │ │ │ │ │ + 109 } │ │ │ │ │ 110 │ │ │ │ │ -115 AxisAlignedCubeGeometry(const Dune::FieldVector lower, │ │ │ │ │ - 116 const Dune::FieldVector upper) │ │ │ │ │ - 117 : lower_(lower), │ │ │ │ │ - 118 upper_(upper), │ │ │ │ │ - 119 axes_() │ │ │ │ │ - 120 { │ │ │ │ │ - 121 static_assert(dim==coorddim, "Use this constructor only if │ │ │ │ │ -dim==coorddim!"); │ │ │ │ │ - 122 // all 'true', but is never actually used │ │ │ │ │ - 123 axes_ = (1< lower, │ │ │ │ │ - 134 const Dune::FieldVector upper, │ │ │ │ │ - 135 const std::bitset& axes) │ │ │ │ │ - 136 : lower_(lower), │ │ │ │ │ - 137 upper_(upper), │ │ │ │ │ - 138 axes_(axes) │ │ │ │ │ + 111 template │ │ │ │ │ + 112 typename RefinementImp::VertexIterator │ │ │ │ │ +113 RefinementImp:: │ │ │ │ │ + 114vBegin(int nIntervals) │ │ │ │ │ + 115 { │ │ │ │ │ + 116 return VertexIterator(nIntervals); │ │ │ │ │ + 117 } │ │ │ │ │ + 118 │ │ │ │ │ + 119 template │ │ │ │ │ + 120 typename RefinementImp::VertexIterator │ │ │ │ │ +121 RefinementImp:: │ │ │ │ │ + 122vEnd(int nIntervals) │ │ │ │ │ + 123 { │ │ │ │ │ + 124 return VertexIterator(nIntervals, true); │ │ │ │ │ + 125 } │ │ │ │ │ + 126 │ │ │ │ │ + 127 template │ │ │ │ │ + 128 int │ │ │ │ │ +129 RefinementImp:: │ │ │ │ │ + 130nElements(int nIntervals) │ │ │ │ │ + 131 { │ │ │ │ │ + 132 return BackendRefinement::nElements(nIntervals) * 3; │ │ │ │ │ + 133 } │ │ │ │ │ + 134 │ │ │ │ │ + 135 template │ │ │ │ │ + 136 typename RefinementImp::ElementIterator │ │ │ │ │ +137 RefinementImp:: │ │ │ │ │ + 138eBegin(int nIntervals) │ │ │ │ │ 139 { │ │ │ │ │ - 140 assert(axes.count()==dim); │ │ │ │ │ - 141 for (size_t i=0; i lower) │ │ │ │ │ - 151 : lower_(lower) │ │ │ │ │ - 152 {} │ │ │ │ │ - 153 │ │ │ │ │ -155 GeometryType type() const │ │ │ │ │ - 156 { │ │ │ │ │ - 157 return GeometryTypes::cube(dim); │ │ │ │ │ - 158 } │ │ │ │ │ - 159 │ │ │ │ │ -161 GlobalCoordinate global(const LocalCoordinate& local) const │ │ │ │ │ - 162 { │ │ │ │ │ - 163 GlobalCoordinate result; │ │ │ │ │ - 164 if (dim == coorddim) { // fast case │ │ │ │ │ - 165 for (size_t i=0; i │ │ │ │ │ + 144 typename RefinementImp::ElementIterator │ │ │ │ │ +145 RefinementImp:: │ │ │ │ │ + 146eEnd(int nIntervals) │ │ │ │ │ + 147 { │ │ │ │ │ + 148 return ElementIterator(nIntervals, true); │ │ │ │ │ + 149 } │ │ │ │ │ + 150 │ │ │ │ │ + 151 // ////////////// │ │ │ │ │ + 152 // │ │ │ │ │ + 153 // The iterator │ │ │ │ │ + 154 // │ │ │ │ │ + 155 │ │ │ │ │ + 156 // vertices │ │ │ │ │ + 157 template │ │ │ │ │ +158 class RefinementIteratorSpecial │ │ │ │ │ + 159 { │ │ │ │ │ + 160 public: │ │ │ │ │ +161 typedef RefinementImp Refinement; │ │ │ │ │ +162 typedef typename Refinement::CoordVector CoordVector; │ │ │ │ │ +163 typedef typename Refinement::template Codim::Geometry Geometry; │ │ │ │ │ + 164 │ │ │ │ │ + 165 RefinementIteratorSpecial(int nIntervals, bool end = false); │ │ │ │ │ + 166 │ │ │ │ │ + 167 void increment(); │ │ │ │ │ + 168 │ │ │ │ │ + 169 CoordVector coords() const; │ │ │ │ │ + 170 Geometry geometry () const; │ │ │ │ │ + 171 │ │ │ │ │ + 172 int index() const; │ │ │ │ │ + 173 protected: │ │ │ │ │ +174 typedef typename Refinement::BackendRefinement BackendRefinement; │ │ │ │ │ +175 typedef typename BackendRefinement::template Codim:: │ │ │ │ │ +SubEntityIterator BackendIterator; │ │ │ │ │ +176 constexpr static int nKuhnSimplices = 3; │ │ │ │ │ + 177 │ │ │ │ │ +178 int nIntervals_; │ │ │ │ │ + 179 │ │ │ │ │ +180 int kuhnIndex; │ │ │ │ │ +181 BackendIterator backend; │ │ │ │ │ +182 const BackendIterator backendEnd; │ │ │ │ │ + 183 }; │ │ │ │ │ + 184 │ │ │ │ │ + 185 template │ │ │ │ │ +186 RefinementIteratorSpecial:: │ │ │ │ │ + 187RefinementIteratorSpecial(int nIntervals, bool end) │ │ │ │ │ + 188 : nIntervals_(nIntervals), kuhnIndex(0), │ │ │ │ │ + 189 backend(BackendRefinement::vBegin(nIntervals_)), │ │ │ │ │ + 190 backendEnd(BackendRefinement::vEnd(nIntervals_)) │ │ │ │ │ + 191 { │ │ │ │ │ + 192 if (end) │ │ │ │ │ + 193 kuhnIndex = nKuhnSimplices; │ │ │ │ │ + 194 } │ │ │ │ │ + 195 │ │ │ │ │ + 196 template │ │ │ │ │ + 197 void │ │ │ │ │ +198 RefinementIteratorSpecial:: │ │ │ │ │ + 199increment() │ │ │ │ │ + 200 { │ │ │ │ │ + 201 ++backend; │ │ │ │ │ + 202 if (backend == backendEnd) │ │ │ │ │ + 203 { │ │ │ │ │ + 204 backend = BackendRefinement::vBegin(nIntervals_); │ │ │ │ │ + 205 ++kuhnIndex; │ │ │ │ │ + 206 } │ │ │ │ │ + 207 } │ │ │ │ │ + 208 │ │ │ │ │ + 209 template │ │ │ │ │ + 210 typename RefinementIteratorSpecial:: │ │ │ │ │ +CoordVector │ │ │ │ │ +211 RefinementIteratorSpecial:: │ │ │ │ │ + 212coords() const │ │ │ │ │ + 213 { │ │ │ │ │ + 214 // while the kuhnIndex runs from 0,1,2 the actual permutations we need are │ │ │ │ │ +0,2,3 │ │ │ │ │ + 215 return transformCoordinate(referenceToKuhn(backend.coords(), │ │ │ │ │ + 216 getPermutation((kuhnIndex + 2) % 4))); │ │ │ │ │ 217 } │ │ │ │ │ 218 │ │ │ │ │ -220 Jacobian jacobian([[maybe_unused]] const LocalCoordinate& local) const │ │ │ │ │ - 221 { │ │ │ │ │ - 222 return jacobianTransposed(local).transposed(); │ │ │ │ │ - 223 } │ │ │ │ │ - 224 │ │ │ │ │ -226 JacobianInverse jacobianInverse([[maybe_unused]] const LocalCoordinate& │ │ │ │ │ -local) const │ │ │ │ │ - 227 { │ │ │ │ │ - 228 return jacobianInverseTransposed(local).transposed(); │ │ │ │ │ - 229 } │ │ │ │ │ - 230 │ │ │ │ │ -234 Volume integrationElement([[maybe_unused]] const LocalCoordinate& local) │ │ │ │ │ + 219 template │ │ │ │ │ + 220 typename RefinementIteratorSpecial:: │ │ │ │ │ +Geometry │ │ │ │ │ +221 RefinementIteratorSpecial::geometry () │ │ │ │ │ const │ │ │ │ │ - 235 { │ │ │ │ │ - 236 return volume(); │ │ │ │ │ - 237 } │ │ │ │ │ - 238 │ │ │ │ │ -240 GlobalCoordinate center() const │ │ │ │ │ - 241 { │ │ │ │ │ - 242 GlobalCoordinate result; │ │ │ │ │ - 243 if (dim==0) │ │ │ │ │ - 244 result = lower_; │ │ │ │ │ - 245 else { │ │ │ │ │ - 246 // Since lower_==upper_ for unused coordinates, this always does the right │ │ │ │ │ -thing │ │ │ │ │ - 247 for (size_t i=0; i corners(1); │ │ │ │ │ + 224 corners[0] = transformCoordinate(referenceToKuhn(backend.coords(), │ │ │ │ │ + 225 getPermutation((kuhnIndex + 2) % 4))); │ │ │ │ │ + 226 return Geometry(GeometryTypes::vertex, corners); │ │ │ │ │ + 227 } │ │ │ │ │ + 228 │ │ │ │ │ + 229 template │ │ │ │ │ + 230 int │ │ │ │ │ +231 RefinementIteratorSpecial:: │ │ │ │ │ + 232index() const │ │ │ │ │ + 233 { │ │ │ │ │ + 234 return kuhnIndex*BackendRefinement::nVertices(nIntervals_) + backend.index │ │ │ │ │ +(); │ │ │ │ │ + 235 } │ │ │ │ │ + 236 │ │ │ │ │ + 237 // elements │ │ │ │ │ + 238 template │ │ │ │ │ +239 class RefinementIteratorSpecial │ │ │ │ │ + 240 { │ │ │ │ │ + 241 public: │ │ │ │ │ +242 typedef RefinementImp Refinement; │ │ │ │ │ +243 typedef typename Refinement::IndexVector IndexVector; │ │ │ │ │ +244 typedef typename Refinement::CoordVector CoordVector; │ │ │ │ │ +245 typedef typename Refinement::template Codim<0>::Geometry Geometry; │ │ │ │ │ + 246 │ │ │ │ │ + 247 RefinementIteratorSpecial(int nIntervals, bool end = false); │ │ │ │ │ + 248 │ │ │ │ │ + 249 void increment(); │ │ │ │ │ + 250 │ │ │ │ │ + 251 IndexVector vertexIndices() const; │ │ │ │ │ + 252 int index() const; │ │ │ │ │ + 253 CoordVector coords() const; │ │ │ │ │ + 254 │ │ │ │ │ + 255 Geometry geometry () const; │ │ │ │ │ + 256 │ │ │ │ │ + 257 private: │ │ │ │ │ + 258 CoordVector global(const CoordVector &local) const; │ │ │ │ │ + 259 │ │ │ │ │ + 260 protected: │ │ │ │ │ +261 typedef typename Refinement::BackendRefinement BackendRefinement; │ │ │ │ │ +262 typedef typename BackendRefinement::template Codim<0>::SubEntityIterator │ │ │ │ │ +BackendIterator; │ │ │ │ │ +263 constexpr static int nKuhnSimplices = 3; │ │ │ │ │ + 264 │ │ │ │ │ +265 int nIntervals_; │ │ │ │ │ + 266 │ │ │ │ │ +267 int kuhnIndex; │ │ │ │ │ +268 BackendIterator backend; │ │ │ │ │ +269 const BackendIterator backendEnd; │ │ │ │ │ + 270 }; │ │ │ │ │ + 271 │ │ │ │ │ + 272 template │ │ │ │ │ +273 RefinementIteratorSpecial:: │ │ │ │ │ + 274RefinementIteratorSpecial(int nIntervals, bool end) │ │ │ │ │ + 275 : nIntervals_(nIntervals), kuhnIndex(0), │ │ │ │ │ + 276 backend(BackendRefinement::eBegin(nIntervals_)), │ │ │ │ │ + 277 backendEnd(BackendRefinement::eEnd(nIntervals_)) │ │ │ │ │ + 278 { │ │ │ │ │ + 279 if (end) │ │ │ │ │ + 280 kuhnIndex = nKuhnSimplices; │ │ │ │ │ + 281 } │ │ │ │ │ + 282 │ │ │ │ │ + 283 template │ │ │ │ │ + 284 void │ │ │ │ │ +285 RefinementIteratorSpecial:: │ │ │ │ │ + 286increment() │ │ │ │ │ 287 { │ │ │ │ │ - 288 ctype vol = 1; │ │ │ │ │ - 289 if (dim == coorddim) { // fast case │ │ │ │ │ - 290 for (size_t i=0; i > │ │ │ │ │ -referenceElement ( const AxisAlignedCubeGeometry & /* geometry */ ) │ │ │ │ │ - 308 { │ │ │ │ │ - 309 return ReferenceElements<_ctype,_dim_>::cube(); │ │ │ │ │ - 310 } │ │ │ │ │ - 311 │ │ │ │ │ - 312 private: │ │ │ │ │ - 313 // jacobianTransposed: fast case --> diagonal matrix │ │ │ │ │ - 314 void jacobianTransposed ( DiagonalMatrix &jacobianTransposed ) │ │ │ │ │ -const │ │ │ │ │ - 315 { │ │ │ │ │ - 316 for (size_t i=0; i dense matrix │ │ │ │ │ - 321 void jacobianTransposed ( FieldMatrix │ │ │ │ │ -&jacobianTransposed ) const │ │ │ │ │ - 322 { │ │ │ │ │ - 323 if (dim==0) │ │ │ │ │ - 324 return; │ │ │ │ │ - 325 │ │ │ │ │ - 326 size_t lc = 0; │ │ │ │ │ - 327 for (size_t i=0; i diagonal matrix │ │ │ │ │ - 333 void jacobianInverseTransposed ( DiagonalMatrix │ │ │ │ │ -&jacobianInverseTransposed ) const │ │ │ │ │ - 334 { │ │ │ │ │ - 335 for (size_t i=0; i dense matrix │ │ │ │ │ - 340 void jacobianInverseTransposed ( FieldMatrix │ │ │ │ │ -&jacobianInverseTransposed ) const │ │ │ │ │ - 341 { │ │ │ │ │ - 342 if (dim==0) │ │ │ │ │ - 343 return; │ │ │ │ │ - 344 │ │ │ │ │ - 345 size_t lc = 0; │ │ │ │ │ - 346 for (size_t i=0; i lower_; │ │ │ │ │ - 352 │ │ │ │ │ - 353 Dune::FieldVector upper_; │ │ │ │ │ - 354 │ │ │ │ │ - 355 std::bitset axes_; │ │ │ │ │ - 356 }; │ │ │ │ │ + 288 ++backend; │ │ │ │ │ + 289 if (backend == backendEnd) │ │ │ │ │ + 290 { │ │ │ │ │ + 291 backend = BackendRefinement::eBegin(nIntervals_); │ │ │ │ │ + 292 ++kuhnIndex; │ │ │ │ │ + 293 } │ │ │ │ │ + 294 } │ │ │ │ │ + 295 │ │ │ │ │ + 296 template │ │ │ │ │ + 297 typename RefinementIteratorSpecial::IndexVector │ │ │ │ │ +298 RefinementIteratorSpecial:: │ │ │ │ │ + 299vertexIndices() const │ │ │ │ │ + 300 { │ │ │ │ │ + 301 IndexVector indices = backend.vertexIndices(); │ │ │ │ │ + 302 │ │ │ │ │ + 303 int base = kuhnIndex * BackendRefinement::nVertices(nIntervals_); │ │ │ │ │ + 304 indices += base; │ │ │ │ │ + 305 │ │ │ │ │ + 306 return indices; │ │ │ │ │ + 307 } │ │ │ │ │ + 308 │ │ │ │ │ + 309 template │ │ │ │ │ + 310 int │ │ │ │ │ +311 RefinementIteratorSpecial:: │ │ │ │ │ + 312index() const │ │ │ │ │ + 313 { │ │ │ │ │ + 314 return kuhnIndex*BackendRefinement::nElements(nIntervals_) + backend.index │ │ │ │ │ +(); │ │ │ │ │ + 315 } │ │ │ │ │ + 316 │ │ │ │ │ + 317 template │ │ │ │ │ + 318 typename RefinementIteratorSpecial::CoordVector │ │ │ │ │ +319 RefinementIteratorSpecial:: │ │ │ │ │ + 320coords() const │ │ │ │ │ + 321 { │ │ │ │ │ + 322 return global(backend.coords()); │ │ │ │ │ + 323 } │ │ │ │ │ + 324 │ │ │ │ │ + 325 template │ │ │ │ │ + 326 typename RefinementIteratorSpecial::Geometry │ │ │ │ │ +327 RefinementIteratorSpecial::geometry () const │ │ │ │ │ + 328 { │ │ │ │ │ + 329 const typename BackendIterator::Geometry &bgeo = │ │ │ │ │ + 330 backend.geometry(); │ │ │ │ │ + 331 std::vector corners(dimension+1); │ │ │ │ │ + 332 for(int i = 0; i <= dimension; ++i) │ │ │ │ │ + 333 corners[i] = global(bgeo.corner(i)); │ │ │ │ │ + 334 │ │ │ │ │ + 335 return Geometry(bgeo.type(), corners); │ │ │ │ │ + 336 } │ │ │ │ │ + 337 │ │ │ │ │ + 338 template │ │ │ │ │ + 339 typename RefinementIteratorSpecial::CoordVector │ │ │ │ │ + 340 RefinementIteratorSpecial:: │ │ │ │ │ + 341global(const CoordVector &local) const │ │ │ │ │ + 342 { │ │ │ │ │ + 343 // while the kuhnIndex runs from 0,1,2 the actual permutations we need are │ │ │ │ │ +0,2,3 │ │ │ │ │ + 344 return transformCoordinate(referenceToKuhn(local, │ │ │ │ │ +getPermutation((kuhnIndex+2)%4))); │ │ │ │ │ + 345 } │ │ │ │ │ + 346 │ │ │ │ │ + 347 // common │ │ │ │ │ + 348 template │ │ │ │ │ + 349 template │ │ │ │ │ +350 class RefinementImp::Codim:: │ │ │ │ │ +SubEntityIterator │ │ │ │ │ + 351 : public ForwardIteratorFacade::template Codim::SubEntityIterator, int>, │ │ │ │ │ + 352 public RefinementIteratorSpecial │ │ │ │ │ + 353 { │ │ │ │ │ + 354 public: │ │ │ │ │ +355 typedef RefinementImp Refinement; │ │ │ │ │ +356 typedef SubEntityIterator This; │ │ │ │ │ 357 │ │ │ │ │ - 358} // namespace Dune │ │ │ │ │ - 359#endif │ │ │ │ │ +358 SubEntityIterator(int nIntervals, bool end = false); │ │ │ │ │ + 359 │ │ │ │ │ +360 bool equals(const This &other) const; │ │ │ │ │ + 361 protected: │ │ │ │ │ + 362 using RefinementIteratorSpecial:: │ │ │ │ │ +kuhnIndex; │ │ │ │ │ + 363 using RefinementIteratorSpecial:: │ │ │ │ │ +backend; │ │ │ │ │ + 364 }; │ │ │ │ │ + 365 │ │ │ │ │ + 366#ifndef DOXYGEN │ │ │ │ │ + 367 template │ │ │ │ │ + 368 template │ │ │ │ │ + 369 RefinementImp::Codim:: │ │ │ │ │ +SubEntityIterator:: │ │ │ │ │ + 370SubEntityIterator(int nIntervals, bool end) │ │ │ │ │ + 371 : RefinementIteratorSpecial(nIntervals, │ │ │ │ │ +end) │ │ │ │ │ + 372 {} │ │ │ │ │ + 373 │ │ │ │ │ + 374 template │ │ │ │ │ + 375 template │ │ │ │ │ + 376 bool │ │ │ │ │ + 377 RefinementImp::Codim:: │ │ │ │ │ +SubEntityIterator:: │ │ │ │ │ + 378equals(const This &other) const │ │ │ │ │ + 379 { │ │ │ │ │ + 380 return ((kuhnIndex == other.kuhnIndex) && (backend == other.backend)); │ │ │ │ │ + 381 } │ │ │ │ │ + 382#endif │ │ │ │ │ + 383 │ │ │ │ │ + 384 } // namespace PrismTriangulation │ │ │ │ │ + 385 } // namespace RefinementImp │ │ │ │ │ + 386 │ │ │ │ │ + 387 namespace RefinementImp │ │ │ │ │ + 388 { │ │ │ │ │ + 389 // /////////////////////// │ │ │ │ │ + 390 // │ │ │ │ │ + 391 // The refinement traits │ │ │ │ │ + 392 // │ │ │ │ │ + 393 │ │ │ │ │ + 394#ifndef DOXYGEN │ │ │ │ │ + 395 template │ │ │ │ │ + 396 struct Traits< │ │ │ │ │ + 397 topologyId, CoordType, coerceToId, 3, │ │ │ │ │ + 398 typename std::enable_if< │ │ │ │ │ + 399 (GeometryTypes::prism.id() >> 1) == │ │ │ │ │ + 400 (topologyId >> 1) && │ │ │ │ │ + 401 (GeometryTypes::simplex(3).id() >> 1) == │ │ │ │ │ + 402 (coerceToId >> 1) │ │ │ │ │ + 403 >::type> │ │ │ │ │ + 404 { │ │ │ │ │ + 405 typedef PrismTriangulation::RefinementImp<3, CoordType> Imp; │ │ │ │ │ + 406 }; │ │ │ │ │ + 407#endif │ │ │ │ │ + 408 │ │ │ │ │ + 409 } // namespace RefinementImp │ │ │ │ │ + 410} // namespace Dune │ │ │ │ │ + 411 │ │ │ │ │ + 412#endif // DUNE_GEOMETRY_REFINEMENT_PRISMTRIANGULATION_CC │ │ │ │ │ referenceelements.hh │ │ │ │ │ type.hh │ │ │ │ │ A unique label for each type of element that can occur in a grid. │ │ │ │ │ +base.cc │ │ │ │ │ +This file contains the parts independent of a particular Refinement │ │ │ │ │ +implementation. │ │ │ │ │ +simplex.cc │ │ │ │ │ +This file contains the Refinement implementation for simplices (triangles, │ │ │ │ │ +tetrahedrons.... │ │ │ │ │ Dune │ │ │ │ │ Definition affinegeometry.hh:21 │ │ │ │ │ -Dune::Geo::ReferenceElements::cube │ │ │ │ │ -static const ReferenceElement & cube() │ │ │ │ │ -get hypercube reference elements │ │ │ │ │ -Definition referenceelements.hh:210 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry │ │ │ │ │ -A geometry implementation for axis-aligned hypercubes. │ │ │ │ │ -Definition axisalignedcubegeometry.hh:50 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::volume │ │ │ │ │ -Volume volume() const │ │ │ │ │ -Return the element volume. │ │ │ │ │ -Definition axisalignedcubegeometry.hh:286 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::AxisAlignedCubeGeometry │ │ │ │ │ -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 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::AxisAlignedCubeGeometry │ │ │ │ │ -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 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::jacobianInverse │ │ │ │ │ -JacobianInverse jacobianInverse(const LocalCoordinate &local) const │ │ │ │ │ -Inverse Jacobian of the transformation from local to global coordinates. │ │ │ │ │ -Definition axisalignedcubegeometry.hh:226 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::jacobianInverseTransposed │ │ │ │ │ -JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate │ │ │ │ │ -&local) const │ │ │ │ │ -Inverse Jacobian transposed of the transformation from local to global │ │ │ │ │ -coordinates. │ │ │ │ │ -Definition axisalignedcubegeometry.hh:208 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::JacobianTransposed │ │ │ │ │ -std::conditional< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< │ │ │ │ │ -ctype, dim, coorddim > >::type JacobianTransposed │ │ │ │ │ -Return type of jacobianTransposed. │ │ │ │ │ -Definition axisalignedcubegeometry.hh:81 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::AxisAlignedCubeGeometry │ │ │ │ │ -AxisAlignedCubeGeometry(const Dune::FieldVector< ctype, coorddim > lower) │ │ │ │ │ -Constructor from a single point only. │ │ │ │ │ -Definition axisalignedcubegeometry.hh:150 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::mydimension │ │ │ │ │ -static constexpr int mydimension │ │ │ │ │ -Dimension of the cube element. │ │ │ │ │ -Definition axisalignedcubegeometry.hh:56 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::coorddimension │ │ │ │ │ -static constexpr int coorddimension │ │ │ │ │ -Dimension of the world space that the cube element is embedded in. │ │ │ │ │ -Definition axisalignedcubegeometry.hh:59 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::corner │ │ │ │ │ -GlobalCoordinate corner(int k) const │ │ │ │ │ -Return world coordinates of the k-th corner of the element. │ │ │ │ │ -Definition axisalignedcubegeometry.hh:260 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::Volume │ │ │ │ │ -ctype Volume │ │ │ │ │ -Type used for volume. │ │ │ │ │ -Definition axisalignedcubegeometry.hh:71 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::LocalCoordinate │ │ │ │ │ -FieldVector< ctype, dim > LocalCoordinate │ │ │ │ │ -Type used for a vector of element coordinates. │ │ │ │ │ -Definition axisalignedcubegeometry.hh:65 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::referenceElement │ │ │ │ │ -friend Dune::Transitional::ReferenceElement< ctype, Dim< dim > > │ │ │ │ │ -referenceElement(const AxisAlignedCubeGeometry &) │ │ │ │ │ -Definition axisalignedcubegeometry.hh:307 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::jacobianTransposed │ │ │ │ │ -JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const │ │ │ │ │ -Jacobian transposed of the transformation from local to global coordinates. │ │ │ │ │ -Definition axisalignedcubegeometry.hh:196 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::GlobalCoordinate │ │ │ │ │ -FieldVector< ctype, coorddim > GlobalCoordinate │ │ │ │ │ -Type used for a vector of world coordinates. │ │ │ │ │ -Definition axisalignedcubegeometry.hh:68 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::local │ │ │ │ │ -LocalCoordinate local(const GlobalCoordinate &global) const │ │ │ │ │ -Map a point in global (world) coordinates to element coordinates. │ │ │ │ │ -Definition axisalignedcubegeometry.hh:180 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::ctype │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::transformCoordinate │ │ │ │ │ +FieldVector< CoordType, dimension > transformCoordinate(FieldVector< CoordType, │ │ │ │ │ +dimension > point) │ │ │ │ │ +Definition prismtriangulation.cc:50 │ │ │ │ │ +Dune::RefinementImp::Simplex::getPermutation │ │ │ │ │ +FieldVector< int, n > getPermutation(int m) │ │ │ │ │ +Calculate permutation from it's index. │ │ │ │ │ +Definition simplex.cc:336 │ │ │ │ │ +Dune::RefinementImp::Simplex::referenceToKuhn │ │ │ │ │ +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 │ │ │ │ │ +Dune::Codim │ │ │ │ │ +Static tag representing a codimension. │ │ │ │ │ +Definition dimension.hh:24 │ │ │ │ │ +Dune::MultiLinearGeometry │ │ │ │ │ +generic geometry implementation based on corner coordinates │ │ │ │ │ +Definition multilineargeometry.hh:181 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial │ │ │ │ │ +Definition prismtriangulation.cc:43 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementImp │ │ │ │ │ +Implementation of the refinement of a prism into simplices. │ │ │ │ │ +Definition prismtriangulation.cc:67 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementImp::dimension │ │ │ │ │ +static constexpr int dimension │ │ │ │ │ +Definition prismtriangulation.cc:69 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementImp::ctype │ │ │ │ │ CoordType ctype │ │ │ │ │ -Type used for single coordinate coefficients. │ │ │ │ │ -Definition axisalignedcubegeometry.hh:62 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::Jacobian │ │ │ │ │ -std::conditional_t< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< │ │ │ │ │ -ctype, coorddim, dim > > Jacobian │ │ │ │ │ -Return type of jacobian. │ │ │ │ │ -Definition axisalignedcubegeometry.hh:100 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::type │ │ │ │ │ -GeometryType type() const │ │ │ │ │ -Type of the cube. Here: a hypercube of the correct dimension. │ │ │ │ │ -Definition axisalignedcubegeometry.hh:155 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::corners │ │ │ │ │ -int corners() const │ │ │ │ │ -Return the number of corners of the element. │ │ │ │ │ -Definition axisalignedcubegeometry.hh:254 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::jacobian │ │ │ │ │ -Jacobian jacobian(const LocalCoordinate &local) const │ │ │ │ │ -Jacobian of the transformation from local to global coordinates. │ │ │ │ │ -Definition axisalignedcubegeometry.hh:220 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::JacobianInverseTransposed │ │ │ │ │ -std::conditional< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< │ │ │ │ │ -ctype, coorddim, dim > >::type JacobianInverseTransposed │ │ │ │ │ -Return type of jacobianInverseTransposed. │ │ │ │ │ -Definition axisalignedcubegeometry.hh:91 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::integrationElement │ │ │ │ │ -Volume integrationElement(const LocalCoordinate &local) const │ │ │ │ │ -Return the integration element, i.e., the determinant term in the integral │ │ │ │ │ -transformation formula. │ │ │ │ │ -Definition axisalignedcubegeometry.hh:234 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::center │ │ │ │ │ -GlobalCoordinate center() const │ │ │ │ │ -Return center of mass of the element. │ │ │ │ │ -Definition axisalignedcubegeometry.hh:240 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::affine │ │ │ │ │ -bool affine() const │ │ │ │ │ -Return if the element is affine. Here: yes. │ │ │ │ │ -Definition axisalignedcubegeometry.hh:302 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::JacobianInverse │ │ │ │ │ -std::conditional_t< dim==coorddim, DiagonalMatrix< ctype, dim >, FieldMatrix< │ │ │ │ │ -ctype, dim, coorddim > > JacobianInverse │ │ │ │ │ -Return type of jacobianInverse. │ │ │ │ │ -Definition axisalignedcubegeometry.hh:109 │ │ │ │ │ -Dune::AxisAlignedCubeGeometry::global │ │ │ │ │ -GlobalCoordinate global(const LocalCoordinate &local) const │ │ │ │ │ -Map a point in local (element) coordinates to world coordinates. │ │ │ │ │ -Definition axisalignedcubegeometry.hh:161 │ │ │ │ │ -Dune::GeometryType │ │ │ │ │ -Unique label for each type of entities that can occur in DUNE grids. │ │ │ │ │ -Definition type.hh:126 │ │ │ │ │ +Definition prismtriangulation.cc:71 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementImp::vEnd │ │ │ │ │ +static VertexIterator vEnd(int nIntervals) │ │ │ │ │ +Definition prismtriangulation.cc:122 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementImp::IndexVector │ │ │ │ │ +FieldVector< int, dimension+1 > IndexVector │ │ │ │ │ +Definition prismtriangulation.cc:78 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementImp::eEnd │ │ │ │ │ +static ElementIterator eEnd(int nIntervals) │ │ │ │ │ +Definition prismtriangulation.cc:146 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementImp::nVertices │ │ │ │ │ +static int nVertices(int nIntervals) │ │ │ │ │ +Definition prismtriangulation.cc:106 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementImp::CoordVector │ │ │ │ │ +FieldVector< CoordType, dimension > CoordVector │ │ │ │ │ +Definition prismtriangulation.cc:76 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementImp::nElements │ │ │ │ │ +static int nElements(int nIntervals) │ │ │ │ │ +Definition prismtriangulation.cc:130 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementImp::ElementIterator │ │ │ │ │ +Codim< 0 >::SubEntityIterator ElementIterator │ │ │ │ │ +Definition prismtriangulation.cc:77 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementImp::VertexIterator │ │ │ │ │ +Codim< dimension >::SubEntityIterator VertexIterator │ │ │ │ │ +Definition prismtriangulation.cc:75 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementImp::eBegin │ │ │ │ │ +static ElementIterator eBegin(int nIntervals) │ │ │ │ │ +Definition prismtriangulation.cc:138 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementImp::vBegin │ │ │ │ │ +static VertexIterator vBegin(int nIntervals) │ │ │ │ │ +Definition prismtriangulation.cc:114 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementImp::Codim │ │ │ │ │ +Definition prismtriangulation.cc:98 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementImp::Codim::Geometry │ │ │ │ │ +Dune::MultiLinearGeometry< CoordType, dimension-codimension, dimension > │ │ │ │ │ +Geometry │ │ │ │ │ +Definition prismtriangulation.cc:100 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_dimension_>::nIntervals_ │ │ │ │ │ +int nIntervals_ │ │ │ │ │ +Definition prismtriangulation.cc:178 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_dimension_>::Geometry │ │ │ │ │ +Refinement::template Codim< dimension >::Geometry Geometry │ │ │ │ │ +Definition prismtriangulation.cc:163 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_dimension_>::BackendRefinement │ │ │ │ │ +Refinement::BackendRefinement BackendRefinement │ │ │ │ │ +Definition prismtriangulation.cc:174 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_dimension_>::BackendIterator │ │ │ │ │ +BackendRefinement::template Codim< dimension >::SubEntityIterator │ │ │ │ │ +BackendIterator │ │ │ │ │ +Definition prismtriangulation.cc:175 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_dimension_>::CoordVector │ │ │ │ │ +Refinement::CoordVector CoordVector │ │ │ │ │ +Definition prismtriangulation.cc:162 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_dimension_>::backendEnd │ │ │ │ │ +const BackendIterator backendEnd │ │ │ │ │ +Definition prismtriangulation.cc:182 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_dimension_>::Refinement │ │ │ │ │ +RefinementImp< dimension, CoordType > Refinement │ │ │ │ │ +Definition prismtriangulation.cc:161 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_dimension_>::backend │ │ │ │ │ +BackendIterator backend │ │ │ │ │ +Definition prismtriangulation.cc:181 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_dimension_>::kuhnIndex │ │ │ │ │ +int kuhnIndex │ │ │ │ │ +Definition prismtriangulation.cc:180 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_0_>::nIntervals_ │ │ │ │ │ +int nIntervals_ │ │ │ │ │ +Definition prismtriangulation.cc:265 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_0_>::Geometry │ │ │ │ │ +Refinement::template Codim< 0 >::Geometry Geometry │ │ │ │ │ +Definition prismtriangulation.cc:245 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_0_>::backend │ │ │ │ │ +BackendIterator backend │ │ │ │ │ +Definition prismtriangulation.cc:268 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_0_>::IndexVector │ │ │ │ │ +Refinement::IndexVector IndexVector │ │ │ │ │ +Definition prismtriangulation.cc:243 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_0_>::BackendIterator │ │ │ │ │ +BackendRefinement::template Codim< 0 >::SubEntityIterator BackendIterator │ │ │ │ │ +Definition prismtriangulation.cc:262 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_0_>::kuhnIndex │ │ │ │ │ +int kuhnIndex │ │ │ │ │ +Definition prismtriangulation.cc:267 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_0_>::CoordVector │ │ │ │ │ +Refinement::CoordVector CoordVector │ │ │ │ │ +Definition prismtriangulation.cc:244 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_0_>::Refinement │ │ │ │ │ +RefinementImp< dimension, CoordType > Refinement │ │ │ │ │ +Definition prismtriangulation.cc:242 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_0_>::backendEnd │ │ │ │ │ +const BackendIterator backendEnd │ │ │ │ │ +Definition prismtriangulation.cc:269 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_0_>::BackendRefinement │ │ │ │ │ +Refinement::BackendRefinement BackendRefinement │ │ │ │ │ +Definition prismtriangulation.cc:261 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementImp::Codim<_codimension_>:: │ │ │ │ │ +This │ │ │ │ │ +SubEntityIterator This │ │ │ │ │ +Definition prismtriangulation.cc:356 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementImp::Codim<_codimension_>:: │ │ │ │ │ +equals │ │ │ │ │ +bool equals(const This &other) const │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementImp::Codim<_codimension_>:: │ │ │ │ │ +Refinement │ │ │ │ │ +RefinementImp< dimension, CoordType > Refinement │ │ │ │ │ +Definition prismtriangulation.cc:355 │ │ │ │ │ +Dune::RefinementImp::PrismTriangulation::RefinementImp::Codim<_codimension_>:: │ │ │ │ │ +SubEntityIterator │ │ │ │ │ +SubEntityIterator(int nIntervals, bool end=false) │ │ │ │ │ +Dune::RefinementImp::Simplex::RefinementImp │ │ │ │ │ +Definition simplex.cc:433 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00230.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: referenceelement.hh File Reference │ │ │ │ +dune-geometry: hcube.cc File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,44 +65,88 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
referenceelement.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Macros
│ │ │ │ +
hcube.cc File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <dune/geometry/type.hh>
│ │ │ │ + │ │ │ │ +

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

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

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::Geo::ReferenceElement< Implementation >
 This class provides access to geometric and topological properties of a reference element. More...
class  Dune::RefinementImp::HCube::RefinementImp< dimension_, CoordType >
 Refinement implementation for hypercubes More...
 
struct  Dune::RefinementImp::HCube::RefinementImp< dimension_, CoordType >::Codim< codimension >
 
class  Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial< dimension, CoordType, codimension >
 SubEntityIterator base class for hypercube refinement. More...
 
struct  Dune::Geo::ReferenceElement< Implementation >::Codim< codim >
 Collection of types depending on the codimension. More...
class  Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial< dimension, CoordType, dimension >
 
class  Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial< dimension, CoordType, 0 >
 
class  Dune::RefinementImp::HCube::RefinementImp< dimension_, CoordType >::Codim< codimension >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ +

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::Geo
namespace  Dune::RefinementImp
 This namespace contains the implementation of Refinement.
 
namespace  Dune::RefinementImp::HCube
 This namespace contains the Refinement implementation for hypercubes (GeometryType::cube).
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +Macros

#define DUNE_GEOMETRY_REFINEMENT_HCUBE_CC
 
│ │ │ │ +

Detailed Description

│ │ │ │ +

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

│ │ │ │ +

See Refinement implementation for hypercubes.

│ │ │ │ +

Macro Definition Documentation

│ │ │ │ + │ │ │ │ +

◆ DUNE_GEOMETRY_REFINEMENT_HCUBE_CC

│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
#define DUNE_GEOMETRY_REFINEMENT_HCUBE_CC
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -6,27 +6,62 @@ │ │ │ │ │ dune-geometry 2.9.0 │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -referenceelement.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ + * refinement │ │ │ │ │ +Classes | Namespaces | Macros │ │ │ │ │ +hcube.cc File Reference │ │ │ │ │ +This file contains the Refinement implementation for hypercubes │ │ │ │ │ +(quadrilaterals, hexahedrons, etc.). More... │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include "base.cc" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ - class  Dune::Geo::ReferenceElement<_Implementation_> │ │ │ │ │ -  This class provides access to geometric and topological properties of │ │ │ │ │ - a reference element. More... │ │ │ │ │ + class  Dune::RefinementImp::HCube::RefinementImp<_dimension_,_CoordType_> │ │ │ │ │ +  Refinement implementation for hypercubes More... │ │ │ │ │   │ │ │ │ │ -struct  Dune::Geo::ReferenceElement<_Implementation_>::Codim<_codim_> │ │ │ │ │ -  Collection of types depending on the codimension. More... │ │ │ │ │ +struct  Dune::RefinementImp::HCube::RefinementImp<_dimension_,_CoordType_>:: │ │ │ │ │ + Codim<_codimension_> │ │ │ │ │ +  │ │ │ │ │ + class  Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial< │ │ │ │ │ + dimension,_CoordType,_codimension_> │ │ │ │ │ +  SubEntityIterator base class for hypercube refinement. More... │ │ │ │ │ +  │ │ │ │ │ + class  Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial< │ │ │ │ │ + dimension,_CoordType,_dimension_> │ │ │ │ │ +  │ │ │ │ │ + class  Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial< │ │ │ │ │ + dimension,_CoordType,_0_> │ │ │ │ │ +  │ │ │ │ │ + class  Dune::RefinementImp::HCube::RefinementImp<_dimension_,_CoordType_>:: │ │ │ │ │ + Codim<_codimension_> │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ -namespace  Dune::Geo │ │ │ │ │ +namespace  Dune::RefinementImp │ │ │ │ │ +  This namespace contains the implementation of Refinement. │ │ │ │ │ +  │ │ │ │ │ +namespace  Dune::RefinementImp::HCube │ │ │ │ │ +  This namespace contains the Refinement implementation for │ │ │ │ │ + hypercubes (GeometryType::cube). │ │ │ │ │ +  │ │ │ │ │ + Macros │ │ │ │ │ +#define DUNE_GEOMETRY_REFINEMENT_HCUBE_CC │ │ │ │ │   │ │ │ │ │ +***** Detailed Description ***** │ │ │ │ │ +This file contains the Refinement implementation for hypercubes │ │ │ │ │ +(quadrilaterals, hexahedrons, etc.). │ │ │ │ │ +See Refinement_implementation_for_hypercubes. │ │ │ │ │ +***** Macro Definition Documentation ***** │ │ │ │ │ +***** ◆ DUNE_GEOMETRY_REFINEMENT_HCUBE_CC ***** │ │ │ │ │ +#define DUNE_GEOMETRY_REFINEMENT_HCUBE_CC │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00230_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: referenceelement.hh Source File │ │ │ │ +dune-geometry: hcube.cc Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,264 +70,477 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
referenceelement.hh
│ │ │ │ +
hcube.cc
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
│ │ │ │ -
5#ifndef DUNE_GEOMETRY_REFERENCEELEMENT_HH
│ │ │ │ -
6#define DUNE_GEOMETRY_REFERENCEELEMENT_HH
│ │ │ │ +
5#ifndef DUNE_GEOMETRY_REFINEMENT_HCUBE_CC
│ │ │ │ +
6#define DUNE_GEOMETRY_REFINEMENT_HCUBE_CC
│ │ │ │
7
│ │ │ │ - │ │ │ │ -
9
│ │ │ │ -
10namespace Dune {
│ │ │ │ -
11 namespace Geo {
│ │ │ │ -
12
│ │ │ │ -
13 namespace Impl {
│ │ │ │ -
14
│ │ │ │ -
15 // forward declaration for friend declaration
│ │ │ │ -
16 template<typename ctype, int dim>
│ │ │ │ -
17 class ReferenceElementContainer;
│ │ │ │ -
18
│ │ │ │ -
19 }
│ │ │ │ -
20
│ │ │ │ -
21 // forward declaration for constructing default reference element type
│ │ │ │ -
22 template<typename ctype, int dim>
│ │ │ │ -
23 class ReferenceElementImplementation;
│ │ │ │ -
24
│ │ │ │ -
25 // forward declaration for backwards compatibility conversion
│ │ │ │ -
26 template<typename ctype, int dim>
│ │ │ │ -
27 struct ReferenceElements;
│ │ │ │ -
28
│ │ │ │ -
29 // ReferenceElement
│ │ │ │ -
30 // ----------------
│ │ │ │ -
31
│ │ │ │ -
50 template<typename Implementation>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
52 {
│ │ │ │ -
53
│ │ │ │ -
54 public:
│ │ │ │ -
55
│ │ │ │ -
56#ifndef DOXYGEN
│ │ │ │ -
57
│ │ │ │ -
59 template<int codim>
│ │ │ │ -
60 using Codim = typename Implementation::template Codim<codim>;
│ │ │ │ -
61
│ │ │ │ -
62#else
│ │ │ │ -
63
│ │ │ │ -
65 template< int codim >
│ │ │ │ -
│ │ │ │ -
66 struct Codim
│ │ │ │ -
67 {
│ │ │ │ -
69 using Geometry = implementation-defined;
│ │ │ │ -
70 };
│ │ │ │ -
│ │ │ │ -
71
│ │ │ │ -
72#endif // DOXYGEN
│ │ │ │ -
73
│ │ │ │ -
75 using ctype = typename Implementation::ctype;
│ │ │ │ -
76
│ │ │ │ - │ │ │ │ -
79
│ │ │ │ -
81 using Coordinate = typename Implementation::Coordinate;
│ │ │ │ -
82
│ │ │ │ -
84 typedef ctype Volume;
│ │ │ │ -
85
│ │ │ │ -
87 static constexpr int dimension = Implementation::dimension;
│ │ │ │ +
42#include <cassert>
│ │ │ │ +
43
│ │ │ │ +
44#include <dune/common/fvector.hh>
│ │ │ │ +
45#include <dune/common/iteratorfacades.hh>
│ │ │ │ +
46
│ │ │ │ + │ │ │ │ + │ │ │ │ +
49
│ │ │ │ +
50#include "base.cc" // for RefinementTraits
│ │ │ │ +
51
│ │ │ │ +
52namespace Dune
│ │ │ │ +
53{
│ │ │ │ +
54 namespace RefinementImp
│ │ │ │ +
55 {
│ │ │ │ +
│ │ │ │ +
62 namespace HCube
│ │ │ │ +
63 {
│ │ │ │ +
73 template<int dimension_, class CoordType>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
75 {
│ │ │ │ +
76 public:
│ │ │ │ +
78 constexpr static int dimension = dimension_;
│ │ │ │ +
79 //- Know yourself
│ │ │ │ + │ │ │ │ +
81
│ │ │ │ +
82 template<int codimension>
│ │ │ │ +
83 struct Codim;
│ │ │ │ + │ │ │ │ +
85 typedef FieldVector<CoordType, dimension> CoordVector;
│ │ │ │ + │ │ │ │ +
87 typedef FieldVector<int, (1<<dimension)> IndexVector;
│ │ │ │
88
│ │ │ │ -
89
│ │ │ │ -
│ │ │ │ -
94 int size(int c) const
│ │ │ │ -
95 {
│ │ │ │ -
96 return _impl->size(c);
│ │ │ │ -
97 }
│ │ │ │ -
│ │ │ │ -
98
│ │ │ │ -
99
│ │ │ │ -
│ │ │ │ -
111 int size(int i, int c, int cc) const
│ │ │ │ -
112 {
│ │ │ │ -
113 return _impl->size(i,c,cc);
│ │ │ │ -
114 }
│ │ │ │ -
│ │ │ │ -
115
│ │ │ │ -
116
│ │ │ │ -
│ │ │ │ -
130 int subEntity(int i, int c, int ii, int cc) const
│ │ │ │ -
131 {
│ │ │ │ -
132 return _impl->subEntity(i,c,ii,cc);
│ │ │ │ -
133 }
│ │ │ │ -
│ │ │ │ -
134
│ │ │ │ -
│ │ │ │ -
153 auto subEntities ( int i, int c, int cc ) const
│ │ │ │ -
154 {
│ │ │ │ -
155 return _impl->subEntities(i,c,cc);
│ │ │ │ +
89 static unsigned nVertices(unsigned nIntervals);
│ │ │ │ +
90 static VertexIterator vBegin(unsigned nIntervals);
│ │ │ │ +
91 static VertexIterator vEnd(unsigned nIntervals);
│ │ │ │ +
92
│ │ │ │ +
93 static unsigned nElements(unsigned nIntervals);
│ │ │ │ +
94 static ElementIterator eBegin(unsigned nIntervals);
│ │ │ │ +
95 static ElementIterator eEnd(unsigned nIntervals);
│ │ │ │ +
96 };
│ │ │ │ +
│ │ │ │ +
97
│ │ │ │ +
98 template<int dimension, class CoordType>
│ │ │ │ +
99 template<int codimension>
│ │ │ │ +
│ │ │ │ +
100 struct RefinementImp<dimension, CoordType>::Codim
│ │ │ │ +
101 {
│ │ │ │ +
102 class SubEntityIterator;
│ │ │ │ + │ │ │ │ +
104 };
│ │ │ │ +
│ │ │ │ +
105
│ │ │ │ +
106 template<int dimension, class CoordType>
│ │ │ │ +
107 unsigned
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
109 nVertices(unsigned nIntervals)
│ │ │ │ +
110 {
│ │ │ │ +
111 // return (nIntervals + 1)^dim
│ │ │ │ +
112 return Dune::power(nIntervals+1u, unsigned(dimension));
│ │ │ │ +
113 }
│ │ │ │ +
│ │ │ │ +
114
│ │ │ │ +
115 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
118 vBegin(unsigned nIntervals)
│ │ │ │ +
119 {
│ │ │ │ +
120 return VertexIterator(0,nIntervals);
│ │ │ │ +
121 }
│ │ │ │ +
│ │ │ │ +
122
│ │ │ │ +
123 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
126 vEnd(unsigned nIntervals)
│ │ │ │ +
127 {
│ │ │ │ +
128 return VertexIterator(nVertices(nIntervals),nIntervals);
│ │ │ │ +
129 }
│ │ │ │ +
│ │ │ │ +
130
│ │ │ │ +
131 template<int dimension, class CoordType>
│ │ │ │ +
132 unsigned
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
134 nElements(unsigned nIntervals)
│ │ │ │ +
135 {
│ │ │ │ +
136 static_assert(dimension >= 0,
│ │ │ │ +
137 "Negative dimension given, what the heck is that supposed to mean?");
│ │ │ │ +
138 // return nIntervals^dim
│ │ │ │ +
139 return Dune::power(nIntervals, unsigned(dimension));
│ │ │ │ +
140 }
│ │ │ │ +
│ │ │ │ +
141
│ │ │ │ +
142 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
145 eBegin(unsigned nIntervals)
│ │ │ │ +
146 {
│ │ │ │ +
147 return ElementIterator(0,nIntervals);
│ │ │ │ +
148 }
│ │ │ │ +
│ │ │ │ +
149
│ │ │ │ +
150 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
153 eEnd(unsigned nIntervals)
│ │ │ │ +
154 {
│ │ │ │ +
155 return ElementIterator(nElements(nIntervals),nIntervals);
│ │ │ │
156 }
│ │ │ │
│ │ │ │
157
│ │ │ │ -
158
│ │ │ │ -
│ │ │ │ -
171 decltype(auto) type(int i, int c) const
│ │ │ │ -
172 {
│ │ │ │ -
173 return _impl->type(i,c);
│ │ │ │ -
174 }
│ │ │ │ -
│ │ │ │ -
175
│ │ │ │ -
176
│ │ │ │ -
│ │ │ │ -
184 decltype(auto) type() const
│ │ │ │ +
158 //
│ │ │ │ +
159 // The iterators
│ │ │ │ +
160 //
│ │ │ │ +
161
│ │ │ │ +
162#ifdef DOXYGEN
│ │ │ │ +
174 template<int dimension, class CoordType, int codimension>
│ │ │ │ + │ │ │ │ +
176#else
│ │ │ │ +
177 template<int dimension, class CoordType, int codimension>
│ │ │ │ + │ │ │ │ +
179#endif //DOXYGEN
│ │ │ │ +
180
│ │ │ │ +
181 // for vertices
│ │ │ │ +
182
│ │ │ │ +
183 template<int dimension, class CoordType>
│ │ │ │ +
│ │ │ │ +
184 class RefinementSubEntityIteratorSpecial<dimension, CoordType, dimension>
│ │ │ │
185 {
│ │ │ │ -
186 return _impl->type();
│ │ │ │ -
187 }
│ │ │ │ -
│ │ │ │ -
188
│ │ │ │ -
189
│ │ │ │ -
│ │ │ │ -
203 decltype(auto) position(int i, int c) const
│ │ │ │ -
204 {
│ │ │ │ -
205 return _impl->position(i,c);
│ │ │ │ -
206 }
│ │ │ │ -
│ │ │ │ -
207
│ │ │ │ -
208
│ │ │ │ -
│ │ │ │ -
216 bool checkInside(const Coordinate& local) const
│ │ │ │ -
217 {
│ │ │ │ -
218 return _impl->checkInside(local);
│ │ │ │ -
219 }
│ │ │ │ -
│ │ │ │ -
220
│ │ │ │ -
221
│ │ │ │ -
233 template<int codim>
│ │ │ │ -
│ │ │ │ -
234 typename Codim<codim>::Geometry geometry(int i) const
│ │ │ │ -
235 {
│ │ │ │ -
236 return _impl->template geometry<codim>(i);
│ │ │ │ -
237 }
│ │ │ │ -
│ │ │ │ -
238
│ │ │ │ -
239
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
242 {
│ │ │ │ -
243 return _impl->volume();
│ │ │ │ -
244 }
│ │ │ │ -
│ │ │ │ -
245
│ │ │ │ -
246
│ │ │ │ -
│ │ │ │ -
258 decltype(auto) integrationOuterNormal(int face) const
│ │ │ │ -
259 {
│ │ │ │ -
260 return _impl->integrationOuterNormal(face);
│ │ │ │ -
261 }
│ │ │ │ -
│ │ │ │ -
262
│ │ │ │ -
263
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
272 : _impl(nullptr)
│ │ │ │ -
273 {}
│ │ │ │ -
│ │ │ │ -
274
│ │ │ │ -
│ │ │ │ -
280 const Implementation& impl() const
│ │ │ │ -
281 {
│ │ │ │ -
282 return *_impl;
│ │ │ │ -
283 }
│ │ │ │ -
│ │ │ │ +
186 public:
│ │ │ │ + │ │ │ │ +
188 typedef typename Refinement::template Codim<dimension>::SubEntityIterator Common;
│ │ │ │ +
189 typedef typename Refinement::CoordVector CoordVector;
│ │ │ │ +
190
│ │ │ │ +
191 CoordVector coords() const;
│ │ │ │ +
192
│ │ │ │ +
193 private:
│ │ │ │ +
194 const Common & asCommon() const
│ │ │ │ +
195 {
│ │ │ │ +
196 return *static_cast<const Common*>(this);
│ │ │ │ +
197 }
│ │ │ │ +
198 };
│ │ │ │ +
│ │ │ │ +
199
│ │ │ │ +
200 template<int dimension, class CoordType>
│ │ │ │ +
201 typename RefinementSubEntityIteratorSpecial<dimension, CoordType, dimension>::CoordVector
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
203 coords() const
│ │ │ │ +
204 {
│ │ │ │ +
205 std::array<unsigned int, dimension> v(asCommon().vertexCoord());
│ │ │ │ +
206 CoordVector c;
│ │ │ │ +
207 for (int d = 0; d < dimension; d++)
│ │ │ │ +
208 {
│ │ │ │ +
209 c[d] = v[d]*1.0 / asCommon()._nIntervals;
│ │ │ │ +
210 }
│ │ │ │ +
211 return c;
│ │ │ │ +
212 }
│ │ │ │ +
│ │ │ │ +
213
│ │ │ │ +
214 // for elements
│ │ │ │ +
215
│ │ │ │ +
216 template<int dimension, class CoordType>
│ │ │ │ +
│ │ │ │ +
217 class RefinementSubEntityIteratorSpecial<dimension, CoordType, 0>
│ │ │ │ +
218 {
│ │ │ │ +
219 public:
│ │ │ │ + │ │ │ │ +
221 typedef typename Refinement::template Codim<0>::SubEntityIterator Common;
│ │ │ │ +
222 typedef typename Refinement::IndexVector IndexVector;
│ │ │ │ +
223 typedef typename Refinement::CoordVector CoordVector;
│ │ │ │ +
224
│ │ │ │ +
225 IndexVector vertexIndices() const;
│ │ │ │ +
226 CoordVector coords() const;
│ │ │ │ +
227
│ │ │ │ +
228 private:
│ │ │ │ +
229 const Common & asCommon() const
│ │ │ │ +
230 {
│ │ │ │ +
231 return *static_cast<const Common*>(this);
│ │ │ │ +
232 }
│ │ │ │ +
233 };
│ │ │ │ +
│ │ │ │ +
234
│ │ │ │ +
235 template<int dimension, class CoordType>
│ │ │ │ +
236 typename RefinementSubEntityIteratorSpecial<dimension, CoordType, 0>::IndexVector
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
238 vertexIndices() const
│ │ │ │ +
239 {
│ │ │ │ +
240 constexpr static int nIndices = 1 << dimension;
│ │ │ │ +
241
│ │ │ │ +
242 // cell index tuple
│ │ │ │ +
243 std::array<unsigned int, dimension> e(asCommon().cellCoord());
│ │ │ │ +
244
│ │ │ │ +
245 // vertices
│ │ │ │ +
246 IndexVector vec;
│ │ │ │ +
247 for(int i = 0; i < nIndices; ++i)
│ │ │ │ +
248 {
│ │ │ │ +
249 int base = 1;
│ │ │ │ +
250 std::array<unsigned int, dimension> alpha(asCommon().idx2multiidx(i));
│ │ │ │ +
251 for (int d = 0; d < dimension; d++) {
│ │ │ │ +
252 vec[i] += (alpha[d] + e[d]) * base;
│ │ │ │ +
253 base *= asCommon()._nIntervals+1;
│ │ │ │ +
254 }
│ │ │ │ +
255 }
│ │ │ │ +
256 return vec;
│ │ │ │ +
257 }
│ │ │ │ +
│ │ │ │ +
258
│ │ │ │ +
259 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
262 coords() const
│ │ │ │ +
263 {
│ │ │ │ +
264 std::array<unsigned int, dimension> v(asCommon().cellCoord());
│ │ │ │ +
265 CoordVector c;
│ │ │ │ +
266 for (int d=0; d<dimension; d++)
│ │ │ │ +
267 {
│ │ │ │ +
268 c[d] = (v[d]*1.0 + 0.5) / asCommon()._nIntervals;
│ │ │ │ +
269 }
│ │ │ │ +
270 return c;
│ │ │ │ +
271 }
│ │ │ │ +
│ │ │ │ +
272
│ │ │ │ +
273 // common
│ │ │ │ +
274 template<int dimension, class CoordType>
│ │ │ │ +
275 template<int codimension>
│ │ │ │ +
│ │ │ │ +
276 class RefinementImp<dimension, CoordType>::Codim<codimension>::SubEntityIterator
│ │ │ │ +
277 : public ForwardIteratorFacade<typename RefinementImp<dimension,
│ │ │ │ +
278 CoordType>::template Codim<codimension>::SubEntityIterator, int>,
│ │ │ │ +
279 public RefinementSubEntityIteratorSpecial<dimension, CoordType, codimension>
│ │ │ │ +
280 {
│ │ │ │ +
281 public:
│ │ │ │ + │ │ │ │ +
283 typedef typename Refinement::template Codim<codimension>::SubEntityIterator This;
│ │ │ │
284
│ │ │ │ -
│ │ │ │ -
286 bool operator==(const ReferenceElement& r) const
│ │ │ │ -
287 {
│ │ │ │ -
288 return _impl == r._impl;
│ │ │ │ -
289 }
│ │ │ │ -
│ │ │ │ -
290
│ │ │ │ -
│ │ │ │ -
292 bool operator!=(const ReferenceElement& r) const
│ │ │ │ -
293 {
│ │ │ │ -
294 return not (*this == r);
│ │ │ │ -
295 }
│ │ │ │ -
│ │ │ │ +
285 SubEntityIterator(unsigned int index, unsigned int nIntervals);
│ │ │ │ +
286
│ │ │ │ +
287 bool equals(const This &other) const;
│ │ │ │ +
288 void increment();
│ │ │ │ +
289
│ │ │ │ +
290 int index() const;
│ │ │ │ +
291 Geometry geometry () const;
│ │ │ │ +
292 private:
│ │ │ │ +
293 friend class RefinementSubEntityIteratorSpecial<dimension, CoordType, codimension>;
│ │ │ │ +
294 unsigned int _index;
│ │ │ │ +
295 unsigned int _nIntervals;
│ │ │ │
296
│ │ │ │ -
│ │ │ │ -
298 friend std::size_t hash_value(const ReferenceElement& r)
│ │ │ │ -
299 {
│ │ │ │ -
300 return reinterpret_cast<std::size_t>(r._impl);
│ │ │ │ -
301 }
│ │ │ │ -
│ │ │ │ +
297 std::array<unsigned int, dimension>
│ │ │ │ +
298 cellCoord(unsigned int idx) const
│ │ │ │ +
299 {
│ │ │ │ +
300 return idx2coord(idx, _nIntervals);
│ │ │ │ +
301 }
│ │ │ │
302
│ │ │ │ -
303 private:
│ │ │ │ -
304
│ │ │ │ -
305 // The implementation must be a friend to construct a wrapper around itself.
│ │ │ │ -
306 friend Implementation;
│ │ │ │ -
307
│ │ │ │ -
308 // The reference container is a friend to be able to call setImplementation.
│ │ │ │ -
309 friend class Impl::ReferenceElementContainer<ctype,dimension>;
│ │ │ │ -
310
│ │ │ │ -
311 // Constructor for wrapping an implementation reference (required internally by the default implementation)
│ │ │ │ -
312 ReferenceElement(const Implementation& impl)
│ │ │ │ -
313 : _impl(&impl)
│ │ │ │ -
314 {}
│ │ │ │ -
315
│ │ │ │ -
316 void setImplementation(const Implementation& impl)
│ │ │ │ -
317 {
│ │ │ │ -
318 _impl = &impl;
│ │ │ │ -
319 }
│ │ │ │ +
303 std::array<unsigned int, dimension>
│ │ │ │ +
304 vertexCoord(unsigned int idx) const
│ │ │ │ +
305 {
│ │ │ │ +
306 return idx2coord(idx, _nIntervals+1u);
│ │ │ │ +
307 }
│ │ │ │ +
308
│ │ │ │ +
309 std::array<unsigned int, dimension>
│ │ │ │ +
310 cellCoord() const
│ │ │ │ +
311 {
│ │ │ │ +
312 return cellCoord(_index);
│ │ │ │ +
313 }
│ │ │ │ +
314
│ │ │ │ +
315 std::array<unsigned int, dimension>
│ │ │ │ +
316 vertexCoord() const
│ │ │ │ +
317 {
│ │ │ │ +
318 return vertexCoord(_index);
│ │ │ │ +
319 }
│ │ │ │
320
│ │ │ │ -
321 const Implementation* _impl;
│ │ │ │ -
322
│ │ │ │ -
323 };
│ │ │ │ -
│ │ │ │ -
324
│ │ │ │ -
325 }
│ │ │ │ -
326
│ │ │ │ -
327}
│ │ │ │ -
328
│ │ │ │ -
329
│ │ │ │ -
330#endif // DUNE_GEOMETRY_REFERENCEELEMENT_HH
│ │ │ │ -
A unique label for each type of element that can occur in a grid.
│ │ │ │ +
321 std::array<unsigned int, dimension>
│ │ │ │ +
322 idx2coord(unsigned int idx, unsigned int w) const
│ │ │ │ +
323 {
│ │ │ │ +
324 std::array<unsigned int, dimension> c;
│ │ │ │ +
325 for (unsigned int d = 0; d < dimension; d++)
│ │ │ │ +
326 {
│ │ │ │ +
327 c[d] = idx%w;
│ │ │ │ +
328 idx = idx/w;
│ │ │ │ +
329 }
│ │ │ │ +
330 return c;
│ │ │ │ +
331 }
│ │ │ │ +
332
│ │ │ │ +
333 unsigned int
│ │ │ │ +
334 coord2idx(std::array<unsigned int, dimension> c, unsigned int w) const
│ │ │ │ +
335 {
│ │ │ │ +
336 unsigned int i = 0;
│ │ │ │ +
337 for (unsigned int d = dimension; d > 0; d--)
│ │ │ │ +
338 {
│ │ │ │ +
339 i *= w;
│ │ │ │ +
340 i += c[d-1];
│ │ │ │ +
341 }
│ │ │ │ +
342 return i;
│ │ │ │ +
343 }
│ │ │ │ +
344
│ │ │ │ +
345 std::array<unsigned int, dimension>
│ │ │ │ +
346 idx2multiidx(unsigned int idx) const
│ │ │ │ +
347 {
│ │ │ │ +
348 std::array<unsigned int, dimension> alpha;
│ │ │ │ +
349 for (unsigned int i = 0; i < dimension; ++i)
│ │ │ │ +
350 alpha[i] = (idx >> i) & 1u;
│ │ │ │ +
351 return alpha;
│ │ │ │ +
352 }
│ │ │ │ +
353 };
│ │ │ │ +
│ │ │ │ +
354
│ │ │ │ +
355#ifndef DOXYGEN
│ │ │ │ +
356 template<int dimension, class CoordType>
│ │ │ │ +
357 template<int codimension>
│ │ │ │ +
358 RefinementImp<dimension, CoordType>::Codim<codimension>::SubEntityIterator::
│ │ │ │ +
359 SubEntityIterator(unsigned int index, unsigned int nIntervals)
│ │ │ │ +
360 : _index(index), _nIntervals(nIntervals)
│ │ │ │ +
361 {}
│ │ │ │ +
362
│ │ │ │ +
363 template<int dimension, class CoordType>
│ │ │ │ +
364 template<int codimension>
│ │ │ │ +
365 bool
│ │ │ │ +
366 RefinementImp<dimension, CoordType>::Codim<codimension>::SubEntityIterator::
│ │ │ │ +
367 equals(const This &other) const
│ │ │ │ +
368 {
│ │ │ │ +
369 return ((_index == other._index) && (_nIntervals == other._nIntervals));
│ │ │ │ +
370 }
│ │ │ │ +
371
│ │ │ │ +
372 template<int dimension, class CoordType>
│ │ │ │ +
373 template<int codimension>
│ │ │ │ +
374 void
│ │ │ │ +
375 RefinementImp<dimension, CoordType>::Codim<codimension>::SubEntityIterator::
│ │ │ │ +
376 increment()
│ │ │ │ +
377 {
│ │ │ │ +
378 ++_index;
│ │ │ │ +
379 }
│ │ │ │ +
380
│ │ │ │ +
381 template<int dimension, class CoordType>
│ │ │ │ +
382 template<int codimension>
│ │ │ │ +
383 int
│ │ │ │ +
384 RefinementImp<dimension, CoordType>::Codim<codimension>::SubEntityIterator::
│ │ │ │ +
385 index() const
│ │ │ │ +
386 {
│ │ │ │ +
387 return _index;
│ │ │ │ +
388 }
│ │ │ │ +
389
│ │ │ │ +
390 template<int dimension, class CoordType>
│ │ │ │ +
391 template<int codimension>
│ │ │ │ +
392 typename RefinementImp<dimension, CoordType>::template Codim<codimension>::Geometry
│ │ │ │ +
393 RefinementImp<dimension, CoordType>::Codim<codimension>::SubEntityIterator::geometry () const
│ │ │ │ +
394 {
│ │ │ │ +
395 std::array<unsigned int,dimension> intCoords = idx2coord(_index,_nIntervals);
│ │ │ │ +
396
│ │ │ │ +
397 Dune::FieldVector<CoordType,dimension> lower;
│ │ │ │ +
398 Dune::FieldVector<CoordType,dimension> upper;
│ │ │ │ +
399
│ │ │ │ +
400 assert(codimension == 0 or codimension == dimension);
│ │ │ │ +
401
│ │ │ │ +
402 if constexpr (codimension == 0) {
│ │ │ │ +
403 for (size_t j = 0; j < dimension; j++)
│ │ │ │ +
404 {
│ │ │ │ +
405 lower[j] = double(intCoords[j]) / double(_nIntervals);
│ │ │ │ +
406 upper[j] = double(intCoords[j] + 1) / double(_nIntervals);
│ │ │ │ +
407 }
│ │ │ │ +
408
│ │ │ │ +
409 return typename RefinementImp<dimension,
│ │ │ │ +
410 CoordType>::template Codim<codimension>::Geometry(lower,upper);
│ │ │ │ +
411 } else {
│ │ │ │ +
412 for (size_t j = 0; j < dimension; j++)
│ │ │ │ +
413 lower[j] = upper[j] = double(intCoords[j]) / double(_nIntervals);
│ │ │ │ +
414
│ │ │ │ +
415 return typename RefinementImp<dimension,
│ │ │ │ +
416 CoordType>::template Codim<codimension>::Geometry(lower,upper,std::bitset<dimension>(0));
│ │ │ │ +
417 }
│ │ │ │ +
418 }
│ │ │ │ +
419
│ │ │ │ +
420#endif // DOXYGEN
│ │ │ │ +
421
│ │ │ │ +
422 } // namespace HCube
│ │ │ │ +
│ │ │ │ +
423
│ │ │ │ +
424 // ///////////////////////
│ │ │ │ +
425 //
│ │ │ │ +
426 // The refinement traits
│ │ │ │ +
427 //
│ │ │ │ +
428
│ │ │ │ +
429#ifndef DOXYGEN
│ │ │ │ +
430 template<unsigned topologyId, class CoordType, unsigned coerceToId,
│ │ │ │ +
431 int dim>
│ │ │ │ +
432 struct Traits<
│ │ │ │ +
433 topologyId, CoordType, coerceToId, dim,
│ │ │ │ +
434 typename std::enable_if<
│ │ │ │ +
435 (dim >= 2 &&
│ │ │ │ +
436 (GeometryTypes::cube(dim).id() >> 1) ==
│ │ │ │ +
437 (topologyId >> 1) &&
│ │ │ │ +
438 (GeometryTypes::cube(dim).id() >> 1) ==
│ │ │ │ +
439 (coerceToId >> 1)
│ │ │ │ +
440 )>::type
│ │ │ │ +
441 >
│ │ │ │ +
442 {
│ │ │ │ +
443 typedef HCube::RefinementImp<dim, CoordType> Imp;
│ │ │ │ +
444 };
│ │ │ │ +
445#endif
│ │ │ │ +
446
│ │ │ │ +
447 } // namespace RefinementImp
│ │ │ │ +
448
│ │ │ │ +
449} // namespace Dune
│ │ │ │ +
450
│ │ │ │ +
451#endif // DUNE_GEOMETRY_REFINEMENT_HCUBE_CC
│ │ │ │ + │ │ │ │ +
A geometry implementation for axis-aligned hypercubes.
│ │ │ │ +
This file contains the parts independent of a particular Refinement implementation.
│ │ │ │
Definition affinegeometry.hh:21
│ │ │ │ -
This class provides access to geometric and topological properties of a reference element.
Definition referenceelement.hh:52
│ │ │ │ -
CoordinateField volume() const
obtain the volume of the reference element
Definition referenceelement.hh:241
│ │ │ │ -
ReferenceElement()
Constructs an empty reference element.
Definition referenceelement.hh:271
│ │ │ │ -
bool operator!=(const ReferenceElement &r) const
Compares for inequality with another reference element.
Definition referenceelement.hh:292
│ │ │ │ -
decltype(auto) type(int i, int c) const
obtain the type of subentity (i,c)
Definition referenceelement.hh:171
│ │ │ │ -
typename Implementation::Coordinate Coordinate
The coordinate type.
Definition referenceelement.hh:81
│ │ │ │ -
Codim< codim >::Geometry geometry(int i) const
obtain the embedding of subentity (i,codim) into the reference element
Definition referenceelement.hh:234
│ │ │ │ -
static constexpr int dimension
The dimension of the reference element.
Definition referenceelement.hh:87
│ │ │ │ -
int size(int i, int c, int cc) const
number of subentities of codimension cc of subentity (i,c)
Definition referenceelement.hh:111
│ │ │ │ -
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
│ │ │ │ -
typename Implementation::ctype ctype
The coordinate field type.
Definition referenceelement.hh:75
│ │ │ │ -
int size(int c) const
number of subentities of codimension c
Definition referenceelement.hh:94
│ │ │ │ -
decltype(auto) type() const
obtain the type of this reference element
Definition referenceelement.hh:184
│ │ │ │ -
const Implementation & impl() const
Returns a reference to the internal implementation object.
Definition referenceelement.hh:280
│ │ │ │ -
bool checkInside(const Coordinate &local) const
check if a coordinate is in the reference element
Definition referenceelement.hh:216
│ │ │ │ -
ctype CoordinateField
The coordinate field type.
Definition referenceelement.hh:78
│ │ │ │ -
bool operator==(const ReferenceElement &r) const
Compares for equality with another reference element.
Definition referenceelement.hh:286
│ │ │ │ -
decltype(auto) position(int i, int c) const
position of the barycenter of entity (i,c)
Definition referenceelement.hh:203
│ │ │ │ -
decltype(auto) integrationOuterNormal(int face) const
obtain the integration outer normal of the reference element
Definition referenceelement.hh:258
│ │ │ │ -
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
│ │ │ │ -
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
│ │ │ │ -
ctype Volume
Type used for volume.
Definition referenceelement.hh:84
│ │ │ │ -
Collection of types depending on the codimension.
Definition referenceelement.hh:67
│ │ │ │ -
implementation-defined Geometry
type of geometry embedding a subentity into the reference element
Definition referenceelement.hh:69
│ │ │ │ +
A geometry implementation for axis-aligned hypercubes.
Definition axisalignedcubegeometry.hh:50
│ │ │ │ +
Static tag representing a codimension.
Definition dimension.hh:24
│ │ │ │ +
Refinement implementation for hypercubes
Definition hcube.cc:75
│ │ │ │ +
Codim< 0 >::SubEntityIterator ElementIterator
Definition hcube.cc:86
│ │ │ │ +
static ElementIterator eEnd(unsigned nIntervals)
Definition hcube.cc:153
│ │ │ │ +
static unsigned nVertices(unsigned nIntervals)
Definition hcube.cc:109
│ │ │ │ +
static VertexIterator vEnd(unsigned nIntervals)
Definition hcube.cc:126
│ │ │ │ +
FieldVector< int,(1<< dimension)> IndexVector
Definition hcube.cc:87
│ │ │ │ +
Codim< dimension >::SubEntityIterator VertexIterator
Definition hcube.cc:84
│ │ │ │ +
FieldVector< CoordType, dimension > CoordVector
Definition hcube.cc:85
│ │ │ │ +
static unsigned nElements(unsigned nIntervals)
Definition hcube.cc:134
│ │ │ │ +
RefinementImp< dimension, CoordType > Refinement
Definition hcube.cc:80
│ │ │ │ +
static ElementIterator eBegin(unsigned nIntervals)
Definition hcube.cc:145
│ │ │ │ +
static constexpr int dimension
Know your own dimension.
Definition hcube.cc:78
│ │ │ │ +
static VertexIterator vBegin(unsigned nIntervals)
Definition hcube.cc:118
│ │ │ │ + │ │ │ │ +
Dune::AxisAlignedCubeGeometry< CoordType, dimension-codimension, dimension > Geometry
Definition hcube.cc:103
│ │ │ │ +
SubEntityIterator base class for hypercube refinement.
Definition hcube.cc:175
│ │ │ │ + │ │ │ │ +
Refinement::template Codim< dimension >::SubEntityIterator Common
Definition hcube.cc:188
│ │ │ │ + │ │ │ │ +
RefinementImp< dimension, CoordType > Refinement
Definition hcube.cc:220
│ │ │ │ +
Refinement::template Codim< 0 >::SubEntityIterator Common
Definition hcube.cc:221
│ │ │ │ + │ │ │ │ + │ │ │ │ +
SubEntityIterator(unsigned int index, unsigned int nIntervals)
│ │ │ │ + │ │ │ │ + │ │ │ │ +
RefinementImp< dimension, CoordType > Refinement
Definition hcube.cc:282
│ │ │ │ + │ │ │ │ + │ │ │ │ +
Refinement::template Codim< codimension >::SubEntityIterator This
Definition hcube.cc:283
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -7,296 +7,529 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ -referenceelement.hh │ │ │ │ │ + * refinement │ │ │ │ │ +hcube.cc │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception │ │ │ │ │ - 5#ifndef DUNE_GEOMETRY_REFERENCEELEMENT_HH │ │ │ │ │ - 6#define DUNE_GEOMETRY_REFERENCEELEMENT_HH │ │ │ │ │ + 5#ifndef DUNE_GEOMETRY_REFINEMENT_HCUBE_CC │ │ │ │ │ +6#define DUNE_GEOMETRY_REFINEMENT_HCUBE_CC │ │ │ │ │ 7 │ │ │ │ │ - 8#include │ │ │ │ │ - 9 │ │ │ │ │ - 10namespace Dune { │ │ │ │ │ - 11 namespace Geo { │ │ │ │ │ - 12 │ │ │ │ │ - 13 namespace Impl { │ │ │ │ │ - 14 │ │ │ │ │ - 15 // forward declaration for friend declaration │ │ │ │ │ - 16 template │ │ │ │ │ - 17 class ReferenceElementContainer; │ │ │ │ │ - 18 │ │ │ │ │ - 19 } │ │ │ │ │ - 20 │ │ │ │ │ - 21 // forward declaration for constructing default reference element type │ │ │ │ │ - 22 template │ │ │ │ │ - 23 class ReferenceElementImplementation; │ │ │ │ │ - 24 │ │ │ │ │ - 25 // forward declaration for backwards compatibility conversion │ │ │ │ │ - 26 template │ │ │ │ │ - 27 struct ReferenceElements; │ │ │ │ │ - 28 │ │ │ │ │ - 29 // ReferenceElement │ │ │ │ │ - 30 // ---------------- │ │ │ │ │ - 31 │ │ │ │ │ - 50 template │ │ │ │ │ -51 class ReferenceElement │ │ │ │ │ - 52 { │ │ │ │ │ - 53 │ │ │ │ │ - 54 public: │ │ │ │ │ - 55 │ │ │ │ │ - 56#ifndef DOXYGEN │ │ │ │ │ - 57 │ │ │ │ │ - 59 template │ │ │ │ │ - 60 using Codim = typename Implementation::template Codim; │ │ │ │ │ - 61 │ │ │ │ │ - 62#else │ │ │ │ │ - 63 │ │ │ │ │ - 65 template< int codim > │ │ │ │ │ -66 struct Codim │ │ │ │ │ - 67 { │ │ │ │ │ -69 using Geometry = implementation-defined; │ │ │ │ │ - 70 }; │ │ │ │ │ - 71 │ │ │ │ │ - 72#endif // DOXYGEN │ │ │ │ │ - 73 │ │ │ │ │ -75 using ctype = typename Implementation::ctype; │ │ │ │ │ - 76 │ │ │ │ │ -78 using CoordinateField = ctype; │ │ │ │ │ - 79 │ │ │ │ │ -81 using Coordinate = typename Implementation::Coordinate; │ │ │ │ │ - 82 │ │ │ │ │ -84 typedef ctype Volume; │ │ │ │ │ - 85 │ │ │ │ │ -87 static constexpr int dimension = Implementation::dimension; │ │ │ │ │ + 42#include │ │ │ │ │ + 43 │ │ │ │ │ + 44#include │ │ │ │ │ + 45#include │ │ │ │ │ + 46 │ │ │ │ │ + 47#include │ │ │ │ │ + 48#include │ │ │ │ │ + 49 │ │ │ │ │ + 50#include "base.cc" // for RefinementTraits │ │ │ │ │ + 51 │ │ │ │ │ + 52namespace Dune │ │ │ │ │ + 53{ │ │ │ │ │ + 54 namespace RefinementImp │ │ │ │ │ + 55 { │ │ │ │ │ +62 namespace HCube │ │ │ │ │ + 63 { │ │ │ │ │ + 73 template │ │ │ │ │ +74 class RefinementImp │ │ │ │ │ + 75 { │ │ │ │ │ + 76 public: │ │ │ │ │ +78 constexpr static int dimension = dimension_; │ │ │ │ │ + 79 //- Know yourself │ │ │ │ │ +80 typedef RefinementImp Refinement; │ │ │ │ │ + 81 │ │ │ │ │ + 82 template │ │ │ │ │ + 83 struct Codim; │ │ │ │ │ +84 typedef typename Codim::SubEntityIterator VertexIterator; │ │ │ │ │ +85 typedef FieldVector CoordVector; │ │ │ │ │ +86 typedef typename Codim<0>::SubEntityIterator ElementIterator; │ │ │ │ │ +87 typedef FieldVector IndexVector; │ │ │ │ │ 88 │ │ │ │ │ - 89 │ │ │ │ │ -94 int size(int c) const │ │ │ │ │ - 95 { │ │ │ │ │ - 96 return _impl->size(c); │ │ │ │ │ - 97 } │ │ │ │ │ - 98 │ │ │ │ │ - 99 │ │ │ │ │ -111 int size(int i, int c, int cc) const │ │ │ │ │ - 112 { │ │ │ │ │ - 113 return _impl->size(i,c,cc); │ │ │ │ │ - 114 } │ │ │ │ │ - 115 │ │ │ │ │ - 116 │ │ │ │ │ -130 int subEntity(int i, int c, int ii, int cc) const │ │ │ │ │ - 131 { │ │ │ │ │ - 132 return _impl->subEntity(i,c,ii,cc); │ │ │ │ │ - 133 } │ │ │ │ │ - 134 │ │ │ │ │ -153 auto subEntities ( int i, int c, int cc ) const │ │ │ │ │ + 89 static unsigned nVertices(unsigned nIntervals); │ │ │ │ │ + 90 static VertexIterator vBegin(unsigned nIntervals); │ │ │ │ │ + 91 static VertexIterator vEnd(unsigned nIntervals); │ │ │ │ │ + 92 │ │ │ │ │ + 93 static unsigned nElements(unsigned nIntervals); │ │ │ │ │ + 94 static ElementIterator eBegin(unsigned nIntervals); │ │ │ │ │ + 95 static ElementIterator eEnd(unsigned nIntervals); │ │ │ │ │ + 96 }; │ │ │ │ │ + 97 │ │ │ │ │ + 98 template │ │ │ │ │ + 99 template │ │ │ │ │ +100 struct RefinementImp::Codim │ │ │ │ │ + 101 { │ │ │ │ │ + 102 class SubEntityIterator; │ │ │ │ │ +103 typedef Dune::AxisAlignedCubeGeometry Geometry; │ │ │ │ │ + 104 }; │ │ │ │ │ + 105 │ │ │ │ │ + 106 template │ │ │ │ │ + 107 unsigned │ │ │ │ │ +108 RefinementImp:: │ │ │ │ │ + 109nVertices(unsigned nIntervals) │ │ │ │ │ + 110 { │ │ │ │ │ + 111 // return (nIntervals + 1)^dim │ │ │ │ │ + 112 return Dune::power(nIntervals+1u, unsigned(dimension)); │ │ │ │ │ + 113 } │ │ │ │ │ + 114 │ │ │ │ │ + 115 template │ │ │ │ │ + 116 typename RefinementImp::VertexIterator │ │ │ │ │ +117 RefinementImp:: │ │ │ │ │ + 118vBegin(unsigned nIntervals) │ │ │ │ │ + 119 { │ │ │ │ │ + 120 return VertexIterator(0,nIntervals); │ │ │ │ │ + 121 } │ │ │ │ │ + 122 │ │ │ │ │ + 123 template │ │ │ │ │ + 124 typename RefinementImp::VertexIterator │ │ │ │ │ +125 RefinementImp:: │ │ │ │ │ + 126vEnd(unsigned nIntervals) │ │ │ │ │ + 127 { │ │ │ │ │ + 128 return VertexIterator(nVertices(nIntervals),nIntervals); │ │ │ │ │ + 129 } │ │ │ │ │ + 130 │ │ │ │ │ + 131 template │ │ │ │ │ + 132 unsigned │ │ │ │ │ +133 RefinementImp:: │ │ │ │ │ + 134nElements(unsigned nIntervals) │ │ │ │ │ + 135 { │ │ │ │ │ + 136 static_assert(dimension >= 0, │ │ │ │ │ + 137 "Negative dimension given, what the heck is that supposed to mean?"); │ │ │ │ │ + 138 // return nIntervals^dim │ │ │ │ │ + 139 return Dune::power(nIntervals, unsigned(dimension)); │ │ │ │ │ + 140 } │ │ │ │ │ + 141 │ │ │ │ │ + 142 template │ │ │ │ │ + 143 typename RefinementImp::ElementIterator │ │ │ │ │ +144 RefinementImp:: │ │ │ │ │ + 145eBegin(unsigned nIntervals) │ │ │ │ │ + 146 { │ │ │ │ │ + 147 return ElementIterator(0,nIntervals); │ │ │ │ │ + 148 } │ │ │ │ │ + 149 │ │ │ │ │ + 150 template │ │ │ │ │ + 151 typename RefinementImp::ElementIterator │ │ │ │ │ +152 RefinementImp:: │ │ │ │ │ + 153eEnd(unsigned nIntervals) │ │ │ │ │ 154 { │ │ │ │ │ - 155 return _impl->subEntities(i,c,cc); │ │ │ │ │ + 155 return ElementIterator(nElements(nIntervals),nIntervals); │ │ │ │ │ 156 } │ │ │ │ │ 157 │ │ │ │ │ - 158 │ │ │ │ │ -171 decltype(auto) type(int i, int c) const │ │ │ │ │ - 172 { │ │ │ │ │ - 173 return _impl->type(i,c); │ │ │ │ │ - 174 } │ │ │ │ │ - 175 │ │ │ │ │ - 176 │ │ │ │ │ -184 decltype(auto) type() const │ │ │ │ │ + 158 // │ │ │ │ │ + 159 // The iterators │ │ │ │ │ + 160 // │ │ │ │ │ + 161 │ │ │ │ │ + 162#ifdef DOXYGEN │ │ │ │ │ + 174 template │ │ │ │ │ +175 class RefinementSubEntityIteratorSpecial {}; │ │ │ │ │ + 176#else │ │ │ │ │ + 177 template │ │ │ │ │ + 178 class RefinementSubEntityIteratorSpecial; │ │ │ │ │ + 179#endif //DOXYGEN │ │ │ │ │ + 180 │ │ │ │ │ + 181 // for vertices │ │ │ │ │ + 182 │ │ │ │ │ + 183 template │ │ │ │ │ +184 class RefinementSubEntityIteratorSpecial │ │ │ │ │ 185 { │ │ │ │ │ - 186 return _impl->type(); │ │ │ │ │ - 187 } │ │ │ │ │ - 188 │ │ │ │ │ - 189 │ │ │ │ │ -203 decltype(auto) position(int i, int c) const │ │ │ │ │ + 186 public: │ │ │ │ │ +187 typedef RefinementImp Refinement; │ │ │ │ │ +188 typedef typename Refinement::template Codim::SubEntityIterator │ │ │ │ │ +Common; │ │ │ │ │ +189 typedef typename Refinement::CoordVector CoordVector; │ │ │ │ │ + 190 │ │ │ │ │ + 191 CoordVector coords() const; │ │ │ │ │ + 192 │ │ │ │ │ + 193 private: │ │ │ │ │ + 194 const Common & asCommon() const │ │ │ │ │ + 195 { │ │ │ │ │ + 196 return *static_cast(this); │ │ │ │ │ + 197 } │ │ │ │ │ + 198 }; │ │ │ │ │ + 199 │ │ │ │ │ + 200 template │ │ │ │ │ + 201 typename RefinementSubEntityIteratorSpecial::CoordVector │ │ │ │ │ +202 RefinementSubEntityIteratorSpecial:: │ │ │ │ │ + 203coords() const │ │ │ │ │ 204 { │ │ │ │ │ - 205 return _impl->position(i,c); │ │ │ │ │ - 206 } │ │ │ │ │ - 207 │ │ │ │ │ - 208 │ │ │ │ │ -216 bool checkInside(const Coordinate& local) const │ │ │ │ │ - 217 { │ │ │ │ │ - 218 return _impl->checkInside(local); │ │ │ │ │ - 219 } │ │ │ │ │ - 220 │ │ │ │ │ - 221 │ │ │ │ │ - 233 template │ │ │ │ │ -234 typename Codim::Geometry geometry(int i) const │ │ │ │ │ - 235 { │ │ │ │ │ - 236 return _impl->template geometry(i); │ │ │ │ │ - 237 } │ │ │ │ │ - 238 │ │ │ │ │ - 239 │ │ │ │ │ -241 CoordinateField volume() const │ │ │ │ │ - 242 { │ │ │ │ │ - 243 return _impl->volume(); │ │ │ │ │ - 244 } │ │ │ │ │ - 245 │ │ │ │ │ - 246 │ │ │ │ │ -258 decltype(auto) integrationOuterNormal(int face) const │ │ │ │ │ - 259 { │ │ │ │ │ - 260 return _impl->integrationOuterNormal(face); │ │ │ │ │ - 261 } │ │ │ │ │ - 262 │ │ │ │ │ - 263 │ │ │ │ │ -271 ReferenceElement() │ │ │ │ │ - 272 : _impl(nullptr) │ │ │ │ │ - 273 {} │ │ │ │ │ - 274 │ │ │ │ │ -280 const Implementation& impl() const │ │ │ │ │ - 281 { │ │ │ │ │ - 282 return *_impl; │ │ │ │ │ - 283 } │ │ │ │ │ + 205 std::array v(asCommon().vertexCoord()); │ │ │ │ │ + 206 CoordVector c; │ │ │ │ │ + 207 for (int d = 0; d < dimension; d++) │ │ │ │ │ + 208 { │ │ │ │ │ + 209 c[d] = v[d]*1.0 / asCommon()._nIntervals; │ │ │ │ │ + 210 } │ │ │ │ │ + 211 return c; │ │ │ │ │ + 212 } │ │ │ │ │ + 213 │ │ │ │ │ + 214 // for elements │ │ │ │ │ + 215 │ │ │ │ │ + 216 template │ │ │ │ │ +217 class RefinementSubEntityIteratorSpecial │ │ │ │ │ + 218 { │ │ │ │ │ + 219 public: │ │ │ │ │ +220 typedef RefinementImp Refinement; │ │ │ │ │ +221 typedef typename Refinement::template Codim<0>::SubEntityIterator Common; │ │ │ │ │ +222 typedef typename Refinement::IndexVector IndexVector; │ │ │ │ │ +223 typedef typename Refinement::CoordVector CoordVector; │ │ │ │ │ + 224 │ │ │ │ │ + 225 IndexVector vertexIndices() const; │ │ │ │ │ + 226 CoordVector coords() const; │ │ │ │ │ + 227 │ │ │ │ │ + 228 private: │ │ │ │ │ + 229 const Common & asCommon() const │ │ │ │ │ + 230 { │ │ │ │ │ + 231 return *static_cast(this); │ │ │ │ │ + 232 } │ │ │ │ │ + 233 }; │ │ │ │ │ + 234 │ │ │ │ │ + 235 template │ │ │ │ │ + 236 typename RefinementSubEntityIteratorSpecial:: │ │ │ │ │ +IndexVector │ │ │ │ │ +237 RefinementSubEntityIteratorSpecial:: │ │ │ │ │ + 238vertexIndices() const │ │ │ │ │ + 239 { │ │ │ │ │ + 240 constexpr static int nIndices = 1 << dimension; │ │ │ │ │ + 241 │ │ │ │ │ + 242 // cell index tuple │ │ │ │ │ + 243 std::array e(asCommon().cellCoord()); │ │ │ │ │ + 244 │ │ │ │ │ + 245 // vertices │ │ │ │ │ + 246 IndexVector vec; │ │ │ │ │ + 247 for(int i = 0; i < nIndices; ++i) │ │ │ │ │ + 248 { │ │ │ │ │ + 249 int base = 1; │ │ │ │ │ + 250 std::array alpha(asCommon().idx2multiidx(i)); │ │ │ │ │ + 251 for (int d = 0; d < dimension; d++) { │ │ │ │ │ + 252 vec[i] += (alpha[d] + e[d]) * base; │ │ │ │ │ + 253 base *= asCommon()._nIntervals+1; │ │ │ │ │ + 254 } │ │ │ │ │ + 255 } │ │ │ │ │ + 256 return vec; │ │ │ │ │ + 257 } │ │ │ │ │ + 258 │ │ │ │ │ + 259 template │ │ │ │ │ + 260 typename RefinementSubEntityIteratorSpecial:: │ │ │ │ │ +CoordVector │ │ │ │ │ +261 RefinementSubEntityIteratorSpecial:: │ │ │ │ │ + 262coords() const │ │ │ │ │ + 263 { │ │ │ │ │ + 264 std::array v(asCommon().cellCoord()); │ │ │ │ │ + 265 CoordVector c; │ │ │ │ │ + 266 for (int d=0; d │ │ │ │ │ + 275 template │ │ │ │ │ +276 class RefinementImp::Codim:: │ │ │ │ │ +SubEntityIterator │ │ │ │ │ + 277 : public ForwardIteratorFacade::template Codim::SubEntityIterator, int>, │ │ │ │ │ + 279 public RefinementSubEntityIteratorSpecial │ │ │ │ │ + 280 { │ │ │ │ │ + 281 public: │ │ │ │ │ +282 typedef RefinementImp Refinement; │ │ │ │ │ +283 typedef typename Refinement::template Codim::SubEntityIterator │ │ │ │ │ +This; │ │ │ │ │ 284 │ │ │ │ │ -286 bool operator==(const ReferenceElement& r) const │ │ │ │ │ - 287 { │ │ │ │ │ - 288 return _impl == r._impl; │ │ │ │ │ - 289 } │ │ │ │ │ - 290 │ │ │ │ │ -292 bool operator!=(const ReferenceElement& r) const │ │ │ │ │ - 293 { │ │ │ │ │ - 294 return not (*this == r); │ │ │ │ │ - 295 } │ │ │ │ │ +285 SubEntityIterator(unsigned int index, unsigned int nIntervals); │ │ │ │ │ + 286 │ │ │ │ │ +287 bool equals(const This &other) const; │ │ │ │ │ +288 void increment(); │ │ │ │ │ + 289 │ │ │ │ │ +290 int index() const; │ │ │ │ │ +291 Geometry geometry () const; │ │ │ │ │ + 292 private: │ │ │ │ │ + 293 friend class RefinementSubEntityIteratorSpecial; │ │ │ │ │ + 294 unsigned int _index; │ │ │ │ │ + 295 unsigned int _nIntervals; │ │ │ │ │ 296 │ │ │ │ │ -298 friend std::size_t hash_value(const ReferenceElement& r) │ │ │ │ │ + 297 std::array │ │ │ │ │ + 298 cellCoord(unsigned int idx) const │ │ │ │ │ 299 { │ │ │ │ │ - 300 return reinterpret_cast(r._impl); │ │ │ │ │ + 300 return idx2coord(idx, _nIntervals); │ │ │ │ │ 301 } │ │ │ │ │ 302 │ │ │ │ │ - 303 private: │ │ │ │ │ - 304 │ │ │ │ │ - 305 // The implementation must be a friend to construct a wrapper around │ │ │ │ │ -itself. │ │ │ │ │ - 306 friend Implementation; │ │ │ │ │ - 307 │ │ │ │ │ - 308 // The reference container is a friend to be able to call │ │ │ │ │ -setImplementation. │ │ │ │ │ - 309 friend class Impl::ReferenceElementContainer; │ │ │ │ │ - 310 │ │ │ │ │ - 311 // Constructor for wrapping an implementation reference (required │ │ │ │ │ -internally by the default implementation) │ │ │ │ │ - 312 ReferenceElement(const Implementation& impl) │ │ │ │ │ - 313 : _impl(&impl) │ │ │ │ │ - 314 {} │ │ │ │ │ - 315 │ │ │ │ │ - 316 void setImplementation(const Implementation& impl) │ │ │ │ │ + 303 std::array │ │ │ │ │ + 304 vertexCoord(unsigned int idx) const │ │ │ │ │ + 305 { │ │ │ │ │ + 306 return idx2coord(idx, _nIntervals+1u); │ │ │ │ │ + 307 } │ │ │ │ │ + 308 │ │ │ │ │ + 309 std::array │ │ │ │ │ + 310 cellCoord() const │ │ │ │ │ + 311 { │ │ │ │ │ + 312 return cellCoord(_index); │ │ │ │ │ + 313 } │ │ │ │ │ + 314 │ │ │ │ │ + 315 std::array │ │ │ │ │ + 316 vertexCoord() const │ │ │ │ │ 317 { │ │ │ │ │ - 318 _impl = &impl; │ │ │ │ │ + 318 return vertexCoord(_index); │ │ │ │ │ 319 } │ │ │ │ │ 320 │ │ │ │ │ - 321 const Implementation* _impl; │ │ │ │ │ - 322 │ │ │ │ │ - 323 }; │ │ │ │ │ - 324 │ │ │ │ │ - 325 } │ │ │ │ │ - 326 │ │ │ │ │ - 327} │ │ │ │ │ - 328 │ │ │ │ │ - 329 │ │ │ │ │ - 330#endif // DUNE_GEOMETRY_REFERENCEELEMENT_HH │ │ │ │ │ -type.hh │ │ │ │ │ -A unique label for each type of element that can occur in a grid. │ │ │ │ │ + 321 std::array │ │ │ │ │ + 322 idx2coord(unsigned int idx, unsigned int w) const │ │ │ │ │ + 323 { │ │ │ │ │ + 324 std::array c; │ │ │ │ │ + 325 for (unsigned int d = 0; d < dimension; d++) │ │ │ │ │ + 326 { │ │ │ │ │ + 327 c[d] = idx%w; │ │ │ │ │ + 328 idx = idx/w; │ │ │ │ │ + 329 } │ │ │ │ │ + 330 return c; │ │ │ │ │ + 331 } │ │ │ │ │ + 332 │ │ │ │ │ + 333 unsigned int │ │ │ │ │ + 334 coord2idx(std::array c, unsigned int w) const │ │ │ │ │ + 335 { │ │ │ │ │ + 336 unsigned int i = 0; │ │ │ │ │ + 337 for (unsigned int d = dimension; d > 0; d--) │ │ │ │ │ + 338 { │ │ │ │ │ + 339 i *= w; │ │ │ │ │ + 340 i += c[d-1]; │ │ │ │ │ + 341 } │ │ │ │ │ + 342 return i; │ │ │ │ │ + 343 } │ │ │ │ │ + 344 │ │ │ │ │ + 345 std::array │ │ │ │ │ + 346 idx2multiidx(unsigned int idx) const │ │ │ │ │ + 347 { │ │ │ │ │ + 348 std::array alpha; │ │ │ │ │ + 349 for (unsigned int i = 0; i < dimension; ++i) │ │ │ │ │ + 350 alpha[i] = (idx >> i) & 1u; │ │ │ │ │ + 351 return alpha; │ │ │ │ │ + 352 } │ │ │ │ │ + 353 }; │ │ │ │ │ + 354 │ │ │ │ │ + 355#ifndef DOXYGEN │ │ │ │ │ + 356 template │ │ │ │ │ + 357 template │ │ │ │ │ + 358 RefinementImp::Codim:: │ │ │ │ │ +SubEntityIterator:: │ │ │ │ │ + 359 SubEntityIterator(unsigned int index, unsigned int nIntervals) │ │ │ │ │ + 360 : _index(index), _nIntervals(nIntervals) │ │ │ │ │ + 361 {} │ │ │ │ │ + 362 │ │ │ │ │ + 363 template │ │ │ │ │ + 364 template │ │ │ │ │ + 365 bool │ │ │ │ │ + 366 RefinementImp::Codim:: │ │ │ │ │ +SubEntityIterator:: │ │ │ │ │ + 367 equals(const This &other) const │ │ │ │ │ + 368 { │ │ │ │ │ + 369 return ((_index == other._index) && (_nIntervals == other._nIntervals)); │ │ │ │ │ + 370 } │ │ │ │ │ + 371 │ │ │ │ │ + 372 template │ │ │ │ │ + 373 template │ │ │ │ │ + 374 void │ │ │ │ │ + 375 RefinementImp::Codim:: │ │ │ │ │ +SubEntityIterator:: │ │ │ │ │ + 376 increment() │ │ │ │ │ + 377 { │ │ │ │ │ + 378 ++_index; │ │ │ │ │ + 379 } │ │ │ │ │ + 380 │ │ │ │ │ + 381 template │ │ │ │ │ + 382 template │ │ │ │ │ + 383 int │ │ │ │ │ + 384 RefinementImp::Codim:: │ │ │ │ │ +SubEntityIterator:: │ │ │ │ │ + 385 index() const │ │ │ │ │ + 386 { │ │ │ │ │ + 387 return _index; │ │ │ │ │ + 388 } │ │ │ │ │ + 389 │ │ │ │ │ + 390 template │ │ │ │ │ + 391 template │ │ │ │ │ + 392 typename RefinementImp::template │ │ │ │ │ +Codim::Geometry │ │ │ │ │ + 393 RefinementImp::Codim:: │ │ │ │ │ +SubEntityIterator::geometry () const │ │ │ │ │ + 394 { │ │ │ │ │ + 395 std::array intCoords = idx2coord │ │ │ │ │ +(_index,_nIntervals); │ │ │ │ │ + 396 │ │ │ │ │ + 397 Dune::FieldVector lower; │ │ │ │ │ + 398 Dune::FieldVector upper; │ │ │ │ │ + 399 │ │ │ │ │ + 400 assert(codimension == 0 or codimension == dimension); │ │ │ │ │ + 401 │ │ │ │ │ + 402 if constexpr (codimension == 0) { │ │ │ │ │ + 403 for (size_t j = 0; j < dimension; j++) │ │ │ │ │ + 404 { │ │ │ │ │ + 405 lower[j] = double(intCoords[j]) / double(_nIntervals); │ │ │ │ │ + 406 upper[j] = double(intCoords[j] + 1) / double(_nIntervals); │ │ │ │ │ + 407 } │ │ │ │ │ + 408 │ │ │ │ │ + 409 return typename RefinementImp::template Codim::Geometry(lower,upper); │ │ │ │ │ + 411 } else { │ │ │ │ │ + 412 for (size_t j = 0; j < dimension; j++) │ │ │ │ │ + 413 lower[j] = upper[j] = double(intCoords[j]) / double(_nIntervals); │ │ │ │ │ + 414 │ │ │ │ │ + 415 return typename RefinementImp::template Codim::Geometry(lower,upper,std:: │ │ │ │ │ +bitset(0)); │ │ │ │ │ + 417 } │ │ │ │ │ + 418 } │ │ │ │ │ + 419 │ │ │ │ │ + 420#endif // DOXYGEN │ │ │ │ │ + 421 │ │ │ │ │ + 422 } // namespace HCube │ │ │ │ │ + 423 │ │ │ │ │ + 424 // /////////////////////// │ │ │ │ │ + 425 // │ │ │ │ │ + 426 // The refinement traits │ │ │ │ │ + 427 // │ │ │ │ │ + 428 │ │ │ │ │ + 429#ifndef DOXYGEN │ │ │ │ │ + 430 template │ │ │ │ │ + 432 struct Traits< │ │ │ │ │ + 433 topologyId, CoordType, coerceToId, dim, │ │ │ │ │ + 434 typename std::enable_if< │ │ │ │ │ + 435 (dim >= 2 && │ │ │ │ │ + 436 (GeometryTypes::cube(dim).id() >> 1) == │ │ │ │ │ + 437 (topologyId >> 1) && │ │ │ │ │ + 438 (GeometryTypes::cube(dim).id() >> 1) == │ │ │ │ │ + 439 (coerceToId >> 1) │ │ │ │ │ + 440 )>::type │ │ │ │ │ + 441 > │ │ │ │ │ + 442 { │ │ │ │ │ + 443 typedef HCube::RefinementImp Imp; │ │ │ │ │ + 444 }; │ │ │ │ │ + 445#endif │ │ │ │ │ + 446 │ │ │ │ │ + 447 } // namespace RefinementImp │ │ │ │ │ + 448 │ │ │ │ │ + 449} // namespace Dune │ │ │ │ │ + 450 │ │ │ │ │ + 451#endif // DUNE_GEOMETRY_REFINEMENT_HCUBE_CC │ │ │ │ │ +referenceelements.hh │ │ │ │ │ +axisalignedcubegeometry.hh │ │ │ │ │ +A geometry implementation for axis-aligned hypercubes. │ │ │ │ │ +base.cc │ │ │ │ │ +This file contains the parts independent of a particular Refinement │ │ │ │ │ +implementation. │ │ │ │ │ Dune │ │ │ │ │ Definition affinegeometry.hh:21 │ │ │ │ │ -Dune::Geo::ReferenceElement │ │ │ │ │ -This class provides access to geometric and topological properties of a │ │ │ │ │ -reference element. │ │ │ │ │ -Definition referenceelement.hh:52 │ │ │ │ │ -Dune::Geo::ReferenceElement::volume │ │ │ │ │ -CoordinateField volume() const │ │ │ │ │ -obtain the volume of the reference element │ │ │ │ │ -Definition referenceelement.hh:241 │ │ │ │ │ -Dune::Geo::ReferenceElement::ReferenceElement │ │ │ │ │ -ReferenceElement() │ │ │ │ │ -Constructs an empty reference element. │ │ │ │ │ -Definition referenceelement.hh:271 │ │ │ │ │ -Dune::Geo::ReferenceElement::operator!= │ │ │ │ │ -bool operator!=(const ReferenceElement &r) const │ │ │ │ │ -Compares for inequality with another reference element. │ │ │ │ │ -Definition referenceelement.hh:292 │ │ │ │ │ -Dune::Geo::ReferenceElement::type │ │ │ │ │ -decltype(auto) type(int i, int c) const │ │ │ │ │ -obtain the type of subentity (i,c) │ │ │ │ │ -Definition referenceelement.hh:171 │ │ │ │ │ -Dune::Geo::ReferenceElement::Coordinate │ │ │ │ │ -typename Implementation::Coordinate Coordinate │ │ │ │ │ -The coordinate type. │ │ │ │ │ -Definition referenceelement.hh:81 │ │ │ │ │ -Dune::Geo::ReferenceElement::geometry │ │ │ │ │ -Codim< codim >::Geometry geometry(int i) const │ │ │ │ │ -obtain the embedding of subentity (i,codim) into the reference element │ │ │ │ │ -Definition referenceelement.hh:234 │ │ │ │ │ -Dune::Geo::ReferenceElement::dimension │ │ │ │ │ +Dune::AxisAlignedCubeGeometry │ │ │ │ │ +A geometry implementation for axis-aligned hypercubes. │ │ │ │ │ +Definition axisalignedcubegeometry.hh:50 │ │ │ │ │ +Dune::Codim │ │ │ │ │ +Static tag representing a codimension. │ │ │ │ │ +Definition dimension.hh:24 │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementImp │ │ │ │ │ +Refinement implementation for hypercubes │ │ │ │ │ +Definition hcube.cc:75 │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementImp::ElementIterator │ │ │ │ │ +Codim< 0 >::SubEntityIterator ElementIterator │ │ │ │ │ +Definition hcube.cc:86 │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementImp::eEnd │ │ │ │ │ +static ElementIterator eEnd(unsigned nIntervals) │ │ │ │ │ +Definition hcube.cc:153 │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementImp::nVertices │ │ │ │ │ +static unsigned nVertices(unsigned nIntervals) │ │ │ │ │ +Definition hcube.cc:109 │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementImp::vEnd │ │ │ │ │ +static VertexIterator vEnd(unsigned nIntervals) │ │ │ │ │ +Definition hcube.cc:126 │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementImp::IndexVector │ │ │ │ │ +FieldVector< int,(1<< dimension)> IndexVector │ │ │ │ │ +Definition hcube.cc:87 │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementImp::VertexIterator │ │ │ │ │ +Codim< dimension >::SubEntityIterator VertexIterator │ │ │ │ │ +Definition hcube.cc:84 │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementImp::CoordVector │ │ │ │ │ +FieldVector< CoordType, dimension > CoordVector │ │ │ │ │ +Definition hcube.cc:85 │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementImp::nElements │ │ │ │ │ +static unsigned nElements(unsigned nIntervals) │ │ │ │ │ +Definition hcube.cc:134 │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementImp::Refinement │ │ │ │ │ +RefinementImp< dimension, CoordType > Refinement │ │ │ │ │ +Definition hcube.cc:80 │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementImp::eBegin │ │ │ │ │ +static ElementIterator eBegin(unsigned nIntervals) │ │ │ │ │ +Definition hcube.cc:145 │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementImp::dimension │ │ │ │ │ static constexpr int dimension │ │ │ │ │ -The dimension of the reference element. │ │ │ │ │ -Definition referenceelement.hh:87 │ │ │ │ │ -Dune::Geo::ReferenceElement::size │ │ │ │ │ -int size(int i, int c, int cc) const │ │ │ │ │ -number of subentities of codimension cc of subentity (i,c) │ │ │ │ │ -Definition referenceelement.hh:111 │ │ │ │ │ -Dune::Geo::ReferenceElement::subEntity │ │ │ │ │ -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 │ │ │ │ │ -Dune::Geo::ReferenceElement::ctype │ │ │ │ │ -typename Implementation::ctype ctype │ │ │ │ │ -The coordinate field type. │ │ │ │ │ -Definition referenceelement.hh:75 │ │ │ │ │ -Dune::Geo::ReferenceElement::size │ │ │ │ │ -int size(int c) const │ │ │ │ │ -number of subentities of codimension c │ │ │ │ │ -Definition referenceelement.hh:94 │ │ │ │ │ -Dune::Geo::ReferenceElement::type │ │ │ │ │ -decltype(auto) type() const │ │ │ │ │ -obtain the type of this reference element │ │ │ │ │ -Definition referenceelement.hh:184 │ │ │ │ │ -Dune::Geo::ReferenceElement::impl │ │ │ │ │ -const Implementation & impl() const │ │ │ │ │ -Returns a reference to the internal implementation object. │ │ │ │ │ -Definition referenceelement.hh:280 │ │ │ │ │ -Dune::Geo::ReferenceElement::checkInside │ │ │ │ │ -bool checkInside(const Coordinate &local) const │ │ │ │ │ -check if a coordinate is in the reference element │ │ │ │ │ -Definition referenceelement.hh:216 │ │ │ │ │ -Dune::Geo::ReferenceElement::CoordinateField │ │ │ │ │ -ctype CoordinateField │ │ │ │ │ -The coordinate field type. │ │ │ │ │ -Definition referenceelement.hh:78 │ │ │ │ │ -Dune::Geo::ReferenceElement::operator== │ │ │ │ │ -bool operator==(const ReferenceElement &r) const │ │ │ │ │ -Compares for equality with another reference element. │ │ │ │ │ -Definition referenceelement.hh:286 │ │ │ │ │ -Dune::Geo::ReferenceElement::position │ │ │ │ │ -decltype(auto) position(int i, int c) const │ │ │ │ │ -position of the barycenter of entity (i,c) │ │ │ │ │ -Definition referenceelement.hh:203 │ │ │ │ │ -Dune::Geo::ReferenceElement::integrationOuterNormal │ │ │ │ │ -decltype(auto) integrationOuterNormal(int face) const │ │ │ │ │ -obtain the integration outer normal of the reference element │ │ │ │ │ -Definition referenceelement.hh:258 │ │ │ │ │ -Dune::Geo::ReferenceElement::hash_value │ │ │ │ │ -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 │ │ │ │ │ -Dune::Geo::ReferenceElement::subEntities │ │ │ │ │ -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 │ │ │ │ │ -Dune::Geo::ReferenceElement::Volume │ │ │ │ │ -ctype Volume │ │ │ │ │ -Type used for volume. │ │ │ │ │ -Definition referenceelement.hh:84 │ │ │ │ │ -Dune::Geo::ReferenceElement::Codim │ │ │ │ │ -Collection of types depending on the codimension. │ │ │ │ │ -Definition referenceelement.hh:67 │ │ │ │ │ -Dune::Geo::ReferenceElement::Codim::Geometry │ │ │ │ │ -implementation-defined Geometry │ │ │ │ │ -type of geometry embedding a subentity into the reference element │ │ │ │ │ -Definition referenceelement.hh:69 │ │ │ │ │ +Know your own dimension. │ │ │ │ │ +Definition hcube.cc:78 │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementImp::vBegin │ │ │ │ │ +static VertexIterator vBegin(unsigned nIntervals) │ │ │ │ │ +Definition hcube.cc:118 │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementImp::Codim │ │ │ │ │ +Definition hcube.cc:101 │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementImp::Codim::Geometry │ │ │ │ │ +Dune::AxisAlignedCubeGeometry< CoordType, dimension-codimension, dimension > │ │ │ │ │ +Geometry │ │ │ │ │ +Definition hcube.cc:103 │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial │ │ │ │ │ +SubEntityIterator base class for hypercube refinement. │ │ │ │ │ +Definition hcube.cc:175 │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_dimension_>::CoordVector │ │ │ │ │ +Refinement::CoordVector CoordVector │ │ │ │ │ +Definition hcube.cc:189 │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_dimension_>::Common │ │ │ │ │ +Refinement::template Codim< dimension >::SubEntityIterator Common │ │ │ │ │ +Definition hcube.cc:188 │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_dimension_>::Refinement │ │ │ │ │ +RefinementImp< dimension, CoordType > Refinement │ │ │ │ │ +Definition hcube.cc:187 │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_0_>::Refinement │ │ │ │ │ +RefinementImp< dimension, CoordType > Refinement │ │ │ │ │ +Definition hcube.cc:220 │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_0_>::Common │ │ │ │ │ +Refinement::template Codim< 0 >::SubEntityIterator Common │ │ │ │ │ +Definition hcube.cc:221 │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_0_>::CoordVector │ │ │ │ │ +Refinement::CoordVector CoordVector │ │ │ │ │ +Definition hcube.cc:223 │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementSubEntityIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_0_>::IndexVector │ │ │ │ │ +Refinement::IndexVector IndexVector │ │ │ │ │ +Definition hcube.cc:222 │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementImp::Codim<_codimension_>:: │ │ │ │ │ +SubEntityIterator │ │ │ │ │ +SubEntityIterator(unsigned int index, unsigned int nIntervals) │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementImp::Codim<_codimension_>::equals │ │ │ │ │ +bool equals(const This &other) const │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementImp::Codim<_codimension_>::geometry │ │ │ │ │ +Geometry geometry() const │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementImp::Codim<_codimension_>::Refinement │ │ │ │ │ +RefinementImp< dimension, CoordType > Refinement │ │ │ │ │ +Definition hcube.cc:282 │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementImp::Codim<_codimension_>::index │ │ │ │ │ +int index() const │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementImp::Codim<_codimension_>::increment │ │ │ │ │ +void increment() │ │ │ │ │ +Dune::RefinementImp::HCube::RefinementImp::Codim<_codimension_>::This │ │ │ │ │ +Refinement::template Codim< codimension >::SubEntityIterator This │ │ │ │ │ +Definition hcube.cc:283 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00233.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: affinegeometry.hh File Reference │ │ │ │ +dune-geometry: simplex.cc File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,50 +65,111 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
affinegeometry.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Macros
│ │ │ │ +
simplex.cc File Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

An implementation of the Geometry interface for affine geometries. │ │ │ │ +

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

│ │ │ │ -
#include <cmath>
│ │ │ │ -#include <dune/common/fmatrix.hh>
│ │ │ │ +
#include <algorithm>
│ │ │ │ #include <dune/common/fvector.hh>
│ │ │ │ -#include <dune/geometry/type.hh>
│ │ │ │ +#include <dune/common/math.hh>
│ │ │ │ +#include <dune/geometry/multilineargeometry.hh>
│ │ │ │ +#include <dune/geometry/referenceelements.hh>
│ │ │ │ +#include <dune/geometry/type.hh>
│ │ │ │ +#include "base.cc"
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::AffineGeometry< ct, mydim, cdim >
 Implementation of the Geometry interface for affine geometries. More...
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 >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ +

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::Geo
namespace  Dune::RefinementImp
 This namespace contains the implementation of Refinement.
 
namespace  Dune::RefinementImp::Simplex
 This namespace contains the Refinement implementation for simplices (triangles, tetrahedrons...)
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Macros

#define DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

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

Detailed Description

│ │ │ │ -

An implementation of the Geometry interface for affine geometries.

│ │ │ │ -
Author
Martin Nolte
│ │ │ │ -
│ │ │ │ +

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

│ │ │ │ +

See Refinement implementation for simplices.

│ │ │ │ +

Macro Definition Documentation

│ │ │ │ + │ │ │ │ +

◆ DUNE_GRID_COMMON_REFINEMENT_SIMPLEX_CC

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

A unique label for each type of element that can occur in a grid. │ │ │ │ +

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

│ │ │ │ -
#include <cassert>
│ │ │ │ -#include <cstdint>
│ │ │ │ -#include <string>
│ │ │ │ -#include <type_traits>
│ │ │ │ -#include <dune/common/exceptions.hh>
│ │ │ │ -#include <dune/common/keywords.hh>
│ │ │ │ -#include <dune/common/typetraits.hh>
│ │ │ │ -#include <dune/common/unused.hh>
│ │ │ │ -#include <dune/geometry/deprecated_topology.hh>
│ │ │ │ +
#include <dune/geometry/referenceelements.hh>
│ │ │ │ +#include <dune/geometry/type.hh>
│ │ │ │ +#include "base.cc"
│ │ │ │ +#include "simplex.cc"
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::GeometryType
 Unique label for each type of entities that can occur in DUNE grids. More...
class  Dune::RefinementImp::HCubeTriangulation::RefinementImp< dimension_, CoordType >
 
struct  Dune::RefinementImp::HCubeTriangulation::RefinementImp< dimension_, CoordType >::Codim< codimension >
 
class  Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial< dimension, CoordType, dimension >
 
class  Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial< dimension, CoordType, 0 >
 
class  Dune::RefinementImp::HCubeTriangulation::RefinementImp< dimension_, CoordType >::Codim< codimension >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::GeometryTypes
 Predefined GeometryTypes for common geometries.
namespace  Dune::RefinementImp
 This namespace contains the implementation of Refinement.
 
namespace  Dune::RefinementImp::HCubeTriangulation
 This namespace contains the Refinement implementation for triangulating hypercubes (GeometryType::cube -> GeometryType::simplex)
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ -Functions

std::ostream & Dune::operator<< (std::ostream &s, const GeometryType &a)
 Prints the type to an output stream.
 

│ │ │ │ +Macros

#define DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC
 
│ │ │ │

Detailed Description

│ │ │ │ -

A unique label for each type of element that can occur in a grid.

│ │ │ │ -
│ │ │ │ +

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

│ │ │ │ +

See Refinement implementation for triangulating hypercubes.

│ │ │ │ +

Macro Definition Documentation

│ │ │ │ + │ │ │ │ +

◆ DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC

│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
#define DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -6,40 +6,57 @@ │ │ │ │ │ dune-geometry 2.9.0 │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ -Classes | Namespaces | Functions │ │ │ │ │ -type.hh File Reference │ │ │ │ │ -A unique label for each type of element that can occur in a grid. More... │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ + * refinement │ │ │ │ │ +Classes | Namespaces | Macros │ │ │ │ │ +hcubetriangulation.cc File Reference │ │ │ │ │ +This file contains the Refinement implementation for triangulating hypercubes │ │ │ │ │ +(quadrilateral -> triangle, hexahedron -> tetrahedron) More... │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include "base.cc" │ │ │ │ │ +#include "simplex.cc" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  Dune::GeometryType │ │ │ │ │ -  Unique label for each type of entities that can occur in DUNE grids. │ │ │ │ │ - More... │ │ │ │ │ + class  Dune::RefinementImp::HCubeTriangulation::RefinementImp<_dimension_, │ │ │ │ │ + CoordType_> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::RefinementImp::HCubeTriangulation::RefinementImp<_dimension_, │ │ │ │ │ + CoordType_>::Codim<_codimension_> │ │ │ │ │ +  │ │ │ │ │ + class  Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial< │ │ │ │ │ + dimension,_CoordType,_dimension_> │ │ │ │ │ +  │ │ │ │ │ + class  Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial< │ │ │ │ │ + dimension,_CoordType,_0_> │ │ │ │ │ +  │ │ │ │ │ + class  Dune::RefinementImp::HCubeTriangulation::RefinementImp<_dimension_, │ │ │ │ │ + CoordType_>::Codim<_codimension_> │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ -namespace  Dune::GeometryTypes │ │ │ │ │ -  Predefined GeometryTypes for common geometries. │ │ │ │ │ +namespace  Dune::RefinementImp │ │ │ │ │ +  This namespace contains the implementation of Refinement. │ │ │ │ │ +  │ │ │ │ │ +namespace  Dune::RefinementImp::HCubeTriangulation │ │ │ │ │ + This namespace contains the Refinement implementation for │ │ │ │ │ +  triangulating hypercubes (GeometryType::cube -> GeometryType:: │ │ │ │ │ + simplex) │ │ │ │ │   │ │ │ │ │ - Functions │ │ │ │ │ -std::ostream & Dune::operator<< (std::ostream &s, const GeometryType &a) │ │ │ │ │ -  Prints the type to an output stream. │ │ │ │ │ + Macros │ │ │ │ │ +#define DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC │ │ │ │ │   │ │ │ │ │ ***** Detailed Description ***** │ │ │ │ │ -A unique label for each type of element that can occur in a grid. │ │ │ │ │ +This file contains the Refinement implementation for triangulating hypercubes │ │ │ │ │ +(quadrilateral -> triangle, hexahedron -> tetrahedron) │ │ │ │ │ +See Refinement_implementation_for_triangulating_hypercubes. │ │ │ │ │ +***** Macro Definition Documentation ***** │ │ │ │ │ +***** ◆ DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC ***** │ │ │ │ │ +#define DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00236_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: type.hh Source File │ │ │ │ +dune-geometry: hcubetriangulation.cc Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -70,500 +70,508 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
type.hh
│ │ │ │ +
hcubetriangulation.cc
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
│ │ │ │ -
5#ifndef DUNE_GEOMETRY_TYPE_HH
│ │ │ │ -
6#define DUNE_GEOMETRY_TYPE_HH
│ │ │ │ +
5#ifndef DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC
│ │ │ │ +
6#define DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC
│ │ │ │
7
│ │ │ │ -
12#include <cassert>
│ │ │ │ -
13#include <cstdint>
│ │ │ │ -
14
│ │ │ │ -
15#include <string>
│ │ │ │ -
16#include <type_traits>
│ │ │ │ -
17
│ │ │ │ -
18#include <dune/common/exceptions.hh>
│ │ │ │ -
19#include <dune/common/keywords.hh>
│ │ │ │ -
20#include <dune/common/typetraits.hh>
│ │ │ │ -
21#include <dune/common/unused.hh>
│ │ │ │ -
22
│ │ │ │ -
23namespace Dune
│ │ │ │ -
24{
│ │ │ │ -
25
│ │ │ │ -
26 namespace Impl
│ │ │ │ -
27 {
│ │ │ │ -
28
│ │ │ │ -
29 enum TopologyConstruction { pyramidConstruction = 0, prismConstruction = 1 };
│ │ │ │ -
30
│ │ │ │ -
31 // Dynamic Topology Properties
│ │ │ │ -
32 // ---------------------------
│ │ │ │ -
33
│ │ │ │ -
42 inline static unsigned int numTopologies ( int dim ) noexcept
│ │ │ │ -
43 {
│ │ │ │ -
44 return (1u << dim);
│ │ │ │ -
45 }
│ │ │ │ -
46
│ │ │ │ -
58 inline bool static isPyramid ( unsigned int topologyId, int dim, int codim = 0 ) noexcept
│ │ │ │ -
59 {
│ │ │ │ -
60 assert( (dim > 0) && (topologyId < numTopologies( dim )) );
│ │ │ │ -
61 assert( (0 <= codim) && (codim < dim) );
│ │ │ │ -
62 return (((topologyId & ~1) & (1u << (dim-codim-1))) == 0);
│ │ │ │ -
63 }
│ │ │ │ + │ │ │ │ +
30#include <dune/geometry/type.hh>
│ │ │ │ +
31
│ │ │ │ +
32#include "base.cc"
│ │ │ │ +
33#include "simplex.cc"
│ │ │ │ +
34
│ │ │ │ +
35namespace Dune
│ │ │ │ +
36{
│ │ │ │ +
37 namespace RefinementImp
│ │ │ │ +
38 {
│ │ │ │ +
│ │ │ │ +
46 namespace HCubeTriangulation {
│ │ │ │ +
47
│ │ │ │ +
48 // ////////////
│ │ │ │ +
49 //
│ │ │ │ +
50 // Utilities
│ │ │ │ +
51 //
│ │ │ │ +
52
│ │ │ │ + │ │ │ │ + │ │ │ │ +
55
│ │ │ │ +
56 // ////////////////////////////////////
│ │ │ │ +
57 //
│ │ │ │ +
58 // Refine a hypercube with simplices
│ │ │ │ +
59 //
│ │ │ │ +
60
│ │ │ │ +
61 // forward declaration of the iterator base
│ │ │ │ +
62 template<int dimension, class CoordType, int codimension>
│ │ │ │ + │ │ │ │
64
│ │ │ │ -
76 inline static bool isPrism ( unsigned int topologyId, int dim, int codim = 0 ) noexcept
│ │ │ │ -
77 {
│ │ │ │ -
78 assert( (dim > 0) && (topologyId < numTopologies( dim )) );
│ │ │ │ -
79 assert( (0 <= codim) && (codim < dim) );
│ │ │ │ -
80 return (( (topologyId | 1) & (1u << (dim-codim-1))) != 0);
│ │ │ │ -
81 }
│ │ │ │ -
82
│ │ │ │ -
90 inline static unsigned int baseTopologyId ( unsigned int topologyId, int dim, int codim = 1 ) noexcept
│ │ │ │ -
91 {
│ │ │ │ -
92 assert( (dim >= 0) && (topologyId < numTopologies( dim )) );
│ │ │ │ -
93 assert( (0 <= codim) && (codim <= dim) );
│ │ │ │ -
94 return topologyId & ((1u << (dim-codim)) - 1);
│ │ │ │ -
95 }
│ │ │ │ -
96
│ │ │ │ -
97 } // namespace Impl
│ │ │ │ -
98
│ │ │ │ -
99// the Topology classes are deprecated and will be removed for the 2.8.
│ │ │ │ -
100// Temporarily a header 'deprecated_topology.hh' is provided which will be removed after the 2.9 release.
│ │ │ │ -
101#if __GNUC__ >= 7
│ │ │ │ -
102# pragma GCC diagnostic push
│ │ │ │ -
103# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
│ │ │ │ -
104#endif
│ │ │ │ - │ │ │ │ -
106#if __GNUC__ >= 7
│ │ │ │ -
107# pragma GCC diagnostic pop
│ │ │ │ -
108#endif
│ │ │ │ -
109
│ │ │ │ -
110 // GeometryType
│ │ │ │ -
111 // -------------
│ │ │ │ -
112
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
126 {
│ │ │ │ -
127 public:
│ │ │ │ -
128
│ │ │ │ -
│ │ │ │ -
131 enum
│ │ │ │ -
132 BasicType {
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
138 none
│ │ │ │ -
139 };
│ │ │ │ -
│ │ │ │ -
140
│ │ │ │ -
141 private:
│ │ │ │ -
142
│ │ │ │ -
144 unsigned char dim_;
│ │ │ │ -
145
│ │ │ │ -
147 bool none_;
│ │ │ │ -
148
│ │ │ │ -
150 unsigned int topologyId_;
│ │ │ │ -
151
│ │ │ │ -
152 // Internal type used for the Id. The exact nature of this type is kept
│ │ │ │ -
153 // as an implementation detail on purpose. We use a scoped enum here because scoped enums
│ │ │ │ -
154 // can be used as template parameters, but are not implicitly converted to other integral
│ │ │ │ -
155 // types by the compiler. That way, we avoid unfortunate implicit conversion chains, e.g.
│ │ │ │ -
156 // people trying to work with GlobalGeometryTypeIndex, but forgetting to actually call
│ │ │ │ -
157 // GlobalGeometryTypeIndex::index(gt) and just using gt directly.
│ │ │ │ -
158 enum class IdType : std::uint64_t
│ │ │ │ -
159 {};
│ │ │ │ -
160
│ │ │ │ -
161 public:
│ │ │ │ -
162
│ │ │ │ -
193 using Id = IdType;
│ │ │ │ -
194
│ │ │ │ -
│ │ │ │ -
202 constexpr operator Id() const
│ │ │ │ -
203 {
│ │ │ │ -
204 // recreate the exact storage layout that this class is using, making conversion
│ │ │ │ -
205 // extremely cheap
│ │ │ │ -
206 std::uint64_t id = dim_ | (std::uint64_t(none_) << 8) | (std::uint64_t(topologyId_) << 32);
│ │ │ │ -
207 return static_cast<Id>(id);
│ │ │ │ -
208 }
│ │ │ │ -
│ │ │ │ -
209
│ │ │ │ -
│ │ │ │ -
222 constexpr Id toId() const
│ │ │ │ -
223 {
│ │ │ │ -
224 return static_cast<Id>(*this);
│ │ │ │ -
225 }
│ │ │ │ -
│ │ │ │ -
226
│ │ │ │ -
│ │ │ │ -
234 constexpr GeometryType(Id id)
│ │ │ │ -
235 : dim_(static_cast<std::uint64_t>(id) & 0xFF)
│ │ │ │ -
236 , none_(static_cast<std::uint64_t>(id) & 0x100)
│ │ │ │ -
237 , topologyId_(static_cast<std::uint64_t>(id) >> 32)
│ │ │ │ -
238 {}
│ │ │ │ -
│ │ │ │ -
239
│ │ │ │ -
242
│ │ │ │ -
│ │ │ │ -
244 constexpr GeometryType ()
│ │ │ │ -
245 : dim_(0), none_(true), topologyId_(0)
│ │ │ │ -
246 {}
│ │ │ │ -
│ │ │ │ -
247
│ │ │ │ -
│ │ │ │ -
254 constexpr GeometryType(unsigned int topologyId, unsigned int dim, bool isNone)
│ │ │ │ -
255 : dim_(dim), none_(isNone), topologyId_(topologyId)
│ │ │ │ -
256 {}
│ │ │ │ +
65 template<int dimension_, class CoordType>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
67 {
│ │ │ │ +
68 public:
│ │ │ │ +
69 constexpr static int dimension = dimension_;
│ │ │ │ +
70
│ │ │ │ +
71 typedef CoordType ctype;
│ │ │ │ +
72
│ │ │ │ +
73 template<int codimension>
│ │ │ │ +
74 struct Codim;
│ │ │ │ + │ │ │ │ +
76 typedef FieldVector<CoordType, dimension> CoordVector;
│ │ │ │ + │ │ │ │ +
78 typedef FieldVector<int, dimension+1> IndexVector;
│ │ │ │ +
79
│ │ │ │ +
80 static int nVertices(int nIntervals);
│ │ │ │ +
81 static VertexIterator vBegin(int nIntervals);
│ │ │ │ +
82 static VertexIterator vEnd(int nIntervals);
│ │ │ │ +
83
│ │ │ │ +
84 static int nElements(int nIntervals);
│ │ │ │ +
85 static ElementIterator eBegin(int nIntervals);
│ │ │ │ +
86 static ElementIterator eEnd(int nIntervals);
│ │ │ │ +
87 private:
│ │ │ │ +
88 friend class RefinementIteratorSpecial<dimension, CoordType, 0>;
│ │ │ │ +
89 friend class RefinementIteratorSpecial<dimension, CoordType, dimension>;
│ │ │ │ +
90
│ │ │ │ + │ │ │ │ +
92 };
│ │ │ │ +
│ │ │ │ +
93
│ │ │ │ +
94 template<int dimension, class CoordType>
│ │ │ │ +
95 template<int codimension>
│ │ │ │ +
│ │ │ │ +
96 struct RefinementImp<dimension, CoordType>::Codim
│ │ │ │ +
97 {
│ │ │ │ +
98 class SubEntityIterator;
│ │ │ │ +
99 typedef Dune::MultiLinearGeometry<CoordType,dimension-codimension,dimension> Geometry;
│ │ │ │ +
100 };
│ │ │ │ +
│ │ │ │ +
101
│ │ │ │ +
102 template<int dimension, class CoordType>
│ │ │ │ +
103 int
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
105 nVertices(int nIntervals)
│ │ │ │ +
106 {
│ │ │ │ +
107 return BackendRefinement::nVertices(nIntervals) * factorial(int(dimension));
│ │ │ │ +
108 }
│ │ │ │
│ │ │ │ +
109
│ │ │ │ +
110 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
113 vBegin(int nIntervals)
│ │ │ │ +
114 {
│ │ │ │ +
115 return VertexIterator(nIntervals);
│ │ │ │ +
116 }
│ │ │ │ +
│ │ │ │ +
117
│ │ │ │ +
118 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
121 vEnd(int nIntervals)
│ │ │ │ +
122 {
│ │ │ │ +
123 return VertexIterator(nIntervals, true);
│ │ │ │ +
124 }
│ │ │ │ +
│ │ │ │ +
125
│ │ │ │ +
126 template<int dimension, class CoordType>
│ │ │ │ +
127 int
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
129 nElements(int nIntervals)
│ │ │ │ +
130 {
│ │ │ │ +
131 return BackendRefinement::nElements(nIntervals) * factorial(int(dimension));
│ │ │ │ +
132 }
│ │ │ │ +
│ │ │ │ +
133
│ │ │ │ +
134 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
137 eBegin(int nIntervals)
│ │ │ │ +
138 {
│ │ │ │ +
139 return ElementIterator(nIntervals);
│ │ │ │ +
140 }
│ │ │ │ +
│ │ │ │ +
141
│ │ │ │ +
142 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
145 eEnd(int nIntervals)
│ │ │ │ +
146 {
│ │ │ │ +
147 return ElementIterator(nIntervals, true);
│ │ │ │ +
148 }
│ │ │ │ +
│ │ │ │ +
149
│ │ │ │ +
150 // //////////////
│ │ │ │ +
151 //
│ │ │ │ +
152 // The iterator
│ │ │ │ +
153 //
│ │ │ │ +
154
│ │ │ │ +
155 // vertices
│ │ │ │ +
156 template<int dimension, class CoordType>
│ │ │ │ +
│ │ │ │ +
157 class RefinementIteratorSpecial<dimension, CoordType, dimension>
│ │ │ │ +
158 {
│ │ │ │ +
159 public:
│ │ │ │ + │ │ │ │ +
161 typedef typename Refinement::CoordVector CoordVector;
│ │ │ │ +
162 typedef typename Refinement::template Codim<dimension>::Geometry Geometry;
│ │ │ │ +
163
│ │ │ │ +
164 RefinementIteratorSpecial(int nIntervals, bool end = false);
│ │ │ │ +
165
│ │ │ │ +
166 void increment();
│ │ │ │ +
167
│ │ │ │ +
168 CoordVector coords() const;
│ │ │ │ +
169
│ │ │ │ +
170 Geometry geometry() const;
│ │ │ │ +
171
│ │ │ │ +
172 int index() const;
│ │ │ │ +
173 protected:
│ │ │ │ +
174 typedef typename Refinement::BackendRefinement BackendRefinement;
│ │ │ │ +
175 typedef typename BackendRefinement::template Codim<dimension>::SubEntityIterator BackendIterator;
│ │ │ │ +
176 constexpr static int nKuhnSimplices = factorial(int(dimension));
│ │ │ │ +
177
│ │ │ │ + │ │ │ │ +
179
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
183 };
│ │ │ │ +
│ │ │ │ +
184
│ │ │ │ +
185 template<int dimension, class CoordType>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
187 RefinementIteratorSpecial(int nIntervals, bool end)
│ │ │ │ +
188 : nIntervals_(nIntervals), kuhnIndex(0),
│ │ │ │ +
189 backend(BackendRefinement::vBegin(nIntervals_)),
│ │ │ │ +
190 backendEnd(BackendRefinement::vEnd(nIntervals_))
│ │ │ │ +
191 {
│ │ │ │ +
192 if (end)
│ │ │ │ +
193 kuhnIndex = nKuhnSimplices;
│ │ │ │ +
194 }
│ │ │ │ +
│ │ │ │ +
195
│ │ │ │ +
196 template<int dimension, class CoordType>
│ │ │ │ +
197 void
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ +
200 {
│ │ │ │ +
201 ++backend;
│ │ │ │ +
202 if (backend == backendEnd)
│ │ │ │ +
203 {
│ │ │ │ +
204 backend = BackendRefinement::vBegin(nIntervals_);
│ │ │ │ +
205 ++kuhnIndex;
│ │ │ │ +
206 }
│ │ │ │ +
207 }
│ │ │ │ +
│ │ │ │ +
208
│ │ │ │ +
209 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
212 coords() const
│ │ │ │ +
213 {
│ │ │ │ +
214 return referenceToKuhn(backend.coords(), getPermutation<dimension>(kuhnIndex));
│ │ │ │ +
215 }
│ │ │ │ +
│ │ │ │ +
216
│ │ │ │ +
217 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
220 {
│ │ │ │ +
221 std::vector<CoordVector> corners(1);
│ │ │ │ +
222 corners[0] = referenceToKuhn(backend.coords(), getPermutation<dimension>(kuhnIndex));
│ │ │ │ +
223 return Geometry(GeometryTypes::vertex, corners);
│ │ │ │ +
224 }
│ │ │ │ +
│ │ │ │ +
225
│ │ │ │ +
226 template<int dimension, class CoordType>
│ │ │ │ +
227 int
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
229 index() const
│ │ │ │ +
230 {
│ │ │ │ +
231 return kuhnIndex*BackendRefinement::nVertices(nIntervals_) + backend.index();
│ │ │ │ +
232 }
│ │ │ │ +
│ │ │ │ +
233
│ │ │ │ +
234 // elements
│ │ │ │ +
235 template<int dimension, class CoordType>
│ │ │ │ +
│ │ │ │ +
236 class RefinementIteratorSpecial<dimension, CoordType, 0>
│ │ │ │ +
237 {
│ │ │ │ +
238 public:
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
242 typedef typename Refinement::template Codim<0>::Geometry Geometry;
│ │ │ │ +
243
│ │ │ │ +
244 RefinementIteratorSpecial(int nIntervals_, bool end = false);
│ │ │ │ + │ │ │ │ +
246
│ │ │ │ +
247 void increment();
│ │ │ │ +
248
│ │ │ │ +
249 IndexVector vertexIndices() const;
│ │ │ │ +
250 int index() const;
│ │ │ │ +
251 CoordVector coords() const;
│ │ │ │ +
252
│ │ │ │ +
253 Geometry geometry() const;
│ │ │ │ +
254
│ │ │ │ +
255 private:
│ │ │ │ +
256 CoordVector global(const CoordVector &local) const;
│ │ │ │
257
│ │ │ │ -
│ │ │ │ -
263 constexpr GeometryType(unsigned int topologyId, unsigned int dim)
│ │ │ │ -
264 : dim_(dim), none_(false), topologyId_(topologyId)
│ │ │ │ -
265 {}
│ │ │ │ -
│ │ │ │ -
266
│ │ │ │ -
277 template<class TopologyType,
│ │ │ │ -
278 class = std::void_t<decltype(TopologyType::dimension), decltype(TopologyType::id)>>
│ │ │ │ -
│ │ │ │ -
279 explicit GeometryType(TopologyType t)
│ │ │ │ -
280 : dim_(TopologyType::dimension), none_(false), topologyId_(TopologyType::id)
│ │ │ │ -
281 {
│ │ │ │ -
282 DUNE_UNUSED_PARAMETER(t);
│ │ │ │ -
283 }
│ │ │ │ -
│ │ │ │ -
284
│ │ │ │ -
│ │ │ │ -
291 constexpr bool isVertex() const {
│ │ │ │ -
292 return dim_==0;
│ │ │ │ -
293 }
│ │ │ │ -
│ │ │ │ -
294
│ │ │ │ -
│ │ │ │ -
296 constexpr bool isLine() const {
│ │ │ │ -
297 return dim_==1;
│ │ │ │ -
298 }
│ │ │ │ -
│ │ │ │ -
299
│ │ │ │ -
│ │ │ │ -
301 constexpr bool isTriangle() const {
│ │ │ │ -
302 return ! none_ && dim_==2 && (topologyId_ | 1) == 0b0001;
│ │ │ │ -
303 }
│ │ │ │ -
│ │ │ │ -
304
│ │ │ │ -
│ │ │ │ -
306 constexpr bool isQuadrilateral() const {
│ │ │ │ -
307 return ! none_ && dim_==2 && (topologyId_ | 1) == 0b0011;
│ │ │ │ -
308 }
│ │ │ │ -
│ │ │ │ -
309
│ │ │ │ -
│ │ │ │ -
311 constexpr bool isTetrahedron() const {
│ │ │ │ -
312 return ! none_ && dim_==3 && (topologyId_ | 1) == 0b0001;
│ │ │ │ -
313 }
│ │ │ │ -
│ │ │ │ -
314
│ │ │ │ +
258 protected:
│ │ │ │ + │ │ │ │ +
260 typedef typename BackendRefinement::template Codim<0>::SubEntityIterator BackendIterator;
│ │ │ │ +
261 constexpr static int nKuhnSimplices = factorial(dimension);
│ │ │ │ +
262
│ │ │ │ + │ │ │ │ +
264
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
268 };
│ │ │ │ +
│ │ │ │ +
269
│ │ │ │ +
270 template<int dimension, class CoordType>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
272 RefinementIteratorSpecial(int nIntervals, bool end)
│ │ │ │ +
273 : nIntervals_(nIntervals), kuhnIndex(0),
│ │ │ │ +
274 backend(BackendRefinement::eBegin(nIntervals_)),
│ │ │ │ +
275 backendEnd(BackendRefinement::eEnd(nIntervals_))
│ │ │ │ +
276 {
│ │ │ │ +
277 if (end)
│ │ │ │ +
278 kuhnIndex = nKuhnSimplices;
│ │ │ │ +
279 }
│ │ │ │ +
│ │ │ │ +
280 template<int dimension, class CoordType>
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ +
283 : nIntervals_(other.nIntervals_), kuhnIndex(other.kuhnIndex),
│ │ │ │ +
284 backend(other.backend),
│ │ │ │ +
285 backendEnd(other.backendEnd)
│ │ │ │ +
286 {}
│ │ │ │ +
│ │ │ │ +
287
│ │ │ │ +
288 template<int dimension, class CoordType>
│ │ │ │ +
289 void
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ +
292 {
│ │ │ │ +
293 ++backend;
│ │ │ │ +
294 if (backend == backendEnd)
│ │ │ │ +
295 {
│ │ │ │ +
296 backend = BackendRefinement::eBegin(nIntervals_);
│ │ │ │ +
297 ++kuhnIndex;
│ │ │ │ +
298 }
│ │ │ │ +
299 }
│ │ │ │ +
│ │ │ │ +
300
│ │ │ │ +
301 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
304 vertexIndices() const
│ │ │ │ +
305 {
│ │ │ │ +
306 IndexVector indices = backend.vertexIndices();
│ │ │ │ +
307
│ │ │ │ +
308 int base = kuhnIndex * BackendRefinement::nVertices(nIntervals_);
│ │ │ │ +
309 indices += base;
│ │ │ │ +
310
│ │ │ │ +
311 return indices;
│ │ │ │ +
312 }
│ │ │ │ +
│ │ │ │ +
313
│ │ │ │ +
314 template<int dimension, class CoordType>
│ │ │ │ +
315 int
│ │ │ │
│ │ │ │ -
316 constexpr bool isPyramid() const {
│ │ │ │ -
317 return ! none_ && dim_==3 && (topologyId_ | 1) == 0b0011;
│ │ │ │ -
318 }
│ │ │ │ -
│ │ │ │ -
319
│ │ │ │ -
│ │ │ │ -
321 constexpr bool isPrism() const {
│ │ │ │ -
322 return ! none_ && dim_==3 && (topologyId_ | 1) == 0b0101;
│ │ │ │ -
323 }
│ │ │ │ -
│ │ │ │ -
324
│ │ │ │ -
│ │ │ │ -
326 constexpr bool isHexahedron() const {
│ │ │ │ -
327 return ! none_ && dim_==3 && (topologyId_ | 1) == 0b0111;
│ │ │ │ -
328 }
│ │ │ │ + │ │ │ │ +
317 index() const
│ │ │ │ +
318 {
│ │ │ │ +
319 return kuhnIndex*BackendRefinement::nElements(nIntervals_) + backend.index();
│ │ │ │ +
320 }
│ │ │ │ +
│ │ │ │ +
321
│ │ │ │ +
322 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
325 coords() const
│ │ │ │ +
326 {
│ │ │ │ +
327 return global(backend.coords());
│ │ │ │ +
328 }
│ │ │ │
│ │ │ │
329
│ │ │ │ -
│ │ │ │ -
331 constexpr bool isSimplex() const {
│ │ │ │ -
332 return ! none_ && (topologyId_ | 1) == 1;
│ │ │ │ -
333 }
│ │ │ │ -
│ │ │ │ -
334
│ │ │ │ -
│ │ │ │ -
336 constexpr bool isCube() const {
│ │ │ │ -
337 return ! none_ && ((topologyId_ ^ ((1 << dim_)-1)) >> 1 == 0);
│ │ │ │ -
338 }
│ │ │ │ -
│ │ │ │ +
330 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ +
│ │ │ │ + │ │ │ │ +
333 {
│ │ │ │ +
334 const typename BackendIterator::Geometry &bgeo =
│ │ │ │ +
335 backend.geometry();
│ │ │ │ +
336 std::vector<CoordVector> corners(dimension+1);
│ │ │ │ +
337 for(int i = 0; i <= dimension; ++i)
│ │ │ │ +
338 corners[i] = global(bgeo.corner(i));
│ │ │ │
339
│ │ │ │ -
│ │ │ │ -
341 constexpr bool isConical() const {
│ │ │ │ -
342 return ! none_ && (((topologyId_ & ~1) & (1u << (dim_-1))) == 0);
│ │ │ │ -
343 }
│ │ │ │ -
│ │ │ │ -
344
│ │ │ │ -
│ │ │ │ -
349 constexpr bool isConical(const int& step) const {
│ │ │ │ -
350 return ! none_ && (((topologyId_ & ~1) & (1u << step)) == 0);
│ │ │ │ -
351 }
│ │ │ │ -
│ │ │ │ -
352
│ │ │ │ -
│ │ │ │ -
354 constexpr bool isPrismatic() const {
│ │ │ │ -
355 return ! none_ && (( (topologyId_ | 1) & (1u << (dim_-1))) != 0);
│ │ │ │ -
356 }
│ │ │ │ -
│ │ │ │ -
357
│ │ │ │ -
│ │ │ │ -
362 constexpr bool isPrismatic(const int& step) const {
│ │ │ │ -
363 return ! none_ && (( (topologyId_ | 1) & (1u << step)) != 0);
│ │ │ │ -
364 }
│ │ │ │ -
│ │ │ │ -
365
│ │ │ │ -
│ │ │ │ -
367 constexpr bool isNone() const {
│ │ │ │ -
368 return none_;
│ │ │ │ -
369 }
│ │ │ │ -
│ │ │ │ -
370
│ │ │ │ -
│ │ │ │ -
372 constexpr unsigned int dim() const {
│ │ │ │ -
373 return dim_;
│ │ │ │ -
374 }
│ │ │ │ -
│ │ │ │ -
375
│ │ │ │ -
│ │ │ │ -
377 constexpr unsigned int id() const {
│ │ │ │ -
378 return topologyId_;
│ │ │ │ -
379 }
│ │ │ │ -
│ │ │ │ -
380
│ │ │ │ -
│ │ │ │ -
388 constexpr bool operator==(const GeometryType& other) const {
│ │ │ │ -
389 return ( ( none_ == other.none_ )
│ │ │ │ -
390 && ( ( none_ == true )
│ │ │ │ -
391 || ( ( dim_ == other.dim_ )
│ │ │ │ -
392 && ( (topologyId_ >> 1) == (other.topologyId_ >> 1) )
│ │ │ │ -
393 )
│ │ │ │ -
394 )
│ │ │ │ -
395 );
│ │ │ │ -
396 }
│ │ │ │ -
│ │ │ │ -
397
│ │ │ │ -
│ │ │ │ -
399 constexpr bool operator!=(const GeometryType& other) const {
│ │ │ │ -
400 return ! ((*this)==other);
│ │ │ │ -
401 }
│ │ │ │ -
│ │ │ │ -
402
│ │ │ │ -
│ │ │ │ -
404 constexpr bool operator < (const GeometryType& other) const {
│ │ │ │ -
405 return ( ( none_ < other.none_ )
│ │ │ │ -
406 || ( !( other.none_ < none_ )
│ │ │ │ -
407 && ( ( dim_ < other.dim_ )
│ │ │ │ -
408 || ( (other.dim_ == dim_)
│ │ │ │ -
409 && ((topologyId_ >> 1) < (other.topologyId_ >> 1) )
│ │ │ │ -
410 )
│ │ │ │ -
411 )
│ │ │ │ -
412 )
│ │ │ │ -
413 );
│ │ │ │ -
414 }
│ │ │ │ -
│ │ │ │ -
415
│ │ │ │ -
418 };
│ │ │ │ -
│ │ │ │ -
419
│ │ │ │ -
│ │ │ │ -
421 inline std::ostream& operator<< (std::ostream& s, const GeometryType& a)
│ │ │ │ -
422 {
│ │ │ │ -
423 if (a.isSimplex())
│ │ │ │ -
424 {
│ │ │ │ -
425 s << "(simplex, " << a.dim() << ")";
│ │ │ │ -
426 return s;
│ │ │ │ -
427 }
│ │ │ │ -
428 if (a.isCube())
│ │ │ │ -
429 {
│ │ │ │ -
430 s << "(cube, " << a.dim() << ")";
│ │ │ │ -
431 return s;
│ │ │ │ -
432 }
│ │ │ │ -
433 if (a.isPyramid())
│ │ │ │ -
434 {
│ │ │ │ -
435 s << "(pyramid, 3)";
│ │ │ │ -
436 return s;
│ │ │ │ -
437 }
│ │ │ │ -
438 if (a.isPrism())
│ │ │ │ -
439 {
│ │ │ │ -
440 s << "(prism, 3)";
│ │ │ │ -
441 return s;
│ │ │ │ -
442 }
│ │ │ │ -
443 if (a.isNone())
│ │ │ │ -
444 {
│ │ │ │ -
445 s << "(none, " << a.dim() << ")";
│ │ │ │ -
446 return s;
│ │ │ │ -
447 }
│ │ │ │ -
448 s << "(other [" << a.id() << "], " << a.dim() << ")";
│ │ │ │ -
449 return s;
│ │ │ │ -
450 }
│ │ │ │ -
│ │ │ │ -
451
│ │ │ │ -
452
│ │ │ │ -
454
│ │ │ │ -
│ │ │ │ -
458 namespace GeometryTypes {
│ │ │ │ -
459
│ │ │ │ -
461
│ │ │ │ -
464 inline constexpr GeometryType simplex(unsigned int dim)
│ │ │ │ -
465 {
│ │ │ │ -
466 return GeometryType(0,dim,false);
│ │ │ │ -
467 }
│ │ │ │ -
468
│ │ │ │ -
470
│ │ │ │ -
473 inline constexpr GeometryType cube(unsigned int dim)
│ │ │ │ -
474 {
│ │ │ │ -
475 return GeometryType(((dim>1) ? ((1 << dim) - 1) : 0),dim,false);
│ │ │ │ -
476 }
│ │ │ │ -
477
│ │ │ │ -
479
│ │ │ │ -
482 inline constexpr GeometryType none(unsigned int dim)
│ │ │ │ -
483 {
│ │ │ │ -
484 return GeometryType(0,dim,true);
│ │ │ │ -
485 }
│ │ │ │ -
486
│ │ │ │ -
488 inline constexpr GeometryType conicalExtension(const GeometryType& gt)
│ │ │ │ -
489 {
│ │ │ │ -
490 return GeometryType(gt.id(), gt.dim()+1, gt.isNone());
│ │ │ │ -
491 }
│ │ │ │ -
492
│ │ │ │ -
494 inline constexpr GeometryType prismaticExtension(const GeometryType& gt)
│ │ │ │ -
495 {
│ │ │ │ -
496 return GeometryType(gt.id() | ((1 << gt.dim())), gt.dim()+1, gt.isNone());
│ │ │ │ -
497 }
│ │ │ │ -
498
│ │ │ │ -
499#ifndef __cpp_inline_variables
│ │ │ │ -
500 namespace {
│ │ │ │ -
501#endif
│ │ │ │ -
502
│ │ │ │ -
504
│ │ │ │ -
507 DUNE_INLINE_VARIABLE constexpr GeometryType vertex = GeometryType(0,0,false);
│ │ │ │ -
508
│ │ │ │ -
510
│ │ │ │ -
513 DUNE_INLINE_VARIABLE constexpr GeometryType line = GeometryType(0,1,false);
│ │ │ │ -
514
│ │ │ │ -
516
│ │ │ │ -
519 DUNE_INLINE_VARIABLE constexpr GeometryType triangle = simplex(2);
│ │ │ │ -
520
│ │ │ │ -
522
│ │ │ │ -
525 DUNE_INLINE_VARIABLE constexpr GeometryType quadrilateral = cube(2);
│ │ │ │ -
526
│ │ │ │ -
528
│ │ │ │ -
531 DUNE_INLINE_VARIABLE constexpr GeometryType tetrahedron = simplex(3);
│ │ │ │ -
532
│ │ │ │ -
534
│ │ │ │ -
537 DUNE_INLINE_VARIABLE constexpr GeometryType pyramid = GeometryType(0b0011,3,false);
│ │ │ │ -
538
│ │ │ │ -
540
│ │ │ │ -
543 DUNE_INLINE_VARIABLE constexpr GeometryType prism = GeometryType(0b0101,3,false);
│ │ │ │ -
544
│ │ │ │ -
546
│ │ │ │ -
549 DUNE_INLINE_VARIABLE constexpr GeometryType hexahedron = cube(3);
│ │ │ │ -
550
│ │ │ │ -
551#ifndef __cpp_inline_variables
│ │ │ │ -
552 }
│ │ │ │ -
553#endif
│ │ │ │ -
554
│ │ │ │ -
555 }
│ │ │ │ -
│ │ │ │ -
556
│ │ │ │ -
557 namespace Impl
│ │ │ │ -
558 {
│ │ │ │ -
559
│ │ │ │ -
561 inline constexpr GeometryType getBase(const GeometryType& gt) {
│ │ │ │ -
562 return GeometryType(gt.id() & ((1 << (gt.dim()-1))-1), gt.dim()-1, gt.isNone());
│ │ │ │ -
563 }
│ │ │ │ -
564
│ │ │ │ -
565
│ │ │ │ -
566 // IfGeometryType
│ │ │ │ -
567 // ----------
│ │ │ │ -
568
│ │ │ │ -
569 template< template< GeometryType::Id > class Operation, int dim, GeometryType::Id geometryId = GeometryTypes::vertex >
│ │ │ │ -
570 struct IfGeometryType
│ │ │ │ -
571 {
│ │ │ │ -
572 static constexpr GeometryType geometry = geometryId;
│ │ │ │ -
573 template< class... Args >
│ │ │ │ -
574 static auto apply ( GeometryType gt, Args &&... args )
│ │ │ │ -
575 {
│ │ │ │ -
576 GeometryType lowerGeometry(gt.id() >>1 , gt.dim()-1, gt.isNone());
│ │ │ │ -
577
│ │ │ │ -
578 if( gt.id() & 1 )
│ │ │ │ -
579 return IfGeometryType< Operation, dim-1, GeometryTypes::prismaticExtension(geometry).toId() >::apply( lowerGeometry, std::forward< Args >( args )... );
│ │ │ │ -
580 else
│ │ │ │ -
581 return IfGeometryType< Operation, dim-1, GeometryTypes::conicalExtension(geometry).toId() >::apply( lowerGeometry, std::forward< Args >( args )... );
│ │ │ │ -
582 }
│ │ │ │ -
583 };
│ │ │ │ -
584
│ │ │ │ -
585 template< template< GeometryType::Id > class Operation, GeometryType::Id geometryId >
│ │ │ │ -
586 struct IfGeometryType< Operation, 0, geometryId>
│ │ │ │ -
587 {
│ │ │ │ -
588 template< class... Args >
│ │ │ │ -
589 static auto apply ([[maybe_unused]] GeometryType gt, Args &&... args )
│ │ │ │ -
590 {
│ │ │ │ -
591 return Operation< geometryId >::apply( std::forward< Args >( args )... );
│ │ │ │ -
592 }
│ │ │ │ -
593 };
│ │ │ │ -
594 } // namespace Impl
│ │ │ │ -
595} // namespace Dune
│ │ │ │ -
596
│ │ │ │ -
597#endif // DUNE_GEOMETRY_TYPE_HH
│ │ │ │ - │ │ │ │ +
340 return Geometry(bgeo.type(), corners);
│ │ │ │ +
341 }
│ │ │ │ +
│ │ │ │ +
342
│ │ │ │ +
343 template<int dimension, class CoordType>
│ │ │ │ + │ │ │ │ + │ │ │ │ +
346 global(const CoordVector &local) const
│ │ │ │ +
347 {
│ │ │ │ +
348 return referenceToKuhn(local, getPermutation<dimension>(kuhnIndex));
│ │ │ │ +
349 }
│ │ │ │ +
350
│ │ │ │ +
351 // common
│ │ │ │ +
352 template<int dimension, class CoordType>
│ │ │ │ +
353 template<int codimension>
│ │ │ │ +
│ │ │ │ +
354 class RefinementImp<dimension, CoordType>::Codim<codimension>::SubEntityIterator
│ │ │ │ +
355 : public ForwardIteratorFacade<typename RefinementImp<dimension, CoordType>::template Codim<codimension>::SubEntityIterator, int>,
│ │ │ │ +
356 public RefinementIteratorSpecial<dimension, CoordType, codimension>
│ │ │ │ +
357 {
│ │ │ │ +
358 public:
│ │ │ │ + │ │ │ │ +
360 typedef SubEntityIterator This;
│ │ │ │ +
361
│ │ │ │ +
362 SubEntityIterator(int nIntervals, bool end = false);
│ │ │ │ +
363
│ │ │ │ +
364 bool equals(const This &other) const;
│ │ │ │ +
365 protected:
│ │ │ │ +
366 using RefinementIteratorSpecial<dimension, CoordType, codimension>::kuhnIndex;
│ │ │ │ +
367 using RefinementIteratorSpecial<dimension, CoordType, codimension>::backend;
│ │ │ │ +
368 };
│ │ │ │ +
│ │ │ │ +
369
│ │ │ │ +
370#ifndef DOXYGEN
│ │ │ │ +
371 template<int dimension, class CoordType>
│ │ │ │ +
372 template<int codimension>
│ │ │ │ + │ │ │ │ +
374 SubEntityIterator(int nIntervals, bool end)
│ │ │ │ +
375 : RefinementIteratorSpecial<dimension, CoordType, codimension>(nIntervals, end)
│ │ │ │ +
376 {}
│ │ │ │ +
377
│ │ │ │ +
378 template<int dimension, class CoordType>
│ │ │ │ +
379 template<int codimension>
│ │ │ │ +
380 bool
│ │ │ │ + │ │ │ │ +
382 equals(const This &other) const
│ │ │ │ +
383 { return kuhnIndex == other.kuhnIndex && backend == other.backend; }
│ │ │ │ +
384
│ │ │ │ +
385#endif // DOXYGEN
│ │ │ │ +
386
│ │ │ │ +
387 } // namespace HCubeTriangulation
│ │ │ │ +
│ │ │ │ +
388 } // namespace RefinementImp
│ │ │ │ +
389
│ │ │ │ +
390 namespace RefinementImp
│ │ │ │ +
391 {
│ │ │ │ +
392 // ///////////////////////
│ │ │ │ +
393 //
│ │ │ │ +
394 // The refinement traits
│ │ │ │ +
395 //
│ │ │ │ +
396
│ │ │ │ +
397#ifndef DOXYGEN
│ │ │ │ +
398 template<unsigned topologyId, class CoordType, unsigned coerceToId,
│ │ │ │ +
399 int dim>
│ │ │ │ +
400 struct Traits<
│ │ │ │ +
401 topologyId, CoordType, coerceToId, dim,
│ │ │ │ +
402 typename std::enable_if<
│ │ │ │ +
403 (dim >= 2 &&
│ │ │ │ +
404 (GeometryTypes::cube(dim).id() >> 1) ==
│ │ │ │ +
405 (topologyId >> 1) &&
│ │ │ │ +
406 (GeometryTypes::simplex(dim).id() >> 1) ==
│ │ │ │ +
407 (coerceToId >> 1)
│ │ │ │ +
408 )>::type
│ │ │ │ +
409 >
│ │ │ │ +
410 {
│ │ │ │ +
411 typedef HCubeTriangulation::RefinementImp<dim, CoordType> Imp;
│ │ │ │ +
412 };
│ │ │ │ +
413#endif
│ │ │ │ +
414
│ │ │ │ +
415 } // namespace RefinementImp
│ │ │ │ +
416} // namespace Dune
│ │ │ │ +
417
│ │ │ │ +
418#endif // DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC
│ │ │ │ + │ │ │ │ +
A unique label for each type of element that can occur in a grid.
│ │ │ │ +
This file contains the parts independent of a particular Refinement implementation.
│ │ │ │ +
This file contains the Refinement implementation for simplices (triangles, tetrahedrons....
│ │ │ │
Definition affinegeometry.hh:21
│ │ │ │ -
std::ostream & operator<<(std::ostream &s, const GeometryType &a)
Prints the type to an output stream.
Definition type.hh:421
│ │ │ │ -
Unique label for each type of entities that can occur in DUNE grids.
Definition type.hh:126
│ │ │ │ -
constexpr GeometryType(unsigned int topologyId, unsigned int dim)
Constructor, using the topologyId (integer) and the dimension.
Definition type.hh:263
│ │ │ │ -
constexpr bool operator<(const GeometryType &other) const
less-than operation for use with maps
Definition type.hh:404
│ │ │ │ -
constexpr bool operator!=(const GeometryType &other) const
Check for inequality.
Definition type.hh:399
│ │ │ │ -
constexpr bool isPyramid() const
Return true if entity is a pyramid.
Definition type.hh:316
│ │ │ │ -
constexpr bool isTetrahedron() const
Return true if entity is a tetrahedron.
Definition type.hh:311
│ │ │ │ -
constexpr bool isPrism() const
Return true if entity is a prism.
Definition type.hh:321
│ │ │ │ -
constexpr bool isVertex() const
Return true if entity is a vertex.
Definition type.hh:291
│ │ │ │ -
constexpr bool operator==(const GeometryType &other) const
Check for equality. This method knows that in dimension 0 and 1 all BasicTypes are equal.
Definition type.hh:388
│ │ │ │ -
constexpr Id toId() const
Create an Id representation of this GeometryType.
Definition type.hh:222
│ │ │ │ -
constexpr bool isConical(const int &step) const
Return true if entity was constructed with a conical product in the chosen step.
Definition type.hh:349
│ │ │ │ -
constexpr unsigned int dim() const
Return dimension of the type.
Definition type.hh:372
│ │ │ │ -
constexpr bool isPrismatic(const int &step) const
Return true if entity was constructed with a prismatic product in the chosen step.
Definition type.hh:362
│ │ │ │ -
constexpr bool isTriangle() const
Return true if entity is a triangle.
Definition type.hh:301
│ │ │ │ -
GeometryType(TopologyType t)
Constructor from static TopologyType class.
Definition type.hh:279
│ │ │ │ -
constexpr GeometryType(unsigned int topologyId, unsigned int dim, bool isNone)
Constructor, using the topologyId (integer), the dimension and a flag for type none.
Definition type.hh:254
│ │ │ │ -
BasicType
Each entity can be tagged by one of these basic types plus its space dimension.
Definition type.hh:132
│ │ │ │ -
@ cube
Cube element in any nonnegative dimension.
Definition type.hh:134
│ │ │ │ -
@ simplex
Simplicial element in any nonnegative dimension.
Definition type.hh:133
│ │ │ │ -
@ pyramid
Four sided pyramid in three dimensions.
Definition type.hh:135
│ │ │ │ -
@ extended
Other, more general topology, representable as topologyId.
Definition type.hh:137
│ │ │ │ -
@ none
Even more general topology, cannot be specified by a topologyId. Two GeometryTypes with 'none' type a...
Definition type.hh:138
│ │ │ │ -
@ prism
Prism element in three dimensions.
Definition type.hh:136
│ │ │ │ -
constexpr GeometryType(Id id)
Reconstruct a Geometry type from a GeometryType::Id.
Definition type.hh:234
│ │ │ │ -
constexpr bool isCube() const
Return true if entity is a cube of any dimension.
Definition type.hh:336
│ │ │ │ -
constexpr GeometryType()
Default constructor, not initializing anything.
Definition type.hh:244
│ │ │ │ -
constexpr bool isConical() const
Return true if entity was constructed with a conical product in the last step.
Definition type.hh:341
│ │ │ │ -
constexpr bool isLine() const
Return true if entity is a line segment.
Definition type.hh:296
│ │ │ │ -
constexpr bool isQuadrilateral() const
Return true if entity is a quadrilateral.
Definition type.hh:306
│ │ │ │ -
constexpr bool isPrismatic() const
Return true if entity was constructed with a prismatic product in the last step.
Definition type.hh:354
│ │ │ │ -
constexpr unsigned int id() const
Return the topology id of the type.
Definition type.hh:377
│ │ │ │ -
constexpr bool isNone() const
Return true if entity is a singular of any dimension.
Definition type.hh:367
│ │ │ │ -
constexpr bool isHexahedron() const
Return true if entity is a hexahedron.
Definition type.hh:326
│ │ │ │ -
constexpr bool isSimplex() const
Return true if entity is a simplex of any dimension.
Definition type.hh:331
│ │ │ │ -
IdType Id
An integral id representing a GeometryType.
Definition type.hh:193
│ │ │ │ +
FieldVector< int, n > getPermutation(int m)
Calculate permutation from it's index.
Definition simplex.cc:336
│ │ │ │ +
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
│ │ │ │ +
Static tag representing a codimension.
Definition dimension.hh:24
│ │ │ │ +
generic geometry implementation based on corner coordinates
Definition multilineargeometry.hh:181
│ │ │ │ + │ │ │ │ + │ │ │ │ +
static VertexIterator vEnd(int nIntervals)
Definition hcubetriangulation.cc:121
│ │ │ │ +
static VertexIterator vBegin(int nIntervals)
Definition hcubetriangulation.cc:113
│ │ │ │ +
static int nElements(int nIntervals)
Definition hcubetriangulation.cc:129
│ │ │ │ +
FieldVector< CoordType, dimension > CoordVector
Definition hcubetriangulation.cc:76
│ │ │ │ +
CoordType ctype
Definition hcubetriangulation.cc:71
│ │ │ │ +
Codim< 0 >::SubEntityIterator ElementIterator
Definition hcubetriangulation.cc:77
│ │ │ │ +
FieldVector< int, dimension+1 > IndexVector
Definition hcubetriangulation.cc:78
│ │ │ │ +
static ElementIterator eBegin(int nIntervals)
Definition hcubetriangulation.cc:137
│ │ │ │ +
static ElementIterator eEnd(int nIntervals)
Definition hcubetriangulation.cc:145
│ │ │ │ +
static constexpr int dimension
Definition hcubetriangulation.cc:69
│ │ │ │ +
Codim< dimension >::SubEntityIterator VertexIterator
Definition hcubetriangulation.cc:75
│ │ │ │ +
static int nVertices(int nIntervals)
Definition hcubetriangulation.cc:105
│ │ │ │ + │ │ │ │ +
Dune::MultiLinearGeometry< CoordType, dimension-codimension, dimension > Geometry
Definition hcubetriangulation.cc:99
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
Refinement::template Codim< dimension >::Geometry Geometry
Definition hcubetriangulation.cc:162
│ │ │ │ +
BackendRefinement::template Codim< dimension >::SubEntityIterator BackendIterator
Definition hcubetriangulation.cc:175
│ │ │ │ +
Refinement::BackendRefinement BackendRefinement
Definition hcubetriangulation.cc:174
│ │ │ │ + │ │ │ │ +
RefinementImp< dimension, CoordType > Refinement
Definition hcubetriangulation.cc:160
│ │ │ │ + │ │ │ │ +
BackendRefinement::template Codim< 0 >::SubEntityIterator BackendIterator
Definition hcubetriangulation.cc:260
│ │ │ │ + │ │ │ │ +
Refinement::CoordVector CoordVector
Definition hcubetriangulation.cc:241
│ │ │ │ + │ │ │ │ + │ │ │ │ +
Refinement::BackendRefinement BackendRefinement
Definition hcubetriangulation.cc:259
│ │ │ │ + │ │ │ │ +
Refinement::IndexVector IndexVector
Definition hcubetriangulation.cc:240
│ │ │ │ +
RefinementImp< dimension, CoordType > Refinement
Definition hcubetriangulation.cc:239
│ │ │ │ +
Refinement::template Codim< 0 >::Geometry Geometry
Definition hcubetriangulation.cc:242
│ │ │ │ + │ │ │ │ + │ │ │ │ +
RefinementImp< dimension, CoordType > Refinement
Definition hcubetriangulation.cc:359
│ │ │ │ +
SubEntityIterator This
Definition hcubetriangulation.cc:360
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -7,567 +7,590 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ -type.hh │ │ │ │ │ + * refinement │ │ │ │ │ +hcubetriangulation.cc │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception │ │ │ │ │ - 5#ifndef DUNE_GEOMETRY_TYPE_HH │ │ │ │ │ - 6#define DUNE_GEOMETRY_TYPE_HH │ │ │ │ │ + 5#ifndef DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC │ │ │ │ │ +6#define DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC │ │ │ │ │ 7 │ │ │ │ │ - 12#include │ │ │ │ │ - 13#include │ │ │ │ │ - 14 │ │ │ │ │ - 15#include │ │ │ │ │ - 16#include │ │ │ │ │ - 17 │ │ │ │ │ - 18#include │ │ │ │ │ - 19#include │ │ │ │ │ - 20#include │ │ │ │ │ - 21#include │ │ │ │ │ - 22 │ │ │ │ │ - 23namespace Dune │ │ │ │ │ - 24{ │ │ │ │ │ - 25 │ │ │ │ │ - 26 namespace Impl │ │ │ │ │ - 27 { │ │ │ │ │ - 28 │ │ │ │ │ - 29 enum TopologyConstruction { pyramidConstruction = 0, prismConstruction = 1 │ │ │ │ │ -}; │ │ │ │ │ - 30 │ │ │ │ │ - 31 // Dynamic Topology Properties │ │ │ │ │ - 32 // --------------------------- │ │ │ │ │ - 33 │ │ │ │ │ - 42 inline static unsigned int numTopologies ( int dim ) noexcept │ │ │ │ │ - 43 { │ │ │ │ │ - 44 return (1u << dim); │ │ │ │ │ - 45 } │ │ │ │ │ - 46 │ │ │ │ │ - 58 inline bool static isPyramid ( unsigned int topologyId, int dim, int codim │ │ │ │ │ -= 0 ) noexcept │ │ │ │ │ - 59 { │ │ │ │ │ - 60 assert( (dim > 0) && (topologyId < numTopologies( dim )) ); │ │ │ │ │ - 61 assert( (0 <= codim) && (codim < dim) ); │ │ │ │ │ - 62 return (((topologyId & ~1) & (1u << (dim-codim-1))) == 0); │ │ │ │ │ - 63 } │ │ │ │ │ + 29#include │ │ │ │ │ + 30#include │ │ │ │ │ + 31 │ │ │ │ │ + 32#include "base.cc" │ │ │ │ │ + 33#include "simplex.cc" │ │ │ │ │ + 34 │ │ │ │ │ + 35namespace Dune │ │ │ │ │ + 36{ │ │ │ │ │ + 37 namespace RefinementImp │ │ │ │ │ + 38 { │ │ │ │ │ +46 namespace HCubeTriangulation { │ │ │ │ │ + 47 │ │ │ │ │ + 48 // //////////// │ │ │ │ │ + 49 // │ │ │ │ │ + 50 // Utilities │ │ │ │ │ + 51 // │ │ │ │ │ + 52 │ │ │ │ │ + 53 using Simplex::getPermutation; │ │ │ │ │ + 54 using Simplex::referenceToKuhn; │ │ │ │ │ + 55 │ │ │ │ │ + 56 // //////////////////////////////////// │ │ │ │ │ + 57 // │ │ │ │ │ + 58 // Refine a hypercube with simplices │ │ │ │ │ + 59 // │ │ │ │ │ + 60 │ │ │ │ │ + 61 // forward declaration of the iterator base │ │ │ │ │ + 62 template │ │ │ │ │ +63 class RefinementIteratorSpecial; │ │ │ │ │ 64 │ │ │ │ │ - 76 inline static bool isPrism ( unsigned int topologyId, int dim, int codim = │ │ │ │ │ -0 ) noexcept │ │ │ │ │ - 77 { │ │ │ │ │ - 78 assert( (dim > 0) && (topologyId < numTopologies( dim )) ); │ │ │ │ │ - 79 assert( (0 <= codim) && (codim < dim) ); │ │ │ │ │ - 80 return (( (topologyId | 1) & (1u << (dim-codim-1))) != 0); │ │ │ │ │ - 81 } │ │ │ │ │ - 82 │ │ │ │ │ - 90 inline static unsigned int baseTopologyId ( unsigned int topologyId, int │ │ │ │ │ -dim, int codim = 1 ) noexcept │ │ │ │ │ - 91 { │ │ │ │ │ - 92 assert( (dim >= 0) && (topologyId < numTopologies( dim )) ); │ │ │ │ │ - 93 assert( (0 <= codim) && (codim <= dim) ); │ │ │ │ │ - 94 return topologyId & ((1u << (dim-codim)) - 1); │ │ │ │ │ - 95 } │ │ │ │ │ - 96 │ │ │ │ │ - 97 } // namespace Impl │ │ │ │ │ - 98 │ │ │ │ │ - 99// the Topology classes are deprecated and will be removed for the 2.8. │ │ │ │ │ - 100// Temporarily a header 'deprecated_topology.hh' is provided which will be │ │ │ │ │ -removed after the 2.9 release. │ │ │ │ │ - 101#if __GNUC__ >= 7 │ │ │ │ │ - 102# pragma GCC diagnostic push │ │ │ │ │ - 103# pragma GCC diagnostic ignored "-Wdeprecated-declarations" │ │ │ │ │ - 104#endif │ │ │ │ │ - 105#include │ │ │ │ │ - 106#if __GNUC__ >= 7 │ │ │ │ │ - 107# pragma GCC diagnostic pop │ │ │ │ │ - 108#endif │ │ │ │ │ + 65 template │ │ │ │ │ +66 class RefinementImp │ │ │ │ │ + 67 { │ │ │ │ │ + 68 public: │ │ │ │ │ +69 constexpr static int dimension = dimension_; │ │ │ │ │ + 70 │ │ │ │ │ +71 typedef CoordType ctype; │ │ │ │ │ + 72 │ │ │ │ │ + 73 template │ │ │ │ │ + 74 struct Codim; │ │ │ │ │ +75 typedef typename Codim::SubEntityIterator VertexIterator; │ │ │ │ │ +76 typedef FieldVector CoordVector; │ │ │ │ │ +77 typedef typename Codim<0>::SubEntityIterator ElementIterator; │ │ │ │ │ +78 typedef FieldVector IndexVector; │ │ │ │ │ + 79 │ │ │ │ │ + 80 static int nVertices(int nIntervals); │ │ │ │ │ + 81 static VertexIterator vBegin(int nIntervals); │ │ │ │ │ + 82 static VertexIterator vEnd(int nIntervals); │ │ │ │ │ + 83 │ │ │ │ │ + 84 static int nElements(int nIntervals); │ │ │ │ │ + 85 static ElementIterator eBegin(int nIntervals); │ │ │ │ │ +86 static ElementIterator eEnd(int nIntervals); │ │ │ │ │ + 87 private: │ │ │ │ │ + 88 friend class RefinementIteratorSpecial; │ │ │ │ │ + 89 friend class RefinementIteratorSpecial; │ │ │ │ │ + 90 │ │ │ │ │ + 91 typedef Simplex::RefinementImp BackendRefinement; │ │ │ │ │ + 92 }; │ │ │ │ │ + 93 │ │ │ │ │ + 94 template │ │ │ │ │ + 95 template │ │ │ │ │ +96 struct RefinementImp::Codim │ │ │ │ │ + 97 { │ │ │ │ │ + 98 class SubEntityIterator; │ │ │ │ │ +99 typedef Dune::MultiLinearGeometry │ │ │ │ │ +Geometry; │ │ │ │ │ + 100 }; │ │ │ │ │ + 101 │ │ │ │ │ + 102 template │ │ │ │ │ + 103 int │ │ │ │ │ +104 RefinementImp:: │ │ │ │ │ + 105nVertices(int nIntervals) │ │ │ │ │ + 106 { │ │ │ │ │ + 107 return BackendRefinement::nVertices(nIntervals) * factorial(int │ │ │ │ │ +(dimension)); │ │ │ │ │ + 108 } │ │ │ │ │ 109 │ │ │ │ │ - 110 // GeometryType │ │ │ │ │ - 111 // ------------- │ │ │ │ │ - 112 │ │ │ │ │ -125 class GeometryType │ │ │ │ │ - 126 { │ │ │ │ │ - 127 public: │ │ │ │ │ - 128 │ │ │ │ │ -131 enum │ │ │ │ │ - 132 BasicType { │ │ │ │ │ -133 simplex, │ │ │ │ │ -134 cube, │ │ │ │ │ -135 pyramid, │ │ │ │ │ -136 prism, │ │ │ │ │ -137 extended, │ │ │ │ │ - 138 none │ │ │ │ │ -139 }; │ │ │ │ │ - 140 │ │ │ │ │ - 141 private: │ │ │ │ │ - 142 │ │ │ │ │ - 144 unsigned char dim_; │ │ │ │ │ - 145 │ │ │ │ │ - 147 bool none_; │ │ │ │ │ - 148 │ │ │ │ │ - 150 unsigned int topologyId_; │ │ │ │ │ - 151 │ │ │ │ │ - 152 // Internal type used for the Id. The exact nature of this type is kept │ │ │ │ │ - 153 // as an implementation detail on purpose. We use a scoped enum here │ │ │ │ │ -because scoped enums │ │ │ │ │ - 154 // can be used as template parameters, but are not implicitly converted to │ │ │ │ │ -other integral │ │ │ │ │ - 155 // types by the compiler. That way, we avoid unfortunate implicit │ │ │ │ │ -conversion chains, e.g. │ │ │ │ │ - 156 // people trying to work with GlobalGeometryTypeIndex, but forgetting to │ │ │ │ │ -actually call │ │ │ │ │ - 157 // GlobalGeometryTypeIndex::index(gt) and just using gt directly. │ │ │ │ │ - 158 enum class IdType : std::uint64_t │ │ │ │ │ - 159 {}; │ │ │ │ │ - 160 │ │ │ │ │ - 161 public: │ │ │ │ │ - 162 │ │ │ │ │ -193 using Id = IdType; │ │ │ │ │ - 194 │ │ │ │ │ -202 constexpr operator Id() const │ │ │ │ │ + 110 template │ │ │ │ │ + 111 typename RefinementImp::VertexIterator │ │ │ │ │ +112 RefinementImp:: │ │ │ │ │ + 113vBegin(int nIntervals) │ │ │ │ │ + 114 { │ │ │ │ │ + 115 return VertexIterator(nIntervals); │ │ │ │ │ + 116 } │ │ │ │ │ + 117 │ │ │ │ │ + 118 template │ │ │ │ │ + 119 typename RefinementImp::VertexIterator │ │ │ │ │ +120 RefinementImp:: │ │ │ │ │ + 121vEnd(int nIntervals) │ │ │ │ │ + 122 { │ │ │ │ │ + 123 return VertexIterator(nIntervals, true); │ │ │ │ │ + 124 } │ │ │ │ │ + 125 │ │ │ │ │ + 126 template │ │ │ │ │ + 127 int │ │ │ │ │ +128 RefinementImp:: │ │ │ │ │ + 129nElements(int nIntervals) │ │ │ │ │ + 130 { │ │ │ │ │ + 131 return BackendRefinement::nElements(nIntervals) * factorial(int │ │ │ │ │ +(dimension)); │ │ │ │ │ + 132 } │ │ │ │ │ + 133 │ │ │ │ │ + 134 template │ │ │ │ │ + 135 typename RefinementImp::ElementIterator │ │ │ │ │ +136 RefinementImp:: │ │ │ │ │ + 137eBegin(int nIntervals) │ │ │ │ │ + 138 { │ │ │ │ │ + 139 return ElementIterator(nIntervals); │ │ │ │ │ + 140 } │ │ │ │ │ + 141 │ │ │ │ │ + 142 template │ │ │ │ │ + 143 typename RefinementImp::ElementIterator │ │ │ │ │ +144 RefinementImp:: │ │ │ │ │ + 145eEnd(int nIntervals) │ │ │ │ │ + 146 { │ │ │ │ │ + 147 return ElementIterator(nIntervals, true); │ │ │ │ │ + 148 } │ │ │ │ │ + 149 │ │ │ │ │ + 150 // ////////////// │ │ │ │ │ + 151 // │ │ │ │ │ + 152 // The iterator │ │ │ │ │ + 153 // │ │ │ │ │ + 154 │ │ │ │ │ + 155 // vertices │ │ │ │ │ + 156 template │ │ │ │ │ +157 class RefinementIteratorSpecial │ │ │ │ │ + 158 { │ │ │ │ │ + 159 public: │ │ │ │ │ +160 typedef RefinementImp Refinement; │ │ │ │ │ +161 typedef typename Refinement::CoordVector CoordVector; │ │ │ │ │ +162 typedef typename Refinement::template Codim::Geometry Geometry; │ │ │ │ │ + 163 │ │ │ │ │ + 164 RefinementIteratorSpecial(int nIntervals, bool end = false); │ │ │ │ │ + 165 │ │ │ │ │ + 166 void increment(); │ │ │ │ │ + 167 │ │ │ │ │ + 168 CoordVector coords() const; │ │ │ │ │ + 169 │ │ │ │ │ + 170 Geometry geometry() const; │ │ │ │ │ + 171 │ │ │ │ │ + 172 int index() const; │ │ │ │ │ + 173 protected: │ │ │ │ │ +174 typedef typename Refinement::BackendRefinement BackendRefinement; │ │ │ │ │ +175 typedef typename BackendRefinement::template Codim:: │ │ │ │ │ +SubEntityIterator BackendIterator; │ │ │ │ │ +176 constexpr static int nKuhnSimplices = factorial(int(dimension)); │ │ │ │ │ + 177 │ │ │ │ │ +178 int nIntervals_; │ │ │ │ │ + 179 │ │ │ │ │ +180 int kuhnIndex; │ │ │ │ │ +181 BackendIterator backend; │ │ │ │ │ +182 const BackendIterator backendEnd; │ │ │ │ │ + 183 }; │ │ │ │ │ + 184 │ │ │ │ │ + 185 template │ │ │ │ │ +186 RefinementIteratorSpecial:: │ │ │ │ │ + 187RefinementIteratorSpecial(int nIntervals, bool end) │ │ │ │ │ + 188 : nIntervals_(nIntervals), kuhnIndex(0), │ │ │ │ │ + 189 backend(BackendRefinement::vBegin(nIntervals_)), │ │ │ │ │ + 190 backendEnd(BackendRefinement::vEnd(nIntervals_)) │ │ │ │ │ + 191 { │ │ │ │ │ + 192 if (end) │ │ │ │ │ + 193 kuhnIndex = nKuhnSimplices; │ │ │ │ │ + 194 } │ │ │ │ │ + 195 │ │ │ │ │ + 196 template │ │ │ │ │ + 197 void │ │ │ │ │ +198 RefinementIteratorSpecial:: │ │ │ │ │ + 199increment() │ │ │ │ │ + 200 { │ │ │ │ │ + 201 ++backend; │ │ │ │ │ + 202 if (backend == backendEnd) │ │ │ │ │ 203 { │ │ │ │ │ - 204 // recreate the exact storage layout that this class is using, making │ │ │ │ │ -conversion │ │ │ │ │ - 205 // extremely cheap │ │ │ │ │ - 206 std::uint64_t id = dim_ | (std::uint64_t(none_) << 8) | (std::uint64_t │ │ │ │ │ -(topologyId_) << 32); │ │ │ │ │ - 207 return static_cast(id); │ │ │ │ │ - 208 } │ │ │ │ │ - 209 │ │ │ │ │ -222 constexpr Id toId() const │ │ │ │ │ - 223 { │ │ │ │ │ - 224 return static_cast(*this); │ │ │ │ │ - 225 } │ │ │ │ │ - 226 │ │ │ │ │ -234 constexpr GeometryType(Id id) │ │ │ │ │ - 235 : dim_(static_cast(id) & 0xFF) │ │ │ │ │ - 236 , none_(static_cast(id) & 0x100) │ │ │ │ │ - 237 , topologyId_(static_cast(id) >> 32) │ │ │ │ │ - 238 {} │ │ │ │ │ - 239 │ │ │ │ │ - 242 │ │ │ │ │ -244 constexpr GeometryType () │ │ │ │ │ - 245 : dim_(0), none_(true), topologyId_(0) │ │ │ │ │ - 246 {} │ │ │ │ │ - 247 │ │ │ │ │ -254 constexpr GeometryType(unsigned int topologyId, unsigned int dim, bool │ │ │ │ │ -isNone) │ │ │ │ │ - 255 : dim_(dim), none_(isNone), topologyId_(topologyId) │ │ │ │ │ - 256 {} │ │ │ │ │ + 204 backend = BackendRefinement::vBegin(nIntervals_); │ │ │ │ │ + 205 ++kuhnIndex; │ │ │ │ │ + 206 } │ │ │ │ │ + 207 } │ │ │ │ │ + 208 │ │ │ │ │ + 209 template │ │ │ │ │ + 210 typename RefinementIteratorSpecial:: │ │ │ │ │ +CoordVector │ │ │ │ │ +211 RefinementIteratorSpecial:: │ │ │ │ │ + 212coords() const │ │ │ │ │ + 213 { │ │ │ │ │ + 214 return referenceToKuhn(backend.coords(), getPermutation │ │ │ │ │ +(kuhnIndex)); │ │ │ │ │ + 215 } │ │ │ │ │ + 216 │ │ │ │ │ + 217 template │ │ │ │ │ + 218 typename RefinementIteratorSpecial:: │ │ │ │ │ +Geometry │ │ │ │ │ +219 RefinementIteratorSpecial::geometry () │ │ │ │ │ +const │ │ │ │ │ + 220 { │ │ │ │ │ + 221 std::vector corners(1); │ │ │ │ │ + 222 corners[0] = referenceToKuhn(backend.coords(), getPermutation │ │ │ │ │ +(kuhnIndex)); │ │ │ │ │ + 223 return Geometry(GeometryTypes::vertex, corners); │ │ │ │ │ + 224 } │ │ │ │ │ + 225 │ │ │ │ │ + 226 template │ │ │ │ │ + 227 int │ │ │ │ │ +228 RefinementIteratorSpecial:: │ │ │ │ │ + 229index() const │ │ │ │ │ + 230 { │ │ │ │ │ + 231 return kuhnIndex*BackendRefinement::nVertices(nIntervals_) + backend.index │ │ │ │ │ +(); │ │ │ │ │ + 232 } │ │ │ │ │ + 233 │ │ │ │ │ + 234 // elements │ │ │ │ │ + 235 template │ │ │ │ │ +236 class RefinementIteratorSpecial │ │ │ │ │ + 237 { │ │ │ │ │ + 238 public: │ │ │ │ │ +239 typedef RefinementImp Refinement; │ │ │ │ │ +240 typedef typename Refinement::IndexVector IndexVector; │ │ │ │ │ +241 typedef typename Refinement::CoordVector CoordVector; │ │ │ │ │ +242 typedef typename Refinement::template Codim<0>::Geometry Geometry; │ │ │ │ │ + 243 │ │ │ │ │ + 244 RefinementIteratorSpecial(int nIntervals_, bool end = false); │ │ │ │ │ + 245 RefinementIteratorSpecial(const RefinementIteratorSpecial &other); │ │ │ │ │ + 246 │ │ │ │ │ + 247 void increment(); │ │ │ │ │ + 248 │ │ │ │ │ + 249 IndexVector vertexIndices() const; │ │ │ │ │ + 250 int index() const; │ │ │ │ │ + 251 CoordVector coords() const; │ │ │ │ │ + 252 │ │ │ │ │ + 253 Geometry geometry() const; │ │ │ │ │ + 254 │ │ │ │ │ + 255 private: │ │ │ │ │ + 256 CoordVector global(const CoordVector &local) const; │ │ │ │ │ 257 │ │ │ │ │ -263 constexpr GeometryType(unsigned int topologyId, unsigned int dim) │ │ │ │ │ - 264 : dim_(dim), none_(false), topologyId_(topologyId) │ │ │ │ │ - 265 {} │ │ │ │ │ - 266 │ │ │ │ │ - 277 template> │ │ │ │ │ -279 explicit GeometryType(TopologyType t) │ │ │ │ │ - 280 : dim_(TopologyType::dimension), none_(false), topologyId_(TopologyType:: │ │ │ │ │ -id) │ │ │ │ │ - 281 { │ │ │ │ │ - 282 DUNE_UNUSED_PARAMETER(t); │ │ │ │ │ - 283 } │ │ │ │ │ - 284 │ │ │ │ │ -291 constexpr bool isVertex() const { │ │ │ │ │ - 292 return dim_==0; │ │ │ │ │ - 293 } │ │ │ │ │ - 294 │ │ │ │ │ -296 constexpr bool isLine() const { │ │ │ │ │ - 297 return dim_==1; │ │ │ │ │ + 258 protected: │ │ │ │ │ +259 typedef typename Refinement::BackendRefinement BackendRefinement; │ │ │ │ │ +260 typedef typename BackendRefinement::template Codim<0>::SubEntityIterator │ │ │ │ │ +BackendIterator; │ │ │ │ │ +261 constexpr static int nKuhnSimplices = factorial(dimension); │ │ │ │ │ + 262 │ │ │ │ │ +263 int nIntervals_; │ │ │ │ │ + 264 │ │ │ │ │ +265 int kuhnIndex; │ │ │ │ │ +266 BackendIterator backend; │ │ │ │ │ +267 const BackendIterator backendEnd; │ │ │ │ │ + 268 }; │ │ │ │ │ + 269 │ │ │ │ │ + 270 template │ │ │ │ │ +271 RefinementIteratorSpecial:: │ │ │ │ │ + 272RefinementIteratorSpecial(int nIntervals, bool end) │ │ │ │ │ + 273 : nIntervals_(nIntervals), kuhnIndex(0), │ │ │ │ │ + 274 backend(BackendRefinement::eBegin(nIntervals_)), │ │ │ │ │ + 275 backendEnd(BackendRefinement::eEnd(nIntervals_)) │ │ │ │ │ + 276 { │ │ │ │ │ + 277 if (end) │ │ │ │ │ + 278 kuhnIndex = nKuhnSimplices; │ │ │ │ │ + 279 } │ │ │ │ │ + 280 template │ │ │ │ │ +281 RefinementIteratorSpecial:: │ │ │ │ │ + 282RefinementIteratorSpecial(const RefinementIteratorSpecial &other) │ │ │ │ │ + 283 : nIntervals_(other.nIntervals_), kuhnIndex(other.kuhnIndex), │ │ │ │ │ + 284 backend(other.backend), │ │ │ │ │ + 285 backendEnd(other.backendEnd) │ │ │ │ │ + 286 {} │ │ │ │ │ + 287 │ │ │ │ │ + 288 template │ │ │ │ │ + 289 void │ │ │ │ │ +290 RefinementIteratorSpecial:: │ │ │ │ │ + 291increment() │ │ │ │ │ + 292 { │ │ │ │ │ + 293 ++backend; │ │ │ │ │ + 294 if (backend == backendEnd) │ │ │ │ │ + 295 { │ │ │ │ │ + 296 backend = BackendRefinement::eBegin(nIntervals_); │ │ │ │ │ + 297 ++kuhnIndex; │ │ │ │ │ 298 } │ │ │ │ │ - 299 │ │ │ │ │ -301 constexpr bool isTriangle() const { │ │ │ │ │ - 302 return ! none_ && dim_==2 && (topologyId_ | 1) == 0b0001; │ │ │ │ │ - 303 } │ │ │ │ │ - 304 │ │ │ │ │ -306 constexpr bool isQuadrilateral() const { │ │ │ │ │ - 307 return ! none_ && dim_==2 && (topologyId_ | 1) == 0b0011; │ │ │ │ │ - 308 } │ │ │ │ │ - 309 │ │ │ │ │ -311 constexpr bool isTetrahedron() const { │ │ │ │ │ - 312 return ! none_ && dim_==3 && (topologyId_ | 1) == 0b0001; │ │ │ │ │ - 313 } │ │ │ │ │ - 314 │ │ │ │ │ -316 constexpr bool isPyramid() const { │ │ │ │ │ - 317 return ! none_ && dim_==3 && (topologyId_ | 1) == 0b0011; │ │ │ │ │ - 318 } │ │ │ │ │ - 319 │ │ │ │ │ -321 constexpr bool isPrism() const { │ │ │ │ │ - 322 return ! none_ && dim_==3 && (topologyId_ | 1) == 0b0101; │ │ │ │ │ - 323 } │ │ │ │ │ - 324 │ │ │ │ │ -326 constexpr bool isHexahedron() const { │ │ │ │ │ - 327 return ! none_ && dim_==3 && (topologyId_ | 1) == 0b0111; │ │ │ │ │ + 299 } │ │ │ │ │ + 300 │ │ │ │ │ + 301 template │ │ │ │ │ + 302 typename RefinementIteratorSpecial::IndexVector │ │ │ │ │ +303 RefinementIteratorSpecial:: │ │ │ │ │ + 304vertexIndices() const │ │ │ │ │ + 305 { │ │ │ │ │ + 306 IndexVector indices = backend.vertexIndices(); │ │ │ │ │ + 307 │ │ │ │ │ + 308 int base = kuhnIndex * BackendRefinement::nVertices(nIntervals_); │ │ │ │ │ + 309 indices += base; │ │ │ │ │ + 310 │ │ │ │ │ + 311 return indices; │ │ │ │ │ + 312 } │ │ │ │ │ + 313 │ │ │ │ │ + 314 template │ │ │ │ │ + 315 int │ │ │ │ │ +316 RefinementIteratorSpecial:: │ │ │ │ │ + 317index() const │ │ │ │ │ + 318 { │ │ │ │ │ + 319 return kuhnIndex*BackendRefinement::nElements(nIntervals_) + backend.index │ │ │ │ │ +(); │ │ │ │ │ + 320 } │ │ │ │ │ + 321 │ │ │ │ │ + 322 template │ │ │ │ │ + 323 typename RefinementIteratorSpecial::CoordVector │ │ │ │ │ +324 RefinementIteratorSpecial:: │ │ │ │ │ + 325coords() const │ │ │ │ │ + 326 { │ │ │ │ │ + 327 return global(backend.coords()); │ │ │ │ │ 328 } │ │ │ │ │ 329 │ │ │ │ │ -331 constexpr bool isSimplex() const { │ │ │ │ │ - 332 return ! none_ && (topologyId_ | 1) == 1; │ │ │ │ │ - 333 } │ │ │ │ │ - 334 │ │ │ │ │ -336 constexpr bool isCube() const { │ │ │ │ │ - 337 return ! none_ && ((topologyId_ ^ ((1 << dim_)-1)) >> 1 == 0); │ │ │ │ │ - 338 } │ │ │ │ │ + 330 template │ │ │ │ │ + 331 typename RefinementIteratorSpecial::Geometry │ │ │ │ │ +332 RefinementIteratorSpecial::geometry () const │ │ │ │ │ + 333 { │ │ │ │ │ + 334 const typename BackendIterator::Geometry &bgeo = │ │ │ │ │ + 335 backend.geometry(); │ │ │ │ │ + 336 std::vector corners(dimension+1); │ │ │ │ │ + 337 for(int i = 0; i <= dimension; ++i) │ │ │ │ │ + 338 corners[i] = global(bgeo.corner(i)); │ │ │ │ │ 339 │ │ │ │ │ -341 constexpr bool isConical() const { │ │ │ │ │ - 342 return ! none_ && (((topologyId_ & ~1) & (1u << (dim_-1))) == 0); │ │ │ │ │ - 343 } │ │ │ │ │ - 344 │ │ │ │ │ -349 constexpr bool isConical(const int& step) const { │ │ │ │ │ - 350 return ! none_ && (((topologyId_ & ~1) & (1u << step)) == 0); │ │ │ │ │ - 351 } │ │ │ │ │ - 352 │ │ │ │ │ -354 constexpr bool isPrismatic() const { │ │ │ │ │ - 355 return ! none_ && (( (topologyId_ | 1) & (1u << (dim_-1))) != 0); │ │ │ │ │ - 356 } │ │ │ │ │ - 357 │ │ │ │ │ -362 constexpr bool isPrismatic(const int& step) const { │ │ │ │ │ - 363 return ! none_ && (( (topologyId_ | 1) & (1u << step)) != 0); │ │ │ │ │ - 364 } │ │ │ │ │ - 365 │ │ │ │ │ -367 constexpr bool isNone() const { │ │ │ │ │ - 368 return none_; │ │ │ │ │ - 369 } │ │ │ │ │ - 370 │ │ │ │ │ -372 constexpr unsigned int dim() const { │ │ │ │ │ - 373 return dim_; │ │ │ │ │ - 374 } │ │ │ │ │ - 375 │ │ │ │ │ -377 constexpr unsigned int id() const { │ │ │ │ │ - 378 return topologyId_; │ │ │ │ │ - 379 } │ │ │ │ │ - 380 │ │ │ │ │ -388 constexpr bool operator==(const GeometryType& other) const { │ │ │ │ │ - 389 return ( ( none_ == other.none_ ) │ │ │ │ │ - 390 && ( ( none_ == true ) │ │ │ │ │ - 391 || ( ( dim_ == other.dim_ ) │ │ │ │ │ - 392 && ( (topologyId_ >> 1) == (other.topologyId_ >> 1) ) │ │ │ │ │ - 393 ) │ │ │ │ │ - 394 ) │ │ │ │ │ - 395 ); │ │ │ │ │ - 396 } │ │ │ │ │ - 397 │ │ │ │ │ -399 constexpr bool operator!=(const GeometryType& other) const { │ │ │ │ │ - 400 return ! ((*this)==other); │ │ │ │ │ - 401 } │ │ │ │ │ - 402 │ │ │ │ │ -404 constexpr bool operator_<(const GeometryType& other) const { │ │ │ │ │ - 405 return ( ( none_ < other.none_ ) │ │ │ │ │ - 406 || ( !( other.none_ < none_ ) │ │ │ │ │ - 407 && ( ( dim_ < other.dim_ ) │ │ │ │ │ - 408 || ( (other.dim_ == dim_) │ │ │ │ │ - 409 && ((topologyId_ >> 1) < (other.topologyId_ >> 1) ) │ │ │ │ │ - 410 ) │ │ │ │ │ - 411 ) │ │ │ │ │ - 412 ) │ │ │ │ │ - 413 ); │ │ │ │ │ - 414 } │ │ │ │ │ - 415 │ │ │ │ │ - 418 }; │ │ │ │ │ - 419 │ │ │ │ │ -421 inline std::ostream& operator<<(std::ostream& s, const GeometryType& a) │ │ │ │ │ - 422 { │ │ │ │ │ - 423 if (a.isSimplex()) │ │ │ │ │ - 424 { │ │ │ │ │ - 425 s << "(simplex, " << a.dim() << ")"; │ │ │ │ │ - 426 return s; │ │ │ │ │ - 427 } │ │ │ │ │ - 428 if (a.isCube()) │ │ │ │ │ - 429 { │ │ │ │ │ - 430 s << "(cube, " << a.dim() << ")"; │ │ │ │ │ - 431 return s; │ │ │ │ │ - 432 } │ │ │ │ │ - 433 if (a.isPyramid()) │ │ │ │ │ - 434 { │ │ │ │ │ - 435 s << "(pyramid, 3)"; │ │ │ │ │ - 436 return s; │ │ │ │ │ - 437 } │ │ │ │ │ - 438 if (a.isPrism()) │ │ │ │ │ - 439 { │ │ │ │ │ - 440 s << "(prism, 3)"; │ │ │ │ │ - 441 return s; │ │ │ │ │ - 442 } │ │ │ │ │ - 443 if (a.isNone()) │ │ │ │ │ - 444 { │ │ │ │ │ - 445 s << "(none, " << a.dim() << ")"; │ │ │ │ │ - 446 return s; │ │ │ │ │ - 447 } │ │ │ │ │ - 448 s << "(other [" << a.id() << "], " << a.dim() << ")"; │ │ │ │ │ - 449 return s; │ │ │ │ │ - 450 } │ │ │ │ │ - 451 │ │ │ │ │ - 452 │ │ │ │ │ - 454 │ │ │ │ │ -458 namespace GeometryTypes { │ │ │ │ │ - 459 │ │ │ │ │ - 461 │ │ │ │ │ - 464 inline constexpr GeometryType simplex(unsigned int dim) │ │ │ │ │ - 465 { │ │ │ │ │ - 466 return GeometryType(0,dim,false); │ │ │ │ │ - 467 } │ │ │ │ │ - 468 │ │ │ │ │ - 470 │ │ │ │ │ - 473 inline constexpr GeometryType cube(unsigned int dim) │ │ │ │ │ - 474 { │ │ │ │ │ - 475 return GeometryType(((dim>1) ? ((1 << dim) - 1) : 0),dim,false); │ │ │ │ │ - 476 } │ │ │ │ │ - 477 │ │ │ │ │ - 479 │ │ │ │ │ - 482 inline constexpr GeometryType none(unsigned int dim) │ │ │ │ │ - 483 { │ │ │ │ │ - 484 return GeometryType(0,dim,true); │ │ │ │ │ - 485 } │ │ │ │ │ - 486 │ │ │ │ │ - 488 inline constexpr GeometryType conicalExtension(const GeometryType& gt) │ │ │ │ │ - 489 { │ │ │ │ │ - 490 return GeometryType(gt.id(), gt.dim()+1, gt.isNone()); │ │ │ │ │ - 491 } │ │ │ │ │ - 492 │ │ │ │ │ - 494 inline constexpr GeometryType prismaticExtension(const GeometryType& gt) │ │ │ │ │ - 495 { │ │ │ │ │ - 496 return GeometryType(gt.id() | ((1 << gt.dim())), gt.dim()+1, gt.isNone()); │ │ │ │ │ - 497 } │ │ │ │ │ - 498 │ │ │ │ │ - 499#ifndef __cpp_inline_variables │ │ │ │ │ - 500 namespace { │ │ │ │ │ - 501#endif │ │ │ │ │ - 502 │ │ │ │ │ - 504 │ │ │ │ │ - 507 DUNE_INLINE_VARIABLE constexpr GeometryType vertex = GeometryType │ │ │ │ │ -(0,0,false); │ │ │ │ │ - 508 │ │ │ │ │ - 510 │ │ │ │ │ - 513 DUNE_INLINE_VARIABLE constexpr GeometryType line = GeometryType │ │ │ │ │ -(0,1,false); │ │ │ │ │ - 514 │ │ │ │ │ - 516 │ │ │ │ │ - 519 DUNE_INLINE_VARIABLE constexpr GeometryType triangle = simplex(2); │ │ │ │ │ - 520 │ │ │ │ │ - 522 │ │ │ │ │ - 525 DUNE_INLINE_VARIABLE constexpr GeometryType quadrilateral = cube(2); │ │ │ │ │ - 526 │ │ │ │ │ - 528 │ │ │ │ │ - 531 DUNE_INLINE_VARIABLE constexpr GeometryType tetrahedron = simplex(3); │ │ │ │ │ - 532 │ │ │ │ │ - 534 │ │ │ │ │ - 537 DUNE_INLINE_VARIABLE constexpr GeometryType pyramid = GeometryType │ │ │ │ │ -(0b0011,3,false); │ │ │ │ │ - 538 │ │ │ │ │ - 540 │ │ │ │ │ - 543 DUNE_INLINE_VARIABLE constexpr GeometryType prism = GeometryType │ │ │ │ │ -(0b0101,3,false); │ │ │ │ │ - 544 │ │ │ │ │ - 546 │ │ │ │ │ - 549 DUNE_INLINE_VARIABLE constexpr GeometryType hexahedron = cube(3); │ │ │ │ │ - 550 │ │ │ │ │ - 551#ifndef __cpp_inline_variables │ │ │ │ │ - 552 } │ │ │ │ │ - 553#endif │ │ │ │ │ - 554 │ │ │ │ │ - 555 } │ │ │ │ │ - 556 │ │ │ │ │ - 557 namespace Impl │ │ │ │ │ - 558 { │ │ │ │ │ - 559 │ │ │ │ │ - 561 inline constexpr GeometryType getBase(const GeometryType& gt) { │ │ │ │ │ - 562 return GeometryType(gt.id() & ((1 << (gt.dim()-1))-1), gt.dim()-1, │ │ │ │ │ -gt.isNone()); │ │ │ │ │ - 563 } │ │ │ │ │ - 564 │ │ │ │ │ - 565 │ │ │ │ │ - 566 // IfGeometryType │ │ │ │ │ - 567 // ---------- │ │ │ │ │ - 568 │ │ │ │ │ - 569 template< template< GeometryType::Id > class Operation, int dim, │ │ │ │ │ -GeometryType::Id geometryId = GeometryTypes::vertex > │ │ │ │ │ - 570 struct IfGeometryType │ │ │ │ │ - 571 { │ │ │ │ │ - 572 static constexpr GeometryType geometry = geometryId; │ │ │ │ │ - 573 template< class... Args > │ │ │ │ │ - 574 static auto apply ( GeometryType gt, Args &&... args ) │ │ │ │ │ - 575 { │ │ │ │ │ - 576 GeometryType lowerGeometry(gt.id() >>1 , gt.dim()-1, gt.isNone()); │ │ │ │ │ - 577 │ │ │ │ │ - 578 if( gt.id() & 1 ) │ │ │ │ │ - 579 return IfGeometryType< Operation, dim-1, GeometryTypes::prismaticExtension │ │ │ │ │ -(geometry).toId() >::apply( lowerGeometry, std::forward< Args >( args )... ); │ │ │ │ │ - 580 else │ │ │ │ │ - 581 return IfGeometryType< Operation, dim-1, GeometryTypes::conicalExtension │ │ │ │ │ -(geometry).toId() >::apply( lowerGeometry, std::forward< Args >( args )... ); │ │ │ │ │ - 582 } │ │ │ │ │ - 583 }; │ │ │ │ │ - 584 │ │ │ │ │ - 585 template< template< GeometryType::Id > class Operation, GeometryType::Id │ │ │ │ │ -geometryId > │ │ │ │ │ - 586 struct IfGeometryType< Operation, 0, geometryId> │ │ │ │ │ - 587 { │ │ │ │ │ - 588 template< class... Args > │ │ │ │ │ - 589 static auto apply ([[maybe_unused]] GeometryType gt, Args &&... args ) │ │ │ │ │ - 590 { │ │ │ │ │ - 591 return Operation< geometryId >::apply( std::forward< Args >( args )... ); │ │ │ │ │ - 592 } │ │ │ │ │ - 593 }; │ │ │ │ │ - 594 } // namespace Impl │ │ │ │ │ - 595} // namespace Dune │ │ │ │ │ - 596 │ │ │ │ │ - 597#endif // DUNE_GEOMETRY_TYPE_HH │ │ │ │ │ -deprecated_topology.hh │ │ │ │ │ + 340 return Geometry(bgeo.type(), corners); │ │ │ │ │ + 341 } │ │ │ │ │ + 342 │ │ │ │ │ + 343 template │ │ │ │ │ + 344 typename RefinementIteratorSpecial::CoordVector │ │ │ │ │ + 345 RefinementIteratorSpecial:: │ │ │ │ │ + 346global(const CoordVector &local) const │ │ │ │ │ + 347 { │ │ │ │ │ + 348 return referenceToKuhn(local, getPermutation(kuhnIndex)); │ │ │ │ │ + 349 } │ │ │ │ │ + 350 │ │ │ │ │ + 351 // common │ │ │ │ │ + 352 template │ │ │ │ │ + 353 template │ │ │ │ │ +354 class RefinementImp::Codim:: │ │ │ │ │ +SubEntityIterator │ │ │ │ │ + 355 : public ForwardIteratorFacade::template Codim::SubEntityIterator, int>, │ │ │ │ │ + 356 public RefinementIteratorSpecial │ │ │ │ │ + 357 { │ │ │ │ │ + 358 public: │ │ │ │ │ +359 typedef RefinementImp Refinement; │ │ │ │ │ +360 typedef SubEntityIterator This; │ │ │ │ │ + 361 │ │ │ │ │ +362 SubEntityIterator(int nIntervals, bool end = false); │ │ │ │ │ + 363 │ │ │ │ │ +364 bool equals(const This &other) const; │ │ │ │ │ + 365 protected: │ │ │ │ │ + 366 using RefinementIteratorSpecial:: │ │ │ │ │ +kuhnIndex; │ │ │ │ │ + 367 using RefinementIteratorSpecial:: │ │ │ │ │ +backend; │ │ │ │ │ + 368 }; │ │ │ │ │ + 369 │ │ │ │ │ + 370#ifndef DOXYGEN │ │ │ │ │ + 371 template │ │ │ │ │ + 372 template │ │ │ │ │ + 373 RefinementImp::Codim:: │ │ │ │ │ +SubEntityIterator:: │ │ │ │ │ + 374SubEntityIterator(int nIntervals, bool end) │ │ │ │ │ + 375 : RefinementIteratorSpecial(nIntervals, │ │ │ │ │ +end) │ │ │ │ │ + 376 {} │ │ │ │ │ + 377 │ │ │ │ │ + 378 template │ │ │ │ │ + 379 template │ │ │ │ │ + 380 bool │ │ │ │ │ + 381 RefinementImp::Codim:: │ │ │ │ │ +SubEntityIterator:: │ │ │ │ │ + 382equals(const This &other) const │ │ │ │ │ + 383 { return kuhnIndex == other.kuhnIndex && backend == other.backend; } │ │ │ │ │ + 384 │ │ │ │ │ + 385#endif // DOXYGEN │ │ │ │ │ + 386 │ │ │ │ │ + 387 } // namespace HCubeTriangulation │ │ │ │ │ + 388 } // namespace RefinementImp │ │ │ │ │ + 389 │ │ │ │ │ + 390 namespace RefinementImp │ │ │ │ │ + 391 { │ │ │ │ │ + 392 // /////////////////////// │ │ │ │ │ + 393 // │ │ │ │ │ + 394 // The refinement traits │ │ │ │ │ + 395 // │ │ │ │ │ + 396 │ │ │ │ │ + 397#ifndef DOXYGEN │ │ │ │ │ + 398 template │ │ │ │ │ + 400 struct Traits< │ │ │ │ │ + 401 topologyId, CoordType, coerceToId, dim, │ │ │ │ │ + 402 typename std::enable_if< │ │ │ │ │ + 403 (dim >= 2 && │ │ │ │ │ + 404 (GeometryTypes::cube(dim).id() >> 1) == │ │ │ │ │ + 405 (topologyId >> 1) && │ │ │ │ │ + 406 (GeometryTypes::simplex(dim).id() >> 1) == │ │ │ │ │ + 407 (coerceToId >> 1) │ │ │ │ │ + 408 )>::type │ │ │ │ │ + 409 > │ │ │ │ │ + 410 { │ │ │ │ │ + 411 typedef HCubeTriangulation::RefinementImp Imp; │ │ │ │ │ + 412 }; │ │ │ │ │ + 413#endif │ │ │ │ │ + 414 │ │ │ │ │ + 415 } // namespace RefinementImp │ │ │ │ │ + 416} // namespace Dune │ │ │ │ │ + 417 │ │ │ │ │ + 418#endif // DUNE_GEOMETRY_REFINEMENT_HCUBETRIANGULATION_CC │ │ │ │ │ +referenceelements.hh │ │ │ │ │ +type.hh │ │ │ │ │ +A unique label for each type of element that can occur in a grid. │ │ │ │ │ +base.cc │ │ │ │ │ +This file contains the parts independent of a particular Refinement │ │ │ │ │ +implementation. │ │ │ │ │ +simplex.cc │ │ │ │ │ +This file contains the Refinement implementation for simplices (triangles, │ │ │ │ │ +tetrahedrons.... │ │ │ │ │ Dune │ │ │ │ │ Definition affinegeometry.hh:21 │ │ │ │ │ -Dune::operator<< │ │ │ │ │ -std::ostream & operator<<(std::ostream &s, const GeometryType &a) │ │ │ │ │ -Prints the type to an output stream. │ │ │ │ │ -Definition type.hh:421 │ │ │ │ │ -Dune::GeometryType │ │ │ │ │ -Unique label for each type of entities that can occur in DUNE grids. │ │ │ │ │ -Definition type.hh:126 │ │ │ │ │ -Dune::GeometryType::GeometryType │ │ │ │ │ -constexpr GeometryType(unsigned int topologyId, unsigned int dim) │ │ │ │ │ -Constructor, using the topologyId (integer) and the dimension. │ │ │ │ │ -Definition type.hh:263 │ │ │ │ │ -Dune::GeometryType::operator< │ │ │ │ │ -constexpr bool operator<(const GeometryType &other) const │ │ │ │ │ -less-than operation for use with maps │ │ │ │ │ -Definition type.hh:404 │ │ │ │ │ -Dune::GeometryType::operator!= │ │ │ │ │ -constexpr bool operator!=(const GeometryType &other) const │ │ │ │ │ -Check for inequality. │ │ │ │ │ -Definition type.hh:399 │ │ │ │ │ -Dune::GeometryType::isPyramid │ │ │ │ │ -constexpr bool isPyramid() const │ │ │ │ │ -Return true if entity is a pyramid. │ │ │ │ │ -Definition type.hh:316 │ │ │ │ │ -Dune::GeometryType::isTetrahedron │ │ │ │ │ -constexpr bool isTetrahedron() const │ │ │ │ │ -Return true if entity is a tetrahedron. │ │ │ │ │ -Definition type.hh:311 │ │ │ │ │ -Dune::GeometryType::isPrism │ │ │ │ │ -constexpr bool isPrism() const │ │ │ │ │ -Return true if entity is a prism. │ │ │ │ │ -Definition type.hh:321 │ │ │ │ │ -Dune::GeometryType::isVertex │ │ │ │ │ -constexpr bool isVertex() const │ │ │ │ │ -Return true if entity is a vertex. │ │ │ │ │ -Definition type.hh:291 │ │ │ │ │ -Dune::GeometryType::operator== │ │ │ │ │ -constexpr bool operator==(const GeometryType &other) const │ │ │ │ │ -Check for equality. This method knows that in dimension 0 and 1 all BasicTypes │ │ │ │ │ -are equal. │ │ │ │ │ -Definition type.hh:388 │ │ │ │ │ -Dune::GeometryType::toId │ │ │ │ │ -constexpr Id toId() const │ │ │ │ │ -Create an Id representation of this GeometryType. │ │ │ │ │ -Definition type.hh:222 │ │ │ │ │ -Dune::GeometryType::isConical │ │ │ │ │ -constexpr bool isConical(const int &step) const │ │ │ │ │ -Return true if entity was constructed with a conical product in the chosen │ │ │ │ │ -step. │ │ │ │ │ -Definition type.hh:349 │ │ │ │ │ -Dune::GeometryType::dim │ │ │ │ │ -constexpr unsigned int dim() const │ │ │ │ │ -Return dimension of the type. │ │ │ │ │ -Definition type.hh:372 │ │ │ │ │ -Dune::GeometryType::isPrismatic │ │ │ │ │ -constexpr bool isPrismatic(const int &step) const │ │ │ │ │ -Return true if entity was constructed with a prismatic product in the chosen │ │ │ │ │ -step. │ │ │ │ │ -Definition type.hh:362 │ │ │ │ │ -Dune::GeometryType::isTriangle │ │ │ │ │ -constexpr bool isTriangle() const │ │ │ │ │ -Return true if entity is a triangle. │ │ │ │ │ -Definition type.hh:301 │ │ │ │ │ -Dune::GeometryType::GeometryType │ │ │ │ │ -GeometryType(TopologyType t) │ │ │ │ │ -Constructor from static TopologyType class. │ │ │ │ │ -Definition type.hh:279 │ │ │ │ │ -Dune::GeometryType::GeometryType │ │ │ │ │ -constexpr GeometryType(unsigned int topologyId, unsigned int dim, bool isNone) │ │ │ │ │ -Constructor, using the topologyId (integer), the dimension and a flag for type │ │ │ │ │ -none. │ │ │ │ │ -Definition type.hh:254 │ │ │ │ │ -Dune::GeometryType::BasicType │ │ │ │ │ -BasicType │ │ │ │ │ -Each entity can be tagged by one of these basic types plus its space dimension. │ │ │ │ │ -Definition type.hh:132 │ │ │ │ │ -Dune::GeometryType::cube │ │ │ │ │ -@ cube │ │ │ │ │ -Cube element in any nonnegative dimension. │ │ │ │ │ -Definition type.hh:134 │ │ │ │ │ -Dune::GeometryType::simplex │ │ │ │ │ -@ simplex │ │ │ │ │ -Simplicial element in any nonnegative dimension. │ │ │ │ │ -Definition type.hh:133 │ │ │ │ │ -Dune::GeometryType::pyramid │ │ │ │ │ -@ pyramid │ │ │ │ │ -Four sided pyramid in three dimensions. │ │ │ │ │ -Definition type.hh:135 │ │ │ │ │ -Dune::GeometryType::extended │ │ │ │ │ -@ extended │ │ │ │ │ -Other, more general topology, representable as topologyId. │ │ │ │ │ -Definition type.hh:137 │ │ │ │ │ -Dune::GeometryType::none │ │ │ │ │ -@ none │ │ │ │ │ -Even more general topology, cannot be specified by a topologyId. Two │ │ │ │ │ -GeometryTypes with 'none' type a... │ │ │ │ │ -Definition type.hh:138 │ │ │ │ │ -Dune::GeometryType::prism │ │ │ │ │ -@ prism │ │ │ │ │ -Prism element in three dimensions. │ │ │ │ │ -Definition type.hh:136 │ │ │ │ │ -Dune::GeometryType::GeometryType │ │ │ │ │ -constexpr GeometryType(Id id) │ │ │ │ │ -Reconstruct a Geometry type from a GeometryType::Id. │ │ │ │ │ -Definition type.hh:234 │ │ │ │ │ -Dune::GeometryType::isCube │ │ │ │ │ -constexpr bool isCube() const │ │ │ │ │ -Return true if entity is a cube of any dimension. │ │ │ │ │ -Definition type.hh:336 │ │ │ │ │ -Dune::GeometryType::GeometryType │ │ │ │ │ -constexpr GeometryType() │ │ │ │ │ -Default constructor, not initializing anything. │ │ │ │ │ -Definition type.hh:244 │ │ │ │ │ -Dune::GeometryType::isConical │ │ │ │ │ -constexpr bool isConical() const │ │ │ │ │ -Return true if entity was constructed with a conical product in the last step. │ │ │ │ │ -Definition type.hh:341 │ │ │ │ │ -Dune::GeometryType::isLine │ │ │ │ │ -constexpr bool isLine() const │ │ │ │ │ -Return true if entity is a line segment. │ │ │ │ │ -Definition type.hh:296 │ │ │ │ │ -Dune::GeometryType::isQuadrilateral │ │ │ │ │ -constexpr bool isQuadrilateral() const │ │ │ │ │ -Return true if entity is a quadrilateral. │ │ │ │ │ -Definition type.hh:306 │ │ │ │ │ -Dune::GeometryType::isPrismatic │ │ │ │ │ -constexpr bool isPrismatic() const │ │ │ │ │ -Return true if entity was constructed with a prismatic product in the last │ │ │ │ │ -step. │ │ │ │ │ -Definition type.hh:354 │ │ │ │ │ -Dune::GeometryType::id │ │ │ │ │ -constexpr unsigned int id() const │ │ │ │ │ -Return the topology id of the type. │ │ │ │ │ -Definition type.hh:377 │ │ │ │ │ -Dune::GeometryType::isNone │ │ │ │ │ -constexpr bool isNone() const │ │ │ │ │ -Return true if entity is a singular of any dimension. │ │ │ │ │ -Definition type.hh:367 │ │ │ │ │ -Dune::GeometryType::isHexahedron │ │ │ │ │ -constexpr bool isHexahedron() const │ │ │ │ │ -Return true if entity is a hexahedron. │ │ │ │ │ -Definition type.hh:326 │ │ │ │ │ -Dune::GeometryType::isSimplex │ │ │ │ │ -constexpr bool isSimplex() const │ │ │ │ │ -Return true if entity is a simplex of any dimension. │ │ │ │ │ -Definition type.hh:331 │ │ │ │ │ -Dune::GeometryType::Id │ │ │ │ │ -IdType Id │ │ │ │ │ -An integral id representing a GeometryType. │ │ │ │ │ -Definition type.hh:193 │ │ │ │ │ +Dune::RefinementImp::Simplex::getPermutation │ │ │ │ │ +FieldVector< int, n > getPermutation(int m) │ │ │ │ │ +Calculate permutation from it's index. │ │ │ │ │ +Definition simplex.cc:336 │ │ │ │ │ +Dune::RefinementImp::Simplex::referenceToKuhn │ │ │ │ │ +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 │ │ │ │ │ +Dune::Codim │ │ │ │ │ +Static tag representing a codimension. │ │ │ │ │ +Definition dimension.hh:24 │ │ │ │ │ +Dune::MultiLinearGeometry │ │ │ │ │ +generic geometry implementation based on corner coordinates │ │ │ │ │ +Definition multilineargeometry.hh:181 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial │ │ │ │ │ +Definition hcubetriangulation.cc:63 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementImp │ │ │ │ │ +Definition hcubetriangulation.cc:67 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementImp::vEnd │ │ │ │ │ +static VertexIterator vEnd(int nIntervals) │ │ │ │ │ +Definition hcubetriangulation.cc:121 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementImp::vBegin │ │ │ │ │ +static VertexIterator vBegin(int nIntervals) │ │ │ │ │ +Definition hcubetriangulation.cc:113 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementImp::nElements │ │ │ │ │ +static int nElements(int nIntervals) │ │ │ │ │ +Definition hcubetriangulation.cc:129 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementImp::CoordVector │ │ │ │ │ +FieldVector< CoordType, dimension > CoordVector │ │ │ │ │ +Definition hcubetriangulation.cc:76 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementImp::ctype │ │ │ │ │ +CoordType ctype │ │ │ │ │ +Definition hcubetriangulation.cc:71 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementImp::ElementIterator │ │ │ │ │ +Codim< 0 >::SubEntityIterator ElementIterator │ │ │ │ │ +Definition hcubetriangulation.cc:77 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementImp::IndexVector │ │ │ │ │ +FieldVector< int, dimension+1 > IndexVector │ │ │ │ │ +Definition hcubetriangulation.cc:78 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementImp::eBegin │ │ │ │ │ +static ElementIterator eBegin(int nIntervals) │ │ │ │ │ +Definition hcubetriangulation.cc:137 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementImp::eEnd │ │ │ │ │ +static ElementIterator eEnd(int nIntervals) │ │ │ │ │ +Definition hcubetriangulation.cc:145 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementImp::dimension │ │ │ │ │ +static constexpr int dimension │ │ │ │ │ +Definition hcubetriangulation.cc:69 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementImp::VertexIterator │ │ │ │ │ +Codim< dimension >::SubEntityIterator VertexIterator │ │ │ │ │ +Definition hcubetriangulation.cc:75 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementImp::nVertices │ │ │ │ │ +static int nVertices(int nIntervals) │ │ │ │ │ +Definition hcubetriangulation.cc:105 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementImp::Codim │ │ │ │ │ +Definition hcubetriangulation.cc:97 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementImp::Codim::Geometry │ │ │ │ │ +Dune::MultiLinearGeometry< CoordType, dimension-codimension, dimension > │ │ │ │ │ +Geometry │ │ │ │ │ +Definition hcubetriangulation.cc:99 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_dimension_>::nIntervals_ │ │ │ │ │ +int nIntervals_ │ │ │ │ │ +Definition hcubetriangulation.cc:178 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_dimension_>::kuhnIndex │ │ │ │ │ +int kuhnIndex │ │ │ │ │ +Definition hcubetriangulation.cc:180 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_dimension_>::CoordVector │ │ │ │ │ +Refinement::CoordVector CoordVector │ │ │ │ │ +Definition hcubetriangulation.cc:161 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_dimension_>::Geometry │ │ │ │ │ +Refinement::template Codim< dimension >::Geometry Geometry │ │ │ │ │ +Definition hcubetriangulation.cc:162 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_dimension_>::BackendIterator │ │ │ │ │ +BackendRefinement::template Codim< dimension >::SubEntityIterator │ │ │ │ │ +BackendIterator │ │ │ │ │ +Definition hcubetriangulation.cc:175 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_dimension_>::BackendRefinement │ │ │ │ │ +Refinement::BackendRefinement BackendRefinement │ │ │ │ │ +Definition hcubetriangulation.cc:174 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_dimension_>::backend │ │ │ │ │ +BackendIterator backend │ │ │ │ │ +Definition hcubetriangulation.cc:181 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_dimension_>::Refinement │ │ │ │ │ +RefinementImp< dimension, CoordType > Refinement │ │ │ │ │ +Definition hcubetriangulation.cc:160 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_dimension_>::backendEnd │ │ │ │ │ +const BackendIterator backendEnd │ │ │ │ │ +Definition hcubetriangulation.cc:182 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_0_>::BackendIterator │ │ │ │ │ +BackendRefinement::template Codim< 0 >::SubEntityIterator BackendIterator │ │ │ │ │ +Definition hcubetriangulation.cc:260 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_0_>::backend │ │ │ │ │ +BackendIterator backend │ │ │ │ │ +Definition hcubetriangulation.cc:266 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_0_>::CoordVector │ │ │ │ │ +Refinement::CoordVector CoordVector │ │ │ │ │ +Definition hcubetriangulation.cc:241 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_0_>::backendEnd │ │ │ │ │ +const BackendIterator backendEnd │ │ │ │ │ +Definition hcubetriangulation.cc:267 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_0_>::kuhnIndex │ │ │ │ │ +int kuhnIndex │ │ │ │ │ +Definition hcubetriangulation.cc:265 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_0_>::BackendRefinement │ │ │ │ │ +Refinement::BackendRefinement BackendRefinement │ │ │ │ │ +Definition hcubetriangulation.cc:259 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_0_>::nIntervals_ │ │ │ │ │ +int nIntervals_ │ │ │ │ │ +Definition hcubetriangulation.cc:263 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_0_>::IndexVector │ │ │ │ │ +Refinement::IndexVector IndexVector │ │ │ │ │ +Definition hcubetriangulation.cc:240 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_0_>::Refinement │ │ │ │ │ +RefinementImp< dimension, CoordType > Refinement │ │ │ │ │ +Definition hcubetriangulation.cc:239 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementIteratorSpecial<_dimension, │ │ │ │ │ +CoordType,_0_>::Geometry │ │ │ │ │ +Refinement::template Codim< 0 >::Geometry Geometry │ │ │ │ │ +Definition hcubetriangulation.cc:242 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementImp::Codim<_codimension_>:: │ │ │ │ │ +equals │ │ │ │ │ +bool equals(const This &other) const │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementImp::Codim<_codimension_>:: │ │ │ │ │ +SubEntityIterator │ │ │ │ │ +SubEntityIterator(int nIntervals, bool end=false) │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementImp::Codim<_codimension_>:: │ │ │ │ │ +Refinement │ │ │ │ │ +RefinementImp< dimension, CoordType > Refinement │ │ │ │ │ +Definition hcubetriangulation.cc:359 │ │ │ │ │ +Dune::RefinementImp::HCubeTriangulation::RefinementImp::Codim<_codimension_>:: │ │ │ │ │ +This │ │ │ │ │ +SubEntityIterator This │ │ │ │ │ +Definition hcubetriangulation.cc:360 │ │ │ │ │ +Dune::RefinementImp::Simplex::RefinementImp │ │ │ │ │ +Definition simplex.cc:433 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00239.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: topologyfactory.hh File Reference │ │ │ │ +dune-geometry: affinegeometry.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -72,42 +72,43 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
topologyfactory.hh File Reference
│ │ │ │ +
affinegeometry.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <cassert>
│ │ │ │ -#include <array>
│ │ │ │ -#include <map>
│ │ │ │ -#include <memory>
│ │ │ │ -#include <type_traits>
│ │ │ │ -#include <vector>
│ │ │ │ -#include <dune/geometry/type.hh>
│ │ │ │ -#include <dune/geometry/typeindex.hh>
│ │ │ │ + │ │ │ │ +

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

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

Go to the source code of this file.

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

│ │ │ │ Classes

struct  Dune::TopologyFactory< Traits >
 Provide a factory over the generic topologies. More...
 
struct  Dune::TopologySingletonFactory< Factory >
 A wrapper for a TopologyFactory providing singleton storage. Same usage as TopologyFactory but with empty release method an internal storage. More...
class  Dune::AffineGeometry< ct, mydim, cdim >
 Implementation of the Geometry interface for affine geometries. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::Geo
 
│ │ │ │ -
│ │ │ │ +

Detailed Description

│ │ │ │ +

An implementation of the Geometry interface for affine geometries.

│ │ │ │ +
Author
Martin Nolte
│ │ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -7,32 +7,30 @@ │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -topologyfactory.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +affinegeometry.hh File Reference │ │ │ │ │ +An implementation of the Geometry interface for affine geometries. More... │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -struct  Dune::TopologyFactory<_Traits_> │ │ │ │ │ -  Provide a factory over the generic topologies. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::TopologySingletonFactory<_Factory_> │ │ │ │ │ - A wrapper for a TopologyFactory providing singleton storage. Same │ │ │ │ │ -  usage as TopologyFactory but with empty release method an internal │ │ │ │ │ - storage. More... │ │ │ │ │ +class  Dune::AffineGeometry<_ct,_mydim,_cdim_> │ │ │ │ │ +  Implementation of the Geometry interface for affine geometries. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ +namespace  Dune::Geo │ │ │ │ │ +  │ │ │ │ │ +***** Detailed Description ***** │ │ │ │ │ +An implementation of the Geometry interface for affine geometries. │ │ │ │ │ + Author │ │ │ │ │ + Martin Nolte │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00239_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-geometry: topologyfactory.hh Source File │ │ │ │ +dune-geometry: affinegeometry.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -74,194 +74,689 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
topologyfactory.hh
│ │ │ │ +
affinegeometry.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
│ │ │ │
2// vi: set et ts=4 sw=2 sts=2:
│ │ │ │
3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
│ │ │ │ -
5#ifndef DUNE_GEOMETRY_TOPOLOGYFACTORY_HH
│ │ │ │ -
6#define DUNE_GEOMETRY_TOPOLOGYFACTORY_HH
│ │ │ │ +
5#ifndef DUNE_GEOMETRY_AFFINEGEOMETRY_HH
│ │ │ │ +
6#define DUNE_GEOMETRY_AFFINEGEOMETRY_HH
│ │ │ │
7
│ │ │ │ -
8#include <cassert>
│ │ │ │ -
9
│ │ │ │ -
10#include <array>
│ │ │ │ -
11#include <map>
│ │ │ │ -
12#include <memory>
│ │ │ │ -
13#include <type_traits>
│ │ │ │ -
14#include <vector>
│ │ │ │ -
15
│ │ │ │ -
16#include <dune/geometry/type.hh>
│ │ │ │ - │ │ │ │ -
18
│ │ │ │ -
19namespace Dune
│ │ │ │ -
20{
│ │ │ │ -
21
│ │ │ │ -
40 template <class Traits>
│ │ │ │ -
│ │ │ │ - │ │ │ │ +
13#include <cmath>
│ │ │ │ +
14
│ │ │ │ +
15#include <dune/common/fmatrix.hh>
│ │ │ │ +
16#include <dune/common/fvector.hh>
│ │ │ │ +
17
│ │ │ │ +
18#include <dune/geometry/type.hh>
│ │ │ │ +
19
│ │ │ │ +
│ │ │ │ +
20namespace Dune
│ │ │ │ +
21{
│ │ │ │ +
22
│ │ │ │ +
23 // External Forward Declarations
│ │ │ │ +
24 // -----------------------------
│ │ │ │ +
25
│ │ │ │ +
│ │ │ │ +
26 namespace Geo
│ │ │ │ +
27 {
│ │ │ │ +
28
│ │ │ │ +
29 template< typename Implementation >
│ │ │ │ +
30 class ReferenceElement;
│ │ │ │ +
31
│ │ │ │ +
32 template< class ctype, int dim >
│ │ │ │ + │ │ │ │ +
34
│ │ │ │ +
35 template< class ctype, int dim >
│ │ │ │ +
36 struct ReferenceElements;
│ │ │ │ +
37
│ │ │ │ +
38 }
│ │ │ │ +
│ │ │ │ +
39
│ │ │ │ +
40
│ │ │ │ +
41 namespace Impl
│ │ │ │
42 {
│ │ │ │ -
43 // extract types from Traits class
│ │ │ │ -
44 static const unsigned int dimension = Traits::dimension;
│ │ │ │ -
45 typedef typename Traits::Key Key;
│ │ │ │ -
46 typedef typename Traits::Object Object;
│ │ │ │ -
47 typedef typename Traits::Factory Factory;
│ │ │ │ -
48
│ │ │ │ -
│ │ │ │ -
50 static Object *create ( const Dune::GeometryType &gt, const Key &key )
│ │ │ │ -
51 {
│ │ │ │ -
52 return Impl::toGeometryTypeIdConstant<dimension>(gt, [&](auto id) {
│ │ │ │ -
53 return create<decltype(id)::value>(key);
│ │ │ │ -
54 });
│ │ │ │ -
55 }
│ │ │ │ -
│ │ │ │ -
57 template< GeometryType::Id geometryId >
│ │ │ │ -
│ │ │ │ -
58 static Object *create ( const Key &key )
│ │ │ │ -
59 {
│ │ │ │ -
60 return Factory::template createObject< geometryId >( key );
│ │ │ │ -
61 }
│ │ │ │ -
│ │ │ │ +
43
│ │ │ │ +
44 // FieldMatrixHelper
│ │ │ │ +
45 // -----------------
│ │ │ │ +
46
│ │ │ │ +
47 template< class ct >
│ │ │ │ +
48 struct FieldMatrixHelper
│ │ │ │ +
49 {
│ │ │ │ +
50 typedef ct ctype;
│ │ │ │ +
51
│ │ │ │ +
52 template< int m, int n >
│ │ │ │ +
53 static void Ax ( const FieldMatrix< ctype, m, n > &A, const FieldVector< ctype, n > &x, FieldVector< ctype, m > &ret )
│ │ │ │ +
54 {
│ │ │ │ +
55 for( int i = 0; i < m; ++i )
│ │ │ │ +
56 {
│ │ │ │ +
57 ret[ i ] = ctype( 0 );
│ │ │ │ +
58 for( int j = 0; j < n; ++j )
│ │ │ │ +
59 ret[ i ] += A[ i ][ j ] * x[ j ];
│ │ │ │ +
60 }
│ │ │ │ +
61 }
│ │ │ │
62
│ │ │ │ -
64 template< class Topology >
│ │ │ │ -
│ │ │ │ -
65 static Object *create ( const Key &key )
│ │ │ │ -
66 {
│ │ │ │ -
67 return Factory::template createObject< Topology >( key );
│ │ │ │ -
68 }
│ │ │ │ -
│ │ │ │ -
69
│ │ │ │ -
71 static void release( Object *object ) { delete object; }
│ │ │ │ -
72 };
│ │ │ │ -
│ │ │ │ +
63 template< int m, int n >
│ │ │ │ +
64 static void ATx ( const FieldMatrix< ctype, m, n > &A, const FieldVector< ctype, m > &x, FieldVector< ctype, n > &ret )
│ │ │ │ +
65 {
│ │ │ │ +
66 for( int i = 0; i < n; ++i )
│ │ │ │ +
67 {
│ │ │ │ +
68 ret[ i ] = ctype( 0 );
│ │ │ │ +
69 for( int j = 0; j < m; ++j )
│ │ │ │ +
70 ret[ i ] += A[ j ][ i ] * x[ j ];
│ │ │ │ +
71 }
│ │ │ │ +
72 }
│ │ │ │
73
│ │ │ │ -
74
│ │ │ │ -
75
│ │ │ │ -
80 template <class Factory>
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
82 {
│ │ │ │ -
83 static const unsigned int dimension = Factory::dimension;
│ │ │ │ -
84 typedef typename Factory::Key Key;
│ │ │ │ -
85 typedef const typename Factory::Object Object;
│ │ │ │ -
86
│ │ │ │ -
│ │ │ │ -
88 static Object *create ( const Dune::GeometryType &gt, const Key &key )
│ │ │ │ -
89 {
│ │ │ │ -
90 assert( gt.id() < numTopologies );
│ │ │ │ -
91 return instance().getObject( gt, key );
│ │ │ │ -
92 }
│ │ │ │ -
│ │ │ │ -
94 template< GeometryType::Id geometryId >
│ │ │ │ -
│ │ │ │ -
95 static auto create ( const Key &key )
│ │ │ │ -
96 -> std::enable_if_t< static_cast<GeometryType>(geometryId).dim() == dimension, Object * >
│ │ │ │ -
97 {
│ │ │ │ -
98 return instance().template getObject< geometryId >( key );
│ │ │ │ -
99 }
│ │ │ │ -
│ │ │ │ -
100
│ │ │ │ -
102 template< class Topology >
│ │ │ │ -
│ │ │ │ -
103 static auto create ( const Key &key )
│ │ │ │ -
104 -> std::enable_if_t< Topology::dimension == dimension, Object * >
│ │ │ │ -
105 {
│ │ │ │ -
106 return instance().template getObject< Topology >( key );
│ │ │ │ -
107 }
│ │ │ │ -
│ │ │ │ -
108
│ │ │ │ -
│ │ │ │ -
110 static void release ( Object *object )
│ │ │ │ -
111 {}
│ │ │ │ -
│ │ │ │ -
112
│ │ │ │ -
113 private:
│ │ │ │ -
114 struct ObjectDeleter
│ │ │ │ -
115 {
│ │ │ │ -
116 void operator() ( Object *ptr ) const { Factory::release( ptr ); }
│ │ │ │ -
117 };
│ │ │ │ -
118
│ │ │ │ -
119 static TopologySingletonFactory &instance ()
│ │ │ │ -
120 {
│ │ │ │ -
121 static TopologySingletonFactory instance;
│ │ │ │ -
122 return instance;
│ │ │ │ -
123 }
│ │ │ │ -
124
│ │ │ │ -
125 static const unsigned int numTopologies = (1 << dimension);
│ │ │ │ -
126 typedef std::array< std::unique_ptr< Object, ObjectDeleter >, numTopologies > Array;
│ │ │ │ -
127 typedef std::map< Key, Array > Storage;
│ │ │ │ +
74 template< int m, int n, int p >
│ │ │ │ +
75 static void AB ( const FieldMatrix< ctype, m, n > &A, const FieldMatrix< ctype, n, p > &B, FieldMatrix< ctype, m, p > &ret )
│ │ │ │ +
76 {
│ │ │ │ +
77 for( int i = 0; i < m; ++i )
│ │ │ │ +
78 {
│ │ │ │ +
79 for( int j = 0; j < p; ++j )
│ │ │ │ +
80 {
│ │ │ │ +
81 ret[ i ][ j ] = ctype( 0 );
│ │ │ │ +
82 for( int k = 0; k < n; ++k )
│ │ │ │ +
83 ret[ i ][ j ] += A[ i ][ k ] * B[ k ][ j ];
│ │ │ │ +
84 }
│ │ │ │ +
85 }
│ │ │ │ +
86 }
│ │ │ │ +
87
│ │ │ │ +
88 template< int m, int n, int p >
│ │ │ │ +
89 static void ATBT ( const FieldMatrix< ctype, m, n > &A, const FieldMatrix< ctype, p, m > &B, FieldMatrix< ctype, n, p > &ret )
│ │ │ │ +
90 {
│ │ │ │ +
91 for( int i = 0; i < n; ++i )
│ │ │ │ +
92 {
│ │ │ │ +
93 for( int j = 0; j < p; ++j )
│ │ │ │ +
94 {
│ │ │ │ +
95 ret[ i ][ j ] = ctype( 0 );
│ │ │ │ +
96 for( int k = 0; k < m; ++k )
│ │ │ │ +
97 ret[ i ][ j ] += A[ k ][ i ] * B[ j ][ k ];
│ │ │ │ +
98 }
│ │ │ │ +
99 }
│ │ │ │ +
100 }
│ │ │ │ +
101
│ │ │ │ +
102 template< int m, int n >
│ │ │ │ +
103 static void ATA_L ( const FieldMatrix< ctype, m, n > &A, FieldMatrix< ctype, n, n > &ret )
│ │ │ │ +
104 {
│ │ │ │ +
105 for( int i = 0; i < n; ++i )
│ │ │ │ +
106 {
│ │ │ │ +
107 for( int j = 0; j <= i; ++j )
│ │ │ │ +
108 {
│ │ │ │ +
109 ret[ i ][ j ] = ctype( 0 );
│ │ │ │ +
110 for( int k = 0; k < m; ++k )
│ │ │ │ +
111 ret[ i ][ j ] += A[ k ][ i ] * A[ k ][ j ];
│ │ │ │ +
112 }
│ │ │ │ +
113 }
│ │ │ │ +
114 }
│ │ │ │ +
115
│ │ │ │ +
116 template< int m, int n >
│ │ │ │ +
117 static void ATA ( const FieldMatrix< ctype, m, n > &A, FieldMatrix< ctype, n, n > &ret )
│ │ │ │ +
118 {
│ │ │ │ +
119 for( int i = 0; i < n; ++i )
│ │ │ │ +
120 {
│ │ │ │ +
121 for( int j = 0; j <= i; ++j )
│ │ │ │ +
122 {
│ │ │ │ +
123 ret[ i ][ j ] = ctype( 0 );
│ │ │ │ +
124 for( int k = 0; k < m; ++k )
│ │ │ │ +
125 ret[ i ][ j ] += A[ k ][ i ] * A[ k ][ j ];
│ │ │ │ +
126 ret[ j ][ i ] = ret[ i ][ j ];
│ │ │ │ +
127 }
│ │ │ │
128
│ │ │ │ -
129 TopologySingletonFactory () = default;
│ │ │ │ -
130
│ │ │ │ -
131 std::unique_ptr< Object, ObjectDeleter > &find ( const unsigned int topologyId, const Key &key )
│ │ │ │ -
132 {
│ │ │ │ -
133 return storage_[ key ][ topologyId ];
│ │ │ │ -
134 }
│ │ │ │ -
135
│ │ │ │ -
136 Object *getObject ( const Dune::GeometryType &gt, const Key &key )
│ │ │ │ -
137 {
│ │ │ │ -
138 auto &object = find( gt.id(), key );
│ │ │ │ -
139 if( !object )
│ │ │ │ -
140 object.reset( Factory::create( gt, key ) );
│ │ │ │ -
141 return object.get();
│ │ │ │ -
142 }
│ │ │ │ -
143
│ │ │ │ -
144 template< GeometryType::Id geometryId >
│ │ │ │ -
145 Object *getObject ( const Key &key )
│ │ │ │ -
146 {
│ │ │ │ -
147 static constexpr GeometryType geometry = geometryId;
│ │ │ │ -
148 auto &object = find( geometry.id(), key );
│ │ │ │ -
149 if( !object )
│ │ │ │ -
150 object.reset( Factory::template create< geometry >( key ) );
│ │ │ │ -
151 return object.get();
│ │ │ │ -
152 }
│ │ │ │ -
153
│ │ │ │ -
154 template< class Topology >
│ │ │ │ -
155 Object *getObject ( const Key &key )
│ │ │ │ -
156 {
│ │ │ │ -
157 auto &object = find( Topology::id, key );
│ │ │ │ -
158 if( !object )
│ │ │ │ -
159 object.reset( Factory::template create< Topology >( key ) );
│ │ │ │ -
160 return object.get();
│ │ │ │ -
161 }
│ │ │ │ -
162
│ │ │ │ -
163 Storage storage_;
│ │ │ │ -
164 };
│ │ │ │ -
│ │ │ │ -
165
│ │ │ │ -
166}
│ │ │ │ -
167
│ │ │ │ -
168#endif // #ifndef DUNE_GEOMETRY_TOPOLOGYFACTORY_HH
│ │ │ │ -
Helper classes to provide indices for geometrytypes for use in a vector.
│ │ │ │ -
A unique label for each type of element that can occur in a grid.
│ │ │ │ +
129 ret[ i ][ i ] = ctype( 0 );
│ │ │ │ +
130 for( int k = 0; k < m; ++k )
│ │ │ │ +
131 ret[ i ][ i ] += A[ k ][ i ] * A[ k ][ i ];
│ │ │ │ +
132 }
│ │ │ │ +
133 }
│ │ │ │ +
134
│ │ │ │ +
135 template< int m, int n >
│ │ │ │ +
136 static void AAT_L ( const FieldMatrix< ctype, m, n > &A, FieldMatrix< ctype, m, m > &ret )
│ │ │ │ +
137 {
│ │ │ │ +
138 /*
│ │ │ │ +
139 if (m==2) {
│ │ │ │ +
140 ret[0][0] = A[0]*A[0];
│ │ │ │ +
141 ret[1][1] = A[1]*A[1];
│ │ │ │ +
142 ret[1][0] = A[0]*A[1];
│ │ │ │ +
143 }
│ │ │ │ +
144 else
│ │ │ │ +
145 */
│ │ │ │ +
146 for( int i = 0; i < m; ++i )
│ │ │ │ +
147 {
│ │ │ │ +
148 for( int j = 0; j <= i; ++j )
│ │ │ │ +
149 {
│ │ │ │ +
150 ctype &retij = ret[ i ][ j ];
│ │ │ │ +
151 retij = A[ i ][ 0 ] * A[ j ][ 0 ];
│ │ │ │ +
152 for( int k = 1; k < n; ++k )
│ │ │ │ +
153 retij += A[ i ][ k ] * A[ j ][ k ];
│ │ │ │ +
154 }
│ │ │ │ +
155 }
│ │ │ │ +
156 }
│ │ │ │ +
157
│ │ │ │ +
158 template< int m, int n >
│ │ │ │ +
159 static void AAT ( const FieldMatrix< ctype, m, n > &A, FieldMatrix< ctype, m, m > &ret )
│ │ │ │ +
160 {
│ │ │ │ +
161 for( int i = 0; i < m; ++i )
│ │ │ │ +
162 {
│ │ │ │ +
163 for( int j = 0; j < i; ++j )
│ │ │ │ +
164 {
│ │ │ │ +
165 ret[ i ][ j ] = ctype( 0 );
│ │ │ │ +
166 for( int k = 0; k < n; ++k )
│ │ │ │ +
167 ret[ i ][ j ] += A[ i ][ k ] * A[ j ][ k ];
│ │ │ │ +
168 ret[ j ][ i ] = ret[ i ][ j ];
│ │ │ │ +
169 }
│ │ │ │ +
170 ret[ i ][ i ] = ctype( 0 );
│ │ │ │ +
171 for( int k = 0; k < n; ++k )
│ │ │ │ +
172 ret[ i ][ i ] += A[ i ][ k ] * A[ i ][ k ];
│ │ │ │ +
173 }
│ │ │ │ +
174 }
│ │ │ │ +
175
│ │ │ │ +
176 template< int n >
│ │ │ │ +
177 static void Lx ( const FieldMatrix< ctype, n, n > &L, const FieldVector< ctype, n > &x, FieldVector< ctype, n > &ret )
│ │ │ │ +
178 {
│ │ │ │ +
179 for( int i = 0; i < n; ++i )
│ │ │ │ +
180 {
│ │ │ │ +
181 ret[ i ] = ctype( 0 );
│ │ │ │ +
182 for( int j = 0; j <= i; ++j )
│ │ │ │ +
183 ret[ i ] += L[ i ][ j ] * x[ j ];
│ │ │ │ +
184 }
│ │ │ │ +
185 }
│ │ │ │ +
186
│ │ │ │ +
187 template< int n >
│ │ │ │ +
188 static void LTx ( const FieldMatrix< ctype, n, n > &L, const FieldVector< ctype, n > &x, FieldVector< ctype, n > &ret )
│ │ │ │ +
189 {
│ │ │ │ +
190 for( int i = 0; i < n; ++i )
│ │ │ │ +
191 {
│ │ │ │ +
192 ret[ i ] = ctype( 0 );
│ │ │ │ +
193 for( int j = i; j < n; ++j )
│ │ │ │ +
194 ret[ i ] += L[ j ][ i ] * x[ j ];
│ │ │ │ +
195 }
│ │ │ │ +
196 }
│ │ │ │ +
197
│ │ │ │ +
198 template< int n >
│ │ │ │ +
199 static void LTL ( const FieldMatrix< ctype, n, n > &L, FieldMatrix< ctype, n, n > &ret )
│ │ │ │ +
200 {
│ │ │ │ +
201 for( int i = 0; i < n; ++i )
│ │ │ │ +
202 {
│ │ │ │ +
203 for( int j = 0; j < i; ++j )
│ │ │ │ +
204 {
│ │ │ │ +
205 ret[ i ][ j ] = ctype( 0 );
│ │ │ │ +
206 for( int k = i; k < n; ++k )
│ │ │ │ +
207 ret[ i ][ j ] += L[ k ][ i ] * L[ k ][ j ];
│ │ │ │ +
208 ret[ j ][ i ] = ret[ i ][ j ];
│ │ │ │ +
209 }
│ │ │ │ +
210 ret[ i ][ i ] = ctype( 0 );
│ │ │ │ +
211 for( int k = i; k < n; ++k )
│ │ │ │ +
212 ret[ i ][ i ] += L[ k ][ i ] * L[ k ][ i ];
│ │ │ │ +
213 }
│ │ │ │ +
214 }
│ │ │ │ +
215
│ │ │ │ +
216 template< int n >
│ │ │ │ +
217 static void LLT ( const FieldMatrix< ctype, n, n > &L, FieldMatrix< ctype, n, n > &ret )
│ │ │ │ +
218 {
│ │ │ │ +
219 for( int i = 0; i < n; ++i )
│ │ │ │ +
220 {
│ │ │ │ +
221 for( int j = 0; j < i; ++j )
│ │ │ │ +
222 {
│ │ │ │ +
223 ret[ i ][ j ] = ctype( 0 );
│ │ │ │ +
224 for( int k = 0; k <= j; ++k )
│ │ │ │ +
225 ret[ i ][ j ] += L[ i ][ k ] * L[ j ][ k ];
│ │ │ │ +
226 ret[ j ][ i ] = ret[ i ][ j ];
│ │ │ │ +
227 }
│ │ │ │ +
228 ret[ i ][ i ] = ctype( 0 );
│ │ │ │ +
229 for( int k = 0; k <= i; ++k )
│ │ │ │ +
230 ret[ i ][ i ] += L[ i ][ k ] * L[ i ][ k ];
│ │ │ │ +
231 }
│ │ │ │ +
232 }
│ │ │ │ +
233
│ │ │ │ +
234 template< int n >
│ │ │ │ +
235 static bool cholesky_L ( const FieldMatrix< ctype, n, n > &A, FieldMatrix< ctype, n, n > &ret, const bool checkSingular = false )
│ │ │ │ +
236 {
│ │ │ │ +
237 using std::sqrt;
│ │ │ │ +
238 for( int i = 0; i < n; ++i )
│ │ │ │ +
239 {
│ │ │ │ +
240 ctype &rii = ret[ i ][ i ];
│ │ │ │ +
241
│ │ │ │ +
242 ctype xDiag = A[ i ][ i ];
│ │ │ │ +
243 for( int j = 0; j < i; ++j )
│ │ │ │ +
244 xDiag -= ret[ i ][ j ] * ret[ i ][ j ];
│ │ │ │ +
245
│ │ │ │ +
246 // in some cases A can be singular, e.g. when checking local for
│ │ │ │ +
247 // outside points during checkInside
│ │ │ │ +
248 if( checkSingular && ! ( xDiag > ctype( 0 )) )
│ │ │ │ +
249 return false ;
│ │ │ │ +
250
│ │ │ │ +
251 // otherwise this should be true always
│ │ │ │ +
252 assert( xDiag > ctype( 0 ) );
│ │ │ │ +
253 rii = sqrt( xDiag );
│ │ │ │ +
254
│ │ │ │ +
255 ctype invrii = ctype( 1 ) / rii;
│ │ │ │ +
256 for( int k = i+1; k < n; ++k )
│ │ │ │ +
257 {
│ │ │ │ +
258 ctype x = A[ k ][ i ];
│ │ │ │ +
259 for( int j = 0; j < i; ++j )
│ │ │ │ +
260 x -= ret[ i ][ j ] * ret[ k ][ j ];
│ │ │ │ +
261 ret[ k ][ i ] = invrii * x;
│ │ │ │ +
262 }
│ │ │ │ +
263 }
│ │ │ │ +
264
│ │ │ │ +
265 // return true for meaning A is non-singular
│ │ │ │ +
266 return true;
│ │ │ │ +
267 }
│ │ │ │ +
268
│ │ │ │ +
269 template< int n >
│ │ │ │ +
270 static ctype detL ( const FieldMatrix< ctype, n, n > &L )
│ │ │ │ +
271 {
│ │ │ │ +
272 ctype det( 1 );
│ │ │ │ +
273 for( int i = 0; i < n; ++i )
│ │ │ │ +
274 det *= L[ i ][ i ];
│ │ │ │ +
275 return det;
│ │ │ │ +
276 }
│ │ │ │ +
277
│ │ │ │ +
278 template< int n >
│ │ │ │ +
279 static ctype invL ( FieldMatrix< ctype, n, n > &L )
│ │ │ │ +
280 {
│ │ │ │ +
281 ctype det( 1 );
│ │ │ │ +
282 for( int i = 0; i < n; ++i )
│ │ │ │ +
283 {
│ │ │ │ +
284 ctype &lii = L[ i ][ i ];
│ │ │ │ +
285 det *= lii;
│ │ │ │ +
286 lii = ctype( 1 ) / lii;
│ │ │ │ +
287 for( int j = 0; j < i; ++j )
│ │ │ │ +
288 {
│ │ │ │ +
289 ctype &lij = L[ i ][ j ];
│ │ │ │ +
290 ctype x = lij * L[ j ][ j ];
│ │ │ │ +
291 for( int k = j+1; k < i; ++k )
│ │ │ │ +
292 x += L[ i ][ k ] * L[ k ][ j ];
│ │ │ │ +
293 lij = (-lii) * x;
│ │ │ │ +
294 }
│ │ │ │ +
295 }
│ │ │ │ +
296 return det;
│ │ │ │ +
297 }
│ │ │ │ +
298
│ │ │ │ +
299 // calculates x := L^{-1} x
│ │ │ │ +
300 template< int n >
│ │ │ │ +
301 static void invLx ( FieldMatrix< ctype, n, n > &L, FieldVector< ctype, n > &x )
│ │ │ │ +
302 {
│ │ │ │ +
303 for( int i = 0; i < n; ++i )
│ │ │ │ +
304 {
│ │ │ │ +
305 for( int j = 0; j < i; ++j )
│ │ │ │ +
306 x[ i ] -= L[ i ][ j ] * x[ j ];
│ │ │ │ +
307 x[ i ] /= L[ i ][ i ];
│ │ │ │ +
308 }
│ │ │ │ +
309 }
│ │ │ │ +
310
│ │ │ │ +
311 // calculates x := L^{-T} x
│ │ │ │ +
312 template< int n >
│ │ │ │ +
313 static void invLTx ( FieldMatrix< ctype, n, n > &L, FieldVector< ctype, n > &x )
│ │ │ │ +
314 {
│ │ │ │ +
315 for( int i = n; i > 0; --i )
│ │ │ │ +
316 {
│ │ │ │ +
317 for( int j = i; j < n; ++j )
│ │ │ │ +
318 x[ i-1 ] -= L[ j ][ i-1 ] * x[ j ];
│ │ │ │ +
319 x[ i-1 ] /= L[ i-1 ][ i-1 ];
│ │ │ │ +
320 }
│ │ │ │ +
321 }
│ │ │ │ +
322
│ │ │ │ +
323 template< int n >
│ │ │ │ +
324 static ctype spdDetA ( const FieldMatrix< ctype, n, n > &A )
│ │ │ │ +
325 {
│ │ │ │ +
326 // return A[0][0]*A[1][1]-A[1][0]*A[1][0];
│ │ │ │ +
327 FieldMatrix< ctype, n, n > L;
│ │ │ │ +
328 cholesky_L( A, L );
│ │ │ │ +
329 return detL( L );
│ │ │ │ +
330 }
│ │ │ │ +
331
│ │ │ │ +
332 template< int n >
│ │ │ │ +
333 static ctype spdInvA ( FieldMatrix< ctype, n, n > &A )
│ │ │ │ +
334 {
│ │ │ │ +
335 FieldMatrix< ctype, n, n > L;
│ │ │ │ +
336 cholesky_L( A, L );
│ │ │ │ +
337 const ctype det = invL( L );
│ │ │ │ +
338 LTL( L, A );
│ │ │ │ +
339 return det;
│ │ │ │ +
340 }
│ │ │ │ +
341
│ │ │ │ +
342 // calculate x := A^{-1} x
│ │ │ │ +
343 template< int n >
│ │ │ │ +
344 static bool spdInvAx ( FieldMatrix< ctype, n, n > &A, FieldVector< ctype, n > &x, const bool checkSingular = false )
│ │ │ │ +
345 {
│ │ │ │ +
346 FieldMatrix< ctype, n, n > L;
│ │ │ │ +
347 const bool invertible = cholesky_L( A, L, checkSingular );
│ │ │ │ +
348 if( ! invertible ) return invertible ;
│ │ │ │ +
349 invLx( L, x );
│ │ │ │ +
350 invLTx( L, x );
│ │ │ │ +
351 return invertible;
│ │ │ │ +
352 }
│ │ │ │ +
353
│ │ │ │ +
354 template< int m, int n >
│ │ │ │ +
355 static ctype detATA ( const FieldMatrix< ctype, m, n > &A )
│ │ │ │ +
356 {
│ │ │ │ +
357 if( m >= n )
│ │ │ │ +
358 {
│ │ │ │ +
359 FieldMatrix< ctype, n, n > ata;
│ │ │ │ +
360 ATA_L( A, ata );
│ │ │ │ +
361 return spdDetA( ata );
│ │ │ │ +
362 }
│ │ │ │ +
363 else
│ │ │ │ +
364 return ctype( 0 );
│ │ │ │ +
365 }
│ │ │ │ +
366
│ │ │ │ +
372 template< int m, int n >
│ │ │ │ +
373 static ctype sqrtDetAAT ( const FieldMatrix< ctype, m, n > &A )
│ │ │ │ +
374 {
│ │ │ │ +
375 using std::abs;
│ │ │ │ +
376 using std::sqrt;
│ │ │ │ +
377 // These special cases are here not only for speed reasons:
│ │ │ │ +
378 // The general implementation aborts if the matrix is almost singular,
│ │ │ │ +
379 // and the special implementation provide a stable way to handle that case.
│ │ │ │ +
380 if( (n == 2) && (m == 2) )
│ │ │ │ +
381 {
│ │ │ │ +
382 // Special implementation for 2x2 matrices: faster and more stable
│ │ │ │ +
383 return abs( A[ 0 ][ 0 ]*A[ 1 ][ 1 ] - A[ 1 ][ 0 ]*A[ 0 ][ 1 ] );
│ │ │ │ +
384 }
│ │ │ │ +
385 else if( (n == 3) && (m == 3) )
│ │ │ │ +
386 {
│ │ │ │ +
387 // Special implementation for 3x3 matrices
│ │ │ │ +
388 const ctype v0 = A[ 0 ][ 1 ] * A[ 1 ][ 2 ] - A[ 1 ][ 1 ] * A[ 0 ][ 2 ];
│ │ │ │ +
389 const ctype v1 = A[ 0 ][ 2 ] * A[ 1 ][ 0 ] - A[ 1 ][ 2 ] * A[ 0 ][ 0 ];
│ │ │ │ +
390 const ctype v2 = A[ 0 ][ 0 ] * A[ 1 ][ 1 ] - A[ 1 ][ 0 ] * A[ 0 ][ 1 ];
│ │ │ │ +
391 return abs( v0 * A[ 2 ][ 0 ] + v1 * A[ 2 ][ 1 ] + v2 * A[ 2 ][ 2 ] );
│ │ │ │ +
392 }
│ │ │ │ +
393 else if ( (n == 3) && (m == 2) )
│ │ │ │ +
394 {
│ │ │ │ +
395 // Special implementation for 2x3 matrices
│ │ │ │ +
396 const ctype v0 = A[ 0 ][ 0 ] * A[ 1 ][ 1 ] - A[ 0 ][ 1 ] * A[ 1 ][ 0 ];
│ │ │ │ +
397 const ctype v1 = A[ 0 ][ 0 ] * A[ 1 ][ 2 ] - A[ 1 ][ 0 ] * A[ 0 ][ 2 ];
│ │ │ │ +
398 const ctype v2 = A[ 0 ][ 1 ] * A[ 1 ][ 2 ] - A[ 0 ][ 2 ] * A[ 1 ][ 1 ];
│ │ │ │ +
399 return sqrt( v0*v0 + v1*v1 + v2*v2);
│ │ │ │ +
400 }
│ │ │ │ +
401 else if( n >= m )
│ │ │ │ +
402 {
│ │ │ │ +
403 // General case
│ │ │ │ +
404 FieldMatrix< ctype, m, m > aat;
│ │ │ │ +
405 AAT_L( A, aat );
│ │ │ │ +
406 return spdDetA( aat );
│ │ │ │ +
407 }
│ │ │ │ +
408 else
│ │ │ │ +
409 return ctype( 0 );
│ │ │ │ +
410 }
│ │ │ │ +
411
│ │ │ │ +
412 // A^{-1}_L = (A^T A)^{-1} A^T
│ │ │ │ +
413 // => A^{-1}_L A = I
│ │ │ │ +
414 template< int m, int n >
│ │ │ │ +
415 static ctype leftInvA ( const FieldMatrix< ctype, m, n > &A, FieldMatrix< ctype, n, m > &ret )
│ │ │ │ +
416 {
│ │ │ │ +
417 static_assert((m >= n), "Matrix has no left inverse.");
│ │ │ │ +
418 FieldMatrix< ctype, n, n > ata;
│ │ │ │ +
419 ATA_L( A, ata );
│ │ │ │ +
420 const ctype det = spdInvA( ata );
│ │ │ │ +
421 ATBT( ata, A, ret );
│ │ │ │ +
422 return det;
│ │ │ │ +
423 }
│ │ │ │ +
424
│ │ │ │ +
425 template< int m, int n >
│ │ │ │ +
426 static void leftInvAx ( const FieldMatrix< ctype, m, n > &A, const FieldVector< ctype, m > &x, FieldVector< ctype, n > &y )
│ │ │ │ +
427 {
│ │ │ │ +
428 static_assert((m >= n), "Matrix has no left inverse.");
│ │ │ │ +
429 FieldMatrix< ctype, n, n > ata;
│ │ │ │ +
430 ATx( A, x, y );
│ │ │ │ +
431 ATA_L( A, ata );
│ │ │ │ +
432 spdInvAx( ata, y );
│ │ │ │ +
433 }
│ │ │ │ +
434
│ │ │ │ +
436 template< int m, int n >
│ │ │ │ +
437 static ctype rightInvA ( const FieldMatrix< ctype, m, n > &A, FieldMatrix< ctype, n, m > &ret )
│ │ │ │ +
438 {
│ │ │ │ +
439 static_assert((n >= m), "Matrix has no right inverse.");
│ │ │ │ +
440 using std::abs;
│ │ │ │ +
441 if( (n == 2) && (m == 2) )
│ │ │ │ +
442 {
│ │ │ │ +
443 const ctype det = (A[ 0 ][ 0 ]*A[ 1 ][ 1 ] - A[ 1 ][ 0 ]*A[ 0 ][ 1 ]);
│ │ │ │ +
444 const ctype detInv = ctype( 1 ) / det;
│ │ │ │ +
445 ret[ 0 ][ 0 ] = A[ 1 ][ 1 ] * detInv;
│ │ │ │ +
446 ret[ 1 ][ 1 ] = A[ 0 ][ 0 ] * detInv;
│ │ │ │ +
447 ret[ 1 ][ 0 ] = -A[ 1 ][ 0 ] * detInv;
│ │ │ │ +
448 ret[ 0 ][ 1 ] = -A[ 0 ][ 1 ] * detInv;
│ │ │ │ +
449 return abs( det );
│ │ │ │ +
450 }
│ │ │ │ +
451 else
│ │ │ │ +
452 {
│ │ │ │ +
453 FieldMatrix< ctype, m , m > aat;
│ │ │ │ +
454 AAT_L( A, aat );
│ │ │ │ +
455 const ctype det = spdInvA( aat );
│ │ │ │ +
456 ATBT( A , aat , ret );
│ │ │ │ +
457 return det;
│ │ │ │ +
458 }
│ │ │ │ +
459 }
│ │ │ │ +
460
│ │ │ │ +
461 template< int m, int n >
│ │ │ │ +
462 static bool xTRightInvA ( const FieldMatrix< ctype, m, n > &A, const FieldVector< ctype, n > &x, FieldVector< ctype, m > &y )
│ │ │ │ +
463 {
│ │ │ │ +
464 static_assert((n >= m), "Matrix has no right inverse.");
│ │ │ │ +
465 FieldMatrix< ctype, m, m > aat;
│ │ │ │ +
466 Ax( A, x, y );
│ │ │ │ +
467 AAT_L( A, aat );
│ │ │ │ +
468 // check whether aat is singular and return true if non-singular
│ │ │ │ +
469 return spdInvAx( aat, y, true );
│ │ │ │ +
470 }
│ │ │ │ +
471 };
│ │ │ │ +
472
│ │ │ │ +
473 } // namespace Impl
│ │ │ │ +
474
│ │ │ │ +
475
│ │ │ │ +
476
│ │ │ │ +
482 template< class ct, int mydim, int cdim>
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
484 {
│ │ │ │ +
485 public:
│ │ │ │ +
486
│ │ │ │ +
488 typedef ct ctype;
│ │ │ │ +
489
│ │ │ │ +
491 static const int mydimension= mydim;
│ │ │ │ +
492
│ │ │ │ +
494 static const int coorddimension = cdim;
│ │ │ │ +
495
│ │ │ │ +
497 typedef FieldVector< ctype, mydimension > LocalCoordinate;
│ │ │ │ +
498
│ │ │ │ +
500 typedef FieldVector< ctype, coorddimension > GlobalCoordinate;
│ │ │ │ +
501
│ │ │ │ +
503 typedef ctype Volume;
│ │ │ │ +
504
│ │ │ │ +
506 typedef FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed;
│ │ │ │ +
507
│ │ │ │ +
509 typedef FieldMatrix< ctype, coorddimension, mydimension > JacobianInverseTransposed;
│ │ │ │ +
510
│ │ │ │ +
512 typedef FieldMatrix< ctype, coorddimension, mydimension > Jacobian;
│ │ │ │ +
513
│ │ │ │ +
515 typedef FieldMatrix< ctype, mydimension, coorddimension > JacobianInverse;
│ │ │ │ +
516
│ │ │ │ +
517 private:
│ │ │ │ + │ │ │ │ +
520
│ │ │ │ + │ │ │ │ +
522
│ │ │ │ +
523 // Helper class to compute a matrix pseudo inverse
│ │ │ │ +
524 typedef Impl::FieldMatrixHelper< ct > MatrixHelper;
│ │ │ │ +
525
│ │ │ │ +
526 public:
│ │ │ │ +
│ │ │ │ +
528 AffineGeometry ( const ReferenceElement &refElement, const GlobalCoordinate &origin,
│ │ │ │ +
529 const JacobianTransposed &jt )
│ │ │ │ +
530 : refElement_(refElement), origin_(origin), jacobianTransposed_(jt)
│ │ │ │ +
531 {
│ │ │ │ +
532 integrationElement_ = MatrixHelper::template rightInvA< mydimension, coorddimension >( jacobianTransposed_, jacobianInverseTransposed_ );
│ │ │ │ +
533 }
│ │ │ │ +
│ │ │ │ +
534
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
537 const JacobianTransposed &jt )
│ │ │ │ +
538 : AffineGeometry(ReferenceElements::general( gt ), origin, jt)
│ │ │ │ +
539 { }
│ │ │ │ +
│ │ │ │ +
540
│ │ │ │ +
542 template< class CoordVector >
│ │ │ │ +
│ │ │ │ +
543 AffineGeometry ( const ReferenceElement &refElement, const CoordVector &coordVector )
│ │ │ │ +
544 : refElement_(refElement), origin_(coordVector[0])
│ │ │ │ +
545 {
│ │ │ │ +
546 for( int i = 0; i < mydimension; ++i )
│ │ │ │ +
547 jacobianTransposed_[ i ] = coordVector[ i+1 ] - origin_;
│ │ │ │ +
548 integrationElement_ = MatrixHelper::template rightInvA< mydimension, coorddimension >( jacobianTransposed_, jacobianInverseTransposed_ );
│ │ │ │ +
549 }
│ │ │ │ +
│ │ │ │ +
550
│ │ │ │ +
552 template< class CoordVector >
│ │ │ │ +
│ │ │ │ +
553 AffineGeometry ( Dune::GeometryType gt, const CoordVector &coordVector )
│ │ │ │ +
554 : AffineGeometry(ReferenceElements::general( gt ), coordVector)
│ │ │ │ +
555 { }
│ │ │ │ +
│ │ │ │ +
556
│ │ │ │ +
558 bool affine () const { return true; }
│ │ │ │ +
559
│ │ │ │ +
561 Dune::GeometryType type () const { return refElement_.type(); }
│ │ │ │ +
562
│ │ │ │ +
564 int corners () const { return refElement_.size( mydimension ); }
│ │ │ │ +
565
│ │ │ │ +
│ │ │ │ +
567 GlobalCoordinate corner ( int i ) const
│ │ │ │ +
568 {
│ │ │ │ +
569 return global( refElement_.position( i, mydimension ) );
│ │ │ │ +
570 }
│ │ │ │ +
│ │ │ │ +
571
│ │ │ │ +
573 GlobalCoordinate center () const { return global( refElement_.position( 0, 0 ) ); }
│ │ │ │ +
574
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
582 {
│ │ │ │ +
583 GlobalCoordinate global( origin_ );
│ │ │ │ +
584 jacobianTransposed_.umtv( local, global );
│ │ │ │ +
585 return global;
│ │ │ │ +
586 }
│ │ │ │ +
│ │ │ │ +
587
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
602 {
│ │ │ │ + │ │ │ │ +
604 jacobianInverseTransposed_.mtv( global - origin_, local );
│ │ │ │ +
605 return local;
│ │ │ │ +
606 }
│ │ │ │ +
│ │ │ │ +
607
│ │ │ │ +
│ │ │ │ +
618 ctype integrationElement ([[maybe_unused]] const LocalCoordinate &local) const
│ │ │ │ +
619 {
│ │ │ │ +
620 return integrationElement_;
│ │ │ │ +
621 }
│ │ │ │ +
│ │ │ │ +
622
│ │ │ │ +
│ │ │ │ +
624 Volume volume () const
│ │ │ │ +
625 {
│ │ │ │ +
626 return integrationElement_ * refElement_.volume();
│ │ │ │ +
627 }
│ │ │ │ +
│ │ │ │ +
628
│ │ │ │ +
│ │ │ │ +
635 const JacobianTransposed &jacobianTransposed ([[maybe_unused]] const LocalCoordinate &local) const
│ │ │ │ +
636 {
│ │ │ │ +
637 return jacobianTransposed_;
│ │ │ │ +
638 }
│ │ │ │ +
│ │ │ │ +
639
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
647 {
│ │ │ │ +
648 return jacobianInverseTransposed_;
│ │ │ │ +
649 }
│ │ │ │ +
│ │ │ │ +
650
│ │ │ │ +
│ │ │ │ +
657 Jacobian jacobian ([[maybe_unused]] const LocalCoordinate &local) const
│ │ │ │ +
658 {
│ │ │ │ +
659 return jacobianTransposed_.transposed();
│ │ │ │ +
660 }
│ │ │ │ +
│ │ │ │ +
661
│ │ │ │ +
│ │ │ │ +
668 JacobianInverse jacobianInverse ([[maybe_unused]] const LocalCoordinate &local) const
│ │ │ │ +
669 {
│ │ │ │ +
670 return jacobianInverseTransposed_.transposed();
│ │ │ │ +
671 }
│ │ │ │ +
│ │ │ │ +
672
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
674 {
│ │ │ │ +
675 return geometry.refElement_;
│ │ │ │ +
676 }
│ │ │ │ +
│ │ │ │ +
677
│ │ │ │ +
678 private:
│ │ │ │ +
679 ReferenceElement refElement_;
│ │ │ │ +
680 GlobalCoordinate origin_;
│ │ │ │ +
681 JacobianTransposed jacobianTransposed_;
│ │ │ │ +
682 JacobianInverseTransposed jacobianInverseTransposed_;
│ │ │ │ +
683 ctype integrationElement_;
│ │ │ │ +
684 };
│ │ │ │ +
│ │ │ │ +
685
│ │ │ │ +
686} // namespace Dune
│ │ │ │ +
│ │ │ │ +
687
│ │ │ │ +
688#endif // #ifndef DUNE_GEOMETRY_AFFINEGEOMETRY_HH
│ │ │ │ +
A unique label for each type of element that can occur in a grid.
│ │ │ │ +
unspecified-type ReferenceElement
Returns the type of reference element for the argument type T.
Definition referenceelements.hh:497
│ │ │ │
Definition affinegeometry.hh:21
│ │ │ │ -
Provide a factory over the generic topologies.
Definition topologyfactory.hh:42
│ │ │ │ -
Traits::Factory Factory
Definition topologyfactory.hh:47
│ │ │ │ -
static Object * create(const Dune::GeometryType &gt, const Key &key)
dynamically create objects
Definition topologyfactory.hh:50
│ │ │ │ -
static const unsigned int dimension
Definition topologyfactory.hh:44
│ │ │ │ -
static Object * create(const Key &key)
statically create objects
Definition topologyfactory.hh:58
│ │ │ │ -
static void release(Object *object)
release the object returned by the create methods
Definition topologyfactory.hh:71
│ │ │ │ -
Traits::Key Key
Definition topologyfactory.hh:45
│ │ │ │ -
Traits::Object Object
Definition topologyfactory.hh:46
│ │ │ │ -
A wrapper for a TopologyFactory providing singleton storage. Same usage as TopologyFactory but with e...
Definition topologyfactory.hh:82
│ │ │ │ -
static auto create(const Key &key) -> std::enable_if_t< Topology::dimension==dimension, Object * >
Definition topologyfactory.hh:103
│ │ │ │ -
static Object * create(const Dune::GeometryType &gt, const Key &key)
Definition topologyfactory.hh:88
│ │ │ │ -
static void release(Object *object)
release the object returned by the create methods
Definition topologyfactory.hh:110
│ │ │ │ -
const Factory::Object Object
Definition topologyfactory.hh:85
│ │ │ │ -
Factory::Key Key
Definition topologyfactory.hh:84
│ │ │ │ -
static auto create(const Key &key) -> std::enable_if_t< static_cast< GeometryType >(geometryId).dim()==dimension, Object * >
Definition topologyfactory.hh:95
│ │ │ │ -
static const unsigned int dimension
Definition topologyfactory.hh:83
│ │ │ │ +
This class provides access to geometric and topological properties of a reference element.
Definition referenceelement.hh:52
│ │ │ │ +
CoordinateField volume() const
obtain the volume of the reference element
Definition referenceelement.hh:241
│ │ │ │ +
decltype(auto) type(int i, int c) const
obtain the type of subentity (i,c)
Definition referenceelement.hh:171
│ │ │ │ +
int size(int c) const
number of subentities of codimension c
Definition referenceelement.hh:94
│ │ │ │ +
decltype(auto) position(int i, int c) const
position of the barycenter of entity (i,c)
Definition referenceelement.hh:203
│ │ │ │ +
Definition affinegeometry.hh:33
│ │ │ │ +
Class providing access to the singletons of the reference elements.
Definition referenceelements.hh:170
│ │ │ │ +
Implementation of the Geometry interface for affine geometries.
Definition affinegeometry.hh:484
│ │ │ │ +
AffineGeometry(const ReferenceElement &refElement, const CoordVector &coordVector)
Create affine geometry from reference element and a vector of vertex coordinates.
Definition affinegeometry.hh:543
│ │ │ │ +
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
│ │ │ │ +
FieldVector< ctype, mydimension > LocalCoordinate
Type for local coordinate vector.
Definition affinegeometry.hh:497
│ │ │ │ +
Dune::GeometryType type() const
Obtain the type of the reference element.
Definition affinegeometry.hh:561
│ │ │ │ +
static const int mydimension
Dimension of the geometry.
Definition affinegeometry.hh:491
│ │ │ │ +
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
│ │ │ │ +
ctype Volume
Type used for volume.
Definition affinegeometry.hh:503
│ │ │ │ +
JacobianInverse jacobianInverse(const LocalCoordinate &local) const
Obtain the Jacobian's inverse.
Definition affinegeometry.hh:668
│ │ │ │ +
friend ReferenceElement referenceElement(const AffineGeometry &geometry)
Definition affinegeometry.hh:673
│ │ │ │ +
AffineGeometry(Dune::GeometryType gt, const CoordVector &coordVector)
Create affine geometry from GeometryType and a vector of vertex coordinates.
Definition affinegeometry.hh:553
│ │ │ │ +
ctype integrationElement(const LocalCoordinate &local) const
Obtain the integration element.
Definition affinegeometry.hh:618
│ │ │ │ +
FieldMatrix< ctype, mydimension, coorddimension > JacobianInverse
Type for the inverse Jacobian matrix.
Definition affinegeometry.hh:515
│ │ │ │ +
FieldMatrix< ctype, coorddimension, mydimension > Jacobian
Type for the Jacobian matrix.
Definition affinegeometry.hh:512
│ │ │ │ +
const JacobianInverseTransposed & jacobianInverseTransposed(const LocalCoordinate &local) const
Obtain the transposed of the Jacobian's inverse.
Definition affinegeometry.hh:646
│ │ │ │ +
FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed
Type for the transposed Jacobian matrix.
Definition affinegeometry.hh:506
│ │ │ │ +
GlobalCoordinate corner(int i) const
Obtain coordinates of the i-th corner.
Definition affinegeometry.hh:567
│ │ │ │ +
int corners() const
Obtain number of corners of the corresponding reference element.
Definition affinegeometry.hh:564
│ │ │ │ +
LocalCoordinate local(const GlobalCoordinate &global) const
Evaluate the inverse mapping.
Definition affinegeometry.hh:601
│ │ │ │ +
FieldMatrix< ctype, coorddimension, mydimension > JacobianInverseTransposed
Type for the transposed inverse Jacobian matrix.
Definition affinegeometry.hh:509
│ │ │ │ +
static const int coorddimension
Dimension of the world space.
Definition affinegeometry.hh:494
│ │ │ │ +
GlobalCoordinate global(const LocalCoordinate &local) const
Evaluate the mapping.
Definition affinegeometry.hh:581
│ │ │ │ +
GlobalCoordinate center() const
Obtain the centroid of the mapping's image.
Definition affinegeometry.hh:573
│ │ │ │ +
Jacobian jacobian(const LocalCoordinate &local) const
Obtain the Jacobian.
Definition affinegeometry.hh:657
│ │ │ │ +
ct ctype
Type used for coordinates.
Definition affinegeometry.hh:488
│ │ │ │ +
FieldVector< ctype, coorddimension > GlobalCoordinate
Type for coordinate vector in world space.
Definition affinegeometry.hh:500
│ │ │ │ +
bool affine() const
Always true: this is an affine geometry.
Definition affinegeometry.hh:558
│ │ │ │ +
const JacobianTransposed & jacobianTransposed(const LocalCoordinate &local) const
Obtain the transposed of the Jacobian.
Definition affinegeometry.hh:635
│ │ │ │ +
Volume volume() const
Obtain the volume of the element.
Definition affinegeometry.hh:624
│ │ │ │
Unique label for each type of entities that can occur in DUNE grids.
Definition type.hh:126
│ │ │ │ -
constexpr unsigned int id() const
Return the topology id of the type.
Definition type.hh:377
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -7,222 +7,801 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ Loading... │ │ │ │ │ Searching... │ │ │ │ │ No Matches │ │ │ │ │ * dune │ │ │ │ │ * geometry │ │ │ │ │ -topologyfactory.hh │ │ │ │ │ +affinegeometry.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- │ │ │ │ │ 2// vi: set et ts=4 sw=2 sts=2: │ │ │ │ │ 3// SPDX-FileCopyrightInfo: Copyright (C) DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 4// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception │ │ │ │ │ - 5#ifndef DUNE_GEOMETRY_TOPOLOGYFACTORY_HH │ │ │ │ │ - 6#define DUNE_GEOMETRY_TOPOLOGYFACTORY_HH │ │ │ │ │ + 5#ifndef DUNE_GEOMETRY_AFFINEGEOMETRY_HH │ │ │ │ │ + 6#define DUNE_GEOMETRY_AFFINEGEOMETRY_HH │ │ │ │ │ 7 │ │ │ │ │ - 8#include │ │ │ │ │ - 9 │ │ │ │ │ - 10#include │ │ │ │ │ - 11#include │ │ │ │ │ - 12#include │ │ │ │ │ - 13#include │ │ │ │ │ - 14#include │ │ │ │ │ - 15 │ │ │ │ │ - 16#include │ │ │ │ │ - 17#include │ │ │ │ │ - 18 │ │ │ │ │ - 19namespace Dune │ │ │ │ │ - 20{ │ │ │ │ │ - 21 │ │ │ │ │ - 40 template │ │ │ │ │ -41 struct TopologyFactory │ │ │ │ │ + 13#include │ │ │ │ │ + 14 │ │ │ │ │ + 15#include │ │ │ │ │ + 16#include │ │ │ │ │ + 17 │ │ │ │ │ + 18#include │ │ │ │ │ + 19 │ │ │ │ │ +20namespace Dune │ │ │ │ │ + 21{ │ │ │ │ │ + 22 │ │ │ │ │ + 23 // External Forward Declarations │ │ │ │ │ + 24 // ----------------------------- │ │ │ │ │ + 25 │ │ │ │ │ +26 namespace Geo │ │ │ │ │ + 27 { │ │ │ │ │ + 28 │ │ │ │ │ + 29 template< typename Implementation > │ │ │ │ │ + 30 class ReferenceElement; │ │ │ │ │ + 31 │ │ │ │ │ + 32 template< class ctype, int dim > │ │ │ │ │ +33 class ReferenceElementImplementation; │ │ │ │ │ + 34 │ │ │ │ │ + 35 template< class ctype, int dim > │ │ │ │ │ + 36 struct ReferenceElements; │ │ │ │ │ + 37 │ │ │ │ │ + 38 } │ │ │ │ │ + 39 │ │ │ │ │ + 40 │ │ │ │ │ + 41 namespace Impl │ │ │ │ │ 42 { │ │ │ │ │ - 43 // extract types from Traits class │ │ │ │ │ -44 static const unsigned int dimension = Traits::dimension; │ │ │ │ │ -45 typedef typename Traits::Key Key; │ │ │ │ │ -46 typedef typename Traits::Object Object; │ │ │ │ │ -47 typedef typename Traits::Factory Factory; │ │ │ │ │ - 48 │ │ │ │ │ -50 static Object *create ( const Dune::GeometryType >, const Key &key ) │ │ │ │ │ - 51 { │ │ │ │ │ - 52 return Impl::toGeometryTypeIdConstant(gt, [&](auto id) { │ │ │ │ │ - 53 return create(key); │ │ │ │ │ - 54 }); │ │ │ │ │ - 55 } │ │ │ │ │ - 57 template< GeometryType::Id geometryId > │ │ │ │ │ -58 static Object *create ( const Key &key ) │ │ │ │ │ - 59 { │ │ │ │ │ - 60 return Factory::template createObject< geometryId >( key ); │ │ │ │ │ + 43 │ │ │ │ │ + 44 // FieldMatrixHelper │ │ │ │ │ + 45 // ----------------- │ │ │ │ │ + 46 │ │ │ │ │ + 47 template< class ct > │ │ │ │ │ + 48 struct FieldMatrixHelper │ │ │ │ │ + 49 { │ │ │ │ │ + 50 typedef ct ctype; │ │ │ │ │ + 51 │ │ │ │ │ + 52 template< int m, int n > │ │ │ │ │ + 53 static void Ax ( const FieldMatrix< ctype, m, n > &A, const FieldVector< │ │ │ │ │ +ctype, n > &x, FieldVector< ctype, m > &ret ) │ │ │ │ │ + 54 { │ │ │ │ │ + 55 for( int i = 0; i < m; ++i ) │ │ │ │ │ + 56 { │ │ │ │ │ + 57 ret[ i ] = ctype( 0 ); │ │ │ │ │ + 58 for( int j = 0; j < n; ++j ) │ │ │ │ │ + 59 ret[ i ] += A[ i ][ j ] * x[ j ]; │ │ │ │ │ + 60 } │ │ │ │ │ 61 } │ │ │ │ │ 62 │ │ │ │ │ - 64 template< class Topology > │ │ │ │ │ -65 static Object *create ( const Key &key ) │ │ │ │ │ - 66 { │ │ │ │ │ - 67 return Factory::template createObject< Topology >( key ); │ │ │ │ │ - 68 } │ │ │ │ │ - 69 │ │ │ │ │ -71 static void release( Object *object ) { delete object; } │ │ │ │ │ - 72 }; │ │ │ │ │ + 63 template< int m, int n > │ │ │ │ │ + 64 static void ATx ( const FieldMatrix< ctype, m, n > &A, const FieldVector< │ │ │ │ │ +ctype, m > &x, FieldVector< ctype, n > &ret ) │ │ │ │ │ + 65 { │ │ │ │ │ + 66 for( int i = 0; i < n; ++i ) │ │ │ │ │ + 67 { │ │ │ │ │ + 68 ret[ i ] = ctype( 0 ); │ │ │ │ │ + 69 for( int j = 0; j < m; ++j ) │ │ │ │ │ + 70 ret[ i ] += A[ j ][ i ] * x[ j ]; │ │ │ │ │ + 71 } │ │ │ │ │ + 72 } │ │ │ │ │ 73 │ │ │ │ │ - 74 │ │ │ │ │ - 75 │ │ │ │ │ - 80 template │ │ │ │ │ -81 struct TopologySingletonFactory │ │ │ │ │ - 82 { │ │ │ │ │ -83 static const unsigned int dimension = Factory::dimension; │ │ │ │ │ -84 typedef typename Factory::Key Key; │ │ │ │ │ -85 typedef const typename Factory::Object Object; │ │ │ │ │ - 86 │ │ │ │ │ -88 static Object *create ( const Dune::GeometryType >, const Key &key ) │ │ │ │ │ - 89 { │ │ │ │ │ - 90 assert( gt.id() < numTopologies ); │ │ │ │ │ - 91 return instance().getObject( gt, key ); │ │ │ │ │ - 92 } │ │ │ │ │ - 94 template< GeometryType::Id geometryId > │ │ │ │ │ -95 static auto create ( const Key &key ) │ │ │ │ │ - 96 -> std::enable_if_t< static_cast(geometryId).dim() == │ │ │ │ │ -dimension, Object * > │ │ │ │ │ - 97 { │ │ │ │ │ - 98 return instance().template getObject< geometryId >( key ); │ │ │ │ │ + 74 template< int m, int n, int p > │ │ │ │ │ + 75 static void AB ( const FieldMatrix< ctype, m, n > &A, const FieldMatrix< │ │ │ │ │ +ctype, n, p > &B, FieldMatrix< ctype, m, p > &ret ) │ │ │ │ │ + 76 { │ │ │ │ │ + 77 for( int i = 0; i < m; ++i ) │ │ │ │ │ + 78 { │ │ │ │ │ + 79 for( int j = 0; j < p; ++j ) │ │ │ │ │ + 80 { │ │ │ │ │ + 81 ret[ i ][ j ] = ctype( 0 ); │ │ │ │ │ + 82 for( int k = 0; k < n; ++k ) │ │ │ │ │ + 83 ret[ i ][ j ] += A[ i ][ k ] * B[ k ][ j ]; │ │ │ │ │ + 84 } │ │ │ │ │ + 85 } │ │ │ │ │ + 86 } │ │ │ │ │ + 87 │ │ │ │ │ + 88 template< int m, int n, int p > │ │ │ │ │ + 89 static void ATBT ( const FieldMatrix< ctype, m, n > &A, const FieldMatrix< │ │ │ │ │ +ctype, p, m > &B, FieldMatrix< ctype, n, p > &ret ) │ │ │ │ │ + 90 { │ │ │ │ │ + 91 for( int i = 0; i < n; ++i ) │ │ │ │ │ + 92 { │ │ │ │ │ + 93 for( int j = 0; j < p; ++j ) │ │ │ │ │ + 94 { │ │ │ │ │ + 95 ret[ i ][ j ] = ctype( 0 ); │ │ │ │ │ + 96 for( int k = 0; k < m; ++k ) │ │ │ │ │ + 97 ret[ i ][ j ] += A[ k ][ i ] * B[ j ][ k ]; │ │ │ │ │ + 98 } │ │ │ │ │ 99 } │ │ │ │ │ - 100 │ │ │ │ │ - 102 template< class Topology > │ │ │ │ │ -103 static auto create ( const Key &key ) │ │ │ │ │ - 104 -> std::enable_if_t< Topology::dimension == dimension, Object * > │ │ │ │ │ - 105 { │ │ │ │ │ - 106 return instance().template getObject< Topology >( key ); │ │ │ │ │ - 107 } │ │ │ │ │ - 108 │ │ │ │ │ -110 static void release ( Object *object ) │ │ │ │ │ - 111 {} │ │ │ │ │ - 112 │ │ │ │ │ - 113 private: │ │ │ │ │ - 114 struct ObjectDeleter │ │ │ │ │ - 115 { │ │ │ │ │ - 116 void operator() ( Object *ptr ) const { Factory::release( ptr ); } │ │ │ │ │ - 117 }; │ │ │ │ │ - 118 │ │ │ │ │ - 119 static TopologySingletonFactory &instance () │ │ │ │ │ + 100 } │ │ │ │ │ + 101 │ │ │ │ │ + 102 template< int m, int n > │ │ │ │ │ + 103 static void ATA_L ( const FieldMatrix< ctype, m, n > &A, FieldMatrix< │ │ │ │ │ +ctype, n, n > &ret ) │ │ │ │ │ + 104 { │ │ │ │ │ + 105 for( int i = 0; i < n; ++i ) │ │ │ │ │ + 106 { │ │ │ │ │ + 107 for( int j = 0; j <= i; ++j ) │ │ │ │ │ + 108 { │ │ │ │ │ + 109 ret[ i ][ j ] = ctype( 0 ); │ │ │ │ │ + 110 for( int k = 0; k < m; ++k ) │ │ │ │ │ + 111 ret[ i ][ j ] += A[ k ][ i ] * A[ k ][ j ]; │ │ │ │ │ + 112 } │ │ │ │ │ + 113 } │ │ │ │ │ + 114 } │ │ │ │ │ + 115 │ │ │ │ │ + 116 template< int m, int n > │ │ │ │ │ + 117 static void ATA ( const FieldMatrix< ctype, m, n > &A, FieldMatrix< ctype, │ │ │ │ │ +n, n > &ret ) │ │ │ │ │ + 118 { │ │ │ │ │ + 119 for( int i = 0; i < n; ++i ) │ │ │ │ │ 120 { │ │ │ │ │ - 121 static TopologySingletonFactory instance; │ │ │ │ │ - 122 return instance; │ │ │ │ │ - 123 } │ │ │ │ │ - 124 │ │ │ │ │ - 125 static const unsigned int numTopologies = (1 << dimension); │ │ │ │ │ - 126 typedef std::array< std::unique_ptr< Object, ObjectDeleter >, │ │ │ │ │ -numTopologies > Array; │ │ │ │ │ - 127 typedef std::map< Key, Array > Storage; │ │ │ │ │ + 121 for( int j = 0; j <= i; ++j ) │ │ │ │ │ + 122 { │ │ │ │ │ + 123 ret[ i ][ j ] = ctype( 0 ); │ │ │ │ │ + 124 for( int k = 0; k < m; ++k ) │ │ │ │ │ + 125 ret[ i ][ j ] += A[ k ][ i ] * A[ k ][ j ]; │ │ │ │ │ + 126 ret[ j ][ i ] = ret[ i ][ j ]; │ │ │ │ │ + 127 } │ │ │ │ │ 128 │ │ │ │ │ - 129 TopologySingletonFactory () = default; │ │ │ │ │ - 130 │ │ │ │ │ - 131 std::unique_ptr< Object, ObjectDeleter > &find ( const unsigned int │ │ │ │ │ -topologyId, const Key &key ) │ │ │ │ │ - 132 { │ │ │ │ │ - 133 return storage_[ key ][ topologyId ]; │ │ │ │ │ - 134 } │ │ │ │ │ - 135 │ │ │ │ │ - 136 Object *getObject ( const Dune::GeometryType >, const Key &key ) │ │ │ │ │ + 129 ret[ i ][ i ] = ctype( 0 ); │ │ │ │ │ + 130 for( int k = 0; k < m; ++k ) │ │ │ │ │ + 131 ret[ i ][ i ] += A[ k ][ i ] * A[ k ][ i ]; │ │ │ │ │ + 132 } │ │ │ │ │ + 133 } │ │ │ │ │ + 134 │ │ │ │ │ + 135 template< int m, int n > │ │ │ │ │ + 136 static void AAT_L ( const FieldMatrix< ctype, m, n > &A, FieldMatrix< │ │ │ │ │ +ctype, m, m > &ret ) │ │ │ │ │ 137 { │ │ │ │ │ - 138 auto &object = find( gt.id(), key ); │ │ │ │ │ - 139 if( !object ) │ │ │ │ │ - 140 object.reset( Factory::create( gt, key ) ); │ │ │ │ │ - 141 return object.get(); │ │ │ │ │ - 142 } │ │ │ │ │ - 143 │ │ │ │ │ - 144 template< GeometryType::Id geometryId > │ │ │ │ │ - 145 Object *getObject ( const Key &key ) │ │ │ │ │ - 146 { │ │ │ │ │ - 147 static constexpr GeometryType geometry = geometryId; │ │ │ │ │ - 148 auto &object = find( geometry.id(), key ); │ │ │ │ │ - 149 if( !object ) │ │ │ │ │ - 150 object.reset( Factory::template create< geometry >( key ) ); │ │ │ │ │ - 151 return object.get(); │ │ │ │ │ - 152 } │ │ │ │ │ - 153 │ │ │ │ │ - 154 template< class Topology > │ │ │ │ │ - 155 Object *getObject ( const Key &key ) │ │ │ │ │ - 156 { │ │ │ │ │ - 157 auto &object = find( Topology::id, key ); │ │ │ │ │ - 158 if( !object ) │ │ │ │ │ - 159 object.reset( Factory::template create< Topology >( key ) ); │ │ │ │ │ - 160 return object.get(); │ │ │ │ │ - 161 } │ │ │ │ │ - 162 │ │ │ │ │ - 163 Storage storage_; │ │ │ │ │ - 164 }; │ │ │ │ │ - 165 │ │ │ │ │ - 166} │ │ │ │ │ - 167 │ │ │ │ │ - 168#endif // #ifndef DUNE_GEOMETRY_TOPOLOGYFACTORY_HH │ │ │ │ │ -typeindex.hh │ │ │ │ │ -Helper classes to provide indices for geometrytypes for use in a vector. │ │ │ │ │ + 138 /* │ │ │ │ │ + 139 if (m==2) { │ │ │ │ │ + 140 ret[0][0] = A[0]*A[0]; │ │ │ │ │ + 141 ret[1][1] = A[1]*A[1]; │ │ │ │ │ + 142 ret[1][0] = A[0]*A[1]; │ │ │ │ │ + 143 } │ │ │ │ │ + 144 else │ │ │ │ │ + 145 */ │ │ │ │ │ + 146 for( int i = 0; i < m; ++i ) │ │ │ │ │ + 147 { │ │ │ │ │ + 148 for( int j = 0; j <= i; ++j ) │ │ │ │ │ + 149 { │ │ │ │ │ + 150 ctype &retij = ret[ i ][ j ]; │ │ │ │ │ + 151 retij = A[ i ][ 0 ] * A[ j ][ 0 ]; │ │ │ │ │ + 152 for( int k = 1; k < n; ++k ) │ │ │ │ │ + 153 retij += A[ i ][ k ] * A[ j ][ k ]; │ │ │ │ │ + 154 } │ │ │ │ │ + 155 } │ │ │ │ │ + 156 } │ │ │ │ │ + 157 │ │ │ │ │ + 158 template< int m, int n > │ │ │ │ │ + 159 static void AAT ( const FieldMatrix< ctype, m, n > &A, FieldMatrix< ctype, │ │ │ │ │ +m, m > &ret ) │ │ │ │ │ + 160 { │ │ │ │ │ + 161 for( int i = 0; i < m; ++i ) │ │ │ │ │ + 162 { │ │ │ │ │ + 163 for( int j = 0; j < i; ++j ) │ │ │ │ │ + 164 { │ │ │ │ │ + 165 ret[ i ][ j ] = ctype( 0 ); │ │ │ │ │ + 166 for( int k = 0; k < n; ++k ) │ │ │ │ │ + 167 ret[ i ][ j ] += A[ i ][ k ] * A[ j ][ k ]; │ │ │ │ │ + 168 ret[ j ][ i ] = ret[ i ][ j ]; │ │ │ │ │ + 169 } │ │ │ │ │ + 170 ret[ i ][ i ] = ctype( 0 ); │ │ │ │ │ + 171 for( int k = 0; k < n; ++k ) │ │ │ │ │ + 172 ret[ i ][ i ] += A[ i ][ k ] * A[ i ][ k ]; │ │ │ │ │ + 173 } │ │ │ │ │ + 174 } │ │ │ │ │ + 175 │ │ │ │ │ + 176 template< int n > │ │ │ │ │ + 177 static void Lx ( const FieldMatrix< ctype, n, n > &L, const FieldVector< │ │ │ │ │ +ctype, n > &x, FieldVector< ctype, n > &ret ) │ │ │ │ │ + 178 { │ │ │ │ │ + 179 for( int i = 0; i < n; ++i ) │ │ │ │ │ + 180 { │ │ │ │ │ + 181 ret[ i ] = ctype( 0 ); │ │ │ │ │ + 182 for( int j = 0; j <= i; ++j ) │ │ │ │ │ + 183 ret[ i ] += L[ i ][ j ] * x[ j ]; │ │ │ │ │ + 184 } │ │ │ │ │ + 185 } │ │ │ │ │ + 186 │ │ │ │ │ + 187 template< int n > │ │ │ │ │ + 188 static void LTx ( const FieldMatrix< ctype, n, n > &L, const FieldVector< │ │ │ │ │ +ctype, n > &x, FieldVector< ctype, n > &ret ) │ │ │ │ │ + 189 { │ │ │ │ │ + 190 for( int i = 0; i < n; ++i ) │ │ │ │ │ + 191 { │ │ │ │ │ + 192 ret[ i ] = ctype( 0 ); │ │ │ │ │ + 193 for( int j = i; j < n; ++j ) │ │ │ │ │ + 194 ret[ i ] += L[ j ][ i ] * x[ j ]; │ │ │ │ │ + 195 } │ │ │ │ │ + 196 } │ │ │ │ │ + 197 │ │ │ │ │ + 198 template< int n > │ │ │ │ │ + 199 static void LTL ( const FieldMatrix< ctype, n, n > &L, FieldMatrix< ctype, │ │ │ │ │ +n, n > &ret ) │ │ │ │ │ + 200 { │ │ │ │ │ + 201 for( int i = 0; i < n; ++i ) │ │ │ │ │ + 202 { │ │ │ │ │ + 203 for( int j = 0; j < i; ++j ) │ │ │ │ │ + 204 { │ │ │ │ │ + 205 ret[ i ][ j ] = ctype( 0 ); │ │ │ │ │ + 206 for( int k = i; k < n; ++k ) │ │ │ │ │ + 207 ret[ i ][ j ] += L[ k ][ i ] * L[ k ][ j ]; │ │ │ │ │ + 208 ret[ j ][ i ] = ret[ i ][ j ]; │ │ │ │ │ + 209 } │ │ │ │ │ + 210 ret[ i ][ i ] = ctype( 0 ); │ │ │ │ │ + 211 for( int k = i; k < n; ++k ) │ │ │ │ │ + 212 ret[ i ][ i ] += L[ k ][ i ] * L[ k ][ i ]; │ │ │ │ │ + 213 } │ │ │ │ │ + 214 } │ │ │ │ │ + 215 │ │ │ │ │ + 216 template< int n > │ │ │ │ │ + 217 static void LLT ( const FieldMatrix< ctype, n, n > &L, FieldMatrix< ctype, │ │ │ │ │ +n, n > &ret ) │ │ │ │ │ + 218 { │ │ │ │ │ + 219 for( int i = 0; i < n; ++i ) │ │ │ │ │ + 220 { │ │ │ │ │ + 221 for( int j = 0; j < i; ++j ) │ │ │ │ │ + 222 { │ │ │ │ │ + 223 ret[ i ][ j ] = ctype( 0 ); │ │ │ │ │ + 224 for( int k = 0; k <= j; ++k ) │ │ │ │ │ + 225 ret[ i ][ j ] += L[ i ][ k ] * L[ j ][ k ]; │ │ │ │ │ + 226 ret[ j ][ i ] = ret[ i ][ j ]; │ │ │ │ │ + 227 } │ │ │ │ │ + 228 ret[ i ][ i ] = ctype( 0 ); │ │ │ │ │ + 229 for( int k = 0; k <= i; ++k ) │ │ │ │ │ + 230 ret[ i ][ i ] += L[ i ][ k ] * L[ i ][ k ]; │ │ │ │ │ + 231 } │ │ │ │ │ + 232 } │ │ │ │ │ + 233 │ │ │ │ │ + 234 template< int n > │ │ │ │ │ + 235 static bool cholesky_L ( const FieldMatrix< ctype, n, n > &A, FieldMatrix< │ │ │ │ │ +ctype, n, n > &ret, const bool checkSingular = false ) │ │ │ │ │ + 236 { │ │ │ │ │ + 237 using std::sqrt; │ │ │ │ │ + 238 for( int i = 0; i < n; ++i ) │ │ │ │ │ + 239 { │ │ │ │ │ + 240 ctype &rii = ret[ i ][ i ]; │ │ │ │ │ + 241 │ │ │ │ │ + 242 ctype xDiag = A[ i ][ i ]; │ │ │ │ │ + 243 for( int j = 0; j < i; ++j ) │ │ │ │ │ + 244 xDiag -= ret[ i ][ j ] * ret[ i ][ j ]; │ │ │ │ │ + 245 │ │ │ │ │ + 246 // in some cases A can be singular, e.g. when checking local for │ │ │ │ │ + 247 // outside points during checkInside │ │ │ │ │ + 248 if( checkSingular && ! ( xDiag > ctype( 0 )) ) │ │ │ │ │ + 249 return false ; │ │ │ │ │ + 250 │ │ │ │ │ + 251 // otherwise this should be true always │ │ │ │ │ + 252 assert( xDiag > ctype( 0 ) ); │ │ │ │ │ + 253 rii = sqrt( xDiag ); │ │ │ │ │ + 254 │ │ │ │ │ + 255 ctype invrii = ctype( 1 ) / rii; │ │ │ │ │ + 256 for( int k = i+1; k < n; ++k ) │ │ │ │ │ + 257 { │ │ │ │ │ + 258 ctype x = A[ k ][ i ]; │ │ │ │ │ + 259 for( int j = 0; j < i; ++j ) │ │ │ │ │ + 260 x -= ret[ i ][ j ] * ret[ k ][ j ]; │ │ │ │ │ + 261 ret[ k ][ i ] = invrii * x; │ │ │ │ │ + 262 } │ │ │ │ │ + 263 } │ │ │ │ │ + 264 │ │ │ │ │ + 265 // return true for meaning A is non-singular │ │ │ │ │ + 266 return true; │ │ │ │ │ + 267 } │ │ │ │ │ + 268 │ │ │ │ │ + 269 template< int n > │ │ │ │ │ + 270 static ctype detL ( const FieldMatrix< ctype, n, n > &L ) │ │ │ │ │ + 271 { │ │ │ │ │ + 272 ctype det( 1 ); │ │ │ │ │ + 273 for( int i = 0; i < n; ++i ) │ │ │ │ │ + 274 det *= L[ i ][ i ]; │ │ │ │ │ + 275 return det; │ │ │ │ │ + 276 } │ │ │ │ │ + 277 │ │ │ │ │ + 278 template< int n > │ │ │ │ │ + 279 static ctype invL ( FieldMatrix< ctype, n, n > &L ) │ │ │ │ │ + 280 { │ │ │ │ │ + 281 ctype det( 1 ); │ │ │ │ │ + 282 for( int i = 0; i < n; ++i ) │ │ │ │ │ + 283 { │ │ │ │ │ + 284 ctype &lii = L[ i ][ i ]; │ │ │ │ │ + 285 det *= lii; │ │ │ │ │ + 286 lii = ctype( 1 ) / lii; │ │ │ │ │ + 287 for( int j = 0; j < i; ++j ) │ │ │ │ │ + 288 { │ │ │ │ │ + 289 ctype &lij = L[ i ][ j ]; │ │ │ │ │ + 290 ctype x = lij * L[ j ][ j ]; │ │ │ │ │ + 291 for( int k = j+1; k < i; ++k ) │ │ │ │ │ + 292 x += L[ i ][ k ] * L[ k ][ j ]; │ │ │ │ │ + 293 lij = (-lii) * x; │ │ │ │ │ + 294 } │ │ │ │ │ + 295 } │ │ │ │ │ + 296 return det; │ │ │ │ │ + 297 } │ │ │ │ │ + 298 │ │ │ │ │ + 299 // calculates x := L^{-1} x │ │ │ │ │ + 300 template< int n > │ │ │ │ │ + 301 static void invLx ( FieldMatrix< ctype, n, n > &L, FieldVector< ctype, n > │ │ │ │ │ +&x ) │ │ │ │ │ + 302 { │ │ │ │ │ + 303 for( int i = 0; i < n; ++i ) │ │ │ │ │ + 304 { │ │ │ │ │ + 305 for( int j = 0; j < i; ++j ) │ │ │ │ │ + 306 x[ i ] -= L[ i ][ j ] * x[ j ]; │ │ │ │ │ + 307 x[ i ] /= L[ i ][ i ]; │ │ │ │ │ + 308 } │ │ │ │ │ + 309 } │ │ │ │ │ + 310 │ │ │ │ │ + 311 // calculates x := L^{-T} x │ │ │ │ │ + 312 template< int n > │ │ │ │ │ + 313 static void invLTx ( FieldMatrix< ctype, n, n > &L, FieldVector< ctype, n │ │ │ │ │ +> &x ) │ │ │ │ │ + 314 { │ │ │ │ │ + 315 for( int i = n; i > 0; --i ) │ │ │ │ │ + 316 { │ │ │ │ │ + 317 for( int j = i; j < n; ++j ) │ │ │ │ │ + 318 x[ i-1 ] -= L[ j ][ i-1 ] * x[ j ]; │ │ │ │ │ + 319 x[ i-1 ] /= L[ i-1 ][ i-1 ]; │ │ │ │ │ + 320 } │ │ │ │ │ + 321 } │ │ │ │ │ + 322 │ │ │ │ │ + 323 template< int n > │ │ │ │ │ + 324 static ctype spdDetA ( const FieldMatrix< ctype, n, n > &A ) │ │ │ │ │ + 325 { │ │ │ │ │ + 326 // return A[0][0]*A[1][1]-A[1][0]*A[1][0]; │ │ │ │ │ + 327 FieldMatrix< ctype, n, n > L; │ │ │ │ │ + 328 cholesky_L( A, L ); │ │ │ │ │ + 329 return detL( L ); │ │ │ │ │ + 330 } │ │ │ │ │ + 331 │ │ │ │ │ + 332 template< int n > │ │ │ │ │ + 333 static ctype spdInvA ( FieldMatrix< ctype, n, n > &A ) │ │ │ │ │ + 334 { │ │ │ │ │ + 335 FieldMatrix< ctype, n, n > L; │ │ │ │ │ + 336 cholesky_L( A, L ); │ │ │ │ │ + 337 const ctype det = invL( L ); │ │ │ │ │ + 338 LTL( L, A ); │ │ │ │ │ + 339 return det; │ │ │ │ │ + 340 } │ │ │ │ │ + 341 │ │ │ │ │ + 342 // calculate x := A^{-1} x │ │ │ │ │ + 343 template< int n > │ │ │ │ │ + 344 static bool spdInvAx ( FieldMatrix< ctype, n, n > &A, FieldVector< ctype, │ │ │ │ │ +n > &x, const bool checkSingular = false ) │ │ │ │ │ + 345 { │ │ │ │ │ + 346 FieldMatrix< ctype, n, n > L; │ │ │ │ │ + 347 const bool invertible = cholesky_L( A, L, checkSingular ); │ │ │ │ │ + 348 if( ! invertible ) return invertible ; │ │ │ │ │ + 349 invLx( L, x ); │ │ │ │ │ + 350 invLTx( L, x ); │ │ │ │ │ + 351 return invertible; │ │ │ │ │ + 352 } │ │ │ │ │ + 353 │ │ │ │ │ + 354 template< int m, int n > │ │ │ │ │ + 355 static ctype detATA ( const FieldMatrix< ctype, m, n > &A ) │ │ │ │ │ + 356 { │ │ │ │ │ + 357 if( m >= n ) │ │ │ │ │ + 358 { │ │ │ │ │ + 359 FieldMatrix< ctype, n, n > ata; │ │ │ │ │ + 360 ATA_L( A, ata ); │ │ │ │ │ + 361 return spdDetA( ata ); │ │ │ │ │ + 362 } │ │ │ │ │ + 363 else │ │ │ │ │ + 364 return ctype( 0 ); │ │ │ │ │ + 365 } │ │ │ │ │ + 366 │ │ │ │ │ + 372 template< int m, int n > │ │ │ │ │ + 373 static ctype sqrtDetAAT ( const FieldMatrix< ctype, m, n > &A ) │ │ │ │ │ + 374 { │ │ │ │ │ + 375 using std::abs; │ │ │ │ │ + 376 using std::sqrt; │ │ │ │ │ + 377 // These special cases are here not only for speed reasons: │ │ │ │ │ + 378 // The general implementation aborts if the matrix is almost singular, │ │ │ │ │ + 379 // and the special implementation provide a stable way to handle that │ │ │ │ │ +case. │ │ │ │ │ + 380 if( (n == 2) && (m == 2) ) │ │ │ │ │ + 381 { │ │ │ │ │ + 382 // Special implementation for 2x2 matrices: faster and more stable │ │ │ │ │ + 383 return abs( A[ 0 ][ 0 ]*A[ 1 ][ 1 ] - A[ 1 ][ 0 ]*A[ 0 ][ 1 ] ); │ │ │ │ │ + 384 } │ │ │ │ │ + 385 else if( (n == 3) && (m == 3) ) │ │ │ │ │ + 386 { │ │ │ │ │ + 387 // Special implementation for 3x3 matrices │ │ │ │ │ + 388 const ctype v0 = A[ 0 ][ 1 ] * A[ 1 ][ 2 ] - A[ 1 ][ 1 ] * A[ 0 ][ 2 ]; │ │ │ │ │ + 389 const ctype v1 = A[ 0 ][ 2 ] * A[ 1 ][ 0 ] - A[ 1 ][ 2 ] * A[ 0 ][ 0 ]; │ │ │ │ │ + 390 const ctype v2 = A[ 0 ][ 0 ] * A[ 1 ][ 1 ] - A[ 1 ][ 0 ] * A[ 0 ][ 1 ]; │ │ │ │ │ + 391 return abs( v0 * A[ 2 ][ 0 ] + v1 * A[ 2 ][ 1 ] + v2 * A[ 2 ][ 2 ] ); │ │ │ │ │ + 392 } │ │ │ │ │ + 393 else if ( (n == 3) && (m == 2) ) │ │ │ │ │ + 394 { │ │ │ │ │ + 395 // Special implementation for 2x3 matrices │ │ │ │ │ + 396 const ctype v0 = A[ 0 ][ 0 ] * A[ 1 ][ 1 ] - A[ 0 ][ 1 ] * A[ 1 ][ 0 ]; │ │ │ │ │ + 397 const ctype v1 = A[ 0 ][ 0 ] * A[ 1 ][ 2 ] - A[ 1 ][ 0 ] * A[ 0 ][ 2 ]; │ │ │ │ │ + 398 const ctype v2 = A[ 0 ][ 1 ] * A[ 1 ][ 2 ] - A[ 0 ][ 2 ] * A[ 1 ][ 1 ]; │ │ │ │ │ + 399 return sqrt( v0*v0 + v1*v1 + v2*v2); │ │ │ │ │ + 400 } │ │ │ │ │ + 401 else if( n >= m ) │ │ │ │ │ + 402 { │ │ │ │ │ + 403 // General case │ │ │ │ │ + 404 FieldMatrix< ctype, m, m > aat; │ │ │ │ │ + 405 AAT_L( A, aat ); │ │ │ │ │ + 406 return spdDetA( aat ); │ │ │ │ │ + 407 } │ │ │ │ │ + 408 else │ │ │ │ │ + 409 return ctype( 0 ); │ │ │ │ │ + 410 } │ │ │ │ │ + 411 │ │ │ │ │ + 412 // A^{-1}_L = (A^T A)^{-1} A^T │ │ │ │ │ + 413 // => A^{-1}_L A = I │ │ │ │ │ + 414 template< int m, int n > │ │ │ │ │ + 415 static ctype leftInvA ( const FieldMatrix< ctype, m, n > &A, FieldMatrix< │ │ │ │ │ +ctype, n, m > &ret ) │ │ │ │ │ + 416 { │ │ │ │ │ + 417 static_assert((m >= n), "Matrix has no left inverse."); │ │ │ │ │ + 418 FieldMatrix< ctype, n, n > ata; │ │ │ │ │ + 419 ATA_L( A, ata ); │ │ │ │ │ + 420 const ctype det = spdInvA( ata ); │ │ │ │ │ + 421 ATBT( ata, A, ret ); │ │ │ │ │ + 422 return det; │ │ │ │ │ + 423 } │ │ │ │ │ + 424 │ │ │ │ │ + 425 template< int m, int n > │ │ │ │ │ + 426 static void leftInvAx ( const FieldMatrix< ctype, m, n > &A, const │ │ │ │ │ +FieldVector< ctype, m > &x, FieldVector< ctype, n > &y ) │ │ │ │ │ + 427 { │ │ │ │ │ + 428 static_assert((m >= n), "Matrix has no left inverse."); │ │ │ │ │ + 429 FieldMatrix< ctype, n, n > ata; │ │ │ │ │ + 430 ATx( A, x, y ); │ │ │ │ │ + 431 ATA_L( A, ata ); │ │ │ │ │ + 432 spdInvAx( ata, y ); │ │ │ │ │ + 433 } │ │ │ │ │ + 434 │ │ │ │ │ + 436 template< int m, int n > │ │ │ │ │ + 437 static ctype rightInvA ( const FieldMatrix< ctype, m, n > &A, FieldMatrix< │ │ │ │ │ +ctype, n, m > &ret ) │ │ │ │ │ + 438 { │ │ │ │ │ + 439 static_assert((n >= m), "Matrix has no right inverse."); │ │ │ │ │ + 440 using std::abs; │ │ │ │ │ + 441 if( (n == 2) && (m == 2) ) │ │ │ │ │ + 442 { │ │ │ │ │ + 443 const ctype det = (A[ 0 ][ 0 ]*A[ 1 ][ 1 ] - A[ 1 ][ 0 ]*A[ 0 ][ 1 ]); │ │ │ │ │ + 444 const ctype detInv = ctype( 1 ) / det; │ │ │ │ │ + 445 ret[ 0 ][ 0 ] = A[ 1 ][ 1 ] * detInv; │ │ │ │ │ + 446 ret[ 1 ][ 1 ] = A[ 0 ][ 0 ] * detInv; │ │ │ │ │ + 447 ret[ 1 ][ 0 ] = -A[ 1 ][ 0 ] * detInv; │ │ │ │ │ + 448 ret[ 0 ][ 1 ] = -A[ 0 ][ 1 ] * detInv; │ │ │ │ │ + 449 return abs( det ); │ │ │ │ │ + 450 } │ │ │ │ │ + 451 else │ │ │ │ │ + 452 { │ │ │ │ │ + 453 FieldMatrix< ctype, m , m > aat; │ │ │ │ │ + 454 AAT_L( A, aat ); │ │ │ │ │ + 455 const ctype det = spdInvA( aat ); │ │ │ │ │ + 456 ATBT( A , aat , ret ); │ │ │ │ │ + 457 return det; │ │ │ │ │ + 458 } │ │ │ │ │ + 459 } │ │ │ │ │ + 460 │ │ │ │ │ + 461 template< int m, int n > │ │ │ │ │ + 462 static bool xTRightInvA ( const FieldMatrix< ctype, m, n > &A, const │ │ │ │ │ +FieldVector< ctype, n > &x, FieldVector< ctype, m > &y ) │ │ │ │ │ + 463 { │ │ │ │ │ + 464 static_assert((n >= m), "Matrix has no right inverse."); │ │ │ │ │ + 465 FieldMatrix< ctype, m, m > aat; │ │ │ │ │ + 466 Ax( A, x, y ); │ │ │ │ │ + 467 AAT_L( A, aat ); │ │ │ │ │ + 468 // check whether aat is singular and return true if non-singular │ │ │ │ │ + 469 return spdInvAx( aat, y, true ); │ │ │ │ │ + 470 } │ │ │ │ │ + 471 }; │ │ │ │ │ + 472 │ │ │ │ │ + 473 } // namespace Impl │ │ │ │ │ + 474 │ │ │ │ │ + 475 │ │ │ │ │ + 476 │ │ │ │ │ + 482 template< class ct, int mydim, int cdim> │ │ │ │ │ +483 class AffineGeometry │ │ │ │ │ + 484 { │ │ │ │ │ + 485 public: │ │ │ │ │ + 486 │ │ │ │ │ +488 typedef ct ctype; │ │ │ │ │ + 489 │ │ │ │ │ +491 static const int mydimension= mydim; │ │ │ │ │ + 492 │ │ │ │ │ +494 static const int coorddimension = cdim; │ │ │ │ │ + 495 │ │ │ │ │ +497 typedef FieldVector< ctype, mydimension > LocalCoordinate; │ │ │ │ │ + 498 │ │ │ │ │ +500 typedef FieldVector< ctype, coorddimension > GlobalCoordinate; │ │ │ │ │ + 501 │ │ │ │ │ +503 typedef ctype Volume; │ │ │ │ │ + 504 │ │ │ │ │ +506 typedef FieldMatrix< ctype, mydimension, coorddimension > │ │ │ │ │ +JacobianTransposed; │ │ │ │ │ + 507 │ │ │ │ │ +509 typedef FieldMatrix< ctype, coorddimension, mydimension > │ │ │ │ │ +JacobianInverseTransposed; │ │ │ │ │ + 510 │ │ │ │ │ +512 typedef FieldMatrix< ctype, coorddimension, mydimension > Jacobian; │ │ │ │ │ + 513 │ │ │ │ │ +515 typedef FieldMatrix< ctype, mydimension, coorddimension > JacobianInverse; │ │ │ │ │ + 516 │ │ │ │ │ + 517 private: │ │ │ │ │ + 519 typedef Geo::ReferenceElement<_Geo::ReferenceElementImplementation<_ctype, │ │ │ │ │ +mydimension_> > ReferenceElement; │ │ │ │ │ + 520 │ │ │ │ │ + 521 typedef Geo::ReferenceElements<_ctype,_mydimension_> ReferenceElements; │ │ │ │ │ + 522 │ │ │ │ │ + 523 // Helper class to compute a matrix pseudo inverse │ │ │ │ │ + 524 typedef Impl::FieldMatrixHelper< ct > MatrixHelper; │ │ │ │ │ + 525 │ │ │ │ │ + 526 public: │ │ │ │ │ +528 AffineGeometry ( const ReferenceElement &refElement, const GlobalCoordinate │ │ │ │ │ +&origin, │ │ │ │ │ + 529 const JacobianTransposed &jt ) │ │ │ │ │ + 530 : refElement_(refElement), origin_(origin), jacobianTransposed_(jt) │ │ │ │ │ + 531 { │ │ │ │ │ + 532 integrationElement_ = MatrixHelper::template rightInvA< mydimension, │ │ │ │ │ +coorddimension >( jacobianTransposed_, jacobianInverseTransposed_ ); │ │ │ │ │ + 533 } │ │ │ │ │ + 534 │ │ │ │ │ +536 AffineGeometry ( Dune::GeometryType gt, const GlobalCoordinate &origin, │ │ │ │ │ + 537 const JacobianTransposed &jt ) │ │ │ │ │ + 538 : AffineGeometry(ReferenceElements::general( gt ), origin, jt) │ │ │ │ │ + 539 { } │ │ │ │ │ + 540 │ │ │ │ │ + 542 template< class CoordVector > │ │ │ │ │ +543 AffineGeometry ( const ReferenceElement &refElement, const CoordVector │ │ │ │ │ +&coordVector ) │ │ │ │ │ + 544 : refElement_(refElement), origin_(coordVector[0]) │ │ │ │ │ + 545 { │ │ │ │ │ + 546 for( int i = 0; i < mydimension; ++i ) │ │ │ │ │ + 547 jacobianTransposed_[ i ] = coordVector[ i+1 ] - origin_; │ │ │ │ │ + 548 integrationElement_ = MatrixHelper::template rightInvA< mydimension, │ │ │ │ │ +coorddimension >( jacobianTransposed_, jacobianInverseTransposed_ ); │ │ │ │ │ + 549 } │ │ │ │ │ + 550 │ │ │ │ │ + 552 template< class CoordVector > │ │ │ │ │ +553 AffineGeometry ( Dune::GeometryType gt, const CoordVector &coordVector ) │ │ │ │ │ + 554 : AffineGeometry(ReferenceElements::general( gt ), coordVector) │ │ │ │ │ + 555 { } │ │ │ │ │ + 556 │ │ │ │ │ +558 bool affine () const { return true; } │ │ │ │ │ + 559 │ │ │ │ │ +561 Dune::GeometryType type () const { return refElement_.type(); } │ │ │ │ │ + 562 │ │ │ │ │ +564 int corners () const { return refElement_.size( mydimension ); } │ │ │ │ │ + 565 │ │ │ │ │ +567 GlobalCoordinate corner ( int i ) const │ │ │ │ │ + 568 { │ │ │ │ │ + 569 return global( refElement_.position( i, mydimension ) ); │ │ │ │ │ + 570 } │ │ │ │ │ + 571 │ │ │ │ │ +573 GlobalCoordinate center () const { return global( refElement_.position( 0, │ │ │ │ │ +0 ) ); } │ │ │ │ │ + 574 │ │ │ │ │ +581 GlobalCoordinate global ( const LocalCoordinate &local ) const │ │ │ │ │ + 582 { │ │ │ │ │ + 583 GlobalCoordinate global( origin_ ); │ │ │ │ │ + 584 jacobianTransposed_.umtv( local, global ); │ │ │ │ │ + 585 return global; │ │ │ │ │ + 586 } │ │ │ │ │ + 587 │ │ │ │ │ +601 LocalCoordinate local ( const GlobalCoordinate &global ) const │ │ │ │ │ + 602 { │ │ │ │ │ + 603 LocalCoordinate local; │ │ │ │ │ + 604 jacobianInverseTransposed_.mtv( global - origin_, local ); │ │ │ │ │ + 605 return local; │ │ │ │ │ + 606 } │ │ │ │ │ + 607 │ │ │ │ │ +618 ctype integrationElement ([[maybe_unused]] const LocalCoordinate &local) │ │ │ │ │ +const │ │ │ │ │ + 619 { │ │ │ │ │ + 620 return integrationElement_; │ │ │ │ │ + 621 } │ │ │ │ │ + 622 │ │ │ │ │ +624 Volume volume () const │ │ │ │ │ + 625 { │ │ │ │ │ + 626 return integrationElement_ * refElement_.volume(); │ │ │ │ │ + 627 } │ │ │ │ │ + 628 │ │ │ │ │ +635 const JacobianTransposed &jacobianTransposed ([[maybe_unused]] const │ │ │ │ │ +LocalCoordinate &local) const │ │ │ │ │ + 636 { │ │ │ │ │ + 637 return jacobianTransposed_; │ │ │ │ │ + 638 } │ │ │ │ │ + 639 │ │ │ │ │ +646 const JacobianInverseTransposed &jacobianInverseTransposed ([ │ │ │ │ │ +[maybe_unused]] const LocalCoordinate &local) const │ │ │ │ │ + 647 { │ │ │ │ │ + 648 return jacobianInverseTransposed_; │ │ │ │ │ + 649 } │ │ │ │ │ + 650 │ │ │ │ │ +657 Jacobian jacobian ([[maybe_unused]] const LocalCoordinate &local) const │ │ │ │ │ + 658 { │ │ │ │ │ + 659 return jacobianTransposed_.transposed(); │ │ │ │ │ + 660 } │ │ │ │ │ + 661 │ │ │ │ │ +668 JacobianInverse jacobianInverse ([[maybe_unused]] const LocalCoordinate │ │ │ │ │ +&local) const │ │ │ │ │ + 669 { │ │ │ │ │ + 670 return jacobianInverseTransposed_.transposed(); │ │ │ │ │ + 671 } │ │ │ │ │ + 672 │ │ │ │ │ +673 friend ReferenceElement referenceElement ( const AffineGeometry &geometry ) │ │ │ │ │ + 674 { │ │ │ │ │ + 675 return geometry.refElement_; │ │ │ │ │ + 676 } │ │ │ │ │ + 677 │ │ │ │ │ + 678 private: │ │ │ │ │ + 679 ReferenceElement refElement_; │ │ │ │ │ + 680 GlobalCoordinate origin_; │ │ │ │ │ + 681 JacobianTransposed jacobianTransposed_; │ │ │ │ │ + 682 JacobianInverseTransposed jacobianInverseTransposed_; │ │ │ │ │ + 683 ctype integrationElement_; │ │ │ │ │ + 684 }; │ │ │ │ │ + 685 │ │ │ │ │ + 686} // namespace Dune │ │ │ │ │ + 687 │ │ │ │ │ + 688#endif // #ifndef DUNE_GEOMETRY_AFFINEGEOMETRY_HH │ │ │ │ │ type.hh │ │ │ │ │ A unique label for each type of element that can occur in a grid. │ │ │ │ │ +Dune::ReferenceElement │ │ │ │ │ +unspecified-type ReferenceElement │ │ │ │ │ +Returns the type of reference element for the argument type T. │ │ │ │ │ +Definition referenceelements.hh:497 │ │ │ │ │ Dune │ │ │ │ │ Definition affinegeometry.hh:21 │ │ │ │ │ -Dune::TopologyFactory │ │ │ │ │ -Provide a factory over the generic topologies. │ │ │ │ │ -Definition topologyfactory.hh:42 │ │ │ │ │ -Dune::TopologyFactory::Factory │ │ │ │ │ -Traits::Factory Factory │ │ │ │ │ -Definition topologyfactory.hh:47 │ │ │ │ │ -Dune::TopologyFactory::create │ │ │ │ │ -static Object * create(const Dune::GeometryType >, const Key &key) │ │ │ │ │ -dynamically create objects │ │ │ │ │ -Definition topologyfactory.hh:50 │ │ │ │ │ -Dune::TopologyFactory::dimension │ │ │ │ │ -static const unsigned int dimension │ │ │ │ │ -Definition topologyfactory.hh:44 │ │ │ │ │ -Dune::TopologyFactory::create │ │ │ │ │ -static Object * create(const Key &key) │ │ │ │ │ -statically create objects │ │ │ │ │ -Definition topologyfactory.hh:58 │ │ │ │ │ -Dune::TopologyFactory::release │ │ │ │ │ -static void release(Object *object) │ │ │ │ │ -release the object returned by the create methods │ │ │ │ │ -Definition topologyfactory.hh:71 │ │ │ │ │ -Dune::TopologyFactory::Key │ │ │ │ │ -Traits::Key Key │ │ │ │ │ -Definition topologyfactory.hh:45 │ │ │ │ │ -Dune::TopologyFactory::Object │ │ │ │ │ -Traits::Object Object │ │ │ │ │ -Definition topologyfactory.hh:46 │ │ │ │ │ -Dune::TopologySingletonFactory │ │ │ │ │ -A wrapper for a TopologyFactory providing singleton storage. Same usage as │ │ │ │ │ -TopologyFactory but with e... │ │ │ │ │ -Definition topologyfactory.hh:82 │ │ │ │ │ -Dune::TopologySingletonFactory::create │ │ │ │ │ -static auto create(const Key &key) -> std::enable_if_t< Topology:: │ │ │ │ │ -dimension==dimension, Object * > │ │ │ │ │ -Definition topologyfactory.hh:103 │ │ │ │ │ -Dune::TopologySingletonFactory::create │ │ │ │ │ -static Object * create(const Dune::GeometryType >, const Key &key) │ │ │ │ │ -Definition topologyfactory.hh:88 │ │ │ │ │ -Dune::TopologySingletonFactory::release │ │ │ │ │ -static void release(Object *object) │ │ │ │ │ -release the object returned by the create methods │ │ │ │ │ -Definition topologyfactory.hh:110 │ │ │ │ │ -Dune::TopologySingletonFactory::Object │ │ │ │ │ -const Factory::Object Object │ │ │ │ │ -Definition topologyfactory.hh:85 │ │ │ │ │ -Dune::TopologySingletonFactory::Key │ │ │ │ │ -Factory::Key Key │ │ │ │ │ -Definition topologyfactory.hh:84 │ │ │ │ │ -Dune::TopologySingletonFactory::create │ │ │ │ │ -static auto create(const Key &key) -> std::enable_if_t< static_cast< │ │ │ │ │ -GeometryType >(geometryId).dim()==dimension, Object * > │ │ │ │ │ -Definition topologyfactory.hh:95 │ │ │ │ │ -Dune::TopologySingletonFactory::dimension │ │ │ │ │ -static const unsigned int dimension │ │ │ │ │ -Definition topologyfactory.hh:83 │ │ │ │ │ +Dune::Geo::ReferenceElement │ │ │ │ │ +This class provides access to geometric and topological properties of a │ │ │ │ │ +reference element. │ │ │ │ │ +Definition referenceelement.hh:52 │ │ │ │ │ +Dune::Geo::ReferenceElement::volume │ │ │ │ │ +CoordinateField volume() const │ │ │ │ │ +obtain the volume of the reference element │ │ │ │ │ +Definition referenceelement.hh:241 │ │ │ │ │ +Dune::Geo::ReferenceElement::type │ │ │ │ │ +decltype(auto) type(int i, int c) const │ │ │ │ │ +obtain the type of subentity (i,c) │ │ │ │ │ +Definition referenceelement.hh:171 │ │ │ │ │ +Dune::Geo::ReferenceElement::size │ │ │ │ │ +int size(int c) const │ │ │ │ │ +number of subentities of codimension c │ │ │ │ │ +Definition referenceelement.hh:94 │ │ │ │ │ +Dune::Geo::ReferenceElement::position │ │ │ │ │ +decltype(auto) position(int i, int c) const │ │ │ │ │ +position of the barycenter of entity (i,c) │ │ │ │ │ +Definition referenceelement.hh:203 │ │ │ │ │ +Dune::Geo::ReferenceElementImplementation │ │ │ │ │ +Definition affinegeometry.hh:33 │ │ │ │ │ +Dune::Geo::ReferenceElements │ │ │ │ │ +Class providing access to the singletons of the reference elements. │ │ │ │ │ +Definition referenceelements.hh:170 │ │ │ │ │ +Dune::AffineGeometry │ │ │ │ │ +Implementation of the Geometry interface for affine geometries. │ │ │ │ │ +Definition affinegeometry.hh:484 │ │ │ │ │ +Dune::AffineGeometry::AffineGeometry │ │ │ │ │ +AffineGeometry(const ReferenceElement &refElement, const CoordVector │ │ │ │ │ +&coordVector) │ │ │ │ │ +Create affine geometry from reference element and a vector of vertex │ │ │ │ │ +coordinates. │ │ │ │ │ +Definition affinegeometry.hh:543 │ │ │ │ │ +Dune::AffineGeometry::AffineGeometry │ │ │ │ │ +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 │ │ │ │ │ +Dune::AffineGeometry::LocalCoordinate │ │ │ │ │ +FieldVector< ctype, mydimension > LocalCoordinate │ │ │ │ │ +Type for local coordinate vector. │ │ │ │ │ +Definition affinegeometry.hh:497 │ │ │ │ │ +Dune::AffineGeometry::type │ │ │ │ │ +Dune::GeometryType type() const │ │ │ │ │ +Obtain the type of the reference element. │ │ │ │ │ +Definition affinegeometry.hh:561 │ │ │ │ │ +Dune::AffineGeometry::mydimension │ │ │ │ │ +static const int mydimension │ │ │ │ │ +Dimension of the geometry. │ │ │ │ │ +Definition affinegeometry.hh:491 │ │ │ │ │ +Dune::AffineGeometry::AffineGeometry │ │ │ │ │ +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 │ │ │ │ │ +Dune::AffineGeometry::Volume │ │ │ │ │ +ctype Volume │ │ │ │ │ +Type used for volume. │ │ │ │ │ +Definition affinegeometry.hh:503 │ │ │ │ │ +Dune::AffineGeometry::jacobianInverse │ │ │ │ │ +JacobianInverse jacobianInverse(const LocalCoordinate &local) const │ │ │ │ │ +Obtain the Jacobian's inverse. │ │ │ │ │ +Definition affinegeometry.hh:668 │ │ │ │ │ +Dune::AffineGeometry::referenceElement │ │ │ │ │ +friend ReferenceElement referenceElement(const AffineGeometry &geometry) │ │ │ │ │ +Definition affinegeometry.hh:673 │ │ │ │ │ +Dune::AffineGeometry::AffineGeometry │ │ │ │ │ +AffineGeometry(Dune::GeometryType gt, const CoordVector &coordVector) │ │ │ │ │ +Create affine geometry from GeometryType and a vector of vertex coordinates. │ │ │ │ │ +Definition affinegeometry.hh:553 │ │ │ │ │ +Dune::AffineGeometry::integrationElement │ │ │ │ │ +ctype integrationElement(const LocalCoordinate &local) const │ │ │ │ │ +Obtain the integration element. │ │ │ │ │ +Definition affinegeometry.hh:618 │ │ │ │ │ +Dune::AffineGeometry::JacobianInverse │ │ │ │ │ +FieldMatrix< ctype, mydimension, coorddimension > JacobianInverse │ │ │ │ │ +Type for the inverse Jacobian matrix. │ │ │ │ │ +Definition affinegeometry.hh:515 │ │ │ │ │ +Dune::AffineGeometry::Jacobian │ │ │ │ │ +FieldMatrix< ctype, coorddimension, mydimension > Jacobian │ │ │ │ │ +Type for the Jacobian matrix. │ │ │ │ │ +Definition affinegeometry.hh:512 │ │ │ │ │ +Dune::AffineGeometry::jacobianInverseTransposed │ │ │ │ │ +const JacobianInverseTransposed & jacobianInverseTransposed(const │ │ │ │ │ +LocalCoordinate &local) const │ │ │ │ │ +Obtain the transposed of the Jacobian's inverse. │ │ │ │ │ +Definition affinegeometry.hh:646 │ │ │ │ │ +Dune::AffineGeometry::JacobianTransposed │ │ │ │ │ +FieldMatrix< ctype, mydimension, coorddimension > JacobianTransposed │ │ │ │ │ +Type for the transposed Jacobian matrix. │ │ │ │ │ +Definition affinegeometry.hh:506 │ │ │ │ │ +Dune::AffineGeometry::corner │ │ │ │ │ +GlobalCoordinate corner(int i) const │ │ │ │ │ +Obtain coordinates of the i-th corner. │ │ │ │ │ +Definition affinegeometry.hh:567 │ │ │ │ │ +Dune::AffineGeometry::corners │ │ │ │ │ +int corners() const │ │ │ │ │ +Obtain number of corners of the corresponding reference element. │ │ │ │ │ +Definition affinegeometry.hh:564 │ │ │ │ │ +Dune::AffineGeometry::local │ │ │ │ │ +LocalCoordinate local(const GlobalCoordinate &global) const │ │ │ │ │ +Evaluate the inverse mapping. │ │ │ │ │ +Definition affinegeometry.hh:601 │ │ │ │ │ +Dune::AffineGeometry::JacobianInverseTransposed │ │ │ │ │ +FieldMatrix< ctype, coorddimension, mydimension > JacobianInverseTransposed │ │ │ │ │ +Type for the transposed inverse Jacobian matrix. │ │ │ │ │ +Definition affinegeometry.hh:509 │ │ │ │ │ +Dune::AffineGeometry::coorddimension │ │ │ │ │ +static const int coorddimension │ │ │ │ │ +Dimension of the world space. │ │ │ │ │ +Definition affinegeometry.hh:494 │ │ │ │ │ +Dune::AffineGeometry::global │ │ │ │ │ +GlobalCoordinate global(const LocalCoordinate &local) const │ │ │ │ │ +Evaluate the mapping. │ │ │ │ │ +Definition affinegeometry.hh:581 │ │ │ │ │ +Dune::AffineGeometry::center │ │ │ │ │ +GlobalCoordinate center() const │ │ │ │ │ +Obtain the centroid of the mapping's image. │ │ │ │ │ +Definition affinegeometry.hh:573 │ │ │ │ │ +Dune::AffineGeometry::jacobian │ │ │ │ │ +Jacobian jacobian(const LocalCoordinate &local) const │ │ │ │ │ +Obtain the Jacobian. │ │ │ │ │ +Definition affinegeometry.hh:657 │ │ │ │ │ +Dune::AffineGeometry::ctype │ │ │ │ │ +ct ctype │ │ │ │ │ +Type used for coordinates. │ │ │ │ │ +Definition affinegeometry.hh:488 │ │ │ │ │ +Dune::AffineGeometry::GlobalCoordinate │ │ │ │ │ +FieldVector< ctype, coorddimension > GlobalCoordinate │ │ │ │ │ +Type for coordinate vector in world space. │ │ │ │ │ +Definition affinegeometry.hh:500 │ │ │ │ │ +Dune::AffineGeometry::affine │ │ │ │ │ +bool affine() const │ │ │ │ │ +Always true: this is an affine geometry. │ │ │ │ │ +Definition affinegeometry.hh:558 │ │ │ │ │ +Dune::AffineGeometry::jacobianTransposed │ │ │ │ │ +const JacobianTransposed & jacobianTransposed(const LocalCoordinate &local) │ │ │ │ │ +const │ │ │ │ │ +Obtain the transposed of the Jacobian. │ │ │ │ │ +Definition affinegeometry.hh:635 │ │ │ │ │ +Dune::AffineGeometry::volume │ │ │ │ │ +Volume volume() const │ │ │ │ │ +Obtain the volume of the element. │ │ │ │ │ +Definition affinegeometry.hh:624 │ │ │ │ │ Dune::GeometryType │ │ │ │ │ Unique label for each type of entities that can occur in DUNE grids. │ │ │ │ │ Definition type.hh:126 │ │ │ │ │ -Dune::GeometryType::id │ │ │ │ │ -constexpr unsigned int id() const │ │ │ │ │ -Return the topology id of the type. │ │ │ │ │ -Definition type.hh:377 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.8 │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00251.html │ │ │ │ @@ -204,15 +204,15 @@ │ │ │ │
GeometryTypes::cube(2), 2>
│ │ │ │
{
│ │ │ │
typedef SquaringTheCircle::RefinementImp<CoordType> Imp;
│ │ │ │
};
│ │ │ │
}
│ │ │ │
This namespace contains the implementation of Refinement.
Definition base.cc:29
│ │ │ │ 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. │ │ │ │ -
  • #include "refinement/squaringthecircle.cc" from refinement.hh.
  • │ │ │ │ +
  • #include "refinement/squaringthecircle.cc" from refinement.hh.
  • │ │ │ │ │ │ │ │

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

    │ │ │ │

    │ │ │ │ Namespaces

    │ │ │ │

    Function Documentation

    │ │ │ │ │ │ │ │

    ◆ refinementIntervals()

    │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a00254.html │ │ │ │ @@ -397,16 +397,16 @@ │ │ │ │ ) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │

    Algorithm to reduce vertex order information.

    │ │ │ │ -
    │ │ │ │ - │ │ │ │ +
    │ │ │ │ + │ │ │ │
    Parameters
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    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.
    │ │ │ │
    │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01083.html │ │ │ │ @@ -82,15 +82,15 @@ │ │ │ │
    Dune::Geo::ReferenceElement< Implementation > Class Template Reference
    │ │ │ │
    │ │ │ │
    │ │ │ │ │ │ │ │

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

    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/referenceelement.hh>

    │ │ │ │ +

    #include <dune/geometry/referenceelement.hh>

    │ │ │ │
    │ │ │ │ Inheritance diagram for Dune::Geo::ReferenceElement< Implementation >:
    │ │ │ │
    │ │ │ │
    Inheritance graph
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -887,16 +887,16 @@ │ │ │ │
    │ │ │ │ │ │ │ │

    The dimension of the reference element.

    │ │ │ │ │ │ │ │
    │ │ │ │
    │ │ │ │
    The documentation for this class was generated from the following files: │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01087.html │ │ │ │ @@ -83,15 +83,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01091.html │ │ │ │ @@ -81,15 +81,15 @@ │ │ │ │
    Dune::Geo::ReferenceElements< ctype_, dim > Struct Template Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │

    Class providing access to the singletons of the reference elements. │ │ │ │ More...

    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/referenceelements.hh>

    │ │ │ │ +

    #include <dune/geometry/referenceelements.hh>

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -389,16 +389,16 @@ │ │ │ │
    │ │ │ │ │ │ │ │

    The dimension of the contained reference elements.

    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this struct was generated from the following files: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01099.html │ │ │ │ @@ -81,15 +81,15 @@ │ │ │ │
    Dune::AffineGeometry< ct, mydim, cdim > Class Template Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │

    Implementation of the Geometry interface for affine geometries. │ │ │ │ More...

    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/affinegeometry.hh>

    │ │ │ │ +

    #include <dune/geometry/affinegeometry.hh>

    │ │ │ │

    │ │ │ │ Public Types

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

    Dimension of the geometry.

    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01103.html │ │ │ │ @@ -81,15 +81,15 @@ │ │ │ │
    Dune::AxisAlignedCubeGeometry< CoordType, dim, coorddim > Class Template Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │

    A geometry implementation for axis-aligned hypercubes. │ │ │ │ More...

    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/axisalignedcubegeometry.hh>

    │ │ │ │ +

    #include <dune/geometry/axisalignedcubegeometry.hh>

    │ │ │ │

    │ │ │ │ Public Types

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

    Dimension of the cube element.

    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01159.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
    Dune::Dim< dim > Struct Template Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │

    Static tag representing a dimension. │ │ │ │ More...

    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/dimension.hh>

    │ │ │ │ +

    #include <dune/geometry/dimension.hh>

    │ │ │ │
    │ │ │ │ Inheritance diagram for Dune::Dim< dim >:
    │ │ │ │
    │ │ │ │
    Inheritance graph
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -117,15 +117,15 @@ │ │ │ │ │ │ │ │

    │ │ │ │ Public Types

    typedef CoordType ctype
     Type used for single coordinate coefficients.
     
    typedef FieldVector< ctype, dim > LocalCoordinate
    │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01163.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
    Dune::Codim< codim > Struct Template Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │

    Static tag representing a codimension. │ │ │ │ More...

    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/dimension.hh>

    │ │ │ │ +

    #include <dune/geometry/dimension.hh>

    │ │ │ │
    │ │ │ │ Inheritance diagram for Dune::Codim< codim >:
    │ │ │ │
    │ │ │ │
    Inheritance graph
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -123,15 +123,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │
    │ │ │ │
    The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01167.html │ │ │ │ @@ -82,15 +82,15 @@ │ │ │ │
    Dune::GeneralVertexOrder< dim, Index_ > Class Template Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │

    Class providing information on the ordering of vertices. │ │ │ │ More...

    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/generalvertexorder.hh>

    │ │ │ │ +

    #include <dune/geometry/generalvertexorder.hh>

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

    │ │ │ │ Classes

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

    export the dimension of the entity we provide information for

    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01171.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
    Dune::GeneralVertexOrder< dim, Index_ >::iterator Class Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │

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

    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/generalvertexorder.hh>

    │ │ │ │ +

    #include <dune/geometry/generalvertexorder.hh>

    │ │ │ │
    │ │ │ │ Inheritance diagram for Dune::GeneralVertexOrder< dim, Index_ >::iterator:
    │ │ │ │
    │ │ │ │
    Inheritance graph
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -341,15 +341,15 @@ │ │ │ │ │ │ │ │
    │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01175.html │ │ │ │ @@ -81,15 +81,15 @@ │ │ │ │
    Dune::MultiLinearGeometryTraits< ct > Struct Template Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │

    default traits class for MultiLinearGeometry │ │ │ │ More...

    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/multilineargeometry.hh>

    │ │ │ │ +

    #include <dune/geometry/multilineargeometry.hh>

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -176,15 +176,15 @@ │ │ │ │
    │ │ │ │ │ │ │ │

    tolerance to numerical algorithms

    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01179.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
    Dune::MultiLinearGeometryTraits< ct >::CornerStorage< mydim, cdim > Struct Template Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │

    template specifying the storage for the corners │ │ │ │ More...

    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/multilineargeometry.hh>

    │ │ │ │ +

    #include <dune/geometry/multilineargeometry.hh>

    │ │ │ │

    │ │ │ │ Classes

    struct  CornerStorage
     template specifying the storage for the corners More...
     
    struct  hasSingleGeometryType
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

    │ │ │ │ Public Types

    typedef std::vector< FieldVector< ct, cdim > > Type
     
    │ │ │ │

    Detailed Description

    │ │ │ │ @@ -143,15 +143,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01183.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
    Dune::MultiLinearGeometryTraits< ct >::hasSingleGeometryType< dim > Struct Template Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │

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

    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/multilineargeometry.hh>

    │ │ │ │ +

    #include <dune/geometry/multilineargeometry.hh>

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -149,15 +149,15 @@ │ │ │ │ │ │ │ │

    │ │ │ │ Static Public Attributes

    static const bool v = false
     
    static const unsigned int topologyId = ~0u
     
    │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01187.html │ │ │ │ @@ -85,15 +85,15 @@ │ │ │ │
    Dune::MultiLinearGeometry< ct, mydim, cdim, Traits > Class Template Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │

    generic geometry implementation based on corner coordinates │ │ │ │ More...

    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/multilineargeometry.hh>

    │ │ │ │ +

    #include <dune/geometry/multilineargeometry.hh>

    │ │ │ │
    │ │ │ │ Inheritance diagram for Dune::MultiLinearGeometry< ct, mydim, cdim, Traits >:
    │ │ │ │
    │ │ │ │
    Inheritance graph
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -1521,15 +1521,15 @@ │ │ │ │
    │ │ │ │ │ │ │ │

    geometry dimension

    │ │ │ │ │ │ │ │
    │ │ │ │
    │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01191.html │ │ │ │ @@ -76,15 +76,15 @@ │ │ │ │
    │ │ │ │ Public Member Functions | │ │ │ │ List of all members
    │ │ │ │
    Dune::MultiLinearGeometry< ct, mydim, cdim, Traits >::JacobianInverseTransposed Class Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/multilineargeometry.hh>

    │ │ │ │ +

    #include <dune/geometry/multilineargeometry.hh>

    │ │ │ │
    │ │ │ │ Inheritance diagram for Dune::MultiLinearGeometry< ct, mydim, cdim, Traits >::JacobianInverseTransposed:
    │ │ │ │
    │ │ │ │
    Inheritance graph
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -211,15 +211,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │
    │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01195.html │ │ │ │ @@ -84,15 +84,15 @@ │ │ │ │
    Dune::CachedMultiLinearGeometry< ct, mydim, cdim, Traits > Class Template Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │

    Implement a MultiLinearGeometry with additional caching. │ │ │ │ More...

    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/multilineargeometry.hh>

    │ │ │ │ +

    #include <dune/geometry/multilineargeometry.hh>

    │ │ │ │
    │ │ │ │ Inheritance diagram for Dune::CachedMultiLinearGeometry< ct, mydim, cdim, Traits >:
    │ │ │ │
    │ │ │ │
    Inheritance graph
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -1479,15 +1479,15 @@ │ │ │ │
    │ │ │ │ │ │ │ │

    geometry dimension

    │ │ │ │ │ │ │ │
    │ │ │ │
    │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01199.html │ │ │ │ @@ -76,29 +76,29 @@ │ │ │ │
    Dune::QuadratureOrderOutOfRange Class Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │

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

    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/quadraturerules.hh>

    │ │ │ │ +

    #include <dune/geometry/quadraturerules.hh>

    │ │ │ │
    │ │ │ │ Inheritance diagram for Dune::QuadratureOrderOutOfRange:
    │ │ │ │
    │ │ │ │
    Inheritance graph
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │

    Detailed Description

    │ │ │ │

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

    │ │ │ │

    The documentation for this class was generated from the following file: │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01203.html │ │ │ │ @@ -82,15 +82,15 @@ │ │ │ │
    Dune::QuadraturePoint< ct, dim > Class Template Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │

    Single evaluation point in a quadrature rule. │ │ │ │ More...

    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/quadraturerules.hh>

    │ │ │ │ +

    #include <dune/geometry/quadraturerules.hh>

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -341,15 +341,15 @@ │ │ │ │ │ │ │ │

    │ │ │ │ Public Types

    typedef ct Field
     Number type used for coordinates and quadrature weights.
     
    typedef Dune::FieldVector< ct, dim > Vector
    │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01207.html │ │ │ │ @@ -84,15 +84,15 @@ │ │ │ │
    Dune::QuadratureRule< ct, dim > Class Template Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │

    Abstract base class for quadrature rules. │ │ │ │ More...

    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/quadraturerules.hh>

    │ │ │ │ +

    #include <dune/geometry/quadraturerules.hh>

    │ │ │ │
    │ │ │ │ Inheritance diagram for Dune::QuadratureRule< ct, dim >:
    │ │ │ │
    │ │ │ │
    Inheritance graph
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -474,15 +474,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │
    │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01211.html │ │ │ │ @@ -78,21 +78,21 @@ │ │ │ │
    Dune::QuadratureRuleFactory< ctype, dim > Class Template Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │

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

    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/quadraturerules.hh>

    │ │ │ │ +

    #include <dune/geometry/quadraturerules.hh>

    │ │ │ │

    Detailed Description

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

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

    │ │ │ │

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

    │ │ │ │

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

    A container for all quadrature rules of dimension dim │ │ │ │ More...

    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/quadraturerules.hh>

    │ │ │ │ +

    #include <dune/geometry/quadraturerules.hh>

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -230,15 +230,15 @@ │ │ │ │
    │ │ │ │ │ │ │ │

    select the appropriate QuadratureRule for GeometryType t and order p

    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01219.html │ │ │ │ @@ -75,17 +75,17 @@ │ │ │ │
    │ │ │ │
    │ │ │ │ List of all members
    │ │ │ │
    Dune::QuadratureRuleFactory< ctype, 0 > Class Template Reference
    │ │ │ │
    │ │ │ │
    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/quadraturerules.hh>

    │ │ │ │ +

    #include <dune/geometry/quadraturerules.hh>

    │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01223.html │ │ │ │ @@ -75,17 +75,17 @@ │ │ │ │
    │ │ │ │
    │ │ │ │ List of all members
    │ │ │ │
    Dune::QuadratureRuleFactory< ctype, 1 > Class Template Reference
    │ │ │ │
    │ │ │ │
    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/quadraturerules.hh>

    │ │ │ │ +

    #include <dune/geometry/quadraturerules.hh>

    │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01227.html │ │ │ │ @@ -75,17 +75,17 @@ │ │ │ │
    │ │ │ │
    │ │ │ │ List of all members
    │ │ │ │
    Dune::QuadratureRuleFactory< ctype, 2 > Class Template Reference
    │ │ │ │
    │ │ │ │
    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/quadraturerules.hh>

    │ │ │ │ +

    #include <dune/geometry/quadraturerules.hh>

    │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01231.html │ │ │ │ @@ -75,17 +75,17 @@ │ │ │ │
    │ │ │ │
    │ │ │ │ List of all members
    │ │ │ │
    Dune::QuadratureRuleFactory< ctype, 3 > Class Template Reference
    │ │ │ │
    │ │ │ │
    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/quadraturerules.hh>

    │ │ │ │ +

    #include <dune/geometry/quadraturerules.hh>

    │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01239.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
    Dune::Geo::ReferenceElement< Implementation >::Codim< codim > Struct Template Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │

    Collection of types depending on the codimension. │ │ │ │ More...

    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/referenceelement.hh>

    │ │ │ │ +

    #include <dune/geometry/referenceelement.hh>

    │ │ │ │

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

    │ │ │ │ Public Types

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

    type of geometry embedding a subentity into the reference element

    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01259.html │ │ │ │ @@ -412,15 +412,15 @@ │ │ │ │
    │ │ │ │ │ │ │ │

    Know your own dimension.

    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01263.html │ │ │ │ @@ -101,15 +101,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01267.html │ │ │ │ @@ -98,15 +98,15 @@ │ │ │ │ CoordTypeCoordinate type of the refined element │ │ │ │ codimensionCodimension of the iterator │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

    This is the base class for SubEntityIterators. We have to use this construct because RefinementImp<...>::codim<...> cannot be specialized without first specializing RefinementImp.

    │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01271.html │ │ │ │ @@ -161,15 +161,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01275.html │ │ │ │ @@ -200,15 +200,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01279.html │ │ │ │ @@ -265,15 +265,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01283.html │ │ │ │ @@ -83,15 +83,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01287.html │ │ │ │ @@ -395,15 +395,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01291.html │ │ │ │ @@ -101,15 +101,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01295.html │ │ │ │ @@ -452,15 +452,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01299.html │ │ │ │ @@ -513,15 +513,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01303.html │ │ │ │ @@ -196,15 +196,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01307.html │ │ │ │ @@ -83,15 +83,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01311.html │ │ │ │ @@ -402,15 +402,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01315.html │ │ │ │ @@ -101,15 +101,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01319.html │ │ │ │ @@ -452,15 +452,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01323.html │ │ │ │ @@ -491,15 +491,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01327.html │ │ │ │ @@ -196,15 +196,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01331.html │ │ │ │ @@ -83,15 +83,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01335.html │ │ │ │ @@ -402,15 +402,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01339.html │ │ │ │ @@ -101,15 +101,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01343.html │ │ │ │ @@ -452,15 +452,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01347.html │ │ │ │ @@ -491,15 +491,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01351.html │ │ │ │ @@ -196,15 +196,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01355.html │ │ │ │ @@ -395,15 +395,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01359.html │ │ │ │ @@ -101,15 +101,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01363.html │ │ │ │ @@ -83,15 +83,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01367.html │ │ │ │ @@ -384,15 +384,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01371.html │ │ │ │ @@ -503,15 +503,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01375.html │ │ │ │ @@ -152,15 +152,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01379.html │ │ │ │ @@ -81,15 +81,15 @@ │ │ │ │
    Dune::TopologyFactory< Traits > Struct Template Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │

    Provide a factory over the generic topologies. │ │ │ │ More...

    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/topologyfactory.hh>

    │ │ │ │ +

    #include <dune/geometry/topologyfactory.hh>

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -328,15 +328,15 @@ │ │ │ │ │ │ │ │

    │ │ │ │ Public Types

    typedef Traits::Key Key
     
    typedef Traits::Object Object
     
    │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01383.html │ │ │ │ @@ -82,15 +82,15 @@ │ │ │ │
    Dune::TopologySingletonFactory< Factory > Struct Template Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │

    A wrapper for a TopologyFactory providing singleton storage. Same usage as TopologyFactory but with empty release method an internal storage. │ │ │ │ More...

    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/topologyfactory.hh>

    │ │ │ │ +

    #include <dune/geometry/topologyfactory.hh>

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -309,15 +309,15 @@ │ │ │ │ │ │ │ │

    │ │ │ │ Public Types

    typedef Factory::Key Key
     
    typedef const Factory::Object Object
     
    │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01391.html │ │ │ │ @@ -80,15 +80,15 @@ │ │ │ │
    Dune::GeometryType Class Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │

    Unique label for each type of entities that can occur in DUNE grids. │ │ │ │ More...

    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/type.hh>

    │ │ │ │ +

    #include <dune/geometry/type.hh>

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

    │ │ │ │ Public Types

    enum  BasicType {
    │ │ │ │   simplex │ │ │ │ , cube │ │ │ │ , pyramid │ │ │ │ @@ -1059,15 +1059,15 @@ │ │ │ │

    Create an Id representation of this GeometryType.

    │ │ │ │

    The returned Id encapsulates the whole information of this GeometryType into an enum suitable for being used as template parameter. The GeometryType can be reconstructed from the Id using GeometryType{id}.

    │ │ │ │

    This function was mainly introduced to support older GCC versions (<10.2). There the implicit conversion from GeometryType to Id failed if a pure r-value template argument based on a static class member was used. (See dune/geometry/test/test-geometrytype-id.cc)

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01403.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
    Dune::LocalGeometryTypeIndex Class Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │

    Compute per-dimension indices for geometry types. │ │ │ │ More...

    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/typeindex.hh>

    │ │ │ │ +

    #include <dune/geometry/typeindex.hh>

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -193,15 +193,15 @@ │ │ │ │
    │ │ │ │ │ │ │ │

    compute the geometry type for the given local index and dimension

    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01407.html │ │ │ │ @@ -79,15 +79,15 @@ │ │ │ │
    Dune::GlobalGeometryTypeIndex Class Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │

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

    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/typeindex.hh>

    │ │ │ │ +

    #include <dune/geometry/typeindex.hh>

    │ │ │ │

    │ │ │ │ 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)
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -183,15 +183,15 @@ │ │ │ │ │ │ │ │

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

    │ │ │ │

    This includes irregular geometry types such as "None".

    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01411.html │ │ │ │ @@ -83,15 +83,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01415.html │ │ │ │ @@ -73,15 +73,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │
    Dune::VirtualRefinementSubEntityIteratorSpecial< dimension, CoordType, dimension > Class Template Reference
    │ │ │ │
    │ │ │ │
    │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01419.html │ │ │ │ @@ -161,15 +161,15 @@ │ │ │ │ │ │ │ │

    │ │ │ │ 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)
    │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01423.html │ │ │ │ @@ -367,15 +367,15 @@ │ │ │ │
    │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01427.html │ │ │ │ @@ -83,15 +83,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01431.html │ │ │ │ @@ -110,15 +110,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01435.html │ │ │ │ @@ -181,15 +181,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01439.html │ │ │ │ @@ -344,15 +344,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01443.html │ │ │ │ @@ -579,15 +579,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01447.html │ │ │ │ @@ -341,15 +341,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01451.html │ │ │ │ @@ -83,15 +83,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01455.html │ │ │ │ @@ -83,15 +83,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01459.html │ │ │ │ @@ -207,15 +207,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01463.html │ │ │ │ @@ -121,15 +121,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01467.html │ │ │ │ @@ -121,15 +121,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01471.html │ │ │ │ @@ -121,15 +121,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01475.html │ │ │ │ @@ -82,15 +82,15 @@ │ │ │ │
    Dune::VirtualRefinement< dimension, CoordType > Class Template Referenceabstract
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │

    VirtualRefinement base class. │ │ │ │ More...

    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/virtualrefinement.hh>

    │ │ │ │ +

    #include <dune/geometry/virtualrefinement.hh>

    │ │ │ │
    │ │ │ │ Inheritance diagram for Dune::VirtualRefinement< dimension, CoordType >:
    │ │ │ │
    │ │ │ │
    Inheritance graph
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -607,16 +607,16 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │
    │ │ │ │
    │ │ │ │
    The documentation for this class was generated from the following files: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/a01479.html │ │ │ │ @@ -76,21 +76,21 @@ │ │ │ │
    Dune::VirtualRefinement< dimension, CoordType >::Codim< codimension > Struct Template Reference
    │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │

    codim database of VirtualRefinement │ │ │ │ More...

    │ │ │ │ │ │ │ │ -

    #include <dune/geometry/virtualrefinement.hh>

    │ │ │ │ +

    #include <dune/geometry/virtualrefinement.hh>

    │ │ │ │

    Detailed Description

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

    codim database of VirtualRefinement

    │ │ │ │

    The documentation for this struct was generated from the following file: │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/dir_000004_000006.html │ │ │ │ @@ -69,14 +69,14 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ -

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

    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
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/dir_18620fa9f137864b479f21357cfac10d.html │ │ │ │ @@ -95,54 +95,54 @@ │ │ │ │  refinement │ │ │ │   │ │ │ │  utility │ │ │ │   │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

    │ │ │ │ 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
     topologyfactory.hh
     
     type.hh
     A unique label for each type of element that can occur in a grid.
     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.
     
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/dir_428ed1c935e77406fcbfdccd4ee3f7a2.html │ │ │ │ @@ -84,15 +84,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

    │ │ │ │ Files

     typefromvertexcount.hh
     typefromvertexcount.hh
     
    │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-geometry-doc/doxygen/dir_b609f53bbb5e26b8e9292001c59476a3.html │ │ │ │ @@ -87,26 +87,26 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

    │ │ │ │ Files

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