--- /srv/reproducible-results/rbuild-debian/r-b-build.yvOIOubo/b1/dune-grid-glue_2.9.0-3_i386.changes +++ /srv/reproducible-results/rbuild-debian/r-b-build.yvOIOubo/b2/dune-grid-glue_2.9.0-3_i386.changes ├── Files │ @@ -1,4 +1,4 @@ │ │ 8eb8933d43c65d6e39b4a0963f0d38ee 882488 debug optional libdune-grid-glue-dev-dbgsym_2.9.0-3_i386.deb │ 4914c3a299201ca850d147e763eecb2e 109232 libdevel optional libdune-grid-glue-dev_2.9.0-3_i386.deb │ - 7af0d6928c26806f52edb112ff65cf23 772948 doc optional libdune-grid-glue-doc_2.9.0-3_all.deb │ + 4422cb4ad50a2cf20423b708fe0c94e5 773008 doc optional libdune-grid-glue-doc_2.9.0-3_all.deb ├── libdune-grid-glue-doc_2.9.0-3_all.deb │ ├── file list │ │ @@ -1,3 +1,3 @@ │ │ -rw-r--r-- 0 0 0 4 2023-01-13 13:23:40.000000 debian-binary │ │ --rw-r--r-- 0 0 0 7220 2023-01-13 13:23:40.000000 control.tar.xz │ │ --rw-r--r-- 0 0 0 765536 2023-01-13 13:23:40.000000 data.tar.xz │ │ +-rw-r--r-- 0 0 0 7224 2023-01-13 13:23:40.000000 control.tar.xz │ │ +-rw-r--r-- 0 0 0 765592 2023-01-13 13:23:40.000000 data.tar.xz │ ├── control.tar.xz │ │ ├── control.tar │ │ │ ├── ./md5sums │ │ │ │ ├── ./md5sums │ │ │ │ │┄ Files differ │ │ │ │ ├── line order │ │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/changelog.Debian.gz │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/changelog.gz │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/copyright │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00002.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00002_source.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00005.html │ │ │ │ │ +usr/share/doc/libdune-grid-glue-doc/doxygen/a00005_source.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00008.html │ │ │ │ │ -usr/share/doc/libdune-grid-glue-doc/doxygen/a00008_source.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00011.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00011_source.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00014.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00014_source.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00017.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00017_source.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00020.html │ │ │ │ │ @@ -39,32 +39,32 @@ │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00056.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00056_source.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00059.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00059_source.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00062.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00062_source.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00065.html │ │ │ │ │ -usr/share/doc/libdune-grid-glue-doc/doxygen/a00065_source.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00068.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00068_source.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00071.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00071_source.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00074.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00077.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00077_source.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00080.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00083.html │ │ │ │ │ -usr/share/doc/libdune-grid-glue-doc/doxygen/a00083_source.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00086.html │ │ │ │ │ +usr/share/doc/libdune-grid-glue-doc/doxygen/a00086_source.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00089.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00089_source.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00092.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00095.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00095_source.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00098.html │ │ │ │ │ +usr/share/doc/libdune-grid-glue-doc/doxygen/a00098_source.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00101.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00103.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00104.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00105.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00106.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00107.html │ │ │ │ │ usr/share/doc/libdune-grid-glue-doc/doxygen/a00108.html │ ├── data.tar.xz │ │ ├── data.tar │ │ │ ├── file list │ │ │ │ @@ -5,72 +5,72 @@ │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/ │ │ │ │ -rw-r--r-- 0 root (0) root (0) 768 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/changelog.Debian.gz │ │ │ │ -rw-r--r-- 0 root (0) root (0) 1157 2022-12-23 06:52:03.000000 ./usr/share/doc/libdune-grid-glue-doc/changelog.gz │ │ │ │ -rw-r--r-- 0 root (0) root (0) 2569 2023-01-12 15:07:38.000000 ./usr/share/doc/libdune-grid-glue-doc/copyright │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/ │ │ │ │ -rw-r--r-- 0 root (0) root (0) 6934 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00002.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 80989 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00002_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5293 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00005.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5600 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00008.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 51914 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00008_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5982 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00005.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 13843 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00005_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5293 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00008.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 5124 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00011.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 16170 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00011_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 4890 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00014.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 16166 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00014_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7874 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00017.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 117804 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00017_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10399 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00020.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 68932 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00020_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5256 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00023.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 26879 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00023_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5982 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00026.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 13843 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00026_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7846 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00029.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 29152 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00029_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10978 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00032.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 40196 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00032_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5188 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00035.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8044 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00035_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7444 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00038.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 10647 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00038_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7874 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00014.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 117804 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00014_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10399 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00017.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 68932 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00017_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5600 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00020.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 51914 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00020_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 4890 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00023.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 16166 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00023_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5256 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00026.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 26879 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00026_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6298 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00029.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8760 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00029_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5782 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00032.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 27205 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00032_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7444 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00035.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10647 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00035_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7157 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00038.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 44297 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00038_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 7719 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00041.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 73289 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00041_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5782 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00044.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 27205 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00044_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 7157 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00047.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 44297 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00047_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6298 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00050.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8760 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00050_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 8009 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00053.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 94248 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00053_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 10978 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00044.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 40196 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00044_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5188 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00047.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8044 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00047_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 7846 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00050.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 29152 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00050_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5232 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00053.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 43609 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00053_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 5191 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00056.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 47646 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00056_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5232 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00059.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 43609 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00059_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 8009 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00059.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 94248 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00059_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 5365 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00062.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 70686 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00062_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5159 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00065.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 22438 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00065_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5882 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00068.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 58890 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00068_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6144 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00071.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 45120 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00071_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 9744 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00074.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11998 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00077.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 148477 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00077_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 9744 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00065.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5770 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00068.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 36815 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00068_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5725 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00071.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 18783 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00071_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 4284 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00074.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5159 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00077.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 22438 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00077_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 5168 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00080.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5725 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00083.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 18783 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00083_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 11104 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00086.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 6394 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00089.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 35781 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00089_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11104 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00083.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6394 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00086.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 35781 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00086_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 6144 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00089.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 45120 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00089_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 4035 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00092.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5770 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00095.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 36815 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00095_source.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 4284 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00098.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 11998 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00095.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 148477 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00095_source.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5882 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00098.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 58890 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00098_source.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 5689 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00101.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 4421 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00103.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 66344 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00104.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 5563 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00105.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 14779 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00106.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 13251 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00107.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 6137 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00108.html │ │ │ │ @@ -222,15 +222,15 @@ │ │ │ │ -rw-r--r-- 0 root (0) root (0) 2343 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_65f347cff0208f20f00d27c542208238_dep.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 6730 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_68eff8a27dcb1cd0ff0ecf490070d3de.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 13683 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_68eff8a27dcb1cd0ff0ecf490070d3de_dep.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 6242 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_eaad0bdad6fc03850e65b1fdad9faad4.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 7170 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_eaad0bdad6fc03850e65b1fdad9faad4_dep.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 746 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/doc.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 33676 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/doxygen.css │ │ │ │ --rw-r--r-- 0 root (0) root (0) 28666 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/dune-grid-glue.tag.gz │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 28668 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/dune-grid-glue.tag.gz │ │ │ │ -rw-r--r-- 0 root (0) root (0) 4452 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/dynsections.js │ │ │ │ -rw-r--r-- 0 root (0) root (0) 15406 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/files.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 616 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/folderclosed.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 597 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/folderopen.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 3051 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/functions.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 3616 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/functions_b.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 13286 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/functions_c.html │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00002.html │ │ │ │ @@ -80,28 +80,28 @@ │ │ │ │ #include <type_traits>
│ │ │ │ #include <dune/common/deprecated.hh>
│ │ │ │ #include <dune/common/exceptions.hh>
│ │ │ │ #include <dune/common/iteratorfacades.hh>
│ │ │ │ #include <dune/common/promotiontraits.hh>
│ │ │ │ #include <dune/common/shared_ptr.hh>
│ │ │ │ #include <dune/common/stdstreams.hh>
│ │ │ │ -#include "adapter/gridgluecommunicate.hh"
│ │ │ │ -#include <dune/grid-glue/merging/merger.hh>
│ │ │ │ +#include "adapter/gridgluecommunicate.hh"
│ │ │ │ +#include <dune/grid-glue/merging/merger.hh>
│ │ │ │ #include <dune/common/parallel/mpitraits.hh>
│ │ │ │ #include <dune/common/parallel/mpicommunication.hh>
│ │ │ │ #include <dune/common/parallel/indexset.hh>
│ │ │ │ #include <dune/common/parallel/plocalindex.hh>
│ │ │ │ #include <dune/common/parallel/remoteindices.hh>
│ │ │ │ #include <dune/common/parallel/communicator.hh>
│ │ │ │ #include <dune/common/parallel/interface.hh>
│ │ │ │ -#include "adapter/rangegenerators.hh"
│ │ │ │ -#include "adapter/gridglue.cc"
│ │ │ │ -#include "adapter/intersection.hh"
│ │ │ │ +#include "adapter/rangegenerators.hh"
│ │ │ │ +#include "adapter/gridglue.cc"
│ │ │ │ +#include "adapter/intersection.hh"
│ │ │ │ #include "adapter/intersectioniterator.hh"
│ │ │ │ -#include "adapter/intersectionindexset.hh"
│ │ │ │ +#include "adapter/intersectionindexset.hh"
│ │ │ │ │ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00002_source.html │ │ │ │ @@ -83,16 +83,16 @@ │ │ │ │
19#include <dune/common/deprecated.hh>
│ │ │ │
20#include <dune/common/exceptions.hh>
│ │ │ │
21#include <dune/common/iteratorfacades.hh>
│ │ │ │
22#include <dune/common/promotiontraits.hh>
│ │ │ │
23#include <dune/common/shared_ptr.hh>
│ │ │ │
24#include <dune/common/stdstreams.hh>
│ │ │ │
25
│ │ │ │ -
26#include "adapter/gridgluecommunicate.hh"
│ │ │ │ -
27#include <dune/grid-glue/merging/merger.hh>
│ │ │ │ +
26#include "adapter/gridgluecommunicate.hh"
│ │ │ │ +
27#include <dune/grid-glue/merging/merger.hh>
│ │ │ │
28
│ │ │ │
29#include <dune/common/parallel/mpitraits.hh>
│ │ │ │
30#include <dune/common/parallel/mpicommunication.hh>
│ │ │ │
31#include <dune/common/parallel/indexset.hh>
│ │ │ │
32#include <dune/common/parallel/plocalindex.hh>
│ │ │ │
33#include <dune/common/parallel/remoteindices.hh>
│ │ │ │
34#include <dune/common/parallel/communicator.hh>
│ │ │ │ @@ -355,30 +355,30 @@ │ │ │ │
396 }
│ │ │ │
397
│ │ │ │
398};
│ │ │ │
399
│ │ │ │
400} // end namespace GridGlue
│ │ │ │
401} // end namespace Dune
│ │ │ │
402
│ │ │ │ -
403#include "adapter/rangegenerators.hh"
│ │ │ │ +
403#include "adapter/rangegenerators.hh"
│ │ │ │
404
│ │ │ │ -
405#include "adapter/gridglue.cc"
│ │ │ │ +
405#include "adapter/gridglue.cc"
│ │ │ │
406
│ │ │ │ -
407#include "adapter/intersection.hh"
│ │ │ │ +
407#include "adapter/intersection.hh"
│ │ │ │
408#include "adapter/intersectioniterator.hh"
│ │ │ │ -
409#include "adapter/intersectionindexset.hh"
│ │ │ │ +
409#include "adapter/intersectionindexset.hh"
│ │ │ │
410
│ │ │ │
411#endif // DUNE_GRIDGLUE_GRIDGLUE_HH
│ │ │ │ -
gridglue.cc
│ │ │ │ +
rangegenerators.hh
│ │ │ │ +
gridglue.cc
│ │ │ │
intersectioniterator.hh
Implement iterators over GridGlue intersections.
│ │ │ │ -
intersectionindexset.hh
│ │ │ │ -
intersection.hh
Model of the Intersection concept provided by GridGlue.
│ │ │ │ -
gridgluecommunicate.hh
Describes the parallel communication interface class for Dune::GridGlue.
│ │ │ │ -
rangegenerators.hh
│ │ │ │ -
merger.hh
│ │ │ │ +
intersection.hh
Model of the Intersection concept provided by GridGlue.
│ │ │ │ +
gridgluecommunicate.hh
Describes the parallel communication interface class for Dune::GridGlue.
│ │ │ │ +
intersectionindexset.hh
│ │ │ │ +
merger.hh
│ │ │ │
Dune
Definition: gridglue.hh:37
│ │ │ │
Dune::GridGlue::GridGlue
sequential adapter to couple two grids at specified close together boundaries
Definition: gridglue.hh:67
│ │ │ │
Dune::GridGlue::GridGlue::Coords
Dune::FieldVector< ctype, dimworld > Coords
The type used for coordinate vectors.
Definition: gridglue.hh:174
│ │ │ │
Dune::GridGlue::GridGlue::getIntersection
Intersection getIntersection(int i) const
Definition: gridglue.hh:388
│ │ │ │
Dune::GridGlue::GridGlue::Grid1Vertex
GridVertex< 1 > Grid1Vertex
The type of the Grid1 vertices.
Definition: gridglue.hh:194
│ │ │ │
Dune::GridGlue::GridGlue::IndexSet
Dune::GridGlue::IntersectionIndexSet< P0, P1 > IndexSet
Type of remote intersection indexSet.
Definition: gridglue.hh:206
│ │ │ │
Dune::GridGlue::GridGlue::IndexType
unsigned int IndexType
Definition: gridglue.hh:147
│ │ │ │ ├── html2text {} │ │ │ │ │ @@ -326,23 +326,23 @@ │ │ │ │ │ 405#include "adapter/gridglue.cc" │ │ │ │ │ 406 │ │ │ │ │ 407#include "adapter/intersection.hh" │ │ │ │ │ 408#include "adapter/intersectioniterator.hh" │ │ │ │ │ 409#include "adapter/intersectionindexset.hh" │ │ │ │ │ 410 │ │ │ │ │ 411#endif // DUNE_GRIDGLUE_GRIDGLUE_HH │ │ │ │ │ +rangegenerators.hh │ │ │ │ │ gridglue.cc │ │ │ │ │ intersectioniterator.hh │ │ │ │ │ Implement iterators over GridGlue intersections. │ │ │ │ │ -intersectionindexset.hh │ │ │ │ │ intersection.hh │ │ │ │ │ Model of the Intersection concept provided by GridGlue. │ │ │ │ │ gridgluecommunicate.hh │ │ │ │ │ Describes the parallel communication interface class for Dune::GridGlue. │ │ │ │ │ -rangegenerators.hh │ │ │ │ │ +intersectionindexset.hh │ │ │ │ │ merger.hh │ │ │ │ │ Dune │ │ │ │ │ Definition: gridglue.hh:37 │ │ │ │ │ Dune::GridGlue::GridGlue │ │ │ │ │ sequential adapter to couple two grids at specified close together boundaries │ │ │ │ │ Definition: gridglue.hh:67 │ │ │ │ │ Dune::GridGlue::GridGlue::Coords │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00005.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: gridglue.cc File Reference │ │ │ │ +dune-grid-glue: rangegenerators.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -63,38 +63,42 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ +Classes | │ │ │ │ Namespaces | │ │ │ │ Functions
│ │ │ │ -
gridglue.cc File Reference
│ │ │ │ +
rangegenerators.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include "intersection.hh"
│ │ │ │ -#include <vector>
│ │ │ │ -#include <iterator>
│ │ │ │ -#include "../gridglue.hh"
│ │ │ │ -#include "../common/ringcomm.hh"
│ │ │ │ -#include <dune/common/unused.hh>
│ │ │ │ -

│ │ │ │ Classes

class  Dune::GridGlue::GridGlue< P0, P1 >
 sequential adapter to couple two grids at specified close together boundaries More...
│ │ │ │ +
#include <dune/common/iteratorrange.hh>
│ │ │ │ +
│ │ │ │ +

Go to the source code of this file.

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

│ │ │ │ +Classes

struct  Dune::GridGlue::Reverse< reverse >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ Functions

template<typename T >
void Dune::GridGlue::printVector (const std::vector< T > &v, std::string name, int rank)
 
template<... >
IteratorRange<... > Dune::GridGlue::intersections (const GridGlue<... > &glue, const Reverse<... > &reverse=!reversed)
 Iterate over all intersections of a GridGlue. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,28 +5,28 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * adapter │ │ │ │ │ -Namespaces | Functions │ │ │ │ │ -gridglue.cc File Reference │ │ │ │ │ -#include "intersection.hh" │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include "../gridglue.hh" │ │ │ │ │ -#include "../common/ringcomm.hh" │ │ │ │ │ -#include │ │ │ │ │ +Classes | Namespaces | Functions │ │ │ │ │ +rangegenerators.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +Go_to_the_source_code_of_this_file. │ │ │ │ │ + Classes │ │ │ │ │ +struct  Dune::GridGlue::Reverse<_reverse_> │ │ │ │ │ +  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::GridGlue │ │ │ │ │   │ │ │ │ │ Functions │ │ │ │ │ -template │ │ │ │ │ -void Dune::GridGlue::printVector (const std::vector< T > &v, std::string name, │ │ │ │ │ - int rank) │ │ │ │ │ +template<... > │ │ │ │ │ +IteratorRange<... > Dune::GridGlue::intersections (const GridGlue<... > &glue, │ │ │ │ │ + const Reverse<... > &reverse=!reversed) │ │ │ │ │ +  Iterate over all intersections of a GridGlue. More... │ │ │ │ │   │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00008.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: gridgluevtkwriter.hh File Reference │ │ │ │ +dune-grid-glue: gridglue.cc File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -63,48 +63,39 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ -Namespaces
│ │ │ │ -
gridgluevtkwriter.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Functions
│ │ │ │ +
gridglue.cc File Reference
│ │ │ │ │ │ │ │
│ │ │ │ - │ │ │ │ -

Write all remote intersections to a vtk file for debugging. │ │ │ │ -More...

│ │ │ │ -
#include <fstream>
│ │ │ │ -#include <iomanip>
│ │ │ │ -#include <type_traits>
│ │ │ │ +
#include "intersection.hh"
│ │ │ │ #include <vector>
│ │ │ │ -#include <dune/common/classname.hh>
│ │ │ │ -#include <dune/geometry/type.hh>
│ │ │ │ -#include <dune/geometry/referenceelements.hh>
│ │ │ │ -#include <dune/grid-glue/gridglue.hh>
│ │ │ │ -
│ │ │ │ -

Go to the source code of this file.

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

│ │ │ │ -Classes

class  Dune::GridGlue::GridGlueVtkWriter
 Write remote intersections to a vtk file for debugging purposes. More...
 
│ │ │ │ +#include <iterator>
│ │ │ │ +#include "../gridglue.hh"
│ │ │ │ +#include "../common/ringcomm.hh"
│ │ │ │ +#include <dune/common/unused.hh>
│ │ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +Functions

template<typename T >
void Dune::GridGlue::printVector (const std::vector< T > &v, std::string name, int rank)
 
│ │ │ │ -

Detailed Description

│ │ │ │ -

Write all remote intersections to a vtk file for debugging.

│ │ │ │ -
│ │ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,34 +5,28 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * adapter │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -gridgluevtkwriter.hh File Reference │ │ │ │ │ -Write all remote intersections to a vtk file for debugging. More... │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +Namespaces | Functions │ │ │ │ │ +gridglue.cc File Reference │ │ │ │ │ +#include "intersection.hh" │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -Go_to_the_source_code_of_this_file. │ │ │ │ │ - Classes │ │ │ │ │ -class  Dune::GridGlue::GridGlueVtkWriter │ │ │ │ │ -  Write remote intersections to a vtk file for debugging purposes. │ │ │ │ │ - More... │ │ │ │ │ -  │ │ │ │ │ +#include │ │ │ │ │ +#include "../gridglue.hh" │ │ │ │ │ +#include "../common/ringcomm.hh" │ │ │ │ │ +#include │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::GridGlue │ │ │ │ │   │ │ │ │ │ -***** Detailed Description ***** │ │ │ │ │ -Write all remote intersections to a vtk file for debugging. │ │ │ │ │ + Functions │ │ │ │ │ +template │ │ │ │ │ +void Dune::GridGlue::printVector (const std::vector< T > &v, std::string name, │ │ │ │ │ + int rank) │ │ │ │ │ +  │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00014.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: intersectionindexset.hh File Reference │ │ │ │ +dune-grid-glue: intersection.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -64,35 +64,74 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
intersectionindexset.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Macros
│ │ │ │ +
intersection.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <dune/grid-glue/gridglue.hh>
│ │ │ │ -#include <dune/grid-glue/adapter/intersection.hh>
│ │ │ │ + │ │ │ │ +

Model of the Intersection concept provided by GridGlue. │ │ │ │ +More...

│ │ │ │ +
#include <algorithm>
│ │ │ │ +#include <optional>
│ │ │ │ +#include <tuple>
│ │ │ │ +#include <dune/common/deprecated.hh>
│ │ │ │ +#include <dune/common/version.hh>
│ │ │ │ +#include <dune/geometry/affinegeometry.hh>
│ │ │ │ +#include <dune/geometry/referenceelements.hh>
│ │ │ │ +#include <dune/grid-glue/gridglue.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::GridGlue::IntersectionIndexSet< P0, P1 >
class  Dune::GridGlue::IntersectionData< P0, P1 >
 storage class for Dune::GridGlue::Intersection related data More...
 
struct  Dune::GridGlue::IntersectionTraits< P0, P1, inside, outside >
 
class  Dune::GridGlue::Intersection< P0, P1, I, O >
 The intersection of two entities of the two patches of a GridGlue. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +Macros

#define ONLY_SIMPLEX_INTERSECTIONS
 
│ │ │ │ +

Detailed Description

│ │ │ │ +

Model of the Intersection concept provided by GridGlue.

│ │ │ │ +
Author
Christian Engwer
│ │ │ │ +

Macro Definition Documentation

│ │ │ │ + │ │ │ │ +

◆ ONLY_SIMPLEX_INTERSECTIONS

│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
#define ONLY_SIMPLEX_INTERSECTIONS
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,23 +5,47 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * adapter │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -intersectionindexset.hh File Reference │ │ │ │ │ +Classes | Namespaces | Macros │ │ │ │ │ +intersection.hh File Reference │ │ │ │ │ +Model of the Intersection concept provided by GridGlue. More... │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  Dune::GridGlue::IntersectionIndexSet<_P0,_P1_> │ │ │ │ │ + class  Dune::GridGlue::IntersectionData<_P0,_P1_> │ │ │ │ │ +  storage class for Dune::GridGlue::Intersection related data More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::GridGlue::IntersectionTraits<_P0,_P1,_inside,_outside_> │ │ │ │ │ +  │ │ │ │ │ + class  Dune::GridGlue::Intersection<_P0,_P1,_I,_O_> │ │ │ │ │ +  The intersection of two entities of the two patches of a GridGlue. │ │ │ │ │ + More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::GridGlue │ │ │ │ │   │ │ │ │ │ + Macros │ │ │ │ │ +#define ONLY_SIMPLEX_INTERSECTIONS │ │ │ │ │ +  │ │ │ │ │ +***** Detailed Description ***** │ │ │ │ │ +Model of the Intersection concept provided by GridGlue. │ │ │ │ │ + Author │ │ │ │ │ + Christian Engwer │ │ │ │ │ +***** Macro Definition Documentation ***** │ │ │ │ │ +***** ◆ ONLY_SIMPLEX_INTERSECTIONS ***** │ │ │ │ │ +#define ONLY_SIMPLEX_INTERSECTIONS │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00014_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: intersectionindexset.hh Source File │ │ │ │ +dune-grid-glue: intersection.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,81 +62,525 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
intersectionindexset.hh
│ │ │ │ +
intersection.hh
│ │ │ │
│ │ │ │
│ │ │ │ -Go to the documentation of this file.
1// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │ -
2// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
│ │ │ │ -
3#ifndef DUNE_GRIDGLUE_ADAPTER_INTERSECTIONINDEXSET_HH
│ │ │ │ -
4#define DUNE_GRIDGLUE_ADAPTER_INTERSECTIONINDEXSET_HH
│ │ │ │ -
5
│ │ │ │ - │ │ │ │ - │ │ │ │ -
8
│ │ │ │ -
9#ifndef ONLY_SIMPLEX_INTERSECTIONS
│ │ │ │ -
10// we currently support only one intersection type. If we want to support more,
│ │ │ │ -
11// we have to think about the semantics of our IndexSet
│ │ │ │ -
12#error Not Implemented
│ │ │ │ -
13#endif
│ │ │ │ -
14
│ │ │ │ -
15namespace Dune {
│ │ │ │ -
16 namespace GridGlue {
│ │ │ │ +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 © DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │ +
4// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
│ │ │ │ +
11#ifndef DUNE_GRIDGLUE_ADAPTER_INTERSECTION_HH
│ │ │ │ +
12#define DUNE_GRIDGLUE_ADAPTER_INTERSECTION_HH
│ │ │ │ +
13
│ │ │ │ +
14#include <algorithm>
│ │ │ │ +
15#include <optional>
│ │ │ │ +
16#include <tuple>
│ │ │ │
17
│ │ │ │ -
18 template<typename P0, typename P1>
│ │ │ │ - │ │ │ │ -
20 {
│ │ │ │ -
21 friend class ::Dune::GridGlue::GridGlue<P0,P1>;
│ │ │ │ -
22 typedef ::Dune::GridGlue::GridGlue<P0,P1> GridGlue;
│ │ │ │ +
18#include <dune/common/deprecated.hh>
│ │ │ │ +
19#include <dune/common/version.hh>
│ │ │ │ +
20#include <dune/geometry/affinegeometry.hh>
│ │ │ │ +
21#include <dune/geometry/referenceelements.hh>
│ │ │ │ + │ │ │ │
23
│ │ │ │ -
24 public:
│ │ │ │ +
24#define ONLY_SIMPLEX_INTERSECTIONS
│ │ │ │
25
│ │ │ │ - │ │ │ │ -
29 typedef size_t SizeType;
│ │ │ │ -
30
│ │ │ │ -
33 template<int I, int O>
│ │ │ │ - │ │ │ │ -
35 {
│ │ │ │ -
36 return i.i_->index_;
│ │ │ │ -
37 }
│ │ │ │ -
38
│ │ │ │ -
41 SizeType size () const
│ │ │ │ -
42 {
│ │ │ │ -
43 return glue_->size();
│ │ │ │ -
44 }
│ │ │ │ -
45
│ │ │ │ -
46 private:
│ │ │ │ -
47
│ │ │ │ - │ │ │ │ -
50 glue_(g) {}
│ │ │ │ +
26namespace Dune {
│ │ │ │ +
27 namespace GridGlue {
│ │ │ │ +
28
│ │ │ │ +
29 // forward declaration
│ │ │ │ +
30 template<typename P0, typename P1>
│ │ │ │ +
31 class IntersectionIndexSet;
│ │ │ │ +
32
│ │ │ │ +
36 template<typename P0, typename P1>
│ │ │ │ + │ │ │ │ +
38 {
│ │ │ │ +
39 public:
│ │ │ │ +
40 typedef ::Dune::GridGlue::GridGlue<P0, P1> GridGlue;
│ │ │ │ +
41
│ │ │ │ + │ │ │ │ +
43
│ │ │ │ +
45 static constexpr int coorddim = GridGlue::dimworld;
│ │ │ │ +
46
│ │ │ │ +
47 private:
│ │ │ │ +
48 // intermediate quantities
│ │ │ │ +
49 template<int side>
│ │ │ │ +
50 static constexpr int dim() { return GridGlue::template GridView<side>::Grid::dimension - GridGlue::template GridPatch<side>::codim; }
│ │ │ │
51
│ │ │ │ -
52 const GridGlue * glue_;
│ │ │ │ -
53 };
│ │ │ │ -
54
│ │ │ │ -
55 } // end namespace GridGlue
│ │ │ │ -
56} // end namespace Dune
│ │ │ │ -
57
│ │ │ │ -
58#endif // DUNE_GRIDGLUE_ADAPTER_INTERSECTIONINDEXSET_HH
│ │ │ │ +
52 public:
│ │ │ │ +
54 static constexpr int mydim = dim<0>() < dim<1>() ? dim<0>() : dim<1>();
│ │ │ │ +
55
│ │ │ │ +
56 template<int side>
│ │ │ │ +
57 using GridLocalGeometry = AffineGeometry<
│ │ │ │ +
58 typename GridGlue::template GridView<side>::ctype, mydim, GridGlue::template GridView<side>::dimension>;
│ │ │ │ +
59
│ │ │ │ +
60 using Grid0LocalGeometry [[deprecated("please use GridLocalGeometry<0> instead")]] = GridLocalGeometry<0>;
│ │ │ │ +
61 using Grid1LocalGeometry [[deprecated("please use GridLocalGeometry<1> instead")]] = GridLocalGeometry<1>;
│ │ │ │ +
62
│ │ │ │ +
63 template<int side>
│ │ │ │ +
64 using GridGeometry = AffineGeometry<
│ │ │ │ +
65 typename GridGlue::template GridView<side>::ctype, mydim, GridGlue::template GridView<side>::dimensionworld>;
│ │ │ │ +
66
│ │ │ │ +
67 using Grid0Geometry [[deprecated("please use GridGeometry<0> instead")]] = GridGeometry<0>;
│ │ │ │ +
68 using Grid1Geometry [[deprecated("please use GridGeometry<1> instead")]] = GridGeometry<1>;
│ │ │ │ +
69
│ │ │ │ +
70 template<int side>
│ │ │ │ +
71 using GridIndexType = typename GridGlue::template GridView<side>::IndexSet::IndexType;
│ │ │ │ +
72
│ │ │ │ +
73 using Grid0IndexType [[deprecated("please use GridIndexType<0> instead")]] = GridIndexType<0>;
│ │ │ │ +
74 using Grid1IndexType [[deprecated("please use GridIndexType<1> instead")]] = GridIndexType<1>;
│ │ │ │ +
75
│ │ │ │ +
77 IntersectionData(const GridGlue& glue, unsigned int mergeindex, unsigned int offset, bool grid0local, bool grid1local);
│ │ │ │ +
78
│ │ │ │ +
80 IntersectionData() = default;
│ │ │ │ +
81
│ │ │ │ +
82 /* Accessor Functions */
│ │ │ │ +
83
│ │ │ │ +
84 template<int side>
│ │ │ │ +
85 const GridLocalGeometry<side>& localGeometry(unsigned int parentId = 0) const
│ │ │ │ +
86 { return *std::get<side>(sideData_).gridlocalgeom[parentId]; }
│ │ │ │ +
87
│ │ │ │ +
88 template<int side>
│ │ │ │ + │ │ │ │ +
90 { return *std::get<side>(sideData_).gridgeom; }
│ │ │ │ +
91
│ │ │ │ +
92 template<int side>
│ │ │ │ +
93 bool local() const
│ │ │ │ +
94 { return std::get<side>(sideData_).gridlocal; }
│ │ │ │ +
95
│ │ │ │ +
96 template<int side>
│ │ │ │ +
97 IndexType index(unsigned int parentId = 0) const
│ │ │ │ +
98 { return std::get<side>(sideData_).gridindices[parentId]; }
│ │ │ │ +
99
│ │ │ │ +
100 template<int side>
│ │ │ │ + │ │ │ │ +
102 { return std::get<side>(sideData_).gridindices.size(); }
│ │ │ │ +
103
│ │ │ │ +
104 private:
│ │ │ │ +
105 template<int side>
│ │ │ │ +
106 void initializeGeometry(const GridGlue& glue, unsigned mergeindex);
│ │ │ │ +
107
│ │ │ │ +
108 /* M E M B E R V A R I A B L E S */
│ │ │ │ +
109
│ │ │ │ +
110 public:
│ │ │ │ + │ │ │ │ +
113
│ │ │ │ +
114 private:
│ │ │ │ +
115 template<int side>
│ │ │ │ +
116 struct SideData {
│ │ │ │ +
118 bool gridlocal = false;
│ │ │ │ +
119
│ │ │ │ +
121 std::vector< GridIndexType<side> > gridindices;
│ │ │ │ +
122
│ │ │ │ +
124 std::vector< std::optional< GridLocalGeometry<side> > > gridlocalgeom;
│ │ │ │ +
125
│ │ │ │ +
133 std::optional< GridGeometry<side> > gridgeom;
│ │ │ │ +
134 };
│ │ │ │ +
135
│ │ │ │ +
136 std::tuple< SideData<0>, SideData<1> > sideData_;
│ │ │ │ +
137 };
│ │ │ │ +
138
│ │ │ │ +
139 template<typename P0, typename P1>
│ │ │ │ +
140 template<int side>
│ │ │ │ +
141 void IntersectionData<P0, P1>::initializeGeometry(const GridGlue& glue, unsigned mergeindex)
│ │ │ │ +
142 {
│ │ │ │ +
143 auto& data = std::get<side>(sideData_);
│ │ │ │ +
144
│ │ │ │ +
145 const unsigned n_parents = glue.merger_->template parents<side>(mergeindex);
│ │ │ │ +
146
│ │ │ │ +
147 // init containers
│ │ │ │ +
148 data.gridindices.resize(n_parents);
│ │ │ │ +
149 data.gridlocalgeom.resize(n_parents);
│ │ │ │ +
150
│ │ │ │ +
151 // default values
│ │ │ │ +
152 data.gridindices[0] = 0;
│ │ │ │ +
153
│ │ │ │ +
154 static constexpr int nSimplexCorners = mydim + 1;
│ │ │ │ +
155 using ctype = typename GridGlue::ctype;
│ │ │ │ +
156
│ │ │ │ +
157 // initialize the local and the global geometries of grid `side`
│ │ │ │ +
158
│ │ │ │ +
159 // compute the coordinates of the subface's corners in codim 0 entity local coordinates
│ │ │ │ +
160 static constexpr int elementdim = GridGlue::template GridView<side>::template Codim<0>::Geometry::mydimension;
│ │ │ │ +
161
│ │ │ │ +
162 // coordinates within the subentity that contains the remote intersection
│ │ │ │ +
163 std::array<Dune::FieldVector< ctype, dim<side>() >, nSimplexCorners> corners_subEntity_local;
│ │ │ │ +
164
│ │ │ │ +
165 for (unsigned int par = 0; par < n_parents; ++par) {
│ │ │ │ +
166 for (int i = 0; i < nSimplexCorners; ++i)
│ │ │ │ +
167 corners_subEntity_local[i] = glue.merger_->template parentLocal<side>(mergeindex, i, par);
│ │ │ │ +
168
│ │ │ │ +
169 // Coordinates of the remote intersection corners wrt the element coordinate system
│ │ │ │ +
170 std::array<Dune::FieldVector<ctype, elementdim>, nSimplexCorners> corners_element_local;
│ │ │ │ +
171
│ │ │ │ +
172 if (data.gridlocal) {
│ │ │ │ +
173 data.gridindices[par] = glue.merger_->template parent<side>(mergeindex,par);
│ │ │ │ +
174
│ │ │ │ +
175 typename GridGlue::template GridPatch<side>::LocalGeometry
│ │ │ │ +
176 gridLocalGeometry = glue.template patch<side>().geometryLocal(data.gridindices[par]);
│ │ │ │ +
177 for (std::size_t i=0; i<corners_subEntity_local.size(); i++) {
│ │ │ │ +
178 corners_element_local[i] = gridLocalGeometry.global(corners_subEntity_local[i]);
│ │ │ │ +
179 }
│ │ │ │ +
180
│ │ │ │ +
181 // set the corners of the local geometry
│ │ │ │ +
182#ifdef ONLY_SIMPLEX_INTERSECTIONS
│ │ │ │ +
183# if DUNE_VERSION_NEWER(DUNE_GEOMETRY, 2, 6)
│ │ │ │ +
184 const Dune::GeometryType type = Dune::GeometryTypes::simplex(mydim);
│ │ │ │ +
185# else
│ │ │ │ +
186 const Dune::GeometryType type(Dune::GeometryType::simplex, mydim);
│ │ │ │ +
187# endif
│ │ │ │ +
188#else
│ │ │ │ +
189#error Not Implemented
│ │ │ │ +
190#endif
│ │ │ │ +
191 data.gridlocalgeom[par].emplace(type, corners_element_local);
│ │ │ │ +
192
│ │ │ │ +
193 // Add world geometry only for 0th parent
│ │ │ │ +
194 if (par == 0) {
│ │ │ │ +
195 typename GridGlue::template GridPatch<side>::Geometry
│ │ │ │ +
196 gridWorldGeometry = glue.template patch<side>().geometry(data.gridindices[par]);
│ │ │ │ +
197
│ │ │ │ +
198 // world coordinates of the remote intersection corners
│ │ │ │ +
199 std::array<Dune::FieldVector<ctype, GridGlue::template GridView<side>::dimensionworld>, nSimplexCorners> corners_global;
│ │ │ │ +
200
│ │ │ │ +
201 for (std::size_t i=0; i<corners_subEntity_local.size(); i++) {
│ │ │ │ +
202 corners_global[i] = gridWorldGeometry.global(corners_subEntity_local[i]);
│ │ │ │ +
203 }
│ │ │ │ +
204
│ │ │ │ +
205 data.gridgeom.emplace(type, corners_global);
│ │ │ │ +
206 }
│ │ │ │ +
207 }
│ │ │ │ +
208 }
│ │ │ │ +
209 }
│ │ │ │ +
210
│ │ │ │ +
212 template<typename P0, typename P1>
│ │ │ │ +
213 IntersectionData<P0, P1>::IntersectionData(const GridGlue& glue, unsigned int mergeindex, unsigned int offset,
│ │ │ │ +
214 bool grid0local, bool grid1local)
│ │ │ │ +
215 : index_(mergeindex+offset)
│ │ │ │ +
216 {
│ │ │ │ +
217 // if an invalid index is given do not proceed!
│ │ │ │ +
218 // (happens when the parent GridGlue initializes the "end"-Intersection)
│ │ │ │ +
219 assert (0 <= mergeindex || mergeindex < glue.index__sz);
│ │ │ │ +
220
│ │ │ │ +
221 std::get<0>(sideData_).gridlocal = grid0local;
│ │ │ │ +
222 std::get<1>(sideData_).gridlocal = grid1local;
│ │ │ │ +
223
│ │ │ │ +
224 initializeGeometry<0>(glue, mergeindex);
│ │ │ │ +
225 initializeGeometry<1>(glue, mergeindex);
│ │ │ │ +
226 }
│ │ │ │ +
227
│ │ │ │ +
232 template<typename P0, typename P1, int inside, int outside>
│ │ │ │ + │ │ │ │ +
234 {
│ │ │ │ + │ │ │ │ + │ │ │ │ +
237
│ │ │ │ +
238 using InsideGridView = typename GridGlue::template GridView<inside>;
│ │ │ │ +
239 using OutsideGridView = typename GridGlue::template GridView<outside>;
│ │ │ │ +
240
│ │ │ │ +
241 using InsideLocalGeometry = typename IntersectionData::template GridLocalGeometry<inside>;
│ │ │ │ +
242 using OutsideLocalGeometry = typename IntersectionData::template GridLocalGeometry<outside>;
│ │ │ │ +
243
│ │ │ │ +
244 using Geometry = typename IntersectionData::template GridGeometry<inside>;
│ │ │ │ +
245 using OutsideGeometry = typename IntersectionData::template GridGeometry<outside>;
│ │ │ │ +
246
│ │ │ │ +
247 static constexpr auto coorddim = IntersectionData::coorddim;
│ │ │ │ +
248 static constexpr auto mydim = IntersectionData::mydim;
│ │ │ │ +
249 static constexpr int insidePatch = inside;
│ │ │ │ +
250 static constexpr int outsidePatch = outside;
│ │ │ │ +
251
│ │ │ │ +
252 using ctype = typename GridGlue::ctype;
│ │ │ │ +
253 using LocalCoordinate = Dune::FieldVector<ctype, mydim>;
│ │ │ │ +
254 using GlobalCoordinate = Dune::FieldVector<ctype, coorddim>;
│ │ │ │ +
255 };
│ │ │ │ +
256
│ │ │ │ +
259 template<typename P0, typename P1, int I, int O>
│ │ │ │ + │ │ │ │ +
261 {
│ │ │ │ +
262
│ │ │ │ +
263 public:
│ │ │ │ +
264
│ │ │ │ + │ │ │ │ +
266
│ │ │ │ +
267 typedef typename Traits::GridGlue GridGlue;
│ │ │ │ + │ │ │ │ +
269
│ │ │ │ +
270
│ │ │ │ + │ │ │ │ + │ │ │ │ +
273
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
277
│ │ │ │ +
278 typedef typename Traits::Geometry Geometry;
│ │ │ │ +
279 typedef typename Traits::ctype ctype;
│ │ │ │ +
280
│ │ │ │ +
281 typedef typename InsideGridView::Traits::template Codim<0>::Entity InsideEntity;
│ │ │ │ +
282 typedef typename OutsideGridView::Traits::template Codim<0>::Entity OutsideEntity;
│ │ │ │ +
283
│ │ │ │ + │ │ │ │ + │ │ │ │ +
286
│ │ │ │ +
288 static constexpr auto coorddim = Traits::coorddim;
│ │ │ │ +
289
│ │ │ │ +
291 static constexpr auto mydim = Traits::mydim;
│ │ │ │ +
292
│ │ │ │ +
294 static constexpr int insidePatch = Traits::insidePatch;
│ │ │ │ +
295
│ │ │ │ +
297 static constexpr int outsidePatch = Traits::outsidePatch;
│ │ │ │ +
298
│ │ │ │ +
299 // typedef unsigned int IndexType;
│ │ │ │ +
300
│ │ │ │ +
301 private:
│ │ │ │ +
305 static constexpr int codimensionWorld = coorddim - mydim;
│ │ │ │ +
306
│ │ │ │ +
307 public:
│ │ │ │ +
308 /* C O N S T R U C T O R S */
│ │ │ │ +
309
│ │ │ │ +
311 Intersection(const GridGlue* glue, const IntersectionData* i) :
│ │ │ │ +
312 glue_(glue), i_(i) {}
│ │ │ │ +
313
│ │ │ │ +
314 /* F U N C T I O N A L I T Y */
│ │ │ │ +
315
│ │ │ │ + │ │ │ │ +
319 inside(unsigned int parentId = 0) const
│ │ │ │ +
320 {
│ │ │ │ +
321 assert(self());
│ │ │ │ +
322 return glue_->template patch<I>().element(i_->template index<I>(parentId));
│ │ │ │ +
323 }
│ │ │ │ +
324
│ │ │ │ + │ │ │ │ +
328 outside(unsigned int parentId = 0) const
│ │ │ │ +
329 {
│ │ │ │ +
330 assert(neighbor());
│ │ │ │ +
331 return glue_->template patch<O>().element(i_->template index<O>(parentId));
│ │ │ │ +
332 }
│ │ │ │ +
333
│ │ │ │ +
335 bool conforming() const
│ │ │ │ +
336 {
│ │ │ │ +
337 throw Dune::NotImplemented();
│ │ │ │ +
338 }
│ │ │ │ +
339
│ │ │ │ +
342 const InsideLocalGeometry& geometryInInside(unsigned int parentId = 0) const
│ │ │ │ +
343 {
│ │ │ │ +
344 return i_->template localGeometry<I>(parentId);
│ │ │ │ +
345 }
│ │ │ │ +
346
│ │ │ │ +
349 const OutsideLocalGeometry& geometryInOutside(unsigned int parentId = 0) const
│ │ │ │ +
350 {
│ │ │ │ +
351 return i_->template localGeometry<O>(parentId);
│ │ │ │ +
352 }
│ │ │ │ +
353
│ │ │ │ +
360 const Geometry& geometry() const
│ │ │ │ +
361 {
│ │ │ │ +
362 return i_->template geometry<I>();
│ │ │ │ +
363 }
│ │ │ │ +
364
│ │ │ │ +
371 const OutsideGeometry& geometryOutside() const // DUNE_DEPRECATED
│ │ │ │ +
372 {
│ │ │ │ +
373 return i_->template geometry<O>();
│ │ │ │ +
374 }
│ │ │ │ +
375
│ │ │ │ +
377 Dune::GeometryType type() const
│ │ │ │ +
378 {
│ │ │ │ +
379 #ifdef ONLY_SIMPLEX_INTERSECTIONS
│ │ │ │ +
380 # if DUNE_VERSION_NEWER(DUNE_GEOMETRY, 2, 6)
│ │ │ │ +
381 return Dune::GeometryTypes::simplex(mydim);
│ │ │ │ +
382 # else
│ │ │ │ +
383 static const Dune::GeometryType type(Dune::GeometryType::simplex, mydim);
│ │ │ │ +
384 return type;
│ │ │ │ +
385 # endif
│ │ │ │ +
386 #else
│ │ │ │ +
387 #error Not Implemented
│ │ │ │ +
388 #endif
│ │ │ │ +
389 }
│ │ │ │ +
390
│ │ │ │ +
391
│ │ │ │ +
393 bool self() const
│ │ │ │ +
394 {
│ │ │ │ +
395 return i_->template local<I>();
│ │ │ │ +
396 }
│ │ │ │ +
397
│ │ │ │ +
399 size_t neighbor(unsigned int g = 0) const
│ │ │ │ +
400 {
│ │ │ │ +
401 if (g == 0 && i_->template local<O>()) {
│ │ │ │ +
402 return i_->template parents<O>();
│ │ │ │ +
403 } else if (g == 1 && i_->template local<I>()) {
│ │ │ │ +
404 return i_->template parents<I>();
│ │ │ │ +
405 }
│ │ │ │ +
406 return 0;
│ │ │ │ +
407 }
│ │ │ │ +
408
│ │ │ │ +
410 int indexInInside(unsigned int parentId = 0) const
│ │ │ │ +
411 {
│ │ │ │ +
412 assert(self());
│ │ │ │ +
413 return glue_->template patch<I>().indexInInside(i_->template index<I>(parentId));
│ │ │ │ +
414 }
│ │ │ │ +
415
│ │ │ │ +
417 int indexInOutside(unsigned int parentId = 0) const
│ │ │ │ +
418 {
│ │ │ │ +
419 assert(neighbor());
│ │ │ │ +
420 return glue_->template patch<O>().indexInInside(i_->template index<O>(parentId));
│ │ │ │ +
421 }
│ │ │ │ +
422
│ │ │ │ + │ │ │ │ +
428 {
│ │ │ │ +
429 GlobalCoordinate normal;
│ │ │ │ +
430
│ │ │ │ +
431 if (codimensionWorld == 0)
│ │ │ │ +
432 DUNE_THROW(Dune::Exception, "There is no normal vector to a full-dimensional intersection");
│ │ │ │ +
433 else if (codimensionWorld == 1) {
│ │ │ │ +
434 /* TODO: Implement the general n-ary cross product here */
│ │ │ │ +
435 const auto jacobianTransposed = geometry().jacobianTransposed(local);
│ │ │ │ +
436 if (mydim==1) {
│ │ │ │ +
437 normal[0] = - jacobianTransposed[0][1];
│ │ │ │ +
438 normal[1] = jacobianTransposed[0][0];
│ │ │ │ +
439 } else if (mydim==2) {
│ │ │ │ +
440 normal[0] = (jacobianTransposed[0][1] * jacobianTransposed[1][2] - jacobianTransposed[0][2] * jacobianTransposed[1][1]);
│ │ │ │ +
441 normal[1] = - (jacobianTransposed[0][0] * jacobianTransposed[1][2] - jacobianTransposed[0][2] * jacobianTransposed[1][0]);
│ │ │ │ +
442 normal[2] = (jacobianTransposed[0][0] * jacobianTransposed[1][1] - jacobianTransposed[0][1] * jacobianTransposed[1][0]);
│ │ │ │ +
443 } else
│ │ │ │ +
444 DUNE_THROW(Dune::NotImplemented, "Remote intersections don't implement the 'outerNormal' method for " << mydim << "-dimensional intersections yet");
│ │ │ │ +
445 } else
│ │ │ │ +
446 DUNE_THROW(Dune::NotImplemented, "Remote intersections don't implement the 'outerNormal' method for intersections with codim >= 2 yet");
│ │ │ │ +
447
│ │ │ │ +
448 return normal;
│ │ │ │ +
449 }
│ │ │ │ +
450
│ │ │ │ + │ │ │ │ +
456 {
│ │ │ │ +
457 GlobalCoordinate normal = outerNormal(local);
│ │ │ │ +
458 normal /= normal.two_norm();
│ │ │ │ +
459 return normal;
│ │ │ │ +
460 }
│ │ │ │ +
461
│ │ │ │ + │ │ │ │ +
467 {
│ │ │ │ +
468 return (unitOuterNormal(local) *= geometry().integrationElement(local));
│ │ │ │ +
469 }
│ │ │ │ +
470
│ │ │ │ + │ │ │ │ +
476 {
│ │ │ │ +
477 return unitOuterNormal(ReferenceElements<ctype,mydim>::general(type()).position(0,0));
│ │ │ │ +
478 }
│ │ │ │ +
479
│ │ │ │ + │ │ │ │ +
484 {
│ │ │ │ +
485 return Intersection<P0,P1,O,I>(glue_,i_);
│ │ │ │ +
486 }
│ │ │ │ +
487
│ │ │ │ +
488#ifdef QUICKHACK_INDEX
│ │ │ │ +
489 typedef typename GridGlue::IndexType IndexType;
│ │ │ │ +
490
│ │ │ │ +
491 IndexType index() const
│ │ │ │ +
492 {
│ │ │ │ +
493 return i_->index_;
│ │ │ │ +
494 }
│ │ │ │ +
495
│ │ │ │ +
496#endif
│ │ │ │ +
497
│ │ │ │ +
498 private:
│ │ │ │ +
499
│ │ │ │ +
500 friend class IntersectionIndexSet<P0,P1>;
│ │ │ │ +
501
│ │ │ │ +
502 /* M E M B E R V A R I A B L E S */
│ │ │ │ +
503
│ │ │ │ +
505 const GridGlue* glue_;
│ │ │ │ +
506
│ │ │ │ +
508 const IntersectionData* i_;
│ │ │ │ +
509 };
│ │ │ │ +
510
│ │ │ │ +
511
│ │ │ │ +
512 } // end namespace GridGlue
│ │ │ │ +
513} // end namespace Dune
│ │ │ │ +
514
│ │ │ │ +
515#endif // DUNE_GRIDGLUE_ADAPTER_INTERSECTION_HH
│ │ │ │
Central component of the module implementing the coupling of two grids.
│ │ │ │ -
Model of the Intersection concept provided by GridGlue.
│ │ │ │
Definition: gridglue.hh:37
│ │ │ │ +
bool inside(const Coordinate &x, const Field &epsilon)
Definition: projection_impl.hh:111
│ │ │ │
sequential adapter to couple two grids at specified close together boundaries
Definition: gridglue.hh:67
│ │ │ │
unsigned int IndexType
Definition: gridglue.hh:147
│ │ │ │ -
size_t size() const
Definition: gridglue.hh:393
│ │ │ │ +
PromotionTraits< typenameGridView< 0 >::ctype, typenameGridView< 1 >::ctype >::PromotedType ctype
The type used for coordinates.
Definition: gridglue.hh:171
│ │ │ │ +
static constexpr int dimworld
export the world dimension This is the maximum of the extractors' world dimensions.
Definition: gridglue.hh:166
│ │ │ │ +
storage class for Dune::GridGlue::Intersection related data
Definition: intersection.hh:38
│ │ │ │ +
GridGlue::IndexType IndexType
Definition: intersection.hh:42
│ │ │ │ +
AffineGeometry< typename GridGlue::template GridView< side >::ctype, mydim, GridGlue::template GridView< side >::dimensionworld > GridGeometry
Definition: intersection.hh:65
│ │ │ │ +
const GridLocalGeometry< side > & localGeometry(unsigned int parentId=0) const
Definition: intersection.hh:85
│ │ │ │ +
static constexpr int coorddim
Dimension of the world space of the intersection.
Definition: intersection.hh:45
│ │ │ │ +
GridGeometry< 0 > Grid0Geometry
Definition: intersection.hh:67
│ │ │ │ +
typename GridGlue::template GridView< side >::IndexSet::IndexType GridIndexType
Definition: intersection.hh:71
│ │ │ │ +
IndexType index(unsigned int parentId=0) const
Definition: intersection.hh:97
│ │ │ │ +
IndexType parents() const
Definition: intersection.hh:101
│ │ │ │ +
GridLocalGeometry< 1 > Grid1LocalGeometry
Definition: intersection.hh:61
│ │ │ │ +
const GridGeometry< side > & geometry() const
Definition: intersection.hh:89
│ │ │ │ +
bool local() const
Definition: intersection.hh:93
│ │ │ │ +
::Dune::GridGlue::GridGlue< P0, P1 > GridGlue
Definition: intersection.hh:40
│ │ │ │ +
static constexpr int mydim
Dimension of the intersection.
Definition: intersection.hh:54
│ │ │ │ +
AffineGeometry< typename GridGlue::template GridView< side >::ctype, mydim, GridGlue::template GridView< side >::dimension > GridLocalGeometry
Definition: intersection.hh:58
│ │ │ │ +
GridLocalGeometry< 0 > Grid0LocalGeometry
Definition: intersection.hh:60
│ │ │ │
IndexType index_
index of this intersection after GridGlue interface
Definition: intersection.hh:112
│ │ │ │ +
GridIndexType< 1 > Grid1IndexType
Definition: intersection.hh:74
│ │ │ │ +
GridGeometry< 1 > Grid1Geometry
Definition: intersection.hh:68
│ │ │ │ +
GridIndexType< 0 > Grid0IndexType
Definition: intersection.hh:73
│ │ │ │ +
IntersectionData()=default
Default Constructor.
│ │ │ │
The intersection of two entities of the two patches of a GridGlue.
Definition: intersection.hh:261
│ │ │ │ -
Definition: intersectionindexset.hh:20
│ │ │ │ -
SizeType size() const
Return total number of intersections.
Definition: intersectionindexset.hh:41
│ │ │ │ -
GridGlue::IndexType IndexType
The type used for the indices.
Definition: intersectionindexset.hh:27
│ │ │ │ -
IndexType index(const Intersection< P0, P1, I, O > &i) const
Map Dune::GridGlue::Intersection to index.
Definition: intersectionindexset.hh:34
│ │ │ │ -
size_t SizeType
The type used for the size.
Definition: intersectionindexset.hh:29
│ │ │ │ +
Traits::OutsideLocalGeometry OutsideLocalGeometry
Definition: intersection.hh:275
│ │ │ │ +
Intersection< P0, P1, O, I > flip() const
Return a copy of the intersection with inside and outside switched.
Definition: intersection.hh:483
│ │ │ │ +
bool conforming() const
Return true if intersection is conforming.
Definition: intersection.hh:335
│ │ │ │ +
InsideGridView::Traits::template Codim< 0 >::Entity InsideEntity
Definition: intersection.hh:281
│ │ │ │ +
Traits::GridGlue GridGlue
Definition: intersection.hh:267
│ │ │ │ +
int indexInOutside(unsigned int parentId=0) const
Local number of codim 1 entity in outside() Entity where intersection is contained in.
Definition: intersection.hh:417
│ │ │ │ +
int indexInInside(unsigned int parentId=0) const
Local number of codim 1 entity in the inside() Entity where intersection is contained in.
Definition: intersection.hh:410
│ │ │ │ +
bool self() const
For parallel computations: Return true if inside() entity exists locally.
Definition: intersection.hh:393
│ │ │ │ +
static constexpr auto mydim
dimension of the intersection
Definition: intersection.hh:291
│ │ │ │ +
static constexpr int outsidePatch
outside patch
Definition: intersection.hh:297
│ │ │ │ +
Dune::GeometryType type() const
Type of reference element for this intersection.
Definition: intersection.hh:377
│ │ │ │ +
InsideEntity inside(unsigned int parentId=0) const
Return element on the inside of this intersection.
Definition: intersection.hh:319
│ │ │ │ +
Traits::LocalCoordinate LocalCoordinate
Definition: intersection.hh:284
│ │ │ │ +
const OutsideLocalGeometry & geometryInOutside(unsigned int parentId=0) const
Geometric information about this intersection in local coordinates of the outside() element.
Definition: intersection.hh:349
│ │ │ │ +
GlobalCoordinate unitOuterNormal(const LocalCoordinate &local) const
Return a unit outer normal.
Definition: intersection.hh:455
│ │ │ │ +
Traits::ctype ctype
Definition: intersection.hh:279
│ │ │ │ +
IntersectionTraits< P0, P1, I, O > Traits
Definition: intersection.hh:265
│ │ │ │ +
Traits::IntersectionData IntersectionData
Definition: intersection.hh:268
│ │ │ │ +
Traits::GlobalCoordinate GlobalCoordinate
Definition: intersection.hh:285
│ │ │ │ +
Traits::OutsideGeometry OutsideGeometry
Definition: intersection.hh:276
│ │ │ │ +
size_t neighbor(unsigned int g=0) const
Return number of embeddings into local grid0 (grid1) entities.
Definition: intersection.hh:399
│ │ │ │ +
Intersection(const GridGlue *glue, const IntersectionData *i)
Constructor for a given Dataset.
Definition: intersection.hh:311
│ │ │ │ +
static constexpr int insidePatch
inside patch
Definition: intersection.hh:294
│ │ │ │ +
Traits::Geometry Geometry
Definition: intersection.hh:278
│ │ │ │ +
OutsideGridView::Traits::template Codim< 0 >::Entity OutsideEntity
Definition: intersection.hh:282
│ │ │ │ +
OutsideEntity outside(unsigned int parentId=0) const
Return element on the outside of this intersection.
Definition: intersection.hh:328
│ │ │ │ +
const Geometry & geometry() const
Geometric information about this intersection as part of the inside grid.
Definition: intersection.hh:360
│ │ │ │ +
Traits::InsideLocalGeometry InsideLocalGeometry
Definition: intersection.hh:272
│ │ │ │ +
GlobalCoordinate outerNormal(const LocalCoordinate &local) const
Return an outer normal (length not necessarily 1)
Definition: intersection.hh:427
│ │ │ │ +
const OutsideGeometry & geometryOutside() const
Geometric information about this intersection as part of the outside grid.
Definition: intersection.hh:371
│ │ │ │ +
Traits::OutsideGridView OutsideGridView
Definition: intersection.hh:274
│ │ │ │ +
GlobalCoordinate integrationOuterNormal(const LocalCoordinate &local) const
Return an outer normal with the length of the integration element.
Definition: intersection.hh:466
│ │ │ │ +
Traits::InsideGridView InsideGridView
Definition: intersection.hh:271
│ │ │ │ +
const InsideLocalGeometry & geometryInInside(unsigned int parentId=0) const
Geometric information about this intersection in local coordinates of the inside() element.
Definition: intersection.hh:342
│ │ │ │ +
GlobalCoordinate centerUnitOuterNormal() const
Unit outer normal at the center of the intersection.
Definition: intersection.hh:475
│ │ │ │ +
static constexpr auto coorddim
dimension of the world space of the intersection
Definition: intersection.hh:288
│ │ │ │ +
Definition: intersection.hh:234
│ │ │ │ +
static constexpr int insidePatch
Definition: intersection.hh:249
│ │ │ │ +
Dune::FieldVector< ctype, mydim > LocalCoordinate
Definition: intersection.hh:253
│ │ │ │ +
static constexpr auto coorddim
Definition: intersection.hh:247
│ │ │ │ +
typename IntersectionData::template GridGeometry< outside > OutsideGeometry
Definition: intersection.hh:245
│ │ │ │ +
typename GridGlue::ctype ctype
Definition: intersection.hh:252
│ │ │ │ +
typename GridGlue::template GridView< outside > OutsideGridView
Definition: intersection.hh:239
│ │ │ │ +
Dune::FieldVector< ctype, coorddim > GlobalCoordinate
Definition: intersection.hh:254
│ │ │ │ +
typename IntersectionData::template GridLocalGeometry< outside > OutsideLocalGeometry
Definition: intersection.hh:242
│ │ │ │ +
typename GridGlue::template GridView< inside > InsideGridView
Definition: intersection.hh:238
│ │ │ │ +
typename IntersectionData::template GridGeometry< inside > Geometry
Definition: intersection.hh:244
│ │ │ │ +
typename IntersectionData::template GridLocalGeometry< inside > InsideLocalGeometry
Definition: intersection.hh:241
│ │ │ │ +
static constexpr int outsidePatch
Definition: intersection.hh:250
│ │ │ │ +
static constexpr auto mydim
Definition: intersection.hh:248
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,106 +5,758 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * adapter │ │ │ │ │ -intersectionindexset.hh │ │ │ │ │ +intersection.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ -1// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see 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 © DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ - 2// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only- │ │ │ │ │ + 4// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only- │ │ │ │ │ with-dune-grid-glue-exception │ │ │ │ │ - 3#ifndef DUNE_GRIDGLUE_ADAPTER_INTERSECTIONINDEXSET_HH │ │ │ │ │ - 4#define DUNE_GRIDGLUE_ADAPTER_INTERSECTIONINDEXSET_HH │ │ │ │ │ - 5 │ │ │ │ │ - 6#include │ │ │ │ │ - 7#include │ │ │ │ │ - 8 │ │ │ │ │ - 9#ifndef ONLY_SIMPLEX_INTERSECTIONS │ │ │ │ │ - 10// we currently support only one intersection type. If we want to support │ │ │ │ │ -more, │ │ │ │ │ - 11// we have to think about the semantics of our IndexSet │ │ │ │ │ - 12#error Not Implemented │ │ │ │ │ - 13#endif │ │ │ │ │ - 14 │ │ │ │ │ - 15namespace Dune { │ │ │ │ │ - 16 namespace GridGlue { │ │ │ │ │ + 11#ifndef DUNE_GRIDGLUE_ADAPTER_INTERSECTION_HH │ │ │ │ │ + 12#define DUNE_GRIDGLUE_ADAPTER_INTERSECTION_HH │ │ │ │ │ + 13 │ │ │ │ │ + 14#include │ │ │ │ │ + 15#include │ │ │ │ │ + 16#include │ │ │ │ │ 17 │ │ │ │ │ - 18 template │ │ │ │ │ -19 class IntersectionIndexSet │ │ │ │ │ - 20 { │ │ │ │ │ - 21 friend class ::Dune::GridGlue::GridGlue; │ │ │ │ │ - 22 typedef ::Dune::GridGlue::GridGlue GridGlue; │ │ │ │ │ + 18#include │ │ │ │ │ + 19#include │ │ │ │ │ + 20#include │ │ │ │ │ + 21#include │ │ │ │ │ + 22#include │ │ │ │ │ 23 │ │ │ │ │ - 24 public: │ │ │ │ │ +24#define ONLY_SIMPLEX_INTERSECTIONS │ │ │ │ │ 25 │ │ │ │ │ -27 typedef typename GridGlue::IndexType IndexType; │ │ │ │ │ -29 typedef size_t SizeType; │ │ │ │ │ - 30 │ │ │ │ │ - 33 template │ │ │ │ │ -34 IndexType index (const Intersection & i) const │ │ │ │ │ - 35 { │ │ │ │ │ - 36 return i.i_->index_; │ │ │ │ │ - 37 } │ │ │ │ │ - 38 │ │ │ │ │ -41 SizeType size () const │ │ │ │ │ - 42 { │ │ │ │ │ - 43 return glue_->size(); │ │ │ │ │ - 44 } │ │ │ │ │ - 45 │ │ │ │ │ - 46 private: │ │ │ │ │ - 47 │ │ │ │ │ - 49 IntersectionIndexSet(const GridGlue * g) : │ │ │ │ │ - 50 glue_(g) {} │ │ │ │ │ + 26namespace Dune { │ │ │ │ │ + 27 namespace GridGlue { │ │ │ │ │ + 28 │ │ │ │ │ + 29 // forward declaration │ │ │ │ │ + 30 template │ │ │ │ │ + 31 class IntersectionIndexSet; │ │ │ │ │ + 32 │ │ │ │ │ + 36 template │ │ │ │ │ +37 class IntersectionData │ │ │ │ │ + 38 { │ │ │ │ │ + 39 public: │ │ │ │ │ +40 typedef ::Dune::GridGlue::GridGlue GridGlue; │ │ │ │ │ + 41 │ │ │ │ │ +42 typedef typename GridGlue::IndexType IndexType; │ │ │ │ │ + 43 │ │ │ │ │ +45 static constexpr int coorddim = GridGlue::dimworld; │ │ │ │ │ + 46 │ │ │ │ │ + 47 private: │ │ │ │ │ + 48 // intermediate quantities │ │ │ │ │ + 49 template │ │ │ │ │ + 50 static constexpr int dim() { return GridGlue::template GridView:: │ │ │ │ │ +Grid::dimension - GridGlue::template GridPatch::codim; } │ │ │ │ │ 51 │ │ │ │ │ - 52 const GridGlue * glue_; │ │ │ │ │ - 53 }; │ │ │ │ │ - 54 │ │ │ │ │ - 55 } // end namespace GridGlue │ │ │ │ │ - 56} // end namespace Dune │ │ │ │ │ - 57 │ │ │ │ │ - 58#endif // DUNE_GRIDGLUE_ADAPTER_INTERSECTIONINDEXSET_HH │ │ │ │ │ + 52 public: │ │ │ │ │ +54 static constexpr int mydim = dim<0>() < dim<1>() ? dim<0>() : dim<1>(); │ │ │ │ │ + 55 │ │ │ │ │ + 56 template │ │ │ │ │ +57 using GridLocalGeometry = AffineGeometry< │ │ │ │ │ + 58 typename GridGlue::template GridView::ctype, mydim, GridGlue:: │ │ │ │ │ +template GridView::dimension>; │ │ │ │ │ + 59 │ │ │ │ │ +60 using Grid0LocalGeometry [[deprecated("please use GridLocalGeometry<0> │ │ │ │ │ +instead")]] = GridLocalGeometry<0>; │ │ │ │ │ +61 using Grid1LocalGeometry [[deprecated("please use GridLocalGeometry<1> │ │ │ │ │ +instead")]] = GridLocalGeometry<1>; │ │ │ │ │ + 62 │ │ │ │ │ + 63 template │ │ │ │ │ +64 using GridGeometry = AffineGeometry< │ │ │ │ │ + 65 typename GridGlue::template GridView::ctype, mydim, GridGlue:: │ │ │ │ │ +template GridView::dimensionworld>; │ │ │ │ │ + 66 │ │ │ │ │ +67 using Grid0Geometry [[deprecated("please use GridGeometry<0> instead")]] = │ │ │ │ │ +GridGeometry<0>; │ │ │ │ │ +68 using Grid1Geometry [[deprecated("please use GridGeometry<1> instead")]] = │ │ │ │ │ +GridGeometry<1>; │ │ │ │ │ + 69 │ │ │ │ │ + 70 template │ │ │ │ │ +71 using GridIndexType = typename GridGlue::template GridView::IndexSet:: │ │ │ │ │ +IndexType; │ │ │ │ │ + 72 │ │ │ │ │ +73 using Grid0IndexType [[deprecated("please use GridIndexType<0> instead")]] = │ │ │ │ │ +GridIndexType<0>; │ │ │ │ │ +74 using Grid1IndexType [[deprecated("please use GridIndexType<1> instead")]] = │ │ │ │ │ +GridIndexType<1>; │ │ │ │ │ + 75 │ │ │ │ │ + 77 IntersectionData(const GridGlue& glue, unsigned int mergeindex, unsigned │ │ │ │ │ +int offset, bool grid0local, bool grid1local); │ │ │ │ │ + 78 │ │ │ │ │ +80 IntersectionData() = default; │ │ │ │ │ + 81 │ │ │ │ │ + 82 /* Accessor Functions */ │ │ │ │ │ + 83 │ │ │ │ │ + 84 template │ │ │ │ │ +85 const GridLocalGeometry& localGeometry(unsigned int parentId = 0) │ │ │ │ │ +const │ │ │ │ │ + 86 { return *std::get(sideData_).gridlocalgeom[parentId]; } │ │ │ │ │ + 87 │ │ │ │ │ + 88 template │ │ │ │ │ +89 const GridGeometry& geometry() const │ │ │ │ │ + 90 { return *std::get(sideData_).gridgeom; } │ │ │ │ │ + 91 │ │ │ │ │ + 92 template │ │ │ │ │ +93 bool local() const │ │ │ │ │ + 94 { return std::get(sideData_).gridlocal; } │ │ │ │ │ + 95 │ │ │ │ │ + 96 template │ │ │ │ │ +97 IndexType index(unsigned int parentId = 0) const │ │ │ │ │ + 98 { return std::get(sideData_).gridindices[parentId]; } │ │ │ │ │ + 99 │ │ │ │ │ + 100 template │ │ │ │ │ +101 IndexType parents() const │ │ │ │ │ + 102 { return std::get(sideData_).gridindices.size(); } │ │ │ │ │ + 103 │ │ │ │ │ + 104 private: │ │ │ │ │ + 105 template │ │ │ │ │ + 106 void initializeGeometry(const GridGlue& glue, unsigned mergeindex); │ │ │ │ │ + 107 │ │ │ │ │ + 108 /* M E M B E R V A R I A B L E S */ │ │ │ │ │ + 109 │ │ │ │ │ + 110 public: │ │ │ │ │ +112 IndexType index_; │ │ │ │ │ + 113 │ │ │ │ │ + 114 private: │ │ │ │ │ + 115 template │ │ │ │ │ + 116 struct SideData { │ │ │ │ │ + 118 bool gridlocal = false; │ │ │ │ │ + 119 │ │ │ │ │ + 121 std::vector< GridIndexType > gridindices; │ │ │ │ │ + 122 │ │ │ │ │ + 124 std::vector< std::optional< GridLocalGeometry > > gridlocalgeom; │ │ │ │ │ + 125 │ │ │ │ │ + 133 std::optional< GridGeometry > gridgeom; │ │ │ │ │ + 134 }; │ │ │ │ │ + 135 │ │ │ │ │ + 136 std::tuple< SideData<0>, SideData<1> > sideData_; │ │ │ │ │ + 137 }; │ │ │ │ │ + 138 │ │ │ │ │ + 139 template │ │ │ │ │ + 140 template │ │ │ │ │ + 141 void IntersectionData::initializeGeometry(const GridGlue& glue, │ │ │ │ │ +unsigned mergeindex) │ │ │ │ │ + 142 { │ │ │ │ │ + 143 auto& data = std::get(sideData_); │ │ │ │ │ + 144 │ │ │ │ │ + 145 const unsigned n_parents = glue.merger_->template parents │ │ │ │ │ +(mergeindex); │ │ │ │ │ + 146 │ │ │ │ │ + 147 // init containers │ │ │ │ │ + 148 data.gridindices.resize(n_parents); │ │ │ │ │ + 149 data.gridlocalgeom.resize(n_parents); │ │ │ │ │ + 150 │ │ │ │ │ + 151 // default values │ │ │ │ │ + 152 data.gridindices[0] = 0; │ │ │ │ │ + 153 │ │ │ │ │ + 154 static constexpr int nSimplexCorners = mydim + 1; │ │ │ │ │ + 155 using ctype = typename GridGlue::ctype; │ │ │ │ │ + 156 │ │ │ │ │ + 157 // initialize the local and the global geometries of grid `side` │ │ │ │ │ + 158 │ │ │ │ │ + 159 // compute the coordinates of the subface's corners in codim 0 entity │ │ │ │ │ +local coordinates │ │ │ │ │ + 160 static constexpr int elementdim = GridGlue::template GridView:: │ │ │ │ │ +template Codim<0>::Geometry::mydimension; │ │ │ │ │ + 161 │ │ │ │ │ + 162 // coordinates within the subentity that contains the remote intersection │ │ │ │ │ + 163 std::array() >, nSimplexCorners> │ │ │ │ │ +corners_subEntity_local; │ │ │ │ │ + 164 │ │ │ │ │ + 165 for (unsigned int par = 0; par < n_parents; ++par) { │ │ │ │ │ + 166 for (int i = 0; i < nSimplexCorners; ++i) │ │ │ │ │ + 167 corners_subEntity_local[i] = glue.merger_->template parentLocal │ │ │ │ │ +(mergeindex, i, par); │ │ │ │ │ + 168 │ │ │ │ │ + 169 // Coordinates of the remote intersection corners wrt the element │ │ │ │ │ +coordinate system │ │ │ │ │ + 170 std::array, nSimplexCorners> │ │ │ │ │ +corners_element_local; │ │ │ │ │ + 171 │ │ │ │ │ + 172 if (data.gridlocal) { │ │ │ │ │ + 173 data.gridindices[par] = glue.merger_->template parent │ │ │ │ │ +(mergeindex,par); │ │ │ │ │ + 174 │ │ │ │ │ + 175 typename GridGlue::template GridPatch::LocalGeometry │ │ │ │ │ + 176 gridLocalGeometry = glue.template patch().geometryLocal │ │ │ │ │ +(data.gridindices[par]); │ │ │ │ │ + 177 for (std::size_t i=0; i::Geometry │ │ │ │ │ + 196 gridWorldGeometry = glue.template patch().geometry(data.gridindices │ │ │ │ │ +[par]); │ │ │ │ │ + 197 │ │ │ │ │ + 198 // world coordinates of the remote intersection corners │ │ │ │ │ + 199 std::array:: │ │ │ │ │ +dimensionworld>, nSimplexCorners> corners_global; │ │ │ │ │ + 200 │ │ │ │ │ + 201 for (std::size_t i=0; i │ │ │ │ │ +213 IntersectionData::IntersectionData(const GridGlue& glue, unsigned │ │ │ │ │ +int mergeindex, unsigned int offset, │ │ │ │ │ + 214 bool grid0local, bool grid1local) │ │ │ │ │ + 215 : index_(mergeindex+offset) │ │ │ │ │ + 216 { │ │ │ │ │ + 217 // if an invalid index is given do not proceed! │ │ │ │ │ + 218 // (happens when the parent GridGlue initializes the "end"-Intersection) │ │ │ │ │ + 219 assert (0 <= mergeindex || mergeindex < glue.index__sz); │ │ │ │ │ + 220 │ │ │ │ │ + 221 std::get<0>(sideData_).gridlocal = grid0local; │ │ │ │ │ + 222 std::get<1>(sideData_).gridlocal = grid1local; │ │ │ │ │ + 223 │ │ │ │ │ + 224 initializeGeometry<0>(glue, mergeindex); │ │ │ │ │ + 225 initializeGeometry<1>(glue, mergeindex); │ │ │ │ │ + 226 } │ │ │ │ │ + 227 │ │ │ │ │ + 232 template │ │ │ │ │ +233 struct IntersectionTraits │ │ │ │ │ + 234 { │ │ │ │ │ +235 using GridGlue = ::Dune::GridGlue::GridGlue; │ │ │ │ │ +236 using IntersectionData = Dune::GridGlue::IntersectionData; │ │ │ │ │ + 237 │ │ │ │ │ +238 using InsideGridView = typename GridGlue::template GridView; │ │ │ │ │ +239 using OutsideGridView = typename GridGlue::template GridView; │ │ │ │ │ + 240 │ │ │ │ │ +241 using InsideLocalGeometry = typename IntersectionData::template │ │ │ │ │ +GridLocalGeometry; │ │ │ │ │ +242 using OutsideLocalGeometry = typename IntersectionData::template │ │ │ │ │ +GridLocalGeometry; │ │ │ │ │ + 243 │ │ │ │ │ +244 using Geometry = typename IntersectionData::template GridGeometry; │ │ │ │ │ +245 using OutsideGeometry = typename IntersectionData::template │ │ │ │ │ +GridGeometry; │ │ │ │ │ + 246 │ │ │ │ │ +247 static constexpr auto coorddim = IntersectionData::coorddim; │ │ │ │ │ +248 static constexpr auto mydim = IntersectionData::mydim; │ │ │ │ │ +249 static constexpr int insidePatch = inside; │ │ │ │ │ +250 static constexpr int outsidePatch = outside; │ │ │ │ │ + 251 │ │ │ │ │ +252 using ctype = typename GridGlue::ctype; │ │ │ │ │ +253 using LocalCoordinate = Dune::FieldVector; │ │ │ │ │ +254 using GlobalCoordinate = Dune::FieldVector; │ │ │ │ │ + 255 }; │ │ │ │ │ + 256 │ │ │ │ │ + 259 template │ │ │ │ │ +260 class Intersection │ │ │ │ │ + 261 { │ │ │ │ │ + 262 │ │ │ │ │ + 263 public: │ │ │ │ │ + 264 │ │ │ │ │ +265 typedef IntersectionTraits Traits; │ │ │ │ │ + 266 │ │ │ │ │ +267 typedef typename Traits::GridGlue GridGlue; │ │ │ │ │ +268 typedef typename Traits::IntersectionData IntersectionData; │ │ │ │ │ + 269 │ │ │ │ │ + 270 │ │ │ │ │ +271 typedef typename Traits::InsideGridView InsideGridView; │ │ │ │ │ +272 typedef typename Traits::InsideLocalGeometry InsideLocalGeometry; │ │ │ │ │ + 273 │ │ │ │ │ +274 typedef typename Traits::OutsideGridView OutsideGridView; │ │ │ │ │ +275 typedef typename Traits::OutsideLocalGeometry OutsideLocalGeometry; │ │ │ │ │ +276 typedef typename Traits::OutsideGeometry OutsideGeometry; │ │ │ │ │ + 277 │ │ │ │ │ +278 typedef typename Traits::Geometry Geometry; │ │ │ │ │ +279 typedef typename Traits::ctype ctype; │ │ │ │ │ + 280 │ │ │ │ │ +281 typedef typename InsideGridView::Traits::template Codim<0>::Entity │ │ │ │ │ +InsideEntity; │ │ │ │ │ +282 typedef typename OutsideGridView::Traits::template Codim<0>::Entity │ │ │ │ │ +OutsideEntity; │ │ │ │ │ + 283 │ │ │ │ │ +284 typedef typename Traits::LocalCoordinate LocalCoordinate; │ │ │ │ │ +285 typedef typename Traits::GlobalCoordinate GlobalCoordinate; │ │ │ │ │ + 286 │ │ │ │ │ +288 static constexpr auto coorddim = Traits::coorddim; │ │ │ │ │ + 289 │ │ │ │ │ +291 static constexpr auto mydim = Traits::mydim; │ │ │ │ │ + 292 │ │ │ │ │ +294 static constexpr int insidePatch = Traits::insidePatch; │ │ │ │ │ + 295 │ │ │ │ │ +297 static constexpr int outsidePatch = Traits::outsidePatch; │ │ │ │ │ + 298 │ │ │ │ │ + 299 // typedef unsigned int IndexType; │ │ │ │ │ + 300 │ │ │ │ │ + 301 private: │ │ │ │ │ + 305 static constexpr int codimensionWorld = coorddim - mydim; │ │ │ │ │ + 306 │ │ │ │ │ + 307 public: │ │ │ │ │ + 308 /* C O N S T R U C T O R S */ │ │ │ │ │ + 309 │ │ │ │ │ +311 Intersection(const GridGlue* glue, const IntersectionData* i) : │ │ │ │ │ + 312 glue_(glue), i_(i) {} │ │ │ │ │ + 313 │ │ │ │ │ + 314 /* F U N C T I O N A L I T Y */ │ │ │ │ │ + 315 │ │ │ │ │ + 318 InsideEntity │ │ │ │ │ +319 inside(unsigned int parentId = 0) const │ │ │ │ │ + 320 { │ │ │ │ │ + 321 assert(self()); │ │ │ │ │ + 322 return glue_->template patch().element(i_->template index │ │ │ │ │ +(parentId)); │ │ │ │ │ + 323 } │ │ │ │ │ + 324 │ │ │ │ │ + 327 OutsideEntity │ │ │ │ │ +328 outside(unsigned int parentId = 0) const │ │ │ │ │ + 329 { │ │ │ │ │ + 330 assert(neighbor()); │ │ │ │ │ + 331 return glue_->template patch().element(i_->template index │ │ │ │ │ +(parentId)); │ │ │ │ │ + 332 } │ │ │ │ │ + 333 │ │ │ │ │ +335 bool conforming() const │ │ │ │ │ + 336 { │ │ │ │ │ + 337 throw Dune::NotImplemented(); │ │ │ │ │ + 338 } │ │ │ │ │ + 339 │ │ │ │ │ +342 const InsideLocalGeometry& geometryInInside(unsigned int parentId = 0) │ │ │ │ │ +const │ │ │ │ │ + 343 { │ │ │ │ │ + 344 return i_->template localGeometry(parentId); │ │ │ │ │ + 345 } │ │ │ │ │ + 346 │ │ │ │ │ +349 const OutsideLocalGeometry& geometryInOutside(unsigned int parentId = 0) │ │ │ │ │ +const │ │ │ │ │ + 350 { │ │ │ │ │ + 351 return i_->template localGeometry(parentId); │ │ │ │ │ + 352 } │ │ │ │ │ + 353 │ │ │ │ │ +360 const Geometry& geometry() const │ │ │ │ │ + 361 { │ │ │ │ │ + 362 return i_->template geometry(); │ │ │ │ │ + 363 } │ │ │ │ │ + 364 │ │ │ │ │ +371 const OutsideGeometry& geometryOutside() const // DUNE_DEPRECATED │ │ │ │ │ + 372 { │ │ │ │ │ + 373 return i_->template geometry(); │ │ │ │ │ + 374 } │ │ │ │ │ + 375 │ │ │ │ │ +377 Dune::GeometryType type() const │ │ │ │ │ + 378 { │ │ │ │ │ + 379 #ifdef ONLY_SIMPLEX_INTERSECTIONS │ │ │ │ │ + 380 # if DUNE_VERSION_NEWER(DUNE_GEOMETRY, 2, 6) │ │ │ │ │ + 381 return Dune::GeometryTypes::simplex(mydim); │ │ │ │ │ + 382 # else │ │ │ │ │ + 383 static const Dune::GeometryType type(Dune::GeometryType::simplex, mydim); │ │ │ │ │ + 384 return type; │ │ │ │ │ + 385 # endif │ │ │ │ │ + 386 #else │ │ │ │ │ + 387 #error Not Implemented │ │ │ │ │ + 388 #endif │ │ │ │ │ + 389 } │ │ │ │ │ + 390 │ │ │ │ │ + 391 │ │ │ │ │ +393 bool self() const │ │ │ │ │ + 394 { │ │ │ │ │ + 395 return i_->template local(); │ │ │ │ │ + 396 } │ │ │ │ │ + 397 │ │ │ │ │ +399 size_t neighbor(unsigned int g = 0) const │ │ │ │ │ + 400 { │ │ │ │ │ + 401 if (g == 0 && i_->template local()) { │ │ │ │ │ + 402 return i_->template parents(); │ │ │ │ │ + 403 } else if (g == 1 && i_->template local()) { │ │ │ │ │ + 404 return i_->template parents(); │ │ │ │ │ + 405 } │ │ │ │ │ + 406 return 0; │ │ │ │ │ + 407 } │ │ │ │ │ + 408 │ │ │ │ │ +410 int indexInInside(unsigned int parentId = 0) const │ │ │ │ │ + 411 { │ │ │ │ │ + 412 assert(self()); │ │ │ │ │ + 413 return glue_->template patch().indexInInside(i_->template index │ │ │ │ │ +(parentId)); │ │ │ │ │ + 414 } │ │ │ │ │ + 415 │ │ │ │ │ +417 int indexInOutside(unsigned int parentId = 0) const │ │ │ │ │ + 418 { │ │ │ │ │ + 419 assert(neighbor()); │ │ │ │ │ + 420 return glue_->template patch().indexInInside(i_->template index │ │ │ │ │ +(parentId)); │ │ │ │ │ + 421 } │ │ │ │ │ + 422 │ │ │ │ │ +427 GlobalCoordinate outerNormal(const LocalCoordinate &local) const │ │ │ │ │ + 428 { │ │ │ │ │ + 429 GlobalCoordinate normal; │ │ │ │ │ + 430 │ │ │ │ │ + 431 if (codimensionWorld == 0) │ │ │ │ │ + 432 DUNE_THROW(Dune::Exception, "There is no normal vector to a full- │ │ │ │ │ +dimensional intersection"); │ │ │ │ │ + 433 else if (codimensionWorld == 1) { │ │ │ │ │ + 434 /* TODO: Implement the general n-ary cross product here */ │ │ │ │ │ + 435 const auto jacobianTransposed = geometry().jacobianTransposed(local); │ │ │ │ │ + 436 if (mydim==1) { │ │ │ │ │ + 437 normal[0] = - jacobianTransposed[0][1]; │ │ │ │ │ + 438 normal[1] = jacobianTransposed[0][0]; │ │ │ │ │ + 439 } else if (mydim==2) { │ │ │ │ │ + 440 normal[0] = (jacobianTransposed[0][1] * jacobianTransposed[1][2] - │ │ │ │ │ +jacobianTransposed[0][2] * jacobianTransposed[1][1]); │ │ │ │ │ + 441 normal[1] = - (jacobianTransposed[0][0] * jacobianTransposed[1][2] - │ │ │ │ │ +jacobianTransposed[0][2] * jacobianTransposed[1][0]); │ │ │ │ │ + 442 normal[2] = (jacobianTransposed[0][0] * jacobianTransposed[1][1] - │ │ │ │ │ +jacobianTransposed[0][1] * jacobianTransposed[1][0]); │ │ │ │ │ + 443 } else │ │ │ │ │ + 444 DUNE_THROW(Dune::NotImplemented, "Remote intersections don't implement the │ │ │ │ │ +'outerNormal' method for " << mydim << "-dimensional intersections yet"); │ │ │ │ │ + 445 } else │ │ │ │ │ + 446 DUNE_THROW(Dune::NotImplemented, "Remote intersections don't implement the │ │ │ │ │ +'outerNormal' method for intersections with codim >= 2 yet"); │ │ │ │ │ + 447 │ │ │ │ │ + 448 return normal; │ │ │ │ │ + 449 } │ │ │ │ │ + 450 │ │ │ │ │ +455 GlobalCoordinate unitOuterNormal(const LocalCoordinate &local) const │ │ │ │ │ + 456 { │ │ │ │ │ + 457 GlobalCoordinate normal = outerNormal(local); │ │ │ │ │ + 458 normal /= normal.two_norm(); │ │ │ │ │ + 459 return normal; │ │ │ │ │ + 460 } │ │ │ │ │ + 461 │ │ │ │ │ +466 GlobalCoordinate integrationOuterNormal(const LocalCoordinate &local) const │ │ │ │ │ + 467 { │ │ │ │ │ + 468 return (unitOuterNormal(local) *= geometry().integrationElement(local)); │ │ │ │ │ + 469 } │ │ │ │ │ + 470 │ │ │ │ │ +475 GlobalCoordinate centerUnitOuterNormal () const │ │ │ │ │ + 476 { │ │ │ │ │ + 477 return unitOuterNormal(ReferenceElements::general(type │ │ │ │ │ +()).position(0,0)); │ │ │ │ │ + 478 } │ │ │ │ │ + 479 │ │ │ │ │ +483 Intersection flip() const │ │ │ │ │ + 484 { │ │ │ │ │ + 485 return Intersection(glue_,i_); │ │ │ │ │ + 486 } │ │ │ │ │ + 487 │ │ │ │ │ + 488#ifdef QUICKHACK_INDEX │ │ │ │ │ + 489 typedef typename GridGlue::IndexType IndexType; │ │ │ │ │ + 490 │ │ │ │ │ + 491 IndexType index() const │ │ │ │ │ + 492 { │ │ │ │ │ + 493 return i_->index_; │ │ │ │ │ + 494 } │ │ │ │ │ + 495 │ │ │ │ │ + 496#endif │ │ │ │ │ + 497 │ │ │ │ │ + 498 private: │ │ │ │ │ + 499 │ │ │ │ │ + 500 friend class IntersectionIndexSet; │ │ │ │ │ + 501 │ │ │ │ │ + 502 /* M E M B E R V A R I A B L E S */ │ │ │ │ │ + 503 │ │ │ │ │ + 505 const GridGlue* glue_; │ │ │ │ │ + 506 │ │ │ │ │ + 508 const IntersectionData* i_; │ │ │ │ │ + 509 }; │ │ │ │ │ + 510 │ │ │ │ │ + 511 │ │ │ │ │ + 512 } // end namespace GridGlue │ │ │ │ │ + 513} // end namespace Dune │ │ │ │ │ + 514 │ │ │ │ │ + 515#endif // DUNE_GRIDGLUE_ADAPTER_INTERSECTION_HH │ │ │ │ │ gridglue.hh │ │ │ │ │ Central component of the module implementing the coupling of two grids. │ │ │ │ │ -intersection.hh │ │ │ │ │ -Model of the Intersection concept provided by GridGlue. │ │ │ │ │ Dune │ │ │ │ │ Definition: gridglue.hh:37 │ │ │ │ │ +Dune::GridGlue::ProjectionImplementation::inside │ │ │ │ │ +bool inside(const Coordinate &x, const Field &epsilon) │ │ │ │ │ +Definition: projection_impl.hh:111 │ │ │ │ │ Dune::GridGlue::GridGlue │ │ │ │ │ sequential adapter to couple two grids at specified close together boundaries │ │ │ │ │ Definition: gridglue.hh:67 │ │ │ │ │ Dune::GridGlue::GridGlue::IndexType │ │ │ │ │ unsigned int IndexType │ │ │ │ │ Definition: gridglue.hh:147 │ │ │ │ │ -Dune::GridGlue::GridGlue::size │ │ │ │ │ -size_t size() const │ │ │ │ │ -Definition: gridglue.hh:393 │ │ │ │ │ +Dune::GridGlue::GridGlue::ctype │ │ │ │ │ +PromotionTraits< typenameGridView< 0 >::ctype, typenameGridView< 1 >::ctype >:: │ │ │ │ │ +PromotedType ctype │ │ │ │ │ +The type used for coordinates. │ │ │ │ │ +Definition: gridglue.hh:171 │ │ │ │ │ +Dune::GridGlue::GridGlue::dimworld │ │ │ │ │ +static constexpr int dimworld │ │ │ │ │ +export the world dimension This is the maximum of the extractors' world │ │ │ │ │ +dimensions. │ │ │ │ │ +Definition: gridglue.hh:166 │ │ │ │ │ +Dune::GridGlue::IntersectionData │ │ │ │ │ +storage class for Dune::GridGlue::Intersection related data │ │ │ │ │ +Definition: intersection.hh:38 │ │ │ │ │ +Dune::GridGlue::IntersectionData::IndexType │ │ │ │ │ +GridGlue::IndexType IndexType │ │ │ │ │ +Definition: intersection.hh:42 │ │ │ │ │ +Dune::GridGlue::IntersectionData::GridGeometry │ │ │ │ │ +AffineGeometry< typename GridGlue::template GridView< side >::ctype, mydim, │ │ │ │ │ +GridGlue::template GridView< side >::dimensionworld > GridGeometry │ │ │ │ │ +Definition: intersection.hh:65 │ │ │ │ │ +Dune::GridGlue::IntersectionData::localGeometry │ │ │ │ │ +const GridLocalGeometry< side > & localGeometry(unsigned int parentId=0) const │ │ │ │ │ +Definition: intersection.hh:85 │ │ │ │ │ +Dune::GridGlue::IntersectionData::coorddim │ │ │ │ │ +static constexpr int coorddim │ │ │ │ │ +Dimension of the world space of the intersection. │ │ │ │ │ +Definition: intersection.hh:45 │ │ │ │ │ +Dune::GridGlue::IntersectionData::Grid0Geometry │ │ │ │ │ +GridGeometry< 0 > Grid0Geometry │ │ │ │ │ +Definition: intersection.hh:67 │ │ │ │ │ +Dune::GridGlue::IntersectionData::GridIndexType │ │ │ │ │ +typename GridGlue::template GridView< side >::IndexSet::IndexType GridIndexType │ │ │ │ │ +Definition: intersection.hh:71 │ │ │ │ │ +Dune::GridGlue::IntersectionData::index │ │ │ │ │ +IndexType index(unsigned int parentId=0) const │ │ │ │ │ +Definition: intersection.hh:97 │ │ │ │ │ +Dune::GridGlue::IntersectionData::parents │ │ │ │ │ +IndexType parents() const │ │ │ │ │ +Definition: intersection.hh:101 │ │ │ │ │ +Dune::GridGlue::IntersectionData::Grid1LocalGeometry │ │ │ │ │ +GridLocalGeometry< 1 > Grid1LocalGeometry │ │ │ │ │ +Definition: intersection.hh:61 │ │ │ │ │ +Dune::GridGlue::IntersectionData::geometry │ │ │ │ │ +const GridGeometry< side > & geometry() const │ │ │ │ │ +Definition: intersection.hh:89 │ │ │ │ │ +Dune::GridGlue::IntersectionData::local │ │ │ │ │ +bool local() const │ │ │ │ │ +Definition: intersection.hh:93 │ │ │ │ │ +Dune::GridGlue::IntersectionData::GridGlue │ │ │ │ │ +::Dune::GridGlue::GridGlue< P0, P1 > GridGlue │ │ │ │ │ +Definition: intersection.hh:40 │ │ │ │ │ +Dune::GridGlue::IntersectionData::mydim │ │ │ │ │ +static constexpr int mydim │ │ │ │ │ +Dimension of the intersection. │ │ │ │ │ +Definition: intersection.hh:54 │ │ │ │ │ +Dune::GridGlue::IntersectionData::GridLocalGeometry │ │ │ │ │ +AffineGeometry< typename GridGlue::template GridView< side >::ctype, mydim, │ │ │ │ │ +GridGlue::template GridView< side >::dimension > GridLocalGeometry │ │ │ │ │ +Definition: intersection.hh:58 │ │ │ │ │ +Dune::GridGlue::IntersectionData::Grid0LocalGeometry │ │ │ │ │ +GridLocalGeometry< 0 > Grid0LocalGeometry │ │ │ │ │ +Definition: intersection.hh:60 │ │ │ │ │ Dune::GridGlue::IntersectionData::index_ │ │ │ │ │ IndexType index_ │ │ │ │ │ index of this intersection after GridGlue interface │ │ │ │ │ Definition: intersection.hh:112 │ │ │ │ │ +Dune::GridGlue::IntersectionData::Grid1IndexType │ │ │ │ │ +GridIndexType< 1 > Grid1IndexType │ │ │ │ │ +Definition: intersection.hh:74 │ │ │ │ │ +Dune::GridGlue::IntersectionData::Grid1Geometry │ │ │ │ │ +GridGeometry< 1 > Grid1Geometry │ │ │ │ │ +Definition: intersection.hh:68 │ │ │ │ │ +Dune::GridGlue::IntersectionData::Grid0IndexType │ │ │ │ │ +GridIndexType< 0 > Grid0IndexType │ │ │ │ │ +Definition: intersection.hh:73 │ │ │ │ │ +Dune::GridGlue::IntersectionData::IntersectionData │ │ │ │ │ +IntersectionData()=default │ │ │ │ │ +Default Constructor. │ │ │ │ │ Dune::GridGlue::Intersection │ │ │ │ │ The intersection of two entities of the two patches of a GridGlue. │ │ │ │ │ Definition: intersection.hh:261 │ │ │ │ │ -Dune::GridGlue::IntersectionIndexSet │ │ │ │ │ -Definition: intersectionindexset.hh:20 │ │ │ │ │ -Dune::GridGlue::IntersectionIndexSet::size │ │ │ │ │ -SizeType size() const │ │ │ │ │ -Return total number of intersections. │ │ │ │ │ -Definition: intersectionindexset.hh:41 │ │ │ │ │ -Dune::GridGlue::IntersectionIndexSet::IndexType │ │ │ │ │ -GridGlue::IndexType IndexType │ │ │ │ │ -The type used for the indices. │ │ │ │ │ -Definition: intersectionindexset.hh:27 │ │ │ │ │ -Dune::GridGlue::IntersectionIndexSet::index │ │ │ │ │ -IndexType index(const Intersection< P0, P1, I, O > &i) const │ │ │ │ │ -Map Dune::GridGlue::Intersection to index. │ │ │ │ │ -Definition: intersectionindexset.hh:34 │ │ │ │ │ -Dune::GridGlue::IntersectionIndexSet::SizeType │ │ │ │ │ -size_t SizeType │ │ │ │ │ -The type used for the size. │ │ │ │ │ -Definition: intersectionindexset.hh:29 │ │ │ │ │ +Dune::GridGlue::Intersection::OutsideLocalGeometry │ │ │ │ │ +Traits::OutsideLocalGeometry OutsideLocalGeometry │ │ │ │ │ +Definition: intersection.hh:275 │ │ │ │ │ +Dune::GridGlue::Intersection::flip │ │ │ │ │ +Intersection< P0, P1, O, I > flip() const │ │ │ │ │ +Return a copy of the intersection with inside and outside switched. │ │ │ │ │ +Definition: intersection.hh:483 │ │ │ │ │ +Dune::GridGlue::Intersection::conforming │ │ │ │ │ +bool conforming() const │ │ │ │ │ +Return true if intersection is conforming. │ │ │ │ │ +Definition: intersection.hh:335 │ │ │ │ │ +Dune::GridGlue::Intersection::InsideEntity │ │ │ │ │ +InsideGridView::Traits::template Codim< 0 >::Entity InsideEntity │ │ │ │ │ +Definition: intersection.hh:281 │ │ │ │ │ +Dune::GridGlue::Intersection::GridGlue │ │ │ │ │ +Traits::GridGlue GridGlue │ │ │ │ │ +Definition: intersection.hh:267 │ │ │ │ │ +Dune::GridGlue::Intersection::indexInOutside │ │ │ │ │ +int indexInOutside(unsigned int parentId=0) const │ │ │ │ │ +Local number of codim 1 entity in outside() Entity where intersection is │ │ │ │ │ +contained in. │ │ │ │ │ +Definition: intersection.hh:417 │ │ │ │ │ +Dune::GridGlue::Intersection::indexInInside │ │ │ │ │ +int indexInInside(unsigned int parentId=0) const │ │ │ │ │ +Local number of codim 1 entity in the inside() Entity where intersection is │ │ │ │ │ +contained in. │ │ │ │ │ +Definition: intersection.hh:410 │ │ │ │ │ +Dune::GridGlue::Intersection::self │ │ │ │ │ +bool self() const │ │ │ │ │ +For parallel computations: Return true if inside() entity exists locally. │ │ │ │ │ +Definition: intersection.hh:393 │ │ │ │ │ +Dune::GridGlue::Intersection::mydim │ │ │ │ │ +static constexpr auto mydim │ │ │ │ │ +dimension of the intersection │ │ │ │ │ +Definition: intersection.hh:291 │ │ │ │ │ +Dune::GridGlue::Intersection::outsidePatch │ │ │ │ │ +static constexpr int outsidePatch │ │ │ │ │ +outside patch │ │ │ │ │ +Definition: intersection.hh:297 │ │ │ │ │ +Dune::GridGlue::Intersection::type │ │ │ │ │ +Dune::GeometryType type() const │ │ │ │ │ +Type of reference element for this intersection. │ │ │ │ │ +Definition: intersection.hh:377 │ │ │ │ │ +Dune::GridGlue::Intersection::inside │ │ │ │ │ +InsideEntity inside(unsigned int parentId=0) const │ │ │ │ │ +Return element on the inside of this intersection. │ │ │ │ │ +Definition: intersection.hh:319 │ │ │ │ │ +Dune::GridGlue::Intersection::LocalCoordinate │ │ │ │ │ +Traits::LocalCoordinate LocalCoordinate │ │ │ │ │ +Definition: intersection.hh:284 │ │ │ │ │ +Dune::GridGlue::Intersection::geometryInOutside │ │ │ │ │ +const OutsideLocalGeometry & geometryInOutside(unsigned int parentId=0) const │ │ │ │ │ +Geometric information about this intersection in local coordinates of the │ │ │ │ │ +outside() element. │ │ │ │ │ +Definition: intersection.hh:349 │ │ │ │ │ +Dune::GridGlue::Intersection::unitOuterNormal │ │ │ │ │ +GlobalCoordinate unitOuterNormal(const LocalCoordinate &local) const │ │ │ │ │ +Return a unit outer normal. │ │ │ │ │ +Definition: intersection.hh:455 │ │ │ │ │ +Dune::GridGlue::Intersection::ctype │ │ │ │ │ +Traits::ctype ctype │ │ │ │ │ +Definition: intersection.hh:279 │ │ │ │ │ +Dune::GridGlue::Intersection::Traits │ │ │ │ │ +IntersectionTraits< P0, P1, I, O > Traits │ │ │ │ │ +Definition: intersection.hh:265 │ │ │ │ │ +Dune::GridGlue::Intersection::IntersectionData │ │ │ │ │ +Traits::IntersectionData IntersectionData │ │ │ │ │ +Definition: intersection.hh:268 │ │ │ │ │ +Dune::GridGlue::Intersection::GlobalCoordinate │ │ │ │ │ +Traits::GlobalCoordinate GlobalCoordinate │ │ │ │ │ +Definition: intersection.hh:285 │ │ │ │ │ +Dune::GridGlue::Intersection::OutsideGeometry │ │ │ │ │ +Traits::OutsideGeometry OutsideGeometry │ │ │ │ │ +Definition: intersection.hh:276 │ │ │ │ │ +Dune::GridGlue::Intersection::neighbor │ │ │ │ │ +size_t neighbor(unsigned int g=0) const │ │ │ │ │ +Return number of embeddings into local grid0 (grid1) entities. │ │ │ │ │ +Definition: intersection.hh:399 │ │ │ │ │ +Dune::GridGlue::Intersection::Intersection │ │ │ │ │ +Intersection(const GridGlue *glue, const IntersectionData *i) │ │ │ │ │ +Constructor for a given Dataset. │ │ │ │ │ +Definition: intersection.hh:311 │ │ │ │ │ +Dune::GridGlue::Intersection::insidePatch │ │ │ │ │ +static constexpr int insidePatch │ │ │ │ │ +inside patch │ │ │ │ │ +Definition: intersection.hh:294 │ │ │ │ │ +Dune::GridGlue::Intersection::Geometry │ │ │ │ │ +Traits::Geometry Geometry │ │ │ │ │ +Definition: intersection.hh:278 │ │ │ │ │ +Dune::GridGlue::Intersection::OutsideEntity │ │ │ │ │ +OutsideGridView::Traits::template Codim< 0 >::Entity OutsideEntity │ │ │ │ │ +Definition: intersection.hh:282 │ │ │ │ │ +Dune::GridGlue::Intersection::outside │ │ │ │ │ +OutsideEntity outside(unsigned int parentId=0) const │ │ │ │ │ +Return element on the outside of this intersection. │ │ │ │ │ +Definition: intersection.hh:328 │ │ │ │ │ +Dune::GridGlue::Intersection::geometry │ │ │ │ │ +const Geometry & geometry() const │ │ │ │ │ +Geometric information about this intersection as part of the inside grid. │ │ │ │ │ +Definition: intersection.hh:360 │ │ │ │ │ +Dune::GridGlue::Intersection::InsideLocalGeometry │ │ │ │ │ +Traits::InsideLocalGeometry InsideLocalGeometry │ │ │ │ │ +Definition: intersection.hh:272 │ │ │ │ │ +Dune::GridGlue::Intersection::outerNormal │ │ │ │ │ +GlobalCoordinate outerNormal(const LocalCoordinate &local) const │ │ │ │ │ +Return an outer normal (length not necessarily 1) │ │ │ │ │ +Definition: intersection.hh:427 │ │ │ │ │ +Dune::GridGlue::Intersection::geometryOutside │ │ │ │ │ +const OutsideGeometry & geometryOutside() const │ │ │ │ │ +Geometric information about this intersection as part of the outside grid. │ │ │ │ │ +Definition: intersection.hh:371 │ │ │ │ │ +Dune::GridGlue::Intersection::OutsideGridView │ │ │ │ │ +Traits::OutsideGridView OutsideGridView │ │ │ │ │ +Definition: intersection.hh:274 │ │ │ │ │ +Dune::GridGlue::Intersection::integrationOuterNormal │ │ │ │ │ +GlobalCoordinate integrationOuterNormal(const LocalCoordinate &local) const │ │ │ │ │ +Return an outer normal with the length of the integration element. │ │ │ │ │ +Definition: intersection.hh:466 │ │ │ │ │ +Dune::GridGlue::Intersection::InsideGridView │ │ │ │ │ +Traits::InsideGridView InsideGridView │ │ │ │ │ +Definition: intersection.hh:271 │ │ │ │ │ +Dune::GridGlue::Intersection::geometryInInside │ │ │ │ │ +const InsideLocalGeometry & geometryInInside(unsigned int parentId=0) const │ │ │ │ │ +Geometric information about this intersection in local coordinates of the │ │ │ │ │ +inside() element. │ │ │ │ │ +Definition: intersection.hh:342 │ │ │ │ │ +Dune::GridGlue::Intersection::centerUnitOuterNormal │ │ │ │ │ +GlobalCoordinate centerUnitOuterNormal() const │ │ │ │ │ +Unit outer normal at the center of the intersection. │ │ │ │ │ +Definition: intersection.hh:475 │ │ │ │ │ +Dune::GridGlue::Intersection::coorddim │ │ │ │ │ +static constexpr auto coorddim │ │ │ │ │ +dimension of the world space of the intersection │ │ │ │ │ +Definition: intersection.hh:288 │ │ │ │ │ +Dune::GridGlue::IntersectionTraits │ │ │ │ │ +Definition: intersection.hh:234 │ │ │ │ │ +Dune::GridGlue::IntersectionTraits::insidePatch │ │ │ │ │ +static constexpr int insidePatch │ │ │ │ │ +Definition: intersection.hh:249 │ │ │ │ │ +Dune::GridGlue::IntersectionTraits::LocalCoordinate │ │ │ │ │ +Dune::FieldVector< ctype, mydim > LocalCoordinate │ │ │ │ │ +Definition: intersection.hh:253 │ │ │ │ │ +Dune::GridGlue::IntersectionTraits::coorddim │ │ │ │ │ +static constexpr auto coorddim │ │ │ │ │ +Definition: intersection.hh:247 │ │ │ │ │ +Dune::GridGlue::IntersectionTraits::OutsideGeometry │ │ │ │ │ +typename IntersectionData::template GridGeometry< outside > OutsideGeometry │ │ │ │ │ +Definition: intersection.hh:245 │ │ │ │ │ +Dune::GridGlue::IntersectionTraits::ctype │ │ │ │ │ +typename GridGlue::ctype ctype │ │ │ │ │ +Definition: intersection.hh:252 │ │ │ │ │ +Dune::GridGlue::IntersectionTraits::OutsideGridView │ │ │ │ │ +typename GridGlue::template GridView< outside > OutsideGridView │ │ │ │ │ +Definition: intersection.hh:239 │ │ │ │ │ +Dune::GridGlue::IntersectionTraits::GlobalCoordinate │ │ │ │ │ +Dune::FieldVector< ctype, coorddim > GlobalCoordinate │ │ │ │ │ +Definition: intersection.hh:254 │ │ │ │ │ +Dune::GridGlue::IntersectionTraits::OutsideLocalGeometry │ │ │ │ │ +typename IntersectionData::template GridLocalGeometry< outside > │ │ │ │ │ +OutsideLocalGeometry │ │ │ │ │ +Definition: intersection.hh:242 │ │ │ │ │ +Dune::GridGlue::IntersectionTraits::InsideGridView │ │ │ │ │ +typename GridGlue::template GridView< inside > InsideGridView │ │ │ │ │ +Definition: intersection.hh:238 │ │ │ │ │ +Dune::GridGlue::IntersectionTraits::Geometry │ │ │ │ │ +typename IntersectionData::template GridGeometry< inside > Geometry │ │ │ │ │ +Definition: intersection.hh:244 │ │ │ │ │ +Dune::GridGlue::IntersectionTraits::InsideLocalGeometry │ │ │ │ │ +typename IntersectionData::template GridLocalGeometry< inside > │ │ │ │ │ +InsideLocalGeometry │ │ │ │ │ +Definition: intersection.hh:241 │ │ │ │ │ +Dune::GridGlue::IntersectionTraits::outsidePatch │ │ │ │ │ +static constexpr int outsidePatch │ │ │ │ │ +Definition: intersection.hh:250 │ │ │ │ │ +Dune::GridGlue::IntersectionTraits::mydim │ │ │ │ │ +static constexpr auto mydim │ │ │ │ │ +Definition: intersection.hh:248 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00017.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: intersection.hh File Reference │ │ │ │ +dune-grid-glue: gridgluecommunicate.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,73 +65,73 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces | │ │ │ │ -Macros
│ │ │ │ -
intersection.hh File Reference
│ │ │ │ +Typedefs | │ │ │ │ +Functions
│ │ │ │ +
gridgluecommunicate.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Model of the Intersection concept provided by GridGlue. │ │ │ │ +

Describes the parallel communication interface class for Dune::GridGlue. │ │ │ │ More...

│ │ │ │ -
#include <algorithm>
│ │ │ │ -#include <optional>
│ │ │ │ -#include <tuple>
│ │ │ │ -#include <dune/common/deprecated.hh>
│ │ │ │ -#include <dune/common/version.hh>
│ │ │ │ -#include <dune/geometry/affinegeometry.hh>
│ │ │ │ -#include <dune/geometry/referenceelements.hh>
│ │ │ │ -#include <dune/grid-glue/gridglue.hh>
│ │ │ │ +
#include <type_traits>
│ │ │ │ +#include <dune/common/bartonnackmanifcheck.hh>
│ │ │ │ +#include <dune/common/parallel/communicator.hh>
│ │ │ │ +#include <dune/grid/common/datahandleif.hh>
│ │ │ │ +#include <dune/grid/common/gridenums.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::GridGlue::IntersectionData< P0, P1 >
 storage class for Dune::GridGlue::Intersection related data More...
struct  Dune::GridGlue::GlobalId
 
struct  Dune::GridGlue::IntersectionTraits< P0, P1, inside, outside >
class  Dune::GridGlue::CommDataHandle< DataHandleImp, DataTypeImp >
 describes the features of a data handle for communication in parallel runs using the GridGlue::communicate methods. More...
 
class  Dune::GridGlue::Intersection< P0, P1, I, O >
 The intersection of two entities of the two patches of a GridGlue. More...
class  Dune::GridGlue::StreamingMessageBuffer< DT >
 
class  Dune::GridGlue::CommunicationOperator< dir >
 forward gather scatter to user defined CommInfo class More...
 
struct  Dune::GridGlue::CommInfo< GG, DataHandleImp, DataTypeImp >
 collects all GridGlue data requried for communication More...
 
struct  Dune::CommPolicy< ::Dune::GridGlue::CommInfo< GG, DataHandleImp, DataTypeImp > >
 specialization of the CommPolicy struct, required for the ParallelIndexsets More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ -Macros

#define ONLY_SIMPLEX_INTERSECTIONS
 

│ │ │ │ +Typedefs

typedef std::pair< int, int > Dune::GridGlue::RankPair
 
typedef CommunicationOperator< Dune::ForwardCommunication > Dune::GridGlue::ForwardOperator
 
typedef CommunicationOperator< Dune::BackwardCommunication > Dune::GridGlue::BackwardOperator
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +Functions

std::ostream & Dune::GridGlue::operator<< (std::ostream &os, const GlobalId &id)
 
│ │ │ │

Detailed Description

│ │ │ │ -

Model of the Intersection concept provided by GridGlue.

│ │ │ │ +

Describes the parallel communication interface class for Dune::GridGlue.

│ │ │ │
Author
Christian Engwer
│ │ │ │ -

Macro Definition Documentation

│ │ │ │ - │ │ │ │ -

◆ ONLY_SIMPLEX_INTERSECTIONS

│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
#define ONLY_SIMPLEX_INTERSECTIONS
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,47 +5,62 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * adapter │ │ │ │ │ -Classes | Namespaces | Macros │ │ │ │ │ -intersection.hh File Reference │ │ │ │ │ -Model of the Intersection concept provided by GridGlue. More... │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +Classes | Namespaces | Typedefs | Functions │ │ │ │ │ +gridgluecommunicate.hh File Reference │ │ │ │ │ +Describes the parallel communication interface class for Dune::GridGlue. │ │ │ │ │ +More... │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ - class  Dune::GridGlue::IntersectionData<_P0,_P1_> │ │ │ │ │ -  storage class for Dune::GridGlue::Intersection related data More... │ │ │ │ │ +struct  Dune::GridGlue::GlobalId │ │ │ │ │   │ │ │ │ │ -struct  Dune::GridGlue::IntersectionTraits<_P0,_P1,_inside,_outside_> │ │ │ │ │ + class  Dune::GridGlue::CommDataHandle<_DataHandleImp,_DataTypeImp_> │ │ │ │ │ +  describes the features of a data handle for communication in parallel │ │ │ │ │ + runs using the GridGlue::communicate methods. More... │ │ │ │ │   │ │ │ │ │ - class  Dune::GridGlue::Intersection<_P0,_P1,_I,_O_> │ │ │ │ │ -  The intersection of two entities of the two patches of a GridGlue. │ │ │ │ │ - More... │ │ │ │ │ + class  Dune::GridGlue::StreamingMessageBuffer<_DT_> │ │ │ │ │ +  │ │ │ │ │ + class  Dune::GridGlue::CommunicationOperator<_dir_> │ │ │ │ │ +  forward gather scatter to user defined CommInfo class More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::GridGlue::CommInfo<_GG,_DataHandleImp,_DataTypeImp_> │ │ │ │ │ +  collects all GridGlue data requried for communication More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::CommPolicy<_::Dune::GridGlue::CommInfo<_GG,_DataHandleImp, │ │ │ │ │ + DataTypeImp_>_> │ │ │ │ │ +  specialization of the CommPolicy struct, required for the │ │ │ │ │ + ParallelIndexsets More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::GridGlue │ │ │ │ │   │ │ │ │ │ - Macros │ │ │ │ │ -#define ONLY_SIMPLEX_INTERSECTIONS │ │ │ │ │ + Typedefs │ │ │ │ │ + typedef std::pair< int, int > Dune::GridGlue::RankPair │ │ │ │ │ +  │ │ │ │ │ +typedef CommunicationOperator< Dune:: │ │ │ │ │ + ForwardCommunication > Dune::GridGlue::ForwardOperator │ │ │ │ │ +  │ │ │ │ │ +typedef CommunicationOperator< Dune:: │ │ │ │ │ + BackwardCommunication > Dune::GridGlue::BackwardOperator │ │ │ │ │ +  │ │ │ │ │ + Functions │ │ │ │ │ +std::ostream & Dune::GridGlue::operator<< (std::ostream &os, const GlobalId │ │ │ │ │ + &id) │ │ │ │ │   │ │ │ │ │ ***** Detailed Description ***** │ │ │ │ │ -Model of the Intersection concept provided by GridGlue. │ │ │ │ │ +Describes the parallel communication interface class for Dune::GridGlue. │ │ │ │ │ Author │ │ │ │ │ Christian Engwer │ │ │ │ │ -***** Macro Definition Documentation ***** │ │ │ │ │ -***** ◆ ONLY_SIMPLEX_INTERSECTIONS ***** │ │ │ │ │ -#define ONLY_SIMPLEX_INTERSECTIONS │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00017_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: intersection.hh Source File │ │ │ │ +dune-grid-glue: gridgluecommunicate.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,525 +62,323 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
intersection.hh
│ │ │ │ +
gridgluecommunicate.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 © DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
4// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
│ │ │ │ -
11#ifndef DUNE_GRIDGLUE_ADAPTER_INTERSECTION_HH
│ │ │ │ -
12#define DUNE_GRIDGLUE_ADAPTER_INTERSECTION_HH
│ │ │ │ -
13
│ │ │ │ -
14#include <algorithm>
│ │ │ │ -
15#include <optional>
│ │ │ │ -
16#include <tuple>
│ │ │ │ -
17
│ │ │ │ -
18#include <dune/common/deprecated.hh>
│ │ │ │ -
19#include <dune/common/version.hh>
│ │ │ │ -
20#include <dune/geometry/affinegeometry.hh>
│ │ │ │ -
21#include <dune/geometry/referenceelements.hh>
│ │ │ │ - │ │ │ │ +
5#ifndef DUNE_GRIDGLUE_ADAPTER_GRIDGLUECOMMUNICATE_HH
│ │ │ │ +
6#define DUNE_GRIDGLUE_ADAPTER_GRIDGLUECOMMUNICATE_HH
│ │ │ │ +
7
│ │ │ │ +
13#include <type_traits>
│ │ │ │ +
14
│ │ │ │ +
15#include <dune/common/bartonnackmanifcheck.hh>
│ │ │ │ +
16#include <dune/common/parallel/communicator.hh>
│ │ │ │ +
17#include <dune/grid/common/datahandleif.hh>
│ │ │ │ +
18#include <dune/grid/common/gridenums.hh>
│ │ │ │ +
19
│ │ │ │ +
20
│ │ │ │ +
21namespace Dune {
│ │ │ │ +
22 namespace GridGlue {
│ │ │ │
23
│ │ │ │ -
24#define ONLY_SIMPLEX_INTERSECTIONS
│ │ │ │ -
25
│ │ │ │ -
26namespace Dune {
│ │ │ │ -
27 namespace GridGlue {
│ │ │ │ -
28
│ │ │ │ -
29 // forward declaration
│ │ │ │ -
30 template<typename P0, typename P1>
│ │ │ │ -
31 class IntersectionIndexSet;
│ │ │ │ -
32
│ │ │ │ -
36 template<typename P0, typename P1>
│ │ │ │ - │ │ │ │ -
38 {
│ │ │ │ -
39 public:
│ │ │ │ -
40 typedef ::Dune::GridGlue::GridGlue<P0, P1> GridGlue;
│ │ │ │ -
41
│ │ │ │ - │ │ │ │ -
43
│ │ │ │ -
45 static constexpr int coorddim = GridGlue::dimworld;
│ │ │ │ -
46
│ │ │ │ -
47 private:
│ │ │ │ -
48 // intermediate quantities
│ │ │ │ -
49 template<int side>
│ │ │ │ -
50 static constexpr int dim() { return GridGlue::template GridView<side>::Grid::dimension - GridGlue::template GridPatch<side>::codim; }
│ │ │ │ -
51
│ │ │ │ -
52 public:
│ │ │ │ -
54 static constexpr int mydim = dim<0>() < dim<1>() ? dim<0>() : dim<1>();
│ │ │ │ -
55
│ │ │ │ -
56 template<int side>
│ │ │ │ -
57 using GridLocalGeometry = AffineGeometry<
│ │ │ │ -
58 typename GridGlue::template GridView<side>::ctype, mydim, GridGlue::template GridView<side>::dimension>;
│ │ │ │ -
59
│ │ │ │ -
60 using Grid0LocalGeometry [[deprecated("please use GridLocalGeometry<0> instead")]] = GridLocalGeometry<0>;
│ │ │ │ -
61 using Grid1LocalGeometry [[deprecated("please use GridLocalGeometry<1> instead")]] = GridLocalGeometry<1>;
│ │ │ │ +
24 typedef std::pair<int, int> RankPair;
│ │ │ │ +
25 struct GlobalId : public std::pair<RankPair, unsigned int>
│ │ │ │ +
26 {
│ │ │ │ + │ │ │ │ +
31 this->first.first = 0;
│ │ │ │ +
32 this->first.second = 0;
│ │ │ │ +
33 this->second = 0;
│ │ │ │ +
34 }
│ │ │ │ +
38 GlobalId(int i) {
│ │ │ │ +
39 this->first.first = i;
│ │ │ │ +
40 this->first.second = i;
│ │ │ │ +
41 this->second = 0;
│ │ │ │ +
42 }
│ │ │ │ +
48 GlobalId(int i, int j, unsigned int n) {
│ │ │ │ +
49 this->first.first = std::min(i,j);
│ │ │ │ +
50 this->first.second = std::max(i,j);
│ │ │ │ +
51 this->second = n;
│ │ │ │ +
52 }
│ │ │ │ +
53 };
│ │ │ │ +
54
│ │ │ │ +
55 inline std::ostream& operator<<(std::ostream& os, const GlobalId & id)
│ │ │ │ +
56 {
│ │ │ │ +
57 os << "("
│ │ │ │ +
58 << id.first.first << "," << id.first.second << ","
│ │ │ │ +
59 << id.second << ")";
│ │ │ │ +
60 return os;
│ │ │ │ +
61 }
│ │ │ │
62
│ │ │ │ -
63 template<int side>
│ │ │ │ -
64 using GridGeometry = AffineGeometry<
│ │ │ │ -
65 typename GridGlue::template GridView<side>::ctype, mydim, GridGlue::template GridView<side>::dimensionworld>;
│ │ │ │ -
66
│ │ │ │ -
67 using Grid0Geometry [[deprecated("please use GridGeometry<0> instead")]] = GridGeometry<0>;
│ │ │ │ -
68 using Grid1Geometry [[deprecated("please use GridGeometry<1> instead")]] = GridGeometry<1>;
│ │ │ │ -
69
│ │ │ │ -
70 template<int side>
│ │ │ │ -
71 using GridIndexType = typename GridGlue::template GridView<side>::IndexSet::IndexType;
│ │ │ │ -
72
│ │ │ │ -
73 using Grid0IndexType [[deprecated("please use GridIndexType<0> instead")]] = GridIndexType<0>;
│ │ │ │ -
74 using Grid1IndexType [[deprecated("please use GridIndexType<1> instead")]] = GridIndexType<1>;
│ │ │ │ -
75
│ │ │ │ -
77 IntersectionData(const GridGlue& glue, unsigned int mergeindex, unsigned int offset, bool grid0local, bool grid1local);
│ │ │ │ -
78
│ │ │ │ -
80 IntersectionData() = default;
│ │ │ │ +
75 template <class DataHandleImp, class DataTypeImp>
│ │ │ │ + │ │ │ │ +
77 {
│ │ │ │ +
78 public:
│ │ │ │ +
80 typedef DataTypeImp DataType;
│ │ │ │
81
│ │ │ │ -
82 /* Accessor Functions */
│ │ │ │ -
83
│ │ │ │ -
84 template<int side>
│ │ │ │ -
85 const GridLocalGeometry<side>& localGeometry(unsigned int parentId = 0) const
│ │ │ │ -
86 { return *std::get<side>(sideData_).gridlocalgeom[parentId]; }
│ │ │ │ +
82 protected:
│ │ │ │ +
83 // one should not create an explicit instance of this inteface object
│ │ │ │ + │ │ │ │ +
85
│ │ │ │ +
86 public:
│ │ │ │
87
│ │ │ │ -
88 template<int side>
│ │ │ │ - │ │ │ │ -
90 { return *std::get<side>(sideData_).gridgeom; }
│ │ │ │ -
91
│ │ │ │ -
92 template<int side>
│ │ │ │ -
93 bool local() const
│ │ │ │ -
94 { return std::get<side>(sideData_).gridlocal; }
│ │ │ │ -
95
│ │ │ │ -
96 template<int side>
│ │ │ │ -
97 IndexType index(unsigned int parentId = 0) const
│ │ │ │ -
98 { return std::get<side>(sideData_).gridindices[parentId]; }
│ │ │ │ -
99
│ │ │ │ -
100 template<int side>
│ │ │ │ - │ │ │ │ -
102 { return std::get<side>(sideData_).gridindices.size(); }
│ │ │ │ -
103
│ │ │ │ -
104 private:
│ │ │ │ -
105 template<int side>
│ │ │ │ -
106 void initializeGeometry(const GridGlue& glue, unsigned mergeindex);
│ │ │ │ -
107
│ │ │ │ -
108 /* M E M B E R V A R I A B L E S */
│ │ │ │ +
91 template<class RISType>
│ │ │ │ +
92 size_t size (RISType& i) const
│ │ │ │ +
93 {
│ │ │ │ +
94 CHECK_INTERFACE_IMPLEMENTATION((asImp().size(i)));
│ │ │ │ +
95 return asImp().size(i);
│ │ │ │ +
96 }
│ │ │ │ +
97
│ │ │ │ +
103 template<class MessageBufferImp, class EntityType, class RISType>
│ │ │ │ +
104 void gather (MessageBufferImp& buff, const EntityType& e, const RISType & i) const
│ │ │ │ +
105 {
│ │ │ │ +
106 MessageBufferIF<MessageBufferImp> buffIF(buff);
│ │ │ │ +
107 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().gather(buffIF,e,i)));
│ │ │ │ +
108 }
│ │ │ │
109
│ │ │ │ -
110 public:
│ │ │ │ - │ │ │ │ -
113
│ │ │ │ -
114 private:
│ │ │ │ -
115 template<int side>
│ │ │ │ -
116 struct SideData {
│ │ │ │ -
118 bool gridlocal = false;
│ │ │ │ -
119
│ │ │ │ -
121 std::vector< GridIndexType<side> > gridindices;
│ │ │ │ -
122
│ │ │ │ -
124 std::vector< std::optional< GridLocalGeometry<side> > > gridlocalgeom;
│ │ │ │ -
125
│ │ │ │ -
133 std::optional< GridGeometry<side> > gridgeom;
│ │ │ │ -
134 };
│ │ │ │ +
117 template<class MessageBufferImp, class EntityType, class RISType>
│ │ │ │ +
118 void scatter (MessageBufferImp& buff, const EntityType& e, const RISType & i, size_t n)
│ │ │ │ +
119 {
│ │ │ │ +
120 MessageBufferIF<MessageBufferImp> buffIF(buff);
│ │ │ │ +
121 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().scatter(buffIF,e,i,n)));
│ │ │ │ +
122 }
│ │ │ │ +
123
│ │ │ │ +
124 private:
│ │ │ │ +
126 DataHandleImp& asImp () {
│ │ │ │ +
127 return static_cast<DataHandleImp &> (*this);
│ │ │ │ +
128 }
│ │ │ │ +
130 const DataHandleImp& asImp () const
│ │ │ │ +
131 {
│ │ │ │ +
132 return static_cast<const DataHandleImp &>(*this);
│ │ │ │ +
133 }
│ │ │ │ +
134 }; // end class CommDataHandleIF
│ │ │ │
135
│ │ │ │ -
136 std::tuple< SideData<0>, SideData<1> > sideData_;
│ │ │ │ -
137 };
│ │ │ │ -
138
│ │ │ │ -
139 template<typename P0, typename P1>
│ │ │ │ -
140 template<int side>
│ │ │ │ -
141 void IntersectionData<P0, P1>::initializeGeometry(const GridGlue& glue, unsigned mergeindex)
│ │ │ │ -
142 {
│ │ │ │ -
143 auto& data = std::get<side>(sideData_);
│ │ │ │ +
140 template<typename DT>
│ │ │ │ + │ │ │ │ +
142 public:
│ │ │ │ +
143 typedef DT value_type;
│ │ │ │
144
│ │ │ │ -
145 const unsigned n_parents = glue.merger_->template parents<side>(mergeindex);
│ │ │ │ -
146
│ │ │ │ -
147 // init containers
│ │ │ │ -
148 data.gridindices.resize(n_parents);
│ │ │ │ -
149 data.gridlocalgeom.resize(n_parents);
│ │ │ │ -
150
│ │ │ │ -
151 // default values
│ │ │ │ -
152 data.gridindices[0] = 0;
│ │ │ │ -
153
│ │ │ │ -
154 static constexpr int nSimplexCorners = mydim + 1;
│ │ │ │ -
155 using ctype = typename GridGlue::ctype;
│ │ │ │ -
156
│ │ │ │ -
157 // initialize the local and the global geometries of grid `side`
│ │ │ │ -
158
│ │ │ │ -
159 // compute the coordinates of the subface's corners in codim 0 entity local coordinates
│ │ │ │ -
160 static constexpr int elementdim = GridGlue::template GridView<side>::template Codim<0>::Geometry::mydimension;
│ │ │ │ -
161
│ │ │ │ -
162 // coordinates within the subentity that contains the remote intersection
│ │ │ │ -
163 std::array<Dune::FieldVector< ctype, dim<side>() >, nSimplexCorners> corners_subEntity_local;
│ │ │ │ -
164
│ │ │ │ -
165 for (unsigned int par = 0; par < n_parents; ++par) {
│ │ │ │ -
166 for (int i = 0; i < nSimplexCorners; ++i)
│ │ │ │ -
167 corners_subEntity_local[i] = glue.merger_->template parentLocal<side>(mergeindex, i, par);
│ │ │ │ +
145 // Constructor
│ │ │ │ + │ │ │ │ +
147 {
│ │ │ │ +
148 a=p;
│ │ │ │ +
149 i=0;
│ │ │ │ +
150 j=0;
│ │ │ │ +
151 }
│ │ │ │ +
152
│ │ │ │ +
153 // write data to message buffer, acts like a stream !
│ │ │ │ +
154 template<class Y>
│ │ │ │ +
155 void write (const Y& data)
│ │ │ │ +
156 {
│ │ │ │ +
157 static_assert(std::is_same<DT,Y>::value, "DataType mismatch");
│ │ │ │ +
158 a[i++] = data;
│ │ │ │ +
159 }
│ │ │ │ +
160
│ │ │ │ +
161 // read data from message buffer, acts like a stream !
│ │ │ │ +
162 template<class Y>
│ │ │ │ +
163 void read (Y& data) const
│ │ │ │ +
164 {
│ │ │ │ +
165 static_assert(std::is_same<DT,Y>::value, "DataType mismatch");
│ │ │ │ +
166 data = a[j++];
│ │ │ │ +
167 }
│ │ │ │
168
│ │ │ │ -
169 // Coordinates of the remote intersection corners wrt the element coordinate system
│ │ │ │ -
170 std::array<Dune::FieldVector<ctype, elementdim>, nSimplexCorners> corners_element_local;
│ │ │ │ -
171
│ │ │ │ -
172 if (data.gridlocal) {
│ │ │ │ -
173 data.gridindices[par] = glue.merger_->template parent<side>(mergeindex,par);
│ │ │ │ -
174
│ │ │ │ -
175 typename GridGlue::template GridPatch<side>::LocalGeometry
│ │ │ │ -
176 gridLocalGeometry = glue.template patch<side>().geometryLocal(data.gridindices[par]);
│ │ │ │ -
177 for (std::size_t i=0; i<corners_subEntity_local.size(); i++) {
│ │ │ │ -
178 corners_element_local[i] = gridLocalGeometry.global(corners_subEntity_local[i]);
│ │ │ │ -
179 }
│ │ │ │ -
180
│ │ │ │ -
181 // set the corners of the local geometry
│ │ │ │ -
182#ifdef ONLY_SIMPLEX_INTERSECTIONS
│ │ │ │ -
183# if DUNE_VERSION_NEWER(DUNE_GEOMETRY, 2, 6)
│ │ │ │ -
184 const Dune::GeometryType type = Dune::GeometryTypes::simplex(mydim);
│ │ │ │ -
185# else
│ │ │ │ -
186 const Dune::GeometryType type(Dune::GeometryType::simplex, mydim);
│ │ │ │ -
187# endif
│ │ │ │ -
188#else
│ │ │ │ -
189#error Not Implemented
│ │ │ │ -
190#endif
│ │ │ │ -
191 data.gridlocalgeom[par].emplace(type, corners_element_local);
│ │ │ │ -
192
│ │ │ │ -
193 // Add world geometry only for 0th parent
│ │ │ │ -
194 if (par == 0) {
│ │ │ │ -
195 typename GridGlue::template GridPatch<side>::Geometry
│ │ │ │ -
196 gridWorldGeometry = glue.template patch<side>().geometry(data.gridindices[par]);
│ │ │ │ -
197
│ │ │ │ -
198 // world coordinates of the remote intersection corners
│ │ │ │ -
199 std::array<Dune::FieldVector<ctype, GridGlue::template GridView<side>::dimensionworld>, nSimplexCorners> corners_global;
│ │ │ │ -
200
│ │ │ │ -
201 for (std::size_t i=0; i<corners_subEntity_local.size(); i++) {
│ │ │ │ -
202 corners_global[i] = gridWorldGeometry.global(corners_subEntity_local[i]);
│ │ │ │ -
203 }
│ │ │ │ -
204
│ │ │ │ -
205 data.gridgeom.emplace(type, corners_global);
│ │ │ │ -
206 }
│ │ │ │ -
207 }
│ │ │ │ -
208 }
│ │ │ │ -
209 }
│ │ │ │ -
210
│ │ │ │ -
212 template<typename P0, typename P1>
│ │ │ │ -
213 IntersectionData<P0, P1>::IntersectionData(const GridGlue& glue, unsigned int mergeindex, unsigned int offset,
│ │ │ │ -
214 bool grid0local, bool grid1local)
│ │ │ │ -
215 : index_(mergeindex+offset)
│ │ │ │ -
216 {
│ │ │ │ -
217 // if an invalid index is given do not proceed!
│ │ │ │ -
218 // (happens when the parent GridGlue initializes the "end"-Intersection)
│ │ │ │ -
219 assert (0 <= mergeindex || mergeindex < glue.index__sz);
│ │ │ │ +
169 size_t counter() const { return i; }
│ │ │ │ +
170
│ │ │ │ +
171 void clear()
│ │ │ │ +
172 {
│ │ │ │ +
173 i = 0;
│ │ │ │ +
174 j = 0;
│ │ │ │ +
175 }
│ │ │ │ +
176
│ │ │ │ +
177 // we need access to these variables in an assertion
│ │ │ │ +
178#ifdef NDEBUG
│ │ │ │ +
179 private:
│ │ │ │ +
180#endif
│ │ │ │ +
181 DT *a;
│ │ │ │ +
182 size_t i;
│ │ │ │ +
183 mutable size_t j;
│ │ │ │ +
184 };
│ │ │ │ +
185
│ │ │ │ +
192 template<int dir>
│ │ │ │ + │ │ │ │ +
194 {
│ │ │ │ +
195 public:
│ │ │ │ +
196 template<class CommInfo>
│ │ │ │ +
197 static const typename CommInfo::DataType& gather(const CommInfo& commInfo, size_t i, size_t j = 0)
│ │ │ │ +
198 {
│ │ │ │ +
199 // get Intersection
│ │ │ │ +
200 typedef typename CommInfo::GridGlue::Intersection Intersection;
│ │ │ │ +
201 Intersection ris(commInfo.gridglue->getIntersection(i));
│ │ │ │ +
202
│ │ │ │ +
203 // fill buffer if we have a new intersection
│ │ │ │ +
204 if (j == 0)
│ │ │ │ +
205 {
│ │ │ │ +
206 commInfo.mbuffer.clear();
│ │ │ │ +
207 if (dir == Dune::ForwardCommunication)
│ │ │ │ +
208 {
│ │ │ │ +
209 // read from grid0
│ │ │ │ +
210 if(ris.self())
│ │ │ │ +
211 commInfo.data->gather(commInfo.mbuffer, ris.inside(), ris);
│ │ │ │ +
212 }
│ │ │ │ +
213 else // (dir == Dune::BackwardCommunication)
│ │ │ │ +
214 {
│ │ │ │ +
215 // read from grid1
│ │ │ │ +
216 if(ris.neighbor())
│ │ │ │ +
217 commInfo.data->gather(commInfo.mbuffer, ris.outside(), ris.flip());
│ │ │ │ +
218 }
│ │ │ │ +
219 }
│ │ │ │
220
│ │ │ │ -
221 std::get<0>(sideData_).gridlocal = grid0local;
│ │ │ │ -
222 std::get<1>(sideData_).gridlocal = grid1local;
│ │ │ │ -
223
│ │ │ │ -
224 initializeGeometry<0>(glue, mergeindex);
│ │ │ │ -
225 initializeGeometry<1>(glue, mergeindex);
│ │ │ │ -
226 }
│ │ │ │ -
227
│ │ │ │ -
232 template<typename P0, typename P1, int inside, int outside>
│ │ │ │ - │ │ │ │ -
234 {
│ │ │ │ - │ │ │ │ - │ │ │ │ -
237
│ │ │ │ -
238 using InsideGridView = typename GridGlue::template GridView<inside>;
│ │ │ │ -
239 using OutsideGridView = typename GridGlue::template GridView<outside>;
│ │ │ │ -
240
│ │ │ │ -
241 using InsideLocalGeometry = typename IntersectionData::template GridLocalGeometry<inside>;
│ │ │ │ -
242 using OutsideLocalGeometry = typename IntersectionData::template GridLocalGeometry<outside>;
│ │ │ │ -
243
│ │ │ │ -
244 using Geometry = typename IntersectionData::template GridGeometry<inside>;
│ │ │ │ -
245 using OutsideGeometry = typename IntersectionData::template GridGeometry<outside>;
│ │ │ │ -
246
│ │ │ │ -
247 static constexpr auto coorddim = IntersectionData::coorddim;
│ │ │ │ -
248 static constexpr auto mydim = IntersectionData::mydim;
│ │ │ │ -
249 static constexpr int insidePatch = inside;
│ │ │ │ -
250 static constexpr int outsidePatch = outside;
│ │ │ │ -
251
│ │ │ │ -
252 using ctype = typename GridGlue::ctype;
│ │ │ │ -
253 using LocalCoordinate = Dune::FieldVector<ctype, mydim>;
│ │ │ │ -
254 using GlobalCoordinate = Dune::FieldVector<ctype, coorddim>;
│ │ │ │ -
255 };
│ │ │ │ -
256
│ │ │ │ -
259 template<typename P0, typename P1, int I, int O>
│ │ │ │ - │ │ │ │ -
261 {
│ │ │ │ +
221 // return the j'th value in the buffer
│ │ │ │ +
222 assert(j < commInfo.mbuffer.i);
│ │ │ │ +
223 return commInfo.buffer[j];
│ │ │ │ +
224 }
│ │ │ │ +
225
│ │ │ │ +
226 template<class CommInfo>
│ │ │ │ +
227 static void scatter(CommInfo& commInfo, const typename CommInfo::DataType& v, std::size_t i, std::size_t j = 0)
│ │ │ │ +
228 {
│ │ │ │ +
229 // extract GridGlue objects...
│ │ │ │ +
230 typedef typename CommInfo::GridGlue::Intersection Intersection;
│ │ │ │ +
231 Intersection ris(commInfo.gridglue->getIntersection(i));
│ │ │ │ +
232
│ │ │ │ +
233 // get size if we have a new intersection
│ │ │ │ +
234 if (j == 0)
│ │ │ │ +
235 {
│ │ │ │ +
236 commInfo.mbuffer.clear();
│ │ │ │ +
237 commInfo.currentsize = commInfo.data->size(ris);
│ │ │ │ +
238 }
│ │ │ │ +
239
│ │ │ │ +
240 // write entry to buffer
│ │ │ │ +
241 commInfo.buffer[j] = v;
│ │ │ │ +
242
│ │ │ │ +
243 // write back the buffer if we are at the end of this intersection
│ │ │ │ +
244 if (j == commInfo.currentsize-1)
│ │ │ │ +
245 {
│ │ │ │ +
246 if (dir == Dune::ForwardCommunication)
│ │ │ │ +
247 {
│ │ │ │ +
248 // write to grid1
│ │ │ │ +
249 if(ris.neighbor())
│ │ │ │ +
250 commInfo.data->scatter(commInfo.mbuffer, ris.outside(), ris.flip(), commInfo.currentsize);
│ │ │ │ +
251 }
│ │ │ │ +
252 else // (dir == Dune::BackwardCommunication)
│ │ │ │ +
253 {
│ │ │ │ +
254 // write to grid0
│ │ │ │ +
255 if(ris.self())
│ │ │ │ +
256 commInfo.data->scatter(commInfo.mbuffer, ris.inside(), ris, commInfo.currentsize);
│ │ │ │ +
257 }
│ │ │ │ +
258 assert(commInfo.mbuffer.j <= commInfo.currentsize);
│ │ │ │ +
259 }
│ │ │ │ +
260 }
│ │ │ │ +
261 };
│ │ │ │
262
│ │ │ │ -
263 public:
│ │ │ │ -
264
│ │ │ │ - │ │ │ │ -
266
│ │ │ │ -
267 typedef typename Traits::GridGlue GridGlue;
│ │ │ │ - │ │ │ │ -
269
│ │ │ │ -
270
│ │ │ │ - │ │ │ │ - │ │ │ │ -
273
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
277
│ │ │ │ -
278 typedef typename Traits::Geometry Geometry;
│ │ │ │ -
279 typedef typename Traits::ctype ctype;
│ │ │ │ -
280
│ │ │ │ -
281 typedef typename InsideGridView::Traits::template Codim<0>::Entity InsideEntity;
│ │ │ │ -
282 typedef typename OutsideGridView::Traits::template Codim<0>::Entity OutsideEntity;
│ │ │ │ + │ │ │ │ + │ │ │ │ +
265
│ │ │ │ +
270 template <typename GG, class DataHandleImp, class DataTypeImp>
│ │ │ │ +
271 struct CommInfo
│ │ │ │ +
272 {
│ │ │ │ +
273 typedef DataTypeImp value_type;
│ │ │ │ +
274 typedef GG GridGlue;
│ │ │ │ +
275 typedef DataTypeImp DataType;
│ │ │ │ +
276
│ │ │ │ + │ │ │ │ +
278 {}
│ │ │ │ +
279
│ │ │ │ +
280 // tunnel information to the policy and the operators
│ │ │ │ + │ │ │ │ + │ │ │ │
283
│ │ │ │ - │ │ │ │ - │ │ │ │ -
286
│ │ │ │ -
288 static constexpr auto coorddim = Traits::coorddim;
│ │ │ │ -
289
│ │ │ │ -
291 static constexpr auto mydim = Traits::mydim;
│ │ │ │ +
284 // state variables
│ │ │ │ +
285 std::vector<DataType> buffer;
│ │ │ │ +
286 mutable ::Dune::GridGlue::StreamingMessageBuffer<DataType> mbuffer;
│ │ │ │ + │ │ │ │ +
288 Dune::CommunicationDirection dir;
│ │ │ │ +
289 };
│ │ │ │ +
290
│ │ │ │ +
291 } // end namespace GridGlue
│ │ │ │
292
│ │ │ │ -
294 static constexpr int insidePatch = Traits::insidePatch;
│ │ │ │ -
295
│ │ │ │ -
297 static constexpr int outsidePatch = Traits::outsidePatch;
│ │ │ │ -
298
│ │ │ │ -
299 // typedef unsigned int IndexType;
│ │ │ │ -
300
│ │ │ │ -
301 private:
│ │ │ │ -
305 static constexpr int codimensionWorld = coorddim - mydim;
│ │ │ │ -
306
│ │ │ │ -
307 public:
│ │ │ │ -
308 /* C O N S T R U C T O R S */
│ │ │ │ -
309
│ │ │ │ -
311 Intersection(const GridGlue* glue, const IntersectionData* i) :
│ │ │ │ -
312 glue_(glue), i_(i) {}
│ │ │ │ -
313
│ │ │ │ -
314 /* F U N C T I O N A L I T Y */
│ │ │ │ -
315
│ │ │ │ - │ │ │ │ -
319 inside(unsigned int parentId = 0) const
│ │ │ │ -
320 {
│ │ │ │ -
321 assert(self());
│ │ │ │ -
322 return glue_->template patch<I>().element(i_->template index<I>(parentId));
│ │ │ │ -
323 }
│ │ │ │ -
324
│ │ │ │ - │ │ │ │ -
328 outside(unsigned int parentId = 0) const
│ │ │ │ -
329 {
│ │ │ │ -
330 assert(neighbor());
│ │ │ │ -
331 return glue_->template patch<O>().element(i_->template index<O>(parentId));
│ │ │ │ -
332 }
│ │ │ │ -
333
│ │ │ │ -
335 bool conforming() const
│ │ │ │ -
336 {
│ │ │ │ -
337 throw Dune::NotImplemented();
│ │ │ │ -
338 }
│ │ │ │ -
339
│ │ │ │ -
342 const InsideLocalGeometry& geometryInInside(unsigned int parentId = 0) const
│ │ │ │ -
343 {
│ │ │ │ -
344 return i_->template localGeometry<I>(parentId);
│ │ │ │ -
345 }
│ │ │ │ -
346
│ │ │ │ -
349 const OutsideLocalGeometry& geometryInOutside(unsigned int parentId = 0) const
│ │ │ │ -
350 {
│ │ │ │ -
351 return i_->template localGeometry<O>(parentId);
│ │ │ │ -
352 }
│ │ │ │ -
353
│ │ │ │ -
360 const Geometry& geometry() const
│ │ │ │ -
361 {
│ │ │ │ -
362 return i_->template geometry<I>();
│ │ │ │ -
363 }
│ │ │ │ -
364
│ │ │ │ -
371 const OutsideGeometry& geometryOutside() const // DUNE_DEPRECATED
│ │ │ │ -
372 {
│ │ │ │ -
373 return i_->template geometry<O>();
│ │ │ │ -
374 }
│ │ │ │ -
375
│ │ │ │ -
377 Dune::GeometryType type() const
│ │ │ │ -
378 {
│ │ │ │ -
379 #ifdef ONLY_SIMPLEX_INTERSECTIONS
│ │ │ │ -
380 # if DUNE_VERSION_NEWER(DUNE_GEOMETRY, 2, 6)
│ │ │ │ -
381 return Dune::GeometryTypes::simplex(mydim);
│ │ │ │ -
382 # else
│ │ │ │ -
383 static const Dune::GeometryType type(Dune::GeometryType::simplex, mydim);
│ │ │ │ -
384 return type;
│ │ │ │ -
385 # endif
│ │ │ │ -
386 #else
│ │ │ │ -
387 #error Not Implemented
│ │ │ │ -
388 #endif
│ │ │ │ -
389 }
│ │ │ │ -
390
│ │ │ │ -
391
│ │ │ │ -
393 bool self() const
│ │ │ │ -
394 {
│ │ │ │ -
395 return i_->template local<I>();
│ │ │ │ -
396 }
│ │ │ │ -
397
│ │ │ │ -
399 size_t neighbor(unsigned int g = 0) const
│ │ │ │ -
400 {
│ │ │ │ -
401 if (g == 0 && i_->template local<O>()) {
│ │ │ │ -
402 return i_->template parents<O>();
│ │ │ │ -
403 } else if (g == 1 && i_->template local<I>()) {
│ │ │ │ -
404 return i_->template parents<I>();
│ │ │ │ -
405 }
│ │ │ │ -
406 return 0;
│ │ │ │ -
407 }
│ │ │ │ -
408
│ │ │ │ -
410 int indexInInside(unsigned int parentId = 0) const
│ │ │ │ -
411 {
│ │ │ │ -
412 assert(self());
│ │ │ │ -
413 return glue_->template patch<I>().indexInInside(i_->template index<I>(parentId));
│ │ │ │ -
414 }
│ │ │ │ -
415
│ │ │ │ -
417 int indexInOutside(unsigned int parentId = 0) const
│ │ │ │ -
418 {
│ │ │ │ -
419 assert(neighbor());
│ │ │ │ -
420 return glue_->template patch<O>().indexInInside(i_->template index<O>(parentId));
│ │ │ │ -
421 }
│ │ │ │ -
422
│ │ │ │ - │ │ │ │ -
428 {
│ │ │ │ -
429 GlobalCoordinate normal;
│ │ │ │ -
430
│ │ │ │ -
431 if (codimensionWorld == 0)
│ │ │ │ -
432 DUNE_THROW(Dune::Exception, "There is no normal vector to a full-dimensional intersection");
│ │ │ │ -
433 else if (codimensionWorld == 1) {
│ │ │ │ -
434 /* TODO: Implement the general n-ary cross product here */
│ │ │ │ -
435 const auto jacobianTransposed = geometry().jacobianTransposed(local);
│ │ │ │ -
436 if (mydim==1) {
│ │ │ │ -
437 normal[0] = - jacobianTransposed[0][1];
│ │ │ │ -
438 normal[1] = jacobianTransposed[0][0];
│ │ │ │ -
439 } else if (mydim==2) {
│ │ │ │ -
440 normal[0] = (jacobianTransposed[0][1] * jacobianTransposed[1][2] - jacobianTransposed[0][2] * jacobianTransposed[1][1]);
│ │ │ │ -
441 normal[1] = - (jacobianTransposed[0][0] * jacobianTransposed[1][2] - jacobianTransposed[0][2] * jacobianTransposed[1][0]);
│ │ │ │ -
442 normal[2] = (jacobianTransposed[0][0] * jacobianTransposed[1][1] - jacobianTransposed[0][1] * jacobianTransposed[1][0]);
│ │ │ │ -
443 } else
│ │ │ │ -
444 DUNE_THROW(Dune::NotImplemented, "Remote intersections don't implement the 'outerNormal' method for " << mydim << "-dimensional intersections yet");
│ │ │ │ -
445 } else
│ │ │ │ -
446 DUNE_THROW(Dune::NotImplemented, "Remote intersections don't implement the 'outerNormal' method for intersections with codim >= 2 yet");
│ │ │ │ -
447
│ │ │ │ -
448 return normal;
│ │ │ │ -
449 }
│ │ │ │ -
450
│ │ │ │ - │ │ │ │ -
456 {
│ │ │ │ -
457 GlobalCoordinate normal = outerNormal(local);
│ │ │ │ -
458 normal /= normal.two_norm();
│ │ │ │ -
459 return normal;
│ │ │ │ -
460 }
│ │ │ │ -
461
│ │ │ │ - │ │ │ │ -
467 {
│ │ │ │ -
468 return (unitOuterNormal(local) *= geometry().integrationElement(local));
│ │ │ │ -
469 }
│ │ │ │ -
470
│ │ │ │ - │ │ │ │ -
476 {
│ │ │ │ -
477 return unitOuterNormal(ReferenceElements<ctype,mydim>::general(type()).position(0,0));
│ │ │ │ -
478 }
│ │ │ │ -
479
│ │ │ │ - │ │ │ │ -
484 {
│ │ │ │ -
485 return Intersection<P0,P1,O,I>(glue_,i_);
│ │ │ │ -
486 }
│ │ │ │ -
487
│ │ │ │ -
488#ifdef QUICKHACK_INDEX
│ │ │ │ -
489 typedef typename GridGlue::IndexType IndexType;
│ │ │ │ -
490
│ │ │ │ -
491 IndexType index() const
│ │ │ │ -
492 {
│ │ │ │ -
493 return i_->index_;
│ │ │ │ -
494 }
│ │ │ │ -
495
│ │ │ │ -
496#endif
│ │ │ │ -
497
│ │ │ │ -
498 private:
│ │ │ │ -
499
│ │ │ │ -
500 friend class IntersectionIndexSet<P0,P1>;
│ │ │ │ -
501
│ │ │ │ -
502 /* M E M B E R V A R I A B L E S */
│ │ │ │ -
503
│ │ │ │ -
505 const GridGlue* glue_;
│ │ │ │ -
506
│ │ │ │ -
508 const IntersectionData* i_;
│ │ │ │ -
509 };
│ │ │ │ -
510
│ │ │ │ -
511
│ │ │ │ -
512 } // end namespace GridGlue
│ │ │ │ -
513} // end namespace Dune
│ │ │ │ -
514
│ │ │ │ -
515#endif // DUNE_GRIDGLUE_ADAPTER_INTERSECTION_HH
│ │ │ │ -
Central component of the module implementing the coupling of two grids.
│ │ │ │ +
293#if HAVE_MPI
│ │ │ │ +
298 template<typename GG, class DataHandleImp, class DataTypeImp>
│ │ │ │ +
299 struct CommPolicy< ::Dune::GridGlue::CommInfo<GG, DataHandleImp, DataTypeImp> >
│ │ │ │ +
300 {
│ │ │ │ +
304 typedef ::Dune::GridGlue::CommInfo<GG, DataHandleImp, DataTypeImp> Type;
│ │ │ │ +
305
│ │ │ │ +
309 typedef DataTypeImp IndexedType;
│ │ │ │ +
310
│ │ │ │ +
314 // typedef SizeOne IndexedTypeFlag;
│ │ │ │ +
315 typedef VariableSize IndexedTypeFlag;
│ │ │ │ +
316
│ │ │ │ +
320 static size_t getSize(const Type& commInfo, size_t i)
│ │ │ │ +
321 {
│ │ │ │ +
322 // get Intersection
│ │ │ │ +
323 typedef typename Type::GridGlue::Intersection Intersection;
│ │ │ │ +
324 Intersection ris(commInfo.gridglue->getIntersection(i));
│ │ │ │ +
325
│ │ │ │ +
326 // ask data handle for size
│ │ │ │ +
327 return commInfo.data->size(ris);
│ │ │ │ +
328 }
│ │ │ │ +
329 };
│ │ │ │ +
330#endif
│ │ │ │ +
331
│ │ │ │ +
332} // end namespace Dune
│ │ │ │ +
333#endif
│ │ │ │
Definition: gridglue.hh:37
│ │ │ │ -
bool inside(const Coordinate &x, const Field &epsilon)
Definition: projection_impl.hh:111
│ │ │ │ -
sequential adapter to couple two grids at specified close together boundaries
Definition: gridglue.hh:67
│ │ │ │ -
unsigned int IndexType
Definition: gridglue.hh:147
│ │ │ │ -
PromotionTraits< typenameGridView< 0 >::ctype, typenameGridView< 1 >::ctype >::PromotedType ctype
The type used for coordinates.
Definition: gridglue.hh:171
│ │ │ │ -
static constexpr int dimworld
export the world dimension This is the maximum of the extractors' world dimensions.
Definition: gridglue.hh:166
│ │ │ │ -
storage class for Dune::GridGlue::Intersection related data
Definition: intersection.hh:38
│ │ │ │ -
GridGlue::IndexType IndexType
Definition: intersection.hh:42
│ │ │ │ -
AffineGeometry< typename GridGlue::template GridView< side >::ctype, mydim, GridGlue::template GridView< side >::dimensionworld > GridGeometry
Definition: intersection.hh:65
│ │ │ │ -
const GridLocalGeometry< side > & localGeometry(unsigned int parentId=0) const
Definition: intersection.hh:85
│ │ │ │ -
static constexpr int coorddim
Dimension of the world space of the intersection.
Definition: intersection.hh:45
│ │ │ │ -
GridGeometry< 0 > Grid0Geometry
Definition: intersection.hh:67
│ │ │ │ -
typename GridGlue::template GridView< side >::IndexSet::IndexType GridIndexType
Definition: intersection.hh:71
│ │ │ │ -
IndexType index(unsigned int parentId=0) const
Definition: intersection.hh:97
│ │ │ │ -
IndexType parents() const
Definition: intersection.hh:101
│ │ │ │ -
GridLocalGeometry< 1 > Grid1LocalGeometry
Definition: intersection.hh:61
│ │ │ │ -
const GridGeometry< side > & geometry() const
Definition: intersection.hh:89
│ │ │ │ -
bool local() const
Definition: intersection.hh:93
│ │ │ │ -
::Dune::GridGlue::GridGlue< P0, P1 > GridGlue
Definition: intersection.hh:40
│ │ │ │ -
static constexpr int mydim
Dimension of the intersection.
Definition: intersection.hh:54
│ │ │ │ -
AffineGeometry< typename GridGlue::template GridView< side >::ctype, mydim, GridGlue::template GridView< side >::dimension > GridLocalGeometry
Definition: intersection.hh:58
│ │ │ │ -
GridLocalGeometry< 0 > Grid0LocalGeometry
Definition: intersection.hh:60
│ │ │ │ -
IndexType index_
index of this intersection after GridGlue interface
Definition: intersection.hh:112
│ │ │ │ -
GridIndexType< 1 > Grid1IndexType
Definition: intersection.hh:74
│ │ │ │ -
GridGeometry< 1 > Grid1Geometry
Definition: intersection.hh:68
│ │ │ │ -
GridIndexType< 0 > Grid0IndexType
Definition: intersection.hh:73
│ │ │ │ -
IntersectionData()=default
Default Constructor.
│ │ │ │ +
CommunicationOperator< Dune::BackwardCommunication > BackwardOperator
Definition: gridgluecommunicate.hh:264
│ │ │ │ +
CommunicationOperator< Dune::ForwardCommunication > ForwardOperator
Definition: gridgluecommunicate.hh:263
│ │ │ │ +
std::pair< int, int > RankPair
Definition: gridgluecommunicate.hh:24
│ │ │ │ +
std::ostream & operator<<(std::ostream &os, const GlobalId &id)
Definition: gridgluecommunicate.hh:55
│ │ │ │
The intersection of two entities of the two patches of a GridGlue.
Definition: intersection.hh:261
│ │ │ │ -
Traits::OutsideLocalGeometry OutsideLocalGeometry
Definition: intersection.hh:275
│ │ │ │
Intersection< P0, P1, O, I > flip() const
Return a copy of the intersection with inside and outside switched.
Definition: intersection.hh:483
│ │ │ │ -
bool conforming() const
Return true if intersection is conforming.
Definition: intersection.hh:335
│ │ │ │ -
InsideGridView::Traits::template Codim< 0 >::Entity InsideEntity
Definition: intersection.hh:281
│ │ │ │ -
Traits::GridGlue GridGlue
Definition: intersection.hh:267
│ │ │ │ -
int indexInOutside(unsigned int parentId=0) const
Local number of codim 1 entity in outside() Entity where intersection is contained in.
Definition: intersection.hh:417
│ │ │ │ -
int indexInInside(unsigned int parentId=0) const
Local number of codim 1 entity in the inside() Entity where intersection is contained in.
Definition: intersection.hh:410
│ │ │ │
bool self() const
For parallel computations: Return true if inside() entity exists locally.
Definition: intersection.hh:393
│ │ │ │ -
static constexpr auto mydim
dimension of the intersection
Definition: intersection.hh:291
│ │ │ │ -
static constexpr int outsidePatch
outside patch
Definition: intersection.hh:297
│ │ │ │ -
Dune::GeometryType type() const
Type of reference element for this intersection.
Definition: intersection.hh:377
│ │ │ │
InsideEntity inside(unsigned int parentId=0) const
Return element on the inside of this intersection.
Definition: intersection.hh:319
│ │ │ │ -
Traits::LocalCoordinate LocalCoordinate
Definition: intersection.hh:284
│ │ │ │ -
const OutsideLocalGeometry & geometryInOutside(unsigned int parentId=0) const
Geometric information about this intersection in local coordinates of the outside() element.
Definition: intersection.hh:349
│ │ │ │ -
GlobalCoordinate unitOuterNormal(const LocalCoordinate &local) const
Return a unit outer normal.
Definition: intersection.hh:455
│ │ │ │ -
Traits::ctype ctype
Definition: intersection.hh:279
│ │ │ │ -
IntersectionTraits< P0, P1, I, O > Traits
Definition: intersection.hh:265
│ │ │ │ -
Traits::IntersectionData IntersectionData
Definition: intersection.hh:268
│ │ │ │ -
Traits::GlobalCoordinate GlobalCoordinate
Definition: intersection.hh:285
│ │ │ │ -
Traits::OutsideGeometry OutsideGeometry
Definition: intersection.hh:276
│ │ │ │
size_t neighbor(unsigned int g=0) const
Return number of embeddings into local grid0 (grid1) entities.
Definition: intersection.hh:399
│ │ │ │ -
Intersection(const GridGlue *glue, const IntersectionData *i)
Constructor for a given Dataset.
Definition: intersection.hh:311
│ │ │ │ -
static constexpr int insidePatch
inside patch
Definition: intersection.hh:294
│ │ │ │ -
Traits::Geometry Geometry
Definition: intersection.hh:278
│ │ │ │ -
OutsideGridView::Traits::template Codim< 0 >::Entity OutsideEntity
Definition: intersection.hh:282
│ │ │ │
OutsideEntity outside(unsigned int parentId=0) const
Return element on the outside of this intersection.
Definition: intersection.hh:328
│ │ │ │ -
const Geometry & geometry() const
Geometric information about this intersection as part of the inside grid.
Definition: intersection.hh:360
│ │ │ │ -
Traits::InsideLocalGeometry InsideLocalGeometry
Definition: intersection.hh:272
│ │ │ │ -
GlobalCoordinate outerNormal(const LocalCoordinate &local) const
Return an outer normal (length not necessarily 1)
Definition: intersection.hh:427
│ │ │ │ -
const OutsideGeometry & geometryOutside() const
Geometric information about this intersection as part of the outside grid.
Definition: intersection.hh:371
│ │ │ │ -
Traits::OutsideGridView OutsideGridView
Definition: intersection.hh:274
│ │ │ │ -
GlobalCoordinate integrationOuterNormal(const LocalCoordinate &local) const
Return an outer normal with the length of the integration element.
Definition: intersection.hh:466
│ │ │ │ -
Traits::InsideGridView InsideGridView
Definition: intersection.hh:271
│ │ │ │ -
const InsideLocalGeometry & geometryInInside(unsigned int parentId=0) const
Geometric information about this intersection in local coordinates of the inside() element.
Definition: intersection.hh:342
│ │ │ │ -
GlobalCoordinate centerUnitOuterNormal() const
Unit outer normal at the center of the intersection.
Definition: intersection.hh:475
│ │ │ │ -
static constexpr auto coorddim
dimension of the world space of the intersection
Definition: intersection.hh:288
│ │ │ │ -
Definition: intersection.hh:234
│ │ │ │ -
static constexpr int insidePatch
Definition: intersection.hh:249
│ │ │ │ -
Dune::FieldVector< ctype, mydim > LocalCoordinate
Definition: intersection.hh:253
│ │ │ │ -
static constexpr auto coorddim
Definition: intersection.hh:247
│ │ │ │ -
typename IntersectionData::template GridGeometry< outside > OutsideGeometry
Definition: intersection.hh:245
│ │ │ │ -
typename GridGlue::ctype ctype
Definition: intersection.hh:252
│ │ │ │ -
typename GridGlue::template GridView< outside > OutsideGridView
Definition: intersection.hh:239
│ │ │ │ -
Dune::FieldVector< ctype, coorddim > GlobalCoordinate
Definition: intersection.hh:254
│ │ │ │ -
typename IntersectionData::template GridLocalGeometry< outside > OutsideLocalGeometry
Definition: intersection.hh:242
│ │ │ │ -
typename GridGlue::template GridView< inside > InsideGridView
Definition: intersection.hh:238
│ │ │ │ -
typename IntersectionData::template GridGeometry< inside > Geometry
Definition: intersection.hh:244
│ │ │ │ -
typename IntersectionData::template GridLocalGeometry< inside > InsideLocalGeometry
Definition: intersection.hh:241
│ │ │ │ -
static constexpr int outsidePatch
Definition: intersection.hh:250
│ │ │ │ -
static constexpr auto mydim
Definition: intersection.hh:248
│ │ │ │ +
Definition: gridgluecommunicate.hh:26
│ │ │ │ +
GlobalId(int i)
Definition: gridgluecommunicate.hh:38
│ │ │ │ +
GlobalId()
Definition: gridgluecommunicate.hh:30
│ │ │ │ +
GlobalId(int i, int j, unsigned int n)
Definition: gridgluecommunicate.hh:48
│ │ │ │ +
describes the features of a data handle for communication in parallel runs using the GridGlue::commun...
Definition: gridgluecommunicate.hh:77
│ │ │ │ +
size_t size(RISType &i) const
Definition: gridgluecommunicate.hh:92
│ │ │ │ +
void scatter(MessageBufferImp &buff, const EntityType &e, const RISType &i, size_t n)
Definition: gridgluecommunicate.hh:118
│ │ │ │ +
void gather(MessageBufferImp &buff, const EntityType &e, const RISType &i) const
pack data from user to message buffer
Definition: gridgluecommunicate.hh:104
│ │ │ │ +
DataTypeImp DataType
data type of data to communicate
Definition: gridgluecommunicate.hh:80
│ │ │ │ +
CommDataHandle()
Definition: gridgluecommunicate.hh:84
│ │ │ │ +
Definition: gridgluecommunicate.hh:141
│ │ │ │ +
size_t j
Definition: gridgluecommunicate.hh:183
│ │ │ │ +
StreamingMessageBuffer(DT *p)
Definition: gridgluecommunicate.hh:146
│ │ │ │ +
DT * a
Definition: gridgluecommunicate.hh:181
│ │ │ │ +
size_t counter() const
Definition: gridgluecommunicate.hh:169
│ │ │ │ +
void write(const Y &data)
Definition: gridgluecommunicate.hh:155
│ │ │ │ +
void read(Y &data) const
Definition: gridgluecommunicate.hh:163
│ │ │ │ +
DT value_type
Definition: gridgluecommunicate.hh:143
│ │ │ │ +
size_t i
Definition: gridgluecommunicate.hh:182
│ │ │ │ +
void clear()
Definition: gridgluecommunicate.hh:171
│ │ │ │ +
forward gather scatter to user defined CommInfo class
Definition: gridgluecommunicate.hh:194
│ │ │ │ +
static void scatter(CommInfo &commInfo, const typename CommInfo::DataType &v, std::size_t i, std::size_t j=0)
Definition: gridgluecommunicate.hh:227
│ │ │ │ +
static const CommInfo::DataType & gather(const CommInfo &commInfo, size_t i, size_t j=0)
Definition: gridgluecommunicate.hh:197
│ │ │ │ +
collects all GridGlue data requried for communication
Definition: gridgluecommunicate.hh:272
│ │ │ │ +
Dune::CommunicationDirection dir
Definition: gridgluecommunicate.hh:288
│ │ │ │ +
DataTypeImp value_type
Definition: gridgluecommunicate.hh:273
│ │ │ │ +
DataTypeImp DataType
Definition: gridgluecommunicate.hh:275
│ │ │ │ +
::Dune::GridGlue::CommDataHandle< DataHandleImp, DataTypeImp > * data
Definition: gridgluecommunicate.hh:282
│ │ │ │ +
GG GridGlue
Definition: gridgluecommunicate.hh:274
│ │ │ │ +
size_t currentsize
Definition: gridgluecommunicate.hh:287
│ │ │ │ +
CommInfo()
Definition: gridgluecommunicate.hh:277
│ │ │ │ +
mutable ::Dune::GridGlue::StreamingMessageBuffer< DataType > mbuffer
Definition: gridgluecommunicate.hh:286
│ │ │ │ +
const GridGlue * gridglue
Definition: gridgluecommunicate.hh:281
│ │ │ │ +
std::vector< DataType > buffer
Definition: gridgluecommunicate.hh:285
│ │ │ │ +
static size_t getSize(const Type &commInfo, size_t i)
Get the number of objects at an intersection.
Definition: gridgluecommunicate.hh:320
│ │ │ │ +
DataTypeImp IndexedType
The datatype that should be communicated.
Definition: gridgluecommunicate.hh:309
│ │ │ │ +
::Dune::GridGlue::CommInfo< GG, DataHandleImp, DataTypeImp > Type
The type of the GridGlueCommInfo.
Definition: gridgluecommunicate.hh:304
│ │ │ │ +
VariableSize IndexedTypeFlag
Each intersection can communicate a different number of objects.
Definition: gridgluecommunicate.hh:315
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,758 +5,443 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * adapter │ │ │ │ │ -intersection.hh │ │ │ │ │ +gridgluecommunicate.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 © DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 4// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only- │ │ │ │ │ with-dune-grid-glue-exception │ │ │ │ │ - 11#ifndef DUNE_GRIDGLUE_ADAPTER_INTERSECTION_HH │ │ │ │ │ - 12#define DUNE_GRIDGLUE_ADAPTER_INTERSECTION_HH │ │ │ │ │ - 13 │ │ │ │ │ - 14#include │ │ │ │ │ - 15#include │ │ │ │ │ - 16#include │ │ │ │ │ - 17 │ │ │ │ │ - 18#include │ │ │ │ │ - 19#include │ │ │ │ │ - 20#include │ │ │ │ │ - 21#include │ │ │ │ │ - 22#include │ │ │ │ │ + 5#ifndef DUNE_GRIDGLUE_ADAPTER_GRIDGLUECOMMUNICATE_HH │ │ │ │ │ + 6#define DUNE_GRIDGLUE_ADAPTER_GRIDGLUECOMMUNICATE_HH │ │ │ │ │ + 7 │ │ │ │ │ + 13#include │ │ │ │ │ + 14 │ │ │ │ │ + 15#include │ │ │ │ │ + 16#include │ │ │ │ │ + 17#include │ │ │ │ │ + 18#include │ │ │ │ │ + 19 │ │ │ │ │ + 20 │ │ │ │ │ + 21namespace Dune { │ │ │ │ │ + 22 namespace GridGlue { │ │ │ │ │ 23 │ │ │ │ │ -24#define ONLY_SIMPLEX_INTERSECTIONS │ │ │ │ │ - 25 │ │ │ │ │ - 26namespace Dune { │ │ │ │ │ - 27 namespace GridGlue { │ │ │ │ │ - 28 │ │ │ │ │ - 29 // forward declaration │ │ │ │ │ - 30 template │ │ │ │ │ - 31 class IntersectionIndexSet; │ │ │ │ │ - 32 │ │ │ │ │ - 36 template │ │ │ │ │ -37 class IntersectionData │ │ │ │ │ - 38 { │ │ │ │ │ - 39 public: │ │ │ │ │ -40 typedef ::Dune::GridGlue::GridGlue GridGlue; │ │ │ │ │ - 41 │ │ │ │ │ -42 typedef typename GridGlue::IndexType IndexType; │ │ │ │ │ - 43 │ │ │ │ │ -45 static constexpr int coorddim = GridGlue::dimworld; │ │ │ │ │ - 46 │ │ │ │ │ - 47 private: │ │ │ │ │ - 48 // intermediate quantities │ │ │ │ │ - 49 template │ │ │ │ │ - 50 static constexpr int dim() { return GridGlue::template GridView:: │ │ │ │ │ -Grid::dimension - GridGlue::template GridPatch::codim; } │ │ │ │ │ - 51 │ │ │ │ │ - 52 public: │ │ │ │ │ -54 static constexpr int mydim = dim<0>() < dim<1>() ? dim<0>() : dim<1>(); │ │ │ │ │ - 55 │ │ │ │ │ - 56 template │ │ │ │ │ -57 using GridLocalGeometry = AffineGeometry< │ │ │ │ │ - 58 typename GridGlue::template GridView::ctype, mydim, GridGlue:: │ │ │ │ │ -template GridView::dimension>; │ │ │ │ │ - 59 │ │ │ │ │ -60 using Grid0LocalGeometry [[deprecated("please use GridLocalGeometry<0> │ │ │ │ │ -instead")]] = GridLocalGeometry<0>; │ │ │ │ │ -61 using Grid1LocalGeometry [[deprecated("please use GridLocalGeometry<1> │ │ │ │ │ -instead")]] = GridLocalGeometry<1>; │ │ │ │ │ +24 typedef std::pair RankPair; │ │ │ │ │ +25 struct GlobalId : public std::pair │ │ │ │ │ + 26 { │ │ │ │ │ +30 GlobalId() { │ │ │ │ │ + 31 this->first.first = 0; │ │ │ │ │ + 32 this->first.second = 0; │ │ │ │ │ + 33 this->second = 0; │ │ │ │ │ + 34 } │ │ │ │ │ +38 GlobalId(int i) { │ │ │ │ │ + 39 this->first.first = i; │ │ │ │ │ + 40 this->first.second = i; │ │ │ │ │ + 41 this->second = 0; │ │ │ │ │ + 42 } │ │ │ │ │ +48 GlobalId(int i, int j, unsigned int n) { │ │ │ │ │ + 49 this->first.first = std::min(i,j); │ │ │ │ │ + 50 this->first.second = std::max(i,j); │ │ │ │ │ + 51 this->second = n; │ │ │ │ │ + 52 } │ │ │ │ │ + 53 }; │ │ │ │ │ + 54 │ │ │ │ │ +55 inline std::ostream& operator<<(std::ostream& os, const GlobalId & id) │ │ │ │ │ + 56 { │ │ │ │ │ + 57 os << "(" │ │ │ │ │ + 58 << id.first.first << "," << id.first.second << "," │ │ │ │ │ + 59 << id.second << ")"; │ │ │ │ │ + 60 return os; │ │ │ │ │ + 61 } │ │ │ │ │ 62 │ │ │ │ │ - 63 template │ │ │ │ │ -64 using GridGeometry = AffineGeometry< │ │ │ │ │ - 65 typename GridGlue::template GridView::ctype, mydim, GridGlue:: │ │ │ │ │ -template GridView::dimensionworld>; │ │ │ │ │ - 66 │ │ │ │ │ -67 using Grid0Geometry [[deprecated("please use GridGeometry<0> instead")]] = │ │ │ │ │ -GridGeometry<0>; │ │ │ │ │ -68 using Grid1Geometry [[deprecated("please use GridGeometry<1> instead")]] = │ │ │ │ │ -GridGeometry<1>; │ │ │ │ │ - 69 │ │ │ │ │ - 70 template │ │ │ │ │ -71 using GridIndexType = typename GridGlue::template GridView::IndexSet:: │ │ │ │ │ -IndexType; │ │ │ │ │ - 72 │ │ │ │ │ -73 using Grid0IndexType [[deprecated("please use GridIndexType<0> instead")]] = │ │ │ │ │ -GridIndexType<0>; │ │ │ │ │ -74 using Grid1IndexType [[deprecated("please use GridIndexType<1> instead")]] = │ │ │ │ │ -GridIndexType<1>; │ │ │ │ │ - 75 │ │ │ │ │ - 77 IntersectionData(const GridGlue& glue, unsigned int mergeindex, unsigned │ │ │ │ │ -int offset, bool grid0local, bool grid1local); │ │ │ │ │ - 78 │ │ │ │ │ -80 IntersectionData() = default; │ │ │ │ │ + 75 template │ │ │ │ │ +76 class CommDataHandle │ │ │ │ │ + 77 { │ │ │ │ │ + 78 public: │ │ │ │ │ +80 typedef DataTypeImp DataType; │ │ │ │ │ 81 │ │ │ │ │ - 82 /* Accessor Functions */ │ │ │ │ │ - 83 │ │ │ │ │ - 84 template │ │ │ │ │ -85 const GridLocalGeometry& localGeometry(unsigned int parentId = 0) │ │ │ │ │ -const │ │ │ │ │ - 86 { return *std::get(sideData_).gridlocalgeom[parentId]; } │ │ │ │ │ + 82 protected: │ │ │ │ │ + 83 // one should not create an explicit instance of this inteface object │ │ │ │ │ +84 CommDataHandle() {} │ │ │ │ │ + 85 │ │ │ │ │ + 86 public: │ │ │ │ │ 87 │ │ │ │ │ - 88 template │ │ │ │ │ -89 const GridGeometry& geometry() const │ │ │ │ │ - 90 { return *std::get(sideData_).gridgeom; } │ │ │ │ │ - 91 │ │ │ │ │ - 92 template │ │ │ │ │ -93 bool local() const │ │ │ │ │ - 94 { return std::get(sideData_).gridlocal; } │ │ │ │ │ - 95 │ │ │ │ │ - 96 template │ │ │ │ │ -97 IndexType index(unsigned int parentId = 0) const │ │ │ │ │ - 98 { return std::get(sideData_).gridindices[parentId]; } │ │ │ │ │ - 99 │ │ │ │ │ - 100 template │ │ │ │ │ -101 IndexType parents() const │ │ │ │ │ - 102 { return std::get(sideData_).gridindices.size(); } │ │ │ │ │ - 103 │ │ │ │ │ - 104 private: │ │ │ │ │ - 105 template │ │ │ │ │ - 106 void initializeGeometry(const GridGlue& glue, unsigned mergeindex); │ │ │ │ │ - 107 │ │ │ │ │ - 108 /* M E M B E R V A R I A B L E S */ │ │ │ │ │ + 91 template │ │ │ │ │ +92 size_t size (RISType& i) const │ │ │ │ │ + 93 { │ │ │ │ │ + 94 CHECK_INTERFACE_IMPLEMENTATION((asImp().size(i))); │ │ │ │ │ + 95 return asImp().size(i); │ │ │ │ │ + 96 } │ │ │ │ │ + 97 │ │ │ │ │ + 103 template │ │ │ │ │ +104 void gather (MessageBufferImp& buff, const EntityType& e, const RISType & │ │ │ │ │ +i) const │ │ │ │ │ + 105 { │ │ │ │ │ + 106 MessageBufferIF buffIF(buff); │ │ │ │ │ + 107 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().gather(buffIF,e,i))); │ │ │ │ │ + 108 } │ │ │ │ │ 109 │ │ │ │ │ - 110 public: │ │ │ │ │ -112 IndexType index_; │ │ │ │ │ - 113 │ │ │ │ │ - 114 private: │ │ │ │ │ - 115 template │ │ │ │ │ - 116 struct SideData { │ │ │ │ │ - 118 bool gridlocal = false; │ │ │ │ │ - 119 │ │ │ │ │ - 121 std::vector< GridIndexType > gridindices; │ │ │ │ │ - 122 │ │ │ │ │ - 124 std::vector< std::optional< GridLocalGeometry > > gridlocalgeom; │ │ │ │ │ - 125 │ │ │ │ │ - 133 std::optional< GridGeometry > gridgeom; │ │ │ │ │ - 134 }; │ │ │ │ │ + 117 template │ │ │ │ │ +118 void scatter (MessageBufferImp& buff, const EntityType& e, const RISType & │ │ │ │ │ +i, size_t n) │ │ │ │ │ + 119 { │ │ │ │ │ + 120 MessageBufferIF buffIF(buff); │ │ │ │ │ + 121 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().scatter(buffIF,e,i,n))); │ │ │ │ │ + 122 } │ │ │ │ │ + 123 │ │ │ │ │ + 124 private: │ │ │ │ │ + 126 DataHandleImp& asImp () { │ │ │ │ │ + 127 return static_cast (*this); │ │ │ │ │ + 128 } │ │ │ │ │ + 130 const DataHandleImp& asImp () const │ │ │ │ │ + 131 { │ │ │ │ │ + 132 return static_cast(*this); │ │ │ │ │ + 133 } │ │ │ │ │ + 134 }; // end class CommDataHandleIF │ │ │ │ │ 135 │ │ │ │ │ - 136 std::tuple< SideData<0>, SideData<1> > sideData_; │ │ │ │ │ - 137 }; │ │ │ │ │ - 138 │ │ │ │ │ - 139 template │ │ │ │ │ - 140 template │ │ │ │ │ - 141 void IntersectionData::initializeGeometry(const GridGlue& glue, │ │ │ │ │ -unsigned mergeindex) │ │ │ │ │ - 142 { │ │ │ │ │ - 143 auto& data = std::get(sideData_); │ │ │ │ │ + 140 template │ │ │ │ │ +141 class StreamingMessageBuffer { │ │ │ │ │ + 142 public: │ │ │ │ │ +143 typedef DT value_type; │ │ │ │ │ 144 │ │ │ │ │ - 145 const unsigned n_parents = glue.merger_->template parents │ │ │ │ │ -(mergeindex); │ │ │ │ │ - 146 │ │ │ │ │ - 147 // init containers │ │ │ │ │ - 148 data.gridindices.resize(n_parents); │ │ │ │ │ - 149 data.gridlocalgeom.resize(n_parents); │ │ │ │ │ - 150 │ │ │ │ │ - 151 // default values │ │ │ │ │ - 152 data.gridindices[0] = 0; │ │ │ │ │ - 153 │ │ │ │ │ - 154 static constexpr int nSimplexCorners = mydim + 1; │ │ │ │ │ - 155 using ctype = typename GridGlue::ctype; │ │ │ │ │ - 156 │ │ │ │ │ - 157 // initialize the local and the global geometries of grid `side` │ │ │ │ │ - 158 │ │ │ │ │ - 159 // compute the coordinates of the subface's corners in codim 0 entity │ │ │ │ │ -local coordinates │ │ │ │ │ - 160 static constexpr int elementdim = GridGlue::template GridView:: │ │ │ │ │ -template Codim<0>::Geometry::mydimension; │ │ │ │ │ - 161 │ │ │ │ │ - 162 // coordinates within the subentity that contains the remote intersection │ │ │ │ │ - 163 std::array() >, nSimplexCorners> │ │ │ │ │ -corners_subEntity_local; │ │ │ │ │ - 164 │ │ │ │ │ - 165 for (unsigned int par = 0; par < n_parents; ++par) { │ │ │ │ │ - 166 for (int i = 0; i < nSimplexCorners; ++i) │ │ │ │ │ - 167 corners_subEntity_local[i] = glue.merger_->template parentLocal │ │ │ │ │ -(mergeindex, i, par); │ │ │ │ │ + 145 // Constructor │ │ │ │ │ +146 StreamingMessageBuffer (DT *p) │ │ │ │ │ + 147 { │ │ │ │ │ + 148 a=p; │ │ │ │ │ + 149 i=0; │ │ │ │ │ + 150 j=0; │ │ │ │ │ + 151 } │ │ │ │ │ + 152 │ │ │ │ │ + 153 // write data to message buffer, acts like a stream ! │ │ │ │ │ + 154 template │ │ │ │ │ +155 void write (const Y& data) │ │ │ │ │ + 156 { │ │ │ │ │ + 157 static_assert(std::is_same::value, "DataType mismatch"); │ │ │ │ │ + 158 a[i++] = data; │ │ │ │ │ + 159 } │ │ │ │ │ + 160 │ │ │ │ │ + 161 // read data from message buffer, acts like a stream ! │ │ │ │ │ + 162 template │ │ │ │ │ +163 void read (Y& data) const │ │ │ │ │ + 164 { │ │ │ │ │ + 165 static_assert(std::is_same::value, "DataType mismatch"); │ │ │ │ │ + 166 data = a[j++]; │ │ │ │ │ + 167 } │ │ │ │ │ 168 │ │ │ │ │ - 169 // Coordinates of the remote intersection corners wrt the element │ │ │ │ │ -coordinate system │ │ │ │ │ - 170 std::array, nSimplexCorners> │ │ │ │ │ -corners_element_local; │ │ │ │ │ - 171 │ │ │ │ │ - 172 if (data.gridlocal) { │ │ │ │ │ - 173 data.gridindices[par] = glue.merger_->template parent │ │ │ │ │ -(mergeindex,par); │ │ │ │ │ - 174 │ │ │ │ │ - 175 typename GridGlue::template GridPatch::LocalGeometry │ │ │ │ │ - 176 gridLocalGeometry = glue.template patch().geometryLocal │ │ │ │ │ -(data.gridindices[par]); │ │ │ │ │ - 177 for (std::size_t i=0; i::Geometry │ │ │ │ │ - 196 gridWorldGeometry = glue.template patch().geometry(data.gridindices │ │ │ │ │ -[par]); │ │ │ │ │ - 197 │ │ │ │ │ - 198 // world coordinates of the remote intersection corners │ │ │ │ │ - 199 std::array:: │ │ │ │ │ -dimensionworld>, nSimplexCorners> corners_global; │ │ │ │ │ - 200 │ │ │ │ │ - 201 for (std::size_t i=0; i │ │ │ │ │ -213 IntersectionData::IntersectionData(const GridGlue& glue, unsigned │ │ │ │ │ -int mergeindex, unsigned int offset, │ │ │ │ │ - 214 bool grid0local, bool grid1local) │ │ │ │ │ - 215 : index_(mergeindex+offset) │ │ │ │ │ - 216 { │ │ │ │ │ - 217 // if an invalid index is given do not proceed! │ │ │ │ │ - 218 // (happens when the parent GridGlue initializes the "end"-Intersection) │ │ │ │ │ - 219 assert (0 <= mergeindex || mergeindex < glue.index__sz); │ │ │ │ │ +169 size_t counter() const { return i; } │ │ │ │ │ + 170 │ │ │ │ │ +171 void clear() │ │ │ │ │ + 172 { │ │ │ │ │ + 173 i = 0; │ │ │ │ │ + 174 j = 0; │ │ │ │ │ + 175 } │ │ │ │ │ + 176 │ │ │ │ │ + 177 // we need access to these variables in an assertion │ │ │ │ │ + 178#ifdef NDEBUG │ │ │ │ │ + 179 private: │ │ │ │ │ + 180#endif │ │ │ │ │ +181 DT *a; │ │ │ │ │ +182 size_t i; │ │ │ │ │ +183 mutable size_t j; │ │ │ │ │ + 184 }; │ │ │ │ │ + 185 │ │ │ │ │ + 192 template │ │ │ │ │ +193 class CommunicationOperator │ │ │ │ │ + 194 { │ │ │ │ │ + 195 public: │ │ │ │ │ + 196 template │ │ │ │ │ +197 static const typename CommInfo::DataType& gather(const CommInfo& commInfo, │ │ │ │ │ +size_t i, size_t j = 0) │ │ │ │ │ + 198 { │ │ │ │ │ + 199 // get Intersection │ │ │ │ │ + 200 typedef typename CommInfo::GridGlue::Intersection Intersection; │ │ │ │ │ + 201 Intersection ris(commInfo.gridglue->getIntersection(i)); │ │ │ │ │ + 202 │ │ │ │ │ + 203 // fill buffer if we have a new intersection │ │ │ │ │ + 204 if (j == 0) │ │ │ │ │ + 205 { │ │ │ │ │ + 206 commInfo.mbuffer.clear(); │ │ │ │ │ + 207 if (dir == Dune::ForwardCommunication) │ │ │ │ │ + 208 { │ │ │ │ │ + 209 // read from grid0 │ │ │ │ │ + 210 if(ris.self()) │ │ │ │ │ + 211 commInfo.data->gather(commInfo.mbuffer, ris.inside(), ris); │ │ │ │ │ + 212 } │ │ │ │ │ + 213 else // (dir == Dune::BackwardCommunication) │ │ │ │ │ + 214 { │ │ │ │ │ + 215 // read from grid1 │ │ │ │ │ + 216 if(ris.neighbor()) │ │ │ │ │ + 217 commInfo.data->gather(commInfo.mbuffer, ris.outside(), ris.flip()); │ │ │ │ │ + 218 } │ │ │ │ │ + 219 } │ │ │ │ │ 220 │ │ │ │ │ - 221 std::get<0>(sideData_).gridlocal = grid0local; │ │ │ │ │ - 222 std::get<1>(sideData_).gridlocal = grid1local; │ │ │ │ │ - 223 │ │ │ │ │ - 224 initializeGeometry<0>(glue, mergeindex); │ │ │ │ │ - 225 initializeGeometry<1>(glue, mergeindex); │ │ │ │ │ - 226 } │ │ │ │ │ - 227 │ │ │ │ │ - 232 template │ │ │ │ │ -233 struct IntersectionTraits │ │ │ │ │ - 234 { │ │ │ │ │ -235 using GridGlue = ::Dune::GridGlue::GridGlue; │ │ │ │ │ -236 using IntersectionData = Dune::GridGlue::IntersectionData; │ │ │ │ │ - 237 │ │ │ │ │ -238 using InsideGridView = typename GridGlue::template GridView; │ │ │ │ │ -239 using OutsideGridView = typename GridGlue::template GridView; │ │ │ │ │ - 240 │ │ │ │ │ -241 using InsideLocalGeometry = typename IntersectionData::template │ │ │ │ │ -GridLocalGeometry; │ │ │ │ │ -242 using OutsideLocalGeometry = typename IntersectionData::template │ │ │ │ │ -GridLocalGeometry; │ │ │ │ │ - 243 │ │ │ │ │ -244 using Geometry = typename IntersectionData::template GridGeometry; │ │ │ │ │ -245 using OutsideGeometry = typename IntersectionData::template │ │ │ │ │ -GridGeometry; │ │ │ │ │ - 246 │ │ │ │ │ -247 static constexpr auto coorddim = IntersectionData::coorddim; │ │ │ │ │ -248 static constexpr auto mydim = IntersectionData::mydim; │ │ │ │ │ -249 static constexpr int insidePatch = inside; │ │ │ │ │ -250 static constexpr int outsidePatch = outside; │ │ │ │ │ - 251 │ │ │ │ │ -252 using ctype = typename GridGlue::ctype; │ │ │ │ │ -253 using LocalCoordinate = Dune::FieldVector; │ │ │ │ │ -254 using GlobalCoordinate = Dune::FieldVector; │ │ │ │ │ - 255 }; │ │ │ │ │ - 256 │ │ │ │ │ - 259 template │ │ │ │ │ -260 class Intersection │ │ │ │ │ - 261 { │ │ │ │ │ + 221 // return the j'th value in the buffer │ │ │ │ │ + 222 assert(j < commInfo.mbuffer.i); │ │ │ │ │ + 223 return commInfo.buffer[j]; │ │ │ │ │ + 224 } │ │ │ │ │ + 225 │ │ │ │ │ + 226 template │ │ │ │ │ +227 static void scatter(CommInfo& commInfo, const typename CommInfo::DataType& │ │ │ │ │ +v, std::size_t i, std::size_t j = 0) │ │ │ │ │ + 228 { │ │ │ │ │ + 229 // extract GridGlue objects... │ │ │ │ │ + 230 typedef typename CommInfo::GridGlue::Intersection Intersection; │ │ │ │ │ + 231 Intersection ris(commInfo.gridglue->getIntersection(i)); │ │ │ │ │ + 232 │ │ │ │ │ + 233 // get size if we have a new intersection │ │ │ │ │ + 234 if (j == 0) │ │ │ │ │ + 235 { │ │ │ │ │ + 236 commInfo.mbuffer.clear(); │ │ │ │ │ + 237 commInfo.currentsize = commInfo.data->size(ris); │ │ │ │ │ + 238 } │ │ │ │ │ + 239 │ │ │ │ │ + 240 // write entry to buffer │ │ │ │ │ + 241 commInfo.buffer[j] = v; │ │ │ │ │ + 242 │ │ │ │ │ + 243 // write back the buffer if we are at the end of this intersection │ │ │ │ │ + 244 if (j == commInfo.currentsize-1) │ │ │ │ │ + 245 { │ │ │ │ │ + 246 if (dir == Dune::ForwardCommunication) │ │ │ │ │ + 247 { │ │ │ │ │ + 248 // write to grid1 │ │ │ │ │ + 249 if(ris.neighbor()) │ │ │ │ │ + 250 commInfo.data->scatter(commInfo.mbuffer, ris.outside(), ris.flip(), │ │ │ │ │ +commInfo.currentsize); │ │ │ │ │ + 251 } │ │ │ │ │ + 252 else // (dir == Dune::BackwardCommunication) │ │ │ │ │ + 253 { │ │ │ │ │ + 254 // write to grid0 │ │ │ │ │ + 255 if(ris.self()) │ │ │ │ │ + 256 commInfo.data->scatter(commInfo.mbuffer, ris.inside(), ris, │ │ │ │ │ +commInfo.currentsize); │ │ │ │ │ + 257 } │ │ │ │ │ + 258 assert(commInfo.mbuffer.j <= commInfo.currentsize); │ │ │ │ │ + 259 } │ │ │ │ │ + 260 } │ │ │ │ │ + 261 }; │ │ │ │ │ 262 │ │ │ │ │ - 263 public: │ │ │ │ │ - 264 │ │ │ │ │ -265 typedef IntersectionTraits Traits; │ │ │ │ │ - 266 │ │ │ │ │ -267 typedef typename Traits::GridGlue GridGlue; │ │ │ │ │ -268 typedef typename Traits::IntersectionData IntersectionData; │ │ │ │ │ - 269 │ │ │ │ │ - 270 │ │ │ │ │ -271 typedef typename Traits::InsideGridView InsideGridView; │ │ │ │ │ -272 typedef typename Traits::InsideLocalGeometry InsideLocalGeometry; │ │ │ │ │ - 273 │ │ │ │ │ -274 typedef typename Traits::OutsideGridView OutsideGridView; │ │ │ │ │ -275 typedef typename Traits::OutsideLocalGeometry OutsideLocalGeometry; │ │ │ │ │ -276 typedef typename Traits::OutsideGeometry OutsideGeometry; │ │ │ │ │ - 277 │ │ │ │ │ -278 typedef typename Traits::Geometry Geometry; │ │ │ │ │ -279 typedef typename Traits::ctype ctype; │ │ │ │ │ - 280 │ │ │ │ │ -281 typedef typename InsideGridView::Traits::template Codim<0>::Entity │ │ │ │ │ -InsideEntity; │ │ │ │ │ -282 typedef typename OutsideGridView::Traits::template Codim<0>::Entity │ │ │ │ │ -OutsideEntity; │ │ │ │ │ +263 typedef CommunicationOperator ForwardOperator; │ │ │ │ │ +264 typedef CommunicationOperator │ │ │ │ │ +BackwardOperator; │ │ │ │ │ + 265 │ │ │ │ │ + 270 template │ │ │ │ │ +271 struct CommInfo │ │ │ │ │ + 272 { │ │ │ │ │ +273 typedef DataTypeImp value_type; │ │ │ │ │ +274 typedef GG GridGlue; │ │ │ │ │ +275 typedef DataTypeImp DataType; │ │ │ │ │ + 276 │ │ │ │ │ +277 CommInfo() : buffer(100), mbuffer(&buffer[0]) │ │ │ │ │ + 278 {} │ │ │ │ │ + 279 │ │ │ │ │ + 280 // tunnel information to the policy and the operators │ │ │ │ │ +281 const GridGlue * gridglue; │ │ │ │ │ +282 ::Dune::GridGlue::CommDataHandle * data; │ │ │ │ │ 283 │ │ │ │ │ -284 typedef typename Traits::LocalCoordinate LocalCoordinate; │ │ │ │ │ -285 typedef typename Traits::GlobalCoordinate GlobalCoordinate; │ │ │ │ │ - 286 │ │ │ │ │ -288 static constexpr auto coorddim = Traits::coorddim; │ │ │ │ │ - 289 │ │ │ │ │ -291 static constexpr auto mydim = Traits::mydim; │ │ │ │ │ + 284 // state variables │ │ │ │ │ +285 std::vector buffer; │ │ │ │ │ +286 mutable ::Dune::GridGlue::StreamingMessageBuffer mbuffer; │ │ │ │ │ +287 size_t currentsize; │ │ │ │ │ +288 Dune::CommunicationDirection dir; │ │ │ │ │ + 289 }; │ │ │ │ │ + 290 │ │ │ │ │ + 291 } // end namespace GridGlue │ │ │ │ │ 292 │ │ │ │ │ -294 static constexpr int insidePatch = Traits::insidePatch; │ │ │ │ │ - 295 │ │ │ │ │ -297 static constexpr int outsidePatch = Traits::outsidePatch; │ │ │ │ │ - 298 │ │ │ │ │ - 299 // typedef unsigned int IndexType; │ │ │ │ │ - 300 │ │ │ │ │ - 301 private: │ │ │ │ │ - 305 static constexpr int codimensionWorld = coorddim - mydim; │ │ │ │ │ - 306 │ │ │ │ │ - 307 public: │ │ │ │ │ - 308 /* C O N S T R U C T O R S */ │ │ │ │ │ - 309 │ │ │ │ │ -311 Intersection(const GridGlue* glue, const IntersectionData* i) : │ │ │ │ │ - 312 glue_(glue), i_(i) {} │ │ │ │ │ - 313 │ │ │ │ │ - 314 /* F U N C T I O N A L I T Y */ │ │ │ │ │ - 315 │ │ │ │ │ - 318 InsideEntity │ │ │ │ │ -319 inside(unsigned int parentId = 0) const │ │ │ │ │ - 320 { │ │ │ │ │ - 321 assert(self()); │ │ │ │ │ - 322 return glue_->template patch().element(i_->template index │ │ │ │ │ -(parentId)); │ │ │ │ │ - 323 } │ │ │ │ │ - 324 │ │ │ │ │ - 327 OutsideEntity │ │ │ │ │ -328 outside(unsigned int parentId = 0) const │ │ │ │ │ - 329 { │ │ │ │ │ - 330 assert(neighbor()); │ │ │ │ │ - 331 return glue_->template patch().element(i_->template index │ │ │ │ │ -(parentId)); │ │ │ │ │ - 332 } │ │ │ │ │ - 333 │ │ │ │ │ -335 bool conforming() const │ │ │ │ │ - 336 { │ │ │ │ │ - 337 throw Dune::NotImplemented(); │ │ │ │ │ - 338 } │ │ │ │ │ - 339 │ │ │ │ │ -342 const InsideLocalGeometry& geometryInInside(unsigned int parentId = 0) │ │ │ │ │ -const │ │ │ │ │ - 343 { │ │ │ │ │ - 344 return i_->template localGeometry(parentId); │ │ │ │ │ - 345 } │ │ │ │ │ - 346 │ │ │ │ │ -349 const OutsideLocalGeometry& geometryInOutside(unsigned int parentId = 0) │ │ │ │ │ -const │ │ │ │ │ - 350 { │ │ │ │ │ - 351 return i_->template localGeometry(parentId); │ │ │ │ │ - 352 } │ │ │ │ │ - 353 │ │ │ │ │ -360 const Geometry& geometry() const │ │ │ │ │ - 361 { │ │ │ │ │ - 362 return i_->template geometry(); │ │ │ │ │ - 363 } │ │ │ │ │ - 364 │ │ │ │ │ -371 const OutsideGeometry& geometryOutside() const // DUNE_DEPRECATED │ │ │ │ │ - 372 { │ │ │ │ │ - 373 return i_->template geometry(); │ │ │ │ │ - 374 } │ │ │ │ │ - 375 │ │ │ │ │ -377 Dune::GeometryType type() const │ │ │ │ │ - 378 { │ │ │ │ │ - 379 #ifdef ONLY_SIMPLEX_INTERSECTIONS │ │ │ │ │ - 380 # if DUNE_VERSION_NEWER(DUNE_GEOMETRY, 2, 6) │ │ │ │ │ - 381 return Dune::GeometryTypes::simplex(mydim); │ │ │ │ │ - 382 # else │ │ │ │ │ - 383 static const Dune::GeometryType type(Dune::GeometryType::simplex, mydim); │ │ │ │ │ - 384 return type; │ │ │ │ │ - 385 # endif │ │ │ │ │ - 386 #else │ │ │ │ │ - 387 #error Not Implemented │ │ │ │ │ - 388 #endif │ │ │ │ │ - 389 } │ │ │ │ │ - 390 │ │ │ │ │ - 391 │ │ │ │ │ -393 bool self() const │ │ │ │ │ - 394 { │ │ │ │ │ - 395 return i_->template local(); │ │ │ │ │ - 396 } │ │ │ │ │ - 397 │ │ │ │ │ -399 size_t neighbor(unsigned int g = 0) const │ │ │ │ │ - 400 { │ │ │ │ │ - 401 if (g == 0 && i_->template local()) { │ │ │ │ │ - 402 return i_->template parents(); │ │ │ │ │ - 403 } else if (g == 1 && i_->template local()) { │ │ │ │ │ - 404 return i_->template parents(); │ │ │ │ │ - 405 } │ │ │ │ │ - 406 return 0; │ │ │ │ │ - 407 } │ │ │ │ │ - 408 │ │ │ │ │ -410 int indexInInside(unsigned int parentId = 0) const │ │ │ │ │ - 411 { │ │ │ │ │ - 412 assert(self()); │ │ │ │ │ - 413 return glue_->template patch().indexInInside(i_->template index │ │ │ │ │ -(parentId)); │ │ │ │ │ - 414 } │ │ │ │ │ - 415 │ │ │ │ │ -417 int indexInOutside(unsigned int parentId = 0) const │ │ │ │ │ - 418 { │ │ │ │ │ - 419 assert(neighbor()); │ │ │ │ │ - 420 return glue_->template patch().indexInInside(i_->template index │ │ │ │ │ -(parentId)); │ │ │ │ │ - 421 } │ │ │ │ │ - 422 │ │ │ │ │ -427 GlobalCoordinate outerNormal(const LocalCoordinate &local) const │ │ │ │ │ - 428 { │ │ │ │ │ - 429 GlobalCoordinate normal; │ │ │ │ │ - 430 │ │ │ │ │ - 431 if (codimensionWorld == 0) │ │ │ │ │ - 432 DUNE_THROW(Dune::Exception, "There is no normal vector to a full- │ │ │ │ │ -dimensional intersection"); │ │ │ │ │ - 433 else if (codimensionWorld == 1) { │ │ │ │ │ - 434 /* TODO: Implement the general n-ary cross product here */ │ │ │ │ │ - 435 const auto jacobianTransposed = geometry().jacobianTransposed(local); │ │ │ │ │ - 436 if (mydim==1) { │ │ │ │ │ - 437 normal[0] = - jacobianTransposed[0][1]; │ │ │ │ │ - 438 normal[1] = jacobianTransposed[0][0]; │ │ │ │ │ - 439 } else if (mydim==2) { │ │ │ │ │ - 440 normal[0] = (jacobianTransposed[0][1] * jacobianTransposed[1][2] - │ │ │ │ │ -jacobianTransposed[0][2] * jacobianTransposed[1][1]); │ │ │ │ │ - 441 normal[1] = - (jacobianTransposed[0][0] * jacobianTransposed[1][2] - │ │ │ │ │ -jacobianTransposed[0][2] * jacobianTransposed[1][0]); │ │ │ │ │ - 442 normal[2] = (jacobianTransposed[0][0] * jacobianTransposed[1][1] - │ │ │ │ │ -jacobianTransposed[0][1] * jacobianTransposed[1][0]); │ │ │ │ │ - 443 } else │ │ │ │ │ - 444 DUNE_THROW(Dune::NotImplemented, "Remote intersections don't implement the │ │ │ │ │ -'outerNormal' method for " << mydim << "-dimensional intersections yet"); │ │ │ │ │ - 445 } else │ │ │ │ │ - 446 DUNE_THROW(Dune::NotImplemented, "Remote intersections don't implement the │ │ │ │ │ -'outerNormal' method for intersections with codim >= 2 yet"); │ │ │ │ │ - 447 │ │ │ │ │ - 448 return normal; │ │ │ │ │ - 449 } │ │ │ │ │ - 450 │ │ │ │ │ -455 GlobalCoordinate unitOuterNormal(const LocalCoordinate &local) const │ │ │ │ │ - 456 { │ │ │ │ │ - 457 GlobalCoordinate normal = outerNormal(local); │ │ │ │ │ - 458 normal /= normal.two_norm(); │ │ │ │ │ - 459 return normal; │ │ │ │ │ - 460 } │ │ │ │ │ - 461 │ │ │ │ │ -466 GlobalCoordinate integrationOuterNormal(const LocalCoordinate &local) const │ │ │ │ │ - 467 { │ │ │ │ │ - 468 return (unitOuterNormal(local) *= geometry().integrationElement(local)); │ │ │ │ │ - 469 } │ │ │ │ │ - 470 │ │ │ │ │ -475 GlobalCoordinate centerUnitOuterNormal () const │ │ │ │ │ - 476 { │ │ │ │ │ - 477 return unitOuterNormal(ReferenceElements::general(type │ │ │ │ │ -()).position(0,0)); │ │ │ │ │ - 478 } │ │ │ │ │ - 479 │ │ │ │ │ -483 Intersection flip() const │ │ │ │ │ - 484 { │ │ │ │ │ - 485 return Intersection(glue_,i_); │ │ │ │ │ - 486 } │ │ │ │ │ - 487 │ │ │ │ │ - 488#ifdef QUICKHACK_INDEX │ │ │ │ │ - 489 typedef typename GridGlue::IndexType IndexType; │ │ │ │ │ - 490 │ │ │ │ │ - 491 IndexType index() const │ │ │ │ │ - 492 { │ │ │ │ │ - 493 return i_->index_; │ │ │ │ │ - 494 } │ │ │ │ │ - 495 │ │ │ │ │ - 496#endif │ │ │ │ │ - 497 │ │ │ │ │ - 498 private: │ │ │ │ │ - 499 │ │ │ │ │ - 500 friend class IntersectionIndexSet; │ │ │ │ │ - 501 │ │ │ │ │ - 502 /* M E M B E R V A R I A B L E S */ │ │ │ │ │ - 503 │ │ │ │ │ - 505 const GridGlue* glue_; │ │ │ │ │ - 506 │ │ │ │ │ - 508 const IntersectionData* i_; │ │ │ │ │ - 509 }; │ │ │ │ │ - 510 │ │ │ │ │ - 511 │ │ │ │ │ - 512 } // end namespace GridGlue │ │ │ │ │ - 513} // end namespace Dune │ │ │ │ │ - 514 │ │ │ │ │ - 515#endif // DUNE_GRIDGLUE_ADAPTER_INTERSECTION_HH │ │ │ │ │ -gridglue.hh │ │ │ │ │ -Central component of the module implementing the coupling of two grids. │ │ │ │ │ + 293#if HAVE_MPI │ │ │ │ │ + 298 template │ │ │ │ │ +299 struct CommPolicy< ::Dune::GridGlue::CommInfo > │ │ │ │ │ + 300 { │ │ │ │ │ +304 typedef ::Dune::GridGlue::CommInfo Type; │ │ │ │ │ + 305 │ │ │ │ │ +309 typedef DataTypeImp IndexedType; │ │ │ │ │ + 310 │ │ │ │ │ + 314 // typedef SizeOne IndexedTypeFlag; │ │ │ │ │ +315 typedef VariableSize IndexedTypeFlag; │ │ │ │ │ + 316 │ │ │ │ │ +320 static size_t getSize(const Type& commInfo, size_t i) │ │ │ │ │ + 321 { │ │ │ │ │ + 322 // get Intersection │ │ │ │ │ + 323 typedef typename Type::GridGlue::Intersection Intersection; │ │ │ │ │ + 324 Intersection ris(commInfo.gridglue->getIntersection(i)); │ │ │ │ │ + 325 │ │ │ │ │ + 326 // ask data handle for size │ │ │ │ │ + 327 return commInfo.data->size(ris); │ │ │ │ │ + 328 } │ │ │ │ │ + 329 }; │ │ │ │ │ + 330#endif │ │ │ │ │ + 331 │ │ │ │ │ + 332} // end namespace Dune │ │ │ │ │ + 333#endif │ │ │ │ │ Dune │ │ │ │ │ Definition: gridglue.hh:37 │ │ │ │ │ -Dune::GridGlue::ProjectionImplementation::inside │ │ │ │ │ -bool inside(const Coordinate &x, const Field &epsilon) │ │ │ │ │ -Definition: projection_impl.hh:111 │ │ │ │ │ -Dune::GridGlue::GridGlue │ │ │ │ │ -sequential adapter to couple two grids at specified close together boundaries │ │ │ │ │ -Definition: gridglue.hh:67 │ │ │ │ │ -Dune::GridGlue::GridGlue::IndexType │ │ │ │ │ -unsigned int IndexType │ │ │ │ │ -Definition: gridglue.hh:147 │ │ │ │ │ -Dune::GridGlue::GridGlue::ctype │ │ │ │ │ -PromotionTraits< typenameGridView< 0 >::ctype, typenameGridView< 1 >::ctype >:: │ │ │ │ │ -PromotedType ctype │ │ │ │ │ -The type used for coordinates. │ │ │ │ │ -Definition: gridglue.hh:171 │ │ │ │ │ -Dune::GridGlue::GridGlue::dimworld │ │ │ │ │ -static constexpr int dimworld │ │ │ │ │ -export the world dimension This is the maximum of the extractors' world │ │ │ │ │ -dimensions. │ │ │ │ │ -Definition: gridglue.hh:166 │ │ │ │ │ -Dune::GridGlue::IntersectionData │ │ │ │ │ -storage class for Dune::GridGlue::Intersection related data │ │ │ │ │ -Definition: intersection.hh:38 │ │ │ │ │ -Dune::GridGlue::IntersectionData::IndexType │ │ │ │ │ -GridGlue::IndexType IndexType │ │ │ │ │ -Definition: intersection.hh:42 │ │ │ │ │ -Dune::GridGlue::IntersectionData::GridGeometry │ │ │ │ │ -AffineGeometry< typename GridGlue::template GridView< side >::ctype, mydim, │ │ │ │ │ -GridGlue::template GridView< side >::dimensionworld > GridGeometry │ │ │ │ │ -Definition: intersection.hh:65 │ │ │ │ │ -Dune::GridGlue::IntersectionData::localGeometry │ │ │ │ │ -const GridLocalGeometry< side > & localGeometry(unsigned int parentId=0) const │ │ │ │ │ -Definition: intersection.hh:85 │ │ │ │ │ -Dune::GridGlue::IntersectionData::coorddim │ │ │ │ │ -static constexpr int coorddim │ │ │ │ │ -Dimension of the world space of the intersection. │ │ │ │ │ -Definition: intersection.hh:45 │ │ │ │ │ -Dune::GridGlue::IntersectionData::Grid0Geometry │ │ │ │ │ -GridGeometry< 0 > Grid0Geometry │ │ │ │ │ -Definition: intersection.hh:67 │ │ │ │ │ -Dune::GridGlue::IntersectionData::GridIndexType │ │ │ │ │ -typename GridGlue::template GridView< side >::IndexSet::IndexType GridIndexType │ │ │ │ │ -Definition: intersection.hh:71 │ │ │ │ │ -Dune::GridGlue::IntersectionData::index │ │ │ │ │ -IndexType index(unsigned int parentId=0) const │ │ │ │ │ -Definition: intersection.hh:97 │ │ │ │ │ -Dune::GridGlue::IntersectionData::parents │ │ │ │ │ -IndexType parents() const │ │ │ │ │ -Definition: intersection.hh:101 │ │ │ │ │ -Dune::GridGlue::IntersectionData::Grid1LocalGeometry │ │ │ │ │ -GridLocalGeometry< 1 > Grid1LocalGeometry │ │ │ │ │ -Definition: intersection.hh:61 │ │ │ │ │ -Dune::GridGlue::IntersectionData::geometry │ │ │ │ │ -const GridGeometry< side > & geometry() const │ │ │ │ │ -Definition: intersection.hh:89 │ │ │ │ │ -Dune::GridGlue::IntersectionData::local │ │ │ │ │ -bool local() const │ │ │ │ │ -Definition: intersection.hh:93 │ │ │ │ │ -Dune::GridGlue::IntersectionData::GridGlue │ │ │ │ │ -::Dune::GridGlue::GridGlue< P0, P1 > GridGlue │ │ │ │ │ -Definition: intersection.hh:40 │ │ │ │ │ -Dune::GridGlue::IntersectionData::mydim │ │ │ │ │ -static constexpr int mydim │ │ │ │ │ -Dimension of the intersection. │ │ │ │ │ -Definition: intersection.hh:54 │ │ │ │ │ -Dune::GridGlue::IntersectionData::GridLocalGeometry │ │ │ │ │ -AffineGeometry< typename GridGlue::template GridView< side >::ctype, mydim, │ │ │ │ │ -GridGlue::template GridView< side >::dimension > GridLocalGeometry │ │ │ │ │ -Definition: intersection.hh:58 │ │ │ │ │ -Dune::GridGlue::IntersectionData::Grid0LocalGeometry │ │ │ │ │ -GridLocalGeometry< 0 > Grid0LocalGeometry │ │ │ │ │ -Definition: intersection.hh:60 │ │ │ │ │ -Dune::GridGlue::IntersectionData::index_ │ │ │ │ │ -IndexType index_ │ │ │ │ │ -index of this intersection after GridGlue interface │ │ │ │ │ -Definition: intersection.hh:112 │ │ │ │ │ -Dune::GridGlue::IntersectionData::Grid1IndexType │ │ │ │ │ -GridIndexType< 1 > Grid1IndexType │ │ │ │ │ -Definition: intersection.hh:74 │ │ │ │ │ -Dune::GridGlue::IntersectionData::Grid1Geometry │ │ │ │ │ -GridGeometry< 1 > Grid1Geometry │ │ │ │ │ -Definition: intersection.hh:68 │ │ │ │ │ -Dune::GridGlue::IntersectionData::Grid0IndexType │ │ │ │ │ -GridIndexType< 0 > Grid0IndexType │ │ │ │ │ -Definition: intersection.hh:73 │ │ │ │ │ -Dune::GridGlue::IntersectionData::IntersectionData │ │ │ │ │ -IntersectionData()=default │ │ │ │ │ -Default Constructor. │ │ │ │ │ +Dune::GridGlue::BackwardOperator │ │ │ │ │ +CommunicationOperator< Dune::BackwardCommunication > BackwardOperator │ │ │ │ │ +Definition: gridgluecommunicate.hh:264 │ │ │ │ │ +Dune::GridGlue::ForwardOperator │ │ │ │ │ +CommunicationOperator< Dune::ForwardCommunication > ForwardOperator │ │ │ │ │ +Definition: gridgluecommunicate.hh:263 │ │ │ │ │ +Dune::GridGlue::RankPair │ │ │ │ │ +std::pair< int, int > RankPair │ │ │ │ │ +Definition: gridgluecommunicate.hh:24 │ │ │ │ │ +Dune::GridGlue::operator<< │ │ │ │ │ +std::ostream & operator<<(std::ostream &os, const GlobalId &id) │ │ │ │ │ +Definition: gridgluecommunicate.hh:55 │ │ │ │ │ Dune::GridGlue::Intersection │ │ │ │ │ The intersection of two entities of the two patches of a GridGlue. │ │ │ │ │ Definition: intersection.hh:261 │ │ │ │ │ -Dune::GridGlue::Intersection::OutsideLocalGeometry │ │ │ │ │ -Traits::OutsideLocalGeometry OutsideLocalGeometry │ │ │ │ │ -Definition: intersection.hh:275 │ │ │ │ │ Dune::GridGlue::Intersection::flip │ │ │ │ │ Intersection< P0, P1, O, I > flip() const │ │ │ │ │ Return a copy of the intersection with inside and outside switched. │ │ │ │ │ Definition: intersection.hh:483 │ │ │ │ │ -Dune::GridGlue::Intersection::conforming │ │ │ │ │ -bool conforming() const │ │ │ │ │ -Return true if intersection is conforming. │ │ │ │ │ -Definition: intersection.hh:335 │ │ │ │ │ -Dune::GridGlue::Intersection::InsideEntity │ │ │ │ │ -InsideGridView::Traits::template Codim< 0 >::Entity InsideEntity │ │ │ │ │ -Definition: intersection.hh:281 │ │ │ │ │ -Dune::GridGlue::Intersection::GridGlue │ │ │ │ │ -Traits::GridGlue GridGlue │ │ │ │ │ -Definition: intersection.hh:267 │ │ │ │ │ -Dune::GridGlue::Intersection::indexInOutside │ │ │ │ │ -int indexInOutside(unsigned int parentId=0) const │ │ │ │ │ -Local number of codim 1 entity in outside() Entity where intersection is │ │ │ │ │ -contained in. │ │ │ │ │ -Definition: intersection.hh:417 │ │ │ │ │ -Dune::GridGlue::Intersection::indexInInside │ │ │ │ │ -int indexInInside(unsigned int parentId=0) const │ │ │ │ │ -Local number of codim 1 entity in the inside() Entity where intersection is │ │ │ │ │ -contained in. │ │ │ │ │ -Definition: intersection.hh:410 │ │ │ │ │ Dune::GridGlue::Intersection::self │ │ │ │ │ bool self() const │ │ │ │ │ For parallel computations: Return true if inside() entity exists locally. │ │ │ │ │ Definition: intersection.hh:393 │ │ │ │ │ -Dune::GridGlue::Intersection::mydim │ │ │ │ │ -static constexpr auto mydim │ │ │ │ │ -dimension of the intersection │ │ │ │ │ -Definition: intersection.hh:291 │ │ │ │ │ -Dune::GridGlue::Intersection::outsidePatch │ │ │ │ │ -static constexpr int outsidePatch │ │ │ │ │ -outside patch │ │ │ │ │ -Definition: intersection.hh:297 │ │ │ │ │ -Dune::GridGlue::Intersection::type │ │ │ │ │ -Dune::GeometryType type() const │ │ │ │ │ -Type of reference element for this intersection. │ │ │ │ │ -Definition: intersection.hh:377 │ │ │ │ │ Dune::GridGlue::Intersection::inside │ │ │ │ │ InsideEntity inside(unsigned int parentId=0) const │ │ │ │ │ Return element on the inside of this intersection. │ │ │ │ │ Definition: intersection.hh:319 │ │ │ │ │ -Dune::GridGlue::Intersection::LocalCoordinate │ │ │ │ │ -Traits::LocalCoordinate LocalCoordinate │ │ │ │ │ -Definition: intersection.hh:284 │ │ │ │ │ -Dune::GridGlue::Intersection::geometryInOutside │ │ │ │ │ -const OutsideLocalGeometry & geometryInOutside(unsigned int parentId=0) const │ │ │ │ │ -Geometric information about this intersection in local coordinates of the │ │ │ │ │ -outside() element. │ │ │ │ │ -Definition: intersection.hh:349 │ │ │ │ │ -Dune::GridGlue::Intersection::unitOuterNormal │ │ │ │ │ -GlobalCoordinate unitOuterNormal(const LocalCoordinate &local) const │ │ │ │ │ -Return a unit outer normal. │ │ │ │ │ -Definition: intersection.hh:455 │ │ │ │ │ -Dune::GridGlue::Intersection::ctype │ │ │ │ │ -Traits::ctype ctype │ │ │ │ │ -Definition: intersection.hh:279 │ │ │ │ │ -Dune::GridGlue::Intersection::Traits │ │ │ │ │ -IntersectionTraits< P0, P1, I, O > Traits │ │ │ │ │ -Definition: intersection.hh:265 │ │ │ │ │ -Dune::GridGlue::Intersection::IntersectionData │ │ │ │ │ -Traits::IntersectionData IntersectionData │ │ │ │ │ -Definition: intersection.hh:268 │ │ │ │ │ -Dune::GridGlue::Intersection::GlobalCoordinate │ │ │ │ │ -Traits::GlobalCoordinate GlobalCoordinate │ │ │ │ │ -Definition: intersection.hh:285 │ │ │ │ │ -Dune::GridGlue::Intersection::OutsideGeometry │ │ │ │ │ -Traits::OutsideGeometry OutsideGeometry │ │ │ │ │ -Definition: intersection.hh:276 │ │ │ │ │ Dune::GridGlue::Intersection::neighbor │ │ │ │ │ size_t neighbor(unsigned int g=0) const │ │ │ │ │ Return number of embeddings into local grid0 (grid1) entities. │ │ │ │ │ Definition: intersection.hh:399 │ │ │ │ │ -Dune::GridGlue::Intersection::Intersection │ │ │ │ │ -Intersection(const GridGlue *glue, const IntersectionData *i) │ │ │ │ │ -Constructor for a given Dataset. │ │ │ │ │ -Definition: intersection.hh:311 │ │ │ │ │ -Dune::GridGlue::Intersection::insidePatch │ │ │ │ │ -static constexpr int insidePatch │ │ │ │ │ -inside patch │ │ │ │ │ -Definition: intersection.hh:294 │ │ │ │ │ -Dune::GridGlue::Intersection::Geometry │ │ │ │ │ -Traits::Geometry Geometry │ │ │ │ │ -Definition: intersection.hh:278 │ │ │ │ │ -Dune::GridGlue::Intersection::OutsideEntity │ │ │ │ │ -OutsideGridView::Traits::template Codim< 0 >::Entity OutsideEntity │ │ │ │ │ -Definition: intersection.hh:282 │ │ │ │ │ Dune::GridGlue::Intersection::outside │ │ │ │ │ OutsideEntity outside(unsigned int parentId=0) const │ │ │ │ │ Return element on the outside of this intersection. │ │ │ │ │ Definition: intersection.hh:328 │ │ │ │ │ -Dune::GridGlue::Intersection::geometry │ │ │ │ │ -const Geometry & geometry() const │ │ │ │ │ -Geometric information about this intersection as part of the inside grid. │ │ │ │ │ -Definition: intersection.hh:360 │ │ │ │ │ -Dune::GridGlue::Intersection::InsideLocalGeometry │ │ │ │ │ -Traits::InsideLocalGeometry InsideLocalGeometry │ │ │ │ │ -Definition: intersection.hh:272 │ │ │ │ │ -Dune::GridGlue::Intersection::outerNormal │ │ │ │ │ -GlobalCoordinate outerNormal(const LocalCoordinate &local) const │ │ │ │ │ -Return an outer normal (length not necessarily 1) │ │ │ │ │ -Definition: intersection.hh:427 │ │ │ │ │ -Dune::GridGlue::Intersection::geometryOutside │ │ │ │ │ -const OutsideGeometry & geometryOutside() const │ │ │ │ │ -Geometric information about this intersection as part of the outside grid. │ │ │ │ │ -Definition: intersection.hh:371 │ │ │ │ │ -Dune::GridGlue::Intersection::OutsideGridView │ │ │ │ │ -Traits::OutsideGridView OutsideGridView │ │ │ │ │ -Definition: intersection.hh:274 │ │ │ │ │ -Dune::GridGlue::Intersection::integrationOuterNormal │ │ │ │ │ -GlobalCoordinate integrationOuterNormal(const LocalCoordinate &local) const │ │ │ │ │ -Return an outer normal with the length of the integration element. │ │ │ │ │ -Definition: intersection.hh:466 │ │ │ │ │ -Dune::GridGlue::Intersection::InsideGridView │ │ │ │ │ -Traits::InsideGridView InsideGridView │ │ │ │ │ -Definition: intersection.hh:271 │ │ │ │ │ -Dune::GridGlue::Intersection::geometryInInside │ │ │ │ │ -const InsideLocalGeometry & geometryInInside(unsigned int parentId=0) const │ │ │ │ │ -Geometric information about this intersection in local coordinates of the │ │ │ │ │ -inside() element. │ │ │ │ │ -Definition: intersection.hh:342 │ │ │ │ │ -Dune::GridGlue::Intersection::centerUnitOuterNormal │ │ │ │ │ -GlobalCoordinate centerUnitOuterNormal() const │ │ │ │ │ -Unit outer normal at the center of the intersection. │ │ │ │ │ -Definition: intersection.hh:475 │ │ │ │ │ -Dune::GridGlue::Intersection::coorddim │ │ │ │ │ -static constexpr auto coorddim │ │ │ │ │ -dimension of the world space of the intersection │ │ │ │ │ -Definition: intersection.hh:288 │ │ │ │ │ -Dune::GridGlue::IntersectionTraits │ │ │ │ │ -Definition: intersection.hh:234 │ │ │ │ │ -Dune::GridGlue::IntersectionTraits::insidePatch │ │ │ │ │ -static constexpr int insidePatch │ │ │ │ │ -Definition: intersection.hh:249 │ │ │ │ │ -Dune::GridGlue::IntersectionTraits::LocalCoordinate │ │ │ │ │ -Dune::FieldVector< ctype, mydim > LocalCoordinate │ │ │ │ │ -Definition: intersection.hh:253 │ │ │ │ │ -Dune::GridGlue::IntersectionTraits::coorddim │ │ │ │ │ -static constexpr auto coorddim │ │ │ │ │ -Definition: intersection.hh:247 │ │ │ │ │ -Dune::GridGlue::IntersectionTraits::OutsideGeometry │ │ │ │ │ -typename IntersectionData::template GridGeometry< outside > OutsideGeometry │ │ │ │ │ -Definition: intersection.hh:245 │ │ │ │ │ -Dune::GridGlue::IntersectionTraits::ctype │ │ │ │ │ -typename GridGlue::ctype ctype │ │ │ │ │ -Definition: intersection.hh:252 │ │ │ │ │ -Dune::GridGlue::IntersectionTraits::OutsideGridView │ │ │ │ │ -typename GridGlue::template GridView< outside > OutsideGridView │ │ │ │ │ -Definition: intersection.hh:239 │ │ │ │ │ -Dune::GridGlue::IntersectionTraits::GlobalCoordinate │ │ │ │ │ -Dune::FieldVector< ctype, coorddim > GlobalCoordinate │ │ │ │ │ -Definition: intersection.hh:254 │ │ │ │ │ -Dune::GridGlue::IntersectionTraits::OutsideLocalGeometry │ │ │ │ │ -typename IntersectionData::template GridLocalGeometry< outside > │ │ │ │ │ -OutsideLocalGeometry │ │ │ │ │ -Definition: intersection.hh:242 │ │ │ │ │ -Dune::GridGlue::IntersectionTraits::InsideGridView │ │ │ │ │ -typename GridGlue::template GridView< inside > InsideGridView │ │ │ │ │ -Definition: intersection.hh:238 │ │ │ │ │ -Dune::GridGlue::IntersectionTraits::Geometry │ │ │ │ │ -typename IntersectionData::template GridGeometry< inside > Geometry │ │ │ │ │ -Definition: intersection.hh:244 │ │ │ │ │ -Dune::GridGlue::IntersectionTraits::InsideLocalGeometry │ │ │ │ │ -typename IntersectionData::template GridLocalGeometry< inside > │ │ │ │ │ -InsideLocalGeometry │ │ │ │ │ -Definition: intersection.hh:241 │ │ │ │ │ -Dune::GridGlue::IntersectionTraits::outsidePatch │ │ │ │ │ -static constexpr int outsidePatch │ │ │ │ │ -Definition: intersection.hh:250 │ │ │ │ │ -Dune::GridGlue::IntersectionTraits::mydim │ │ │ │ │ -static constexpr auto mydim │ │ │ │ │ -Definition: intersection.hh:248 │ │ │ │ │ +Dune::GridGlue::GlobalId │ │ │ │ │ +Definition: gridgluecommunicate.hh:26 │ │ │ │ │ +Dune::GridGlue::GlobalId::GlobalId │ │ │ │ │ +GlobalId(int i) │ │ │ │ │ +Definition: gridgluecommunicate.hh:38 │ │ │ │ │ +Dune::GridGlue::GlobalId::GlobalId │ │ │ │ │ +GlobalId() │ │ │ │ │ +Definition: gridgluecommunicate.hh:30 │ │ │ │ │ +Dune::GridGlue::GlobalId::GlobalId │ │ │ │ │ +GlobalId(int i, int j, unsigned int n) │ │ │ │ │ +Definition: gridgluecommunicate.hh:48 │ │ │ │ │ +Dune::GridGlue::CommDataHandle │ │ │ │ │ +describes the features of a data handle for communication in parallel runs │ │ │ │ │ +using the GridGlue::commun... │ │ │ │ │ +Definition: gridgluecommunicate.hh:77 │ │ │ │ │ +Dune::GridGlue::CommDataHandle::size │ │ │ │ │ +size_t size(RISType &i) const │ │ │ │ │ +Definition: gridgluecommunicate.hh:92 │ │ │ │ │ +Dune::GridGlue::CommDataHandle::scatter │ │ │ │ │ +void scatter(MessageBufferImp &buff, const EntityType &e, const RISType &i, │ │ │ │ │ +size_t n) │ │ │ │ │ +Definition: gridgluecommunicate.hh:118 │ │ │ │ │ +Dune::GridGlue::CommDataHandle::gather │ │ │ │ │ +void gather(MessageBufferImp &buff, const EntityType &e, const RISType &i) │ │ │ │ │ +const │ │ │ │ │ +pack data from user to message buffer │ │ │ │ │ +Definition: gridgluecommunicate.hh:104 │ │ │ │ │ +Dune::GridGlue::CommDataHandle::DataType │ │ │ │ │ +DataTypeImp DataType │ │ │ │ │ +data type of data to communicate │ │ │ │ │ +Definition: gridgluecommunicate.hh:80 │ │ │ │ │ +Dune::GridGlue::CommDataHandle::CommDataHandle │ │ │ │ │ +CommDataHandle() │ │ │ │ │ +Definition: gridgluecommunicate.hh:84 │ │ │ │ │ +Dune::GridGlue::StreamingMessageBuffer │ │ │ │ │ +Definition: gridgluecommunicate.hh:141 │ │ │ │ │ +Dune::GridGlue::StreamingMessageBuffer::j │ │ │ │ │ +size_t j │ │ │ │ │ +Definition: gridgluecommunicate.hh:183 │ │ │ │ │ +Dune::GridGlue::StreamingMessageBuffer::StreamingMessageBuffer │ │ │ │ │ +StreamingMessageBuffer(DT *p) │ │ │ │ │ +Definition: gridgluecommunicate.hh:146 │ │ │ │ │ +Dune::GridGlue::StreamingMessageBuffer::a │ │ │ │ │ +DT * a │ │ │ │ │ +Definition: gridgluecommunicate.hh:181 │ │ │ │ │ +Dune::GridGlue::StreamingMessageBuffer::counter │ │ │ │ │ +size_t counter() const │ │ │ │ │ +Definition: gridgluecommunicate.hh:169 │ │ │ │ │ +Dune::GridGlue::StreamingMessageBuffer::write │ │ │ │ │ +void write(const Y &data) │ │ │ │ │ +Definition: gridgluecommunicate.hh:155 │ │ │ │ │ +Dune::GridGlue::StreamingMessageBuffer::read │ │ │ │ │ +void read(Y &data) const │ │ │ │ │ +Definition: gridgluecommunicate.hh:163 │ │ │ │ │ +Dune::GridGlue::StreamingMessageBuffer::value_type │ │ │ │ │ +DT value_type │ │ │ │ │ +Definition: gridgluecommunicate.hh:143 │ │ │ │ │ +Dune::GridGlue::StreamingMessageBuffer::i │ │ │ │ │ +size_t i │ │ │ │ │ +Definition: gridgluecommunicate.hh:182 │ │ │ │ │ +Dune::GridGlue::StreamingMessageBuffer::clear │ │ │ │ │ +void clear() │ │ │ │ │ +Definition: gridgluecommunicate.hh:171 │ │ │ │ │ +Dune::GridGlue::CommunicationOperator │ │ │ │ │ +forward gather scatter to user defined CommInfo class │ │ │ │ │ +Definition: gridgluecommunicate.hh:194 │ │ │ │ │ +Dune::GridGlue::CommunicationOperator::scatter │ │ │ │ │ +static void scatter(CommInfo &commInfo, const typename CommInfo::DataType &v, │ │ │ │ │ +std::size_t i, std::size_t j=0) │ │ │ │ │ +Definition: gridgluecommunicate.hh:227 │ │ │ │ │ +Dune::GridGlue::CommunicationOperator::gather │ │ │ │ │ +static const CommInfo::DataType & gather(const CommInfo &commInfo, size_t i, │ │ │ │ │ +size_t j=0) │ │ │ │ │ +Definition: gridgluecommunicate.hh:197 │ │ │ │ │ +Dune::GridGlue::CommInfo │ │ │ │ │ +collects all GridGlue data requried for communication │ │ │ │ │ +Definition: gridgluecommunicate.hh:272 │ │ │ │ │ +Dune::GridGlue::CommInfo::dir │ │ │ │ │ +Dune::CommunicationDirection dir │ │ │ │ │ +Definition: gridgluecommunicate.hh:288 │ │ │ │ │ +Dune::GridGlue::CommInfo::value_type │ │ │ │ │ +DataTypeImp value_type │ │ │ │ │ +Definition: gridgluecommunicate.hh:273 │ │ │ │ │ +Dune::GridGlue::CommInfo::DataType │ │ │ │ │ +DataTypeImp DataType │ │ │ │ │ +Definition: gridgluecommunicate.hh:275 │ │ │ │ │ +Dune::GridGlue::CommInfo::data │ │ │ │ │ +::Dune::GridGlue::CommDataHandle< DataHandleImp, DataTypeImp > * data │ │ │ │ │ +Definition: gridgluecommunicate.hh:282 │ │ │ │ │ +Dune::GridGlue::CommInfo::GridGlue │ │ │ │ │ +GG GridGlue │ │ │ │ │ +Definition: gridgluecommunicate.hh:274 │ │ │ │ │ +Dune::GridGlue::CommInfo::currentsize │ │ │ │ │ +size_t currentsize │ │ │ │ │ +Definition: gridgluecommunicate.hh:287 │ │ │ │ │ +Dune::GridGlue::CommInfo::CommInfo │ │ │ │ │ +CommInfo() │ │ │ │ │ +Definition: gridgluecommunicate.hh:277 │ │ │ │ │ +Dune::GridGlue::CommInfo::mbuffer │ │ │ │ │ +mutable ::Dune::GridGlue::StreamingMessageBuffer< DataType > mbuffer │ │ │ │ │ +Definition: gridgluecommunicate.hh:286 │ │ │ │ │ +Dune::GridGlue::CommInfo::gridglue │ │ │ │ │ +const GridGlue * gridglue │ │ │ │ │ +Definition: gridgluecommunicate.hh:281 │ │ │ │ │ +Dune::GridGlue::CommInfo::buffer │ │ │ │ │ +std::vector< DataType > buffer │ │ │ │ │ +Definition: gridgluecommunicate.hh:285 │ │ │ │ │ +Dune::CommPolicy<_::Dune::GridGlue::CommInfo<_GG,_DataHandleImp,_DataTypeImp_> │ │ │ │ │ +>::getSize │ │ │ │ │ +static size_t getSize(const Type &commInfo, size_t i) │ │ │ │ │ +Get the number of objects at an intersection. │ │ │ │ │ +Definition: gridgluecommunicate.hh:320 │ │ │ │ │ +Dune::CommPolicy<_::Dune::GridGlue::CommInfo<_GG,_DataHandleImp,_DataTypeImp_> │ │ │ │ │ +>::IndexedType │ │ │ │ │ +DataTypeImp IndexedType │ │ │ │ │ +The datatype that should be communicated. │ │ │ │ │ +Definition: gridgluecommunicate.hh:309 │ │ │ │ │ +Dune::CommPolicy<_::Dune::GridGlue::CommInfo<_GG,_DataHandleImp,_DataTypeImp_> │ │ │ │ │ +>::Type │ │ │ │ │ +::Dune::GridGlue::CommInfo< GG, DataHandleImp, DataTypeImp > Type │ │ │ │ │ +The type of the GridGlueCommInfo. │ │ │ │ │ +Definition: gridgluecommunicate.hh:304 │ │ │ │ │ +Dune::CommPolicy<_::Dune::GridGlue::CommInfo<_GG,_DataHandleImp,_DataTypeImp_> │ │ │ │ │ +>::IndexedTypeFlag │ │ │ │ │ +VariableSize IndexedTypeFlag │ │ │ │ │ +Each intersection can communicate a different number of objects. │ │ │ │ │ +Definition: gridgluecommunicate.hh:315 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00020.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: gridgluecommunicate.hh File Reference │ │ │ │ +dune-grid-glue: gridgluevtkwriter.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -64,74 +64,47 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Typedefs | │ │ │ │ -Functions
│ │ │ │ -
gridgluecommunicate.hh File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
gridgluevtkwriter.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Describes the parallel communication interface class for Dune::GridGlue. │ │ │ │ +

Write all remote intersections to a vtk file for debugging. │ │ │ │ More...

│ │ │ │ -
#include <type_traits>
│ │ │ │ -#include <dune/common/bartonnackmanifcheck.hh>
│ │ │ │ -#include <dune/common/parallel/communicator.hh>
│ │ │ │ -#include <dune/grid/common/datahandleif.hh>
│ │ │ │ -#include <dune/grid/common/gridenums.hh>
│ │ │ │ +
#include <fstream>
│ │ │ │ +#include <iomanip>
│ │ │ │ +#include <type_traits>
│ │ │ │ +#include <vector>
│ │ │ │ +#include <dune/common/classname.hh>
│ │ │ │ +#include <dune/geometry/type.hh>
│ │ │ │ +#include <dune/geometry/referenceelements.hh>
│ │ │ │ +#include <dune/grid-glue/gridglue.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

struct  Dune::GridGlue::GlobalId
 
class  Dune::GridGlue::CommDataHandle< DataHandleImp, DataTypeImp >
 describes the features of a data handle for communication in parallel runs using the GridGlue::communicate methods. More...
 
class  Dune::GridGlue::StreamingMessageBuffer< DT >
 
class  Dune::GridGlue::CommunicationOperator< dir >
 forward gather scatter to user defined CommInfo class More...
 
struct  Dune::GridGlue::CommInfo< GG, DataHandleImp, DataTypeImp >
 collects all GridGlue data requried for communication More...
 
struct  Dune::CommPolicy< ::Dune::GridGlue::CommInfo< GG, DataHandleImp, DataTypeImp > >
 specialization of the CommPolicy struct, required for the ParallelIndexsets More...
class  Dune::GridGlue::GridGlueVtkWriter
 Write remote intersections to a vtk file for debugging purposes. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Typedefs

typedef std::pair< int, int > Dune::GridGlue::RankPair
 
typedef CommunicationOperator< Dune::ForwardCommunication > Dune::GridGlue::ForwardOperator
 
typedef CommunicationOperator< Dune::BackwardCommunication > Dune::GridGlue::BackwardOperator
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -Functions

std::ostream & Dune::GridGlue::operator<< (std::ostream &os, const GlobalId &id)
 
│ │ │ │

Detailed Description

│ │ │ │ -

Describes the parallel communication interface class for Dune::GridGlue.

│ │ │ │ -
Author
Christian Engwer
│ │ │ │ +

Write all remote intersections to a vtk file for debugging.

│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,62 +5,34 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * adapter │ │ │ │ │ -Classes | Namespaces | Typedefs | Functions │ │ │ │ │ -gridgluecommunicate.hh File Reference │ │ │ │ │ -Describes the parallel communication interface class for Dune::GridGlue. │ │ │ │ │ -More... │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +gridgluevtkwriter.hh File Reference │ │ │ │ │ +Write all remote intersections to a vtk file for debugging. More... │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -struct  Dune::GridGlue::GlobalId │ │ │ │ │ -  │ │ │ │ │ - class  Dune::GridGlue::CommDataHandle<_DataHandleImp,_DataTypeImp_> │ │ │ │ │ -  describes the features of a data handle for communication in parallel │ │ │ │ │ - runs using the GridGlue::communicate methods. More... │ │ │ │ │ -  │ │ │ │ │ - class  Dune::GridGlue::StreamingMessageBuffer<_DT_> │ │ │ │ │ -  │ │ │ │ │ - class  Dune::GridGlue::CommunicationOperator<_dir_> │ │ │ │ │ -  forward gather scatter to user defined CommInfo class More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::GridGlue::CommInfo<_GG,_DataHandleImp,_DataTypeImp_> │ │ │ │ │ -  collects all GridGlue data requried for communication More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::CommPolicy<_::Dune::GridGlue::CommInfo<_GG,_DataHandleImp, │ │ │ │ │ - DataTypeImp_>_> │ │ │ │ │ -  specialization of the CommPolicy struct, required for the │ │ │ │ │ - ParallelIndexsets More... │ │ │ │ │ +class  Dune::GridGlue::GridGlueVtkWriter │ │ │ │ │ +  Write remote intersections to a vtk file for debugging purposes. │ │ │ │ │ + More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::GridGlue │ │ │ │ │   │ │ │ │ │ - Typedefs │ │ │ │ │ - typedef std::pair< int, int > Dune::GridGlue::RankPair │ │ │ │ │ -  │ │ │ │ │ -typedef CommunicationOperator< Dune:: │ │ │ │ │ - ForwardCommunication > Dune::GridGlue::ForwardOperator │ │ │ │ │ -  │ │ │ │ │ -typedef CommunicationOperator< Dune:: │ │ │ │ │ - BackwardCommunication > Dune::GridGlue::BackwardOperator │ │ │ │ │ -  │ │ │ │ │ - Functions │ │ │ │ │ -std::ostream & Dune::GridGlue::operator<< (std::ostream &os, const GlobalId │ │ │ │ │ - &id) │ │ │ │ │ -  │ │ │ │ │ ***** Detailed Description ***** │ │ │ │ │ -Describes the parallel communication interface class for Dune::GridGlue. │ │ │ │ │ - Author │ │ │ │ │ - Christian Engwer │ │ │ │ │ +Write all remote intersections to a vtk file for debugging. │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00020_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: gridgluecommunicate.hh Source File │ │ │ │ +dune-grid-glue: gridgluevtkwriter.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,323 +62,314 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
gridgluecommunicate.hh
│ │ │ │ +
gridgluevtkwriter.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 © DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
4// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
│ │ │ │ -
5#ifndef DUNE_GRIDGLUE_ADAPTER_GRIDGLUECOMMUNICATE_HH
│ │ │ │ -
6#define DUNE_GRIDGLUE_ADAPTER_GRIDGLUECOMMUNICATE_HH
│ │ │ │ -
7
│ │ │ │ -
13#include <type_traits>
│ │ │ │ -
14
│ │ │ │ -
15#include <dune/common/bartonnackmanifcheck.hh>
│ │ │ │ -
16#include <dune/common/parallel/communicator.hh>
│ │ │ │ -
17#include <dune/grid/common/datahandleif.hh>
│ │ │ │ -
18#include <dune/grid/common/gridenums.hh>
│ │ │ │ -
19
│ │ │ │ -
20
│ │ │ │ -
21namespace Dune {
│ │ │ │ -
22 namespace GridGlue {
│ │ │ │ +
5/*
│ │ │ │ +
6 * Filename: GridGlueVtkWriter.hh
│ │ │ │ +
7 * Version: 1.0
│ │ │ │ +
8 * Created on: Mar 5, 2009
│ │ │ │ +
9 * Author: Gerrit Buse
│ │ │ │ +
10 * ---------------------------------
│ │ │ │ +
11 * Project: dune-grid-glue
│ │ │ │ +
12 * Description: Class thought to make graphical debugging of couplings easier.
│ │ │ │ +
13 *
│ │ │ │ +
14 */
│ │ │ │ +
20#ifndef DUNE_GRIDGLUE_ADAPTER_GRIDGLUEVTKWRITER_HH
│ │ │ │ +
21#define DUNE_GRIDGLUE_ADAPTER_GRIDGLUEVTKWRITER_HH
│ │ │ │ +
22
│ │ │ │
23
│ │ │ │ -
24 typedef std::pair<int, int> RankPair;
│ │ │ │ -
25 struct GlobalId : public std::pair<RankPair, unsigned int>
│ │ │ │ -
26 {
│ │ │ │ - │ │ │ │ -
31 this->first.first = 0;
│ │ │ │ -
32 this->first.second = 0;
│ │ │ │ -
33 this->second = 0;
│ │ │ │ -
34 }
│ │ │ │ -
38 GlobalId(int i) {
│ │ │ │ -
39 this->first.first = i;
│ │ │ │ -
40 this->first.second = i;
│ │ │ │ -
41 this->second = 0;
│ │ │ │ -
42 }
│ │ │ │ -
48 GlobalId(int i, int j, unsigned int n) {
│ │ │ │ -
49 this->first.first = std::min(i,j);
│ │ │ │ -
50 this->first.second = std::max(i,j);
│ │ │ │ -
51 this->second = n;
│ │ │ │ -
52 }
│ │ │ │ -
53 };
│ │ │ │ +
24#include <fstream>
│ │ │ │ +
25#include <iomanip>
│ │ │ │ +
26#include <type_traits>
│ │ │ │ +
27#include <vector>
│ │ │ │ +
28
│ │ │ │ +
29#include <dune/common/classname.hh>
│ │ │ │ +
30#include <dune/geometry/type.hh>
│ │ │ │ +
31#include <dune/geometry/referenceelements.hh>
│ │ │ │ +
32
│ │ │ │ + │ │ │ │ +
34
│ │ │ │ +
35namespace Dune {
│ │ │ │ +
36namespace GridGlue {
│ │ │ │ +
37
│ │ │ │ + │ │ │ │ +
41{
│ │ │ │ +
42
│ │ │ │ +
46 template <class Glue, int side>
│ │ │ │ +
47 static void writeExtractedPart(const Glue& glue, const std::string& filename)
│ │ │ │ +
48 {
│ │ │ │ +
49 static_assert((side==0 || side==1), "'side' can only be 0 or 1");
│ │ │ │ +
50
│ │ │ │ +
51 std::ofstream fgrid;
│ │ │ │ +
52
│ │ │ │ +
53 fgrid.open(filename.c_str());
│ │ │ │
54
│ │ │ │ -
55 inline std::ostream& operator<<(std::ostream& os, const GlobalId & id)
│ │ │ │ -
56 {
│ │ │ │ -
57 os << "("
│ │ │ │ -
58 << id.first.first << "," << id.first.second << ","
│ │ │ │ -
59 << id.second << ")";
│ │ │ │ -
60 return os;
│ │ │ │ -
61 }
│ │ │ │ +
55 using GridView = typename Glue::template GridView<side>;
│ │ │ │ +
56 using Extractor = typename Glue::template GridPatch<side>;
│ │ │ │ +
57
│ │ │ │ +
58 typedef typename GridView::ctype ctype;
│ │ │ │ +
59
│ │ │ │ +
60 const int domdimw = GridView::dimensionworld;
│ │ │ │ +
61 const int patchDim = Extractor::dim - Extractor::codim;
│ │ │ │
62
│ │ │ │ -
75 template <class DataHandleImp, class DataTypeImp>
│ │ │ │ - │ │ │ │ -
77 {
│ │ │ │ -
78 public:
│ │ │ │ -
80 typedef DataTypeImp DataType;
│ │ │ │ -
81
│ │ │ │ -
82 protected:
│ │ │ │ -
83 // one should not create an explicit instance of this inteface object
│ │ │ │ - │ │ │ │ +
63 // coordinates have to be in R^3 in the VTK format
│ │ │ │ +
64 std::string coordinatePadding;
│ │ │ │ +
65 for (int i=domdimw; i<3; i++)
│ │ │ │ +
66 coordinatePadding += " 0";
│ │ │ │ +
67
│ │ │ │ +
68 fgrid << "# vtk DataFile Version 2.0\nFilename: " << filename << "\nASCII" << std::endl;
│ │ │ │ +
69
│ │ │ │ +
70 // WRITE POINTS
│ │ │ │ +
71 // ----------------
│ │ │ │ +
72 std::vector<typename Extractor::Coords> coords;
│ │ │ │ +
73 glue.template patch<side>().getCoords(coords);
│ │ │ │ +
74
│ │ │ │ +
75 fgrid << ((patchDim==3) ? "DATASET UNSTRUCTURED_GRID" : "DATASET POLYDATA") << std::endl;
│ │ │ │ +
76 fgrid << "POINTS " << coords.size() << " " << Dune::className<ctype>() << std::endl;
│ │ │ │ +
77
│ │ │ │ +
78 for (size_t i=0; i<coords.size(); i++)
│ │ │ │ +
79 fgrid << coords[i] << coordinatePadding << std::endl;
│ │ │ │ +
80
│ │ │ │ +
81 fgrid << std::endl;
│ │ │ │ +
82
│ │ │ │ +
83 // WRITE POLYGONS
│ │ │ │ +
84 // ----------------
│ │ │ │
85
│ │ │ │ -
86 public:
│ │ │ │ -
87
│ │ │ │ -
91 template<class RISType>
│ │ │ │ -
92 size_t size (RISType& i) const
│ │ │ │ -
93 {
│ │ │ │ -
94 CHECK_INTERFACE_IMPLEMENTATION((asImp().size(i)));
│ │ │ │ -
95 return asImp().size(i);
│ │ │ │ -
96 }
│ │ │ │ +
86 std::vector<typename Extractor::VertexVector> faces;
│ │ │ │ +
87 std::vector<Dune::GeometryType> geometryTypes;
│ │ │ │ +
88 glue.template patch<side>().getFaces(faces);
│ │ │ │ +
89 glue.template patch<side>().getGeometryTypes(geometryTypes);
│ │ │ │ +
90
│ │ │ │ +
91 unsigned int faceCornerCount = 0;
│ │ │ │ +
92 for (size_t i=0; i<faces.size(); i++)
│ │ │ │ +
93 faceCornerCount += faces[i].size();
│ │ │ │ +
94
│ │ │ │ +
95 fgrid << ((patchDim==3) ? "CELLS " : "POLYGONS ")
│ │ │ │ +
96 << geometryTypes.size() << " " << geometryTypes.size() + faceCornerCount << std::endl;
│ │ │ │
97
│ │ │ │ -
103 template<class MessageBufferImp, class EntityType, class RISType>
│ │ │ │ -
104 void gather (MessageBufferImp& buff, const EntityType& e, const RISType & i) const
│ │ │ │ -
105 {
│ │ │ │ -
106 MessageBufferIF<MessageBufferImp> buffIF(buff);
│ │ │ │ -
107 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().gather(buffIF,e,i)));
│ │ │ │ -
108 }
│ │ │ │ -
109
│ │ │ │ -
117 template<class MessageBufferImp, class EntityType, class RISType>
│ │ │ │ -
118 void scatter (MessageBufferImp& buff, const EntityType& e, const RISType & i, size_t n)
│ │ │ │ -
119 {
│ │ │ │ -
120 MessageBufferIF<MessageBufferImp> buffIF(buff);
│ │ │ │ -
121 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().scatter(buffIF,e,i,n)));
│ │ │ │ -
122 }
│ │ │ │ -
123
│ │ │ │ -
124 private:
│ │ │ │ -
126 DataHandleImp& asImp () {
│ │ │ │ -
127 return static_cast<DataHandleImp &> (*this);
│ │ │ │ +
98 for (size_t i=0; i<faces.size(); i++) {
│ │ │ │ +
99
│ │ │ │ +
100 fgrid << faces[i].size();
│ │ │ │ +
101
│ │ │ │ +
102 // vtk expects the vertices to by cyclically ordered
│ │ │ │ +
103 // therefore unfortunately we have to deal with several element types on a case-by-case basis
│ │ │ │ +
104 if (geometryTypes[i].isSimplex()) {
│ │ │ │ +
105 for (int j=0; j<patchDim+1; j++)
│ │ │ │ +
106 fgrid << " " << faces[i][j];
│ │ │ │ +
107
│ │ │ │ +
108 } else if (geometryTypes[i].isQuadrilateral()) {
│ │ │ │ +
109 fgrid << " " << faces[i][0] << " " << faces[i][1]
│ │ │ │ +
110 << " " << faces[i][3] << " " << faces[i][2];
│ │ │ │ +
111
│ │ │ │ +
112 } else if (geometryTypes[i].isPyramid()) {
│ │ │ │ +
113 fgrid << " " << faces[i][0] << " " << faces[i][1]
│ │ │ │ +
114 << " " << faces[i][3] << " " << faces[i][2] << " " << faces[i][4];
│ │ │ │ +
115
│ │ │ │ +
116 } else if (geometryTypes[i].isPrism()) {
│ │ │ │ +
117 fgrid << " " << faces[i][0] << " " << faces[i][2] << " " << faces[i][1]
│ │ │ │ +
118 << " " << faces[i][3] << " " << faces[i][5] << " " << faces[i][4];
│ │ │ │ +
119
│ │ │ │ +
120 } else if (geometryTypes[i].isHexahedron()) {
│ │ │ │ +
121 fgrid << " " << faces[i][0] << " " << faces[i][1]
│ │ │ │ +
122 << " " << faces[i][3] << " " << faces[i][2]
│ │ │ │ +
123 << " " << faces[i][4] << " " << faces[i][5]
│ │ │ │ +
124 << " " << faces[i][7] << " " << faces[i][6];
│ │ │ │ +
125
│ │ │ │ +
126 } else {
│ │ │ │ +
127 DUNE_THROW(Dune::NotImplemented, "Geometry type " << geometryTypes[i] << " not supported yet");
│ │ │ │
128 }
│ │ │ │ -
130 const DataHandleImp& asImp () const
│ │ │ │ -
131 {
│ │ │ │ -
132 return static_cast<const DataHandleImp &>(*this);
│ │ │ │ -
133 }
│ │ │ │ -
134 }; // end class CommDataHandleIF
│ │ │ │ -
135
│ │ │ │ -
140 template<typename DT>
│ │ │ │ - │ │ │ │ -
142 public:
│ │ │ │ -
143 typedef DT value_type;
│ │ │ │ -
144
│ │ │ │ -
145 // Constructor
│ │ │ │ - │ │ │ │ -
147 {
│ │ │ │ -
148 a=p;
│ │ │ │ -
149 i=0;
│ │ │ │ -
150 j=0;
│ │ │ │ -
151 }
│ │ │ │ -
152
│ │ │ │ -
153 // write data to message buffer, acts like a stream !
│ │ │ │ -
154 template<class Y>
│ │ │ │ -
155 void write (const Y& data)
│ │ │ │ -
156 {
│ │ │ │ -
157 static_assert(std::is_same<DT,Y>::value, "DataType mismatch");
│ │ │ │ -
158 a[i++] = data;
│ │ │ │ -
159 }
│ │ │ │ +
129
│ │ │ │ +
130 fgrid << std::endl;
│ │ │ │ +
131 }
│ │ │ │ +
132
│ │ │ │ +
133 fgrid << std::endl;
│ │ │ │ +
134
│ │ │ │ +
135 // 3d VTK files need an extra section specifying the CELL_TYPES aka GeometryTypes
│ │ │ │ +
136 if (patchDim==3) {
│ │ │ │ +
137
│ │ │ │ +
138 fgrid << "CELL_TYPES " << geometryTypes.size() << std::endl;
│ │ │ │ +
139
│ │ │ │ +
140 for (size_t i=0; i<geometryTypes.size(); i++) {
│ │ │ │ +
141 if (geometryTypes[i].isSimplex())
│ │ │ │ +
142 fgrid << "10" << std::endl;
│ │ │ │ +
143 else if (geometryTypes[i].isHexahedron())
│ │ │ │ +
144 fgrid << "12" << std::endl;
│ │ │ │ +
145 else if (geometryTypes[i].isPrism())
│ │ │ │ +
146 fgrid << "13" << std::endl;
│ │ │ │ +
147 else if (geometryTypes[i].isPyramid())
│ │ │ │ +
148 fgrid << "14" << std::endl;
│ │ │ │ +
149 else
│ │ │ │ +
150 DUNE_THROW(Dune::NotImplemented, "Geometry type " << geometryTypes[i] << " not supported yet");
│ │ │ │ +
151
│ │ │ │ +
152 }
│ │ │ │ +
153
│ │ │ │ +
154 }
│ │ │ │ +
155
│ │ │ │ +
156#if 0
│ │ │ │ +
157 // WRITE CELL DATA
│ │ │ │ +
158 // ---------------
│ │ │ │ +
159 ctype accum = 0.0, delta = 1.0 / (ctype) (gridSubEntityData.size()-1);
│ │ │ │
160
│ │ │ │ -
161 // read data from message buffer, acts like a stream !
│ │ │ │ -
162 template<class Y>
│ │ │ │ -
163 void read (Y& data) const
│ │ │ │ -
164 {
│ │ │ │ -
165 static_assert(std::is_same<DT,Y>::value, "DataType mismatch");
│ │ │ │ -
166 data = a[j++];
│ │ │ │ -
167 }
│ │ │ │ -
168
│ │ │ │ -
169 size_t counter() const { return i; }
│ │ │ │ -
170
│ │ │ │ -
171 void clear()
│ │ │ │ -
172 {
│ │ │ │ -
173 i = 0;
│ │ │ │ -
174 j = 0;
│ │ │ │ -
175 }
│ │ │ │ +
161 fgrid << "CELL_DATA " << gridSubEntityData.size() << std::endl;
│ │ │ │ +
162 fgrid << "SCALARS property_coding " << Dune::className<ctype>() << " 1" << std::endl;
│ │ │ │ +
163 fgrid << "LOOKUP_TABLE default" << std::endl;
│ │ │ │ +
164
│ │ │ │ +
165 for (typename GridSubEntityData::const_iterator sEIt = gridSubEntityData.begin();
│ │ │ │ +
166 sEIt != gridSubEntityData.end();
│ │ │ │ +
167 ++sEIt, accum += delta)
│ │ │ │ +
168 {
│ │ │ │ +
169 // "encode" the parent with one color...
│ │ │ │ +
170 fgrid << accum << std::endl;
│ │ │ │ +
171 }
│ │ │ │ +
172#endif
│ │ │ │ +
173 fgrid.close();
│ │ │ │ +
174 }
│ │ │ │ +
175
│ │ │ │
176
│ │ │ │ -
177 // we need access to these variables in an assertion
│ │ │ │ -
178#ifdef NDEBUG
│ │ │ │ -
179 private:
│ │ │ │ -
180#endif
│ │ │ │ -
181 DT *a;
│ │ │ │ -
182 size_t i;
│ │ │ │ -
183 mutable size_t j;
│ │ │ │ -
184 };
│ │ │ │ -
185
│ │ │ │ -
192 template<int dir>
│ │ │ │ - │ │ │ │ -
194 {
│ │ │ │ -
195 public:
│ │ │ │ -
196 template<class CommInfo>
│ │ │ │ -
197 static const typename CommInfo::DataType& gather(const CommInfo& commInfo, size_t i, size_t j = 0)
│ │ │ │ -
198 {
│ │ │ │ -
199 // get Intersection
│ │ │ │ -
200 typedef typename CommInfo::GridGlue::Intersection Intersection;
│ │ │ │ -
201 Intersection ris(commInfo.gridglue->getIntersection(i));
│ │ │ │ -
202
│ │ │ │ -
203 // fill buffer if we have a new intersection
│ │ │ │ -
204 if (j == 0)
│ │ │ │ -
205 {
│ │ │ │ -
206 commInfo.mbuffer.clear();
│ │ │ │ -
207 if (dir == Dune::ForwardCommunication)
│ │ │ │ -
208 {
│ │ │ │ -
209 // read from grid0
│ │ │ │ -
210 if(ris.self())
│ │ │ │ -
211 commInfo.data->gather(commInfo.mbuffer, ris.inside(), ris);
│ │ │ │ -
212 }
│ │ │ │ -
213 else // (dir == Dune::BackwardCommunication)
│ │ │ │ -
214 {
│ │ │ │ -
215 // read from grid1
│ │ │ │ -
216 if(ris.neighbor())
│ │ │ │ -
217 commInfo.data->gather(commInfo.mbuffer, ris.outside(), ris.flip());
│ │ │ │ -
218 }
│ │ │ │ -
219 }
│ │ │ │ -
220
│ │ │ │ -
221 // return the j'th value in the buffer
│ │ │ │ -
222 assert(j < commInfo.mbuffer.i);
│ │ │ │ -
223 return commInfo.buffer[j];
│ │ │ │ -
224 }
│ │ │ │ -
225
│ │ │ │ -
226 template<class CommInfo>
│ │ │ │ -
227 static void scatter(CommInfo& commInfo, const typename CommInfo::DataType& v, std::size_t i, std::size_t j = 0)
│ │ │ │ -
228 {
│ │ │ │ -
229 // extract GridGlue objects...
│ │ │ │ -
230 typedef typename CommInfo::GridGlue::Intersection Intersection;
│ │ │ │ -
231 Intersection ris(commInfo.gridglue->getIntersection(i));
│ │ │ │ -
232
│ │ │ │ -
233 // get size if we have a new intersection
│ │ │ │ -
234 if (j == 0)
│ │ │ │ -
235 {
│ │ │ │ -
236 commInfo.mbuffer.clear();
│ │ │ │ -
237 commInfo.currentsize = commInfo.data->size(ris);
│ │ │ │ -
238 }
│ │ │ │ -
239
│ │ │ │ -
240 // write entry to buffer
│ │ │ │ -
241 commInfo.buffer[j] = v;
│ │ │ │ +
180 template <class Glue, int side>
│ │ │ │ +
181 static void writeIntersections(const Glue& glue, const std::string& filename)
│ │ │ │ +
182 {
│ │ │ │ +
183 static_assert((side==0 || side==1), "'side' can only be 0 or 1");
│ │ │ │ +
184
│ │ │ │ +
185 std::ofstream fmerged;
│ │ │ │ +
186
│ │ │ │ +
187 fmerged.open(filename.c_str());
│ │ │ │ +
188
│ │ │ │ +
189 using GridView = typename Glue::template GridView<side>;
│ │ │ │ +
190 typedef typename GridView::ctype ctype;
│ │ │ │ +
191
│ │ │ │ +
192 const int domdimw = GridView::dimensionworld;
│ │ │ │ +
193 const int intersectionDim = Glue::Intersection::mydim;
│ │ │ │ +
194
│ │ │ │ +
195 // coordinates have to be in R^3 in the VTK format
│ │ │ │ +
196 std::string coordinatePadding;
│ │ │ │ +
197 for (int i=domdimw; i<3; i++)
│ │ │ │ +
198 coordinatePadding += " 0";
│ │ │ │ +
199
│ │ │ │ +
200 int overlaps = glue.size();
│ │ │ │ +
201
│ │ │ │ +
202 // WRITE POINTS
│ │ │ │ +
203 // ----------------
│ │ │ │ +
204 using Extractor = typename Glue::template GridPatch<0>;
│ │ │ │ +
205 std::vector<typename Extractor::Coords> coords;
│ │ │ │ +
206 glue.template patch<side>().getCoords(coords);
│ │ │ │ +
207
│ │ │ │ +
208 // the merged grid (i.e. the set of remote intersections
│ │ │ │ +
209 fmerged << "# vtk DataFile Version 2.0\nFilename: " << filename << "\nASCII" << std::endl;
│ │ │ │ +
210 fmerged << ((intersectionDim==3) ? "DATASET UNSTRUCTURED_GRID" : "DATASET POLYDATA") << std::endl;
│ │ │ │ +
211 fmerged << "POINTS " << overlaps*(intersectionDim+1) << " " << Dune::className<ctype>() << std::endl;
│ │ │ │ +
212
│ │ │ │ +
213 for (const auto& intersection : intersections(glue, Reverse<side == 1>{}))
│ │ │ │ +
214 {
│ │ │ │ +
215 const auto& geometry = intersection.geometry();
│ │ │ │ +
216 for (int i = 0; i < geometry.corners(); ++i)
│ │ │ │ +
217 fmerged << geometry.corner(i) << coordinatePadding << std::endl;
│ │ │ │ +
218 }
│ │ │ │ +
219
│ │ │ │ +
220 // WRITE POLYGONS
│ │ │ │ +
221 // ----------------
│ │ │ │ +
222
│ │ │ │ +
223 std::vector<typename Extractor::VertexVector> faces;
│ │ │ │ +
224 std::vector<Dune::GeometryType> geometryTypes;
│ │ │ │ +
225 glue.template patch<side>().getFaces(faces);
│ │ │ │ +
226 glue.template patch<side>().getGeometryTypes(geometryTypes);
│ │ │ │ +
227
│ │ │ │ +
228 unsigned int faceCornerCount = 0;
│ │ │ │ +
229 for (size_t i=0; i<faces.size(); i++)
│ │ │ │ +
230 faceCornerCount += faces[i].size();
│ │ │ │ +
231
│ │ │ │ +
232 int grid0SimplexCorners = intersectionDim+1;
│ │ │ │ +
233 fmerged << ((intersectionDim==3) ? "CELLS " : "POLYGONS ")
│ │ │ │ +
234 << overlaps << " " << (grid0SimplexCorners+1)*overlaps << std::endl;
│ │ │ │ +
235
│ │ │ │ +
236 for (int i = 0; i < overlaps; ++i) {
│ │ │ │ +
237 fmerged << grid0SimplexCorners;
│ │ │ │ +
238 for (int j=0; j<grid0SimplexCorners; j++)
│ │ │ │ +
239 fmerged << " " << grid0SimplexCorners*i+j;
│ │ │ │ +
240 fmerged << std::endl;
│ │ │ │ +
241 }
│ │ │ │
242
│ │ │ │ -
243 // write back the buffer if we are at the end of this intersection
│ │ │ │ -
244 if (j == commInfo.currentsize-1)
│ │ │ │ -
245 {
│ │ │ │ -
246 if (dir == Dune::ForwardCommunication)
│ │ │ │ -
247 {
│ │ │ │ -
248 // write to grid1
│ │ │ │ -
249 if(ris.neighbor())
│ │ │ │ -
250 commInfo.data->scatter(commInfo.mbuffer, ris.outside(), ris.flip(), commInfo.currentsize);
│ │ │ │ -
251 }
│ │ │ │ -
252 else // (dir == Dune::BackwardCommunication)
│ │ │ │ -
253 {
│ │ │ │ -
254 // write to grid0
│ │ │ │ -
255 if(ris.self())
│ │ │ │ -
256 commInfo.data->scatter(commInfo.mbuffer, ris.inside(), ris, commInfo.currentsize);
│ │ │ │ -
257 }
│ │ │ │ -
258 assert(commInfo.mbuffer.j <= commInfo.currentsize);
│ │ │ │ -
259 }
│ │ │ │ -
260 }
│ │ │ │ -
261 };
│ │ │ │ -
262
│ │ │ │ - │ │ │ │ - │ │ │ │ -
265
│ │ │ │ -
270 template <typename GG, class DataHandleImp, class DataTypeImp>
│ │ │ │ -
271 struct CommInfo
│ │ │ │ -
272 {
│ │ │ │ -
273 typedef DataTypeImp value_type;
│ │ │ │ -
274 typedef GG GridGlue;
│ │ │ │ -
275 typedef DataTypeImp DataType;
│ │ │ │ -
276
│ │ │ │ - │ │ │ │ -
278 {}
│ │ │ │ -
279
│ │ │ │ -
280 // tunnel information to the policy and the operators
│ │ │ │ - │ │ │ │ - │ │ │ │ -
283
│ │ │ │ -
284 // state variables
│ │ │ │ -
285 std::vector<DataType> buffer;
│ │ │ │ -
286 mutable ::Dune::GridGlue::StreamingMessageBuffer<DataType> mbuffer;
│ │ │ │ - │ │ │ │ -
288 Dune::CommunicationDirection dir;
│ │ │ │ -
289 };
│ │ │ │ -
290
│ │ │ │ -
291 } // end namespace GridGlue
│ │ │ │ +
243 // 3d VTK files need an extra section specifying the CELL_TYPES aka GeometryTypes
│ │ │ │ +
244 if (intersectionDim==3) {
│ │ │ │ +
245
│ │ │ │ +
246 fmerged << "CELL_TYPES " << overlaps << std::endl;
│ │ │ │ +
247
│ │ │ │ +
248 for (int i = 0; i < overlaps; i++)
│ │ │ │ +
249 fmerged << "10" << std::endl;
│ │ │ │ +
250
│ │ │ │ +
251 }
│ │ │ │ +
252
│ │ │ │ +
253#if 0
│ │ │ │ +
254 // WRITE CELL DATA
│ │ │ │ +
255 // ---------------
│ │ │ │ +
256 ctype accum = 0.0, delta = 1.0 / (ctype) (gridSubEntityData.size()-1);
│ │ │ │ +
257
│ │ │ │ +
258 fmerged << "CELL_DATA " << overlaps << std::endl;
│ │ │ │ +
259 fmerged << "SCALARS property_coding " << Dune::className<ctype>() << " 1" << std::endl;
│ │ │ │ +
260 fmerged << "LOOKUP_TABLE default" << std::endl;
│ │ │ │ +
261
│ │ │ │ +
262 for (typename GridSubEntityData::const_iterator sEIt = gridSubEntityData.begin();
│ │ │ │ +
263 sEIt != gridSubEntityData.end();
│ │ │ │ +
264 ++sEIt, accum += delta)
│ │ │ │ +
265 {
│ │ │ │ +
266 // ...and mark all of its merged grid parts with the same color
│ │ │ │ +
267 for (int j = 0; j < sEIt->first.second; ++j)
│ │ │ │ +
268 fmerged << accum << std::endl;
│ │ │ │ +
269 }
│ │ │ │ +
270#endif
│ │ │ │ +
271 fmerged.close();
│ │ │ │ +
272 }
│ │ │ │ +
273
│ │ │ │ +
274public:
│ │ │ │ +
275 template<typename Glue>
│ │ │ │ +
276 static void write(const Glue& glue, const std::string& filenameTrunk)
│ │ │ │ +
277 {
│ │ │ │ +
278
│ │ │ │ +
279 // Write extracted grid and remote intersection on the grid0-side
│ │ │ │ +
280 writeExtractedPart<Glue,0>(glue,
│ │ │ │ +
281 filenameTrunk + "-grid0.vtk");
│ │ │ │ +
282
│ │ │ │ +
283 writeIntersections<Glue,0>(glue,
│ │ │ │ +
284 filenameTrunk + "-intersections-grid0.vtk");
│ │ │ │ +
285
│ │ │ │ +
286 // Write extracted grid and remote intersection on the grid1-side
│ │ │ │ +
287 writeExtractedPart<Glue,1>(glue,
│ │ │ │ +
288 filenameTrunk + "-grid1.vtk");
│ │ │ │ +
289
│ │ │ │ +
290 writeIntersections<Glue,1>(glue,
│ │ │ │ +
291 filenameTrunk + "-intersections-grid1.vtk");
│ │ │ │
292
│ │ │ │ -
293#if HAVE_MPI
│ │ │ │ -
298 template<typename GG, class DataHandleImp, class DataTypeImp>
│ │ │ │ -
299 struct CommPolicy< ::Dune::GridGlue::CommInfo<GG, DataHandleImp, DataTypeImp> >
│ │ │ │ -
300 {
│ │ │ │ -
304 typedef ::Dune::GridGlue::CommInfo<GG, DataHandleImp, DataTypeImp> Type;
│ │ │ │ -
305
│ │ │ │ -
309 typedef DataTypeImp IndexedType;
│ │ │ │ -
310
│ │ │ │ -
314 // typedef SizeOne IndexedTypeFlag;
│ │ │ │ -
315 typedef VariableSize IndexedTypeFlag;
│ │ │ │ -
316
│ │ │ │ -
320 static size_t getSize(const Type& commInfo, size_t i)
│ │ │ │ -
321 {
│ │ │ │ -
322 // get Intersection
│ │ │ │ -
323 typedef typename Type::GridGlue::Intersection Intersection;
│ │ │ │ -
324 Intersection ris(commInfo.gridglue->getIntersection(i));
│ │ │ │ -
325
│ │ │ │ -
326 // ask data handle for size
│ │ │ │ -
327 return commInfo.data->size(ris);
│ │ │ │ -
328 }
│ │ │ │ -
329 };
│ │ │ │ -
330#endif
│ │ │ │ -
331
│ │ │ │ -
332} // end namespace Dune
│ │ │ │ -
333#endif
│ │ │ │ +
293 }
│ │ │ │ +
294
│ │ │ │ +
295};
│ │ │ │ +
296
│ │ │ │ +
297} /* namespace GridGlue */
│ │ │ │ +
298} /* namespace Dune */
│ │ │ │ +
299
│ │ │ │ +
300#endif // DUNE_GRIDGLUE_ADAPTER_GRIDGLUEVTKWRITER_HH
│ │ │ │ +
Central component of the module implementing the coupling of two grids.
│ │ │ │
Definition: gridglue.hh:37
│ │ │ │ -
CommunicationOperator< Dune::BackwardCommunication > BackwardOperator
Definition: gridgluecommunicate.hh:264
│ │ │ │ -
CommunicationOperator< Dune::ForwardCommunication > ForwardOperator
Definition: gridgluecommunicate.hh:263
│ │ │ │ -
std::pair< int, int > RankPair
Definition: gridgluecommunicate.hh:24
│ │ │ │ -
std::ostream & operator<<(std::ostream &os, const GlobalId &id)
Definition: gridgluecommunicate.hh:55
│ │ │ │ -
The intersection of two entities of the two patches of a GridGlue.
Definition: intersection.hh:261
│ │ │ │ -
Intersection< P0, P1, O, I > flip() const
Return a copy of the intersection with inside and outside switched.
Definition: intersection.hh:483
│ │ │ │ -
bool self() const
For parallel computations: Return true if inside() entity exists locally.
Definition: intersection.hh:393
│ │ │ │ -
InsideEntity inside(unsigned int parentId=0) const
Return element on the inside of this intersection.
Definition: intersection.hh:319
│ │ │ │ -
size_t neighbor(unsigned int g=0) const
Return number of embeddings into local grid0 (grid1) entities.
Definition: intersection.hh:399
│ │ │ │ -
OutsideEntity outside(unsigned int parentId=0) const
Return element on the outside of this intersection.
Definition: intersection.hh:328
│ │ │ │ -
Definition: gridgluecommunicate.hh:26
│ │ │ │ -
GlobalId(int i)
Definition: gridgluecommunicate.hh:38
│ │ │ │ -
GlobalId()
Definition: gridgluecommunicate.hh:30
│ │ │ │ -
GlobalId(int i, int j, unsigned int n)
Definition: gridgluecommunicate.hh:48
│ │ │ │ -
describes the features of a data handle for communication in parallel runs using the GridGlue::commun...
Definition: gridgluecommunicate.hh:77
│ │ │ │ -
size_t size(RISType &i) const
Definition: gridgluecommunicate.hh:92
│ │ │ │ -
void scatter(MessageBufferImp &buff, const EntityType &e, const RISType &i, size_t n)
Definition: gridgluecommunicate.hh:118
│ │ │ │ -
void gather(MessageBufferImp &buff, const EntityType &e, const RISType &i) const
pack data from user to message buffer
Definition: gridgluecommunicate.hh:104
│ │ │ │ -
DataTypeImp DataType
data type of data to communicate
Definition: gridgluecommunicate.hh:80
│ │ │ │ -
CommDataHandle()
Definition: gridgluecommunicate.hh:84
│ │ │ │ -
Definition: gridgluecommunicate.hh:141
│ │ │ │ -
size_t j
Definition: gridgluecommunicate.hh:183
│ │ │ │ -
StreamingMessageBuffer(DT *p)
Definition: gridgluecommunicate.hh:146
│ │ │ │ -
DT * a
Definition: gridgluecommunicate.hh:181
│ │ │ │ -
size_t counter() const
Definition: gridgluecommunicate.hh:169
│ │ │ │ -
void write(const Y &data)
Definition: gridgluecommunicate.hh:155
│ │ │ │ -
void read(Y &data) const
Definition: gridgluecommunicate.hh:163
│ │ │ │ -
DT value_type
Definition: gridgluecommunicate.hh:143
│ │ │ │ -
size_t i
Definition: gridgluecommunicate.hh:182
│ │ │ │ -
void clear()
Definition: gridgluecommunicate.hh:171
│ │ │ │ -
forward gather scatter to user defined CommInfo class
Definition: gridgluecommunicate.hh:194
│ │ │ │ -
static void scatter(CommInfo &commInfo, const typename CommInfo::DataType &v, std::size_t i, std::size_t j=0)
Definition: gridgluecommunicate.hh:227
│ │ │ │ -
static const CommInfo::DataType & gather(const CommInfo &commInfo, size_t i, size_t j=0)
Definition: gridgluecommunicate.hh:197
│ │ │ │ -
collects all GridGlue data requried for communication
Definition: gridgluecommunicate.hh:272
│ │ │ │ -
Dune::CommunicationDirection dir
Definition: gridgluecommunicate.hh:288
│ │ │ │ -
DataTypeImp value_type
Definition: gridgluecommunicate.hh:273
│ │ │ │ -
DataTypeImp DataType
Definition: gridgluecommunicate.hh:275
│ │ │ │ -
::Dune::GridGlue::CommDataHandle< DataHandleImp, DataTypeImp > * data
Definition: gridgluecommunicate.hh:282
│ │ │ │ -
GG GridGlue
Definition: gridgluecommunicate.hh:274
│ │ │ │ -
size_t currentsize
Definition: gridgluecommunicate.hh:287
│ │ │ │ -
CommInfo()
Definition: gridgluecommunicate.hh:277
│ │ │ │ -
mutable ::Dune::GridGlue::StreamingMessageBuffer< DataType > mbuffer
Definition: gridgluecommunicate.hh:286
│ │ │ │ -
const GridGlue * gridglue
Definition: gridgluecommunicate.hh:281
│ │ │ │ -
std::vector< DataType > buffer
Definition: gridgluecommunicate.hh:285
│ │ │ │ -
static size_t getSize(const Type &commInfo, size_t i)
Get the number of objects at an intersection.
Definition: gridgluecommunicate.hh:320
│ │ │ │ -
DataTypeImp IndexedType
The datatype that should be communicated.
Definition: gridgluecommunicate.hh:309
│ │ │ │ -
::Dune::GridGlue::CommInfo< GG, DataHandleImp, DataTypeImp > Type
The type of the GridGlueCommInfo.
Definition: gridgluecommunicate.hh:304
│ │ │ │ -
VariableSize IndexedTypeFlag
Each intersection can communicate a different number of objects.
Definition: gridgluecommunicate.hh:315
│ │ │ │ +
IteratorRange<... > intersections(const GridGlue<... > &glue, const Reverse<... > &reverse=!reversed)
Iterate over all intersections of a GridGlue.
│ │ │ │ +
Write remote intersections to a vtk file for debugging purposes.
Definition: gridgluevtkwriter.hh:41
│ │ │ │ +
static void write(const Glue &glue, const std::string &filenameTrunk)
Definition: gridgluevtkwriter.hh:276
│ │ │ │ +
Definition: rangegenerators.hh:17
│ │ │ │ +
Provides codimension-independent methods for grid extraction.
Definition: extractor.hh:46
│ │ │ │ +
static constexpr auto codim
Definition: extractor.hh:52
│ │ │ │ +
void getCoords(std::vector< Dune::FieldVector< ctype, dimworld > > &coords) const
getter for the coordinates array
Definition: extractor.hh:275
│ │ │ │ +
static constexpr auto dim
Definition: extractor.hh:51
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,443 +5,350 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * adapter │ │ │ │ │ -gridgluecommunicate.hh │ │ │ │ │ +gridgluevtkwriter.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 © DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 4// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only- │ │ │ │ │ with-dune-grid-glue-exception │ │ │ │ │ - 5#ifndef DUNE_GRIDGLUE_ADAPTER_GRIDGLUECOMMUNICATE_HH │ │ │ │ │ - 6#define DUNE_GRIDGLUE_ADAPTER_GRIDGLUECOMMUNICATE_HH │ │ │ │ │ - 7 │ │ │ │ │ - 13#include │ │ │ │ │ - 14 │ │ │ │ │ - 15#include │ │ │ │ │ - 16#include │ │ │ │ │ - 17#include │ │ │ │ │ - 18#include │ │ │ │ │ - 19 │ │ │ │ │ - 20 │ │ │ │ │ - 21namespace Dune { │ │ │ │ │ - 22 namespace GridGlue { │ │ │ │ │ + 5/* │ │ │ │ │ + 6 * Filename: GridGlueVtkWriter.hh │ │ │ │ │ + 7 * Version: 1.0 │ │ │ │ │ + 8 * Created on: Mar 5, 2009 │ │ │ │ │ + 9 * Author: Gerrit Buse │ │ │ │ │ + 10 * --------------------------------- │ │ │ │ │ + 11 * Project: dune-grid-glue │ │ │ │ │ + 12 * Description: Class thought to make graphical debugging of couplings │ │ │ │ │ +easier. │ │ │ │ │ + 13 * │ │ │ │ │ + 14 */ │ │ │ │ │ + 20#ifndef DUNE_GRIDGLUE_ADAPTER_GRIDGLUEVTKWRITER_HH │ │ │ │ │ + 21#define DUNE_GRIDGLUE_ADAPTER_GRIDGLUEVTKWRITER_HH │ │ │ │ │ + 22 │ │ │ │ │ 23 │ │ │ │ │ -24 typedef std::pair RankPair; │ │ │ │ │ -25 struct GlobalId : public std::pair │ │ │ │ │ - 26 { │ │ │ │ │ -30 GlobalId() { │ │ │ │ │ - 31 this->first.first = 0; │ │ │ │ │ - 32 this->first.second = 0; │ │ │ │ │ - 33 this->second = 0; │ │ │ │ │ - 34 } │ │ │ │ │ -38 GlobalId(int i) { │ │ │ │ │ - 39 this->first.first = i; │ │ │ │ │ - 40 this->first.second = i; │ │ │ │ │ - 41 this->second = 0; │ │ │ │ │ - 42 } │ │ │ │ │ -48 GlobalId(int i, int j, unsigned int n) { │ │ │ │ │ - 49 this->first.first = std::min(i,j); │ │ │ │ │ - 50 this->first.second = std::max(i,j); │ │ │ │ │ - 51 this->second = n; │ │ │ │ │ - 52 } │ │ │ │ │ - 53 }; │ │ │ │ │ + 24#include │ │ │ │ │ + 25#include │ │ │ │ │ + 26#include │ │ │ │ │ + 27#include │ │ │ │ │ + 28 │ │ │ │ │ + 29#include │ │ │ │ │ + 30#include │ │ │ │ │ + 31#include │ │ │ │ │ + 32 │ │ │ │ │ + 33#include │ │ │ │ │ + 34 │ │ │ │ │ + 35namespace Dune { │ │ │ │ │ + 36namespace GridGlue { │ │ │ │ │ + 37 │ │ │ │ │ +40class GridGlueVtkWriter │ │ │ │ │ + 41{ │ │ │ │ │ + 42 │ │ │ │ │ + 46 template │ │ │ │ │ + 47 static void writeExtractedPart(const Glue& glue, const std::string& │ │ │ │ │ +filename) │ │ │ │ │ + 48 { │ │ │ │ │ + 49 static_assert((side==0 || side==1), "'side' can only be 0 or 1"); │ │ │ │ │ + 50 │ │ │ │ │ + 51 std::ofstream fgrid; │ │ │ │ │ + 52 │ │ │ │ │ + 53 fgrid.open(filename.c_str()); │ │ │ │ │ 54 │ │ │ │ │ -55 inline std::ostream& operator<<(std::ostream& os, const GlobalId & id) │ │ │ │ │ - 56 { │ │ │ │ │ - 57 os << "(" │ │ │ │ │ - 58 << id.first.first << "," << id.first.second << "," │ │ │ │ │ - 59 << id.second << ")"; │ │ │ │ │ - 60 return os; │ │ │ │ │ - 61 } │ │ │ │ │ + 55 using GridView = typename Glue::template GridView; │ │ │ │ │ + 56 using Extractor = typename Glue::template GridPatch; │ │ │ │ │ + 57 │ │ │ │ │ + 58 typedef typename GridView::ctype ctype; │ │ │ │ │ + 59 │ │ │ │ │ + 60 const int domdimw = GridView::dimensionworld; │ │ │ │ │ + 61 const int patchDim = Extractor::dim - Extractor::codim; │ │ │ │ │ 62 │ │ │ │ │ - 75 template │ │ │ │ │ -76 class CommDataHandle │ │ │ │ │ - 77 { │ │ │ │ │ - 78 public: │ │ │ │ │ -80 typedef DataTypeImp DataType; │ │ │ │ │ - 81 │ │ │ │ │ - 82 protected: │ │ │ │ │ - 83 // one should not create an explicit instance of this inteface object │ │ │ │ │ -84 CommDataHandle() {} │ │ │ │ │ + 63 // coordinates have to be in R^3 in the VTK format │ │ │ │ │ + 64 std::string coordinatePadding; │ │ │ │ │ + 65 for (int i=domdimw; i<3; i++) │ │ │ │ │ + 66 coordinatePadding += " 0"; │ │ │ │ │ + 67 │ │ │ │ │ + 68 fgrid << "# vtk DataFile Version 2.0\nFilename: " << filename << "\nASCII" │ │ │ │ │ +<< std::endl; │ │ │ │ │ + 69 │ │ │ │ │ + 70 // WRITE POINTS │ │ │ │ │ + 71 // ---------------- │ │ │ │ │ + 72 std::vector coords; │ │ │ │ │ + 73 glue.template patch().getCoords(coords); │ │ │ │ │ + 74 │ │ │ │ │ + 75 fgrid << ((patchDim==3) ? "DATASET UNSTRUCTURED_GRID" : "DATASET POLYDATA") │ │ │ │ │ +<< std::endl; │ │ │ │ │ + 76 fgrid << "POINTS " << coords.size() << " " << Dune::className() << │ │ │ │ │ +std::endl; │ │ │ │ │ + 77 │ │ │ │ │ + 78 for (size_t i=0; i │ │ │ │ │ -92 size_t size (RISType& i) const │ │ │ │ │ - 93 { │ │ │ │ │ - 94 CHECK_INTERFACE_IMPLEMENTATION((asImp().size(i))); │ │ │ │ │ - 95 return asImp().size(i); │ │ │ │ │ - 96 } │ │ │ │ │ + 86 std::vector faces; │ │ │ │ │ + 87 std::vector geometryTypes; │ │ │ │ │ + 88 glue.template patch().getFaces(faces); │ │ │ │ │ + 89 glue.template patch().getGeometryTypes(geometryTypes); │ │ │ │ │ + 90 │ │ │ │ │ + 91 unsigned int faceCornerCount = 0; │ │ │ │ │ + 92 for (size_t i=0; i │ │ │ │ │ -104 void gather (MessageBufferImp& buff, const EntityType& e, const RISType & │ │ │ │ │ -i) const │ │ │ │ │ - 105 { │ │ │ │ │ - 106 MessageBufferIF buffIF(buff); │ │ │ │ │ - 107 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().gather(buffIF,e,i))); │ │ │ │ │ - 108 } │ │ │ │ │ - 109 │ │ │ │ │ - 117 template │ │ │ │ │ -118 void scatter (MessageBufferImp& buff, const EntityType& e, const RISType & │ │ │ │ │ -i, size_t n) │ │ │ │ │ - 119 { │ │ │ │ │ - 120 MessageBufferIF buffIF(buff); │ │ │ │ │ - 121 CHECK_AND_CALL_INTERFACE_IMPLEMENTATION((asImp().scatter(buffIF,e,i,n))); │ │ │ │ │ - 122 } │ │ │ │ │ - 123 │ │ │ │ │ - 124 private: │ │ │ │ │ - 126 DataHandleImp& asImp () { │ │ │ │ │ - 127 return static_cast (*this); │ │ │ │ │ + 98 for (size_t i=0; i(*this); │ │ │ │ │ - 133 } │ │ │ │ │ - 134 }; // end class CommDataHandleIF │ │ │ │ │ - 135 │ │ │ │ │ - 140 template │ │ │ │ │ -141 class StreamingMessageBuffer { │ │ │ │ │ - 142 public: │ │ │ │ │ -143 typedef DT value_type; │ │ │ │ │ - 144 │ │ │ │ │ - 145 // Constructor │ │ │ │ │ -146 StreamingMessageBuffer (DT *p) │ │ │ │ │ - 147 { │ │ │ │ │ - 148 a=p; │ │ │ │ │ - 149 i=0; │ │ │ │ │ - 150 j=0; │ │ │ │ │ - 151 } │ │ │ │ │ - 152 │ │ │ │ │ - 153 // write data to message buffer, acts like a stream ! │ │ │ │ │ - 154 template │ │ │ │ │ -155 void write (const Y& data) │ │ │ │ │ - 156 { │ │ │ │ │ - 157 static_assert(std::is_same::value, "DataType mismatch"); │ │ │ │ │ - 158 a[i++] = data; │ │ │ │ │ - 159 } │ │ │ │ │ + 129 │ │ │ │ │ + 130 fgrid << std::endl; │ │ │ │ │ + 131 } │ │ │ │ │ + 132 │ │ │ │ │ + 133 fgrid << std::endl; │ │ │ │ │ + 134 │ │ │ │ │ + 135 // 3d VTK files need an extra section specifying the CELL_TYPES aka │ │ │ │ │ +GeometryTypes │ │ │ │ │ + 136 if (patchDim==3) { │ │ │ │ │ + 137 │ │ │ │ │ + 138 fgrid << "CELL_TYPES " << geometryTypes.size() << std::endl; │ │ │ │ │ + 139 │ │ │ │ │ + 140 for (size_t i=0; i │ │ │ │ │ -163 void read (Y& data) const │ │ │ │ │ - 164 { │ │ │ │ │ - 165 static_assert(std::is_same::value, "DataType mismatch"); │ │ │ │ │ - 166 data = a[j++]; │ │ │ │ │ - 167 } │ │ │ │ │ - 168 │ │ │ │ │ -169 size_t counter() const { return i; } │ │ │ │ │ - 170 │ │ │ │ │ -171 void clear() │ │ │ │ │ - 172 { │ │ │ │ │ - 173 i = 0; │ │ │ │ │ - 174 j = 0; │ │ │ │ │ - 175 } │ │ │ │ │ + 161 fgrid << "CELL_DATA " << gridSubEntityData.size() << std::endl; │ │ │ │ │ + 162 fgrid << "SCALARS property_coding " << Dune::className() << " 1" << │ │ │ │ │ +std::endl; │ │ │ │ │ + 163 fgrid << "LOOKUP_TABLE default" << std::endl; │ │ │ │ │ + 164 │ │ │ │ │ + 165 for (typename GridSubEntityData::const_iterator sEIt = │ │ │ │ │ +gridSubEntityData.begin(); │ │ │ │ │ + 166 sEIt != gridSubEntityData.end(); │ │ │ │ │ + 167 ++sEIt, accum += delta) │ │ │ │ │ + 168 { │ │ │ │ │ + 169 // "encode" the parent with one color... │ │ │ │ │ + 170 fgrid << accum << std::endl; │ │ │ │ │ + 171 } │ │ │ │ │ + 172#endif │ │ │ │ │ + 173 fgrid.close(); │ │ │ │ │ + 174 } │ │ │ │ │ + 175 │ │ │ │ │ 176 │ │ │ │ │ - 177 // we need access to these variables in an assertion │ │ │ │ │ - 178#ifdef NDEBUG │ │ │ │ │ - 179 private: │ │ │ │ │ - 180#endif │ │ │ │ │ -181 DT *a; │ │ │ │ │ -182 size_t i; │ │ │ │ │ -183 mutable size_t j; │ │ │ │ │ - 184 }; │ │ │ │ │ - 185 │ │ │ │ │ - 192 template │ │ │ │ │ -193 class CommunicationOperator │ │ │ │ │ - 194 { │ │ │ │ │ - 195 public: │ │ │ │ │ - 196 template │ │ │ │ │ -197 static const typename CommInfo::DataType& gather(const CommInfo& commInfo, │ │ │ │ │ -size_t i, size_t j = 0) │ │ │ │ │ - 198 { │ │ │ │ │ - 199 // get Intersection │ │ │ │ │ - 200 typedef typename CommInfo::GridGlue::Intersection Intersection; │ │ │ │ │ - 201 Intersection ris(commInfo.gridglue->getIntersection(i)); │ │ │ │ │ - 202 │ │ │ │ │ - 203 // fill buffer if we have a new intersection │ │ │ │ │ - 204 if (j == 0) │ │ │ │ │ - 205 { │ │ │ │ │ - 206 commInfo.mbuffer.clear(); │ │ │ │ │ - 207 if (dir == Dune::ForwardCommunication) │ │ │ │ │ - 208 { │ │ │ │ │ - 209 // read from grid0 │ │ │ │ │ - 210 if(ris.self()) │ │ │ │ │ - 211 commInfo.data->gather(commInfo.mbuffer, ris.inside(), ris); │ │ │ │ │ - 212 } │ │ │ │ │ - 213 else // (dir == Dune::BackwardCommunication) │ │ │ │ │ + 180 template │ │ │ │ │ + 181 static void writeIntersections(const Glue& glue, const std::string& │ │ │ │ │ +filename) │ │ │ │ │ + 182 { │ │ │ │ │ + 183 static_assert((side==0 || side==1), "'side' can only be 0 or 1"); │ │ │ │ │ + 184 │ │ │ │ │ + 185 std::ofstream fmerged; │ │ │ │ │ + 186 │ │ │ │ │ + 187 fmerged.open(filename.c_str()); │ │ │ │ │ + 188 │ │ │ │ │ + 189 using GridView = typename Glue::template GridView; │ │ │ │ │ + 190 typedef typename GridView::ctype ctype; │ │ │ │ │ + 191 │ │ │ │ │ + 192 const int domdimw = GridView::dimensionworld; │ │ │ │ │ + 193 const int intersectionDim = Glue::Intersection::mydim; │ │ │ │ │ + 194 │ │ │ │ │ + 195 // coordinates have to be in R^3 in the VTK format │ │ │ │ │ + 196 std::string coordinatePadding; │ │ │ │ │ + 197 for (int i=domdimw; i<3; i++) │ │ │ │ │ + 198 coordinatePadding += " 0"; │ │ │ │ │ + 199 │ │ │ │ │ + 200 int overlaps = glue.size(); │ │ │ │ │ + 201 │ │ │ │ │ + 202 // WRITE POINTS │ │ │ │ │ + 203 // ---------------- │ │ │ │ │ + 204 using Extractor = typename Glue::template GridPatch<0>; │ │ │ │ │ + 205 std::vector coords; │ │ │ │ │ + 206 glue.template patch().getCoords(coords); │ │ │ │ │ + 207 │ │ │ │ │ + 208 // the merged grid (i.e. the set of remote intersections │ │ │ │ │ + 209 fmerged << "# vtk DataFile Version 2.0\nFilename: " << filename << │ │ │ │ │ +"\nASCII" << std::endl; │ │ │ │ │ + 210 fmerged << ((intersectionDim==3) ? "DATASET UNSTRUCTURED_GRID" : "DATASET │ │ │ │ │ +POLYDATA") << std::endl; │ │ │ │ │ + 211 fmerged << "POINTS " << overlaps*(intersectionDim+1) << " " << Dune:: │ │ │ │ │ +className() << std::endl; │ │ │ │ │ + 212 │ │ │ │ │ + 213 for (const auto& intersection : intersections(glue, Reverse{})) │ │ │ │ │ 214 { │ │ │ │ │ - 215 // read from grid1 │ │ │ │ │ - 216 if(ris.neighbor()) │ │ │ │ │ - 217 commInfo.data->gather(commInfo.mbuffer, ris.outside(), ris.flip()); │ │ │ │ │ + 215 const auto& geometry = intersection.geometry(); │ │ │ │ │ + 216 for (int i = 0; i < geometry.corners(); ++i) │ │ │ │ │ + 217 fmerged << geometry.corner(i) << coordinatePadding << std::endl; │ │ │ │ │ 218 } │ │ │ │ │ - 219 } │ │ │ │ │ - 220 │ │ │ │ │ - 221 // return the j'th value in the buffer │ │ │ │ │ - 222 assert(j < commInfo.mbuffer.i); │ │ │ │ │ - 223 return commInfo.buffer[j]; │ │ │ │ │ - 224 } │ │ │ │ │ - 225 │ │ │ │ │ - 226 template │ │ │ │ │ -227 static void scatter(CommInfo& commInfo, const typename CommInfo::DataType& │ │ │ │ │ -v, std::size_t i, std::size_t j = 0) │ │ │ │ │ - 228 { │ │ │ │ │ - 229 // extract GridGlue objects... │ │ │ │ │ - 230 typedef typename CommInfo::GridGlue::Intersection Intersection; │ │ │ │ │ - 231 Intersection ris(commInfo.gridglue->getIntersection(i)); │ │ │ │ │ - 232 │ │ │ │ │ - 233 // get size if we have a new intersection │ │ │ │ │ - 234 if (j == 0) │ │ │ │ │ - 235 { │ │ │ │ │ - 236 commInfo.mbuffer.clear(); │ │ │ │ │ - 237 commInfo.currentsize = commInfo.data->size(ris); │ │ │ │ │ - 238 } │ │ │ │ │ - 239 │ │ │ │ │ - 240 // write entry to buffer │ │ │ │ │ - 241 commInfo.buffer[j] = v; │ │ │ │ │ + 219 │ │ │ │ │ + 220 // WRITE POLYGONS │ │ │ │ │ + 221 // ---------------- │ │ │ │ │ + 222 │ │ │ │ │ + 223 std::vector faces; │ │ │ │ │ + 224 std::vector geometryTypes; │ │ │ │ │ + 225 glue.template patch().getFaces(faces); │ │ │ │ │ + 226 glue.template patch().getGeometryTypes(geometryTypes); │ │ │ │ │ + 227 │ │ │ │ │ + 228 unsigned int faceCornerCount = 0; │ │ │ │ │ + 229 for (size_t i=0; iscatter(commInfo.mbuffer, ris.outside(), ris.flip(), │ │ │ │ │ -commInfo.currentsize); │ │ │ │ │ + 243 // 3d VTK files need an extra section specifying the CELL_TYPES aka │ │ │ │ │ +GeometryTypes │ │ │ │ │ + 244 if (intersectionDim==3) { │ │ │ │ │ + 245 │ │ │ │ │ + 246 fmerged << "CELL_TYPES " << overlaps << std::endl; │ │ │ │ │ + 247 │ │ │ │ │ + 248 for (int i = 0; i < overlaps; i++) │ │ │ │ │ + 249 fmerged << "10" << std::endl; │ │ │ │ │ + 250 │ │ │ │ │ 251 } │ │ │ │ │ - 252 else // (dir == Dune::BackwardCommunication) │ │ │ │ │ - 253 { │ │ │ │ │ - 254 // write to grid0 │ │ │ │ │ - 255 if(ris.self()) │ │ │ │ │ - 256 commInfo.data->scatter(commInfo.mbuffer, ris.inside(), ris, │ │ │ │ │ -commInfo.currentsize); │ │ │ │ │ - 257 } │ │ │ │ │ - 258 assert(commInfo.mbuffer.j <= commInfo.currentsize); │ │ │ │ │ - 259 } │ │ │ │ │ - 260 } │ │ │ │ │ - 261 }; │ │ │ │ │ - 262 │ │ │ │ │ -263 typedef CommunicationOperator ForwardOperator; │ │ │ │ │ -264 typedef CommunicationOperator │ │ │ │ │ -BackwardOperator; │ │ │ │ │ - 265 │ │ │ │ │ - 270 template │ │ │ │ │ -271 struct CommInfo │ │ │ │ │ - 272 { │ │ │ │ │ -273 typedef DataTypeImp value_type; │ │ │ │ │ -274 typedef GG GridGlue; │ │ │ │ │ -275 typedef DataTypeImp DataType; │ │ │ │ │ - 276 │ │ │ │ │ -277 CommInfo() : buffer(100), mbuffer(&buffer[0]) │ │ │ │ │ - 278 {} │ │ │ │ │ - 279 │ │ │ │ │ - 280 // tunnel information to the policy and the operators │ │ │ │ │ -281 const GridGlue * gridglue; │ │ │ │ │ -282 ::Dune::GridGlue::CommDataHandle * data; │ │ │ │ │ - 283 │ │ │ │ │ - 284 // state variables │ │ │ │ │ -285 std::vector buffer; │ │ │ │ │ -286 mutable ::Dune::GridGlue::StreamingMessageBuffer mbuffer; │ │ │ │ │ -287 size_t currentsize; │ │ │ │ │ -288 Dune::CommunicationDirection dir; │ │ │ │ │ - 289 }; │ │ │ │ │ - 290 │ │ │ │ │ - 291 } // end namespace GridGlue │ │ │ │ │ + 252 │ │ │ │ │ + 253#if 0 │ │ │ │ │ + 254 // WRITE CELL DATA │ │ │ │ │ + 255 // --------------- │ │ │ │ │ + 256 ctype accum = 0.0, delta = 1.0 / (ctype) (gridSubEntityData.size()-1); │ │ │ │ │ + 257 │ │ │ │ │ + 258 fmerged << "CELL_DATA " << overlaps << std::endl; │ │ │ │ │ + 259 fmerged << "SCALARS property_coding " << Dune::className() << " 1" │ │ │ │ │ +<< std::endl; │ │ │ │ │ + 260 fmerged << "LOOKUP_TABLE default" << std::endl; │ │ │ │ │ + 261 │ │ │ │ │ + 262 for (typename GridSubEntityData::const_iterator sEIt = │ │ │ │ │ +gridSubEntityData.begin(); │ │ │ │ │ + 263 sEIt != gridSubEntityData.end(); │ │ │ │ │ + 264 ++sEIt, accum += delta) │ │ │ │ │ + 265 { │ │ │ │ │ + 266 // ...and mark all of its merged grid parts with the same color │ │ │ │ │ + 267 for (int j = 0; j < sEIt->first.second; ++j) │ │ │ │ │ + 268 fmerged << accum << std::endl; │ │ │ │ │ + 269 } │ │ │ │ │ + 270#endif │ │ │ │ │ + 271 fmerged.close(); │ │ │ │ │ + 272 } │ │ │ │ │ + 273 │ │ │ │ │ + 274public: │ │ │ │ │ + 275 template │ │ │ │ │ +276 static void write(const Glue& glue, const std::string& filenameTrunk) │ │ │ │ │ + 277 { │ │ │ │ │ + 278 │ │ │ │ │ + 279 // Write extracted grid and remote intersection on the grid0-side │ │ │ │ │ + 280 writeExtractedPart(glue, │ │ │ │ │ + 281 filenameTrunk + "-grid0.vtk"); │ │ │ │ │ + 282 │ │ │ │ │ + 283 writeIntersections(glue, │ │ │ │ │ + 284 filenameTrunk + "-intersections-grid0.vtk"); │ │ │ │ │ + 285 │ │ │ │ │ + 286 // Write extracted grid and remote intersection on the grid1-side │ │ │ │ │ + 287 writeExtractedPart(glue, │ │ │ │ │ + 288 filenameTrunk + "-grid1.vtk"); │ │ │ │ │ + 289 │ │ │ │ │ + 290 writeIntersections(glue, │ │ │ │ │ + 291 filenameTrunk + "-intersections-grid1.vtk"); │ │ │ │ │ 292 │ │ │ │ │ - 293#if HAVE_MPI │ │ │ │ │ - 298 template │ │ │ │ │ -299 struct CommPolicy< ::Dune::GridGlue::CommInfo > │ │ │ │ │ - 300 { │ │ │ │ │ -304 typedef ::Dune::GridGlue::CommInfo Type; │ │ │ │ │ - 305 │ │ │ │ │ -309 typedef DataTypeImp IndexedType; │ │ │ │ │ - 310 │ │ │ │ │ - 314 // typedef SizeOne IndexedTypeFlag; │ │ │ │ │ -315 typedef VariableSize IndexedTypeFlag; │ │ │ │ │ - 316 │ │ │ │ │ -320 static size_t getSize(const Type& commInfo, size_t i) │ │ │ │ │ - 321 { │ │ │ │ │ - 322 // get Intersection │ │ │ │ │ - 323 typedef typename Type::GridGlue::Intersection Intersection; │ │ │ │ │ - 324 Intersection ris(commInfo.gridglue->getIntersection(i)); │ │ │ │ │ - 325 │ │ │ │ │ - 326 // ask data handle for size │ │ │ │ │ - 327 return commInfo.data->size(ris); │ │ │ │ │ - 328 } │ │ │ │ │ - 329 }; │ │ │ │ │ - 330#endif │ │ │ │ │ - 331 │ │ │ │ │ - 332} // end namespace Dune │ │ │ │ │ - 333#endif │ │ │ │ │ + 293 } │ │ │ │ │ + 294 │ │ │ │ │ + 295}; │ │ │ │ │ + 296 │ │ │ │ │ + 297} /* namespace GridGlue */ │ │ │ │ │ + 298} /* namespace Dune */ │ │ │ │ │ + 299 │ │ │ │ │ + 300#endif // DUNE_GRIDGLUE_ADAPTER_GRIDGLUEVTKWRITER_HH │ │ │ │ │ +gridglue.hh │ │ │ │ │ +Central component of the module implementing the coupling of two grids. │ │ │ │ │ Dune │ │ │ │ │ Definition: gridglue.hh:37 │ │ │ │ │ -Dune::GridGlue::BackwardOperator │ │ │ │ │ -CommunicationOperator< Dune::BackwardCommunication > BackwardOperator │ │ │ │ │ -Definition: gridgluecommunicate.hh:264 │ │ │ │ │ -Dune::GridGlue::ForwardOperator │ │ │ │ │ -CommunicationOperator< Dune::ForwardCommunication > ForwardOperator │ │ │ │ │ -Definition: gridgluecommunicate.hh:263 │ │ │ │ │ -Dune::GridGlue::RankPair │ │ │ │ │ -std::pair< int, int > RankPair │ │ │ │ │ -Definition: gridgluecommunicate.hh:24 │ │ │ │ │ -Dune::GridGlue::operator<< │ │ │ │ │ -std::ostream & operator<<(std::ostream &os, const GlobalId &id) │ │ │ │ │ -Definition: gridgluecommunicate.hh:55 │ │ │ │ │ -Dune::GridGlue::Intersection │ │ │ │ │ -The intersection of two entities of the two patches of a GridGlue. │ │ │ │ │ -Definition: intersection.hh:261 │ │ │ │ │ -Dune::GridGlue::Intersection::flip │ │ │ │ │ -Intersection< P0, P1, O, I > flip() const │ │ │ │ │ -Return a copy of the intersection with inside and outside switched. │ │ │ │ │ -Definition: intersection.hh:483 │ │ │ │ │ -Dune::GridGlue::Intersection::self │ │ │ │ │ -bool self() const │ │ │ │ │ -For parallel computations: Return true if inside() entity exists locally. │ │ │ │ │ -Definition: intersection.hh:393 │ │ │ │ │ -Dune::GridGlue::Intersection::inside │ │ │ │ │ -InsideEntity inside(unsigned int parentId=0) const │ │ │ │ │ -Return element on the inside of this intersection. │ │ │ │ │ -Definition: intersection.hh:319 │ │ │ │ │ -Dune::GridGlue::Intersection::neighbor │ │ │ │ │ -size_t neighbor(unsigned int g=0) const │ │ │ │ │ -Return number of embeddings into local grid0 (grid1) entities. │ │ │ │ │ -Definition: intersection.hh:399 │ │ │ │ │ -Dune::GridGlue::Intersection::outside │ │ │ │ │ -OutsideEntity outside(unsigned int parentId=0) const │ │ │ │ │ -Return element on the outside of this intersection. │ │ │ │ │ -Definition: intersection.hh:328 │ │ │ │ │ -Dune::GridGlue::GlobalId │ │ │ │ │ -Definition: gridgluecommunicate.hh:26 │ │ │ │ │ -Dune::GridGlue::GlobalId::GlobalId │ │ │ │ │ -GlobalId(int i) │ │ │ │ │ -Definition: gridgluecommunicate.hh:38 │ │ │ │ │ -Dune::GridGlue::GlobalId::GlobalId │ │ │ │ │ -GlobalId() │ │ │ │ │ -Definition: gridgluecommunicate.hh:30 │ │ │ │ │ -Dune::GridGlue::GlobalId::GlobalId │ │ │ │ │ -GlobalId(int i, int j, unsigned int n) │ │ │ │ │ -Definition: gridgluecommunicate.hh:48 │ │ │ │ │ -Dune::GridGlue::CommDataHandle │ │ │ │ │ -describes the features of a data handle for communication in parallel runs │ │ │ │ │ -using the GridGlue::commun... │ │ │ │ │ -Definition: gridgluecommunicate.hh:77 │ │ │ │ │ -Dune::GridGlue::CommDataHandle::size │ │ │ │ │ -size_t size(RISType &i) const │ │ │ │ │ -Definition: gridgluecommunicate.hh:92 │ │ │ │ │ -Dune::GridGlue::CommDataHandle::scatter │ │ │ │ │ -void scatter(MessageBufferImp &buff, const EntityType &e, const RISType &i, │ │ │ │ │ -size_t n) │ │ │ │ │ -Definition: gridgluecommunicate.hh:118 │ │ │ │ │ -Dune::GridGlue::CommDataHandle::gather │ │ │ │ │ -void gather(MessageBufferImp &buff, const EntityType &e, const RISType &i) │ │ │ │ │ +Dune::GridGlue::intersections │ │ │ │ │ +IteratorRange<... > intersections(const GridGlue<... > &glue, const Reverse<... │ │ │ │ │ +> &reverse=!reversed) │ │ │ │ │ +Iterate over all intersections of a GridGlue. │ │ │ │ │ +Dune::GridGlue::GridGlueVtkWriter │ │ │ │ │ +Write remote intersections to a vtk file for debugging purposes. │ │ │ │ │ +Definition: gridgluevtkwriter.hh:41 │ │ │ │ │ +Dune::GridGlue::GridGlueVtkWriter::write │ │ │ │ │ +static void write(const Glue &glue, const std::string &filenameTrunk) │ │ │ │ │ +Definition: gridgluevtkwriter.hh:276 │ │ │ │ │ +Dune::GridGlue::Reverse │ │ │ │ │ +Definition: rangegenerators.hh:17 │ │ │ │ │ +Dune::GridGlue::Extractor │ │ │ │ │ +Provides codimension-independent methods for grid extraction. │ │ │ │ │ +Definition: extractor.hh:46 │ │ │ │ │ +Dune::GridGlue::Extractor::codim │ │ │ │ │ +static constexpr auto codim │ │ │ │ │ +Definition: extractor.hh:52 │ │ │ │ │ +Dune::GridGlue::Extractor::getCoords │ │ │ │ │ +void getCoords(std::vector< Dune::FieldVector< ctype, dimworld > > &coords) │ │ │ │ │ const │ │ │ │ │ -pack data from user to message buffer │ │ │ │ │ -Definition: gridgluecommunicate.hh:104 │ │ │ │ │ -Dune::GridGlue::CommDataHandle::DataType │ │ │ │ │ -DataTypeImp DataType │ │ │ │ │ -data type of data to communicate │ │ │ │ │ -Definition: gridgluecommunicate.hh:80 │ │ │ │ │ -Dune::GridGlue::CommDataHandle::CommDataHandle │ │ │ │ │ -CommDataHandle() │ │ │ │ │ -Definition: gridgluecommunicate.hh:84 │ │ │ │ │ -Dune::GridGlue::StreamingMessageBuffer │ │ │ │ │ -Definition: gridgluecommunicate.hh:141 │ │ │ │ │ -Dune::GridGlue::StreamingMessageBuffer::j │ │ │ │ │ -size_t j │ │ │ │ │ -Definition: gridgluecommunicate.hh:183 │ │ │ │ │ -Dune::GridGlue::StreamingMessageBuffer::StreamingMessageBuffer │ │ │ │ │ -StreamingMessageBuffer(DT *p) │ │ │ │ │ -Definition: gridgluecommunicate.hh:146 │ │ │ │ │ -Dune::GridGlue::StreamingMessageBuffer::a │ │ │ │ │ -DT * a │ │ │ │ │ -Definition: gridgluecommunicate.hh:181 │ │ │ │ │ -Dune::GridGlue::StreamingMessageBuffer::counter │ │ │ │ │ -size_t counter() const │ │ │ │ │ -Definition: gridgluecommunicate.hh:169 │ │ │ │ │ -Dune::GridGlue::StreamingMessageBuffer::write │ │ │ │ │ -void write(const Y &data) │ │ │ │ │ -Definition: gridgluecommunicate.hh:155 │ │ │ │ │ -Dune::GridGlue::StreamingMessageBuffer::read │ │ │ │ │ -void read(Y &data) const │ │ │ │ │ -Definition: gridgluecommunicate.hh:163 │ │ │ │ │ -Dune::GridGlue::StreamingMessageBuffer::value_type │ │ │ │ │ -DT value_type │ │ │ │ │ -Definition: gridgluecommunicate.hh:143 │ │ │ │ │ -Dune::GridGlue::StreamingMessageBuffer::i │ │ │ │ │ -size_t i │ │ │ │ │ -Definition: gridgluecommunicate.hh:182 │ │ │ │ │ -Dune::GridGlue::StreamingMessageBuffer::clear │ │ │ │ │ -void clear() │ │ │ │ │ -Definition: gridgluecommunicate.hh:171 │ │ │ │ │ -Dune::GridGlue::CommunicationOperator │ │ │ │ │ -forward gather scatter to user defined CommInfo class │ │ │ │ │ -Definition: gridgluecommunicate.hh:194 │ │ │ │ │ -Dune::GridGlue::CommunicationOperator::scatter │ │ │ │ │ -static void scatter(CommInfo &commInfo, const typename CommInfo::DataType &v, │ │ │ │ │ -std::size_t i, std::size_t j=0) │ │ │ │ │ -Definition: gridgluecommunicate.hh:227 │ │ │ │ │ -Dune::GridGlue::CommunicationOperator::gather │ │ │ │ │ -static const CommInfo::DataType & gather(const CommInfo &commInfo, size_t i, │ │ │ │ │ -size_t j=0) │ │ │ │ │ -Definition: gridgluecommunicate.hh:197 │ │ │ │ │ -Dune::GridGlue::CommInfo │ │ │ │ │ -collects all GridGlue data requried for communication │ │ │ │ │ -Definition: gridgluecommunicate.hh:272 │ │ │ │ │ -Dune::GridGlue::CommInfo::dir │ │ │ │ │ -Dune::CommunicationDirection dir │ │ │ │ │ -Definition: gridgluecommunicate.hh:288 │ │ │ │ │ -Dune::GridGlue::CommInfo::value_type │ │ │ │ │ -DataTypeImp value_type │ │ │ │ │ -Definition: gridgluecommunicate.hh:273 │ │ │ │ │ -Dune::GridGlue::CommInfo::DataType │ │ │ │ │ -DataTypeImp DataType │ │ │ │ │ -Definition: gridgluecommunicate.hh:275 │ │ │ │ │ -Dune::GridGlue::CommInfo::data │ │ │ │ │ -::Dune::GridGlue::CommDataHandle< DataHandleImp, DataTypeImp > * data │ │ │ │ │ -Definition: gridgluecommunicate.hh:282 │ │ │ │ │ -Dune::GridGlue::CommInfo::GridGlue │ │ │ │ │ -GG GridGlue │ │ │ │ │ -Definition: gridgluecommunicate.hh:274 │ │ │ │ │ -Dune::GridGlue::CommInfo::currentsize │ │ │ │ │ -size_t currentsize │ │ │ │ │ -Definition: gridgluecommunicate.hh:287 │ │ │ │ │ -Dune::GridGlue::CommInfo::CommInfo │ │ │ │ │ -CommInfo() │ │ │ │ │ -Definition: gridgluecommunicate.hh:277 │ │ │ │ │ -Dune::GridGlue::CommInfo::mbuffer │ │ │ │ │ -mutable ::Dune::GridGlue::StreamingMessageBuffer< DataType > mbuffer │ │ │ │ │ -Definition: gridgluecommunicate.hh:286 │ │ │ │ │ -Dune::GridGlue::CommInfo::gridglue │ │ │ │ │ -const GridGlue * gridglue │ │ │ │ │ -Definition: gridgluecommunicate.hh:281 │ │ │ │ │ -Dune::GridGlue::CommInfo::buffer │ │ │ │ │ -std::vector< DataType > buffer │ │ │ │ │ -Definition: gridgluecommunicate.hh:285 │ │ │ │ │ -Dune::CommPolicy<_::Dune::GridGlue::CommInfo<_GG,_DataHandleImp,_DataTypeImp_> │ │ │ │ │ ->::getSize │ │ │ │ │ -static size_t getSize(const Type &commInfo, size_t i) │ │ │ │ │ -Get the number of objects at an intersection. │ │ │ │ │ -Definition: gridgluecommunicate.hh:320 │ │ │ │ │ -Dune::CommPolicy<_::Dune::GridGlue::CommInfo<_GG,_DataHandleImp,_DataTypeImp_> │ │ │ │ │ ->::IndexedType │ │ │ │ │ -DataTypeImp IndexedType │ │ │ │ │ -The datatype that should be communicated. │ │ │ │ │ -Definition: gridgluecommunicate.hh:309 │ │ │ │ │ -Dune::CommPolicy<_::Dune::GridGlue::CommInfo<_GG,_DataHandleImp,_DataTypeImp_> │ │ │ │ │ ->::Type │ │ │ │ │ -::Dune::GridGlue::CommInfo< GG, DataHandleImp, DataTypeImp > Type │ │ │ │ │ -The type of the GridGlueCommInfo. │ │ │ │ │ -Definition: gridgluecommunicate.hh:304 │ │ │ │ │ -Dune::CommPolicy<_::Dune::GridGlue::CommInfo<_GG,_DataHandleImp,_DataTypeImp_> │ │ │ │ │ ->::IndexedTypeFlag │ │ │ │ │ -VariableSize IndexedTypeFlag │ │ │ │ │ -Each intersection can communicate a different number of objects. │ │ │ │ │ -Definition: gridgluecommunicate.hh:315 │ │ │ │ │ +getter for the coordinates array │ │ │ │ │ +Definition: extractor.hh:275 │ │ │ │ │ +Dune::GridGlue::Extractor::dim │ │ │ │ │ +static constexpr auto dim │ │ │ │ │ +Definition: extractor.hh:51 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00023.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: gridglueamirawriter.hh File Reference │ │ │ │ +dune-grid-glue: intersectionindexset.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,41 +65,34 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
gridglueamirawriter.hh File Reference
│ │ │ │ +
intersectionindexset.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ - │ │ │ │ -

Write all remote intersections to a AmiraMesh file. │ │ │ │ -More...

│ │ │ │ -
#include <fstream>
│ │ │ │ -#include <sstream>
│ │ │ │ -#include <type_traits>
│ │ │ │ +
#include <dune/grid-glue/gridglue.hh>
│ │ │ │ +#include <dune/grid-glue/adapter/intersection.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::GridGlue::GridGlueAmiraWriter
 Write remote intersections to a AmiraMesh file for debugging purposes. More...
class  Dune::GridGlue::IntersectionIndexSet< P0, P1 >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
│ │ │ │ -

Detailed Description

│ │ │ │ -

Write all remote intersections to a AmiraMesh file.

│ │ │ │ -
│ │ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -6,28 +6,22 @@ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * adapter │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -gridglueamirawriter.hh File Reference │ │ │ │ │ -Write all remote intersections to a AmiraMesh file. More... │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +intersectionindexset.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  Dune::GridGlue::GridGlueAmiraWriter │ │ │ │ │ -  Write remote intersections to a AmiraMesh file for debugging purposes. │ │ │ │ │ - More... │ │ │ │ │ +class  Dune::GridGlue::IntersectionIndexSet<_P0,_P1_> │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::GridGlue │ │ │ │ │   │ │ │ │ │ -***** Detailed Description ***** │ │ │ │ │ -Write all remote intersections to a AmiraMesh file. │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00023_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: gridglueamirawriter.hh Source File │ │ │ │ +dune-grid-glue: intersectionindexset.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,162 +62,81 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
gridglueamirawriter.hh
│ │ │ │ +
intersectionindexset.hh
│ │ │ │
│ │ │ │
│ │ │ │ -Go to the documentation of this file.
1// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │ +Go to the documentation of this file.
1// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
2// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
│ │ │ │ -
8#ifndef DUNE_GRIDGLUE_ADAPTER_GRIDGLUEAMIRAWRITER_HH
│ │ │ │ -
9#define DUNE_GRIDGLUE_ADAPTER_GRIDGLUEAMIRAWRITER_HH
│ │ │ │ -
10
│ │ │ │ -
11#include <fstream>
│ │ │ │ -
12#include <sstream>
│ │ │ │ -
13#include <type_traits>
│ │ │ │ +
3#ifndef DUNE_GRIDGLUE_ADAPTER_INTERSECTIONINDEXSET_HH
│ │ │ │ +
4#define DUNE_GRIDGLUE_ADAPTER_INTERSECTIONINDEXSET_HH
│ │ │ │ +
5
│ │ │ │ + │ │ │ │ + │ │ │ │ +
8
│ │ │ │ +
9#ifndef ONLY_SIMPLEX_INTERSECTIONS
│ │ │ │ +
10// we currently support only one intersection type. If we want to support more,
│ │ │ │ +
11// we have to think about the semantics of our IndexSet
│ │ │ │ +
12#error Not Implemented
│ │ │ │ +
13#endif
│ │ │ │
14
│ │ │ │
15namespace Dune {
│ │ │ │ -
16namespace GridGlue {
│ │ │ │ +
16 namespace GridGlue {
│ │ │ │
17
│ │ │ │ - │ │ │ │ -
21{
│ │ │ │ -
22
│ │ │ │ -
26 template <class Glue, int side>
│ │ │ │ -
27 static void writeIntersections(const Glue& glue, const std::string& filename)
│ │ │ │ -
28 {
│ │ │ │ -
29 static_assert((side==0 || side==1), "'side' can only be 0 or 1");
│ │ │ │ +
18 template<typename P0, typename P1>
│ │ │ │ + │ │ │ │ +
20 {
│ │ │ │ +
21 friend class ::Dune::GridGlue::GridGlue<P0,P1>;
│ │ │ │ +
22 typedef ::Dune::GridGlue::GridGlue<P0,P1> GridGlue;
│ │ │ │ +
23
│ │ │ │ +
24 public:
│ │ │ │ +
25
│ │ │ │ + │ │ │ │ +
29 typedef size_t SizeType;
│ │ │ │
30
│ │ │ │ -
31 std::ofstream fgrid;
│ │ │ │ -
32
│ │ │ │ -
33 fgrid.open(filename.c_str());
│ │ │ │ -
34
│ │ │ │ -
35 using GridView = typename Glue::template GridView<side>;
│ │ │ │ -
36 const int dim = GridView::dimension;
│ │ │ │ -
37 const int domdimw = GridView::dimensionworld;
│ │ │ │ +
33 template<int I, int O>
│ │ │ │ + │ │ │ │ +
35 {
│ │ │ │ +
36 return i.i_->index_;
│ │ │ │ +
37 }
│ │ │ │
38
│ │ │ │ -
39 // coordinates have to be in R^3 in the VTK format
│ │ │ │ -
40 std::string coordinatePadding;
│ │ │ │ -
41 for (int i=domdimw; i<3; i++)
│ │ │ │ -
42 coordinatePadding += " 0";
│ │ │ │ -
43
│ │ │ │ -
44 int overlaps = glue.size();
│ │ │ │ +
41 SizeType size () const
│ │ │ │ +
42 {
│ │ │ │ +
43 return glue_->size();
│ │ │ │ +
44 }
│ │ │ │
45
│ │ │ │ -
46 if (dim==3) {
│ │ │ │ +
46 private:
│ │ │ │
47
│ │ │ │ -
48 fgrid << "# HyperSurface 0.1 ASCII \n" << std::endl;
│ │ │ │ -
49 fgrid<<"\n";
│ │ │ │ -
50 fgrid<<"Parameters {\n";
│ │ │ │ -
51 fgrid<<" Materials {\n";
│ │ │ │ -
52 fgrid<<" outside {\n";
│ │ │ │ -
53 fgrid<<" Id 0\n";
│ │ │ │ -
54 fgrid<<" }\n";
│ │ │ │ -
55 fgrid<<" inside {\n";
│ │ │ │ -
56 fgrid<<" Id 1\n";
│ │ │ │ -
57 fgrid<<" }\n";
│ │ │ │ -
58 fgrid<<" }\n";
│ │ │ │ -
59 fgrid<<"\n";
│ │ │ │ -
60 fgrid<<"}\n";
│ │ │ │ -
61
│ │ │ │ -
62 // ////////////////////////////////////////////
│ │ │ │ -
63 // Write vertices
│ │ │ │ -
64 // ////////////////////////////////////////////
│ │ │ │ -
65
│ │ │ │ -
66 //use dim and not dim+1
│ │ │ │ -
67 fgrid<<"\nVertices "<< overlaps*(dim)<<"\n";
│ │ │ │ -
68 auto isEnd = glue.template iend<side>();
│ │ │ │ -
69 for (auto isIt = glue.template ibegin<side>(); isIt != isEnd; ++isIt)
│ │ │ │ -
70 {
│ │ │ │ -
71 const auto& geometry = isIt->geometry();
│ │ │ │ -
72 for (int i = 0; i < geometry.corners(); ++i)
│ │ │ │ -
73 fgrid << geometry.corner(i) << coordinatePadding << std::endl;
│ │ │ │ -
74 }
│ │ │ │ -
75
│ │ │ │ -
76 // ////////////////////////////////////////////
│ │ │ │ -
77 // Write triangles
│ │ │ │ -
78 // ////////////////////////////////////////////
│ │ │ │ -
79
│ │ │ │ -
80 fgrid<<"NBranchingPoints 0\n";
│ │ │ │ -
81 fgrid<<"NVerticesOnCurves 0\n";
│ │ │ │ -
82 fgrid<<"BoundaryCurves 0\n";
│ │ │ │ -
83 fgrid<<"Patches 1\n";
│ │ │ │ -
84 fgrid<<"{\n";
│ │ │ │ -
85 fgrid<<"InnerRegion inside\n";
│ │ │ │ -
86 fgrid<<"OuterRegion outside\n";
│ │ │ │ -
87 fgrid<<"BoundaryID 0\n";
│ │ │ │ -
88 fgrid<<"BranchingPoints 0";
│ │ │ │ -
89 fgrid<<"\n";
│ │ │ │ -
90
│ │ │ │ -
91 fgrid<<"Triangles "<<overlaps<<std::endl;
│ │ │ │ -
92
│ │ │ │ -
93 for (int i=0;i<overlaps; i++)
│ │ │ │ -
94 fgrid<<i*dim+1<<" "<<i*dim+2<<" "<<i*dim+3<<std::endl;
│ │ │ │ -
95 fgrid<<"}\n";
│ │ │ │ -
96
│ │ │ │ -
97 } else if (dim==2) {
│ │ │ │ -
98
│ │ │ │ -
99 fgrid << "# AmiraMesh 3D ASCII 2.0 \n";
│ │ │ │ -
100 fgrid<<"\n";
│ │ │ │ -
101 fgrid<<"define Lines "<<3*overlaps<<"\n";
│ │ │ │ -
102 fgrid<<"nVertices "<<2*overlaps<<"\n";
│ │ │ │ -
103 fgrid<<"\n";
│ │ │ │ -
104 fgrid<<"Parameters {\n";
│ │ │ │ -
105 fgrid<<" ContentType \"HxLineSet\" \n";
│ │ │ │ -
106 fgrid<<"}\n";
│ │ │ │ -
107 fgrid<<"\n";
│ │ │ │ -
108 fgrid<<"Lines { int LineIdx } @1\n";
│ │ │ │ -
109 fgrid<<"Vertices { float[3] Coordinates } @2\n";
│ │ │ │ -
110 fgrid<<"\n";
│ │ │ │ -
111 fgrid<<"# Data section follows\n";
│ │ │ │ -
112 fgrid<<"@1 \n";
│ │ │ │ -
113 for (int i=0; i<overlaps;i++)
│ │ │ │ -
114 fgrid<<2*i<<"\n"<<2*i+1<<"\n"<<-1<<"\n";
│ │ │ │ -
115 fgrid<<"\n";
│ │ │ │ -
116 fgrid<<"@2 \n";
│ │ │ │ -
117
│ │ │ │ -
118 auto isEnd = glue.template iend<side>();
│ │ │ │ -
119 for (auto isIt = glue.template ibegin<side>(); isIt != isEnd; ++isIt) {
│ │ │ │ -
120 const auto& geometry = isIt->geometry();
│ │ │ │ -
121 for (int i = 0; i <2; ++i)
│ │ │ │ -
122 fgrid << geometry.corner(i) <<" "<<0<<"\n";
│ │ │ │ -
123 }
│ │ │ │ -
124 }
│ │ │ │ -
125
│ │ │ │ -
126 fgrid.close();
│ │ │ │ -
127 }
│ │ │ │ -
128
│ │ │ │ -
129public:
│ │ │ │ -
130 template<typename Glue>
│ │ │ │ -
131 static void write(const Glue& glue, const std::string& path, int appendix=1)
│ │ │ │ -
132 {
│ │ │ │ -
133 std::ostringstream name0;
│ │ │ │ -
134 name0 << path;
│ │ │ │ -
135 name0 << "/domain.surf" << std::setw(3) << std::setfill('0') << appendix;
│ │ │ │ -
136
│ │ │ │ -
137 // Write extracted grid and remote intersection on the grid1-side
│ │ │ │ -
138 writeIntersections<Glue,0>(glue,name0.str());
│ │ │ │ -
139
│ │ │ │ -
140 std::ostringstream name1;
│ │ │ │ -
141 name1 << path;
│ │ │ │ -
142 name1 << "/target.surf" << std::setw(3) << std::setfill('0') << appendix;
│ │ │ │ -
143
│ │ │ │ -
144 writeIntersections<Glue,1>(glue, name1.str());
│ │ │ │ -
145 }
│ │ │ │ -
146
│ │ │ │ -
147};
│ │ │ │ -
148
│ │ │ │ -
149} // namespace GridGlue
│ │ │ │ -
150} // namespace Dune
│ │ │ │ -
151
│ │ │ │ -
152#endif // DUNE_GRIDGLUE_ADAPTER_GRIDGLUEAMIRAWRITER_HH
│ │ │ │ + │ │ │ │ +
50 glue_(g) {}
│ │ │ │ +
51
│ │ │ │ +
52 const GridGlue * glue_;
│ │ │ │ +
53 };
│ │ │ │ +
54
│ │ │ │ +
55 } // end namespace GridGlue
│ │ │ │ +
56} // end namespace Dune
│ │ │ │ +
57
│ │ │ │ +
58#endif // DUNE_GRIDGLUE_ADAPTER_INTERSECTIONINDEXSET_HH
│ │ │ │ +
Central component of the module implementing the coupling of two grids.
│ │ │ │ +
Model of the Intersection concept provided by GridGlue.
│ │ │ │
Definition: gridglue.hh:37
│ │ │ │ -
Write remote intersections to a AmiraMesh file for debugging purposes.
Definition: gridglueamirawriter.hh:21
│ │ │ │ -
static void write(const Glue &glue, const std::string &path, int appendix=1)
Definition: gridglueamirawriter.hh:131
│ │ │ │ +
sequential adapter to couple two grids at specified close together boundaries
Definition: gridglue.hh:67
│ │ │ │ +
unsigned int IndexType
Definition: gridglue.hh:147
│ │ │ │ +
size_t size() const
Definition: gridglue.hh:393
│ │ │ │ +
IndexType index_
index of this intersection after GridGlue interface
Definition: intersection.hh:112
│ │ │ │ +
The intersection of two entities of the two patches of a GridGlue.
Definition: intersection.hh:261
│ │ │ │ +
Definition: intersectionindexset.hh:20
│ │ │ │ +
SizeType size() const
Return total number of intersections.
Definition: intersectionindexset.hh:41
│ │ │ │ +
GridGlue::IndexType IndexType
The type used for the indices.
Definition: intersectionindexset.hh:27
│ │ │ │ +
IndexType index(const Intersection< P0, P1, I, O > &i) const
Map Dune::GridGlue::Intersection to index.
Definition: intersectionindexset.hh:34
│ │ │ │ +
size_t SizeType
The type used for the size.
Definition: intersectionindexset.hh:29
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,166 +5,106 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * adapter │ │ │ │ │ -gridglueamirawriter.hh │ │ │ │ │ +intersectionindexset.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ - 1// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file │ │ │ │ │ +1// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 2// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only- │ │ │ │ │ with-dune-grid-glue-exception │ │ │ │ │ - 8#ifndef DUNE_GRIDGLUE_ADAPTER_GRIDGLUEAMIRAWRITER_HH │ │ │ │ │ - 9#define DUNE_GRIDGLUE_ADAPTER_GRIDGLUEAMIRAWRITER_HH │ │ │ │ │ - 10 │ │ │ │ │ - 11#include │ │ │ │ │ - 12#include │ │ │ │ │ - 13#include │ │ │ │ │ + 3#ifndef DUNE_GRIDGLUE_ADAPTER_INTERSECTIONINDEXSET_HH │ │ │ │ │ + 4#define DUNE_GRIDGLUE_ADAPTER_INTERSECTIONINDEXSET_HH │ │ │ │ │ + 5 │ │ │ │ │ + 6#include │ │ │ │ │ + 7#include │ │ │ │ │ + 8 │ │ │ │ │ + 9#ifndef ONLY_SIMPLEX_INTERSECTIONS │ │ │ │ │ + 10// we currently support only one intersection type. If we want to support │ │ │ │ │ +more, │ │ │ │ │ + 11// we have to think about the semantics of our IndexSet │ │ │ │ │ + 12#error Not Implemented │ │ │ │ │ + 13#endif │ │ │ │ │ 14 │ │ │ │ │ 15namespace Dune { │ │ │ │ │ - 16namespace GridGlue { │ │ │ │ │ + 16 namespace GridGlue { │ │ │ │ │ 17 │ │ │ │ │ -20class GridGlueAmiraWriter │ │ │ │ │ - 21{ │ │ │ │ │ - 22 │ │ │ │ │ - 26 template │ │ │ │ │ - 27 static void writeIntersections(const Glue& glue, const std::string& │ │ │ │ │ -filename) │ │ │ │ │ - 28 { │ │ │ │ │ - 29 static_assert((side==0 || side==1), "'side' can only be 0 or 1"); │ │ │ │ │ + 18 template │ │ │ │ │ +19 class IntersectionIndexSet │ │ │ │ │ + 20 { │ │ │ │ │ + 21 friend class ::Dune::GridGlue::GridGlue; │ │ │ │ │ + 22 typedef ::Dune::GridGlue::GridGlue GridGlue; │ │ │ │ │ + 23 │ │ │ │ │ + 24 public: │ │ │ │ │ + 25 │ │ │ │ │ +27 typedef typename GridGlue::IndexType IndexType; │ │ │ │ │ +29 typedef size_t SizeType; │ │ │ │ │ 30 │ │ │ │ │ - 31 std::ofstream fgrid; │ │ │ │ │ - 32 │ │ │ │ │ - 33 fgrid.open(filename.c_str()); │ │ │ │ │ - 34 │ │ │ │ │ - 35 using GridView = typename Glue::template GridView; │ │ │ │ │ - 36 const int dim = GridView::dimension; │ │ │ │ │ - 37 const int domdimw = GridView::dimensionworld; │ │ │ │ │ + 33 template │ │ │ │ │ +34 IndexType index (const Intersection & i) const │ │ │ │ │ + 35 { │ │ │ │ │ + 36 return i.i_->index_; │ │ │ │ │ + 37 } │ │ │ │ │ 38 │ │ │ │ │ - 39 // coordinates have to be in R^3 in the VTK format │ │ │ │ │ - 40 std::string coordinatePadding; │ │ │ │ │ - 41 for (int i=domdimw; i<3; i++) │ │ │ │ │ - 42 coordinatePadding += " 0"; │ │ │ │ │ - 43 │ │ │ │ │ - 44 int overlaps = glue.size(); │ │ │ │ │ +41 SizeType size () const │ │ │ │ │ + 42 { │ │ │ │ │ + 43 return glue_->size(); │ │ │ │ │ + 44 } │ │ │ │ │ 45 │ │ │ │ │ - 46 if (dim==3) { │ │ │ │ │ + 46 private: │ │ │ │ │ 47 │ │ │ │ │ - 48 fgrid << "# HyperSurface 0.1 ASCII \n" << std::endl; │ │ │ │ │ - 49 fgrid<<"\n"; │ │ │ │ │ - 50 fgrid<<"Parameters {\n"; │ │ │ │ │ - 51 fgrid<<" Materials {\n"; │ │ │ │ │ - 52 fgrid<<" outside {\n"; │ │ │ │ │ - 53 fgrid<<" Id 0\n"; │ │ │ │ │ - 54 fgrid<<" }\n"; │ │ │ │ │ - 55 fgrid<<" inside {\n"; │ │ │ │ │ - 56 fgrid<<" Id 1\n"; │ │ │ │ │ - 57 fgrid<<" }\n"; │ │ │ │ │ - 58 fgrid<<" }\n"; │ │ │ │ │ - 59 fgrid<<"\n"; │ │ │ │ │ - 60 fgrid<<"}\n"; │ │ │ │ │ - 61 │ │ │ │ │ - 62 // //////////////////////////////////////////// │ │ │ │ │ - 63 // Write vertices │ │ │ │ │ - 64 // //////////////////////////////////////////// │ │ │ │ │ - 65 │ │ │ │ │ - 66 //use dim and not dim+1 │ │ │ │ │ - 67 fgrid<<"\nVertices "<< overlaps*(dim)<<"\n"; │ │ │ │ │ - 68 auto isEnd = glue.template iend(); │ │ │ │ │ - 69 for (auto isIt = glue.template ibegin(); isIt != isEnd; ++isIt) │ │ │ │ │ - 70 { │ │ │ │ │ - 71 const auto& geometry = isIt->geometry(); │ │ │ │ │ - 72 for (int i = 0; i < geometry.corners(); ++i) │ │ │ │ │ - 73 fgrid << geometry.corner(i) << coordinatePadding << std::endl; │ │ │ │ │ - 74 } │ │ │ │ │ - 75 │ │ │ │ │ - 76 // //////////////////////////////////////////// │ │ │ │ │ - 77 // Write triangles │ │ │ │ │ - 78 // //////////////////////////////////////////// │ │ │ │ │ - 79 │ │ │ │ │ - 80 fgrid<<"NBranchingPoints 0\n"; │ │ │ │ │ - 81 fgrid<<"NVerticesOnCurves 0\n"; │ │ │ │ │ - 82 fgrid<<"BoundaryCurves 0\n"; │ │ │ │ │ - 83 fgrid<<"Patches 1\n"; │ │ │ │ │ - 84 fgrid<<"{\n"; │ │ │ │ │ - 85 fgrid<<"InnerRegion inside\n"; │ │ │ │ │ - 86 fgrid<<"OuterRegion outside\n"; │ │ │ │ │ - 87 fgrid<<"BoundaryID 0\n"; │ │ │ │ │ - 88 fgrid<<"BranchingPoints 0"; │ │ │ │ │ - 89 fgrid<<"\n"; │ │ │ │ │ - 90 │ │ │ │ │ - 91 fgrid<<"Triangles "<(); │ │ │ │ │ - 119 for (auto isIt = glue.template ibegin(); isIt != isEnd; ++isIt) { │ │ │ │ │ - 120 const auto& geometry = isIt->geometry(); │ │ │ │ │ - 121 for (int i = 0; i <2; ++i) │ │ │ │ │ - 122 fgrid << geometry.corner(i) <<" "<<0<<"\n"; │ │ │ │ │ - 123 } │ │ │ │ │ - 124 } │ │ │ │ │ - 125 │ │ │ │ │ - 126 fgrid.close(); │ │ │ │ │ - 127 } │ │ │ │ │ - 128 │ │ │ │ │ - 129public: │ │ │ │ │ - 130 template │ │ │ │ │ -131 static void write(const Glue& glue, const std::string& path, int │ │ │ │ │ -appendix=1) │ │ │ │ │ - 132 { │ │ │ │ │ - 133 std::ostringstream name0; │ │ │ │ │ - 134 name0 << path; │ │ │ │ │ - 135 name0 << "/domain.surf" << std::setw(3) << std::setfill('0') << appendix; │ │ │ │ │ - 136 │ │ │ │ │ - 137 // Write extracted grid and remote intersection on the grid1-side │ │ │ │ │ - 138 writeIntersections(glue,name0.str()); │ │ │ │ │ - 139 │ │ │ │ │ - 140 std::ostringstream name1; │ │ │ │ │ - 141 name1 << path; │ │ │ │ │ - 142 name1 << "/target.surf" << std::setw(3) << std::setfill('0') << appendix; │ │ │ │ │ - 143 │ │ │ │ │ - 144 writeIntersections(glue, name1.str()); │ │ │ │ │ - 145 } │ │ │ │ │ - 146 │ │ │ │ │ - 147}; │ │ │ │ │ - 148 │ │ │ │ │ - 149} // namespace GridGlue │ │ │ │ │ - 150} // namespace Dune │ │ │ │ │ - 151 │ │ │ │ │ - 152#endif // DUNE_GRIDGLUE_ADAPTER_GRIDGLUEAMIRAWRITER_HH │ │ │ │ │ + 49 IntersectionIndexSet(const GridGlue * g) : │ │ │ │ │ + 50 glue_(g) {} │ │ │ │ │ + 51 │ │ │ │ │ + 52 const GridGlue * glue_; │ │ │ │ │ + 53 }; │ │ │ │ │ + 54 │ │ │ │ │ + 55 } // end namespace GridGlue │ │ │ │ │ + 56} // end namespace Dune │ │ │ │ │ + 57 │ │ │ │ │ + 58#endif // DUNE_GRIDGLUE_ADAPTER_INTERSECTIONINDEXSET_HH │ │ │ │ │ +gridglue.hh │ │ │ │ │ +Central component of the module implementing the coupling of two grids. │ │ │ │ │ +intersection.hh │ │ │ │ │ +Model of the Intersection concept provided by GridGlue. │ │ │ │ │ Dune │ │ │ │ │ Definition: gridglue.hh:37 │ │ │ │ │ -Dune::GridGlue::GridGlueAmiraWriter │ │ │ │ │ -Write remote intersections to a AmiraMesh file for debugging purposes. │ │ │ │ │ -Definition: gridglueamirawriter.hh:21 │ │ │ │ │ -Dune::GridGlue::GridGlueAmiraWriter::write │ │ │ │ │ -static void write(const Glue &glue, const std::string &path, int appendix=1) │ │ │ │ │ -Definition: gridglueamirawriter.hh:131 │ │ │ │ │ +Dune::GridGlue::GridGlue │ │ │ │ │ +sequential adapter to couple two grids at specified close together boundaries │ │ │ │ │ +Definition: gridglue.hh:67 │ │ │ │ │ +Dune::GridGlue::GridGlue::IndexType │ │ │ │ │ +unsigned int IndexType │ │ │ │ │ +Definition: gridglue.hh:147 │ │ │ │ │ +Dune::GridGlue::GridGlue::size │ │ │ │ │ +size_t size() const │ │ │ │ │ +Definition: gridglue.hh:393 │ │ │ │ │ +Dune::GridGlue::IntersectionData::index_ │ │ │ │ │ +IndexType index_ │ │ │ │ │ +index of this intersection after GridGlue interface │ │ │ │ │ +Definition: intersection.hh:112 │ │ │ │ │ +Dune::GridGlue::Intersection │ │ │ │ │ +The intersection of two entities of the two patches of a GridGlue. │ │ │ │ │ +Definition: intersection.hh:261 │ │ │ │ │ +Dune::GridGlue::IntersectionIndexSet │ │ │ │ │ +Definition: intersectionindexset.hh:20 │ │ │ │ │ +Dune::GridGlue::IntersectionIndexSet::size │ │ │ │ │ +SizeType size() const │ │ │ │ │ +Return total number of intersections. │ │ │ │ │ +Definition: intersectionindexset.hh:41 │ │ │ │ │ +Dune::GridGlue::IntersectionIndexSet::IndexType │ │ │ │ │ +GridGlue::IndexType IndexType │ │ │ │ │ +The type used for the indices. │ │ │ │ │ +Definition: intersectionindexset.hh:27 │ │ │ │ │ +Dune::GridGlue::IntersectionIndexSet::index │ │ │ │ │ +IndexType index(const Intersection< P0, P1, I, O > &i) const │ │ │ │ │ +Map Dune::GridGlue::Intersection to index. │ │ │ │ │ +Definition: intersectionindexset.hh:34 │ │ │ │ │ +Dune::GridGlue::IntersectionIndexSet::SizeType │ │ │ │ │ +size_t SizeType │ │ │ │ │ +The type used for the size. │ │ │ │ │ +Definition: intersectionindexset.hh:29 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00026.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: rangegenerators.hh File Reference │ │ │ │ +dune-grid-glue: gridglueamirawriter.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -64,42 +64,42 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Functions
│ │ │ │ -
rangegenerators.hh File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
gridglueamirawriter.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <dune/common/iteratorrange.hh>
│ │ │ │ + │ │ │ │ +

Write all remote intersections to a AmiraMesh file. │ │ │ │ +More...

│ │ │ │ +
#include <fstream>
│ │ │ │ +#include <sstream>
│ │ │ │ +#include <type_traits>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

struct  Dune::GridGlue::Reverse< reverse >
class  Dune::GridGlue::GridGlueAmiraWriter
 Write remote intersections to a AmiraMesh file for debugging purposes. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -Functions

template<... >
IteratorRange<... > Dune::GridGlue::intersections (const GridGlue<... > &glue, const Reverse<... > &reverse=!reversed)
 Iterate over all intersections of a GridGlue. More...
 
│ │ │ │ -
│ │ │ │ +

Detailed Description

│ │ │ │ +

Write all remote intersections to a AmiraMesh file.

│ │ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,28 +5,29 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * adapter │ │ │ │ │ -Classes | Namespaces | Functions │ │ │ │ │ -rangegenerators.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +gridglueamirawriter.hh File Reference │ │ │ │ │ +Write all remote intersections to a AmiraMesh file. More... │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -struct  Dune::GridGlue::Reverse<_reverse_> │ │ │ │ │ +class  Dune::GridGlue::GridGlueAmiraWriter │ │ │ │ │ +  Write remote intersections to a AmiraMesh file for debugging purposes. │ │ │ │ │ + More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::GridGlue │ │ │ │ │   │ │ │ │ │ - Functions │ │ │ │ │ -template<... > │ │ │ │ │ -IteratorRange<... > Dune::GridGlue::intersections (const GridGlue<... > &glue, │ │ │ │ │ - const Reverse<... > &reverse=!reversed) │ │ │ │ │ -  Iterate over all intersections of a GridGlue. More... │ │ │ │ │ -  │ │ │ │ │ +***** Detailed Description ***** │ │ │ │ │ +Write all remote intersections to a AmiraMesh file. │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00026_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: rangegenerators.hh Source File │ │ │ │ +dune-grid-glue: gridglueamirawriter.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,74 +62,162 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
rangegenerators.hh
│ │ │ │ +
gridglueamirawriter.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
2// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
│ │ │ │ -
3#ifndef DUNE_GRIDGLUE_ADAPTER_RANGEGENERATORS_HH
│ │ │ │ -
4#define DUNE_GRIDGLUE_ADAPTER_RANGEGENERATORS_HH
│ │ │ │ -
5
│ │ │ │ -
6#include <dune/common/iteratorrange.hh>
│ │ │ │ -
7
│ │ │ │ -
8namespace Dune {
│ │ │ │ -
9namespace GridGlue {
│ │ │ │ +
8#ifndef DUNE_GRIDGLUE_ADAPTER_GRIDGLUEAMIRAWRITER_HH
│ │ │ │ +
9#define DUNE_GRIDGLUE_ADAPTER_GRIDGLUEAMIRAWRITER_HH
│ │ │ │
10
│ │ │ │ -
14template<bool reverse>
│ │ │ │ -
15struct Reverse
│ │ │ │ -
16 : std::integral_constant<bool, reverse>
│ │ │ │ -
17{
│ │ │ │ -
18 typedef Reverse type;
│ │ │ │ -
19
│ │ │ │ -
20 constexpr
│ │ │ │ - │ │ │ │ -
22 { return {}; }
│ │ │ │ -
23};
│ │ │ │ -
24
│ │ │ │ -
25#ifdef DOXYGEN
│ │ │ │ -
26
│ │ │ │ - │ │ │ │ +
11#include <fstream>
│ │ │ │ +
12#include <sstream>
│ │ │ │ +
13#include <type_traits>
│ │ │ │ +
14
│ │ │ │ +
15namespace Dune {
│ │ │ │ +
16namespace GridGlue {
│ │ │ │ +
17
│ │ │ │ + │ │ │ │ +
21{
│ │ │ │ +
22
│ │ │ │ +
26 template <class Glue, int side>
│ │ │ │ +
27 static void writeIntersections(const Glue& glue, const std::string& filename)
│ │ │ │ +
28 {
│ │ │ │ +
29 static_assert((side==0 || side==1), "'side' can only be 0 or 1");
│ │ │ │ +
30
│ │ │ │ +
31 std::ofstream fgrid;
│ │ │ │
32
│ │ │ │ -
66template<...>
│ │ │ │ -
67IteratorRange<...>
│ │ │ │ -
68intersections(const GridGlue<...>& glue, const Reverse<...>& reverse = !reversed);
│ │ │ │ -
69
│ │ │ │ -
70#else
│ │ │ │ -
71
│ │ │ │ -
72namespace {
│ │ │ │ -
73const Reverse<true> reversed = {};
│ │ │ │ -
74} /* namespace */
│ │ │ │ +
33 fgrid.open(filename.c_str());
│ │ │ │ +
34
│ │ │ │ +
35 using GridView = typename Glue::template GridView<side>;
│ │ │ │ +
36 const int dim = GridView::dimension;
│ │ │ │ +
37 const int domdimw = GridView::dimensionworld;
│ │ │ │ +
38
│ │ │ │ +
39 // coordinates have to be in R^3 in the VTK format
│ │ │ │ +
40 std::string coordinatePadding;
│ │ │ │ +
41 for (int i=domdimw; i<3; i++)
│ │ │ │ +
42 coordinatePadding += " 0";
│ │ │ │ +
43
│ │ │ │ +
44 int overlaps = glue.size();
│ │ │ │ +
45
│ │ │ │ +
46 if (dim==3) {
│ │ │ │ +
47
│ │ │ │ +
48 fgrid << "# HyperSurface 0.1 ASCII \n" << std::endl;
│ │ │ │ +
49 fgrid<<"\n";
│ │ │ │ +
50 fgrid<<"Parameters {\n";
│ │ │ │ +
51 fgrid<<" Materials {\n";
│ │ │ │ +
52 fgrid<<" outside {\n";
│ │ │ │ +
53 fgrid<<" Id 0\n";
│ │ │ │ +
54 fgrid<<" }\n";
│ │ │ │ +
55 fgrid<<" inside {\n";
│ │ │ │ +
56 fgrid<<" Id 1\n";
│ │ │ │ +
57 fgrid<<" }\n";
│ │ │ │ +
58 fgrid<<" }\n";
│ │ │ │ +
59 fgrid<<"\n";
│ │ │ │ +
60 fgrid<<"}\n";
│ │ │ │ +
61
│ │ │ │ +
62 // ////////////////////////////////////////////
│ │ │ │ +
63 // Write vertices
│ │ │ │ +
64 // ////////////////////////////////////////////
│ │ │ │ +
65
│ │ │ │ +
66 //use dim and not dim+1
│ │ │ │ +
67 fgrid<<"\nVertices "<< overlaps*(dim)<<"\n";
│ │ │ │ +
68 auto isEnd = glue.template iend<side>();
│ │ │ │ +
69 for (auto isIt = glue.template ibegin<side>(); isIt != isEnd; ++isIt)
│ │ │ │ +
70 {
│ │ │ │ +
71 const auto& geometry = isIt->geometry();
│ │ │ │ +
72 for (int i = 0; i < geometry.corners(); ++i)
│ │ │ │ +
73 fgrid << geometry.corner(i) << coordinatePadding << std::endl;
│ │ │ │ +
74 }
│ │ │ │
75
│ │ │ │ -
76template<typename P0, typename P1, bool reverse = false>
│ │ │ │ -
77IteratorRange< typename GridGlue<P0, P1>::template IntersectionIterator<reverse ? 1 : 0> >
│ │ │ │ -
78intersections(const GridGlue<P0, P1>& glue, const Reverse<reverse>& = {})
│ │ │ │ -
79{
│ │ │ │ -
80 const static int side = reverse ? 1 : 0;
│ │ │ │ -
81 return {glue.template ibegin<side>(), glue.template iend<side>()};
│ │ │ │ -
82}
│ │ │ │ -
83
│ │ │ │ -
84#endif // DOXYGEN
│ │ │ │ -
85
│ │ │ │ -
86} /* namespace GridGlue */
│ │ │ │ -
87} /* namespace Dune */
│ │ │ │ -
88
│ │ │ │ -
89#endif
│ │ │ │ +
76 // ////////////////////////////////////////////
│ │ │ │ +
77 // Write triangles
│ │ │ │ +
78 // ////////////////////////////////////////////
│ │ │ │ +
79
│ │ │ │ +
80 fgrid<<"NBranchingPoints 0\n";
│ │ │ │ +
81 fgrid<<"NVerticesOnCurves 0\n";
│ │ │ │ +
82 fgrid<<"BoundaryCurves 0\n";
│ │ │ │ +
83 fgrid<<"Patches 1\n";
│ │ │ │ +
84 fgrid<<"{\n";
│ │ │ │ +
85 fgrid<<"InnerRegion inside\n";
│ │ │ │ +
86 fgrid<<"OuterRegion outside\n";
│ │ │ │ +
87 fgrid<<"BoundaryID 0\n";
│ │ │ │ +
88 fgrid<<"BranchingPoints 0";
│ │ │ │ +
89 fgrid<<"\n";
│ │ │ │ +
90
│ │ │ │ +
91 fgrid<<"Triangles "<<overlaps<<std::endl;
│ │ │ │ +
92
│ │ │ │ +
93 for (int i=0;i<overlaps; i++)
│ │ │ │ +
94 fgrid<<i*dim+1<<" "<<i*dim+2<<" "<<i*dim+3<<std::endl;
│ │ │ │ +
95 fgrid<<"}\n";
│ │ │ │ +
96
│ │ │ │ +
97 } else if (dim==2) {
│ │ │ │ +
98
│ │ │ │ +
99 fgrid << "# AmiraMesh 3D ASCII 2.0 \n";
│ │ │ │ +
100 fgrid<<"\n";
│ │ │ │ +
101 fgrid<<"define Lines "<<3*overlaps<<"\n";
│ │ │ │ +
102 fgrid<<"nVertices "<<2*overlaps<<"\n";
│ │ │ │ +
103 fgrid<<"\n";
│ │ │ │ +
104 fgrid<<"Parameters {\n";
│ │ │ │ +
105 fgrid<<" ContentType \"HxLineSet\" \n";
│ │ │ │ +
106 fgrid<<"}\n";
│ │ │ │ +
107 fgrid<<"\n";
│ │ │ │ +
108 fgrid<<"Lines { int LineIdx } @1\n";
│ │ │ │ +
109 fgrid<<"Vertices { float[3] Coordinates } @2\n";
│ │ │ │ +
110 fgrid<<"\n";
│ │ │ │ +
111 fgrid<<"# Data section follows\n";
│ │ │ │ +
112 fgrid<<"@1 \n";
│ │ │ │ +
113 for (int i=0; i<overlaps;i++)
│ │ │ │ +
114 fgrid<<2*i<<"\n"<<2*i+1<<"\n"<<-1<<"\n";
│ │ │ │ +
115 fgrid<<"\n";
│ │ │ │ +
116 fgrid<<"@2 \n";
│ │ │ │ +
117
│ │ │ │ +
118 auto isEnd = glue.template iend<side>();
│ │ │ │ +
119 for (auto isIt = glue.template ibegin<side>(); isIt != isEnd; ++isIt) {
│ │ │ │ +
120 const auto& geometry = isIt->geometry();
│ │ │ │ +
121 for (int i = 0; i <2; ++i)
│ │ │ │ +
122 fgrid << geometry.corner(i) <<" "<<0<<"\n";
│ │ │ │ +
123 }
│ │ │ │ +
124 }
│ │ │ │ +
125
│ │ │ │ +
126 fgrid.close();
│ │ │ │ +
127 }
│ │ │ │ +
128
│ │ │ │ +
129public:
│ │ │ │ +
130 template<typename Glue>
│ │ │ │ +
131 static void write(const Glue& glue, const std::string& path, int appendix=1)
│ │ │ │ +
132 {
│ │ │ │ +
133 std::ostringstream name0;
│ │ │ │ +
134 name0 << path;
│ │ │ │ +
135 name0 << "/domain.surf" << std::setw(3) << std::setfill('0') << appendix;
│ │ │ │ +
136
│ │ │ │ +
137 // Write extracted grid and remote intersection on the grid1-side
│ │ │ │ +
138 writeIntersections<Glue,0>(glue,name0.str());
│ │ │ │ +
139
│ │ │ │ +
140 std::ostringstream name1;
│ │ │ │ +
141 name1 << path;
│ │ │ │ +
142 name1 << "/target.surf" << std::setw(3) << std::setfill('0') << appendix;
│ │ │ │ +
143
│ │ │ │ +
144 writeIntersections<Glue,1>(glue, name1.str());
│ │ │ │ +
145 }
│ │ │ │ +
146
│ │ │ │ +
147};
│ │ │ │ +
148
│ │ │ │ +
149} // namespace GridGlue
│ │ │ │ +
150} // namespace Dune
│ │ │ │ +
151
│ │ │ │ +
152#endif // DUNE_GRIDGLUE_ADAPTER_GRIDGLUEAMIRAWRITER_HH
│ │ │ │
Definition: gridglue.hh:37
│ │ │ │ -
IteratorRange<... > intersections(const GridGlue<... > &glue, const Reverse<... > &reverse=!reversed)
Iterate over all intersections of a GridGlue.
│ │ │ │ -
sequential adapter to couple two grids at specified close together boundaries
Definition: gridglue.hh:67
│ │ │ │ -
IteratorRange<... > intersections(const GridGlue<... > &glue, const Reverse<... > &reverse=!reversed)
Iterate over all intersections of a GridGlue.
│ │ │ │ -
Definition: rangegenerators.hh:17
│ │ │ │ -
const Reverse< true > reversed
Definition: rangegenerators.hh:31
│ │ │ │ -
Reverse type
Definition: rangegenerators.hh:18
│ │ │ │ -
constexpr Reverse<!reverse > operator!() const
Definition: rangegenerators.hh:21
│ │ │ │ +
Write remote intersections to a AmiraMesh file for debugging purposes.
Definition: gridglueamirawriter.hh:21
│ │ │ │ +
static void write(const Glue &glue, const std::string &path, int appendix=1)
Definition: gridglueamirawriter.hh:131
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,89 +5,166 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * adapter │ │ │ │ │ -rangegenerators.hh │ │ │ │ │ +gridglueamirawriter.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 2// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only- │ │ │ │ │ with-dune-grid-glue-exception │ │ │ │ │ - 3#ifndef DUNE_GRIDGLUE_ADAPTER_RANGEGENERATORS_HH │ │ │ │ │ - 4#define DUNE_GRIDGLUE_ADAPTER_RANGEGENERATORS_HH │ │ │ │ │ - 5 │ │ │ │ │ - 6#include │ │ │ │ │ - 7 │ │ │ │ │ - 8namespace Dune { │ │ │ │ │ - 9namespace GridGlue { │ │ │ │ │ + 8#ifndef DUNE_GRIDGLUE_ADAPTER_GRIDGLUEAMIRAWRITER_HH │ │ │ │ │ + 9#define DUNE_GRIDGLUE_ADAPTER_GRIDGLUEAMIRAWRITER_HH │ │ │ │ │ 10 │ │ │ │ │ - 14template │ │ │ │ │ -15struct Reverse │ │ │ │ │ - 16 : std::integral_constant │ │ │ │ │ - 17{ │ │ │ │ │ -18 typedef Reverse type; │ │ │ │ │ - 19 │ │ │ │ │ - 20 constexpr │ │ │ │ │ -21 Reverse operator!() const │ │ │ │ │ - 22 { return {}; } │ │ │ │ │ - 23}; │ │ │ │ │ - 24 │ │ │ │ │ - 25#ifdef DOXYGEN │ │ │ │ │ - 26 │ │ │ │ │ -31const Reverse reversed; │ │ │ │ │ + 11#include │ │ │ │ │ + 12#include │ │ │ │ │ + 13#include │ │ │ │ │ + 14 │ │ │ │ │ + 15namespace Dune { │ │ │ │ │ + 16namespace GridGlue { │ │ │ │ │ + 17 │ │ │ │ │ +20class GridGlueAmiraWriter │ │ │ │ │ + 21{ │ │ │ │ │ + 22 │ │ │ │ │ + 26 template │ │ │ │ │ + 27 static void writeIntersections(const Glue& glue, const std::string& │ │ │ │ │ +filename) │ │ │ │ │ + 28 { │ │ │ │ │ + 29 static_assert((side==0 || side==1), "'side' can only be 0 or 1"); │ │ │ │ │ + 30 │ │ │ │ │ + 31 std::ofstream fgrid; │ │ │ │ │ 32 │ │ │ │ │ - 66template<...> │ │ │ │ │ - 67IteratorRange<...> │ │ │ │ │ -68intersections(const GridGlue<...>& glue, const Reverse<...>& reverse = │ │ │ │ │ -!reversed); │ │ │ │ │ - 69 │ │ │ │ │ - 70#else │ │ │ │ │ - 71 │ │ │ │ │ - 72namespace { │ │ │ │ │ - 73const Reverse reversed = {}; │ │ │ │ │ - 74} /* namespace */ │ │ │ │ │ + 33 fgrid.open(filename.c_str()); │ │ │ │ │ + 34 │ │ │ │ │ + 35 using GridView = typename Glue::template GridView; │ │ │ │ │ + 36 const int dim = GridView::dimension; │ │ │ │ │ + 37 const int domdimw = GridView::dimensionworld; │ │ │ │ │ + 38 │ │ │ │ │ + 39 // coordinates have to be in R^3 in the VTK format │ │ │ │ │ + 40 std::string coordinatePadding; │ │ │ │ │ + 41 for (int i=domdimw; i<3; i++) │ │ │ │ │ + 42 coordinatePadding += " 0"; │ │ │ │ │ + 43 │ │ │ │ │ + 44 int overlaps = glue.size(); │ │ │ │ │ + 45 │ │ │ │ │ + 46 if (dim==3) { │ │ │ │ │ + 47 │ │ │ │ │ + 48 fgrid << "# HyperSurface 0.1 ASCII \n" << std::endl; │ │ │ │ │ + 49 fgrid<<"\n"; │ │ │ │ │ + 50 fgrid<<"Parameters {\n"; │ │ │ │ │ + 51 fgrid<<" Materials {\n"; │ │ │ │ │ + 52 fgrid<<" outside {\n"; │ │ │ │ │ + 53 fgrid<<" Id 0\n"; │ │ │ │ │ + 54 fgrid<<" }\n"; │ │ │ │ │ + 55 fgrid<<" inside {\n"; │ │ │ │ │ + 56 fgrid<<" Id 1\n"; │ │ │ │ │ + 57 fgrid<<" }\n"; │ │ │ │ │ + 58 fgrid<<" }\n"; │ │ │ │ │ + 59 fgrid<<"\n"; │ │ │ │ │ + 60 fgrid<<"}\n"; │ │ │ │ │ + 61 │ │ │ │ │ + 62 // //////////////////////////////////////////// │ │ │ │ │ + 63 // Write vertices │ │ │ │ │ + 64 // //////////////////////////////////////////// │ │ │ │ │ + 65 │ │ │ │ │ + 66 //use dim and not dim+1 │ │ │ │ │ + 67 fgrid<<"\nVertices "<< overlaps*(dim)<<"\n"; │ │ │ │ │ + 68 auto isEnd = glue.template iend(); │ │ │ │ │ + 69 for (auto isIt = glue.template ibegin(); isIt != isEnd; ++isIt) │ │ │ │ │ + 70 { │ │ │ │ │ + 71 const auto& geometry = isIt->geometry(); │ │ │ │ │ + 72 for (int i = 0; i < geometry.corners(); ++i) │ │ │ │ │ + 73 fgrid << geometry.corner(i) << coordinatePadding << std::endl; │ │ │ │ │ + 74 } │ │ │ │ │ 75 │ │ │ │ │ - 76template │ │ │ │ │ - 77IteratorRange< typename GridGlue::template │ │ │ │ │ -IntersectionIterator > │ │ │ │ │ - 78intersections(const GridGlue& glue, const Reverse& = {}) │ │ │ │ │ - 79{ │ │ │ │ │ - 80 const static int side = reverse ? 1 : 0; │ │ │ │ │ - 81 return {glue.template ibegin(), glue.template iend()}; │ │ │ │ │ - 82} │ │ │ │ │ - 83 │ │ │ │ │ - 84#endif // DOXYGEN │ │ │ │ │ - 85 │ │ │ │ │ - 86} /* namespace GridGlue */ │ │ │ │ │ - 87} /* namespace Dune */ │ │ │ │ │ - 88 │ │ │ │ │ - 89#endif │ │ │ │ │ + 76 // //////////////////////////////////////////// │ │ │ │ │ + 77 // Write triangles │ │ │ │ │ + 78 // //////////////////////////////////////////// │ │ │ │ │ + 79 │ │ │ │ │ + 80 fgrid<<"NBranchingPoints 0\n"; │ │ │ │ │ + 81 fgrid<<"NVerticesOnCurves 0\n"; │ │ │ │ │ + 82 fgrid<<"BoundaryCurves 0\n"; │ │ │ │ │ + 83 fgrid<<"Patches 1\n"; │ │ │ │ │ + 84 fgrid<<"{\n"; │ │ │ │ │ + 85 fgrid<<"InnerRegion inside\n"; │ │ │ │ │ + 86 fgrid<<"OuterRegion outside\n"; │ │ │ │ │ + 87 fgrid<<"BoundaryID 0\n"; │ │ │ │ │ + 88 fgrid<<"BranchingPoints 0"; │ │ │ │ │ + 89 fgrid<<"\n"; │ │ │ │ │ + 90 │ │ │ │ │ + 91 fgrid<<"Triangles "<(); │ │ │ │ │ + 119 for (auto isIt = glue.template ibegin(); isIt != isEnd; ++isIt) { │ │ │ │ │ + 120 const auto& geometry = isIt->geometry(); │ │ │ │ │ + 121 for (int i = 0; i <2; ++i) │ │ │ │ │ + 122 fgrid << geometry.corner(i) <<" "<<0<<"\n"; │ │ │ │ │ + 123 } │ │ │ │ │ + 124 } │ │ │ │ │ + 125 │ │ │ │ │ + 126 fgrid.close(); │ │ │ │ │ + 127 } │ │ │ │ │ + 128 │ │ │ │ │ + 129public: │ │ │ │ │ + 130 template │ │ │ │ │ +131 static void write(const Glue& glue, const std::string& path, int │ │ │ │ │ +appendix=1) │ │ │ │ │ + 132 { │ │ │ │ │ + 133 std::ostringstream name0; │ │ │ │ │ + 134 name0 << path; │ │ │ │ │ + 135 name0 << "/domain.surf" << std::setw(3) << std::setfill('0') << appendix; │ │ │ │ │ + 136 │ │ │ │ │ + 137 // Write extracted grid and remote intersection on the grid1-side │ │ │ │ │ + 138 writeIntersections(glue,name0.str()); │ │ │ │ │ + 139 │ │ │ │ │ + 140 std::ostringstream name1; │ │ │ │ │ + 141 name1 << path; │ │ │ │ │ + 142 name1 << "/target.surf" << std::setw(3) << std::setfill('0') << appendix; │ │ │ │ │ + 143 │ │ │ │ │ + 144 writeIntersections(glue, name1.str()); │ │ │ │ │ + 145 } │ │ │ │ │ + 146 │ │ │ │ │ + 147}; │ │ │ │ │ + 148 │ │ │ │ │ + 149} // namespace GridGlue │ │ │ │ │ + 150} // namespace Dune │ │ │ │ │ + 151 │ │ │ │ │ + 152#endif // DUNE_GRIDGLUE_ADAPTER_GRIDGLUEAMIRAWRITER_HH │ │ │ │ │ Dune │ │ │ │ │ Definition: gridglue.hh:37 │ │ │ │ │ -Dune::GridGlue::intersections │ │ │ │ │ -IteratorRange<... > intersections(const GridGlue<... > &glue, const Reverse<... │ │ │ │ │ -> &reverse=!reversed) │ │ │ │ │ -Iterate over all intersections of a GridGlue. │ │ │ │ │ -Dune::GridGlue::GridGlue │ │ │ │ │ -sequential adapter to couple two grids at specified close together boundaries │ │ │ │ │ -Definition: gridglue.hh:67 │ │ │ │ │ -Dune::GridGlue::GridGlue::intersections │ │ │ │ │ -IteratorRange<... > intersections(const GridGlue<... > &glue, const Reverse<... │ │ │ │ │ -> &reverse=!reversed) │ │ │ │ │ -Iterate over all intersections of a GridGlue. │ │ │ │ │ -Dune::GridGlue::Reverse │ │ │ │ │ -Definition: rangegenerators.hh:17 │ │ │ │ │ -Dune::GridGlue::Reverse::reversed │ │ │ │ │ -const Reverse< true > reversed │ │ │ │ │ -Definition: rangegenerators.hh:31 │ │ │ │ │ -Dune::GridGlue::Reverse::type │ │ │ │ │ -Reverse type │ │ │ │ │ -Definition: rangegenerators.hh:18 │ │ │ │ │ -Dune::GridGlue::Reverse::operator! │ │ │ │ │ -constexpr Reverse operator!() const │ │ │ │ │ -Definition: rangegenerators.hh:21 │ │ │ │ │ +Dune::GridGlue::GridGlueAmiraWriter │ │ │ │ │ +Write remote intersections to a AmiraMesh file for debugging purposes. │ │ │ │ │ +Definition: gridglueamirawriter.hh:21 │ │ │ │ │ +Dune::GridGlue::GridGlueAmiraWriter::write │ │ │ │ │ +static void write(const Glue &glue, const std::string &path, int appendix=1) │ │ │ │ │ +Definition: gridglueamirawriter.hh:131 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00029.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: areawriter_impl.hh File Reference │ │ │ │ +dune-grid-glue: areawriter.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -63,47 +63,34 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ Namespaces | │ │ │ │ Functions
│ │ │ │ -
areawriter_impl.hh File Reference
│ │ │ │ +
areawriter.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <fstream>
│ │ │ │ -#include <vector>
│ │ │ │ -#include <dune/common/fvector.hh>
│ │ │ │ -#include <dune/geometry/type.hh>
│ │ │ │ -#include <dune/grid/common/mcmgmapper.hh>
│ │ │ │ +
#include <ostream>
│ │ │ │ +#include <string>
│ │ │ │ +#include "areawriter_impl.hh"
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ -Classes

struct  Dune::GridGlue::AreaWriterImplementation::FacetLayout< dimgrid >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
namespace  Dune::GridGlue::AreaWriterImplementation
 
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,37 +5,26 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * common │ │ │ │ │ -Classes | Namespaces | Functions │ │ │ │ │ -areawriter_impl.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +Namespaces | Functions │ │ │ │ │ +areawriter.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include "areawriter_impl.hh" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ - Classes │ │ │ │ │ -struct  Dune::GridGlue::AreaWriterImplementation::FacetLayout<_dimgrid_> │ │ │ │ │ -  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::GridGlue │ │ │ │ │   │ │ │ │ │ -namespace  Dune::GridGlue::AreaWriterImplementation │ │ │ │ │ -  │ │ │ │ │ Functions │ │ │ │ │ -template │ │ │ │ │ -void Dune::GridGlue::AreaWriterImplementation::write_facet_geometry (const │ │ │ │ │ - GridView &gv, std::ostream &out) │ │ │ │ │ -  │ │ │ │ │ template │ │ │ │ │ void Dune::GridGlue::write_glue_area_vtk (const Glue &glue, std::ostream &out) │ │ │ │ │   │ │ │ │ │ template │ │ │ │ │ void Dune::GridGlue::write_glue_area_vtk (const Glue &glue, const std::string │ │ │ │ │ &filename) │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00029_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: areawriter_impl.hh Source File │ │ │ │ +dune-grid-glue: areawriter.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,169 +62,47 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
areawriter_impl.hh
│ │ │ │ +
areawriter.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
2// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
│ │ │ │ -
3#include <fstream>
│ │ │ │ -
4#include <vector>
│ │ │ │ +
3#ifndef DUNE_GRIDGLUE_COMMON_AREAWRITER_HH
│ │ │ │ +
4#define DUNE_GRIDGLUE_COMMON_AREAWRITER_HH
│ │ │ │
5
│ │ │ │ -
6#include <dune/common/fvector.hh>
│ │ │ │ -
7#include <dune/geometry/type.hh>
│ │ │ │ -
8#include <dune/grid/common/mcmgmapper.hh>
│ │ │ │ -
9
│ │ │ │ -
10namespace Dune {
│ │ │ │ -
11namespace GridGlue {
│ │ │ │ -
12
│ │ │ │ -
13namespace AreaWriterImplementation {
│ │ │ │ +
6#include <ostream>
│ │ │ │ +
7#include <string>
│ │ │ │ +
8
│ │ │ │ +
9namespace Dune {
│ │ │ │ +
10namespace GridGlue {
│ │ │ │ +
11
│ │ │ │ +
12template<int side, typename Glue>
│ │ │ │ +
13void write_glue_area_vtk(const Glue& glue, std::ostream& out);
│ │ │ │
14
│ │ │ │ -
15template<int dimgrid>
│ │ │ │ - │ │ │ │ -
17{
│ │ │ │ -
18 bool contains(Dune::GeometryType gt) const
│ │ │ │ -
19 {
│ │ │ │ -
20 return gt.dim() == dimgrid - 1;
│ │ │ │ -
21 }
│ │ │ │ -
22};
│ │ │ │ -
23
│ │ │ │ -
24template<typename GridView>
│ │ │ │ -
25void write_facet_geometry(const GridView& gv, std::ostream& out)
│ │ │ │ -
26{
│ │ │ │ -
27 using Coordinate = Dune::FieldVector<double, 3>;
│ │ │ │ -
28
│ │ │ │ -
29 std::vector<Coordinate> corners;
│ │ │ │ -
30 for (const auto& facet : facets(gv)) {
│ │ │ │ -
31 const auto geometry = facet.geometry();
│ │ │ │ -
32 for (int i = 0; i < geometry.corners(); ++i) {
│ │ │ │ -
33 /* VTK always needs 3-dim coordinates... */
│ │ │ │ -
34 const auto c0 = geometry.corner(i);
│ │ │ │ -
35 Coordinate c1;
│ │ │ │ -
36 for (int d = 0; d < GridView::dimensionworld; ++d)
│ │ │ │ -
37 c1[d] = c0[d];
│ │ │ │ -
38 for (int d = GridView::dimensionworld; d < Coordinate::dimension; ++d)
│ │ │ │ -
39 c1[d] = double(0);
│ │ │ │ -
40 corners.push_back(c1);
│ │ │ │ -
41 }
│ │ │ │ -
42 }
│ │ │ │ -
43
│ │ │ │ -
44 {
│ │ │ │ -
45 out << "DATASET UNSTRUCTURED_GRID\n"
│ │ │ │ -
46 << "POINTS " << corners.size() << " double\n";
│ │ │ │ -
47 for (const auto& c : corners)
│ │ │ │ -
48 out << c << "\n";
│ │ │ │ -
49 }
│ │ │ │ -
50 {
│ │ │ │ -
51 out << "CELLS " << gv.size(1) << " " << (gv.size(1) + corners.size()) << "\n";
│ │ │ │ -
52 std::size_t c = 0;
│ │ │ │ -
53 for (const auto& facet : facets(gv)) {
│ │ │ │ -
54 const auto geometry = facet.geometry();
│ │ │ │ -
55 out << geometry.corners();
│ │ │ │ -
56 for (int i = 0; i < geometry.corners(); ++i, ++c)
│ │ │ │ -
57 out << " " << c;
│ │ │ │ -
58 out << "\n";
│ │ │ │ -
59 }
│ │ │ │ -
60 }
│ │ │ │ -
61 {
│ │ │ │ -
62 out << "CELL_TYPES " << gv.size(1) << "\n";
│ │ │ │ -
63 for (const auto& facet : facets(gv)) {
│ │ │ │ -
64 const auto type = facet.type();
│ │ │ │ -
65 if (type.isVertex())
│ │ │ │ -
66 out << "1\n";
│ │ │ │ -
67 else if (type.isLine())
│ │ │ │ -
68 out << "2\n";
│ │ │ │ -
69 else if (type.isTriangle())
│ │ │ │ -
70 out << "5\n";
│ │ │ │ -
71 else if (type.isQuadrilateral())
│ │ │ │ -
72 out << "9\n";
│ │ │ │ -
73 else if (type.isTetrahedron())
│ │ │ │ -
74 out << "10\n";
│ │ │ │ -
75 else
│ │ │ │ -
76 DUNE_THROW(Dune::Exception, "Unhandled geometry type");
│ │ │ │ -
77 }
│ │ │ │ -
78 }
│ │ │ │ -
79}
│ │ │ │ -
80
│ │ │ │ -
81} /* namespace AreaWriterImplementation */
│ │ │ │ -
82
│ │ │ │ -
83template<int side, typename Glue>
│ │ │ │ -
84void write_glue_area_vtk(const Glue& glue, std::ostream& out)
│ │ │ │ -
85{
│ │ │ │ -
86 using GridView = typename std::decay< decltype(glue.template gridView<side>()) >::type;
│ │ │ │ -
87 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView, AreaWriterImplementation::FacetLayout>;
│ │ │ │ -
88 using ctype = typename GridView::ctype;
│ │ │ │ -
89
│ │ │ │ -
90 const GridView gv = glue.template gridView<side>();
│ │ │ │ -
91 Mapper mapper(gv);
│ │ │ │ -
92 std::vector<ctype> coveredArea(mapper.size(), ctype(0));
│ │ │ │ -
93 std::vector<ctype> totalArea(mapper.size(), ctype(1));
│ │ │ │ -
94
│ │ │ │ -
95 for (const auto& in : intersections(glue, Reverse<side == 1>())) {
│ │ │ │ -
96 const auto element = in.inside();
│ │ │ │ -
97 const auto index = mapper.subIndex(element, in.indexInInside(), 1);
│ │ │ │ -
98 coveredArea[index] += in.geometryInInside().volume();
│ │ │ │ -
99
│ │ │ │ -
100 const auto& refElement = Dune::ReferenceElements<ctype, GridView::dimension>::general(element.type());
│ │ │ │ -
101 const auto& subGeometry = refElement.template geometry<1>(in.indexInInside());
│ │ │ │ -
102 totalArea[index] = subGeometry.volume();
│ │ │ │ -
103 }
│ │ │ │ -
104
│ │ │ │ -
105 for (std::size_t i = 0; i < coveredArea.size(); ++i)
│ │ │ │ -
106 coveredArea[i] /= totalArea[i];
│ │ │ │ -
107
│ │ │ │ -
108 out << "# vtk DataFile Version 2.0\n"
│ │ │ │ -
109 << "Filename: Glue Area\n"
│ │ │ │ -
110 << "ASCII\n";
│ │ │ │ -
111
│ │ │ │ - │ │ │ │ -
113
│ │ │ │ -
114 out << "CELL_DATA " << coveredArea.size() << "\n"
│ │ │ │ -
115 << "SCALARS CoveredArea double 1\n"
│ │ │ │ -
116 << "LOOKUP_TABLE default\n";
│ │ │ │ -
117 for (const auto& value : coveredArea)
│ │ │ │ -
118 out << value << "\n";
│ │ │ │ -
119}
│ │ │ │ -
120
│ │ │ │ -
121template<int side, typename Glue>
│ │ │ │ -
122void write_glue_area_vtk(const Glue& glue, const std::string& filename)
│ │ │ │ -
123{
│ │ │ │ -
124 std::ofstream out(filename.c_str());
│ │ │ │ -
125 write_glue_area_vtk<side>(glue, out);
│ │ │ │ -
126}
│ │ │ │ -
127
│ │ │ │ -
128template<typename Glue>
│ │ │ │ -
129void write_glue_areas_vtk(const Glue& glue, const std::string& base)
│ │ │ │ -
130{
│ │ │ │ -
131 {
│ │ │ │ -
132 std::string filename = base;
│ │ │ │ -
133 filename += "-inside.vtk";
│ │ │ │ -
134 write_glue_area_vtk<0>(glue, filename);
│ │ │ │ -
135 }
│ │ │ │ -
136 {
│ │ │ │ -
137 std::string filename = base;
│ │ │ │ -
138 filename += "-outside.vtk";
│ │ │ │ -
139 write_glue_area_vtk<1>(glue, filename);
│ │ │ │ -
140 }
│ │ │ │ -
141}
│ │ │ │ -
142
│ │ │ │ -
143} /* namespace GridGlue */
│ │ │ │ -
144} /* namespace Dune */
│ │ │ │ +
15template<int side, typename Glue>
│ │ │ │ +
16void write_glue_area_vtk(const Glue& glue, const std::string& filename);
│ │ │ │ +
17
│ │ │ │ +
37template<typename Glue>
│ │ │ │ +
38void write_glue_areas_vtk(const Glue& glue, const std::string& base);
│ │ │ │ +
39
│ │ │ │ +
40} /* namespace GridGlue */
│ │ │ │ +
41} /* namespace Dune */
│ │ │ │ +
42
│ │ │ │ +
43#include "areawriter_impl.hh"
│ │ │ │ +
44
│ │ │ │ +
45#endif
│ │ │ │ + │ │ │ │
Definition: gridglue.hh:37
│ │ │ │
void write_glue_area_vtk(const Glue &glue, std::ostream &out)
Definition: areawriter_impl.hh:84
│ │ │ │
void write_glue_areas_vtk(const Glue &glue, const std::string &base)
Definition: areawriter_impl.hh:129
│ │ │ │ -
IteratorRange<... > intersections(const GridGlue<... > &glue, const Reverse<... > &reverse=!reversed)
Iterate over all intersections of a GridGlue.
│ │ │ │ -
void write_facet_geometry(const GridView &gv, std::ostream &out)
Definition: areawriter_impl.hh:25
│ │ │ │ -
Definition: rangegenerators.hh:17
│ │ │ │ - │ │ │ │ -
bool contains(Dune::GeometryType gt) const
Definition: areawriter_impl.hh:18
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,185 +5,49 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * common │ │ │ │ │ -areawriter_impl.hh │ │ │ │ │ +areawriter.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 2// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only- │ │ │ │ │ with-dune-grid-glue-exception │ │ │ │ │ - 3#include │ │ │ │ │ - 4#include │ │ │ │ │ + 3#ifndef DUNE_GRIDGLUE_COMMON_AREAWRITER_HH │ │ │ │ │ + 4#define DUNE_GRIDGLUE_COMMON_AREAWRITER_HH │ │ │ │ │ 5 │ │ │ │ │ - 6#include │ │ │ │ │ - 7#include │ │ │ │ │ - 8#include │ │ │ │ │ - 9 │ │ │ │ │ - 10namespace Dune { │ │ │ │ │ - 11namespace GridGlue { │ │ │ │ │ - 12 │ │ │ │ │ -13namespace AreaWriterImplementation { │ │ │ │ │ + 6#include │ │ │ │ │ + 7#include │ │ │ │ │ + 8 │ │ │ │ │ + 9namespace Dune { │ │ │ │ │ + 10namespace GridGlue { │ │ │ │ │ + 11 │ │ │ │ │ + 12template │ │ │ │ │ + 13void write_glue_area_vtk(const Glue& glue, std::ostream& out); │ │ │ │ │ 14 │ │ │ │ │ - 15template │ │ │ │ │ -16struct FacetLayout │ │ │ │ │ - 17{ │ │ │ │ │ -18 bool contains(Dune::GeometryType gt) const │ │ │ │ │ - 19 { │ │ │ │ │ - 20 return gt.dim() == dimgrid - 1; │ │ │ │ │ - 21 } │ │ │ │ │ - 22}; │ │ │ │ │ - 23 │ │ │ │ │ - 24template │ │ │ │ │ -25void write_facet_geometry(const GridView& gv, std::ostream& out) │ │ │ │ │ - 26{ │ │ │ │ │ - 27 using Coordinate = Dune::FieldVector; │ │ │ │ │ - 28 │ │ │ │ │ - 29 std::vector corners; │ │ │ │ │ - 30 for (const auto& facet : facets(gv)) { │ │ │ │ │ - 31 const auto geometry = facet.geometry(); │ │ │ │ │ - 32 for (int i = 0; i < geometry.corners(); ++i) { │ │ │ │ │ - 33 /* VTK always needs 3-dim coordinates... */ │ │ │ │ │ - 34 const auto c0 = geometry.corner(i); │ │ │ │ │ - 35 Coordinate c1; │ │ │ │ │ - 36 for (int d = 0; d < GridView::dimensionworld; ++d) │ │ │ │ │ - 37 c1[d] = c0[d]; │ │ │ │ │ - 38 for (int d = GridView::dimensionworld; d < Coordinate::dimension; ++d) │ │ │ │ │ - 39 c1[d] = double(0); │ │ │ │ │ - 40 corners.push_back(c1); │ │ │ │ │ - 41 } │ │ │ │ │ - 42 } │ │ │ │ │ - 43 │ │ │ │ │ - 44 { │ │ │ │ │ - 45 out << "DATASET UNSTRUCTURED_GRID\n" │ │ │ │ │ - 46 << "POINTS " << corners.size() << " double\n"; │ │ │ │ │ - 47 for (const auto& c : corners) │ │ │ │ │ - 48 out << c << "\n"; │ │ │ │ │ - 49 } │ │ │ │ │ - 50 { │ │ │ │ │ - 51 out << "CELLS " << gv.size(1) << " " << (gv.size(1) + corners.size()) << │ │ │ │ │ -"\n"; │ │ │ │ │ - 52 std::size_t c = 0; │ │ │ │ │ - 53 for (const auto& facet : facets(gv)) { │ │ │ │ │ - 54 const auto geometry = facet.geometry(); │ │ │ │ │ - 55 out << geometry.corners(); │ │ │ │ │ - 56 for (int i = 0; i < geometry.corners(); ++i, ++c) │ │ │ │ │ - 57 out << " " << c; │ │ │ │ │ - 58 out << "\n"; │ │ │ │ │ - 59 } │ │ │ │ │ - 60 } │ │ │ │ │ - 61 { │ │ │ │ │ - 62 out << "CELL_TYPES " << gv.size(1) << "\n"; │ │ │ │ │ - 63 for (const auto& facet : facets(gv)) { │ │ │ │ │ - 64 const auto type = facet.type(); │ │ │ │ │ - 65 if (type.isVertex()) │ │ │ │ │ - 66 out << "1\n"; │ │ │ │ │ - 67 else if (type.isLine()) │ │ │ │ │ - 68 out << "2\n"; │ │ │ │ │ - 69 else if (type.isTriangle()) │ │ │ │ │ - 70 out << "5\n"; │ │ │ │ │ - 71 else if (type.isQuadrilateral()) │ │ │ │ │ - 72 out << "9\n"; │ │ │ │ │ - 73 else if (type.isTetrahedron()) │ │ │ │ │ - 74 out << "10\n"; │ │ │ │ │ - 75 else │ │ │ │ │ - 76 DUNE_THROW(Dune::Exception, "Unhandled geometry type"); │ │ │ │ │ - 77 } │ │ │ │ │ - 78 } │ │ │ │ │ - 79} │ │ │ │ │ - 80 │ │ │ │ │ - 81} /* namespace AreaWriterImplementation */ │ │ │ │ │ - 82 │ │ │ │ │ - 83template │ │ │ │ │ -84void write_glue_area_vtk(const Glue& glue, std::ostream& out) │ │ │ │ │ - 85{ │ │ │ │ │ - 86 using GridView = typename std::decay< decltype(glue.template gridView │ │ │ │ │ -()) >::type; │ │ │ │ │ - 87 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper; │ │ │ │ │ - 88 using ctype = typename GridView::ctype; │ │ │ │ │ - 89 │ │ │ │ │ - 90 const GridView gv = glue.template gridView(); │ │ │ │ │ - 91 Mapper mapper(gv); │ │ │ │ │ - 92 std::vector coveredArea(mapper.size(), ctype(0)); │ │ │ │ │ - 93 std::vector totalArea(mapper.size(), ctype(1)); │ │ │ │ │ - 94 │ │ │ │ │ - 95 for (const auto& in : intersections(glue, Reverse())) { │ │ │ │ │ - 96 const auto element = in.inside(); │ │ │ │ │ - 97 const auto index = mapper.subIndex(element, in.indexInInside(), 1); │ │ │ │ │ - 98 coveredArea[index] += in.geometryInInside().volume(); │ │ │ │ │ - 99 │ │ │ │ │ - 100 const auto& refElement = Dune::ReferenceElements::general(element.type()); │ │ │ │ │ - 101 const auto& subGeometry = refElement.template geometry<1>(in.indexInInside │ │ │ │ │ -()); │ │ │ │ │ - 102 totalArea[index] = subGeometry.volume(); │ │ │ │ │ - 103 } │ │ │ │ │ - 104 │ │ │ │ │ - 105 for (std::size_t i = 0; i < coveredArea.size(); ++i) │ │ │ │ │ - 106 coveredArea[i] /= totalArea[i]; │ │ │ │ │ - 107 │ │ │ │ │ - 108 out << "# vtk DataFile Version 2.0\n" │ │ │ │ │ - 109 << "Filename: Glue Area\n" │ │ │ │ │ - 110 << "ASCII\n"; │ │ │ │ │ - 111 │ │ │ │ │ - 112 AreaWriterImplementation::write_facet_geometry(gv, out); │ │ │ │ │ - 113 │ │ │ │ │ - 114 out << "CELL_DATA " << coveredArea.size() << "\n" │ │ │ │ │ - 115 << "SCALARS CoveredArea double 1\n" │ │ │ │ │ - 116 << "LOOKUP_TABLE default\n"; │ │ │ │ │ - 117 for (const auto& value : coveredArea) │ │ │ │ │ - 118 out << value << "\n"; │ │ │ │ │ - 119} │ │ │ │ │ - 120 │ │ │ │ │ - 121template │ │ │ │ │ -122void write_glue_area_vtk(const Glue& glue, const std::string& filename) │ │ │ │ │ - 123{ │ │ │ │ │ - 124 std::ofstream out(filename.c_str()); │ │ │ │ │ - 125 write_glue_area_vtk(glue, out); │ │ │ │ │ - 126} │ │ │ │ │ - 127 │ │ │ │ │ - 128template │ │ │ │ │ -129void write_glue_areas_vtk(const Glue& glue, const std::string& base) │ │ │ │ │ - 130{ │ │ │ │ │ - 131 { │ │ │ │ │ - 132 std::string filename = base; │ │ │ │ │ - 133 filename += "-inside.vtk"; │ │ │ │ │ - 134 write_glue_area_vtk<0>(glue, filename); │ │ │ │ │ - 135 } │ │ │ │ │ - 136 { │ │ │ │ │ - 137 std::string filename = base; │ │ │ │ │ - 138 filename += "-outside.vtk"; │ │ │ │ │ - 139 write_glue_area_vtk<1>(glue, filename); │ │ │ │ │ - 140 } │ │ │ │ │ - 141} │ │ │ │ │ - 142 │ │ │ │ │ - 143} /* namespace GridGlue */ │ │ │ │ │ - 144} /* namespace Dune */ │ │ │ │ │ + 15template │ │ │ │ │ + 16void write_glue_area_vtk(const Glue& glue, const std::string& filename); │ │ │ │ │ + 17 │ │ │ │ │ + 37template │ │ │ │ │ + 38void write_glue_areas_vtk(const Glue& glue, const std::string& base); │ │ │ │ │ + 39 │ │ │ │ │ + 40} /* namespace GridGlue */ │ │ │ │ │ + 41} /* namespace Dune */ │ │ │ │ │ + 42 │ │ │ │ │ + 43#include "areawriter_impl.hh" │ │ │ │ │ + 44 │ │ │ │ │ + 45#endif │ │ │ │ │ +areawriter_impl.hh │ │ │ │ │ Dune │ │ │ │ │ Definition: gridglue.hh:37 │ │ │ │ │ Dune::GridGlue::write_glue_area_vtk │ │ │ │ │ void write_glue_area_vtk(const Glue &glue, std::ostream &out) │ │ │ │ │ Definition: areawriter_impl.hh:84 │ │ │ │ │ Dune::GridGlue::write_glue_areas_vtk │ │ │ │ │ void write_glue_areas_vtk(const Glue &glue, const std::string &base) │ │ │ │ │ Definition: areawriter_impl.hh:129 │ │ │ │ │ -Dune::GridGlue::intersections │ │ │ │ │ -IteratorRange<... > intersections(const GridGlue<... > &glue, const Reverse<... │ │ │ │ │ -> &reverse=!reversed) │ │ │ │ │ -Iterate over all intersections of a GridGlue. │ │ │ │ │ -Dune::GridGlue::AreaWriterImplementation::write_facet_geometry │ │ │ │ │ -void write_facet_geometry(const GridView &gv, std::ostream &out) │ │ │ │ │ -Definition: areawriter_impl.hh:25 │ │ │ │ │ -Dune::GridGlue::Reverse │ │ │ │ │ -Definition: rangegenerators.hh:17 │ │ │ │ │ -Dune::GridGlue::AreaWriterImplementation::FacetLayout │ │ │ │ │ -Definition: areawriter_impl.hh:17 │ │ │ │ │ -Dune::GridGlue::AreaWriterImplementation::FacetLayout::contains │ │ │ │ │ -bool contains(Dune::GeometryType gt) const │ │ │ │ │ -Definition: areawriter_impl.hh:18 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00032.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: projectionwriter_impl.hh File Reference │ │ │ │ +dune-grid-glue: projection.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -63,61 +63,41 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Namespaces | │ │ │ │ -Functions
│ │ │ │ -
projectionwriter_impl.hh File Reference
│ │ │ │ +Classes | │ │ │ │ +Namespaces
│ │ │ │ +
projection.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <fstream>
│ │ │ │ +
#include <array>
│ │ │ │ +#include <bitset>
│ │ │ │ +#include <tuple>
│ │ │ │ +#include "projection_impl.hh"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │

│ │ │ │ Functions

template<typename GridView >
void Dune::GridGlue::AreaWriterImplementation::write_facet_geometry (const GridView &gv, std::ostream &out)
 
template<int side, typename Glue >
void Dune::GridGlue::write_glue_area_vtk (const Glue &glue, std::ostream &out)
 
template<int side, typename Glue >
void Dune::GridGlue::write_glue_area_vtk (const Glue &glue, const std::string &filename)
 
template<typename Glue >
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Classes

class  Dune::GridGlue::Projection< Coordinate >
 Projection of a line (triangle) on another line (triangle). More...
 
struct  Dune::GridGlue::Projection< Coordinate >::EdgeIntersection
 Intersection between two edges of a triangle. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
namespace  Dune::GridGlue::ProjectionWriterImplementation
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -Functions

template<unsigned side, typename Coordinate , typename Corners >
void Dune::GridGlue::ProjectionWriterImplementation::write_points (const Projection< Coordinate > &projection, const Corners &corners, std::ostream &out)
 
template<unsigned side, typename Coordinate , typename Normals >
void Dune::GridGlue::ProjectionWriterImplementation::write_normals (const Projection< Coordinate > &projection, const Normals &normals, std::ostream &out)
 
template<typename Coordinate , typename Corners >
void Dune::GridGlue::ProjectionWriterImplementation::write_edge_intersection_points (const Projection< Coordinate > &projection, const Corners &corners, std::ostream &out)
 
template<typename Coordinate , typename Normals >
void Dune::GridGlue::ProjectionWriterImplementation::write_edge_intersection_normals (const Projection< Coordinate > &projection, const Normals &normals, std::ostream &out)
 
template<unsigned side, typename Coordinate >
void Dune::GridGlue::ProjectionWriterImplementation::write_success (const Projection< Coordinate > &projection, std::ostream &out)
 
template<typename Coordinate , typename Corners , typename Normals >
void Dune::GridGlue::write (const Projection< Coordinate > &projection, const Corners &corners, const Normals &normals, std::ostream &out)
 write projection in VTK format More...
 
template<typename Coordinate , typename Corners , typename Normals >
void Dune::GridGlue::write (const Projection< Coordinate > &projection, const Corners &corners, const Normals &normals, const std::string &filename)
 write projection in VTK format More...
 
template<typename Coordinate , typename Corners , typename Normals >
void Dune::GridGlue::print (const Projection< Coordinate > &projection, const Corners &corners, const Normals &normals)
 Print information about the projection to std::cout stream. More...
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,61 +5,29 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * common │ │ │ │ │ -Namespaces | Functions │ │ │ │ │ -projectionwriter_impl.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +projection.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include "projection_impl.hh" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ + Classes │ │ │ │ │ + class  Dune::GridGlue::Projection<_Coordinate_> │ │ │ │ │ +  Projection of a line (triangle) on another line (triangle). More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::GridGlue::Projection<_Coordinate_>::EdgeIntersection │ │ │ │ │ +  Intersection between two edges of a triangle. More... │ │ │ │ │ +  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::GridGlue │ │ │ │ │   │ │ │ │ │ -namespace  Dune::GridGlue::ProjectionWriterImplementation │ │ │ │ │ -  │ │ │ │ │ - Functions │ │ │ │ │ -template │ │ │ │ │ -void Dune::GridGlue::ProjectionWriterImplementation::write_points (const │ │ │ │ │ - Projection< Coordinate > &projection, const Corners &corners, std:: │ │ │ │ │ - ostream &out) │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -void Dune::GridGlue::ProjectionWriterImplementation::write_normals (const │ │ │ │ │ - Projection< Coordinate > &projection, const Normals &normals, std:: │ │ │ │ │ - ostream &out) │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -void Dune::GridGlue::ProjectionWriterImplementation:: │ │ │ │ │ - write_edge_intersection_points (const Projection< Coordinate > │ │ │ │ │ - &projection, const Corners &corners, std::ostream &out) │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -void Dune::GridGlue::ProjectionWriterImplementation:: │ │ │ │ │ - write_edge_intersection_normals (const Projection< Coordinate > │ │ │ │ │ - &projection, const Normals &normals, std::ostream &out) │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -void Dune::GridGlue::ProjectionWriterImplementation::write_success (const │ │ │ │ │ - Projection< Coordinate > &projection, std::ostream &out) │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -void Dune::GridGlue::write (const Projection< Coordinate > &projection, const │ │ │ │ │ - Corners &corners, const Normals &normals, std::ostream &out) │ │ │ │ │ -  write projection in VTK format More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -void Dune::GridGlue::write (const Projection< Coordinate > &projection, const │ │ │ │ │ - Corners &corners, const Normals &normals, const std::string &filename) │ │ │ │ │ -  write projection in VTK format More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -void Dune::GridGlue::print (const Projection< Coordinate > &projection, const │ │ │ │ │ - Corners &corners, const Normals &normals) │ │ │ │ │ -  Print information about the projection to std::cout stream. More... │ │ │ │ │ -  │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00032_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: projectionwriter_impl.hh Source File │ │ │ │ +dune-grid-glue: projection.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,195 +62,126 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
projectionwriter_impl.hh
│ │ │ │ +
projection.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
2// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
│ │ │ │ -
3#include <fstream>
│ │ │ │ -
4
│ │ │ │ -
5namespace Dune {
│ │ │ │ -
6namespace GridGlue {
│ │ │ │ -
7
│ │ │ │ -
8namespace ProjectionWriterImplementation {
│ │ │ │ +
3#ifndef DUNE_GRIDGLUE_COMMON_PROJECTIONHELPER2_HH
│ │ │ │ +
4#define DUNE_GRIDGLUE_COMMON_PROJECTIONHELPER2_HH
│ │ │ │ +
5
│ │ │ │ +
6#include <array>
│ │ │ │ +
7#include <bitset>
│ │ │ │ +
8#include <tuple>
│ │ │ │
9
│ │ │ │ -
10template<unsigned side, typename Coordinate, typename Corners>
│ │ │ │ -
11void write_points(const Projection<Coordinate>& projection, const Corners& corners, std::ostream& out)
│ │ │ │ -
12{
│ │ │ │ -
13 using namespace ProjectionImplementation;
│ │ │ │ -
14 using std::get;
│ │ │ │ -
15 const unsigned other_side = 1 - side;
│ │ │ │ -
16
│ │ │ │ -
17 for (const auto& c : get<side>(corners))
│ │ │ │ -
18 out << c << "\n";
│ │ │ │ -
19
│ │ │ │ -
20 for (const auto& i : get<side>(projection.images())) {
│ │ │ │ -
21 const auto global = interpolate(i, get<other_side>(corners));
│ │ │ │ -
22 out << global << "\n";
│ │ │ │ -
23 }
│ │ │ │ -
24}
│ │ │ │ -
25
│ │ │ │ -
26template<unsigned side, typename Coordinate, typename Normals>
│ │ │ │ -
27void write_normals(const Projection<Coordinate>& projection, const Normals& normals, std::ostream& out)
│ │ │ │ -
28{
│ │ │ │ -
29 using namespace ProjectionImplementation;
│ │ │ │ -
30 using std::get;
│ │ │ │ -
31 const unsigned other_side = 1 - side;
│ │ │ │ -
32
│ │ │ │ -
33 for (const auto& n : get<side>(normals))
│ │ │ │ -
34 out << n << "\n";
│ │ │ │ -
35
│ │ │ │ -
36 for (const auto& x : get<side>(projection.images())) {
│ │ │ │ -
37 const auto n = interpolate_unit_normals(x, get<other_side>(normals));
│ │ │ │ -
38 out << n << "\n";
│ │ │ │ -
39 }
│ │ │ │ -
40}
│ │ │ │ -
41
│ │ │ │ -
42template<typename Coordinate, typename Corners>
│ │ │ │ -
43void write_edge_intersection_points(const Projection<Coordinate>& projection, const Corners& corners, std::ostream& out)
│ │ │ │ -
44{
│ │ │ │ -
45 using namespace ProjectionImplementation;
│ │ │ │ -
46 using std::get;
│ │ │ │ -
47
│ │ │ │ -
48 for (std::size_t i = 0; i < projection.numberOfEdgeIntersections(); ++i) {
│ │ │ │ -
49 const auto& local = projection.edgeIntersections()[i].local;
│ │ │ │ -
50 out << interpolate(local[0], get<0>(corners)) << "\n"
│ │ │ │ -
51 << interpolate(local[1], get<1>(corners)) << "\n";
│ │ │ │ -
52 }
│ │ │ │ -
53}
│ │ │ │ -
54
│ │ │ │ -
55template<typename Coordinate, typename Normals>
│ │ │ │ -
56void write_edge_intersection_normals(const Projection<Coordinate>& projection, const Normals& normals, std::ostream& out)
│ │ │ │ -
57{
│ │ │ │ -
58 using namespace ProjectionImplementation;
│ │ │ │ -
59 using std::get;
│ │ │ │ -
60
│ │ │ │ -
61 for (std::size_t i = 0; i < projection.numberOfEdgeIntersections(); ++i) {
│ │ │ │ -
62 const auto& local = projection.edgeIntersections()[i].local;
│ │ │ │ -
63 const auto n0 = interpolate_unit_normals(local[0], get<0>(normals));
│ │ │ │ -
64 const auto n1 = interpolate_unit_normals(local[1], get<1>(normals));
│ │ │ │ -
65
│ │ │ │ -
66 out << n0 << "\n"
│ │ │ │ -
67 << n1 << "\n";
│ │ │ │ -
68 }
│ │ │ │ -
69}
│ │ │ │ -
70
│ │ │ │ -
71template<unsigned side, typename Coordinate>
│ │ │ │ -
72void write_success(const Projection<Coordinate>& projection, std::ostream& out)
│ │ │ │ -
73{
│ │ │ │ -
74 using std::get;
│ │ │ │ -
75
│ │ │ │ -
76 out << side << "\n";
│ │ │ │ -
77
│ │ │ │ -
78 const auto& success = get<side>(projection.success());
│ │ │ │ -
79 for (std::size_t i = 0; i < success.size(); ++i)
│ │ │ │ -
80 out << (success[i] ? "1\n" : "0\n");
│ │ │ │ -
81}
│ │ │ │ -
82
│ │ │ │ -
83} /* namespace ProjectionWriterImplementation */
│ │ │ │ -
84
│ │ │ │ -
85template<typename Coordinate, typename Corners, typename Normals>
│ │ │ │ -
86void write(const Projection<Coordinate>& projection,
│ │ │ │ -
87 const Corners& corners,
│ │ │ │ -
88 const Normals& normals,
│ │ │ │ -
89 std::ostream& out)
│ │ │ │ -
90{
│ │ │ │ -
91 using namespace ProjectionWriterImplementation;
│ │ │ │ -
92
│ │ │ │ -
93 const auto numberOfEdgeIntersections = projection.numberOfEdgeIntersections();
│ │ │ │ -
94 const auto nPoints = 12 + 2 * numberOfEdgeIntersections;
│ │ │ │ +
10namespace Dune {
│ │ │ │ +
11namespace GridGlue {
│ │ │ │ +
12
│ │ │ │ +
19template<typename Coordinate>
│ │ │ │ + │ │ │ │ +
21{
│ │ │ │ +
22public:
│ │ │ │ + │ │ │ │ +
29 {
│ │ │ │ +
33 std::array<unsigned, 2> edge;
│ │ │ │ +
34
│ │ │ │ +
41 std::array<Coordinate, 2> local;
│ │ │ │ +
42 };
│ │ │ │ +
43
│ │ │ │ +
47 constexpr static unsigned dim = Coordinate::dimension;
│ │ │ │ +
48
│ │ │ │ +
54 constexpr static unsigned maxEdgeIntersections = dim == 3 ? 9 : 0;
│ │ │ │ +
55
│ │ │ │ +
56 static_assert(dim == 2 || dim == 3, "Projection only implemented for dim=2 or dim=3");
│ │ │ │ +
57
│ │ │ │ +
61 typedef typename Coordinate::field_type Field;
│ │ │ │ +
62
│ │ │ │ +
70 typedef std::array<Coordinate, dim> Images;
│ │ │ │ +
71
│ │ │ │ + │ │ │ │ +
79
│ │ │ │ +
80private:
│ │ │ │ +
84 const Field m_overlap;
│ │ │ │ +
85
│ │ │ │ +
94 const Field m_max_normal_product;
│ │ │ │
95
│ │ │ │ -
96 out << "# vtk DataFile Version2.0\n"
│ │ │ │ -
97 << "Filename: projection\n"
│ │ │ │ -
98 << "ASCII\n"
│ │ │ │ -
99 << "DATASET UNSTRUCTURED_GRID\n"
│ │ │ │ -
100 << "POINTS " << nPoints << " double\n";
│ │ │ │ -
101 write_points<0>(projection, corners, out);
│ │ │ │ -
102 write_points<1>(projection, corners, out);
│ │ │ │ -
103 write_edge_intersection_points(projection, corners, out);
│ │ │ │ -
104 out << "CELLS " << (8 + numberOfEdgeIntersections) << " " << (26 + 3 * numberOfEdgeIntersections) << "\n";
│ │ │ │ -
105 out << "3 0 1 2\n" "2 0 3\n" "2 1 4\n" "2 2 5\n"
│ │ │ │ -
106 << "3 6 7 8\n" "2 6 9\n" "2 7 10\n" "2 8 11\n";
│ │ │ │ -
107 for (std::size_t i = 0; i < numberOfEdgeIntersections; ++i)
│ │ │ │ -
108 out << "2 " << (12 + 2*i) << " " << (12 + 2*i + 1) << "\n";
│ │ │ │ -
109 out << "CELL_TYPES " << (8 + numberOfEdgeIntersections) << "\n" "5\n3\n3\n3\n" "5\n3\n3\n3\n";
│ │ │ │ -
110 for (std::size_t i = 0; i < numberOfEdgeIntersections; ++i)
│ │ │ │ -
111 out << "3\n";
│ │ │ │ -
112 out << "CELL_DATA " << (8 + numberOfEdgeIntersections) << "\n";
│ │ │ │ -
113 out << "SCALARS success int 1\n"
│ │ │ │ -
114 << "LOOKUP_TABLE success\n";
│ │ │ │ -
115 write_success<0>(projection, out);
│ │ │ │ -
116 write_success<1>(projection, out);
│ │ │ │ -
117 for (std::size_t i = 0; i < numberOfEdgeIntersections; ++i)
│ │ │ │ -
118 out << "2\n";
│ │ │ │ -
119 out << "LOOKUP_TABLE success 2\n"
│ │ │ │ -
120 << "1.0 0.0 0.0 1.0\n"
│ │ │ │ -
121 << "0.0 1.0 0.0 1.0\n";
│ │ │ │ -
122 out << "POINT_DATA " << nPoints << "\n"
│ │ │ │ -
123 << "NORMALS normals double\n";
│ │ │ │ -
124 write_normals<0>(projection, normals, out);
│ │ │ │ -
125 write_normals<1>(projection, normals, out);
│ │ │ │ -
126 write_edge_intersection_normals(projection, normals, out);
│ │ │ │ -
127}
│ │ │ │ -
128
│ │ │ │ -
129template<typename Coordinate, typename Corners, typename Normals>
│ │ │ │ -
130void write(const Projection<Coordinate>& projection,
│ │ │ │ -
131 const Corners& corners,
│ │ │ │ -
132 const Normals& normals,
│ │ │ │ -
133 const std::string& filename)
│ │ │ │ -
134{
│ │ │ │ -
135 std::ofstream out(filename.c_str());
│ │ │ │ -
136 write(projection, corners, normals, out);
│ │ │ │ -
137}
│ │ │ │ -
138
│ │ │ │ -
139template<typename Coordinate, typename Corners, typename Normals>
│ │ │ │ -
140void print(const Projection<Coordinate>& projection,
│ │ │ │ -
141 const Corners& corners,
│ │ │ │ -
142 const Normals& normals)
│ │ │ │ -
143{
│ │ │ │ -
144 using namespace ProjectionWriterImplementation;
│ │ │ │ -
145
│ │ │ │ -
146 std::cout << "Side 0 corners and images:\n";
│ │ │ │ -
147 write_points<0>(projection, corners, std::cout);
│ │ │ │ -
148 std::cout << "Side 0 success:\n";
│ │ │ │ -
149 write_success<0>(projection, std::cout);
│ │ │ │ -
150 std::cout << "Side 1 corners and images:\n";
│ │ │ │ -
151 write_points<1>(projection, corners, std::cout);
│ │ │ │ -
152 std::cout << "Side 1 success:\n";
│ │ │ │ -
153 write_success<1>(projection, std::cout);
│ │ │ │ -
154 std::cout << "Side 0 normals and projected normals:\n";
│ │ │ │ -
155 write_normals<0>(projection, normals, std::cout);
│ │ │ │ -
156 std::cout << "Side 1 normals and projected normals:\n";
│ │ │ │ -
157 write_normals<1>(projection, normals, std::cout);
│ │ │ │ -
158 std::cout << projection.numberOfEdgeIntersections() << " edge intersections:\n";
│ │ │ │ -
159 write_edge_intersection_points(projection, corners, std::cout);
│ │ │ │ -
160}
│ │ │ │ -
161
│ │ │ │ -
162} /* namespace GridGlue */
│ │ │ │ -
163} /* namespace Dune */
│ │ │ │ +
101 Field m_epsilon = Field(1e-12);
│ │ │ │ +
102
│ │ │ │ +
104 std::tuple<Images, Preimages> m_images;
│ │ │ │ +
105
│ │ │ │ +
107 std::tuple<std::bitset<dim>, std::bitset<dim> > m_success;
│ │ │ │ +
108
│ │ │ │ +
110 unsigned m_number_of_edge_intersections;
│ │ │ │ +
111
│ │ │ │ +
113 std::array<EdgeIntersection, maxEdgeIntersections> m_edge_intersections;
│ │ │ │ +
114
│ │ │ │ +
126 bool m_projection_valid;
│ │ │ │ +
127
│ │ │ │ +
133 template<typename Corners, typename Normals>
│ │ │ │ +
134 void doProjection(const std::tuple<Corners&, Corners&>& corners, const std::tuple<Normals&, Normals&>& normals);
│ │ │ │ +
135
│ │ │ │ +
144 template<typename Corners, typename Normals>
│ │ │ │ +
145 void doInverseProjection(const std::tuple<Corners&, Corners&>& corners, const std::tuple<Normals&, Normals&>& normals);
│ │ │ │ +
146
│ │ │ │ +
155 template<typename Corners, typename Normals>
│ │ │ │ +
156 void doEdgeIntersection(const std::tuple<Corners&, Corners&>& corners, const std::tuple<Normals&, Normals&>& normals);
│ │ │ │ +
157
│ │ │ │ +
183 template<typename Corners, typename Normals>
│ │ │ │ +
184 inline bool projectionFeasible(const Coordinate& x, const Coordinate& nx, const Coordinate& px, const Corners& corners, const Normals& normals) const;
│ │ │ │ +
185
│ │ │ │ +
186public:
│ │ │ │ +
191 Projection(const Field overlap = Field(0), const Field max_normal_product = Field(-0.1));
│ │ │ │ +
192
│ │ │ │ +
198 void epsilon(const Field epsilon);
│ │ │ │ +
199
│ │ │ │ +
212 template<typename Corners, typename Normals>
│ │ │ │ +
213 void project(const std::tuple<Corners&, Corners&>& corners, const std::tuple<Normals&, Normals&>& normals);
│ │ │ │ +
214
│ │ │ │ +
235 const std::tuple<Images, Preimages>& images() const
│ │ │ │ +
236 { return m_images; }
│ │ │ │ +
237
│ │ │ │ +
252 const std::tuple<std::bitset<dim>, std::bitset<dim> >& success() const
│ │ │ │ +
253 { return m_success; }
│ │ │ │ +
254
│ │ │ │ + │ │ │ │ +
263 { return m_number_of_edge_intersections; }
│ │ │ │ +
264
│ │ │ │ +
273 const std::array<EdgeIntersection, maxEdgeIntersections>& edgeIntersections() const
│ │ │ │ +
274 { return m_edge_intersections; }
│ │ │ │ +
275};
│ │ │ │ +
276
│ │ │ │ +
277} /* namespace GridGlue */
│ │ │ │ +
278} /* namespace Dune */
│ │ │ │ +
279
│ │ │ │ +
280#include "projection_impl.hh"
│ │ │ │ +
281
│ │ │ │ +
282#endif
│ │ │ │ + │ │ │ │
Definition: gridglue.hh:37
│ │ │ │ -
void write(const Projection< Coordinate > &projection, const Corners &corners, const Normals &normals, std::ostream &out)
write projection in VTK format
Definition: projectionwriter_impl.hh:86
│ │ │ │ -
void print(const Projection< Coordinate > &projection, const Corners &corners, const Normals &normals)
Print information about the projection to std::cout stream.
Definition: projectionwriter_impl.hh:140
│ │ │ │ -
Corners::value_type interpolate(const Coordinate &x, const Corners &corners)
Definition: projection_impl.hh:70
│ │ │ │ -
Normals::value_type interpolate_unit_normals(const Coordinate &x, const Normals &normals)
Definition: projection_impl.hh:91
│ │ │ │ -
void write_normals(const Projection< Coordinate > &projection, const Normals &normals, std::ostream &out)
Definition: projectionwriter_impl.hh:27
│ │ │ │ -
void write_points(const Projection< Coordinate > &projection, const Corners &corners, std::ostream &out)
Definition: projectionwriter_impl.hh:11
│ │ │ │ -
void write_success(const Projection< Coordinate > &projection, std::ostream &out)
Definition: projectionwriter_impl.hh:72
│ │ │ │ -
void write_edge_intersection_points(const Projection< Coordinate > &projection, const Corners &corners, std::ostream &out)
Definition: projectionwriter_impl.hh:43
│ │ │ │ -
void write_edge_intersection_normals(const Projection< Coordinate > &projection, const Normals &normals, std::ostream &out)
Definition: projectionwriter_impl.hh:56
│ │ │ │
Projection of a line (triangle) on another line (triangle).
Definition: projection.hh:21
│ │ │ │ +
Coordinate::field_type Field
Scalar type.
Definition: projection.hh:61
│ │ │ │ +
Projection(const Field overlap=Field(0), const Field max_normal_product=Field(-0.1))
Definition: projection_impl.hh:130
│ │ │ │
const std::tuple< std::bitset< dim >, std::bitset< dim > > & success() const
Indicate whether projection (inverse projection) is valid for each corner or not.
Definition: projection.hh:252
│ │ │ │ +
static constexpr unsigned maxEdgeIntersections
maximum number of edge-edge intersections
Definition: projection.hh:54
│ │ │ │ +
Images Preimages
Definition: projection.hh:78
│ │ │ │ +
std::array< Coordinate, dim > Images
List of corner images.
Definition: projection.hh:70
│ │ │ │ +
void epsilon(const Field epsilon)
Set epsilon used for floating-point comparisons.
Definition: projection_impl.hh:140
│ │ │ │ +
void project(const std::tuple< Corners &, Corners & > &corners, const std::tuple< Normals &, Normals & > &normals)
Do the actual projection.
Definition: projection_impl.hh:469
│ │ │ │ +
static constexpr unsigned dim
dimension of coordinates
Definition: projection.hh:47
│ │ │ │
unsigned numberOfEdgeIntersections() const
Number of edge intersections.
Definition: projection.hh:262
│ │ │ │
const std::tuple< Images, Preimages > & images() const
Images and preimages of corners.
Definition: projection.hh:235
│ │ │ │
const std::array< EdgeIntersection, maxEdgeIntersections > & edgeIntersections() const
Edge-edge intersections.
Definition: projection.hh:273
│ │ │ │ +
Intersection between two edges of a triangle.
Definition: projection.hh:29
│ │ │ │ +
std::array< Coordinate, 2 > local
Local coordinates of intersection and distance along normals.
Definition: projection.hh:41
│ │ │ │ +
std::array< unsigned, 2 > edge
Edge numbers in image and preimage triangle.
Definition: projection.hh:33
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,246 +5,180 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * common │ │ │ │ │ -projectionwriter_impl.hh │ │ │ │ │ +projection.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 2// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only- │ │ │ │ │ with-dune-grid-glue-exception │ │ │ │ │ - 3#include │ │ │ │ │ - 4 │ │ │ │ │ - 5namespace Dune { │ │ │ │ │ - 6namespace GridGlue { │ │ │ │ │ - 7 │ │ │ │ │ -8namespace ProjectionWriterImplementation { │ │ │ │ │ + 3#ifndef DUNE_GRIDGLUE_COMMON_PROJECTIONHELPER2_HH │ │ │ │ │ + 4#define DUNE_GRIDGLUE_COMMON_PROJECTIONHELPER2_HH │ │ │ │ │ + 5 │ │ │ │ │ + 6#include │ │ │ │ │ + 7#include │ │ │ │ │ + 8#include │ │ │ │ │ 9 │ │ │ │ │ - 10template │ │ │ │ │ -11void write_points(const Projection& projection, const Corners& │ │ │ │ │ -corners, std::ostream& out) │ │ │ │ │ - 12{ │ │ │ │ │ - 13 using namespace ProjectionImplementation; │ │ │ │ │ - 14 using std::get; │ │ │ │ │ - 15 const unsigned other_side = 1 - side; │ │ │ │ │ - 16 │ │ │ │ │ - 17 for (const auto& c : get(corners)) │ │ │ │ │ - 18 out << c << "\n"; │ │ │ │ │ - 19 │ │ │ │ │ - 20 for (const auto& i : get(projection.images())) { │ │ │ │ │ - 21 const auto global = interpolate(i, get(corners)); │ │ │ │ │ - 22 out << global << "\n"; │ │ │ │ │ - 23 } │ │ │ │ │ - 24} │ │ │ │ │ - 25 │ │ │ │ │ - 26template │ │ │ │ │ -27void write_normals(const Projection& projection, const Normals& │ │ │ │ │ -normals, std::ostream& out) │ │ │ │ │ - 28{ │ │ │ │ │ - 29 using namespace ProjectionImplementation; │ │ │ │ │ - 30 using std::get; │ │ │ │ │ - 31 const unsigned other_side = 1 - side; │ │ │ │ │ - 32 │ │ │ │ │ - 33 for (const auto& n : get(normals)) │ │ │ │ │ - 34 out << n << "\n"; │ │ │ │ │ - 35 │ │ │ │ │ - 36 for (const auto& x : get(projection.images())) { │ │ │ │ │ - 37 const auto n = interpolate_unit_normals(x, get(normals)); │ │ │ │ │ - 38 out << n << "\n"; │ │ │ │ │ - 39 } │ │ │ │ │ - 40} │ │ │ │ │ - 41 │ │ │ │ │ - 42template │ │ │ │ │ -43void write_edge_intersection_points(const Projection& projection, │ │ │ │ │ -const Corners& corners, std::ostream& out) │ │ │ │ │ - 44{ │ │ │ │ │ - 45 using namespace ProjectionImplementation; │ │ │ │ │ - 46 using std::get; │ │ │ │ │ - 47 │ │ │ │ │ - 48 for (std::size_t i = 0; i < projection.numberOfEdgeIntersections(); ++i) { │ │ │ │ │ - 49 const auto& local = projection.edgeIntersections()[i].local; │ │ │ │ │ - 50 out << interpolate(local[0], get<0>(corners)) << "\n" │ │ │ │ │ - 51 << interpolate(local[1], get<1>(corners)) << "\n"; │ │ │ │ │ - 52 } │ │ │ │ │ - 53} │ │ │ │ │ - 54 │ │ │ │ │ - 55template │ │ │ │ │ -56void write_edge_intersection_normals(const Projection& │ │ │ │ │ -projection, const Normals& normals, std::ostream& out) │ │ │ │ │ - 57{ │ │ │ │ │ - 58 using namespace ProjectionImplementation; │ │ │ │ │ - 59 using std::get; │ │ │ │ │ - 60 │ │ │ │ │ - 61 for (std::size_t i = 0; i < projection.numberOfEdgeIntersections(); ++i) { │ │ │ │ │ - 62 const auto& local = projection.edgeIntersections()[i].local; │ │ │ │ │ - 63 const auto n0 = interpolate_unit_normals(local[0], get<0>(normals)); │ │ │ │ │ - 64 const auto n1 = interpolate_unit_normals(local[1], get<1>(normals)); │ │ │ │ │ - 65 │ │ │ │ │ - 66 out << n0 << "\n" │ │ │ │ │ - 67 << n1 << "\n"; │ │ │ │ │ - 68 } │ │ │ │ │ - 69} │ │ │ │ │ - 70 │ │ │ │ │ - 71template │ │ │ │ │ -72void write_success(const Projection& projection, std::ostream& │ │ │ │ │ -out) │ │ │ │ │ - 73{ │ │ │ │ │ - 74 using std::get; │ │ │ │ │ - 75 │ │ │ │ │ - 76 out << side << "\n"; │ │ │ │ │ - 77 │ │ │ │ │ - 78 const auto& success = get(projection.success()); │ │ │ │ │ - 79 for (std::size_t i = 0; i < success.size(); ++i) │ │ │ │ │ - 80 out << (success[i] ? "1\n" : "0\n"); │ │ │ │ │ - 81} │ │ │ │ │ - 82 │ │ │ │ │ - 83} /* namespace ProjectionWriterImplementation */ │ │ │ │ │ - 84 │ │ │ │ │ - 85template │ │ │ │ │ -86void write(const Projection& projection, │ │ │ │ │ - 87 const Corners& corners, │ │ │ │ │ - 88 const Normals& normals, │ │ │ │ │ - 89 std::ostream& out) │ │ │ │ │ - 90{ │ │ │ │ │ - 91 using namespace ProjectionWriterImplementation; │ │ │ │ │ - 92 │ │ │ │ │ - 93 const auto numberOfEdgeIntersections = projection.numberOfEdgeIntersections │ │ │ │ │ -(); │ │ │ │ │ - 94 const auto nPoints = 12 + 2 * numberOfEdgeIntersections; │ │ │ │ │ + 10namespace Dune { │ │ │ │ │ + 11namespace GridGlue { │ │ │ │ │ + 12 │ │ │ │ │ + 19template │ │ │ │ │ +20class Projection │ │ │ │ │ + 21{ │ │ │ │ │ + 22public: │ │ │ │ │ +28 struct EdgeIntersection │ │ │ │ │ + 29 { │ │ │ │ │ +33 std::array edge; │ │ │ │ │ + 34 │ │ │ │ │ +41 std::array local; │ │ │ │ │ + 42 }; │ │ │ │ │ + 43 │ │ │ │ │ +47 constexpr static unsigned dim = Coordinate::dimension; │ │ │ │ │ + 48 │ │ │ │ │ +54 constexpr static unsigned maxEdgeIntersections = dim == 3 ? 9 : 0; │ │ │ │ │ + 55 │ │ │ │ │ + 56 static_assert(dim == 2 || dim == 3, "Projection only implemented for dim=2 │ │ │ │ │ +or dim=3"); │ │ │ │ │ + 57 │ │ │ │ │ +61 typedef typename Coordinate::field_type Field; │ │ │ │ │ + 62 │ │ │ │ │ +70 typedef std::array Images; │ │ │ │ │ + 71 │ │ │ │ │ +78 typedef Images Preimages; │ │ │ │ │ + 79 │ │ │ │ │ + 80private: │ │ │ │ │ + 84 const Field m_overlap; │ │ │ │ │ + 85 │ │ │ │ │ + 94 const Field m_max_normal_product; │ │ │ │ │ 95 │ │ │ │ │ - 96 out << "# vtk DataFile Version2.0\n" │ │ │ │ │ - 97 << "Filename: projection\n" │ │ │ │ │ - 98 << "ASCII\n" │ │ │ │ │ - 99 << "DATASET UNSTRUCTURED_GRID\n" │ │ │ │ │ - 100 << "POINTS " << nPoints << " double\n"; │ │ │ │ │ - 101 write_points<0>(projection, corners, out); │ │ │ │ │ - 102 write_points<1>(projection, corners, out); │ │ │ │ │ - 103 write_edge_intersection_points(projection, corners, out); │ │ │ │ │ - 104 out << "CELLS " << (8 + numberOfEdgeIntersections) << " " << (26 + 3 * │ │ │ │ │ -numberOfEdgeIntersections) << "\n"; │ │ │ │ │ - 105 out << "3 0 1 2\n" "2 0 3\n" "2 1 4\n" "2 2 5\n" │ │ │ │ │ - 106 << "3 6 7 8\n" "2 6 9\n" "2 7 10\n" "2 8 11\n"; │ │ │ │ │ - 107 for (std::size_t i = 0; i < numberOfEdgeIntersections; ++i) │ │ │ │ │ - 108 out << "2 " << (12 + 2*i) << " " << (12 + 2*i + 1) << "\n"; │ │ │ │ │ - 109 out << "CELL_TYPES " << (8 + numberOfEdgeIntersections) << "\n" │ │ │ │ │ -"5\n3\n3\n3\n" "5\n3\n3\n3\n"; │ │ │ │ │ - 110 for (std::size_t i = 0; i < numberOfEdgeIntersections; ++i) │ │ │ │ │ - 111 out << "3\n"; │ │ │ │ │ - 112 out << "CELL_DATA " << (8 + numberOfEdgeIntersections) << "\n"; │ │ │ │ │ - 113 out << "SCALARS success int 1\n" │ │ │ │ │ - 114 << "LOOKUP_TABLE success\n"; │ │ │ │ │ - 115 write_success<0>(projection, out); │ │ │ │ │ - 116 write_success<1>(projection, out); │ │ │ │ │ - 117 for (std::size_t i = 0; i < numberOfEdgeIntersections; ++i) │ │ │ │ │ - 118 out << "2\n"; │ │ │ │ │ - 119 out << "LOOKUP_TABLE success 2\n" │ │ │ │ │ - 120 << "1.0 0.0 0.0 1.0\n" │ │ │ │ │ - 121 << "0.0 1.0 0.0 1.0\n"; │ │ │ │ │ - 122 out << "POINT_DATA " << nPoints << "\n" │ │ │ │ │ - 123 << "NORMALS normals double\n"; │ │ │ │ │ - 124 write_normals<0>(projection, normals, out); │ │ │ │ │ - 125 write_normals<1>(projection, normals, out); │ │ │ │ │ - 126 write_edge_intersection_normals(projection, normals, out); │ │ │ │ │ - 127} │ │ │ │ │ - 128 │ │ │ │ │ - 129template │ │ │ │ │ -130void write(const Projection& projection, │ │ │ │ │ - 131 const Corners& corners, │ │ │ │ │ - 132 const Normals& normals, │ │ │ │ │ - 133 const std::string& filename) │ │ │ │ │ - 134{ │ │ │ │ │ - 135 std::ofstream out(filename.c_str()); │ │ │ │ │ - 136 write(projection, corners, normals, out); │ │ │ │ │ - 137} │ │ │ │ │ - 138 │ │ │ │ │ - 139template │ │ │ │ │ -140void print(const Projection& projection, │ │ │ │ │ - 141 const Corners& corners, │ │ │ │ │ - 142 const Normals& normals) │ │ │ │ │ - 143{ │ │ │ │ │ - 144 using namespace ProjectionWriterImplementation; │ │ │ │ │ - 145 │ │ │ │ │ - 146 std::cout << "Side 0 corners and images:\n"; │ │ │ │ │ - 147 write_points<0>(projection, corners, std::cout); │ │ │ │ │ - 148 std::cout << "Side 0 success:\n"; │ │ │ │ │ - 149 write_success<0>(projection, std::cout); │ │ │ │ │ - 150 std::cout << "Side 1 corners and images:\n"; │ │ │ │ │ - 151 write_points<1>(projection, corners, std::cout); │ │ │ │ │ - 152 std::cout << "Side 1 success:\n"; │ │ │ │ │ - 153 write_success<1>(projection, std::cout); │ │ │ │ │ - 154 std::cout << "Side 0 normals and projected normals:\n"; │ │ │ │ │ - 155 write_normals<0>(projection, normals, std::cout); │ │ │ │ │ - 156 std::cout << "Side 1 normals and projected normals:\n"; │ │ │ │ │ - 157 write_normals<1>(projection, normals, std::cout); │ │ │ │ │ - 158 std::cout << projection.numberOfEdgeIntersections() << " edge │ │ │ │ │ -intersections:\n"; │ │ │ │ │ - 159 write_edge_intersection_points(projection, corners, std::cout); │ │ │ │ │ - 160} │ │ │ │ │ - 161 │ │ │ │ │ - 162} /* namespace GridGlue */ │ │ │ │ │ - 163} /* namespace Dune */ │ │ │ │ │ + 101 Field m_epsilon = Field(1e-12); │ │ │ │ │ + 102 │ │ │ │ │ + 104 std::tuple m_images; │ │ │ │ │ + 105 │ │ │ │ │ + 107 std::tuple, std::bitset > m_success; │ │ │ │ │ + 108 │ │ │ │ │ + 110 unsigned m_number_of_edge_intersections; │ │ │ │ │ + 111 │ │ │ │ │ + 113 std::array m_edge_intersections; │ │ │ │ │ + 114 │ │ │ │ │ + 126 bool m_projection_valid; │ │ │ │ │ + 127 │ │ │ │ │ + 133 template │ │ │ │ │ + 134 void doProjection(const std::tuple& corners, const │ │ │ │ │ +std::tuple& normals); │ │ │ │ │ + 135 │ │ │ │ │ + 144 template │ │ │ │ │ + 145 void doInverseProjection(const std::tuple& corners, │ │ │ │ │ +const std::tuple& normals); │ │ │ │ │ + 146 │ │ │ │ │ + 155 template │ │ │ │ │ + 156 void doEdgeIntersection(const std::tuple& corners, │ │ │ │ │ +const std::tuple& normals); │ │ │ │ │ + 157 │ │ │ │ │ + 183 template │ │ │ │ │ + 184 inline bool projectionFeasible(const Coordinate& x, const Coordinate& nx, │ │ │ │ │ +const Coordinate& px, const Corners& corners, const Normals& normals) const; │ │ │ │ │ + 185 │ │ │ │ │ + 186public: │ │ │ │ │ + 191 Projection(const Field overlap = Field(0), const Field max_normal_product │ │ │ │ │ += Field(-0.1)); │ │ │ │ │ + 192 │ │ │ │ │ + 198 void epsilon(const Field epsilon); │ │ │ │ │ + 199 │ │ │ │ │ + 212 template │ │ │ │ │ + 213 void project(const std::tuple& corners, const std:: │ │ │ │ │ +tuple& normals); │ │ │ │ │ + 214 │ │ │ │ │ +235 const std::tuple& images() const │ │ │ │ │ + 236 { return m_images; } │ │ │ │ │ + 237 │ │ │ │ │ +252 const std::tuple, std::bitset >& success() const │ │ │ │ │ + 253 { return m_success; } │ │ │ │ │ + 254 │ │ │ │ │ +262 unsigned numberOfEdgeIntersections() const │ │ │ │ │ + 263 { return m_number_of_edge_intersections; } │ │ │ │ │ + 264 │ │ │ │ │ +273 const std::array& edgeIntersections │ │ │ │ │ +() const │ │ │ │ │ + 274 { return m_edge_intersections; } │ │ │ │ │ + 275}; │ │ │ │ │ + 276 │ │ │ │ │ + 277} /* namespace GridGlue */ │ │ │ │ │ + 278} /* namespace Dune */ │ │ │ │ │ + 279 │ │ │ │ │ + 280#include "projection_impl.hh" │ │ │ │ │ + 281 │ │ │ │ │ + 282#endif │ │ │ │ │ +projection_impl.hh │ │ │ │ │ Dune │ │ │ │ │ Definition: gridglue.hh:37 │ │ │ │ │ -Dune::GridGlue::write │ │ │ │ │ -void write(const Projection< Coordinate > &projection, const Corners &corners, │ │ │ │ │ -const Normals &normals, std::ostream &out) │ │ │ │ │ -write projection in VTK format │ │ │ │ │ -Definition: projectionwriter_impl.hh:86 │ │ │ │ │ -Dune::GridGlue::print │ │ │ │ │ -void print(const Projection< Coordinate > &projection, const Corners &corners, │ │ │ │ │ -const Normals &normals) │ │ │ │ │ -Print information about the projection to std::cout stream. │ │ │ │ │ -Definition: projectionwriter_impl.hh:140 │ │ │ │ │ -Dune::GridGlue::ProjectionImplementation::interpolate │ │ │ │ │ -Corners::value_type interpolate(const Coordinate &x, const Corners &corners) │ │ │ │ │ -Definition: projection_impl.hh:70 │ │ │ │ │ -Dune::GridGlue::ProjectionImplementation::interpolate_unit_normals │ │ │ │ │ -Normals::value_type interpolate_unit_normals(const Coordinate &x, const Normals │ │ │ │ │ -&normals) │ │ │ │ │ -Definition: projection_impl.hh:91 │ │ │ │ │ -Dune::GridGlue::ProjectionWriterImplementation::write_normals │ │ │ │ │ -void write_normals(const Projection< Coordinate > &projection, const Normals │ │ │ │ │ -&normals, std::ostream &out) │ │ │ │ │ -Definition: projectionwriter_impl.hh:27 │ │ │ │ │ -Dune::GridGlue::ProjectionWriterImplementation::write_points │ │ │ │ │ -void write_points(const Projection< Coordinate > &projection, const Corners │ │ │ │ │ -&corners, std::ostream &out) │ │ │ │ │ -Definition: projectionwriter_impl.hh:11 │ │ │ │ │ -Dune::GridGlue::ProjectionWriterImplementation::write_success │ │ │ │ │ -void write_success(const Projection< Coordinate > &projection, std::ostream │ │ │ │ │ -&out) │ │ │ │ │ -Definition: projectionwriter_impl.hh:72 │ │ │ │ │ -Dune::GridGlue::ProjectionWriterImplementation::write_edge_intersection_points │ │ │ │ │ -void write_edge_intersection_points(const Projection< Coordinate > &projection, │ │ │ │ │ -const Corners &corners, std::ostream &out) │ │ │ │ │ -Definition: projectionwriter_impl.hh:43 │ │ │ │ │ -Dune::GridGlue::ProjectionWriterImplementation::write_edge_intersection_normals │ │ │ │ │ -void write_edge_intersection_normals(const Projection< Coordinate > │ │ │ │ │ -&projection, const Normals &normals, std::ostream &out) │ │ │ │ │ -Definition: projectionwriter_impl.hh:56 │ │ │ │ │ Dune::GridGlue::Projection │ │ │ │ │ Projection of a line (triangle) on another line (triangle). │ │ │ │ │ Definition: projection.hh:21 │ │ │ │ │ +Dune::GridGlue::Projection::Field │ │ │ │ │ +Coordinate::field_type Field │ │ │ │ │ +Scalar type. │ │ │ │ │ +Definition: projection.hh:61 │ │ │ │ │ +Dune::GridGlue::Projection::Projection │ │ │ │ │ +Projection(const Field overlap=Field(0), const Field max_normal_product=Field(- │ │ │ │ │ +0.1)) │ │ │ │ │ +Definition: projection_impl.hh:130 │ │ │ │ │ Dune::GridGlue::Projection::success │ │ │ │ │ const std::tuple< std::bitset< dim >, std::bitset< dim > > & success() const │ │ │ │ │ Indicate whether projection (inverse projection) is valid for each corner or │ │ │ │ │ not. │ │ │ │ │ Definition: projection.hh:252 │ │ │ │ │ +Dune::GridGlue::Projection::maxEdgeIntersections │ │ │ │ │ +static constexpr unsigned maxEdgeIntersections │ │ │ │ │ +maximum number of edge-edge intersections │ │ │ │ │ +Definition: projection.hh:54 │ │ │ │ │ +Dune::GridGlue::Projection::Preimages │ │ │ │ │ +Images Preimages │ │ │ │ │ +Definition: projection.hh:78 │ │ │ │ │ +Dune::GridGlue::Projection::Images │ │ │ │ │ +std::array< Coordinate, dim > Images │ │ │ │ │ +List of corner images. │ │ │ │ │ +Definition: projection.hh:70 │ │ │ │ │ +Dune::GridGlue::Projection::epsilon │ │ │ │ │ +void epsilon(const Field epsilon) │ │ │ │ │ +Set epsilon used for floating-point comparisons. │ │ │ │ │ +Definition: projection_impl.hh:140 │ │ │ │ │ +Dune::GridGlue::Projection::project │ │ │ │ │ +void project(const std::tuple< Corners &, Corners & > &corners, const std:: │ │ │ │ │ +tuple< Normals &, Normals & > &normals) │ │ │ │ │ +Do the actual projection. │ │ │ │ │ +Definition: projection_impl.hh:469 │ │ │ │ │ +Dune::GridGlue::Projection::dim │ │ │ │ │ +static constexpr unsigned dim │ │ │ │ │ +dimension of coordinates │ │ │ │ │ +Definition: projection.hh:47 │ │ │ │ │ Dune::GridGlue::Projection::numberOfEdgeIntersections │ │ │ │ │ unsigned numberOfEdgeIntersections() const │ │ │ │ │ Number of edge intersections. │ │ │ │ │ Definition: projection.hh:262 │ │ │ │ │ Dune::GridGlue::Projection::images │ │ │ │ │ const std::tuple< Images, Preimages > & images() const │ │ │ │ │ Images and preimages of corners. │ │ │ │ │ Definition: projection.hh:235 │ │ │ │ │ Dune::GridGlue::Projection::edgeIntersections │ │ │ │ │ const std::array< EdgeIntersection, maxEdgeIntersections > & edgeIntersections │ │ │ │ │ () const │ │ │ │ │ Edge-edge intersections. │ │ │ │ │ Definition: projection.hh:273 │ │ │ │ │ +Dune::GridGlue::Projection::EdgeIntersection │ │ │ │ │ +Intersection between two edges of a triangle. │ │ │ │ │ +Definition: projection.hh:29 │ │ │ │ │ +Dune::GridGlue::Projection::EdgeIntersection::local │ │ │ │ │ +std::array< Coordinate, 2 > local │ │ │ │ │ +Local coordinates of intersection and distance along normals. │ │ │ │ │ +Definition: projection.hh:41 │ │ │ │ │ +Dune::GridGlue::Projection::EdgeIntersection::edge │ │ │ │ │ +std::array< unsigned, 2 > edge │ │ │ │ │ +Edge numbers in image and preimage triangle. │ │ │ │ │ +Definition: projection.hh:33 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00035.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: crossproduct.hh File Reference │ │ │ │ +dune-grid-glue: projectionwriter.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,33 +65,45 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Namespaces | │ │ │ │ Functions
│ │ │ │ -
crossproduct.hh File Reference
│ │ │ │ +
projectionwriter.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ - │ │ │ │ +
#include <iostream>
│ │ │ │ +#include <string>
│ │ │ │ +#include <dune/grid-glue/common/projection.hh>
│ │ │ │ +#include "projectionwriter_impl.hh"
│ │ │ │ +
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ Functions

template<class T , int dim>
static Dune::FieldVector< T, dim > Dune::GridGlue::crossProduct (const Dune::FieldVector< T, dim > &a, const Dune::FieldVector< T, dim > &b)
 compute cross product More...
 
template<typename Coordinate , typename Corners , typename Normals >
void Dune::GridGlue::write (const Projection< Coordinate > &projection, const Corners &corners, const Normals &normals, std::ostream &out)
 write projection in VTK format More...
 
template<typename Coordinate , typename Corners , typename Normals >
void Dune::GridGlue::write (const Projection< Coordinate > &projection, const Corners &corners, const Normals &normals, const std::string &filename)
 write projection in VTK format More...
 
template<typename Coordinate , typename Corners , typename Normals >
void Dune::GridGlue::print (const Projection< Coordinate > &projection, const Corners &corners, const Normals &normals)
 Print information about the projection to std::cout stream. More...
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -6,24 +6,37 @@ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * common │ │ │ │ │ Namespaces | Functions │ │ │ │ │ -crossproduct.hh File Reference │ │ │ │ │ +projectionwriter.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include "projectionwriter_impl.hh" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::GridGlue │ │ │ │ │   │ │ │ │ │ Functions │ │ │ │ │ -template │ │ │ │ │ -static Dune::FieldVector< T, dim > Dune::GridGlue::crossProduct (const Dune:: │ │ │ │ │ - FieldVector< T, dim > &a, const Dune:: │ │ │ │ │ - FieldVector< T, dim > &b) │ │ │ │ │ -  compute cross product More... │ │ │ │ │ +template │ │ │ │ │ +void Dune::GridGlue::write (const Projection< Coordinate > &projection, const │ │ │ │ │ + Corners &corners, const Normals &normals, std::ostream &out) │ │ │ │ │ +  write projection in VTK format More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +void Dune::GridGlue::write (const Projection< Coordinate > &projection, const │ │ │ │ │ + Corners &corners, const Normals &normals, const std::string &filename) │ │ │ │ │ +  write projection in VTK format More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +void Dune::GridGlue::print (const Projection< Coordinate > &projection, const │ │ │ │ │ + Corners &corners, const Normals &normals) │ │ │ │ │ +  Print information about the projection to std::cout stream. More... │ │ │ │ │   │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00035_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: crossproduct.hh Source File │ │ │ │ +dune-grid-glue: projectionwriter.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,46 +62,57 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
crossproduct.hh
│ │ │ │ +
projectionwriter.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
2// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
│ │ │ │ -
3#ifndef DUNE_GRIDGLUE_COMMON_CROSSPRODUCT_HH
│ │ │ │ -
4#define DUNE_GRIDGLUE_COMMON_CROSSPRODUCT_HH 1
│ │ │ │ +
3#ifndef DUNE_GRIDGLUE_COMMON_PROJECTIONWRITER_HH
│ │ │ │ +
4#define DUNE_GRIDGLUE_COMMON_PROJECTIONWRITER_HH
│ │ │ │
5
│ │ │ │ -
6namespace Dune {
│ │ │ │ -
7namespace GridGlue {
│ │ │ │ +
6#include <iostream>
│ │ │ │ +
7#include <string>
│ │ │ │
8
│ │ │ │ -
14template <class T, int dim>
│ │ │ │ -
15static Dune::FieldVector<T,dim> crossProduct(const Dune::FieldVector<T,dim>& a,
│ │ │ │ -
16 const Dune::FieldVector<T,dim>& b)
│ │ │ │ -
17{
│ │ │ │ -
18 if (dim!=3)
│ │ │ │ -
19 DUNE_THROW(Dune::NotImplemented, "crossProduct does not work for dimension " << dim);
│ │ │ │ -
20
│ │ │ │ -
21 Dune::FieldVector<T,dim> c;
│ │ │ │ -
22 c[0] = a[1]*b[2] - a[2]*b[1];
│ │ │ │ -
23 c[1] = a[2]*b[0] - a[0]*b[2];
│ │ │ │ -
24 c[2] = a[0]*b[1] - a[1]*b[0];
│ │ │ │ -
25
│ │ │ │ -
26 return c;
│ │ │ │ -
27}
│ │ │ │ -
28
│ │ │ │ -
29} /* namespace GridGlue */
│ │ │ │ -
30} /* namespace Dune */
│ │ │ │ -
31
│ │ │ │ -
32#endif
│ │ │ │ + │ │ │ │ +
10
│ │ │ │ +
11namespace Dune {
│ │ │ │ +
12namespace GridGlue {
│ │ │ │ +
13
│ │ │ │ +
28template<typename Coordinate, typename Corners, typename Normals>
│ │ │ │ +
29void write(const Projection<Coordinate>& projection,
│ │ │ │ +
30 const Corners& corners,
│ │ │ │ +
31 const Normals& normals,
│ │ │ │ +
32 std::ostream& out);
│ │ │ │ +
33
│ │ │ │ +
40template<typename Coordinate, typename Corners, typename Normals>
│ │ │ │ +
41void write(const Projection<Coordinate>& projection,
│ │ │ │ +
42 const Corners& corners,
│ │ │ │ +
43 const Normals& normals,
│ │ │ │ +
44 const std::string& filename);
│ │ │ │ +
54template<typename Coordinate, typename Corners, typename Normals>
│ │ │ │ +
55void print(const Projection<Coordinate>& projection,
│ │ │ │ +
56 const Corners& corners,
│ │ │ │ +
57 const Normals& normals);
│ │ │ │ +
58
│ │ │ │ +
59} /* namespace GridGlue */
│ │ │ │ +
60} /* namespace Dune */
│ │ │ │ +
61
│ │ │ │ + │ │ │ │ +
63
│ │ │ │ +
64#endif
│ │ │ │ + │ │ │ │ + │ │ │ │
Definition: gridglue.hh:37
│ │ │ │ -
static Dune::FieldVector< T, dim > crossProduct(const Dune::FieldVector< T, dim > &a, const Dune::FieldVector< T, dim > &b)
compute cross product
Definition: crossproduct.hh:15
│ │ │ │ +
void write(const Projection< Coordinate > &projection, const Corners &corners, const Normals &normals, std::ostream &out)
write projection in VTK format
Definition: projectionwriter_impl.hh:86
│ │ │ │ +
void print(const Projection< Coordinate > &projection, const Corners &corners, const Normals &normals)
Print information about the projection to std::cout stream.
Definition: projectionwriter_impl.hh:140
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,50 +5,63 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * common │ │ │ │ │ -crossproduct.hh │ │ │ │ │ +projectionwriter.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 2// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only- │ │ │ │ │ with-dune-grid-glue-exception │ │ │ │ │ - 3#ifndef DUNE_GRIDGLUE_COMMON_CROSSPRODUCT_HH │ │ │ │ │ - 4#define DUNE_GRIDGLUE_COMMON_CROSSPRODUCT_HH 1 │ │ │ │ │ + 3#ifndef DUNE_GRIDGLUE_COMMON_PROJECTIONWRITER_HH │ │ │ │ │ + 4#define DUNE_GRIDGLUE_COMMON_PROJECTIONWRITER_HH │ │ │ │ │ 5 │ │ │ │ │ - 6namespace Dune { │ │ │ │ │ - 7namespace GridGlue { │ │ │ │ │ + 6#include │ │ │ │ │ + 7#include │ │ │ │ │ 8 │ │ │ │ │ - 14template │ │ │ │ │ -15static Dune::FieldVector crossProduct(const Dune::FieldVector& │ │ │ │ │ -a, │ │ │ │ │ - 16 const Dune::FieldVector& b) │ │ │ │ │ - 17{ │ │ │ │ │ - 18 if (dim!=3) │ │ │ │ │ - 19 DUNE_THROW(Dune::NotImplemented, "crossProduct does not work for dimension │ │ │ │ │ -" << dim); │ │ │ │ │ - 20 │ │ │ │ │ - 21 Dune::FieldVector c; │ │ │ │ │ - 22 c[0] = a[1]*b[2] - a[2]*b[1]; │ │ │ │ │ - 23 c[1] = a[2]*b[0] - a[0]*b[2]; │ │ │ │ │ - 24 c[2] = a[0]*b[1] - a[1]*b[0]; │ │ │ │ │ - 25 │ │ │ │ │ - 26 return c; │ │ │ │ │ - 27} │ │ │ │ │ - 28 │ │ │ │ │ - 29} /* namespace GridGlue */ │ │ │ │ │ - 30} /* namespace Dune */ │ │ │ │ │ - 31 │ │ │ │ │ - 32#endif │ │ │ │ │ + 9#include │ │ │ │ │ + 10 │ │ │ │ │ + 11namespace Dune { │ │ │ │ │ + 12namespace GridGlue { │ │ │ │ │ + 13 │ │ │ │ │ + 28template │ │ │ │ │ + 29void write(const Projection& projection, │ │ │ │ │ + 30 const Corners& corners, │ │ │ │ │ + 31 const Normals& normals, │ │ │ │ │ + 32 std::ostream& out); │ │ │ │ │ + 33 │ │ │ │ │ + 40template │ │ │ │ │ + 41void write(const Projection& projection, │ │ │ │ │ + 42 const Corners& corners, │ │ │ │ │ + 43 const Normals& normals, │ │ │ │ │ + 44 const std::string& filename); │ │ │ │ │ + 54template │ │ │ │ │ + 55void print(const Projection& projection, │ │ │ │ │ + 56 const Corners& corners, │ │ │ │ │ + 57 const Normals& normals); │ │ │ │ │ + 58 │ │ │ │ │ + 59} /* namespace GridGlue */ │ │ │ │ │ + 60} /* namespace Dune */ │ │ │ │ │ + 61 │ │ │ │ │ + 62#include "projectionwriter_impl.hh" │ │ │ │ │ + 63 │ │ │ │ │ + 64#endif │ │ │ │ │ +projection.hh │ │ │ │ │ +projectionwriter_impl.hh │ │ │ │ │ Dune │ │ │ │ │ Definition: gridglue.hh:37 │ │ │ │ │ -Dune::GridGlue::crossProduct │ │ │ │ │ -static Dune::FieldVector< T, dim > crossProduct(const Dune::FieldVector< T, dim │ │ │ │ │ -> &a, const Dune::FieldVector< T, dim > &b) │ │ │ │ │ -compute cross product │ │ │ │ │ -Definition: crossproduct.hh:15 │ │ │ │ │ +Dune::GridGlue::write │ │ │ │ │ +void write(const Projection< Coordinate > &projection, const Corners &corners, │ │ │ │ │ +const Normals &normals, std::ostream &out) │ │ │ │ │ +write projection in VTK format │ │ │ │ │ +Definition: projectionwriter_impl.hh:86 │ │ │ │ │ +Dune::GridGlue::print │ │ │ │ │ +void print(const Projection< Coordinate > &projection, const Corners &corners, │ │ │ │ │ +const Normals &normals) │ │ │ │ │ +Print information about the projection to std::cout stream. │ │ │ │ │ +Definition: projectionwriter_impl.hh:140 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00038.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: projectionwriter.hh File Reference │ │ │ │ +dune-grid-glue: ringcomm.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -64,47 +64,77 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Namespaces | │ │ │ │ +Macros | │ │ │ │ Functions
│ │ │ │ -
projectionwriter.hh File Reference
│ │ │ │ +
ringcomm.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <iostream>
│ │ │ │ -#include <string>
│ │ │ │ -#include <dune/grid-glue/common/projection.hh>
│ │ │ │ -#include "projectionwriter_impl.hh"
│ │ │ │ +
#include <mpi.h>
│ │ │ │ +#include <functional>
│ │ │ │ +#include <utility>
│ │ │ │ +#include <dune/common/fvector.hh>
│ │ │ │ +#include <dune/common/hybridutilities.hh>
│ │ │ │ +#include <dune/geometry/type.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
namespace  Dune::Parallel
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Macros

#define CheckMPIStatus(A, B)   {}
 
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ Functions

template<typename Coordinate , typename Corners , typename Normals >
void Dune::GridGlue::write (const Projection< Coordinate > &projection, const Corners &corners, const Normals &normals, std::ostream &out)
 write projection in VTK format More...
 
template<typename Coordinate , typename Corners , typename Normals >
void Dune::GridGlue::write (const Projection< Coordinate > &projection, const Corners &corners, const Normals &normals, const std::string &filename)
 write projection in VTK format More...
 
template<typename Coordinate , typename Corners , typename Normals >
void Dune::GridGlue::print (const Projection< Coordinate > &projection, const Corners &corners, const Normals &normals)
 Print information about the projection to std::cout stream. More...
 
template<typename OP , typename... Args>
void Dune::Parallel::MPI_AllApply (MPI_Comm mpicomm, OP &&op, const Args &... data)
 apply an operator locally to a difstributed data set More...
 
│ │ │ │ +

Macro Definition Documentation

│ │ │ │ + │ │ │ │ +

◆ CheckMPIStatus

│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
#define CheckMPIStatus( A,
 
)   {}
│ │ │ │ +
│ │ │ │ +
Todo:
Implement MPI Status check with exception handling
│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,38 +5,40 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * common │ │ │ │ │ -Namespaces | Functions │ │ │ │ │ -projectionwriter.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include "projectionwriter_impl.hh" │ │ │ │ │ +Namespaces | Macros | Functions │ │ │ │ │ +ringcomm.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ -namespace  Dune::GridGlue │ │ │ │ │ +namespace  Dune::Parallel │ │ │ │ │   │ │ │ │ │ - Functions │ │ │ │ │ -template │ │ │ │ │ -void Dune::GridGlue::write (const Projection< Coordinate > &projection, const │ │ │ │ │ - Corners &corners, const Normals &normals, std::ostream &out) │ │ │ │ │ -  write projection in VTK format More... │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -void Dune::GridGlue::write (const Projection< Coordinate > &projection, const │ │ │ │ │ - Corners &corners, const Normals &normals, const std::string &filename) │ │ │ │ │ -  write projection in VTK format More... │ │ │ │ │ + Macros │ │ │ │ │ +#define CheckMPIStatus(A, B)   {} │ │ │ │ │   │ │ │ │ │ -template │ │ │ │ │ -void Dune::GridGlue::print (const Projection< Coordinate > &projection, const │ │ │ │ │ - Corners &corners, const Normals &normals) │ │ │ │ │ -  Print information about the projection to std::cout stream. More... │ │ │ │ │ + Functions │ │ │ │ │ +template │ │ │ │ │ +void Dune::Parallel::MPI_AllApply (MPI_Comm mpicomm, OP &&op, const Args &... │ │ │ │ │ + data) │ │ │ │ │ +  apply an operator locally to a difstributed data set More... │ │ │ │ │   │ │ │ │ │ +***** Macro Definition Documentation ***** │ │ │ │ │ +***** ◆ CheckMPIStatus ***** │ │ │ │ │ +#define CheckMPIStatus (  A, │ │ │ │ │ +  B  │ │ │ │ │ + )    {} │ │ │ │ │ + Todo: │ │ │ │ │ + Implement MPI Status check with exception handling │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00038_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: projectionwriter.hh Source File │ │ │ │ +dune-grid-glue: ringcomm.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,57 +62,305 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
projectionwriter.hh
│ │ │ │ +
ringcomm.hh
│ │ │ │
│ │ │ │
│ │ │ │ -Go to the documentation of this file.
1// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │ -
2// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
│ │ │ │ -
3#ifndef DUNE_GRIDGLUE_COMMON_PROJECTIONWRITER_HH
│ │ │ │ -
4#define DUNE_GRIDGLUE_COMMON_PROJECTIONWRITER_HH
│ │ │ │ -
5
│ │ │ │ -
6#include <iostream>
│ │ │ │ -
7#include <string>
│ │ │ │ -
8
│ │ │ │ - │ │ │ │ -
10
│ │ │ │ -
11namespace Dune {
│ │ │ │ -
12namespace GridGlue {
│ │ │ │ +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 © DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │ +
4// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
│ │ │ │ +
5/* IMPLEMENTATION OF CLASS G R I D G L U E */
│ │ │ │ +
6
│ │ │ │ +
8#define CheckMPIStatus(A,B) {}
│ │ │ │ +
9
│ │ │ │ +
10#include <mpi.h>
│ │ │ │ +
11#include <functional>
│ │ │ │ +
12#include <utility>
│ │ │ │
13
│ │ │ │ -
28template<typename Coordinate, typename Corners, typename Normals>
│ │ │ │ -
29void write(const Projection<Coordinate>& projection,
│ │ │ │ -
30 const Corners& corners,
│ │ │ │ -
31 const Normals& normals,
│ │ │ │ -
32 std::ostream& out);
│ │ │ │ -
33
│ │ │ │ -
40template<typename Coordinate, typename Corners, typename Normals>
│ │ │ │ -
41void write(const Projection<Coordinate>& projection,
│ │ │ │ -
42 const Corners& corners,
│ │ │ │ -
43 const Normals& normals,
│ │ │ │ -
44 const std::string& filename);
│ │ │ │ -
54template<typename Coordinate, typename Corners, typename Normals>
│ │ │ │ -
55void print(const Projection<Coordinate>& projection,
│ │ │ │ -
56 const Corners& corners,
│ │ │ │ -
57 const Normals& normals);
│ │ │ │ -
58
│ │ │ │ -
59} /* namespace GridGlue */
│ │ │ │ -
60} /* namespace Dune */
│ │ │ │ -
61
│ │ │ │ - │ │ │ │ -
63
│ │ │ │ -
64#endif
│ │ │ │ - │ │ │ │ - │ │ │ │ +
14#include <dune/common/fvector.hh>
│ │ │ │ +
15#include <dune/common/hybridutilities.hh>
│ │ │ │ +
16
│ │ │ │ +
17#include <dune/geometry/type.hh>
│ │ │ │ +
18
│ │ │ │ +
19namespace Dune {
│ │ │ │ +
20namespace Parallel {
│ │ │ │ +
21
│ │ │ │ +
22 namespace Impl {
│ │ │ │ +
23
│ │ │ │ +
25 template<typename T>
│ │ │ │ +
26 struct MPITypeInfo {};
│ │ │ │ +
27
│ │ │ │ +
28 template<>
│ │ │ │ +
29 struct MPITypeInfo< int >
│ │ │ │ +
30 {
│ │ │ │ +
31 static const unsigned int size = 1;
│ │ │ │ +
32 static inline MPI_Datatype getType()
│ │ │ │ +
33 {
│ │ │ │ +
34 return MPI_INT;
│ │ │ │ +
35 }
│ │ │ │ +
36 };
│ │ │ │ +
37
│ │ │ │ +
38 template<typename K, int N>
│ │ │ │ +
39 struct MPITypeInfo< Dune::FieldVector<K,N> >
│ │ │ │ +
40 {
│ │ │ │ +
41 static const unsigned int size = N;
│ │ │ │ +
42 static inline MPI_Datatype getType()
│ │ │ │ +
43 {
│ │ │ │ +
44 return Dune::MPITraits<K>::getType();
│ │ │ │ +
45 }
│ │ │ │ +
46 };
│ │ │ │ +
47
│ │ │ │ +
48 template<>
│ │ │ │ +
49 struct MPITypeInfo< unsigned int >
│ │ │ │ +
50 {
│ │ │ │ +
51 static const unsigned int size = 1;
│ │ │ │ +
52 static inline MPI_Datatype getType()
│ │ │ │ +
53 {
│ │ │ │ +
54 return MPI_UNSIGNED;
│ │ │ │ +
55 }
│ │ │ │ +
56 };
│ │ │ │ +
57
│ │ │ │ +
58 template<>
│ │ │ │ +
59 struct MPITypeInfo< Dune::GeometryType >
│ │ │ │ +
60 {
│ │ │ │ +
61 static const unsigned int size = 1;
│ │ │ │ +
62 static inline MPI_Datatype getType()
│ │ │ │ +
63 {
│ │ │ │ +
64 return Dune::MPITraits< Dune::GeometryType >::getType();
│ │ │ │ +
65 }
│ │ │ │ +
66 };
│ │ │ │ +
67
│ │ │ │ +
68 template<typename T>
│ │ │ │ +
69 void MPI_SetVectorSize(
│ │ │ │ +
70 std::vector<T> & data,
│ │ │ │ +
71 MPI_Status & status)
│ │ │ │ +
72 {
│ │ │ │ +
73 typedef MPITypeInfo<T> Info;
│ │ │ │ +
74 int sz;
│ │ │ │ +
75 MPI_Get_count(&status, Info::getType(), &sz);
│ │ │ │ +
76 assert(sz%Info::size == 0);
│ │ │ │ +
77 data.resize(sz/Info::size);
│ │ │ │ +
78 }
│ │ │ │ +
79
│ │ │ │ +
89 template<typename T>
│ │ │ │ +
90 void MPI_SendVectorInRing(
│ │ │ │ +
91 std::vector<T> & data,
│ │ │ │ +
92 std::vector<T> & next,
│ │ │ │ +
93 int tag,
│ │ │ │ +
94 int rightrank,
│ │ │ │ +
95 int leftrank,
│ │ │ │ +
96 MPI_Comm comm,
│ │ │ │ +
97 MPI_Request& r_send,
│ │ │ │ +
98 MPI_Request& r_recv
│ │ │ │ +
99 )
│ │ │ │ +
100 {
│ │ │ │ +
101 // mpi status stuff
│ │ │ │ +
102 [[maybe_unused]] int result = 0;
│ │ │ │ +
103 typedef MPITypeInfo<T> Info;
│ │ │ │ +
104 // resize next buffer to maximum size
│ │ │ │ +
105 next.resize(next.capacity());
│ │ │ │ +
106 // send data (explicitly send data.size elements)
│ │ │ │ +
107 result =
│ │ │ │ +
108 MPI_Isend(
│ │ │ │ +
109 &(data[0]), Info::size*data.size(), Info::getType(), rightrank, tag,
│ │ │ │ +
110 comm, &r_send);
│ │ │ │ +
111 // receive up to maximum size. The acutal size is stored in the status
│ │ │ │ +
112 result =
│ │ │ │ +
113 MPI_Irecv(
│ │ │ │ +
114 &(next[0]), Info::size*next.size(), Info::getType(), leftrank, tag,
│ │ │ │ +
115 comm, &r_recv);
│ │ │ │ +
116 // // check result
│ │ │ │ +
117 // MPI_Status status;
│ │ │ │ +
118 // CheckMPIStatus(result, status);
│ │ │ │ +
119 }
│ │ │ │ +
120
│ │ │ │ +
121 template<typename T>
│ │ │ │ +
122 using ptr_t = T*;
│ │ │ │ +
123
│ │ │ │ +
124 /* these helper structs are needed as long as we still support
│ │ │ │ +
125 C++11, as we can't use variadic lambdas */
│ │ │ │ +
126 template<typename... Args>
│ │ │ │ +
127 struct call_MPI_SendVectorInRing
│ │ │ │ +
128 {
│ │ │ │ +
129 std::tuple<Args...> & remotedata;
│ │ │ │ +
130 std::tuple<Args...> & nextdata;
│ │ │ │ +
131 int & tag;
│ │ │ │ +
132 int & rightrank;
│ │ │ │ +
133 int & leftrank;
│ │ │ │ +
134 MPI_Comm & mpicomm;
│ │ │ │ +
135 std::array<MPI_Request,sizeof...(Args)> & requests_send;
│ │ │ │ +
136 std::array<MPI_Request,sizeof...(Args)> & requests_recv;
│ │ │ │ +
137
│ │ │ │ +
138 template<typename I>
│ │ │ │ +
139 void operator()(I i)
│ │ │ │ +
140 {
│ │ │ │ +
141 MPI_SendVectorInRing(
│ │ │ │ +
142 std::get<i>(remotedata),
│ │ │ │ +
143 std::get<i>(nextdata),
│ │ │ │ +
144 tag+i,
│ │ │ │ +
145 rightrank, leftrank, mpicomm,
│ │ │ │ +
146 requests_send[i],
│ │ │ │ +
147 requests_recv[i]);
│ │ │ │ +
148 }
│ │ │ │ +
149 };
│ │ │ │ +
150 template<typename... Args>
│ │ │ │ +
151 struct call_MPI_SetVectorSize
│ │ │ │ +
152 {
│ │ │ │ +
153 std::tuple<Args...> & nextdata;
│ │ │ │ +
154 std::array<MPI_Status,sizeof...(Args)> & status_recv;
│ │ │ │ +
155
│ │ │ │ +
156 template<typename I>
│ │ │ │ +
157 void operator()(I i)
│ │ │ │ +
158 {
│ │ │ │ +
159 MPI_SetVectorSize(std::get<i>(nextdata),status_recv[i]);
│ │ │ │ +
160 }
│ │ │ │ +
161 };
│ │ │ │ +
162
│ │ │ │ +
163 template<typename OP, std::size_t... Indices, typename... Args>
│ │ │ │ +
164 void MPI_AllApply_impl(MPI_Comm mpicomm,
│ │ │ │ +
165 OP && op,
│ │ │ │ +
166 std::index_sequence<Indices...> indices,
│ │ │ │ +
167 const Args&... data)
│ │ │ │ +
168 {
│ │ │ │ +
169 constexpr std::size_t N = sizeof...(Args);
│ │ │ │ +
170 int myrank = 0;
│ │ │ │ +
171 int commsize = 0;
│ │ │ │ +
172#if HAVE_MPI
│ │ │ │ +
173 MPI_Comm_rank(mpicomm, &myrank);
│ │ │ │ +
174 MPI_Comm_size(mpicomm, &commsize);
│ │ │ │ +
175#endif // HAVE_MPI
│ │ │ │ +
176
│ │ │ │ +
177 if (commsize > 1)
│ │ │ │ +
178 {
│ │ │ │ +
179#ifdef DEBUG_GRIDGLUE_PARALLELMERGE
│ │ │ │ +
180 std::cout << myrank << " Start Communication, size " << commsize << std::endl;
│ │ │ │ +
181#endif
│ │ │ │ +
182
│ │ │ │ +
183 // get data sizes
│ │ │ │ +
184 std::array<unsigned int, N> size({ ((unsigned int)data.size())... });
│ │ │ │ +
185
│ │ │ │ +
186 // communicate max data size
│ │ │ │ +
187 std::array<unsigned int, N> maxSize;
│ │ │ │ +
188 MPI_Allreduce(&size, &maxSize,
│ │ │ │ +
189 size.size(), MPI_UNSIGNED, MPI_MAX, mpicomm);
│ │ │ │ +
190#ifdef DEBUG_GRIDGLUE_PARALLELMERGE
│ │ │ │ +
191 std::cout << myrank << " maxSize " << "done... " << std::endl;
│ │ │ │ +
192#endif
│ │ │ │ +
193
│ │ │ │ +
194 // allocate receiving buffers with maxsize to ensure sufficient buffer size for communication
│ │ │ │ +
195 std::tuple<Args...> remotedata { Args(maxSize[Indices])... };
│ │ │ │ +
196
│ │ │ │ +
197 // copy local data to receiving buffer
│ │ │ │ +
198 remotedata = std::tie(data...);
│ │ │ │ +
199
│ │ │ │ +
200 // allocate second set of receiving buffers necessary for async communication
│ │ │ │ +
201 std::tuple<Args...> nextdata { Args(maxSize[Indices])... };
│ │ │ │ +
202
│ │ │ │ +
203 // communicate data in the ring
│ │ │ │ +
204 int rightrank = (myrank + 1 + commsize) % commsize;
│ │ │ │ +
205 int leftrank = (myrank - 1 + commsize) % commsize;
│ │ │ │ +
206
│ │ │ │ +
207 std::cout << myrank << ": size = " << commsize << std::endl;
│ │ │ │ +
208 std::cout << myrank << ": left = " << leftrank
│ │ │ │ +
209 << " right = " << rightrank << std::endl;
│ │ │ │ +
210
│ │ │ │ +
211 // currently the remote data is our own data
│ │ │ │ +
212 int remoterank = myrank;
│ │ │ │ +
213
│ │ │ │ +
214 for (int i=1; i<commsize; i++)
│ │ │ │ +
215 {
│ │ │ │ +
216 // in this iteration we will receive data from nextrank
│ │ │ │ +
217 int nextrank = (myrank - i + commsize) % commsize;
│ │ │ │ +
218
│ │ │ │ +
219 std::cout << myrank << ": next = " << nextrank << std::endl;
│ │ │ │ +
220
│ │ │ │ +
221 // send remote data to right neighbor and receive from left neighbor
│ │ │ │ +
222 std::array<MPI_Request,N> requests_send;
│ │ │ │ +
223 std::array<MPI_Request,N> requests_recv;
│ │ │ │ +
224
│ │ │ │ +
225 int tag = 0;
│ │ │ │ +
226 Dune::Hybrid::forEach(indices,
│ │ │ │ +
227 // [&](auto i){
│ │ │ │ +
228 // MPI_SendVectorInRing(
│ │ │ │ +
229 // std::get<i>(remotedata),
│ │ │ │ +
230 // std::get<i>(nextdata),
│ │ │ │ +
231 // tag+i,
│ │ │ │ +
232 // rightrank, leftrank, mpicomm,
│ │ │ │ +
233 // requests_send[i],
│ │ │ │ +
234 // requests_recv[i]);
│ │ │ │ +
235 // });
│ │ │ │ +
236 call_MPI_SendVectorInRing<Args...>({
│ │ │ │ +
237 remotedata,
│ │ │ │ +
238 nextdata,
│ │ │ │ +
239 tag,
│ │ │ │ +
240 rightrank, leftrank, mpicomm,
│ │ │ │ +
241 requests_send,
│ │ │ │ +
242 requests_recv
│ │ │ │ +
243 }));
│ │ │ │ +
244
│ │ │ │ +
245 // apply operator
│ │ │ │ +
246 op(remoterank,std::get<Indices>(remotedata)...);
│ │ │ │ +
247
│ │ │ │ +
248 // wait for communication to finalize
│ │ │ │ +
249 std::array<MPI_Status,N> status_send;
│ │ │ │ +
250 std::array<MPI_Status,N> status_recv;
│ │ │ │ +
251 MPI_Waitall(N,&requests_recv[0],&status_recv[0]);
│ │ │ │ +
252
│ │ │ │ +
253 // we finished receiving from nextrank and thus remoterank = nextrank
│ │ │ │ +
254 remoterank = nextrank;
│ │ │ │ +
255
│ │ │ │ +
256 // get current data sizes
│ │ │ │ +
257 // and resize vectors
│ │ │ │ +
258 Dune::Hybrid::forEach(indices,
│ │ │ │ +
259 // [&](auto i){
│ │ │ │ +
260 // MPI_SetVectorSize(std::get<i>(nextdata),status_recv[i]);
│ │ │ │ +
261 // });
│ │ │ │ +
262 call_MPI_SetVectorSize<Args...>({
│ │ │ │ +
263 nextdata, status_recv
│ │ │ │ +
264 }));
│ │ │ │ +
265
│ │ │ │ +
266 MPI_Waitall(N,&requests_send[0],&status_send[0]);
│ │ │ │ +
267
│ │ │ │ +
268 // swap the communication buffers
│ │ │ │ +
269 std::swap(remotedata,nextdata);
│ │ │ │ +
270 }
│ │ │ │ +
271
│ │ │ │ +
272 // last apply (or the only one in the case of sequential application)
│ │ │ │ +
273 op(remoterank,std::get<Indices>(remotedata)...);
│ │ │ │ +
274 }
│ │ │ │ +
275 else // sequential
│ │ │ │ +
276 {
│ │ │ │ +
277 op(myrank,data...);
│ │ │ │ +
278 }
│ │ │ │ +
279 }
│ │ │ │ +
280
│ │ │ │ +
281 } // end namespace Impl
│ │ │ │ +
282
│ │ │ │ +
296template<typename OP, typename... Args>
│ │ │ │ +
297void MPI_AllApply(MPI_Comm mpicomm,
│ │ │ │ +
298 OP && op,
│ │ │ │ +
299 const Args& ... data)
│ │ │ │ +
300{
│ │ │ │ +
301 Impl::MPI_AllApply_impl(
│ │ │ │ +
302 mpicomm,
│ │ │ │ +
303 std::forward<OP>(op),
│ │ │ │ +
304 std::make_index_sequence<sizeof...(Args)>(),
│ │ │ │ +
305 data...
│ │ │ │ +
306 );
│ │ │ │ +
307}
│ │ │ │ +
308
│ │ │ │ +
309} // end namespace Parallel
│ │ │ │ +
310} // end namespace Dune
│ │ │ │
Definition: gridglue.hh:37
│ │ │ │ -
void write(const Projection< Coordinate > &projection, const Corners &corners, const Normals &normals, std::ostream &out)
write projection in VTK format
Definition: projectionwriter_impl.hh:86
│ │ │ │ -
void print(const Projection< Coordinate > &projection, const Corners &corners, const Normals &normals)
Print information about the projection to std::cout stream.
Definition: projectionwriter_impl.hh:140
│ │ │ │ +
void MPI_AllApply(MPI_Comm mpicomm, OP &&op, const Args &... data)
apply an operator locally to a difstributed data set
Definition: ringcomm.hh:297
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,63 +5,309 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * common │ │ │ │ │ -projectionwriter.hh │ │ │ │ │ +ringcomm.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ - 1// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see 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 © DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ - 2// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only- │ │ │ │ │ + 4// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only- │ │ │ │ │ with-dune-grid-glue-exception │ │ │ │ │ - 3#ifndef DUNE_GRIDGLUE_COMMON_PROJECTIONWRITER_HH │ │ │ │ │ - 4#define DUNE_GRIDGLUE_COMMON_PROJECTIONWRITER_HH │ │ │ │ │ - 5 │ │ │ │ │ - 6#include │ │ │ │ │ - 7#include │ │ │ │ │ - 8 │ │ │ │ │ - 9#include │ │ │ │ │ - 10 │ │ │ │ │ - 11namespace Dune { │ │ │ │ │ - 12namespace GridGlue { │ │ │ │ │ + 5/* IMPLEMENTATION OF CLASS G R I D G L U E */ │ │ │ │ │ + 6 │ │ │ │ │ +8#define CheckMPIStatus(A,B) {} │ │ │ │ │ + 9 │ │ │ │ │ + 10#include │ │ │ │ │ + 11#include │ │ │ │ │ + 12#include │ │ │ │ │ 13 │ │ │ │ │ - 28template │ │ │ │ │ - 29void write(const Projection& projection, │ │ │ │ │ - 30 const Corners& corners, │ │ │ │ │ - 31 const Normals& normals, │ │ │ │ │ - 32 std::ostream& out); │ │ │ │ │ - 33 │ │ │ │ │ - 40template │ │ │ │ │ - 41void write(const Projection& projection, │ │ │ │ │ - 42 const Corners& corners, │ │ │ │ │ - 43 const Normals& normals, │ │ │ │ │ - 44 const std::string& filename); │ │ │ │ │ - 54template │ │ │ │ │ - 55void print(const Projection& projection, │ │ │ │ │ - 56 const Corners& corners, │ │ │ │ │ - 57 const Normals& normals); │ │ │ │ │ - 58 │ │ │ │ │ - 59} /* namespace GridGlue */ │ │ │ │ │ - 60} /* namespace Dune */ │ │ │ │ │ - 61 │ │ │ │ │ - 62#include "projectionwriter_impl.hh" │ │ │ │ │ - 63 │ │ │ │ │ - 64#endif │ │ │ │ │ -projectionwriter_impl.hh │ │ │ │ │ -projection.hh │ │ │ │ │ + 14#include │ │ │ │ │ + 15#include │ │ │ │ │ + 16 │ │ │ │ │ + 17#include │ │ │ │ │ + 18 │ │ │ │ │ + 19namespace Dune { │ │ │ │ │ +20namespace Parallel { │ │ │ │ │ + 21 │ │ │ │ │ + 22 namespace Impl { │ │ │ │ │ + 23 │ │ │ │ │ + 25 template │ │ │ │ │ + 26 struct MPITypeInfo {}; │ │ │ │ │ + 27 │ │ │ │ │ + 28 template<> │ │ │ │ │ + 29 struct MPITypeInfo< int > │ │ │ │ │ + 30 { │ │ │ │ │ + 31 static const unsigned int size = 1; │ │ │ │ │ + 32 static inline MPI_Datatype getType() │ │ │ │ │ + 33 { │ │ │ │ │ + 34 return MPI_INT; │ │ │ │ │ + 35 } │ │ │ │ │ + 36 }; │ │ │ │ │ + 37 │ │ │ │ │ + 38 template │ │ │ │ │ + 39 struct MPITypeInfo< Dune::FieldVector > │ │ │ │ │ + 40 { │ │ │ │ │ + 41 static const unsigned int size = N; │ │ │ │ │ + 42 static inline MPI_Datatype getType() │ │ │ │ │ + 43 { │ │ │ │ │ + 44 return Dune::MPITraits::getType(); │ │ │ │ │ + 45 } │ │ │ │ │ + 46 }; │ │ │ │ │ + 47 │ │ │ │ │ + 48 template<> │ │ │ │ │ + 49 struct MPITypeInfo< unsigned int > │ │ │ │ │ + 50 { │ │ │ │ │ + 51 static const unsigned int size = 1; │ │ │ │ │ + 52 static inline MPI_Datatype getType() │ │ │ │ │ + 53 { │ │ │ │ │ + 54 return MPI_UNSIGNED; │ │ │ │ │ + 55 } │ │ │ │ │ + 56 }; │ │ │ │ │ + 57 │ │ │ │ │ + 58 template<> │ │ │ │ │ + 59 struct MPITypeInfo< Dune::GeometryType > │ │ │ │ │ + 60 { │ │ │ │ │ + 61 static const unsigned int size = 1; │ │ │ │ │ + 62 static inline MPI_Datatype getType() │ │ │ │ │ + 63 { │ │ │ │ │ + 64 return Dune::MPITraits< Dune::GeometryType >::getType(); │ │ │ │ │ + 65 } │ │ │ │ │ + 66 }; │ │ │ │ │ + 67 │ │ │ │ │ + 68 template │ │ │ │ │ + 69 void MPI_SetVectorSize( │ │ │ │ │ + 70 std::vector & data, │ │ │ │ │ + 71 MPI_Status & status) │ │ │ │ │ + 72 { │ │ │ │ │ + 73 typedef MPITypeInfo Info; │ │ │ │ │ + 74 int sz; │ │ │ │ │ + 75 MPI_Get_count(&status, Info::getType(), &sz); │ │ │ │ │ + 76 assert(sz%Info::size == 0); │ │ │ │ │ + 77 data.resize(sz/Info::size); │ │ │ │ │ + 78 } │ │ │ │ │ + 79 │ │ │ │ │ + 89 template │ │ │ │ │ + 90 void MPI_SendVectorInRing( │ │ │ │ │ + 91 std::vector & data, │ │ │ │ │ + 92 std::vector & next, │ │ │ │ │ + 93 int tag, │ │ │ │ │ + 94 int rightrank, │ │ │ │ │ + 95 int leftrank, │ │ │ │ │ + 96 MPI_Comm comm, │ │ │ │ │ + 97 MPI_Request& r_send, │ │ │ │ │ + 98 MPI_Request& r_recv │ │ │ │ │ + 99 ) │ │ │ │ │ + 100 { │ │ │ │ │ + 101 // mpi status stuff │ │ │ │ │ + 102 [[maybe_unused]] int result = 0; │ │ │ │ │ + 103 typedef MPITypeInfo Info; │ │ │ │ │ + 104 // resize next buffer to maximum size │ │ │ │ │ + 105 next.resize(next.capacity()); │ │ │ │ │ + 106 // send data (explicitly send data.size elements) │ │ │ │ │ + 107 result = │ │ │ │ │ + 108 MPI_Isend( │ │ │ │ │ + 109 &(data[0]), Info::size*data.size(), Info::getType(), rightrank, tag, │ │ │ │ │ + 110 comm, &r_send); │ │ │ │ │ + 111 // receive up to maximum size. The acutal size is stored in the status │ │ │ │ │ + 112 result = │ │ │ │ │ + 113 MPI_Irecv( │ │ │ │ │ + 114 &(next[0]), Info::size*next.size(), Info::getType(), leftrank, tag, │ │ │ │ │ + 115 comm, &r_recv); │ │ │ │ │ + 116 // // check result │ │ │ │ │ + 117 // MPI_Status status; │ │ │ │ │ + 118 // CheckMPIStatus(result, status); │ │ │ │ │ + 119 } │ │ │ │ │ + 120 │ │ │ │ │ + 121 template │ │ │ │ │ + 122 using ptr_t = T*; │ │ │ │ │ + 123 │ │ │ │ │ + 124 /* these helper structs are needed as long as we still support │ │ │ │ │ + 125 C++11, as we can't use variadic lambdas */ │ │ │ │ │ + 126 template │ │ │ │ │ + 127 struct call_MPI_SendVectorInRing │ │ │ │ │ + 128 { │ │ │ │ │ + 129 std::tuple & remotedata; │ │ │ │ │ + 130 std::tuple & nextdata; │ │ │ │ │ + 131 int & tag; │ │ │ │ │ + 132 int & rightrank; │ │ │ │ │ + 133 int & leftrank; │ │ │ │ │ + 134 MPI_Comm & mpicomm; │ │ │ │ │ + 135 std::array & requests_send; │ │ │ │ │ + 136 std::array & requests_recv; │ │ │ │ │ + 137 │ │ │ │ │ + 138 template │ │ │ │ │ + 139 void operator()(I i) │ │ │ │ │ + 140 { │ │ │ │ │ + 141 MPI_SendVectorInRing( │ │ │ │ │ + 142 std::get(remotedata), │ │ │ │ │ + 143 std::get(nextdata), │ │ │ │ │ + 144 tag+i, │ │ │ │ │ + 145 rightrank, leftrank, mpicomm, │ │ │ │ │ + 146 requests_send[i], │ │ │ │ │ + 147 requests_recv[i]); │ │ │ │ │ + 148 } │ │ │ │ │ + 149 }; │ │ │ │ │ + 150 template │ │ │ │ │ + 151 struct call_MPI_SetVectorSize │ │ │ │ │ + 152 { │ │ │ │ │ + 153 std::tuple & nextdata; │ │ │ │ │ + 154 std::array & status_recv; │ │ │ │ │ + 155 │ │ │ │ │ + 156 template │ │ │ │ │ + 157 void operator()(I i) │ │ │ │ │ + 158 { │ │ │ │ │ + 159 MPI_SetVectorSize(std::get(nextdata),status_recv[i]); │ │ │ │ │ + 160 } │ │ │ │ │ + 161 }; │ │ │ │ │ + 162 │ │ │ │ │ + 163 template │ │ │ │ │ + 164 void MPI_AllApply_impl(MPI_Comm mpicomm, │ │ │ │ │ + 165 OP && op, │ │ │ │ │ + 166 std::index_sequence indices, │ │ │ │ │ + 167 const Args&... data) │ │ │ │ │ + 168 { │ │ │ │ │ + 169 constexpr std::size_t N = sizeof...(Args); │ │ │ │ │ + 170 int myrank = 0; │ │ │ │ │ + 171 int commsize = 0; │ │ │ │ │ + 172#if HAVE_MPI │ │ │ │ │ + 173 MPI_Comm_rank(mpicomm, &myrank); │ │ │ │ │ + 174 MPI_Comm_size(mpicomm, &commsize); │ │ │ │ │ + 175#endif // HAVE_MPI │ │ │ │ │ + 176 │ │ │ │ │ + 177 if (commsize > 1) │ │ │ │ │ + 178 { │ │ │ │ │ + 179#ifdef DEBUG_GRIDGLUE_PARALLELMERGE │ │ │ │ │ + 180 std::cout << myrank << " Start Communication, size " << commsize << std:: │ │ │ │ │ +endl; │ │ │ │ │ + 181#endif │ │ │ │ │ + 182 │ │ │ │ │ + 183 // get data sizes │ │ │ │ │ + 184 std::array size({ ((unsigned int)data.size())... }); │ │ │ │ │ + 185 │ │ │ │ │ + 186 // communicate max data size │ │ │ │ │ + 187 std::array maxSize; │ │ │ │ │ + 188 MPI_Allreduce(&size, &maxSize, │ │ │ │ │ + 189 size.size(), MPI_UNSIGNED, MPI_MAX, mpicomm); │ │ │ │ │ + 190#ifdef DEBUG_GRIDGLUE_PARALLELMERGE │ │ │ │ │ + 191 std::cout << myrank << " maxSize " << "done... " << std::endl; │ │ │ │ │ + 192#endif │ │ │ │ │ + 193 │ │ │ │ │ + 194 // allocate receiving buffers with maxsize to ensure sufficient buffer │ │ │ │ │ +size for communication │ │ │ │ │ + 195 std::tuple remotedata { Args(maxSize[Indices])... }; │ │ │ │ │ + 196 │ │ │ │ │ + 197 // copy local data to receiving buffer │ │ │ │ │ + 198 remotedata = std::tie(data...); │ │ │ │ │ + 199 │ │ │ │ │ + 200 // allocate second set of receiving buffers necessary for async │ │ │ │ │ +communication │ │ │ │ │ + 201 std::tuple nextdata { Args(maxSize[Indices])... }; │ │ │ │ │ + 202 │ │ │ │ │ + 203 // communicate data in the ring │ │ │ │ │ + 204 int rightrank = (myrank + 1 + commsize) % commsize; │ │ │ │ │ + 205 int leftrank = (myrank - 1 + commsize) % commsize; │ │ │ │ │ + 206 │ │ │ │ │ + 207 std::cout << myrank << ": size = " << commsize << std::endl; │ │ │ │ │ + 208 std::cout << myrank << ": left = " << leftrank │ │ │ │ │ + 209 << " right = " << rightrank << std::endl; │ │ │ │ │ + 210 │ │ │ │ │ + 211 // currently the remote data is our own data │ │ │ │ │ + 212 int remoterank = myrank; │ │ │ │ │ + 213 │ │ │ │ │ + 214 for (int i=1; i │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: projection.hh File Reference │ │ │ │ +dune-grid-glue: projectionwriter_impl.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -63,41 +63,61 @@ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ -Namespaces
│ │ │ │ -
projection.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Functions
│ │ │ │ +
projectionwriter_impl.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <array>
│ │ │ │ -#include <bitset>
│ │ │ │ -#include <tuple>
│ │ │ │ -#include "projection_impl.hh"
│ │ │ │ +
#include <fstream>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ -Classes

class  Dune::GridGlue::Projection< Coordinate >
 Projection of a line (triangle) on another line (triangle). More...
 
struct  Dune::GridGlue::Projection< Coordinate >::EdgeIntersection
 Intersection between two edges of a triangle. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
namespace  Dune::GridGlue::ProjectionWriterImplementation
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +Functions

template<unsigned side, typename Coordinate , typename Corners >
void Dune::GridGlue::ProjectionWriterImplementation::write_points (const Projection< Coordinate > &projection, const Corners &corners, std::ostream &out)
 
template<unsigned side, typename Coordinate , typename Normals >
void Dune::GridGlue::ProjectionWriterImplementation::write_normals (const Projection< Coordinate > &projection, const Normals &normals, std::ostream &out)
 
template<typename Coordinate , typename Corners >
void Dune::GridGlue::ProjectionWriterImplementation::write_edge_intersection_points (const Projection< Coordinate > &projection, const Corners &corners, std::ostream &out)
 
template<typename Coordinate , typename Normals >
void Dune::GridGlue::ProjectionWriterImplementation::write_edge_intersection_normals (const Projection< Coordinate > &projection, const Normals &normals, std::ostream &out)
 
template<unsigned side, typename Coordinate >
void Dune::GridGlue::ProjectionWriterImplementation::write_success (const Projection< Coordinate > &projection, std::ostream &out)
 
template<typename Coordinate , typename Corners , typename Normals >
void Dune::GridGlue::write (const Projection< Coordinate > &projection, const Corners &corners, const Normals &normals, std::ostream &out)
 write projection in VTK format More...
 
template<typename Coordinate , typename Corners , typename Normals >
void Dune::GridGlue::write (const Projection< Coordinate > &projection, const Corners &corners, const Normals &normals, const std::string &filename)
 write projection in VTK format More...
 
template<typename Coordinate , typename Corners , typename Normals >
void Dune::GridGlue::print (const Projection< Coordinate > &projection, const Corners &corners, const Normals &normals)
 Print information about the projection to std::cout stream. More...
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,29 +5,61 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * common │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -projection.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include "projection_impl.hh" │ │ │ │ │ +Namespaces | Functions │ │ │ │ │ +projectionwriter_impl.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ - Classes │ │ │ │ │ - class  Dune::GridGlue::Projection<_Coordinate_> │ │ │ │ │ -  Projection of a line (triangle) on another line (triangle). More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::GridGlue::Projection<_Coordinate_>::EdgeIntersection │ │ │ │ │ -  Intersection between two edges of a triangle. More... │ │ │ │ │ -  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::GridGlue │ │ │ │ │   │ │ │ │ │ +namespace  Dune::GridGlue::ProjectionWriterImplementation │ │ │ │ │ +  │ │ │ │ │ + Functions │ │ │ │ │ +template │ │ │ │ │ +void Dune::GridGlue::ProjectionWriterImplementation::write_points (const │ │ │ │ │ + Projection< Coordinate > &projection, const Corners &corners, std:: │ │ │ │ │ + ostream &out) │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +void Dune::GridGlue::ProjectionWriterImplementation::write_normals (const │ │ │ │ │ + Projection< Coordinate > &projection, const Normals &normals, std:: │ │ │ │ │ + ostream &out) │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +void Dune::GridGlue::ProjectionWriterImplementation:: │ │ │ │ │ + write_edge_intersection_points (const Projection< Coordinate > │ │ │ │ │ + &projection, const Corners &corners, std::ostream &out) │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +void Dune::GridGlue::ProjectionWriterImplementation:: │ │ │ │ │ + write_edge_intersection_normals (const Projection< Coordinate > │ │ │ │ │ + &projection, const Normals &normals, std::ostream &out) │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +void Dune::GridGlue::ProjectionWriterImplementation::write_success (const │ │ │ │ │ + Projection< Coordinate > &projection, std::ostream &out) │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +void Dune::GridGlue::write (const Projection< Coordinate > &projection, const │ │ │ │ │ + Corners &corners, const Normals &normals, std::ostream &out) │ │ │ │ │ +  write projection in VTK format More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +void Dune::GridGlue::write (const Projection< Coordinate > &projection, const │ │ │ │ │ + Corners &corners, const Normals &normals, const std::string &filename) │ │ │ │ │ +  write projection in VTK format More... │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +void Dune::GridGlue::print (const Projection< Coordinate > &projection, const │ │ │ │ │ + Corners &corners, const Normals &normals) │ │ │ │ │ +  Print information about the projection to std::cout stream. More... │ │ │ │ │ +  │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00044_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: projection.hh Source File │ │ │ │ +dune-grid-glue: projectionwriter_impl.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,126 +62,195 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
projection.hh
│ │ │ │ +
projectionwriter_impl.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
2// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
│ │ │ │ -
3#ifndef DUNE_GRIDGLUE_COMMON_PROJECTIONHELPER2_HH
│ │ │ │ -
4#define DUNE_GRIDGLUE_COMMON_PROJECTIONHELPER2_HH
│ │ │ │ -
5
│ │ │ │ -
6#include <array>
│ │ │ │ -
7#include <bitset>
│ │ │ │ -
8#include <tuple>
│ │ │ │ +
3#include <fstream>
│ │ │ │ +
4
│ │ │ │ +
5namespace Dune {
│ │ │ │ +
6namespace GridGlue {
│ │ │ │ +
7
│ │ │ │ +
8namespace ProjectionWriterImplementation {
│ │ │ │
9
│ │ │ │ -
10namespace Dune {
│ │ │ │ -
11namespace GridGlue {
│ │ │ │ -
12
│ │ │ │ -
19template<typename Coordinate>
│ │ │ │ - │ │ │ │ -
21{
│ │ │ │ -
22public:
│ │ │ │ - │ │ │ │ -
29 {
│ │ │ │ -
33 std::array<unsigned, 2> edge;
│ │ │ │ -
34
│ │ │ │ -
41 std::array<Coordinate, 2> local;
│ │ │ │ -
42 };
│ │ │ │ -
43
│ │ │ │ -
47 constexpr static unsigned dim = Coordinate::dimension;
│ │ │ │ -
48
│ │ │ │ -
54 constexpr static unsigned maxEdgeIntersections = dim == 3 ? 9 : 0;
│ │ │ │ -
55
│ │ │ │ -
56 static_assert(dim == 2 || dim == 3, "Projection only implemented for dim=2 or dim=3");
│ │ │ │ -
57
│ │ │ │ -
61 typedef typename Coordinate::field_type Field;
│ │ │ │ -
62
│ │ │ │ -
70 typedef std::array<Coordinate, dim> Images;
│ │ │ │ -
71
│ │ │ │ - │ │ │ │ -
79
│ │ │ │ -
80private:
│ │ │ │ -
84 const Field m_overlap;
│ │ │ │ -
85
│ │ │ │ -
94 const Field m_max_normal_product;
│ │ │ │ +
10template<unsigned side, typename Coordinate, typename Corners>
│ │ │ │ +
11void write_points(const Projection<Coordinate>& projection, const Corners& corners, std::ostream& out)
│ │ │ │ +
12{
│ │ │ │ +
13 using namespace ProjectionImplementation;
│ │ │ │ +
14 using std::get;
│ │ │ │ +
15 const unsigned other_side = 1 - side;
│ │ │ │ +
16
│ │ │ │ +
17 for (const auto& c : get<side>(corners))
│ │ │ │ +
18 out << c << "\n";
│ │ │ │ +
19
│ │ │ │ +
20 for (const auto& i : get<side>(projection.images())) {
│ │ │ │ +
21 const auto global = interpolate(i, get<other_side>(corners));
│ │ │ │ +
22 out << global << "\n";
│ │ │ │ +
23 }
│ │ │ │ +
24}
│ │ │ │ +
25
│ │ │ │ +
26template<unsigned side, typename Coordinate, typename Normals>
│ │ │ │ +
27void write_normals(const Projection<Coordinate>& projection, const Normals& normals, std::ostream& out)
│ │ │ │ +
28{
│ │ │ │ +
29 using namespace ProjectionImplementation;
│ │ │ │ +
30 using std::get;
│ │ │ │ +
31 const unsigned other_side = 1 - side;
│ │ │ │ +
32
│ │ │ │ +
33 for (const auto& n : get<side>(normals))
│ │ │ │ +
34 out << n << "\n";
│ │ │ │ +
35
│ │ │ │ +
36 for (const auto& x : get<side>(projection.images())) {
│ │ │ │ +
37 const auto n = interpolate_unit_normals(x, get<other_side>(normals));
│ │ │ │ +
38 out << n << "\n";
│ │ │ │ +
39 }
│ │ │ │ +
40}
│ │ │ │ +
41
│ │ │ │ +
42template<typename Coordinate, typename Corners>
│ │ │ │ +
43void write_edge_intersection_points(const Projection<Coordinate>& projection, const Corners& corners, std::ostream& out)
│ │ │ │ +
44{
│ │ │ │ +
45 using namespace ProjectionImplementation;
│ │ │ │ +
46 using std::get;
│ │ │ │ +
47
│ │ │ │ +
48 for (std::size_t i = 0; i < projection.numberOfEdgeIntersections(); ++i) {
│ │ │ │ +
49 const auto& local = projection.edgeIntersections()[i].local;
│ │ │ │ +
50 out << interpolate(local[0], get<0>(corners)) << "\n"
│ │ │ │ +
51 << interpolate(local[1], get<1>(corners)) << "\n";
│ │ │ │ +
52 }
│ │ │ │ +
53}
│ │ │ │ +
54
│ │ │ │ +
55template<typename Coordinate, typename Normals>
│ │ │ │ +
56void write_edge_intersection_normals(const Projection<Coordinate>& projection, const Normals& normals, std::ostream& out)
│ │ │ │ +
57{
│ │ │ │ +
58 using namespace ProjectionImplementation;
│ │ │ │ +
59 using std::get;
│ │ │ │ +
60
│ │ │ │ +
61 for (std::size_t i = 0; i < projection.numberOfEdgeIntersections(); ++i) {
│ │ │ │ +
62 const auto& local = projection.edgeIntersections()[i].local;
│ │ │ │ +
63 const auto n0 = interpolate_unit_normals(local[0], get<0>(normals));
│ │ │ │ +
64 const auto n1 = interpolate_unit_normals(local[1], get<1>(normals));
│ │ │ │ +
65
│ │ │ │ +
66 out << n0 << "\n"
│ │ │ │ +
67 << n1 << "\n";
│ │ │ │ +
68 }
│ │ │ │ +
69}
│ │ │ │ +
70
│ │ │ │ +
71template<unsigned side, typename Coordinate>
│ │ │ │ +
72void write_success(const Projection<Coordinate>& projection, std::ostream& out)
│ │ │ │ +
73{
│ │ │ │ +
74 using std::get;
│ │ │ │ +
75
│ │ │ │ +
76 out << side << "\n";
│ │ │ │ +
77
│ │ │ │ +
78 const auto& success = get<side>(projection.success());
│ │ │ │ +
79 for (std::size_t i = 0; i < success.size(); ++i)
│ │ │ │ +
80 out << (success[i] ? "1\n" : "0\n");
│ │ │ │ +
81}
│ │ │ │ +
82
│ │ │ │ +
83} /* namespace ProjectionWriterImplementation */
│ │ │ │ +
84
│ │ │ │ +
85template<typename Coordinate, typename Corners, typename Normals>
│ │ │ │ +
86void write(const Projection<Coordinate>& projection,
│ │ │ │ +
87 const Corners& corners,
│ │ │ │ +
88 const Normals& normals,
│ │ │ │ +
89 std::ostream& out)
│ │ │ │ +
90{
│ │ │ │ +
91 using namespace ProjectionWriterImplementation;
│ │ │ │ +
92
│ │ │ │ +
93 const auto numberOfEdgeIntersections = projection.numberOfEdgeIntersections();
│ │ │ │ +
94 const auto nPoints = 12 + 2 * numberOfEdgeIntersections;
│ │ │ │
95
│ │ │ │ -
101 Field m_epsilon = Field(1e-12);
│ │ │ │ -
102
│ │ │ │ -
104 std::tuple<Images, Preimages> m_images;
│ │ │ │ -
105
│ │ │ │ -
107 std::tuple<std::bitset<dim>, std::bitset<dim> > m_success;
│ │ │ │ -
108
│ │ │ │ -
110 unsigned m_number_of_edge_intersections;
│ │ │ │ -
111
│ │ │ │ -
113 std::array<EdgeIntersection, maxEdgeIntersections> m_edge_intersections;
│ │ │ │ -
114
│ │ │ │ -
126 bool m_projection_valid;
│ │ │ │ -
127
│ │ │ │ -
133 template<typename Corners, typename Normals>
│ │ │ │ -
134 void doProjection(const std::tuple<Corners&, Corners&>& corners, const std::tuple<Normals&, Normals&>& normals);
│ │ │ │ -
135
│ │ │ │ -
144 template<typename Corners, typename Normals>
│ │ │ │ -
145 void doInverseProjection(const std::tuple<Corners&, Corners&>& corners, const std::tuple<Normals&, Normals&>& normals);
│ │ │ │ -
146
│ │ │ │ -
155 template<typename Corners, typename Normals>
│ │ │ │ -
156 void doEdgeIntersection(const std::tuple<Corners&, Corners&>& corners, const std::tuple<Normals&, Normals&>& normals);
│ │ │ │ -
157
│ │ │ │ -
183 template<typename Corners, typename Normals>
│ │ │ │ -
184 inline bool projectionFeasible(const Coordinate& x, const Coordinate& nx, const Coordinate& px, const Corners& corners, const Normals& normals) const;
│ │ │ │ -
185
│ │ │ │ -
186public:
│ │ │ │ -
191 Projection(const Field overlap = Field(0), const Field max_normal_product = Field(-0.1));
│ │ │ │ -
192
│ │ │ │ -
198 void epsilon(const Field epsilon);
│ │ │ │ -
199
│ │ │ │ -
212 template<typename Corners, typename Normals>
│ │ │ │ -
213 void project(const std::tuple<Corners&, Corners&>& corners, const std::tuple<Normals&, Normals&>& normals);
│ │ │ │ -
214
│ │ │ │ -
235 const std::tuple<Images, Preimages>& images() const
│ │ │ │ -
236 { return m_images; }
│ │ │ │ -
237
│ │ │ │ -
252 const std::tuple<std::bitset<dim>, std::bitset<dim> >& success() const
│ │ │ │ -
253 { return m_success; }
│ │ │ │ -
254
│ │ │ │ - │ │ │ │ -
263 { return m_number_of_edge_intersections; }
│ │ │ │ -
264
│ │ │ │ -
273 const std::array<EdgeIntersection, maxEdgeIntersections>& edgeIntersections() const
│ │ │ │ -
274 { return m_edge_intersections; }
│ │ │ │ -
275};
│ │ │ │ -
276
│ │ │ │ -
277} /* namespace GridGlue */
│ │ │ │ -
278} /* namespace Dune */
│ │ │ │ -
279
│ │ │ │ -
280#include "projection_impl.hh"
│ │ │ │ -
281
│ │ │ │ -
282#endif
│ │ │ │ - │ │ │ │ +
96 out << "# vtk DataFile Version2.0\n"
│ │ │ │ +
97 << "Filename: projection\n"
│ │ │ │ +
98 << "ASCII\n"
│ │ │ │ +
99 << "DATASET UNSTRUCTURED_GRID\n"
│ │ │ │ +
100 << "POINTS " << nPoints << " double\n";
│ │ │ │ +
101 write_points<0>(projection, corners, out);
│ │ │ │ +
102 write_points<1>(projection, corners, out);
│ │ │ │ +
103 write_edge_intersection_points(projection, corners, out);
│ │ │ │ +
104 out << "CELLS " << (8 + numberOfEdgeIntersections) << " " << (26 + 3 * numberOfEdgeIntersections) << "\n";
│ │ │ │ +
105 out << "3 0 1 2\n" "2 0 3\n" "2 1 4\n" "2 2 5\n"
│ │ │ │ +
106 << "3 6 7 8\n" "2 6 9\n" "2 7 10\n" "2 8 11\n";
│ │ │ │ +
107 for (std::size_t i = 0; i < numberOfEdgeIntersections; ++i)
│ │ │ │ +
108 out << "2 " << (12 + 2*i) << " " << (12 + 2*i + 1) << "\n";
│ │ │ │ +
109 out << "CELL_TYPES " << (8 + numberOfEdgeIntersections) << "\n" "5\n3\n3\n3\n" "5\n3\n3\n3\n";
│ │ │ │ +
110 for (std::size_t i = 0; i < numberOfEdgeIntersections; ++i)
│ │ │ │ +
111 out << "3\n";
│ │ │ │ +
112 out << "CELL_DATA " << (8 + numberOfEdgeIntersections) << "\n";
│ │ │ │ +
113 out << "SCALARS success int 1\n"
│ │ │ │ +
114 << "LOOKUP_TABLE success\n";
│ │ │ │ +
115 write_success<0>(projection, out);
│ │ │ │ +
116 write_success<1>(projection, out);
│ │ │ │ +
117 for (std::size_t i = 0; i < numberOfEdgeIntersections; ++i)
│ │ │ │ +
118 out << "2\n";
│ │ │ │ +
119 out << "LOOKUP_TABLE success 2\n"
│ │ │ │ +
120 << "1.0 0.0 0.0 1.0\n"
│ │ │ │ +
121 << "0.0 1.0 0.0 1.0\n";
│ │ │ │ +
122 out << "POINT_DATA " << nPoints << "\n"
│ │ │ │ +
123 << "NORMALS normals double\n";
│ │ │ │ +
124 write_normals<0>(projection, normals, out);
│ │ │ │ +
125 write_normals<1>(projection, normals, out);
│ │ │ │ +
126 write_edge_intersection_normals(projection, normals, out);
│ │ │ │ +
127}
│ │ │ │ +
128
│ │ │ │ +
129template<typename Coordinate, typename Corners, typename Normals>
│ │ │ │ +
130void write(const Projection<Coordinate>& projection,
│ │ │ │ +
131 const Corners& corners,
│ │ │ │ +
132 const Normals& normals,
│ │ │ │ +
133 const std::string& filename)
│ │ │ │ +
134{
│ │ │ │ +
135 std::ofstream out(filename.c_str());
│ │ │ │ +
136 write(projection, corners, normals, out);
│ │ │ │ +
137}
│ │ │ │ +
138
│ │ │ │ +
139template<typename Coordinate, typename Corners, typename Normals>
│ │ │ │ +
140void print(const Projection<Coordinate>& projection,
│ │ │ │ +
141 const Corners& corners,
│ │ │ │ +
142 const Normals& normals)
│ │ │ │ +
143{
│ │ │ │ +
144 using namespace ProjectionWriterImplementation;
│ │ │ │ +
145
│ │ │ │ +
146 std::cout << "Side 0 corners and images:\n";
│ │ │ │ +
147 write_points<0>(projection, corners, std::cout);
│ │ │ │ +
148 std::cout << "Side 0 success:\n";
│ │ │ │ +
149 write_success<0>(projection, std::cout);
│ │ │ │ +
150 std::cout << "Side 1 corners and images:\n";
│ │ │ │ +
151 write_points<1>(projection, corners, std::cout);
│ │ │ │ +
152 std::cout << "Side 1 success:\n";
│ │ │ │ +
153 write_success<1>(projection, std::cout);
│ │ │ │ +
154 std::cout << "Side 0 normals and projected normals:\n";
│ │ │ │ +
155 write_normals<0>(projection, normals, std::cout);
│ │ │ │ +
156 std::cout << "Side 1 normals and projected normals:\n";
│ │ │ │ +
157 write_normals<1>(projection, normals, std::cout);
│ │ │ │ +
158 std::cout << projection.numberOfEdgeIntersections() << " edge intersections:\n";
│ │ │ │ +
159 write_edge_intersection_points(projection, corners, std::cout);
│ │ │ │ +
160}
│ │ │ │ +
161
│ │ │ │ +
162} /* namespace GridGlue */
│ │ │ │ +
163} /* namespace Dune */
│ │ │ │
Definition: gridglue.hh:37
│ │ │ │ +
void write(const Projection< Coordinate > &projection, const Corners &corners, const Normals &normals, std::ostream &out)
write projection in VTK format
Definition: projectionwriter_impl.hh:86
│ │ │ │ +
void print(const Projection< Coordinate > &projection, const Corners &corners, const Normals &normals)
Print information about the projection to std::cout stream.
Definition: projectionwriter_impl.hh:140
│ │ │ │ +
Corners::value_type interpolate(const Coordinate &x, const Corners &corners)
Definition: projection_impl.hh:70
│ │ │ │ +
Normals::value_type interpolate_unit_normals(const Coordinate &x, const Normals &normals)
Definition: projection_impl.hh:91
│ │ │ │ +
void write_normals(const Projection< Coordinate > &projection, const Normals &normals, std::ostream &out)
Definition: projectionwriter_impl.hh:27
│ │ │ │ +
void write_points(const Projection< Coordinate > &projection, const Corners &corners, std::ostream &out)
Definition: projectionwriter_impl.hh:11
│ │ │ │ +
void write_success(const Projection< Coordinate > &projection, std::ostream &out)
Definition: projectionwriter_impl.hh:72
│ │ │ │ +
void write_edge_intersection_points(const Projection< Coordinate > &projection, const Corners &corners, std::ostream &out)
Definition: projectionwriter_impl.hh:43
│ │ │ │ +
void write_edge_intersection_normals(const Projection< Coordinate > &projection, const Normals &normals, std::ostream &out)
Definition: projectionwriter_impl.hh:56
│ │ │ │
Projection of a line (triangle) on another line (triangle).
Definition: projection.hh:21
│ │ │ │ -
Coordinate::field_type Field
Scalar type.
Definition: projection.hh:61
│ │ │ │ -
Projection(const Field overlap=Field(0), const Field max_normal_product=Field(-0.1))
Definition: projection_impl.hh:130
│ │ │ │
const std::tuple< std::bitset< dim >, std::bitset< dim > > & success() const
Indicate whether projection (inverse projection) is valid for each corner or not.
Definition: projection.hh:252
│ │ │ │ -
static constexpr unsigned maxEdgeIntersections
maximum number of edge-edge intersections
Definition: projection.hh:54
│ │ │ │ -
Images Preimages
Definition: projection.hh:78
│ │ │ │ -
std::array< Coordinate, dim > Images
List of corner images.
Definition: projection.hh:70
│ │ │ │ -
void epsilon(const Field epsilon)
Set epsilon used for floating-point comparisons.
Definition: projection_impl.hh:140
│ │ │ │ -
void project(const std::tuple< Corners &, Corners & > &corners, const std::tuple< Normals &, Normals & > &normals)
Do the actual projection.
Definition: projection_impl.hh:469
│ │ │ │ -
static constexpr unsigned dim
dimension of coordinates
Definition: projection.hh:47
│ │ │ │
unsigned numberOfEdgeIntersections() const
Number of edge intersections.
Definition: projection.hh:262
│ │ │ │
const std::tuple< Images, Preimages > & images() const
Images and preimages of corners.
Definition: projection.hh:235
│ │ │ │
const std::array< EdgeIntersection, maxEdgeIntersections > & edgeIntersections() const
Edge-edge intersections.
Definition: projection.hh:273
│ │ │ │ -
Intersection between two edges of a triangle.
Definition: projection.hh:29
│ │ │ │ -
std::array< Coordinate, 2 > local
Local coordinates of intersection and distance along normals.
Definition: projection.hh:41
│ │ │ │ -
std::array< unsigned, 2 > edge
Edge numbers in image and preimage triangle.
Definition: projection.hh:33
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,180 +5,246 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * common │ │ │ │ │ -projection.hh │ │ │ │ │ +projectionwriter_impl.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 2// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only- │ │ │ │ │ with-dune-grid-glue-exception │ │ │ │ │ - 3#ifndef DUNE_GRIDGLUE_COMMON_PROJECTIONHELPER2_HH │ │ │ │ │ - 4#define DUNE_GRIDGLUE_COMMON_PROJECTIONHELPER2_HH │ │ │ │ │ - 5 │ │ │ │ │ - 6#include │ │ │ │ │ - 7#include │ │ │ │ │ - 8#include │ │ │ │ │ + 3#include │ │ │ │ │ + 4 │ │ │ │ │ + 5namespace Dune { │ │ │ │ │ + 6namespace GridGlue { │ │ │ │ │ + 7 │ │ │ │ │ +8namespace ProjectionWriterImplementation { │ │ │ │ │ 9 │ │ │ │ │ - 10namespace Dune { │ │ │ │ │ - 11namespace GridGlue { │ │ │ │ │ - 12 │ │ │ │ │ - 19template │ │ │ │ │ -20class Projection │ │ │ │ │ - 21{ │ │ │ │ │ - 22public: │ │ │ │ │ -28 struct EdgeIntersection │ │ │ │ │ - 29 { │ │ │ │ │ -33 std::array edge; │ │ │ │ │ - 34 │ │ │ │ │ -41 std::array local; │ │ │ │ │ - 42 }; │ │ │ │ │ - 43 │ │ │ │ │ -47 constexpr static unsigned dim = Coordinate::dimension; │ │ │ │ │ - 48 │ │ │ │ │ -54 constexpr static unsigned maxEdgeIntersections = dim == 3 ? 9 : 0; │ │ │ │ │ - 55 │ │ │ │ │ - 56 static_assert(dim == 2 || dim == 3, "Projection only implemented for dim=2 │ │ │ │ │ -or dim=3"); │ │ │ │ │ - 57 │ │ │ │ │ -61 typedef typename Coordinate::field_type Field; │ │ │ │ │ - 62 │ │ │ │ │ -70 typedef std::array Images; │ │ │ │ │ - 71 │ │ │ │ │ -78 typedef Images Preimages; │ │ │ │ │ - 79 │ │ │ │ │ - 80private: │ │ │ │ │ - 84 const Field m_overlap; │ │ │ │ │ - 85 │ │ │ │ │ - 94 const Field m_max_normal_product; │ │ │ │ │ + 10template │ │ │ │ │ +11void write_points(const Projection& projection, const Corners& │ │ │ │ │ +corners, std::ostream& out) │ │ │ │ │ + 12{ │ │ │ │ │ + 13 using namespace ProjectionImplementation; │ │ │ │ │ + 14 using std::get; │ │ │ │ │ + 15 const unsigned other_side = 1 - side; │ │ │ │ │ + 16 │ │ │ │ │ + 17 for (const auto& c : get(corners)) │ │ │ │ │ + 18 out << c << "\n"; │ │ │ │ │ + 19 │ │ │ │ │ + 20 for (const auto& i : get(projection.images())) { │ │ │ │ │ + 21 const auto global = interpolate(i, get(corners)); │ │ │ │ │ + 22 out << global << "\n"; │ │ │ │ │ + 23 } │ │ │ │ │ + 24} │ │ │ │ │ + 25 │ │ │ │ │ + 26template │ │ │ │ │ +27void write_normals(const Projection& projection, const Normals& │ │ │ │ │ +normals, std::ostream& out) │ │ │ │ │ + 28{ │ │ │ │ │ + 29 using namespace ProjectionImplementation; │ │ │ │ │ + 30 using std::get; │ │ │ │ │ + 31 const unsigned other_side = 1 - side; │ │ │ │ │ + 32 │ │ │ │ │ + 33 for (const auto& n : get(normals)) │ │ │ │ │ + 34 out << n << "\n"; │ │ │ │ │ + 35 │ │ │ │ │ + 36 for (const auto& x : get(projection.images())) { │ │ │ │ │ + 37 const auto n = interpolate_unit_normals(x, get(normals)); │ │ │ │ │ + 38 out << n << "\n"; │ │ │ │ │ + 39 } │ │ │ │ │ + 40} │ │ │ │ │ + 41 │ │ │ │ │ + 42template │ │ │ │ │ +43void write_edge_intersection_points(const Projection& projection, │ │ │ │ │ +const Corners& corners, std::ostream& out) │ │ │ │ │ + 44{ │ │ │ │ │ + 45 using namespace ProjectionImplementation; │ │ │ │ │ + 46 using std::get; │ │ │ │ │ + 47 │ │ │ │ │ + 48 for (std::size_t i = 0; i < projection.numberOfEdgeIntersections(); ++i) { │ │ │ │ │ + 49 const auto& local = projection.edgeIntersections()[i].local; │ │ │ │ │ + 50 out << interpolate(local[0], get<0>(corners)) << "\n" │ │ │ │ │ + 51 << interpolate(local[1], get<1>(corners)) << "\n"; │ │ │ │ │ + 52 } │ │ │ │ │ + 53} │ │ │ │ │ + 54 │ │ │ │ │ + 55template │ │ │ │ │ +56void write_edge_intersection_normals(const Projection& │ │ │ │ │ +projection, const Normals& normals, std::ostream& out) │ │ │ │ │ + 57{ │ │ │ │ │ + 58 using namespace ProjectionImplementation; │ │ │ │ │ + 59 using std::get; │ │ │ │ │ + 60 │ │ │ │ │ + 61 for (std::size_t i = 0; i < projection.numberOfEdgeIntersections(); ++i) { │ │ │ │ │ + 62 const auto& local = projection.edgeIntersections()[i].local; │ │ │ │ │ + 63 const auto n0 = interpolate_unit_normals(local[0], get<0>(normals)); │ │ │ │ │ + 64 const auto n1 = interpolate_unit_normals(local[1], get<1>(normals)); │ │ │ │ │ + 65 │ │ │ │ │ + 66 out << n0 << "\n" │ │ │ │ │ + 67 << n1 << "\n"; │ │ │ │ │ + 68 } │ │ │ │ │ + 69} │ │ │ │ │ + 70 │ │ │ │ │ + 71template │ │ │ │ │ +72void write_success(const Projection& projection, std::ostream& │ │ │ │ │ +out) │ │ │ │ │ + 73{ │ │ │ │ │ + 74 using std::get; │ │ │ │ │ + 75 │ │ │ │ │ + 76 out << side << "\n"; │ │ │ │ │ + 77 │ │ │ │ │ + 78 const auto& success = get(projection.success()); │ │ │ │ │ + 79 for (std::size_t i = 0; i < success.size(); ++i) │ │ │ │ │ + 80 out << (success[i] ? "1\n" : "0\n"); │ │ │ │ │ + 81} │ │ │ │ │ + 82 │ │ │ │ │ + 83} /* namespace ProjectionWriterImplementation */ │ │ │ │ │ + 84 │ │ │ │ │ + 85template │ │ │ │ │ +86void write(const Projection& projection, │ │ │ │ │ + 87 const Corners& corners, │ │ │ │ │ + 88 const Normals& normals, │ │ │ │ │ + 89 std::ostream& out) │ │ │ │ │ + 90{ │ │ │ │ │ + 91 using namespace ProjectionWriterImplementation; │ │ │ │ │ + 92 │ │ │ │ │ + 93 const auto numberOfEdgeIntersections = projection.numberOfEdgeIntersections │ │ │ │ │ +(); │ │ │ │ │ + 94 const auto nPoints = 12 + 2 * numberOfEdgeIntersections; │ │ │ │ │ 95 │ │ │ │ │ - 101 Field m_epsilon = Field(1e-12); │ │ │ │ │ - 102 │ │ │ │ │ - 104 std::tuple m_images; │ │ │ │ │ - 105 │ │ │ │ │ - 107 std::tuple, std::bitset > m_success; │ │ │ │ │ - 108 │ │ │ │ │ - 110 unsigned m_number_of_edge_intersections; │ │ │ │ │ - 111 │ │ │ │ │ - 113 std::array m_edge_intersections; │ │ │ │ │ - 114 │ │ │ │ │ - 126 bool m_projection_valid; │ │ │ │ │ - 127 │ │ │ │ │ - 133 template │ │ │ │ │ - 134 void doProjection(const std::tuple& corners, const │ │ │ │ │ -std::tuple& normals); │ │ │ │ │ - 135 │ │ │ │ │ - 144 template │ │ │ │ │ - 145 void doInverseProjection(const std::tuple& corners, │ │ │ │ │ -const std::tuple& normals); │ │ │ │ │ - 146 │ │ │ │ │ - 155 template │ │ │ │ │ - 156 void doEdgeIntersection(const std::tuple& corners, │ │ │ │ │ -const std::tuple& normals); │ │ │ │ │ - 157 │ │ │ │ │ - 183 template │ │ │ │ │ - 184 inline bool projectionFeasible(const Coordinate& x, const Coordinate& nx, │ │ │ │ │ -const Coordinate& px, const Corners& corners, const Normals& normals) const; │ │ │ │ │ - 185 │ │ │ │ │ - 186public: │ │ │ │ │ - 191 Projection(const Field overlap = Field(0), const Field max_normal_product │ │ │ │ │ -= Field(-0.1)); │ │ │ │ │ - 192 │ │ │ │ │ - 198 void epsilon(const Field epsilon); │ │ │ │ │ - 199 │ │ │ │ │ - 212 template │ │ │ │ │ - 213 void project(const std::tuple& corners, const std:: │ │ │ │ │ -tuple& normals); │ │ │ │ │ - 214 │ │ │ │ │ -235 const std::tuple& images() const │ │ │ │ │ - 236 { return m_images; } │ │ │ │ │ - 237 │ │ │ │ │ -252 const std::tuple, std::bitset >& success() const │ │ │ │ │ - 253 { return m_success; } │ │ │ │ │ - 254 │ │ │ │ │ -262 unsigned numberOfEdgeIntersections() const │ │ │ │ │ - 263 { return m_number_of_edge_intersections; } │ │ │ │ │ - 264 │ │ │ │ │ -273 const std::array& edgeIntersections │ │ │ │ │ -() const │ │ │ │ │ - 274 { return m_edge_intersections; } │ │ │ │ │ - 275}; │ │ │ │ │ - 276 │ │ │ │ │ - 277} /* namespace GridGlue */ │ │ │ │ │ - 278} /* namespace Dune */ │ │ │ │ │ - 279 │ │ │ │ │ - 280#include "projection_impl.hh" │ │ │ │ │ - 281 │ │ │ │ │ - 282#endif │ │ │ │ │ -projection_impl.hh │ │ │ │ │ + 96 out << "# vtk DataFile Version2.0\n" │ │ │ │ │ + 97 << "Filename: projection\n" │ │ │ │ │ + 98 << "ASCII\n" │ │ │ │ │ + 99 << "DATASET UNSTRUCTURED_GRID\n" │ │ │ │ │ + 100 << "POINTS " << nPoints << " double\n"; │ │ │ │ │ + 101 write_points<0>(projection, corners, out); │ │ │ │ │ + 102 write_points<1>(projection, corners, out); │ │ │ │ │ + 103 write_edge_intersection_points(projection, corners, out); │ │ │ │ │ + 104 out << "CELLS " << (8 + numberOfEdgeIntersections) << " " << (26 + 3 * │ │ │ │ │ +numberOfEdgeIntersections) << "\n"; │ │ │ │ │ + 105 out << "3 0 1 2\n" "2 0 3\n" "2 1 4\n" "2 2 5\n" │ │ │ │ │ + 106 << "3 6 7 8\n" "2 6 9\n" "2 7 10\n" "2 8 11\n"; │ │ │ │ │ + 107 for (std::size_t i = 0; i < numberOfEdgeIntersections; ++i) │ │ │ │ │ + 108 out << "2 " << (12 + 2*i) << " " << (12 + 2*i + 1) << "\n"; │ │ │ │ │ + 109 out << "CELL_TYPES " << (8 + numberOfEdgeIntersections) << "\n" │ │ │ │ │ +"5\n3\n3\n3\n" "5\n3\n3\n3\n"; │ │ │ │ │ + 110 for (std::size_t i = 0; i < numberOfEdgeIntersections; ++i) │ │ │ │ │ + 111 out << "3\n"; │ │ │ │ │ + 112 out << "CELL_DATA " << (8 + numberOfEdgeIntersections) << "\n"; │ │ │ │ │ + 113 out << "SCALARS success int 1\n" │ │ │ │ │ + 114 << "LOOKUP_TABLE success\n"; │ │ │ │ │ + 115 write_success<0>(projection, out); │ │ │ │ │ + 116 write_success<1>(projection, out); │ │ │ │ │ + 117 for (std::size_t i = 0; i < numberOfEdgeIntersections; ++i) │ │ │ │ │ + 118 out << "2\n"; │ │ │ │ │ + 119 out << "LOOKUP_TABLE success 2\n" │ │ │ │ │ + 120 << "1.0 0.0 0.0 1.0\n" │ │ │ │ │ + 121 << "0.0 1.0 0.0 1.0\n"; │ │ │ │ │ + 122 out << "POINT_DATA " << nPoints << "\n" │ │ │ │ │ + 123 << "NORMALS normals double\n"; │ │ │ │ │ + 124 write_normals<0>(projection, normals, out); │ │ │ │ │ + 125 write_normals<1>(projection, normals, out); │ │ │ │ │ + 126 write_edge_intersection_normals(projection, normals, out); │ │ │ │ │ + 127} │ │ │ │ │ + 128 │ │ │ │ │ + 129template │ │ │ │ │ +130void write(const Projection& projection, │ │ │ │ │ + 131 const Corners& corners, │ │ │ │ │ + 132 const Normals& normals, │ │ │ │ │ + 133 const std::string& filename) │ │ │ │ │ + 134{ │ │ │ │ │ + 135 std::ofstream out(filename.c_str()); │ │ │ │ │ + 136 write(projection, corners, normals, out); │ │ │ │ │ + 137} │ │ │ │ │ + 138 │ │ │ │ │ + 139template │ │ │ │ │ +140void print(const Projection& projection, │ │ │ │ │ + 141 const Corners& corners, │ │ │ │ │ + 142 const Normals& normals) │ │ │ │ │ + 143{ │ │ │ │ │ + 144 using namespace ProjectionWriterImplementation; │ │ │ │ │ + 145 │ │ │ │ │ + 146 std::cout << "Side 0 corners and images:\n"; │ │ │ │ │ + 147 write_points<0>(projection, corners, std::cout); │ │ │ │ │ + 148 std::cout << "Side 0 success:\n"; │ │ │ │ │ + 149 write_success<0>(projection, std::cout); │ │ │ │ │ + 150 std::cout << "Side 1 corners and images:\n"; │ │ │ │ │ + 151 write_points<1>(projection, corners, std::cout); │ │ │ │ │ + 152 std::cout << "Side 1 success:\n"; │ │ │ │ │ + 153 write_success<1>(projection, std::cout); │ │ │ │ │ + 154 std::cout << "Side 0 normals and projected normals:\n"; │ │ │ │ │ + 155 write_normals<0>(projection, normals, std::cout); │ │ │ │ │ + 156 std::cout << "Side 1 normals and projected normals:\n"; │ │ │ │ │ + 157 write_normals<1>(projection, normals, std::cout); │ │ │ │ │ + 158 std::cout << projection.numberOfEdgeIntersections() << " edge │ │ │ │ │ +intersections:\n"; │ │ │ │ │ + 159 write_edge_intersection_points(projection, corners, std::cout); │ │ │ │ │ + 160} │ │ │ │ │ + 161 │ │ │ │ │ + 162} /* namespace GridGlue */ │ │ │ │ │ + 163} /* namespace Dune */ │ │ │ │ │ Dune │ │ │ │ │ Definition: gridglue.hh:37 │ │ │ │ │ +Dune::GridGlue::write │ │ │ │ │ +void write(const Projection< Coordinate > &projection, const Corners &corners, │ │ │ │ │ +const Normals &normals, std::ostream &out) │ │ │ │ │ +write projection in VTK format │ │ │ │ │ +Definition: projectionwriter_impl.hh:86 │ │ │ │ │ +Dune::GridGlue::print │ │ │ │ │ +void print(const Projection< Coordinate > &projection, const Corners &corners, │ │ │ │ │ +const Normals &normals) │ │ │ │ │ +Print information about the projection to std::cout stream. │ │ │ │ │ +Definition: projectionwriter_impl.hh:140 │ │ │ │ │ +Dune::GridGlue::ProjectionImplementation::interpolate │ │ │ │ │ +Corners::value_type interpolate(const Coordinate &x, const Corners &corners) │ │ │ │ │ +Definition: projection_impl.hh:70 │ │ │ │ │ +Dune::GridGlue::ProjectionImplementation::interpolate_unit_normals │ │ │ │ │ +Normals::value_type interpolate_unit_normals(const Coordinate &x, const Normals │ │ │ │ │ +&normals) │ │ │ │ │ +Definition: projection_impl.hh:91 │ │ │ │ │ +Dune::GridGlue::ProjectionWriterImplementation::write_normals │ │ │ │ │ +void write_normals(const Projection< Coordinate > &projection, const Normals │ │ │ │ │ +&normals, std::ostream &out) │ │ │ │ │ +Definition: projectionwriter_impl.hh:27 │ │ │ │ │ +Dune::GridGlue::ProjectionWriterImplementation::write_points │ │ │ │ │ +void write_points(const Projection< Coordinate > &projection, const Corners │ │ │ │ │ +&corners, std::ostream &out) │ │ │ │ │ +Definition: projectionwriter_impl.hh:11 │ │ │ │ │ +Dune::GridGlue::ProjectionWriterImplementation::write_success │ │ │ │ │ +void write_success(const Projection< Coordinate > &projection, std::ostream │ │ │ │ │ +&out) │ │ │ │ │ +Definition: projectionwriter_impl.hh:72 │ │ │ │ │ +Dune::GridGlue::ProjectionWriterImplementation::write_edge_intersection_points │ │ │ │ │ +void write_edge_intersection_points(const Projection< Coordinate > &projection, │ │ │ │ │ +const Corners &corners, std::ostream &out) │ │ │ │ │ +Definition: projectionwriter_impl.hh:43 │ │ │ │ │ +Dune::GridGlue::ProjectionWriterImplementation::write_edge_intersection_normals │ │ │ │ │ +void write_edge_intersection_normals(const Projection< Coordinate > │ │ │ │ │ +&projection, const Normals &normals, std::ostream &out) │ │ │ │ │ +Definition: projectionwriter_impl.hh:56 │ │ │ │ │ Dune::GridGlue::Projection │ │ │ │ │ Projection of a line (triangle) on another line (triangle). │ │ │ │ │ Definition: projection.hh:21 │ │ │ │ │ -Dune::GridGlue::Projection::Field │ │ │ │ │ -Coordinate::field_type Field │ │ │ │ │ -Scalar type. │ │ │ │ │ -Definition: projection.hh:61 │ │ │ │ │ -Dune::GridGlue::Projection::Projection │ │ │ │ │ -Projection(const Field overlap=Field(0), const Field max_normal_product=Field(- │ │ │ │ │ -0.1)) │ │ │ │ │ -Definition: projection_impl.hh:130 │ │ │ │ │ Dune::GridGlue::Projection::success │ │ │ │ │ const std::tuple< std::bitset< dim >, std::bitset< dim > > & success() const │ │ │ │ │ Indicate whether projection (inverse projection) is valid for each corner or │ │ │ │ │ not. │ │ │ │ │ Definition: projection.hh:252 │ │ │ │ │ -Dune::GridGlue::Projection::maxEdgeIntersections │ │ │ │ │ -static constexpr unsigned maxEdgeIntersections │ │ │ │ │ -maximum number of edge-edge intersections │ │ │ │ │ -Definition: projection.hh:54 │ │ │ │ │ -Dune::GridGlue::Projection::Preimages │ │ │ │ │ -Images Preimages │ │ │ │ │ -Definition: projection.hh:78 │ │ │ │ │ -Dune::GridGlue::Projection::Images │ │ │ │ │ -std::array< Coordinate, dim > Images │ │ │ │ │ -List of corner images. │ │ │ │ │ -Definition: projection.hh:70 │ │ │ │ │ -Dune::GridGlue::Projection::epsilon │ │ │ │ │ -void epsilon(const Field epsilon) │ │ │ │ │ -Set epsilon used for floating-point comparisons. │ │ │ │ │ -Definition: projection_impl.hh:140 │ │ │ │ │ -Dune::GridGlue::Projection::project │ │ │ │ │ -void project(const std::tuple< Corners &, Corners & > &corners, const std:: │ │ │ │ │ -tuple< Normals &, Normals & > &normals) │ │ │ │ │ -Do the actual projection. │ │ │ │ │ -Definition: projection_impl.hh:469 │ │ │ │ │ -Dune::GridGlue::Projection::dim │ │ │ │ │ -static constexpr unsigned dim │ │ │ │ │ -dimension of coordinates │ │ │ │ │ -Definition: projection.hh:47 │ │ │ │ │ Dune::GridGlue::Projection::numberOfEdgeIntersections │ │ │ │ │ unsigned numberOfEdgeIntersections() const │ │ │ │ │ Number of edge intersections. │ │ │ │ │ Definition: projection.hh:262 │ │ │ │ │ Dune::GridGlue::Projection::images │ │ │ │ │ const std::tuple< Images, Preimages > & images() const │ │ │ │ │ Images and preimages of corners. │ │ │ │ │ Definition: projection.hh:235 │ │ │ │ │ Dune::GridGlue::Projection::edgeIntersections │ │ │ │ │ const std::array< EdgeIntersection, maxEdgeIntersections > & edgeIntersections │ │ │ │ │ () const │ │ │ │ │ Edge-edge intersections. │ │ │ │ │ Definition: projection.hh:273 │ │ │ │ │ -Dune::GridGlue::Projection::EdgeIntersection │ │ │ │ │ -Intersection between two edges of a triangle. │ │ │ │ │ -Definition: projection.hh:29 │ │ │ │ │ -Dune::GridGlue::Projection::EdgeIntersection::local │ │ │ │ │ -std::array< Coordinate, 2 > local │ │ │ │ │ -Local coordinates of intersection and distance along normals. │ │ │ │ │ -Definition: projection.hh:41 │ │ │ │ │ -Dune::GridGlue::Projection::EdgeIntersection::edge │ │ │ │ │ -std::array< unsigned, 2 > edge │ │ │ │ │ -Edge numbers in image and preimage triangle. │ │ │ │ │ -Definition: projection.hh:33 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00047.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: ringcomm.hh File Reference │ │ │ │ +dune-grid-glue: crossproduct.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -64,77 +64,35 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Namespaces | │ │ │ │ -Macros | │ │ │ │ Functions
│ │ │ │ -
ringcomm.hh File Reference
│ │ │ │ +
crossproduct.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <mpi.h>
│ │ │ │ -#include <functional>
│ │ │ │ -#include <utility>
│ │ │ │ -#include <dune/common/fvector.hh>
│ │ │ │ -#include <dune/common/hybridutilities.hh>
│ │ │ │ -#include <dune/geometry/type.hh>
│ │ │ │ -
│ │ │ │ + │ │ │ │

Go to the source code of this file.

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

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::Parallel
namespace  Dune::GridGlue
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Macros

#define CheckMPIStatus(A, B)   {}
 
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ Functions

template<typename OP , typename... Args>
void Dune::Parallel::MPI_AllApply (MPI_Comm mpicomm, OP &&op, const Args &... data)
 apply an operator locally to a difstributed data set More...
 
template<class T , int dim>
static Dune::FieldVector< T, dim > Dune::GridGlue::crossProduct (const Dune::FieldVector< T, dim > &a, const Dune::FieldVector< T, dim > &b)
 compute cross product More...
 
│ │ │ │ -

Macro Definition Documentation

│ │ │ │ - │ │ │ │ -

◆ CheckMPIStatus

│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
#define CheckMPIStatus( A,
 
)   {}
│ │ │ │ -
│ │ │ │ -
Todo:
Implement MPI Status check with exception handling
│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,40 +5,25 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * common │ │ │ │ │ -Namespaces | Macros | Functions │ │ │ │ │ -ringcomm.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +Namespaces | Functions │ │ │ │ │ +crossproduct.hh File Reference │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ -namespace  Dune::Parallel │ │ │ │ │ -  │ │ │ │ │ - Macros │ │ │ │ │ -#define CheckMPIStatus(A, B)   {} │ │ │ │ │ +namespace  Dune::GridGlue │ │ │ │ │   │ │ │ │ │ Functions │ │ │ │ │ -template │ │ │ │ │ -void Dune::Parallel::MPI_AllApply (MPI_Comm mpicomm, OP &&op, const Args &... │ │ │ │ │ - data) │ │ │ │ │ -  apply an operator locally to a difstributed data set More... │ │ │ │ │ +template │ │ │ │ │ +static Dune::FieldVector< T, dim > Dune::GridGlue::crossProduct (const Dune:: │ │ │ │ │ + FieldVector< T, dim > &a, const Dune:: │ │ │ │ │ + FieldVector< T, dim > &b) │ │ │ │ │ +  compute cross product More... │ │ │ │ │   │ │ │ │ │ -***** Macro Definition Documentation ***** │ │ │ │ │ -***** ◆ CheckMPIStatus ***** │ │ │ │ │ -#define CheckMPIStatus (  A, │ │ │ │ │ -  B  │ │ │ │ │ - )    {} │ │ │ │ │ - Todo: │ │ │ │ │ - Implement MPI Status check with exception handling │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00047_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: ringcomm.hh Source File │ │ │ │ +dune-grid-glue: crossproduct.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,305 +62,46 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
ringcomm.hh
│ │ │ │ +
crossproduct.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 © DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │ -
4// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
│ │ │ │ -
5/* IMPLEMENTATION OF CLASS G R I D G L U E */
│ │ │ │ -
6
│ │ │ │ -
8#define CheckMPIStatus(A,B) {}
│ │ │ │ -
9
│ │ │ │ -
10#include <mpi.h>
│ │ │ │ -
11#include <functional>
│ │ │ │ -
12#include <utility>
│ │ │ │ -
13
│ │ │ │ -
14#include <dune/common/fvector.hh>
│ │ │ │ -
15#include <dune/common/hybridutilities.hh>
│ │ │ │ -
16
│ │ │ │ -
17#include <dune/geometry/type.hh>
│ │ │ │ -
18
│ │ │ │ -
19namespace Dune {
│ │ │ │ -
20namespace Parallel {
│ │ │ │ -
21
│ │ │ │ -
22 namespace Impl {
│ │ │ │ -
23
│ │ │ │ -
25 template<typename T>
│ │ │ │ -
26 struct MPITypeInfo {};
│ │ │ │ -
27
│ │ │ │ -
28 template<>
│ │ │ │ -
29 struct MPITypeInfo< int >
│ │ │ │ -
30 {
│ │ │ │ -
31 static const unsigned int size = 1;
│ │ │ │ -
32 static inline MPI_Datatype getType()
│ │ │ │ -
33 {
│ │ │ │ -
34 return MPI_INT;
│ │ │ │ -
35 }
│ │ │ │ -
36 };
│ │ │ │ -
37
│ │ │ │ -
38 template<typename K, int N>
│ │ │ │ -
39 struct MPITypeInfo< Dune::FieldVector<K,N> >
│ │ │ │ -
40 {
│ │ │ │ -
41 static const unsigned int size = N;
│ │ │ │ -
42 static inline MPI_Datatype getType()
│ │ │ │ -
43 {
│ │ │ │ -
44 return Dune::MPITraits<K>::getType();
│ │ │ │ -
45 }
│ │ │ │ -
46 };
│ │ │ │ -
47
│ │ │ │ -
48 template<>
│ │ │ │ -
49 struct MPITypeInfo< unsigned int >
│ │ │ │ -
50 {
│ │ │ │ -
51 static const unsigned int size = 1;
│ │ │ │ -
52 static inline MPI_Datatype getType()
│ │ │ │ -
53 {
│ │ │ │ -
54 return MPI_UNSIGNED;
│ │ │ │ -
55 }
│ │ │ │ -
56 };
│ │ │ │ -
57
│ │ │ │ -
58 template<>
│ │ │ │ -
59 struct MPITypeInfo< Dune::GeometryType >
│ │ │ │ -
60 {
│ │ │ │ -
61 static const unsigned int size = 1;
│ │ │ │ -
62 static inline MPI_Datatype getType()
│ │ │ │ -
63 {
│ │ │ │ -
64 return Dune::MPITraits< Dune::GeometryType >::getType();
│ │ │ │ -
65 }
│ │ │ │ -
66 };
│ │ │ │ -
67
│ │ │ │ -
68 template<typename T>
│ │ │ │ -
69 void MPI_SetVectorSize(
│ │ │ │ -
70 std::vector<T> & data,
│ │ │ │ -
71 MPI_Status & status)
│ │ │ │ -
72 {
│ │ │ │ -
73 typedef MPITypeInfo<T> Info;
│ │ │ │ -
74 int sz;
│ │ │ │ -
75 MPI_Get_count(&status, Info::getType(), &sz);
│ │ │ │ -
76 assert(sz%Info::size == 0);
│ │ │ │ -
77 data.resize(sz/Info::size);
│ │ │ │ -
78 }
│ │ │ │ -
79
│ │ │ │ -
89 template<typename T>
│ │ │ │ -
90 void MPI_SendVectorInRing(
│ │ │ │ -
91 std::vector<T> & data,
│ │ │ │ -
92 std::vector<T> & next,
│ │ │ │ -
93 int tag,
│ │ │ │ -
94 int rightrank,
│ │ │ │ -
95 int leftrank,
│ │ │ │ -
96 MPI_Comm comm,
│ │ │ │ -
97 MPI_Request& r_send,
│ │ │ │ -
98 MPI_Request& r_recv
│ │ │ │ -
99 )
│ │ │ │ -
100 {
│ │ │ │ -
101 // mpi status stuff
│ │ │ │ -
102 [[maybe_unused]] int result = 0;
│ │ │ │ -
103 typedef MPITypeInfo<T> Info;
│ │ │ │ -
104 // resize next buffer to maximum size
│ │ │ │ -
105 next.resize(next.capacity());
│ │ │ │ -
106 // send data (explicitly send data.size elements)
│ │ │ │ -
107 result =
│ │ │ │ -
108 MPI_Isend(
│ │ │ │ -
109 &(data[0]), Info::size*data.size(), Info::getType(), rightrank, tag,
│ │ │ │ -
110 comm, &r_send);
│ │ │ │ -
111 // receive up to maximum size. The acutal size is stored in the status
│ │ │ │ -
112 result =
│ │ │ │ -
113 MPI_Irecv(
│ │ │ │ -
114 &(next[0]), Info::size*next.size(), Info::getType(), leftrank, tag,
│ │ │ │ -
115 comm, &r_recv);
│ │ │ │ -
116 // // check result
│ │ │ │ -
117 // MPI_Status status;
│ │ │ │ -
118 // CheckMPIStatus(result, status);
│ │ │ │ -
119 }
│ │ │ │ -
120
│ │ │ │ -
121 template<typename T>
│ │ │ │ -
122 using ptr_t = T*;
│ │ │ │ -
123
│ │ │ │ -
124 /* these helper structs are needed as long as we still support
│ │ │ │ -
125 C++11, as we can't use variadic lambdas */
│ │ │ │ -
126 template<typename... Args>
│ │ │ │ -
127 struct call_MPI_SendVectorInRing
│ │ │ │ -
128 {
│ │ │ │ -
129 std::tuple<Args...> & remotedata;
│ │ │ │ -
130 std::tuple<Args...> & nextdata;
│ │ │ │ -
131 int & tag;
│ │ │ │ -
132 int & rightrank;
│ │ │ │ -
133 int & leftrank;
│ │ │ │ -
134 MPI_Comm & mpicomm;
│ │ │ │ -
135 std::array<MPI_Request,sizeof...(Args)> & requests_send;
│ │ │ │ -
136 std::array<MPI_Request,sizeof...(Args)> & requests_recv;
│ │ │ │ -
137
│ │ │ │ -
138 template<typename I>
│ │ │ │ -
139 void operator()(I i)
│ │ │ │ -
140 {
│ │ │ │ -
141 MPI_SendVectorInRing(
│ │ │ │ -
142 std::get<i>(remotedata),
│ │ │ │ -
143 std::get<i>(nextdata),
│ │ │ │ -
144 tag+i,
│ │ │ │ -
145 rightrank, leftrank, mpicomm,
│ │ │ │ -
146 requests_send[i],
│ │ │ │ -
147 requests_recv[i]);
│ │ │ │ -
148 }
│ │ │ │ -
149 };
│ │ │ │ -
150 template<typename... Args>
│ │ │ │ -
151 struct call_MPI_SetVectorSize
│ │ │ │ -
152 {
│ │ │ │ -
153 std::tuple<Args...> & nextdata;
│ │ │ │ -
154 std::array<MPI_Status,sizeof...(Args)> & status_recv;
│ │ │ │ -
155
│ │ │ │ -
156 template<typename I>
│ │ │ │ -
157 void operator()(I i)
│ │ │ │ -
158 {
│ │ │ │ -
159 MPI_SetVectorSize(std::get<i>(nextdata),status_recv[i]);
│ │ │ │ -
160 }
│ │ │ │ -
161 };
│ │ │ │ -
162
│ │ │ │ -
163 template<typename OP, std::size_t... Indices, typename... Args>
│ │ │ │ -
164 void MPI_AllApply_impl(MPI_Comm mpicomm,
│ │ │ │ -
165 OP && op,
│ │ │ │ -
166 std::index_sequence<Indices...> indices,
│ │ │ │ -
167 const Args&... data)
│ │ │ │ -
168 {
│ │ │ │ -
169 constexpr std::size_t N = sizeof...(Args);
│ │ │ │ -
170 int myrank = 0;
│ │ │ │ -
171 int commsize = 0;
│ │ │ │ -
172#if HAVE_MPI
│ │ │ │ -
173 MPI_Comm_rank(mpicomm, &myrank);
│ │ │ │ -
174 MPI_Comm_size(mpicomm, &commsize);
│ │ │ │ -
175#endif // HAVE_MPI
│ │ │ │ -
176
│ │ │ │ -
177 if (commsize > 1)
│ │ │ │ -
178 {
│ │ │ │ -
179#ifdef DEBUG_GRIDGLUE_PARALLELMERGE
│ │ │ │ -
180 std::cout << myrank << " Start Communication, size " << commsize << std::endl;
│ │ │ │ -
181#endif
│ │ │ │ -
182
│ │ │ │ -
183 // get data sizes
│ │ │ │ -
184 std::array<unsigned int, N> size({ ((unsigned int)data.size())... });
│ │ │ │ -
185
│ │ │ │ -
186 // communicate max data size
│ │ │ │ -
187 std::array<unsigned int, N> maxSize;
│ │ │ │ -
188 MPI_Allreduce(&size, &maxSize,
│ │ │ │ -
189 size.size(), MPI_UNSIGNED, MPI_MAX, mpicomm);
│ │ │ │ -
190#ifdef DEBUG_GRIDGLUE_PARALLELMERGE
│ │ │ │ -
191 std::cout << myrank << " maxSize " << "done... " << std::endl;
│ │ │ │ -
192#endif
│ │ │ │ -
193
│ │ │ │ -
194 // allocate receiving buffers with maxsize to ensure sufficient buffer size for communication
│ │ │ │ -
195 std::tuple<Args...> remotedata { Args(maxSize[Indices])... };
│ │ │ │ -
196
│ │ │ │ -
197 // copy local data to receiving buffer
│ │ │ │ -
198 remotedata = std::tie(data...);
│ │ │ │ -
199
│ │ │ │ -
200 // allocate second set of receiving buffers necessary for async communication
│ │ │ │ -
201 std::tuple<Args...> nextdata { Args(maxSize[Indices])... };
│ │ │ │ -
202
│ │ │ │ -
203 // communicate data in the ring
│ │ │ │ -
204 int rightrank = (myrank + 1 + commsize) % commsize;
│ │ │ │ -
205 int leftrank = (myrank - 1 + commsize) % commsize;
│ │ │ │ -
206
│ │ │ │ -
207 std::cout << myrank << ": size = " << commsize << std::endl;
│ │ │ │ -
208 std::cout << myrank << ": left = " << leftrank
│ │ │ │ -
209 << " right = " << rightrank << std::endl;
│ │ │ │ -
210
│ │ │ │ -
211 // currently the remote data is our own data
│ │ │ │ -
212 int remoterank = myrank;
│ │ │ │ -
213
│ │ │ │ -
214 for (int i=1; i<commsize; i++)
│ │ │ │ -
215 {
│ │ │ │ -
216 // in this iteration we will receive data from nextrank
│ │ │ │ -
217 int nextrank = (myrank - i + commsize) % commsize;
│ │ │ │ -
218
│ │ │ │ -
219 std::cout << myrank << ": next = " << nextrank << std::endl;
│ │ │ │ -
220
│ │ │ │ -
221 // send remote data to right neighbor and receive from left neighbor
│ │ │ │ -
222 std::array<MPI_Request,N> requests_send;
│ │ │ │ -
223 std::array<MPI_Request,N> requests_recv;
│ │ │ │ -
224
│ │ │ │ -
225 int tag = 0;
│ │ │ │ -
226 Dune::Hybrid::forEach(indices,
│ │ │ │ -
227 // [&](auto i){
│ │ │ │ -
228 // MPI_SendVectorInRing(
│ │ │ │ -
229 // std::get<i>(remotedata),
│ │ │ │ -
230 // std::get<i>(nextdata),
│ │ │ │ -
231 // tag+i,
│ │ │ │ -
232 // rightrank, leftrank, mpicomm,
│ │ │ │ -
233 // requests_send[i],
│ │ │ │ -
234 // requests_recv[i]);
│ │ │ │ -
235 // });
│ │ │ │ -
236 call_MPI_SendVectorInRing<Args...>({
│ │ │ │ -
237 remotedata,
│ │ │ │ -
238 nextdata,
│ │ │ │ -
239 tag,
│ │ │ │ -
240 rightrank, leftrank, mpicomm,
│ │ │ │ -
241 requests_send,
│ │ │ │ -
242 requests_recv
│ │ │ │ -
243 }));
│ │ │ │ -
244
│ │ │ │ -
245 // apply operator
│ │ │ │ -
246 op(remoterank,std::get<Indices>(remotedata)...);
│ │ │ │ -
247
│ │ │ │ -
248 // wait for communication to finalize
│ │ │ │ -
249 std::array<MPI_Status,N> status_send;
│ │ │ │ -
250 std::array<MPI_Status,N> status_recv;
│ │ │ │ -
251 MPI_Waitall(N,&requests_recv[0],&status_recv[0]);
│ │ │ │ -
252
│ │ │ │ -
253 // we finished receiving from nextrank and thus remoterank = nextrank
│ │ │ │ -
254 remoterank = nextrank;
│ │ │ │ -
255
│ │ │ │ -
256 // get current data sizes
│ │ │ │ -
257 // and resize vectors
│ │ │ │ -
258 Dune::Hybrid::forEach(indices,
│ │ │ │ -
259 // [&](auto i){
│ │ │ │ -
260 // MPI_SetVectorSize(std::get<i>(nextdata),status_recv[i]);
│ │ │ │ -
261 // });
│ │ │ │ -
262 call_MPI_SetVectorSize<Args...>({
│ │ │ │ -
263 nextdata, status_recv
│ │ │ │ -
264 }));
│ │ │ │ -
265
│ │ │ │ -
266 MPI_Waitall(N,&requests_send[0],&status_send[0]);
│ │ │ │ -
267
│ │ │ │ -
268 // swap the communication buffers
│ │ │ │ -
269 std::swap(remotedata,nextdata);
│ │ │ │ -
270 }
│ │ │ │ -
271
│ │ │ │ -
272 // last apply (or the only one in the case of sequential application)
│ │ │ │ -
273 op(remoterank,std::get<Indices>(remotedata)...);
│ │ │ │ -
274 }
│ │ │ │ -
275 else // sequential
│ │ │ │ -
276 {
│ │ │ │ -
277 op(myrank,data...);
│ │ │ │ -
278 }
│ │ │ │ -
279 }
│ │ │ │ -
280
│ │ │ │ -
281 } // end namespace Impl
│ │ │ │ -
282
│ │ │ │ -
296template<typename OP, typename... Args>
│ │ │ │ -
297void MPI_AllApply(MPI_Comm mpicomm,
│ │ │ │ -
298 OP && op,
│ │ │ │ -
299 const Args& ... data)
│ │ │ │ -
300{
│ │ │ │ -
301 Impl::MPI_AllApply_impl(
│ │ │ │ -
302 mpicomm,
│ │ │ │ -
303 std::forward<OP>(op),
│ │ │ │ -
304 std::make_index_sequence<sizeof...(Args)>(),
│ │ │ │ -
305 data...
│ │ │ │ -
306 );
│ │ │ │ -
307}
│ │ │ │ -
308
│ │ │ │ -
309} // end namespace Parallel
│ │ │ │ -
310} // end namespace Dune
│ │ │ │ +Go to the documentation of this file.
1// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │ +
2// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
│ │ │ │ +
3#ifndef DUNE_GRIDGLUE_COMMON_CROSSPRODUCT_HH
│ │ │ │ +
4#define DUNE_GRIDGLUE_COMMON_CROSSPRODUCT_HH 1
│ │ │ │ +
5
│ │ │ │ +
6namespace Dune {
│ │ │ │ +
7namespace GridGlue {
│ │ │ │ +
8
│ │ │ │ +
14template <class T, int dim>
│ │ │ │ +
15static Dune::FieldVector<T,dim> crossProduct(const Dune::FieldVector<T,dim>& a,
│ │ │ │ +
16 const Dune::FieldVector<T,dim>& b)
│ │ │ │ +
17{
│ │ │ │ +
18 if (dim!=3)
│ │ │ │ +
19 DUNE_THROW(Dune::NotImplemented, "crossProduct does not work for dimension " << dim);
│ │ │ │ +
20
│ │ │ │ +
21 Dune::FieldVector<T,dim> c;
│ │ │ │ +
22 c[0] = a[1]*b[2] - a[2]*b[1];
│ │ │ │ +
23 c[1] = a[2]*b[0] - a[0]*b[2];
│ │ │ │ +
24 c[2] = a[0]*b[1] - a[1]*b[0];
│ │ │ │ +
25
│ │ │ │ +
26 return c;
│ │ │ │ +
27}
│ │ │ │ +
28
│ │ │ │ +
29} /* namespace GridGlue */
│ │ │ │ +
30} /* namespace Dune */
│ │ │ │ +
31
│ │ │ │ +
32#endif
│ │ │ │
Definition: gridglue.hh:37
│ │ │ │ -
void MPI_AllApply(MPI_Comm mpicomm, OP &&op, const Args &... data)
apply an operator locally to a difstributed data set
Definition: ringcomm.hh:297
│ │ │ │ +
static Dune::FieldVector< T, dim > crossProduct(const Dune::FieldVector< T, dim > &a, const Dune::FieldVector< T, dim > &b)
compute cross product
Definition: crossproduct.hh:15
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,309 +5,50 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * common │ │ │ │ │ -ringcomm.hh │ │ │ │ │ +crossproduct.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 © DUNE Project contributors, see file │ │ │ │ │ + 1// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ - 4// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only- │ │ │ │ │ + 2// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only- │ │ │ │ │ with-dune-grid-glue-exception │ │ │ │ │ - 5/* IMPLEMENTATION OF CLASS G R I D G L U E */ │ │ │ │ │ - 6 │ │ │ │ │ -8#define CheckMPIStatus(A,B) {} │ │ │ │ │ - 9 │ │ │ │ │ - 10#include │ │ │ │ │ - 11#include │ │ │ │ │ - 12#include │ │ │ │ │ - 13 │ │ │ │ │ - 14#include │ │ │ │ │ - 15#include │ │ │ │ │ - 16 │ │ │ │ │ - 17#include │ │ │ │ │ - 18 │ │ │ │ │ - 19namespace Dune { │ │ │ │ │ -20namespace Parallel { │ │ │ │ │ - 21 │ │ │ │ │ - 22 namespace Impl { │ │ │ │ │ - 23 │ │ │ │ │ - 25 template │ │ │ │ │ - 26 struct MPITypeInfo {}; │ │ │ │ │ - 27 │ │ │ │ │ - 28 template<> │ │ │ │ │ - 29 struct MPITypeInfo< int > │ │ │ │ │ - 30 { │ │ │ │ │ - 31 static const unsigned int size = 1; │ │ │ │ │ - 32 static inline MPI_Datatype getType() │ │ │ │ │ - 33 { │ │ │ │ │ - 34 return MPI_INT; │ │ │ │ │ - 35 } │ │ │ │ │ - 36 }; │ │ │ │ │ - 37 │ │ │ │ │ - 38 template │ │ │ │ │ - 39 struct MPITypeInfo< Dune::FieldVector > │ │ │ │ │ - 40 { │ │ │ │ │ - 41 static const unsigned int size = N; │ │ │ │ │ - 42 static inline MPI_Datatype getType() │ │ │ │ │ - 43 { │ │ │ │ │ - 44 return Dune::MPITraits::getType(); │ │ │ │ │ - 45 } │ │ │ │ │ - 46 }; │ │ │ │ │ - 47 │ │ │ │ │ - 48 template<> │ │ │ │ │ - 49 struct MPITypeInfo< unsigned int > │ │ │ │ │ - 50 { │ │ │ │ │ - 51 static const unsigned int size = 1; │ │ │ │ │ - 52 static inline MPI_Datatype getType() │ │ │ │ │ - 53 { │ │ │ │ │ - 54 return MPI_UNSIGNED; │ │ │ │ │ - 55 } │ │ │ │ │ - 56 }; │ │ │ │ │ - 57 │ │ │ │ │ - 58 template<> │ │ │ │ │ - 59 struct MPITypeInfo< Dune::GeometryType > │ │ │ │ │ - 60 { │ │ │ │ │ - 61 static const unsigned int size = 1; │ │ │ │ │ - 62 static inline MPI_Datatype getType() │ │ │ │ │ - 63 { │ │ │ │ │ - 64 return Dune::MPITraits< Dune::GeometryType >::getType(); │ │ │ │ │ - 65 } │ │ │ │ │ - 66 }; │ │ │ │ │ - 67 │ │ │ │ │ - 68 template │ │ │ │ │ - 69 void MPI_SetVectorSize( │ │ │ │ │ - 70 std::vector & data, │ │ │ │ │ - 71 MPI_Status & status) │ │ │ │ │ - 72 { │ │ │ │ │ - 73 typedef MPITypeInfo Info; │ │ │ │ │ - 74 int sz; │ │ │ │ │ - 75 MPI_Get_count(&status, Info::getType(), &sz); │ │ │ │ │ - 76 assert(sz%Info::size == 0); │ │ │ │ │ - 77 data.resize(sz/Info::size); │ │ │ │ │ - 78 } │ │ │ │ │ - 79 │ │ │ │ │ - 89 template │ │ │ │ │ - 90 void MPI_SendVectorInRing( │ │ │ │ │ - 91 std::vector & data, │ │ │ │ │ - 92 std::vector & next, │ │ │ │ │ - 93 int tag, │ │ │ │ │ - 94 int rightrank, │ │ │ │ │ - 95 int leftrank, │ │ │ │ │ - 96 MPI_Comm comm, │ │ │ │ │ - 97 MPI_Request& r_send, │ │ │ │ │ - 98 MPI_Request& r_recv │ │ │ │ │ - 99 ) │ │ │ │ │ - 100 { │ │ │ │ │ - 101 // mpi status stuff │ │ │ │ │ - 102 [[maybe_unused]] int result = 0; │ │ │ │ │ - 103 typedef MPITypeInfo Info; │ │ │ │ │ - 104 // resize next buffer to maximum size │ │ │ │ │ - 105 next.resize(next.capacity()); │ │ │ │ │ - 106 // send data (explicitly send data.size elements) │ │ │ │ │ - 107 result = │ │ │ │ │ - 108 MPI_Isend( │ │ │ │ │ - 109 &(data[0]), Info::size*data.size(), Info::getType(), rightrank, tag, │ │ │ │ │ - 110 comm, &r_send); │ │ │ │ │ - 111 // receive up to maximum size. The acutal size is stored in the status │ │ │ │ │ - 112 result = │ │ │ │ │ - 113 MPI_Irecv( │ │ │ │ │ - 114 &(next[0]), Info::size*next.size(), Info::getType(), leftrank, tag, │ │ │ │ │ - 115 comm, &r_recv); │ │ │ │ │ - 116 // // check result │ │ │ │ │ - 117 // MPI_Status status; │ │ │ │ │ - 118 // CheckMPIStatus(result, status); │ │ │ │ │ - 119 } │ │ │ │ │ - 120 │ │ │ │ │ - 121 template │ │ │ │ │ - 122 using ptr_t = T*; │ │ │ │ │ - 123 │ │ │ │ │ - 124 /* these helper structs are needed as long as we still support │ │ │ │ │ - 125 C++11, as we can't use variadic lambdas */ │ │ │ │ │ - 126 template │ │ │ │ │ - 127 struct call_MPI_SendVectorInRing │ │ │ │ │ - 128 { │ │ │ │ │ - 129 std::tuple & remotedata; │ │ │ │ │ - 130 std::tuple & nextdata; │ │ │ │ │ - 131 int & tag; │ │ │ │ │ - 132 int & rightrank; │ │ │ │ │ - 133 int & leftrank; │ │ │ │ │ - 134 MPI_Comm & mpicomm; │ │ │ │ │ - 135 std::array & requests_send; │ │ │ │ │ - 136 std::array & requests_recv; │ │ │ │ │ - 137 │ │ │ │ │ - 138 template │ │ │ │ │ - 139 void operator()(I i) │ │ │ │ │ - 140 { │ │ │ │ │ - 141 MPI_SendVectorInRing( │ │ │ │ │ - 142 std::get(remotedata), │ │ │ │ │ - 143 std::get(nextdata), │ │ │ │ │ - 144 tag+i, │ │ │ │ │ - 145 rightrank, leftrank, mpicomm, │ │ │ │ │ - 146 requests_send[i], │ │ │ │ │ - 147 requests_recv[i]); │ │ │ │ │ - 148 } │ │ │ │ │ - 149 }; │ │ │ │ │ - 150 template │ │ │ │ │ - 151 struct call_MPI_SetVectorSize │ │ │ │ │ - 152 { │ │ │ │ │ - 153 std::tuple & nextdata; │ │ │ │ │ - 154 std::array & status_recv; │ │ │ │ │ - 155 │ │ │ │ │ - 156 template │ │ │ │ │ - 157 void operator()(I i) │ │ │ │ │ - 158 { │ │ │ │ │ - 159 MPI_SetVectorSize(std::get(nextdata),status_recv[i]); │ │ │ │ │ - 160 } │ │ │ │ │ - 161 }; │ │ │ │ │ - 162 │ │ │ │ │ - 163 template │ │ │ │ │ - 164 void MPI_AllApply_impl(MPI_Comm mpicomm, │ │ │ │ │ - 165 OP && op, │ │ │ │ │ - 166 std::index_sequence indices, │ │ │ │ │ - 167 const Args&... data) │ │ │ │ │ - 168 { │ │ │ │ │ - 169 constexpr std::size_t N = sizeof...(Args); │ │ │ │ │ - 170 int myrank = 0; │ │ │ │ │ - 171 int commsize = 0; │ │ │ │ │ - 172#if HAVE_MPI │ │ │ │ │ - 173 MPI_Comm_rank(mpicomm, &myrank); │ │ │ │ │ - 174 MPI_Comm_size(mpicomm, &commsize); │ │ │ │ │ - 175#endif // HAVE_MPI │ │ │ │ │ - 176 │ │ │ │ │ - 177 if (commsize > 1) │ │ │ │ │ - 178 { │ │ │ │ │ - 179#ifdef DEBUG_GRIDGLUE_PARALLELMERGE │ │ │ │ │ - 180 std::cout << myrank << " Start Communication, size " << commsize << std:: │ │ │ │ │ -endl; │ │ │ │ │ - 181#endif │ │ │ │ │ - 182 │ │ │ │ │ - 183 // get data sizes │ │ │ │ │ - 184 std::array size({ ((unsigned int)data.size())... }); │ │ │ │ │ - 185 │ │ │ │ │ - 186 // communicate max data size │ │ │ │ │ - 187 std::array maxSize; │ │ │ │ │ - 188 MPI_Allreduce(&size, &maxSize, │ │ │ │ │ - 189 size.size(), MPI_UNSIGNED, MPI_MAX, mpicomm); │ │ │ │ │ - 190#ifdef DEBUG_GRIDGLUE_PARALLELMERGE │ │ │ │ │ - 191 std::cout << myrank << " maxSize " << "done... " << std::endl; │ │ │ │ │ - 192#endif │ │ │ │ │ - 193 │ │ │ │ │ - 194 // allocate receiving buffers with maxsize to ensure sufficient buffer │ │ │ │ │ -size for communication │ │ │ │ │ - 195 std::tuple remotedata { Args(maxSize[Indices])... }; │ │ │ │ │ - 196 │ │ │ │ │ - 197 // copy local data to receiving buffer │ │ │ │ │ - 198 remotedata = std::tie(data...); │ │ │ │ │ - 199 │ │ │ │ │ - 200 // allocate second set of receiving buffers necessary for async │ │ │ │ │ -communication │ │ │ │ │ - 201 std::tuple nextdata { Args(maxSize[Indices])... }; │ │ │ │ │ - 202 │ │ │ │ │ - 203 // communicate data in the ring │ │ │ │ │ - 204 int rightrank = (myrank + 1 + commsize) % commsize; │ │ │ │ │ - 205 int leftrank = (myrank - 1 + commsize) % commsize; │ │ │ │ │ - 206 │ │ │ │ │ - 207 std::cout << myrank << ": size = " << commsize << std::endl; │ │ │ │ │ - 208 std::cout << myrank << ": left = " << leftrank │ │ │ │ │ - 209 << " right = " << rightrank << std::endl; │ │ │ │ │ - 210 │ │ │ │ │ - 211 // currently the remote data is our own data │ │ │ │ │ - 212 int remoterank = myrank; │ │ │ │ │ - 213 │ │ │ │ │ - 214 for (int i=1; i c; │ │ │ │ │ + 22 c[0] = a[1]*b[2] - a[2]*b[1]; │ │ │ │ │ + 23 c[1] = a[2]*b[0] - a[0]*b[2]; │ │ │ │ │ + 24 c[2] = a[0]*b[1] - a[1]*b[0]; │ │ │ │ │ + 25 │ │ │ │ │ + 26 return c; │ │ │ │ │ + 27} │ │ │ │ │ + 28 │ │ │ │ │ + 29} /* namespace GridGlue */ │ │ │ │ │ + 30} /* namespace Dune */ │ │ │ │ │ + 31 │ │ │ │ │ + 32#endif │ │ │ │ │ Dune │ │ │ │ │ Definition: gridglue.hh:37 │ │ │ │ │ -Dune::Parallel::MPI_AllApply │ │ │ │ │ -void MPI_AllApply(MPI_Comm mpicomm, OP &&op, const Args &... data) │ │ │ │ │ -apply an operator locally to a difstributed data set │ │ │ │ │ -Definition: ringcomm.hh:297 │ │ │ │ │ +Dune::GridGlue::crossProduct │ │ │ │ │ +static Dune::FieldVector< T, dim > crossProduct(const Dune::FieldVector< T, dim │ │ │ │ │ +> &a, const Dune::FieldVector< T, dim > &b) │ │ │ │ │ +compute cross product │ │ │ │ │ +Definition: crossproduct.hh:15 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00050.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: areawriter.hh File Reference │ │ │ │ +dune-grid-glue: areawriter_impl.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -63,34 +63,47 @@ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ +Classes | │ │ │ │ Namespaces | │ │ │ │ Functions
│ │ │ │ -
areawriter.hh File Reference
│ │ │ │ +
areawriter_impl.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <ostream>
│ │ │ │ -#include <string>
│ │ │ │ -#include "areawriter_impl.hh"
│ │ │ │ +
#include <fstream>
│ │ │ │ +#include <vector>
│ │ │ │ +#include <dune/common/fvector.hh>
│ │ │ │ +#include <dune/geometry/type.hh>
│ │ │ │ +#include <dune/grid/common/mcmgmapper.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ +Classes

struct  Dune::GridGlue::AreaWriterImplementation::FacetLayout< dimgrid >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
namespace  Dune::GridGlue::AreaWriterImplementation
 
│ │ │ │ │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,26 +5,37 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * common │ │ │ │ │ -Namespaces | Functions │ │ │ │ │ -areawriter.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include "areawriter_impl.hh" │ │ │ │ │ +Classes | Namespaces | Functions │ │ │ │ │ +areawriter_impl.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ + Classes │ │ │ │ │ +struct  Dune::GridGlue::AreaWriterImplementation::FacetLayout<_dimgrid_> │ │ │ │ │ +  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::GridGlue │ │ │ │ │   │ │ │ │ │ +namespace  Dune::GridGlue::AreaWriterImplementation │ │ │ │ │ +  │ │ │ │ │ Functions │ │ │ │ │ +template │ │ │ │ │ +void Dune::GridGlue::AreaWriterImplementation::write_facet_geometry (const │ │ │ │ │ + GridView &gv, std::ostream &out) │ │ │ │ │ +  │ │ │ │ │ template │ │ │ │ │ void Dune::GridGlue::write_glue_area_vtk (const Glue &glue, std::ostream &out) │ │ │ │ │   │ │ │ │ │ template │ │ │ │ │ void Dune::GridGlue::write_glue_area_vtk (const Glue &glue, const std::string │ │ │ │ │ &filename) │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00050_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: areawriter.hh Source File │ │ │ │ +dune-grid-glue: areawriter_impl.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,47 +62,169 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
areawriter.hh
│ │ │ │ +
areawriter_impl.hh
│ │ │ │
│ │ │ │
│ │ │ │ Go to the documentation of this file.
1// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
2// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
│ │ │ │ -
3#ifndef DUNE_GRIDGLUE_COMMON_AREAWRITER_HH
│ │ │ │ -
4#define DUNE_GRIDGLUE_COMMON_AREAWRITER_HH
│ │ │ │ +
3#include <fstream>
│ │ │ │ +
4#include <vector>
│ │ │ │
5
│ │ │ │ -
6#include <ostream>
│ │ │ │ -
7#include <string>
│ │ │ │ -
8
│ │ │ │ -
9namespace Dune {
│ │ │ │ -
10namespace GridGlue {
│ │ │ │ -
11
│ │ │ │ -
12template<int side, typename Glue>
│ │ │ │ -
13void write_glue_area_vtk(const Glue& glue, std::ostream& out);
│ │ │ │ +
6#include <dune/common/fvector.hh>
│ │ │ │ +
7#include <dune/geometry/type.hh>
│ │ │ │ +
8#include <dune/grid/common/mcmgmapper.hh>
│ │ │ │ +
9
│ │ │ │ +
10namespace Dune {
│ │ │ │ +
11namespace GridGlue {
│ │ │ │ +
12
│ │ │ │ +
13namespace AreaWriterImplementation {
│ │ │ │
14
│ │ │ │ -
15template<int side, typename Glue>
│ │ │ │ -
16void write_glue_area_vtk(const Glue& glue, const std::string& filename);
│ │ │ │ -
17
│ │ │ │ -
37template<typename Glue>
│ │ │ │ -
38void write_glue_areas_vtk(const Glue& glue, const std::string& base);
│ │ │ │ -
39
│ │ │ │ -
40} /* namespace GridGlue */
│ │ │ │ -
41} /* namespace Dune */
│ │ │ │ -
42
│ │ │ │ -
43#include "areawriter_impl.hh"
│ │ │ │ -
44
│ │ │ │ -
45#endif
│ │ │ │ - │ │ │ │ +
15template<int dimgrid>
│ │ │ │ + │ │ │ │ +
17{
│ │ │ │ +
18 bool contains(Dune::GeometryType gt) const
│ │ │ │ +
19 {
│ │ │ │ +
20 return gt.dim() == dimgrid - 1;
│ │ │ │ +
21 }
│ │ │ │ +
22};
│ │ │ │ +
23
│ │ │ │ +
24template<typename GridView>
│ │ │ │ +
25void write_facet_geometry(const GridView& gv, std::ostream& out)
│ │ │ │ +
26{
│ │ │ │ +
27 using Coordinate = Dune::FieldVector<double, 3>;
│ │ │ │ +
28
│ │ │ │ +
29 std::vector<Coordinate> corners;
│ │ │ │ +
30 for (const auto& facet : facets(gv)) {
│ │ │ │ +
31 const auto geometry = facet.geometry();
│ │ │ │ +
32 for (int i = 0; i < geometry.corners(); ++i) {
│ │ │ │ +
33 /* VTK always needs 3-dim coordinates... */
│ │ │ │ +
34 const auto c0 = geometry.corner(i);
│ │ │ │ +
35 Coordinate c1;
│ │ │ │ +
36 for (int d = 0; d < GridView::dimensionworld; ++d)
│ │ │ │ +
37 c1[d] = c0[d];
│ │ │ │ +
38 for (int d = GridView::dimensionworld; d < Coordinate::dimension; ++d)
│ │ │ │ +
39 c1[d] = double(0);
│ │ │ │ +
40 corners.push_back(c1);
│ │ │ │ +
41 }
│ │ │ │ +
42 }
│ │ │ │ +
43
│ │ │ │ +
44 {
│ │ │ │ +
45 out << "DATASET UNSTRUCTURED_GRID\n"
│ │ │ │ +
46 << "POINTS " << corners.size() << " double\n";
│ │ │ │ +
47 for (const auto& c : corners)
│ │ │ │ +
48 out << c << "\n";
│ │ │ │ +
49 }
│ │ │ │ +
50 {
│ │ │ │ +
51 out << "CELLS " << gv.size(1) << " " << (gv.size(1) + corners.size()) << "\n";
│ │ │ │ +
52 std::size_t c = 0;
│ │ │ │ +
53 for (const auto& facet : facets(gv)) {
│ │ │ │ +
54 const auto geometry = facet.geometry();
│ │ │ │ +
55 out << geometry.corners();
│ │ │ │ +
56 for (int i = 0; i < geometry.corners(); ++i, ++c)
│ │ │ │ +
57 out << " " << c;
│ │ │ │ +
58 out << "\n";
│ │ │ │ +
59 }
│ │ │ │ +
60 }
│ │ │ │ +
61 {
│ │ │ │ +
62 out << "CELL_TYPES " << gv.size(1) << "\n";
│ │ │ │ +
63 for (const auto& facet : facets(gv)) {
│ │ │ │ +
64 const auto type = facet.type();
│ │ │ │ +
65 if (type.isVertex())
│ │ │ │ +
66 out << "1\n";
│ │ │ │ +
67 else if (type.isLine())
│ │ │ │ +
68 out << "2\n";
│ │ │ │ +
69 else if (type.isTriangle())
│ │ │ │ +
70 out << "5\n";
│ │ │ │ +
71 else if (type.isQuadrilateral())
│ │ │ │ +
72 out << "9\n";
│ │ │ │ +
73 else if (type.isTetrahedron())
│ │ │ │ +
74 out << "10\n";
│ │ │ │ +
75 else
│ │ │ │ +
76 DUNE_THROW(Dune::Exception, "Unhandled geometry type");
│ │ │ │ +
77 }
│ │ │ │ +
78 }
│ │ │ │ +
79}
│ │ │ │ +
80
│ │ │ │ +
81} /* namespace AreaWriterImplementation */
│ │ │ │ +
82
│ │ │ │ +
83template<int side, typename Glue>
│ │ │ │ +
84void write_glue_area_vtk(const Glue& glue, std::ostream& out)
│ │ │ │ +
85{
│ │ │ │ +
86 using GridView = typename std::decay< decltype(glue.template gridView<side>()) >::type;
│ │ │ │ +
87 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView, AreaWriterImplementation::FacetLayout>;
│ │ │ │ +
88 using ctype = typename GridView::ctype;
│ │ │ │ +
89
│ │ │ │ +
90 const GridView gv = glue.template gridView<side>();
│ │ │ │ +
91 Mapper mapper(gv);
│ │ │ │ +
92 std::vector<ctype> coveredArea(mapper.size(), ctype(0));
│ │ │ │ +
93 std::vector<ctype> totalArea(mapper.size(), ctype(1));
│ │ │ │ +
94
│ │ │ │ +
95 for (const auto& in : intersections(glue, Reverse<side == 1>())) {
│ │ │ │ +
96 const auto element = in.inside();
│ │ │ │ +
97 const auto index = mapper.subIndex(element, in.indexInInside(), 1);
│ │ │ │ +
98 coveredArea[index] += in.geometryInInside().volume();
│ │ │ │ +
99
│ │ │ │ +
100 const auto& refElement = Dune::ReferenceElements<ctype, GridView::dimension>::general(element.type());
│ │ │ │ +
101 const auto& subGeometry = refElement.template geometry<1>(in.indexInInside());
│ │ │ │ +
102 totalArea[index] = subGeometry.volume();
│ │ │ │ +
103 }
│ │ │ │ +
104
│ │ │ │ +
105 for (std::size_t i = 0; i < coveredArea.size(); ++i)
│ │ │ │ +
106 coveredArea[i] /= totalArea[i];
│ │ │ │ +
107
│ │ │ │ +
108 out << "# vtk DataFile Version 2.0\n"
│ │ │ │ +
109 << "Filename: Glue Area\n"
│ │ │ │ +
110 << "ASCII\n";
│ │ │ │ +
111
│ │ │ │ + │ │ │ │ +
113
│ │ │ │ +
114 out << "CELL_DATA " << coveredArea.size() << "\n"
│ │ │ │ +
115 << "SCALARS CoveredArea double 1\n"
│ │ │ │ +
116 << "LOOKUP_TABLE default\n";
│ │ │ │ +
117 for (const auto& value : coveredArea)
│ │ │ │ +
118 out << value << "\n";
│ │ │ │ +
119}
│ │ │ │ +
120
│ │ │ │ +
121template<int side, typename Glue>
│ │ │ │ +
122void write_glue_area_vtk(const Glue& glue, const std::string& filename)
│ │ │ │ +
123{
│ │ │ │ +
124 std::ofstream out(filename.c_str());
│ │ │ │ +
125 write_glue_area_vtk<side>(glue, out);
│ │ │ │ +
126}
│ │ │ │ +
127
│ │ │ │ +
128template<typename Glue>
│ │ │ │ +
129void write_glue_areas_vtk(const Glue& glue, const std::string& base)
│ │ │ │ +
130{
│ │ │ │ +
131 {
│ │ │ │ +
132 std::string filename = base;
│ │ │ │ +
133 filename += "-inside.vtk";
│ │ │ │ +
134 write_glue_area_vtk<0>(glue, filename);
│ │ │ │ +
135 }
│ │ │ │ +
136 {
│ │ │ │ +
137 std::string filename = base;
│ │ │ │ +
138 filename += "-outside.vtk";
│ │ │ │ +
139 write_glue_area_vtk<1>(glue, filename);
│ │ │ │ +
140 }
│ │ │ │ +
141}
│ │ │ │ +
142
│ │ │ │ +
143} /* namespace GridGlue */
│ │ │ │ +
144} /* namespace Dune */
│ │ │ │
Definition: gridglue.hh:37
│ │ │ │
void write_glue_area_vtk(const Glue &glue, std::ostream &out)
Definition: areawriter_impl.hh:84
│ │ │ │
void write_glue_areas_vtk(const Glue &glue, const std::string &base)
Definition: areawriter_impl.hh:129
│ │ │ │ +
IteratorRange<... > intersections(const GridGlue<... > &glue, const Reverse<... > &reverse=!reversed)
Iterate over all intersections of a GridGlue.
│ │ │ │ +
void write_facet_geometry(const GridView &gv, std::ostream &out)
Definition: areawriter_impl.hh:25
│ │ │ │ +
Definition: rangegenerators.hh:17
│ │ │ │ + │ │ │ │ +
bool contains(Dune::GeometryType gt) const
Definition: areawriter_impl.hh:18
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,49 +5,185 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * common │ │ │ │ │ -areawriter.hh │ │ │ │ │ +areawriter_impl.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ 1// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 2// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only- │ │ │ │ │ with-dune-grid-glue-exception │ │ │ │ │ - 3#ifndef DUNE_GRIDGLUE_COMMON_AREAWRITER_HH │ │ │ │ │ - 4#define DUNE_GRIDGLUE_COMMON_AREAWRITER_HH │ │ │ │ │ + 3#include │ │ │ │ │ + 4#include │ │ │ │ │ 5 │ │ │ │ │ - 6#include │ │ │ │ │ - 7#include │ │ │ │ │ - 8 │ │ │ │ │ - 9namespace Dune { │ │ │ │ │ - 10namespace GridGlue { │ │ │ │ │ - 11 │ │ │ │ │ - 12template │ │ │ │ │ - 13void write_glue_area_vtk(const Glue& glue, std::ostream& out); │ │ │ │ │ + 6#include │ │ │ │ │ + 7#include │ │ │ │ │ + 8#include │ │ │ │ │ + 9 │ │ │ │ │ + 10namespace Dune { │ │ │ │ │ + 11namespace GridGlue { │ │ │ │ │ + 12 │ │ │ │ │ +13namespace AreaWriterImplementation { │ │ │ │ │ 14 │ │ │ │ │ - 15template │ │ │ │ │ - 16void write_glue_area_vtk(const Glue& glue, const std::string& filename); │ │ │ │ │ - 17 │ │ │ │ │ - 37template │ │ │ │ │ - 38void write_glue_areas_vtk(const Glue& glue, const std::string& base); │ │ │ │ │ - 39 │ │ │ │ │ - 40} /* namespace GridGlue */ │ │ │ │ │ - 41} /* namespace Dune */ │ │ │ │ │ - 42 │ │ │ │ │ - 43#include "areawriter_impl.hh" │ │ │ │ │ - 44 │ │ │ │ │ - 45#endif │ │ │ │ │ -areawriter_impl.hh │ │ │ │ │ + 15template │ │ │ │ │ +16struct FacetLayout │ │ │ │ │ + 17{ │ │ │ │ │ +18 bool contains(Dune::GeometryType gt) const │ │ │ │ │ + 19 { │ │ │ │ │ + 20 return gt.dim() == dimgrid - 1; │ │ │ │ │ + 21 } │ │ │ │ │ + 22}; │ │ │ │ │ + 23 │ │ │ │ │ + 24template │ │ │ │ │ +25void write_facet_geometry(const GridView& gv, std::ostream& out) │ │ │ │ │ + 26{ │ │ │ │ │ + 27 using Coordinate = Dune::FieldVector; │ │ │ │ │ + 28 │ │ │ │ │ + 29 std::vector corners; │ │ │ │ │ + 30 for (const auto& facet : facets(gv)) { │ │ │ │ │ + 31 const auto geometry = facet.geometry(); │ │ │ │ │ + 32 for (int i = 0; i < geometry.corners(); ++i) { │ │ │ │ │ + 33 /* VTK always needs 3-dim coordinates... */ │ │ │ │ │ + 34 const auto c0 = geometry.corner(i); │ │ │ │ │ + 35 Coordinate c1; │ │ │ │ │ + 36 for (int d = 0; d < GridView::dimensionworld; ++d) │ │ │ │ │ + 37 c1[d] = c0[d]; │ │ │ │ │ + 38 for (int d = GridView::dimensionworld; d < Coordinate::dimension; ++d) │ │ │ │ │ + 39 c1[d] = double(0); │ │ │ │ │ + 40 corners.push_back(c1); │ │ │ │ │ + 41 } │ │ │ │ │ + 42 } │ │ │ │ │ + 43 │ │ │ │ │ + 44 { │ │ │ │ │ + 45 out << "DATASET UNSTRUCTURED_GRID\n" │ │ │ │ │ + 46 << "POINTS " << corners.size() << " double\n"; │ │ │ │ │ + 47 for (const auto& c : corners) │ │ │ │ │ + 48 out << c << "\n"; │ │ │ │ │ + 49 } │ │ │ │ │ + 50 { │ │ │ │ │ + 51 out << "CELLS " << gv.size(1) << " " << (gv.size(1) + corners.size()) << │ │ │ │ │ +"\n"; │ │ │ │ │ + 52 std::size_t c = 0; │ │ │ │ │ + 53 for (const auto& facet : facets(gv)) { │ │ │ │ │ + 54 const auto geometry = facet.geometry(); │ │ │ │ │ + 55 out << geometry.corners(); │ │ │ │ │ + 56 for (int i = 0; i < geometry.corners(); ++i, ++c) │ │ │ │ │ + 57 out << " " << c; │ │ │ │ │ + 58 out << "\n"; │ │ │ │ │ + 59 } │ │ │ │ │ + 60 } │ │ │ │ │ + 61 { │ │ │ │ │ + 62 out << "CELL_TYPES " << gv.size(1) << "\n"; │ │ │ │ │ + 63 for (const auto& facet : facets(gv)) { │ │ │ │ │ + 64 const auto type = facet.type(); │ │ │ │ │ + 65 if (type.isVertex()) │ │ │ │ │ + 66 out << "1\n"; │ │ │ │ │ + 67 else if (type.isLine()) │ │ │ │ │ + 68 out << "2\n"; │ │ │ │ │ + 69 else if (type.isTriangle()) │ │ │ │ │ + 70 out << "5\n"; │ │ │ │ │ + 71 else if (type.isQuadrilateral()) │ │ │ │ │ + 72 out << "9\n"; │ │ │ │ │ + 73 else if (type.isTetrahedron()) │ │ │ │ │ + 74 out << "10\n"; │ │ │ │ │ + 75 else │ │ │ │ │ + 76 DUNE_THROW(Dune::Exception, "Unhandled geometry type"); │ │ │ │ │ + 77 } │ │ │ │ │ + 78 } │ │ │ │ │ + 79} │ │ │ │ │ + 80 │ │ │ │ │ + 81} /* namespace AreaWriterImplementation */ │ │ │ │ │ + 82 │ │ │ │ │ + 83template │ │ │ │ │ +84void write_glue_area_vtk(const Glue& glue, std::ostream& out) │ │ │ │ │ + 85{ │ │ │ │ │ + 86 using GridView = typename std::decay< decltype(glue.template gridView │ │ │ │ │ +()) >::type; │ │ │ │ │ + 87 using Mapper = Dune::MultipleCodimMultipleGeomTypeMapper; │ │ │ │ │ + 88 using ctype = typename GridView::ctype; │ │ │ │ │ + 89 │ │ │ │ │ + 90 const GridView gv = glue.template gridView(); │ │ │ │ │ + 91 Mapper mapper(gv); │ │ │ │ │ + 92 std::vector coveredArea(mapper.size(), ctype(0)); │ │ │ │ │ + 93 std::vector totalArea(mapper.size(), ctype(1)); │ │ │ │ │ + 94 │ │ │ │ │ + 95 for (const auto& in : intersections(glue, Reverse())) { │ │ │ │ │ + 96 const auto element = in.inside(); │ │ │ │ │ + 97 const auto index = mapper.subIndex(element, in.indexInInside(), 1); │ │ │ │ │ + 98 coveredArea[index] += in.geometryInInside().volume(); │ │ │ │ │ + 99 │ │ │ │ │ + 100 const auto& refElement = Dune::ReferenceElements::general(element.type()); │ │ │ │ │ + 101 const auto& subGeometry = refElement.template geometry<1>(in.indexInInside │ │ │ │ │ +()); │ │ │ │ │ + 102 totalArea[index] = subGeometry.volume(); │ │ │ │ │ + 103 } │ │ │ │ │ + 104 │ │ │ │ │ + 105 for (std::size_t i = 0; i < coveredArea.size(); ++i) │ │ │ │ │ + 106 coveredArea[i] /= totalArea[i]; │ │ │ │ │ + 107 │ │ │ │ │ + 108 out << "# vtk DataFile Version 2.0\n" │ │ │ │ │ + 109 << "Filename: Glue Area\n" │ │ │ │ │ + 110 << "ASCII\n"; │ │ │ │ │ + 111 │ │ │ │ │ + 112 AreaWriterImplementation::write_facet_geometry(gv, out); │ │ │ │ │ + 113 │ │ │ │ │ + 114 out << "CELL_DATA " << coveredArea.size() << "\n" │ │ │ │ │ + 115 << "SCALARS CoveredArea double 1\n" │ │ │ │ │ + 116 << "LOOKUP_TABLE default\n"; │ │ │ │ │ + 117 for (const auto& value : coveredArea) │ │ │ │ │ + 118 out << value << "\n"; │ │ │ │ │ + 119} │ │ │ │ │ + 120 │ │ │ │ │ + 121template │ │ │ │ │ +122void write_glue_area_vtk(const Glue& glue, const std::string& filename) │ │ │ │ │ + 123{ │ │ │ │ │ + 124 std::ofstream out(filename.c_str()); │ │ │ │ │ + 125 write_glue_area_vtk(glue, out); │ │ │ │ │ + 126} │ │ │ │ │ + 127 │ │ │ │ │ + 128template │ │ │ │ │ +129void write_glue_areas_vtk(const Glue& glue, const std::string& base) │ │ │ │ │ + 130{ │ │ │ │ │ + 131 { │ │ │ │ │ + 132 std::string filename = base; │ │ │ │ │ + 133 filename += "-inside.vtk"; │ │ │ │ │ + 134 write_glue_area_vtk<0>(glue, filename); │ │ │ │ │ + 135 } │ │ │ │ │ + 136 { │ │ │ │ │ + 137 std::string filename = base; │ │ │ │ │ + 138 filename += "-outside.vtk"; │ │ │ │ │ + 139 write_glue_area_vtk<1>(glue, filename); │ │ │ │ │ + 140 } │ │ │ │ │ + 141} │ │ │ │ │ + 142 │ │ │ │ │ + 143} /* namespace GridGlue */ │ │ │ │ │ + 144} /* namespace Dune */ │ │ │ │ │ Dune │ │ │ │ │ Definition: gridglue.hh:37 │ │ │ │ │ Dune::GridGlue::write_glue_area_vtk │ │ │ │ │ void write_glue_area_vtk(const Glue &glue, std::ostream &out) │ │ │ │ │ Definition: areawriter_impl.hh:84 │ │ │ │ │ Dune::GridGlue::write_glue_areas_vtk │ │ │ │ │ void write_glue_areas_vtk(const Glue &glue, const std::string &base) │ │ │ │ │ Definition: areawriter_impl.hh:129 │ │ │ │ │ +Dune::GridGlue::intersections │ │ │ │ │ +IteratorRange<... > intersections(const GridGlue<... > &glue, const Reverse<... │ │ │ │ │ +> &reverse=!reversed) │ │ │ │ │ +Iterate over all intersections of a GridGlue. │ │ │ │ │ +Dune::GridGlue::AreaWriterImplementation::write_facet_geometry │ │ │ │ │ +void write_facet_geometry(const GridView &gv, std::ostream &out) │ │ │ │ │ +Definition: areawriter_impl.hh:25 │ │ │ │ │ +Dune::GridGlue::Reverse │ │ │ │ │ +Definition: rangegenerators.hh:17 │ │ │ │ │ +Dune::GridGlue::AreaWriterImplementation::FacetLayout │ │ │ │ │ +Definition: areawriter_impl.hh:17 │ │ │ │ │ +Dune::GridGlue::AreaWriterImplementation::FacetLayout::contains │ │ │ │ │ +bool contains(Dune::GeometryType gt) const │ │ │ │ │ +Definition: areawriter_impl.hh:18 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00053.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: extractor.hh File Reference │ │ │ │ +dune-grid-glue: vtksurfacewriter.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,62 +65,42 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
extractor.hh File Reference
│ │ │ │ +
vtksurfacewriter.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

extractor base class │ │ │ │ +

helper class for graphical output of grids in generic representation │ │ │ │ More...

│ │ │ │ -
#include <vector>
│ │ │ │ -#include <map>
│ │ │ │ -#include <algorithm>
│ │ │ │ -#include <dune/common/exceptions.hh>
│ │ │ │ -#include <dune/common/fvector.hh>
│ │ │ │ -#include <dune/common/version.hh>
│ │ │ │ -#include <dune/grid/common/geometry.hh>
│ │ │ │ -#include <dune/grid/common/grid.hh>
│ │ │ │ -#include <dune/grid/common/mcmgmapper.hh>
│ │ │ │ -#include <dune/geometry/multilineargeometry.hh>
│ │ │ │ +
#include <fstream>
│ │ │ │ +#include <iomanip>
│ │ │ │ +#include <vector>
│ │ │ │ +#include <cstring>
│ │ │ │ +#include "../adapter/gridgluevtkwriter.hh"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │

│ │ │ │ Functions

template<typename GridView >
void Dune::GridGlue::AreaWriterImplementation::write_facet_geometry (const GridView &gv, std::ostream &out)
 
template<int side, typename Glue >
void Dune::GridGlue::write_glue_area_vtk (const Glue &glue, std::ostream &out)
 
template<int side, typename Glue >
void Dune::GridGlue::write_glue_area_vtk (const Glue &glue, const std::string &filename)
 
template<typename Glue >
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  Dune::GridGlue::Extractor< GV, cd >
 Provides codimension-independent methods for grid extraction. More...
 
struct  Dune::GridGlue::Extractor< GV, cd >::CornerInfo
 Helpful struct holding one index for the coordinate (vertex) to which it is associated and the element's corner index;. More...
 
struct  Dune::GridGlue::Extractor< GV, cd >::CoordinateInfo
 
struct  Dune::GridGlue::Extractor< GV, cd >::VertexInfo
 simple struct holding a vertex pointer and an index More...
 
struct  Dune::GridGlue::Extractor< GV, cd >::ElementInfo
 simple struct holding an element seed and an index More...
 
struct  Dune::GridGlue::Extractor< GV, cd >::SubEntityInfo
 Holds some information about an element's subentity involved in a coupling. More...
class  Dune::GridGlue::VtkSurfaceWriter
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
│ │ │ │

Detailed Description

│ │ │ │ -

extractor base class

│ │ │ │ +

helper class for graphical output of grids in generic representation

│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -6,50 +6,28 @@ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * extractors │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -extractor.hh File Reference │ │ │ │ │ -extractor base class More... │ │ │ │ │ +vtksurfacewriter.hh File Reference │ │ │ │ │ +helper class for graphical output of grids in generic representation More... │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ +#include "../adapter/gridgluevtkwriter.hh" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ - class  Dune::GridGlue::Extractor<_GV,_cd_> │ │ │ │ │ -  Provides codimension-independent methods for grid extraction. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::GridGlue::Extractor<_GV,_cd_>::CornerInfo │ │ │ │ │ -  Helpful struct holding one index for the coordinate (vertex) to which │ │ │ │ │ - it is associated and the element's corner index;. More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::GridGlue::Extractor<_GV,_cd_>::CoordinateInfo │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::GridGlue::Extractor<_GV,_cd_>::VertexInfo │ │ │ │ │ -  simple struct holding a vertex pointer and an index More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::GridGlue::Extractor<_GV,_cd_>::ElementInfo │ │ │ │ │ -  simple struct holding an element seed and an index More... │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::GridGlue::Extractor<_GV,_cd_>::SubEntityInfo │ │ │ │ │ -  Holds some information about an element's subentity involved in a │ │ │ │ │ - coupling. More... │ │ │ │ │ +class  Dune::GridGlue::VtkSurfaceWriter │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::GridGlue │ │ │ │ │   │ │ │ │ │ ***** Detailed Description ***** │ │ │ │ │ -extractor base class │ │ │ │ │ +helper class for graphical output of grids in generic representation │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00053_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: extractor.hh Source File │ │ │ │ +dune-grid-glue: vtksurfacewriter.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,432 +62,236 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
extractor.hh
│ │ │ │ +
vtksurfacewriter.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 © DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
4// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
│ │ │ │
5/*
│ │ │ │ -
6 * Filename: extractor.hh
│ │ │ │ +
6 * Filename: VtkSurfaceWriter.hh
│ │ │ │
7 * Version: 1.0
│ │ │ │ -
8 * Created on: Oct 05, 2009
│ │ │ │ -
9 * Author: Christian Engwer
│ │ │ │ +
8 * Created on: Jan 16, 2009
│ │ │ │ +
9 * Author: Gerrit Buse
│ │ │ │
10 * ---------------------------------
│ │ │ │
11 * Project: dune-grid-glue
│ │ │ │ -
12 * Description: base class for all grid extractors
│ │ │ │ +
12 * Description: helper class for graphical output of grids in generic representation
│ │ │ │
13 *
│ │ │ │
14 */
│ │ │ │ -
20#ifndef DUNE_GRIDGLUE_EXTRACTORS_EXTRACTOR_HH
│ │ │ │ -
21#define DUNE_GRIDGLUE_EXTRACTORS_EXTRACTOR_HH
│ │ │ │ +
20#ifndef DUNE_GRIDGLUE_EXTRACTORS_VTKSURFACEWRITER_HH
│ │ │ │ +
21#define DUNE_GRIDGLUE_EXTRACTORS_VTKSURFACEWRITER_HH
│ │ │ │
22
│ │ │ │ -
23#include <vector>
│ │ │ │ -
24#include <map>
│ │ │ │ -
25#include <algorithm>
│ │ │ │ -
26#include <dune/common/exceptions.hh>
│ │ │ │ -
27#include <dune/common/fvector.hh>
│ │ │ │ -
28#include <dune/common/version.hh>
│ │ │ │ -
29#include <dune/grid/common/geometry.hh>
│ │ │ │ -
30#include <dune/grid/common/grid.hh>
│ │ │ │ -
31#include <dune/grid/common/mcmgmapper.hh>
│ │ │ │ -
32#include <dune/geometry/multilineargeometry.hh>
│ │ │ │ +
23#include <fstream>
│ │ │ │ +
24#include <iomanip>
│ │ │ │ +
25#include <vector>
│ │ │ │ +
26#include <cstring>
│ │ │ │ +
27
│ │ │ │ +
28#include "../adapter/gridgluevtkwriter.hh"
│ │ │ │ +
29
│ │ │ │ +
30namespace Dune {
│ │ │ │ +
31
│ │ │ │ +
32 namespace GridGlue {
│ │ │ │
33
│ │ │ │ -
34namespace Dune {
│ │ │ │ -
35
│ │ │ │ -
36 namespace GridGlue {
│ │ │ │ + │ │ │ │ +
35{
│ │ │ │ +
36public:
│ │ │ │
37
│ │ │ │ -
44template<typename GV, int cd>
│ │ │ │ - │ │ │ │ -
46{
│ │ │ │ -
47
│ │ │ │ -
48public:
│ │ │ │ -
49
│ │ │ │ -
50 static constexpr auto dimworld = GV::dimensionworld;
│ │ │ │ -
51 static constexpr auto dim = GV::dimension;
│ │ │ │ -
52 static constexpr auto codim = cd;
│ │ │ │ -
53
│ │ │ │ -
54 static constexpr int cube_corners = 1 << (dim-codim);
│ │ │ │ -
55
│ │ │ │ -
56 typedef GV GridView;
│ │ │ │ -
57 typedef typename GridView::Grid Grid;
│ │ │ │ -
58
│ │ │ │ -
59 typedef typename GV::Grid::ctype ctype;
│ │ │ │ -
60 typedef Dune::FieldVector<ctype, dimworld> Coords;
│ │ │ │ -
61 typedef Dune::FieldVector<ctype, dim> LocalCoords;
│ │ │ │ -
62
│ │ │ │ -
63 typedef typename GV::Traits::template Codim<dim>::Entity Vertex;
│ │ │ │ -
64 typedef typename Vertex::EntitySeed VertexSeed;
│ │ │ │ -
65
│ │ │ │ -
66 typedef typename GV::Traits::template Codim<0>::Entity Element;
│ │ │ │ -
67 typedef typename Element::EntitySeed ElementSeed;
│ │ │ │ -
68
│ │ │ │ -
69 typedef std::vector<unsigned int> VertexVector;
│ │ │ │ +
38
│ │ │ │ +
39 VtkSurfaceWriter(const char* filename) : filename_(filename)
│ │ │ │ +
40 {}
│ │ │ │ +
41
│ │ │ │ + │ │ │ │ +
43 {}
│ │ │ │ +
44
│ │ │ │ +
45 void setFilename(const char* name)
│ │ │ │ +
46 {
│ │ │ │ +
47 if (std::strlen(name) > 0)
│ │ │ │ +
48 this->filename_ = name;
│ │ │ │ +
49 }
│ │ │ │ +
50
│ │ │ │ +
51
│ │ │ │ +
52 template<typename K>
│ │ │ │ +
53 void writeSurface(const std::vector<K>& coords, const std::vector<unsigned int>& indices, int corners, int dim)
│ │ │ │ +
54 {
│ │ │ │ +
55 std::ofstream fos;
│ │ │ │ +
56 char buffer[64];
│ │ │ │ +
57 sprintf(buffer, "%s.vtk", this->filename_);
│ │ │ │ +
58 fos.open(buffer);
│ │ │ │ +
59 fos << std::setprecision(8) << std::setw(1);
│ │ │ │ +
60 // write preamble
│ │ │ │ +
61 fos << "# vtk DataFile Version 2.0\nFilename: " << buffer << "\nASCII" << std::endl;
│ │ │ │ +
62 this->writePoints(coords, dim, fos);
│ │ │ │ +
63 const int polycount = indices.size()/corners;
│ │ │ │ +
64 int corner_count[polycount];
│ │ │ │ +
65 for (int i = 0; i < polycount; ++i)
│ │ │ │ +
66 corner_count[i] = corners;
│ │ │ │ +
67 this->writePolygons(indices, corner_count, polycount, dim, fos);
│ │ │ │ +
68 fos.close();
│ │ │ │ +
69 }
│ │ │ │
70
│ │ │ │ -
71#if DUNE_VERSION_NEWER(DUNE_GRID, 2, 6)
│ │ │ │ -
72 using CellMapper = MultipleCodimMultipleGeomTypeMapper<GridView>;
│ │ │ │ -
73#else
│ │ │ │ -
74 using CellMapper = MultipleCodimMultipleGeomTypeMapper<GridView, MCMGElementLayout>;
│ │ │ │ -
75#endif
│ │ │ │ -
76 // typedef typename CellMapper::IndexType IndexType;
│ │ │ │ -
77 typedef int IndexType;
│ │ │ │ -
78public:
│ │ │ │ -
79
│ │ │ │ -
80 // transformations
│ │ │ │ -
81 typedef Dune::MultiLinearGeometry<ctype, dim-codim, dimworld> Geometry;
│ │ │ │ -
82 typedef Dune::MultiLinearGeometry<ctype, dim-codim, dim> LocalGeometry;
│ │ │ │ -
83
│ │ │ │ -
84protected:
│ │ │ │ -
85 /************************** PRIVATE SUBCLASSES **********************/
│ │ │ │ -
86
│ │ │ │ - │ │ │ │ -
92 {
│ │ │ │ -
93 unsigned int idx : 28;
│ │ │ │ -
94 unsigned int num : 4;
│ │ │ │ -
95 };
│ │ │ │ -
96
│ │ │ │ - │ │ │ │ -
98 {
│ │ │ │ - │ │ │ │ -
100 {}
│ │ │ │ -
101
│ │ │ │ -
102 CoordinateInfo(unsigned int index_, IndexType vtxindex_)
│ │ │ │ -
103 : vtxindex(vtxindex_), index(index_)
│ │ │ │ -
104 {}
│ │ │ │ -
105
│ │ │ │ - │ │ │ │ -
108
│ │ │ │ - │ │ │ │ -
111
│ │ │ │ -
113 unsigned int index;
│ │ │ │ -
114 };
│ │ │ │ -
115
│ │ │ │ - │ │ │ │ -
120 {
│ │ │ │ -
121 VertexInfo(unsigned int idx_, const Vertex& p_) : idx(idx_), p(p_.seed())
│ │ │ │ -
122 {}
│ │ │ │ -
123 unsigned int idx;
│ │ │ │ - │ │ │ │ -
125 };
│ │ │ │ -
126
│ │ │ │ -
127
│ │ │ │ - │ │ │ │ -
132 {
│ │ │ │ -
133 ElementInfo(unsigned int idx_, const Element& p_, unsigned int f_) : idx(idx_), faces(f_), p(p_.seed())
│ │ │ │ -
134 {}
│ │ │ │ -
135
│ │ │ │ -
137 unsigned int idx : 28;
│ │ │ │ -
138
│ │ │ │ -
140 unsigned int faces : 4;
│ │ │ │ -
141
│ │ │ │ - │ │ │ │ -
144 };
│ │ │ │ -
145
│ │ │ │ -
146
│ │ │ │ - │ │ │ │ -
151 {
│ │ │ │ - │ │ │ │ -
153 /*
│ │ │ │ -
154 * TODO: move default value of `geometryType_` to member declaration
│ │ │ │ -
155 * when removing support for older dune-geometry
│ │ │ │ -
156 */
│ │ │ │ -
157#if DUNE_VERSION_NEWER(DUNE_GEOMETRY, 2, 6)
│ │ │ │ -
158 : geometryType_(GeometryTypes::simplex(dim-codim))
│ │ │ │ -
159 {}
│ │ │ │ -
160#else
│ │ │ │ -
161 {
│ │ │ │ -
162 geometryType_.makeSimplex(dim-codim);
│ │ │ │ -
163 }
│ │ │ │ -
164#endif
│ │ │ │ -
165
│ │ │ │ -
166 SubEntityInfo(IndexType parent_, unsigned int num_in_parent_,
│ │ │ │ -
167 const Dune::GeometryType& geometryType)
│ │ │ │ -
168 : parent(parent_), num_in_parent(num_in_parent_), geometryType_(geometryType)
│ │ │ │ -
169 {}
│ │ │ │ -
170
│ │ │ │ -
171 unsigned int nCorners() const
│ │ │ │ -
172 {
│ │ │ │ -
173 return Dune::ReferenceElements<ctype, dim-codim>::general(geometryType_).size(dim-codim);
│ │ │ │ -
174 }
│ │ │ │ -
175
│ │ │ │ - │ │ │ │ -
178
│ │ │ │ -
180 unsigned int num_in_parent : 3;
│ │ │ │ -
181
│ │ │ │ -
183 Dune::GeometryType geometryType_;
│ │ │ │ -
184
│ │ │ │ -
191 CornerInfo corners[cube_corners]; // sim = numer of vertices in a simplex
│ │ │ │ -
192 };
│ │ │ │ -
193
│ │ │ │ -
194
│ │ │ │ -
195 typedef std::map<IndexType, ElementInfo> ElementInfoMap;
│ │ │ │ -
196 typedef std::map<IndexType, VertexInfo> VertexInfoMap;
│ │ │ │ -
197
│ │ │ │ -
198 /************************** MEMBER VARIABLES ************************/
│ │ │ │ -
199
│ │ │ │ - │ │ │ │ +
71
│ │ │ │ +
72 template<typename K, typename T>
│ │ │ │ +
73 void writeSurfaceElementData(const std::vector<K>& coords, const std::vector<unsigned int>& indices, int corners, const std::vector<T>& data, const char* dataname, int dim)
│ │ │ │ +
74 {
│ │ │ │ +
75 std::ofstream fos;
│ │ │ │ +
76 char buffer[64];
│ │ │ │ +
77 sprintf(buffer, "%s.vtk", this->filename_);
│ │ │ │ +
78 fos.open(buffer);
│ │ │ │ +
79 fos << std::setprecision(8) << std::setw(1);
│ │ │ │ +
80 // write preamble
│ │ │ │ +
81 fos << "# vtk DataFile Version 2.0\nFilename: " << buffer << "\nASCII" << std::endl;
│ │ │ │ +
82 this->writePoints(coords, dim, fos);
│ │ │ │ +
83 const int polycount = indices.size()/corners;
│ │ │ │ +
84 int corner_count[polycount];
│ │ │ │ +
85 for (int i = 0; i < polycount; ++i)
│ │ │ │ +
86 corner_count[i] = corners;
│ │ │ │ +
87 this->writePolygons(indices, corner_count, polycount, dim, fos);
│ │ │ │ +
88 this->writeCellData(data, dataname, dim, fos);
│ │ │ │ +
89 fos.close();
│ │ │ │ +
90 }
│ │ │ │ +
91
│ │ │ │ +
92
│ │ │ │ +
93 template<typename K, typename T>
│ │ │ │ +
94 void writeSurfaceVertexData(const std::vector<K>& coords, const std::vector<unsigned int>& indices, int corners, const std::vector<T>& data, const char* dataname, int dim)
│ │ │ │ +
95 {
│ │ │ │ +
96 std::ofstream fos;
│ │ │ │ +
97 char buffer[64];
│ │ │ │ +
98 sprintf(buffer, "%s.vtk", this->filename_);
│ │ │ │ +
99 fos.open(buffer);
│ │ │ │ +
100 fos << std::setprecision(8) << std::setw(1);
│ │ │ │ +
101 // write preamble
│ │ │ │ +
102 fos << "# vtk DataFile Version 2.0\nFilename: " << buffer << "\nASCII" << std::endl;
│ │ │ │ +
103 this->writePoints(coords, dim, fos);
│ │ │ │ +
104 const int polycount = indices.size()/corners;
│ │ │ │ +
105 int corner_count[polycount];
│ │ │ │ +
106 for (int i = 0; i < polycount; ++i)
│ │ │ │ +
107 corner_count[i] = corners;
│ │ │ │ +
108 this->writePolygons(indices, corner_count, polycount, dim, fos);
│ │ │ │ +
109 this->writePointData(data, dataname, dim, fos);
│ │ │ │ +
110 fos.close();
│ │ │ │ +
111 }
│ │ │ │ +
112
│ │ │ │ +
113protected:
│ │ │ │ +
114
│ │ │ │ +
115 template<typename K>
│ │ │ │ +
116 void writePoints(const std::vector<K>& coords, int dim, std::ofstream& fos)
│ │ │ │ +
117 {
│ │ │ │ +
118 fos << "DATASET POLYDATA\nPOINTS " << coords.size() << " " << TypeNames[Nametraits<K>::nameidx] << std::endl;
│ │ │ │ +
119 for (unsigned int i = 0; i < coords.size(); ++i)
│ │ │ │ +
120 {
│ │ │ │ +
121 fos << coords[i][0];
│ │ │ │ +
122 if (dim == 2)
│ │ │ │ +
123 fos << " " << coords[i][1] << " 0 \n" << coords[i][0] << " " << coords[i][1] << " 0.01" << std::endl;
│ │ │ │ +
124 else // dim == 3
│ │ │ │ +
125 fos << " " << coords[i][1] << " " << coords[i][2] << std::endl;
│ │ │ │ +
126 }
│ │ │ │ +
127 }
│ │ │ │ +
128
│ │ │ │ +
129 void writePolygons(const std::vector<unsigned int>& indices, const int* corners, int ncorners, int dim, std::ofstream& fos)
│ │ │ │ +
130 {
│ │ │ │ +
131 if (dim == 2)
│ │ │ │ +
132 {
│ │ │ │ +
133 fos << "POLYGONS " << indices.size()/2 << " " << 5*(indices.size() / 2) << std::endl;
│ │ │ │ +
134 for (unsigned int i = 0; i < indices.size(); i += 2)
│ │ │ │ +
135 fos << "4 " << 2*indices[i] << " " << 2*indices[i+1] << " " << 2*indices[i+1]+1 << " "<< 2*indices[i]+1 << std::endl;
│ │ │ │ +
136
│ │ │ │ +
137 // arbitrary shapes - ignored here!
│ │ │ │ +
138 // int sum = ncorners;
│ │ │ │ +
139 // for (int i = 0; i < ncorners; ++i)
│ │ │ │ +
140 // sum += (corners[i] > 2 ? corners[i] : 3);
│ │ │ │ +
141 //
│ │ │ │ +
142 // fos << "POLYGONS " << ncorners << " " << sum << std::endl;
│ │ │ │ +
143 // int index = 0;
│ │ │ │ +
144 // for (int i = 0; i < ncorners; ++i)
│ │ │ │ +
145 // {
│ │ │ │ +
146 // // write the first index twice if it is an egde
│ │ │ │ +
147 // // => triangle instead of edge - paraview can display it then
│ │ │ │ +
148 // if (corners[i] > 2)
│ │ │ │ +
149 // fos << corners[i];
│ │ │ │ +
150 // else
│ │ │ │ +
151 // fos << "3 " << indices[index];
│ │ │ │ +
152 //
│ │ │ │ +
153 // for (int j = 0; j < corners[i]; ++j)
│ │ │ │ +
154 // fos << " " << indices[index++];
│ │ │ │ +
155 // fos << std::endl;
│ │ │ │ +
156 // }
│ │ │ │ +
157 }
│ │ │ │ +
158 else
│ │ │ │ +
159 {
│ │ │ │ +
160 int sum = ncorners;
│ │ │ │ +
161 for (int i = 0; i < ncorners; ++i)
│ │ │ │ +
162 sum += corners[i];
│ │ │ │ +
163 fos << "POLYGONS " << ncorners << " " << sum << std::endl;
│ │ │ │ +
164 int index = 0;
│ │ │ │ +
165 for (int i = 0; i < ncorners; ++i)
│ │ │ │ +
166 {
│ │ │ │ +
167 fos << corners[i];
│ │ │ │ +
168 for (int j = 0; j < corners[i]; ++j)
│ │ │ │ +
169 fos << " " << indices[index++];
│ │ │ │ +
170 fos << std::endl;
│ │ │ │ +
171 }
│ │ │ │ +
172 }
│ │ │ │ +
173 }
│ │ │ │ +
174
│ │ │ │ +
175 template<typename T>
│ │ │ │ +
176 void writeCellData(const std::vector<T>& data, const char* dataname, int dim, std::ofstream& fos)
│ │ │ │ +
177 {
│ │ │ │ +
178 fos << "CELL_DATA " << data.size()*(dim == 2 ? 2 : 1) << std::endl;
│ │ │ │ +
179 fos << "SCALARS " << dataname << " " << TypeNames[Nametraits<T>::nameidx] << " 1" << std::endl;
│ │ │ │ +
180 fos << "LOOKUP_TABLE default" << std::endl;
│ │ │ │ +
181 for (unsigned int i = 0; i < data.size(); ++i)
│ │ │ │ +
182 {
│ │ │ │ +
183 fos << data[i] << std::endl;
│ │ │ │ +
184 if (dim == 2)
│ │ │ │ +
185 fos << data[i] << std::endl;
│ │ │ │ +
186 }
│ │ │ │ +
187 }
│ │ │ │ +
188
│ │ │ │ +
189 template<typename T>
│ │ │ │ +
190 void writePointData(const std::vector<T>& data, const char* dataname, int dim, std::ofstream& fos)
│ │ │ │ +
191 {
│ │ │ │ +
192 fos << "POINT_DATA " << data.size()*(dim == 2 ? 2 : 1) << std::endl;
│ │ │ │ +
193 fos << "SCALARS " << dataname << " " << TypeNames[Nametraits<T>::nameidx] << " 1" << std::endl;
│ │ │ │ +
194 fos << "LOOKUP_TABLE default" << std::endl;
│ │ │ │ +
195 for (unsigned int i = 0; i < data.size(); ++i)
│ │ │ │ +
196 {
│ │ │ │ +
197 fos << data[i] << std::endl;
│ │ │ │ +
198 if (dim == 2)
│ │ │ │ +
199 fos << data[i] << std::endl;
│ │ │ │ +
200 }
│ │ │ │ +
201 }
│ │ │ │
202
│ │ │ │ -
203 /* Geometrical and Topological Information */
│ │ │ │ -
204
│ │ │ │ -
206 std::vector<CoordinateInfo> coords_;
│ │ │ │ +
203
│ │ │ │ +
204private:
│ │ │ │ +
205 const char* filename_;
│ │ │ │ +
206};
│ │ │ │
207
│ │ │ │ -
209 std::vector<SubEntityInfo> subEntities_;
│ │ │ │ -
210
│ │ │ │ - │ │ │ │ -
217
│ │ │ │ - │ │ │ │ -
224
│ │ │ │ - │ │ │ │ -
226
│ │ │ │ -
227public:
│ │ │ │ -
228
│ │ │ │ -
229 /* C O N S T R U C T O R S A N D D E S T R U C T O R S */
│ │ │ │ -
230
│ │ │ │ -
235 Extractor(const GV& gv)
│ │ │ │ -
236 : gv_(gv)
│ │ │ │ -
237#if DUNE_VERSION_NEWER(DUNE_GRID, 2, 6)
│ │ │ │ -
238 , cellMapper_(gv, mcmgElementLayout())
│ │ │ │ -
239#else
│ │ │ │ -
240 , cellMapper_(gv)
│ │ │ │ -
241#endif
│ │ │ │ -
242 {}
│ │ │ │ -
243
│ │ │ │ -
244 /* F U N C T I O N A L I T Y */
│ │ │ │ -
245
│ │ │ │ -
249 void clear()
│ │ │ │ -
250 {
│ │ │ │ -
251 // this is an inofficial way on how to free the memory allocated
│ │ │ │ -
252 // by a std::vector
│ │ │ │ -
253 {
│ │ │ │ -
254 std::vector<CoordinateInfo> dummy;
│ │ │ │ -
255 coords_.swap(dummy);
│ │ │ │ -
256 }
│ │ │ │ -
257 {
│ │ │ │ -
258 std::vector<SubEntityInfo> dummy;
│ │ │ │ -
259 subEntities_.swap(dummy);
│ │ │ │ -
260 }
│ │ │ │ -
261
│ │ │ │ -
262 // ...then clear the maps themselves, too
│ │ │ │ -
263 vtxInfo_.clear();
│ │ │ │ -
264 elmtInfo_.clear();
│ │ │ │ -
265 }
│ │ │ │ -
266
│ │ │ │ -
267
│ │ │ │ -
268 /* G E T T E R S */
│ │ │ │ -
269
│ │ │ │ -
275 void getCoords(std::vector<Dune::FieldVector<ctype, dimworld> >& coords) const
│ │ │ │ -
276 {
│ │ │ │ -
277 coords.resize(coords_.size());
│ │ │ │ -
278 for (unsigned int i = 0; i < coords_.size(); ++i)
│ │ │ │ -
279 coords[i] = coords_[i].coord;
│ │ │ │ -
280 }
│ │ │ │ -
281
│ │ │ │ -
282
│ │ │ │ -
287 unsigned int nCoords() const
│ │ │ │ -
288 {
│ │ │ │ -
289 return coords_.size();
│ │ │ │ -
290 }
│ │ │ │ -
291
│ │ │ │ -
293 void getGeometryTypes(std::vector<Dune::GeometryType>& geometryTypes) const
│ │ │ │ -
294 {
│ │ │ │ -
295 geometryTypes.resize(subEntities_.size());
│ │ │ │ -
296 for (size_t i=0; i<subEntities_.size(); i++)
│ │ │ │ -
297 geometryTypes[i] = subEntities_[i].geometryType_;
│ │ │ │ -
298 }
│ │ │ │ -
299
│ │ │ │ -
300
│ │ │ │ -
304 void getFaces(std::vector<VertexVector>& faces) const
│ │ │ │ -
305 {
│ │ │ │ -
306 faces.resize(subEntities_.size());
│ │ │ │ -
307 for (unsigned int i = 0; i < subEntities_.size(); ++i) {
│ │ │ │ -
308 faces[i].resize(subEntities_[i].nCorners());
│ │ │ │ -
309 for (unsigned int j = 0; j < subEntities_[i].nCorners(); ++j)
│ │ │ │ -
310 faces[i][j] = subEntities_[i].corners[j].idx;
│ │ │ │ -
311 }
│ │ │ │ -
312 }
│ │ │ │ -
313
│ │ │ │ -
314
│ │ │ │ -
323 bool faceIndices(const Element& e, int& first, int& count) const
│ │ │ │ -
324 {
│ │ │ │ -
325 typename ElementInfoMap::const_iterator it =
│ │ │ │ -
326 elmtInfo_.find(cellMapper_.map(e));
│ │ │ │ -
327 if (it == elmtInfo_.end())
│ │ │ │ -
328 {
│ │ │ │ -
329 first = -1;
│ │ │ │ -
330 count = 0;
│ │ │ │ -
331 return false;
│ │ │ │ -
332 }
│ │ │ │ -
333 // the iterator is valid, fill the out params
│ │ │ │ -
334 first = it->second.idx;
│ │ │ │ -
335 count = it->second.faces;
│ │ │ │ -
336 return true;
│ │ │ │ -
337 }
│ │ │ │ -
338
│ │ │ │ -
339
│ │ │ │ -
345 int indexInInside(unsigned int index) const
│ │ │ │ -
346 {
│ │ │ │ -
347 return index < subEntities_.size() ? subEntities_[index].num_in_parent : -1;
│ │ │ │ -
348 }
│ │ │ │ -
349
│ │ │ │ -
350 // /**
│ │ │ │ -
351 // * @brief tests that a given entry in the extraction set does have local couplings
│ │ │ │ -
352 // * @todo parallel interface
│ │ │ │ -
353 // */
│ │ │ │ -
354 // bool contains (unsigned int global, unsigned int & local) const
│ │ │ │ -
355 // {
│ │ │ │ -
356 // local = global;
│ │ │ │ -
357 // return true;
│ │ │ │ -
358 // }
│ │ │ │ -
359
│ │ │ │ -
363 const GridView & gridView() const
│ │ │ │ -
364 {
│ │ │ │ -
365 return gv_;
│ │ │ │ -
366 }
│ │ │ │ -
367
│ │ │ │ -
368 const Grid& grid() const
│ │ │ │ -
369 {
│ │ │ │ -
370 return gv_.grid();
│ │ │ │ -
371 }
│ │ │ │ -
372
│ │ │ │ -
379 Element
│ │ │ │ -
380 element(unsigned int index) const
│ │ │ │ -
381 {
│ │ │ │ -
382 if (index >= subEntities_.size())
│ │ │ │ -
383 DUNE_THROW(Dune::GridError, "invalid face index");
│ │ │ │ -
384 const ElementSeed seed = elmtInfo_.at(subEntities_[index].parent).p;
│ │ │ │ -
385 return grid().entity(seed);
│ │ │ │ -
386 }
│ │ │ │ -
387
│ │ │ │ -
388#if 1
│ │ │ │ -
395 Vertex
│ │ │ │ -
396 vertex(unsigned int index) const
│ │ │ │ -
397 {
│ │ │ │ -
398 if (index >= coords_.size())
│ │ │ │ -
399 DUNE_THROW(Dune::GridError, "invalid coordinate index");
│ │ │ │ -
400 const VertexSeed seed = vtxInfo_.at(coords_[index].vtxindex).p;
│ │ │ │ -
401 return grid().entity(seed);
│ │ │ │ -
402 }
│ │ │ │ -
403#endif
│ │ │ │ -
404
│ │ │ │ -
406 Geometry geometry(unsigned int index) const;
│ │ │ │ -
407
│ │ │ │ -
409 LocalGeometry geometryLocal(unsigned int index) const;
│ │ │ │ -
410
│ │ │ │ -
411};
│ │ │ │ -
412
│ │ │ │ -
413
│ │ │ │ -
415template<typename GV, int cd>
│ │ │ │ - │ │ │ │ -
417{
│ │ │ │ -
418 std::vector<Coords> corners(subEntities_[index].nCorners());
│ │ │ │ -
419 for (unsigned int i = 0; i < subEntities_[index].nCorners(); ++i)
│ │ │ │ -
420 corners[i] = coords_[subEntities_[index].corners[i].idx].coord;
│ │ │ │ -
421
│ │ │ │ -
422 return Geometry(subEntities_[index].geometryType_, corners);
│ │ │ │ -
423}
│ │ │ │ -
424
│ │ │ │ -
425
│ │ │ │ -
427template<typename GV, int cd>
│ │ │ │ - │ │ │ │ -
429{
│ │ │ │ -
430 std::vector<LocalCoords> corners(subEntities_[index].nCorners());
│ │ │ │ -
431
│ │ │ │ -
432 // get face info
│ │ │ │ -
433 const SubEntityInfo & face = subEntities_[index];
│ │ │ │ -
434 Dune::GeometryType facetype = subEntities_[index].geometryType_;
│ │ │ │ -
435
│ │ │ │ -
436 // get reference element
│ │ │ │ -
437 const auto elmtseed = elmtInfo_.at(face.parent).p;
│ │ │ │ -
438 const auto elmt = grid().entity(elmtseed);
│ │ │ │ -
439 const Dune::GeometryType celltype = elmt.type();
│ │ │ │ -
440 const auto& re = Dune::ReferenceElements<ctype, dim>::general(celltype);
│ │ │ │ -
441 for (unsigned int i = 0; i < subEntities_[index].nCorners(); ++i)
│ │ │ │ -
442 corners[i] = re.position(face.corners[i].num,dim);
│ │ │ │ -
443
│ │ │ │ -
444 return LocalGeometry(facetype, corners);
│ │ │ │ -
445}
│ │ │ │ -
446
│ │ │ │ -
447} // namespace GridGlue
│ │ │ │ -
448
│ │ │ │ -
449} // namespace Dune
│ │ │ │ -
450
│ │ │ │ -
451#endif // DUNE_GRIDGLUE_EXTRACTORS_EXTRACTOR_HH
│ │ │ │ +
208} // namespace GridGlue
│ │ │ │ +
209
│ │ │ │ +
210} // namespace Dune
│ │ │ │ +
211
│ │ │ │ +
212#endif // DUNE_GRIDGLUE_EXTRACTORS_VTKSURFACEWRITER_HH
│ │ │ │
Definition: gridglue.hh:37
│ │ │ │ -
Provides codimension-independent methods for grid extraction.
Definition: extractor.hh:46
│ │ │ │ -
GV::Traits::template Codim< dim >::Entity Vertex
Definition: extractor.hh:63
│ │ │ │ -
VertexInfoMap vtxInfo_
a map enabling faster access to vertices and coordinates
Definition: extractor.hh:216
│ │ │ │ -
const Grid & grid() const
Definition: extractor.hh:368
│ │ │ │ -
MultipleCodimMultipleGeomTypeMapper< GridView, MCMGElementLayout > CellMapper
Definition: extractor.hh:74
│ │ │ │ -
Element element(unsigned int index) const
gets the parent element for a given face index, throws an exception if index not valid
Definition: extractor.hh:380
│ │ │ │ -
int indexInInside(unsigned int index) const
gets the number face in the parent element
Definition: extractor.hh:345
│ │ │ │ -
Dune::FieldVector< ctype, dim > LocalCoords
Definition: extractor.hh:61
│ │ │ │ -
LocalGeometry geometryLocal(unsigned int index) const
Get geometry of the extracted face in element coordinates.
Definition: extractor.hh:428
│ │ │ │ -
static constexpr auto dimworld
Definition: extractor.hh:50
│ │ │ │ -
Dune::MultiLinearGeometry< ctype, dim-codim, dimworld > Geometry
Definition: extractor.hh:81
│ │ │ │ -
int IndexType
Definition: extractor.hh:77
│ │ │ │ -
std::vector< CoordinateInfo > coords_
all information about the corner vertices of the extracted
Definition: extractor.hh:206
│ │ │ │ -
GV::Traits::template Codim< 0 >::Entity Element
Definition: extractor.hh:66
│ │ │ │ -
const GridView & gridView() const
give access to the Dune::GridView where this Patch belongs to
Definition: extractor.hh:363
│ │ │ │ -
void getFaces(std::vector< VertexVector > &faces) const
Get the corners of the extracted subentities.
Definition: extractor.hh:304
│ │ │ │ -
std::vector< unsigned int > VertexVector
Definition: extractor.hh:69
│ │ │ │ -
const GridView gv_
the grid object to extract the surface from
Definition: extractor.hh:201
│ │ │ │ -
std::vector< SubEntityInfo > subEntities_
all information about the extracted subEntities
Definition: extractor.hh:209
│ │ │ │ -
static constexpr int cube_corners
Definition: extractor.hh:54
│ │ │ │ -
Vertex vertex(unsigned int index) const
gets the vertex for a given coordinate index throws an exception if index not valid
Definition: extractor.hh:396
│ │ │ │ -
static constexpr auto codim
Definition: extractor.hh:52
│ │ │ │ -
Dune::FieldVector< ctype, dimworld > Coords
Definition: extractor.hh:60
│ │ │ │ -
void getGeometryTypes(std::vector< Dune::GeometryType > &geometryTypes) const
Get the list of geometry types.
Definition: extractor.hh:293
│ │ │ │ -
std::map< IndexType, VertexInfo > VertexInfoMap
Definition: extractor.hh:196
│ │ │ │ -
GridView::Grid Grid
Definition: extractor.hh:57
│ │ │ │ -
bool faceIndices(const Element &e, int &first, int &count) const
gets index of first subentity as well as the total number of subentities that were extracted from thi...
Definition: extractor.hh:323
│ │ │ │ -
Geometry geometry(unsigned int index) const
Get world geometry of the extracted face.
Definition: extractor.hh:416
│ │ │ │ -
GV GridView
Definition: extractor.hh:56
│ │ │ │ -
unsigned int nCoords() const
getter for the count of coordinates
Definition: extractor.hh:287
│ │ │ │ -
GV::Grid::ctype ctype
Definition: extractor.hh:59
│ │ │ │ -
std::map< IndexType, ElementInfo > ElementInfoMap
Definition: extractor.hh:195
│ │ │ │ -
Extractor(const GV &gv)
Constructor.
Definition: extractor.hh:235
│ │ │ │ -
void getCoords(std::vector< Dune::FieldVector< ctype, dimworld > > &coords) const
getter for the coordinates array
Definition: extractor.hh:275
│ │ │ │ -
CellMapper cellMapper_
Definition: extractor.hh:225
│ │ │ │ -
Element::EntitySeed ElementSeed
Definition: extractor.hh:67
│ │ │ │ -
Vertex::EntitySeed VertexSeed
Definition: extractor.hh:64
│ │ │ │ -
ElementInfoMap elmtInfo_
a map enabling faster access to elements and faces
Definition: extractor.hh:223
│ │ │ │ -
void clear()
delete everything build up so far and free the memory
Definition: extractor.hh:249
│ │ │ │ -
static constexpr auto dim
Definition: extractor.hh:51
│ │ │ │ -
Dune::MultiLinearGeometry< ctype, dim-codim, dim > LocalGeometry
Definition: extractor.hh:82
│ │ │ │ -
Helpful struct holding one index for the coordinate (vertex) to which it is associated and the elemen...
Definition: extractor.hh:92
│ │ │ │ -
unsigned int idx
index of the vertex
Definition: extractor.hh:93
│ │ │ │ -
unsigned int num
element corner
Definition: extractor.hh:94
│ │ │ │ - │ │ │ │ -
CoordinateInfo(unsigned int index_, IndexType vtxindex_)
Definition: extractor.hh:102
│ │ │ │ -
unsigned int index
the index of this coordinate (in internal storage scheme) // NEEDED??
Definition: extractor.hh:113
│ │ │ │ -
CoordinateInfo()
Definition: extractor.hh:99
│ │ │ │ -
Coords coord
the coordinate
Definition: extractor.hh:110
│ │ │ │ -
IndexType vtxindex
the index of the parent element (from index set)
Definition: extractor.hh:107
│ │ │ │ -
simple struct holding a vertex pointer and an index
Definition: extractor.hh:120
│ │ │ │ -
unsigned int idx
Definition: extractor.hh:123
│ │ │ │ -
VertexInfo(unsigned int idx_, const Vertex &p_)
Definition: extractor.hh:121
│ │ │ │ -
VertexSeed p
Definition: extractor.hh:124
│ │ │ │ -
simple struct holding an element seed and an index
Definition: extractor.hh:132
│ │ │ │ -
unsigned int idx
the index of this element's first face in the internal list of extracted faces
Definition: extractor.hh:137
│ │ │ │ -
unsigned int faces
the number of extracted faces for this element
Definition: extractor.hh:140
│ │ │ │ -
ElementInfo(unsigned int idx_, const Element &p_, unsigned int f_)
Definition: extractor.hh:133
│ │ │ │ -
ElementSeed p
the entity seed for the element
Definition: extractor.hh:143
│ │ │ │ -
Holds some information about an element's subentity involved in a coupling.
Definition: extractor.hh:151
│ │ │ │ -
unsigned int nCorners() const
Definition: extractor.hh:171
│ │ │ │ -
CornerInfo corners[cube_corners]
the corner indices plus the numbers of the vertices in the parent element
Definition: extractor.hh:191
│ │ │ │ -
IndexType parent
the index of the parent element (from index set)
Definition: extractor.hh:177
│ │ │ │ -
SubEntityInfo(IndexType parent_, unsigned int num_in_parent_, const Dune::GeometryType &geometryType)
Definition: extractor.hh:166
│ │ │ │ -
unsigned int num_in_parent
the number of the face in the parent element
Definition: extractor.hh:180
│ │ │ │ -
Dune::GeometryType geometryType_
The GeometryType of the subentity.
Definition: extractor.hh:183
│ │ │ │ -
SubEntityInfo()
Definition: extractor.hh:152
│ │ │ │ +
Definition: vtksurfacewriter.hh:35
│ │ │ │ +
void writeCellData(const std::vector< T > &data, const char *dataname, int dim, std::ofstream &fos)
Definition: vtksurfacewriter.hh:176
│ │ │ │ +
void writePointData(const std::vector< T > &data, const char *dataname, int dim, std::ofstream &fos)
Definition: vtksurfacewriter.hh:190
│ │ │ │ +
void writeSurfaceVertexData(const std::vector< K > &coords, const std::vector< unsigned int > &indices, int corners, const std::vector< T > &data, const char *dataname, int dim)
Definition: vtksurfacewriter.hh:94
│ │ │ │ +
void setFilename(const char *name)
Definition: vtksurfacewriter.hh:45
│ │ │ │ +
void writeSurfaceElementData(const std::vector< K > &coords, const std::vector< unsigned int > &indices, int corners, const std::vector< T > &data, const char *dataname, int dim)
Definition: vtksurfacewriter.hh:73
│ │ │ │ +
~VtkSurfaceWriter()
Definition: vtksurfacewriter.hh:42
│ │ │ │ +
VtkSurfaceWriter(const char *filename)
Definition: vtksurfacewriter.hh:39
│ │ │ │ +
void writeSurface(const std::vector< K > &coords, const std::vector< unsigned int > &indices, int corners, int dim)
Definition: vtksurfacewriter.hh:53
│ │ │ │ +
void writePoints(const std::vector< K > &coords, int dim, std::ofstream &fos)
Definition: vtksurfacewriter.hh:116
│ │ │ │ +
void writePolygons(const std::vector< unsigned int > &indices, const int *corners, int ncorners, int dim, std::ofstream &fos)
Definition: vtksurfacewriter.hh:129
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,608 +5,281 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * extractors │ │ │ │ │ -extractor.hh │ │ │ │ │ +vtksurfacewriter.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 © DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 4// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only- │ │ │ │ │ with-dune-grid-glue-exception │ │ │ │ │ 5/* │ │ │ │ │ - 6 * Filename: extractor.hh │ │ │ │ │ + 6 * Filename: VtkSurfaceWriter.hh │ │ │ │ │ 7 * Version: 1.0 │ │ │ │ │ - 8 * Created on: Oct 05, 2009 │ │ │ │ │ - 9 * Author: Christian Engwer │ │ │ │ │ + 8 * Created on: Jan 16, 2009 │ │ │ │ │ + 9 * Author: Gerrit Buse │ │ │ │ │ 10 * --------------------------------- │ │ │ │ │ 11 * Project: dune-grid-glue │ │ │ │ │ - 12 * Description: base class for all grid extractors │ │ │ │ │ + 12 * Description: helper class for graphical output of grids in generic │ │ │ │ │ +representation │ │ │ │ │ 13 * │ │ │ │ │ 14 */ │ │ │ │ │ - 20#ifndef DUNE_GRIDGLUE_EXTRACTORS_EXTRACTOR_HH │ │ │ │ │ - 21#define DUNE_GRIDGLUE_EXTRACTORS_EXTRACTOR_HH │ │ │ │ │ + 20#ifndef DUNE_GRIDGLUE_EXTRACTORS_VTKSURFACEWRITER_HH │ │ │ │ │ + 21#define DUNE_GRIDGLUE_EXTRACTORS_VTKSURFACEWRITER_HH │ │ │ │ │ 22 │ │ │ │ │ - 23#include │ │ │ │ │ - 24#include │ │ │ │ │ - 25#include │ │ │ │ │ - 26#include │ │ │ │ │ - 27#include │ │ │ │ │ - 28#include │ │ │ │ │ - 29#include │ │ │ │ │ - 30#include │ │ │ │ │ - 31#include │ │ │ │ │ - 32#include │ │ │ │ │ + 23#include │ │ │ │ │ + 24#include │ │ │ │ │ + 25#include │ │ │ │ │ + 26#include │ │ │ │ │ + 27 │ │ │ │ │ + 28#include "../adapter/gridgluevtkwriter.hh" │ │ │ │ │ + 29 │ │ │ │ │ + 30namespace Dune { │ │ │ │ │ + 31 │ │ │ │ │ + 32 namespace GridGlue { │ │ │ │ │ 33 │ │ │ │ │ - 34namespace Dune { │ │ │ │ │ - 35 │ │ │ │ │ - 36 namespace GridGlue { │ │ │ │ │ +34class VtkSurfaceWriter │ │ │ │ │ + 35{ │ │ │ │ │ + 36public: │ │ │ │ │ 37 │ │ │ │ │ - 44template │ │ │ │ │ -45class Extractor │ │ │ │ │ - 46{ │ │ │ │ │ - 47 │ │ │ │ │ - 48public: │ │ │ │ │ - 49 │ │ │ │ │ -50 static constexpr auto dimworld = GV::dimensionworld; │ │ │ │ │ -51 static constexpr auto dim = GV::dimension; │ │ │ │ │ -52 static constexpr auto codim = cd; │ │ │ │ │ - 53 │ │ │ │ │ -54 static constexpr int cube_corners = 1 << (dim-codim); │ │ │ │ │ - 55 │ │ │ │ │ -56 typedef GV GridView; │ │ │ │ │ -57 typedef typename GridView::Grid Grid; │ │ │ │ │ - 58 │ │ │ │ │ -59 typedef typename GV::Grid::ctype ctype; │ │ │ │ │ -60 typedef Dune::FieldVector Coords; │ │ │ │ │ -61 typedef Dune::FieldVector LocalCoords; │ │ │ │ │ - 62 │ │ │ │ │ -63 typedef typename GV::Traits::template Codim::Entity Vertex; │ │ │ │ │ -64 typedef typename Vertex::EntitySeed VertexSeed; │ │ │ │ │ - 65 │ │ │ │ │ -66 typedef typename GV::Traits::template Codim<0>::Entity Element; │ │ │ │ │ -67 typedef typename Element::EntitySeed ElementSeed; │ │ │ │ │ - 68 │ │ │ │ │ -69 typedef std::vector VertexVector; │ │ │ │ │ + 38 │ │ │ │ │ +39 VtkSurfaceWriter(const char* filename) : filename_(filename) │ │ │ │ │ + 40 {} │ │ │ │ │ + 41 │ │ │ │ │ +42 ~VtkSurfaceWriter() │ │ │ │ │ + 43 {} │ │ │ │ │ + 44 │ │ │ │ │ +45 void setFilename(const char* name) │ │ │ │ │ + 46 { │ │ │ │ │ + 47 if (std::strlen(name) > 0) │ │ │ │ │ + 48 this->filename_ = name; │ │ │ │ │ + 49 } │ │ │ │ │ + 50 │ │ │ │ │ + 51 │ │ │ │ │ + 52 template │ │ │ │ │ +53 void writeSurface(const std::vector& coords, const std::vector& indices, int corners, int dim) │ │ │ │ │ + 54 { │ │ │ │ │ + 55 std::ofstream fos; │ │ │ │ │ + 56 char buffer[64]; │ │ │ │ │ + 57 sprintf(buffer, "%s.vtk", this->filename_); │ │ │ │ │ + 58 fos.open(buffer); │ │ │ │ │ + 59 fos << std::setprecision(8) << std::setw(1); │ │ │ │ │ + 60 // write preamble │ │ │ │ │ + 61 fos << "# vtk DataFile Version 2.0\nFilename: " << buffer << "\nASCII" << │ │ │ │ │ +std::endl; │ │ │ │ │ + 62 this->writePoints(coords, dim, fos); │ │ │ │ │ + 63 const int polycount = indices.size()/corners; │ │ │ │ │ + 64 int corner_count[polycount]; │ │ │ │ │ + 65 for (int i = 0; i < polycount; ++i) │ │ │ │ │ + 66 corner_count[i] = corners; │ │ │ │ │ + 67 this->writePolygons(indices, corner_count, polycount, dim, fos); │ │ │ │ │ + 68 fos.close(); │ │ │ │ │ + 69 } │ │ │ │ │ 70 │ │ │ │ │ - 71#if DUNE_VERSION_NEWER(DUNE_GRID, 2, 6) │ │ │ │ │ - 72 using CellMapper = MultipleCodimMultipleGeomTypeMapper; │ │ │ │ │ - 73#else │ │ │ │ │ -74 using CellMapper = MultipleCodimMultipleGeomTypeMapper; │ │ │ │ │ - 75#endif │ │ │ │ │ - 76 // typedef typename CellMapper::IndexType IndexType; │ │ │ │ │ -77 typedef int IndexType; │ │ │ │ │ - 78public: │ │ │ │ │ - 79 │ │ │ │ │ - 80 // transformations │ │ │ │ │ -81 typedef Dune::MultiLinearGeometry Geometry; │ │ │ │ │ -82 typedef Dune::MultiLinearGeometry LocalGeometry; │ │ │ │ │ - 83 │ │ │ │ │ - 84protected: │ │ │ │ │ - 85 /************************** PRIVATE SUBCLASSES **********************/ │ │ │ │ │ - 86 │ │ │ │ │ -91 struct CornerInfo │ │ │ │ │ - 92 { │ │ │ │ │ -93 unsigned int idx : 28; │ │ │ │ │ -94 unsigned int num : 4; │ │ │ │ │ - 95 }; │ │ │ │ │ - 96 │ │ │ │ │ -97 struct CoordinateInfo │ │ │ │ │ - 98 { │ │ │ │ │ -99 CoordinateInfo() │ │ │ │ │ - 100 {} │ │ │ │ │ - 101 │ │ │ │ │ -102 CoordinateInfo(unsigned int index_, IndexType vtxindex_) │ │ │ │ │ - 103 : vtxindex(vtxindex_), index(index_) │ │ │ │ │ - 104 {} │ │ │ │ │ - 105 │ │ │ │ │ -107 IndexType vtxindex; │ │ │ │ │ - 108 │ │ │ │ │ -110 Coords coord; │ │ │ │ │ - 111 │ │ │ │ │ -113 unsigned int index; │ │ │ │ │ - 114 }; │ │ │ │ │ - 115 │ │ │ │ │ -119 struct VertexInfo │ │ │ │ │ + 71 │ │ │ │ │ + 72 template │ │ │ │ │ +73 void writeSurfaceElementData(const std::vector& coords, const std:: │ │ │ │ │ +vector& indices, int corners, const std::vector& data, const │ │ │ │ │ +char* dataname, int dim) │ │ │ │ │ + 74 { │ │ │ │ │ + 75 std::ofstream fos; │ │ │ │ │ + 76 char buffer[64]; │ │ │ │ │ + 77 sprintf(buffer, "%s.vtk", this->filename_); │ │ │ │ │ + 78 fos.open(buffer); │ │ │ │ │ + 79 fos << std::setprecision(8) << std::setw(1); │ │ │ │ │ + 80 // write preamble │ │ │ │ │ + 81 fos << "# vtk DataFile Version 2.0\nFilename: " << buffer << "\nASCII" << │ │ │ │ │ +std::endl; │ │ │ │ │ + 82 this->writePoints(coords, dim, fos); │ │ │ │ │ + 83 const int polycount = indices.size()/corners; │ │ │ │ │ + 84 int corner_count[polycount]; │ │ │ │ │ + 85 for (int i = 0; i < polycount; ++i) │ │ │ │ │ + 86 corner_count[i] = corners; │ │ │ │ │ + 87 this->writePolygons(indices, corner_count, polycount, dim, fos); │ │ │ │ │ + 88 this->writeCellData(data, dataname, dim, fos); │ │ │ │ │ + 89 fos.close(); │ │ │ │ │ + 90 } │ │ │ │ │ + 91 │ │ │ │ │ + 92 │ │ │ │ │ + 93 template │ │ │ │ │ +94 void writeSurfaceVertexData(const std::vector& coords, const std:: │ │ │ │ │ +vector& indices, int corners, const std::vector& data, const │ │ │ │ │ +char* dataname, int dim) │ │ │ │ │ + 95 { │ │ │ │ │ + 96 std::ofstream fos; │ │ │ │ │ + 97 char buffer[64]; │ │ │ │ │ + 98 sprintf(buffer, "%s.vtk", this->filename_); │ │ │ │ │ + 99 fos.open(buffer); │ │ │ │ │ + 100 fos << std::setprecision(8) << std::setw(1); │ │ │ │ │ + 101 // write preamble │ │ │ │ │ + 102 fos << "# vtk DataFile Version 2.0\nFilename: " << buffer << "\nASCII" << │ │ │ │ │ +std::endl; │ │ │ │ │ + 103 this->writePoints(coords, dim, fos); │ │ │ │ │ + 104 const int polycount = indices.size()/corners; │ │ │ │ │ + 105 int corner_count[polycount]; │ │ │ │ │ + 106 for (int i = 0; i < polycount; ++i) │ │ │ │ │ + 107 corner_count[i] = corners; │ │ │ │ │ + 108 this->writePolygons(indices, corner_count, polycount, dim, fos); │ │ │ │ │ + 109 this->writePointData(data, dataname, dim, fos); │ │ │ │ │ + 110 fos.close(); │ │ │ │ │ + 111 } │ │ │ │ │ + 112 │ │ │ │ │ + 113protected: │ │ │ │ │ + 114 │ │ │ │ │ + 115 template │ │ │ │ │ +116 void writePoints(const std::vector& coords, int dim, std::ofstream& fos) │ │ │ │ │ + 117 { │ │ │ │ │ + 118 fos << "DATASET POLYDATA\nPOINTS " << coords.size() << " " << TypeNames │ │ │ │ │ +[Nametraits::nameidx] << std::endl; │ │ │ │ │ + 119 for (unsigned int i = 0; i < coords.size(); ++i) │ │ │ │ │ 120 { │ │ │ │ │ -121 VertexInfo(unsigned int idx_, const Vertex& p_) : idx(idx_), p(p_.seed()) │ │ │ │ │ - 122 {} │ │ │ │ │ -123 unsigned int idx; │ │ │ │ │ -124 VertexSeed p; │ │ │ │ │ - 125 }; │ │ │ │ │ - 126 │ │ │ │ │ - 127 │ │ │ │ │ -131 struct ElementInfo │ │ │ │ │ + 121 fos << coords[i][0]; │ │ │ │ │ + 122 if (dim == 2) │ │ │ │ │ + 123 fos << " " << coords[i][1] << " 0 \n" << coords[i][0] << " " << coords[i] │ │ │ │ │ +[1] << " 0.01" << std::endl; │ │ │ │ │ + 124 else // dim == 3 │ │ │ │ │ + 125 fos << " " << coords[i][1] << " " << coords[i][2] << std::endl; │ │ │ │ │ + 126 } │ │ │ │ │ + 127 } │ │ │ │ │ + 128 │ │ │ │ │ +129 void writePolygons(const std::vector& indices, const int* │ │ │ │ │ +corners, int ncorners, int dim, std::ofstream& fos) │ │ │ │ │ + 130 { │ │ │ │ │ + 131 if (dim == 2) │ │ │ │ │ 132 { │ │ │ │ │ -133 ElementInfo(unsigned int idx_, const Element& p_, unsigned int f_) : idx │ │ │ │ │ -(idx_), faces(f_), p(p_.seed()) │ │ │ │ │ - 134 {} │ │ │ │ │ - 135 │ │ │ │ │ -137 unsigned int idx : 28; │ │ │ │ │ - 138 │ │ │ │ │ -140 unsigned int faces : 4; │ │ │ │ │ - 141 │ │ │ │ │ -143 ElementSeed p; │ │ │ │ │ - 144 }; │ │ │ │ │ - 145 │ │ │ │ │ - 146 │ │ │ │ │ -150 struct SubEntityInfo │ │ │ │ │ - 151 { │ │ │ │ │ -152 SubEntityInfo() │ │ │ │ │ - 153 /* │ │ │ │ │ - 154 * TODO: move default value of `geometryType_` to member declaration │ │ │ │ │ - 155 * when removing support for older dune-geometry │ │ │ │ │ - 156 */ │ │ │ │ │ - 157#if DUNE_VERSION_NEWER(DUNE_GEOMETRY, 2, 6) │ │ │ │ │ - 158 : geometryType_(GeometryTypes::simplex(dim-codim)) │ │ │ │ │ - 159 {} │ │ │ │ │ - 160#else │ │ │ │ │ - 161 { │ │ │ │ │ - 162 geometryType_.makeSimplex(dim-codim); │ │ │ │ │ - 163 } │ │ │ │ │ - 164#endif │ │ │ │ │ - 165 │ │ │ │ │ -166 SubEntityInfo(IndexType parent_, unsigned int num_in_parent_, │ │ │ │ │ - 167 const Dune::GeometryType& geometryType) │ │ │ │ │ - 168 : parent(parent_), num_in_parent(num_in_parent_), geometryType_ │ │ │ │ │ -(geometryType) │ │ │ │ │ - 169 {} │ │ │ │ │ - 170 │ │ │ │ │ -171 unsigned int nCorners() const │ │ │ │ │ - 172 { │ │ │ │ │ - 173 return Dune::ReferenceElements::general │ │ │ │ │ -(geometryType_).size(dim-codim); │ │ │ │ │ - 174 } │ │ │ │ │ - 175 │ │ │ │ │ -177 IndexType parent; │ │ │ │ │ - 178 │ │ │ │ │ -180 unsigned int num_in_parent : 3; │ │ │ │ │ - 181 │ │ │ │ │ -183 Dune::GeometryType geometryType_; │ │ │ │ │ - 184 │ │ │ │ │ -191 CornerInfo corners[cube_corners]; // sim = numer of vertices in a simplex │ │ │ │ │ - 192 }; │ │ │ │ │ - 193 │ │ │ │ │ - 194 │ │ │ │ │ -195 typedef std::map ElementInfoMap; │ │ │ │ │ -196 typedef std::map VertexInfoMap; │ │ │ │ │ - 197 │ │ │ │ │ - 198 /************************** MEMBER VARIABLES ************************/ │ │ │ │ │ - 199 │ │ │ │ │ -201 const GridView gv_; │ │ │ │ │ + 133 fos << "POLYGONS " << indices.size()/2 << " " << 5*(indices.size() / 2) << │ │ │ │ │ +std::endl; │ │ │ │ │ + 134 for (unsigned int i = 0; i < indices.size(); i += 2) │ │ │ │ │ + 135 fos << "4 " << 2*indices[i] << " " << 2*indices[i+1] << " " << 2*indices │ │ │ │ │ +[i+1]+1 << " "<< 2*indices[i]+1 << std::endl; │ │ │ │ │ + 136 │ │ │ │ │ + 137 // arbitrary shapes - ignored here! │ │ │ │ │ + 138 // int sum = ncorners; │ │ │ │ │ + 139 // for (int i = 0; i < ncorners; ++i) │ │ │ │ │ + 140 // sum += (corners[i] > 2 ? corners[i] : 3); │ │ │ │ │ + 141 // │ │ │ │ │ + 142 // fos << "POLYGONS " << ncorners << " " << sum << std::endl; │ │ │ │ │ + 143 // int index = 0; │ │ │ │ │ + 144 // for (int i = 0; i < ncorners; ++i) │ │ │ │ │ + 145 // { │ │ │ │ │ + 146 // // write the first index twice if it is an egde │ │ │ │ │ + 147 // // => triangle instead of edge - paraview can display it then │ │ │ │ │ + 148 // if (corners[i] > 2) │ │ │ │ │ + 149 // fos << corners[i]; │ │ │ │ │ + 150 // else │ │ │ │ │ + 151 // fos << "3 " << indices[index]; │ │ │ │ │ + 152 // │ │ │ │ │ + 153 // for (int j = 0; j < corners[i]; ++j) │ │ │ │ │ + 154 // fos << " " << indices[index++]; │ │ │ │ │ + 155 // fos << std::endl; │ │ │ │ │ + 156 // } │ │ │ │ │ + 157 } │ │ │ │ │ + 158 else │ │ │ │ │ + 159 { │ │ │ │ │ + 160 int sum = ncorners; │ │ │ │ │ + 161 for (int i = 0; i < ncorners; ++i) │ │ │ │ │ + 162 sum += corners[i]; │ │ │ │ │ + 163 fos << "POLYGONS " << ncorners << " " << sum << std::endl; │ │ │ │ │ + 164 int index = 0; │ │ │ │ │ + 165 for (int i = 0; i < ncorners; ++i) │ │ │ │ │ + 166 { │ │ │ │ │ + 167 fos << corners[i]; │ │ │ │ │ + 168 for (int j = 0; j < corners[i]; ++j) │ │ │ │ │ + 169 fos << " " << indices[index++]; │ │ │ │ │ + 170 fos << std::endl; │ │ │ │ │ + 171 } │ │ │ │ │ + 172 } │ │ │ │ │ + 173 } │ │ │ │ │ + 174 │ │ │ │ │ + 175 template │ │ │ │ │ +176 void writeCellData(const std::vector& data, const char* dataname, int │ │ │ │ │ +dim, std::ofstream& fos) │ │ │ │ │ + 177 { │ │ │ │ │ + 178 fos << "CELL_DATA " << data.size()*(dim == 2 ? 2 : 1) << std::endl; │ │ │ │ │ + 179 fos << "SCALARS " << dataname << " " << TypeNames[Nametraits::nameidx] │ │ │ │ │ +<< " 1" << std::endl; │ │ │ │ │ + 180 fos << "LOOKUP_TABLE default" << std::endl; │ │ │ │ │ + 181 for (unsigned int i = 0; i < data.size(); ++i) │ │ │ │ │ + 182 { │ │ │ │ │ + 183 fos << data[i] << std::endl; │ │ │ │ │ + 184 if (dim == 2) │ │ │ │ │ + 185 fos << data[i] << std::endl; │ │ │ │ │ + 186 } │ │ │ │ │ + 187 } │ │ │ │ │ + 188 │ │ │ │ │ + 189 template │ │ │ │ │ +190 void writePointData(const std::vector& data, const char* dataname, int │ │ │ │ │ +dim, std::ofstream& fos) │ │ │ │ │ + 191 { │ │ │ │ │ + 192 fos << "POINT_DATA " << data.size()*(dim == 2 ? 2 : 1) << std::endl; │ │ │ │ │ + 193 fos << "SCALARS " << dataname << " " << TypeNames[Nametraits::nameidx] │ │ │ │ │ +<< " 1" << std::endl; │ │ │ │ │ + 194 fos << "LOOKUP_TABLE default" << std::endl; │ │ │ │ │ + 195 for (unsigned int i = 0; i < data.size(); ++i) │ │ │ │ │ + 196 { │ │ │ │ │ + 197 fos << data[i] << std::endl; │ │ │ │ │ + 198 if (dim == 2) │ │ │ │ │ + 199 fos << data[i] << std::endl; │ │ │ │ │ + 200 } │ │ │ │ │ + 201 } │ │ │ │ │ 202 │ │ │ │ │ - 203 /* Geometrical and Topological Information */ │ │ │ │ │ - 204 │ │ │ │ │ -206 std::vector coords_; │ │ │ │ │ + 203 │ │ │ │ │ + 204private: │ │ │ │ │ + 205 const char* filename_; │ │ │ │ │ + 206}; │ │ │ │ │ 207 │ │ │ │ │ -209 std::vector subEntities_; │ │ │ │ │ - 210 │ │ │ │ │ -216 VertexInfoMap vtxInfo_; │ │ │ │ │ - 217 │ │ │ │ │ -223 ElementInfoMap elmtInfo_; │ │ │ │ │ - 224 │ │ │ │ │ -225 CellMapper cellMapper_; │ │ │ │ │ - 226 │ │ │ │ │ - 227public: │ │ │ │ │ - 228 │ │ │ │ │ - 229 /* C O N S T R U C T O R S A N D D E S T R U C T O R S */ │ │ │ │ │ - 230 │ │ │ │ │ -235 Extractor(const GV& gv) │ │ │ │ │ - 236 : gv_(gv) │ │ │ │ │ - 237#if DUNE_VERSION_NEWER(DUNE_GRID, 2, 6) │ │ │ │ │ - 238 , cellMapper_(gv, mcmgElementLayout()) │ │ │ │ │ - 239#else │ │ │ │ │ - 240 , cellMapper_(gv) │ │ │ │ │ - 241#endif │ │ │ │ │ - 242 {} │ │ │ │ │ - 243 │ │ │ │ │ - 244 /* F U N C T I O N A L I T Y */ │ │ │ │ │ - 245 │ │ │ │ │ -249 void clear() │ │ │ │ │ - 250 { │ │ │ │ │ - 251 // this is an inofficial way on how to free the memory allocated │ │ │ │ │ - 252 // by a std::vector │ │ │ │ │ - 253 { │ │ │ │ │ - 254 std::vector dummy; │ │ │ │ │ - 255 coords_.swap(dummy); │ │ │ │ │ - 256 } │ │ │ │ │ - 257 { │ │ │ │ │ - 258 std::vector dummy; │ │ │ │ │ - 259 subEntities_.swap(dummy); │ │ │ │ │ - 260 } │ │ │ │ │ - 261 │ │ │ │ │ - 262 // ...then clear the maps themselves, too │ │ │ │ │ - 263 vtxInfo_.clear(); │ │ │ │ │ - 264 elmtInfo_.clear(); │ │ │ │ │ - 265 } │ │ │ │ │ - 266 │ │ │ │ │ - 267 │ │ │ │ │ - 268 /* G E T T E R S */ │ │ │ │ │ - 269 │ │ │ │ │ -275 void getCoords(std::vector >& coords) │ │ │ │ │ -const │ │ │ │ │ - 276 { │ │ │ │ │ - 277 coords.resize(coords_.size()); │ │ │ │ │ - 278 for (unsigned int i = 0; i < coords_.size(); ++i) │ │ │ │ │ - 279 coords[i] = coords_[i].coord; │ │ │ │ │ - 280 } │ │ │ │ │ - 281 │ │ │ │ │ - 282 │ │ │ │ │ -287 unsigned int nCoords() const │ │ │ │ │ - 288 { │ │ │ │ │ - 289 return coords_.size(); │ │ │ │ │ - 290 } │ │ │ │ │ - 291 │ │ │ │ │ -293 void getGeometryTypes(std::vector& geometryTypes) const │ │ │ │ │ - 294 { │ │ │ │ │ - 295 geometryTypes.resize(subEntities_.size()); │ │ │ │ │ - 296 for (size_t i=0; i& faces) const │ │ │ │ │ - 305 { │ │ │ │ │ - 306 faces.resize(subEntities_.size()); │ │ │ │ │ - 307 for (unsigned int i = 0; i < subEntities_.size(); ++i) { │ │ │ │ │ - 308 faces[i].resize(subEntities_[i].nCorners()); │ │ │ │ │ - 309 for (unsigned int j = 0; j < subEntities_[i].nCorners(); ++j) │ │ │ │ │ - 310 faces[i][j] = subEntities_[i].corners[j].idx; │ │ │ │ │ - 311 } │ │ │ │ │ - 312 } │ │ │ │ │ - 313 │ │ │ │ │ - 314 │ │ │ │ │ -323 bool faceIndices(const Element& e, int& first, int& count) const │ │ │ │ │ - 324 { │ │ │ │ │ - 325 typename ElementInfoMap::const_iterator it = │ │ │ │ │ - 326 elmtInfo_.find(cellMapper_.map(e)); │ │ │ │ │ - 327 if (it == elmtInfo_.end()) │ │ │ │ │ - 328 { │ │ │ │ │ - 329 first = -1; │ │ │ │ │ - 330 count = 0; │ │ │ │ │ - 331 return false; │ │ │ │ │ - 332 } │ │ │ │ │ - 333 // the iterator is valid, fill the out params │ │ │ │ │ - 334 first = it->second.idx; │ │ │ │ │ - 335 count = it->second.faces; │ │ │ │ │ - 336 return true; │ │ │ │ │ - 337 } │ │ │ │ │ - 338 │ │ │ │ │ - 339 │ │ │ │ │ -345 int indexInInside(unsigned int index) const │ │ │ │ │ - 346 { │ │ │ │ │ - 347 return index < subEntities_.size() ? subEntities_[index].num_in_parent : - │ │ │ │ │ -1; │ │ │ │ │ - 348 } │ │ │ │ │ - 349 │ │ │ │ │ - 350 // /** │ │ │ │ │ - 351 // * @brief tests that a given entry in the extraction set does have local │ │ │ │ │ -couplings │ │ │ │ │ - 352 // * @todo parallel interface │ │ │ │ │ - 353 // */ │ │ │ │ │ - 354 // bool contains (unsigned int global, unsigned int & local) const │ │ │ │ │ - 355 // { │ │ │ │ │ - 356 // local = global; │ │ │ │ │ - 357 // return true; │ │ │ │ │ - 358 // } │ │ │ │ │ - 359 │ │ │ │ │ -363 const GridView & gridView() const │ │ │ │ │ - 364 { │ │ │ │ │ - 365 return gv_; │ │ │ │ │ - 366 } │ │ │ │ │ - 367 │ │ │ │ │ -368 const Grid& grid() const │ │ │ │ │ - 369 { │ │ │ │ │ - 370 return gv_.grid(); │ │ │ │ │ - 371 } │ │ │ │ │ - 372 │ │ │ │ │ - 379 Element │ │ │ │ │ -380 element(unsigned int index) const │ │ │ │ │ - 381 { │ │ │ │ │ - 382 if (index >= subEntities_.size()) │ │ │ │ │ - 383 DUNE_THROW(Dune::GridError, "invalid face index"); │ │ │ │ │ - 384 const ElementSeed seed = elmtInfo_.at(subEntities_[index].parent).p; │ │ │ │ │ - 385 return grid().entity(seed); │ │ │ │ │ - 386 } │ │ │ │ │ - 387 │ │ │ │ │ - 388#if 1 │ │ │ │ │ - 395 Vertex │ │ │ │ │ -396 vertex(unsigned int index) const │ │ │ │ │ - 397 { │ │ │ │ │ - 398 if (index >= coords_.size()) │ │ │ │ │ - 399 DUNE_THROW(Dune::GridError, "invalid coordinate index"); │ │ │ │ │ - 400 const VertexSeed seed = vtxInfo_.at(coords_[index].vtxindex).p; │ │ │ │ │ - 401 return grid().entity(seed); │ │ │ │ │ - 402 } │ │ │ │ │ - 403#endif │ │ │ │ │ - 404 │ │ │ │ │ -406 Geometry geometry(unsigned int index) const; │ │ │ │ │ - 407 │ │ │ │ │ -409 LocalGeometry geometryLocal(unsigned int index) const; │ │ │ │ │ - 410 │ │ │ │ │ - 411}; │ │ │ │ │ - 412 │ │ │ │ │ - 413 │ │ │ │ │ - 415template │ │ │ │ │ -416typename Extractor::Geometry Extractor::geometry(unsigned int │ │ │ │ │ -index) const │ │ │ │ │ - 417{ │ │ │ │ │ - 418 std::vector corners(subEntities_[index].nCorners()); │ │ │ │ │ - 419 for (unsigned int i = 0; i < subEntities_[index].nCorners(); ++i) │ │ │ │ │ - 420 corners[i] = coords_[subEntities_[index].corners[i].idx].coord; │ │ │ │ │ - 421 │ │ │ │ │ - 422 return Geometry(subEntities_[index].geometryType_, corners); │ │ │ │ │ - 423} │ │ │ │ │ - 424 │ │ │ │ │ - 425 │ │ │ │ │ - 427template │ │ │ │ │ -428typename Extractor::LocalGeometry Extractor::geometryLocal │ │ │ │ │ -(unsigned int index) const │ │ │ │ │ - 429{ │ │ │ │ │ - 430 std::vector corners(subEntities_[index].nCorners()); │ │ │ │ │ - 431 │ │ │ │ │ - 432 // get face info │ │ │ │ │ - 433 const SubEntityInfo & face = subEntities_[index]; │ │ │ │ │ - 434 Dune::GeometryType facetype = subEntities_[index].geometryType_; │ │ │ │ │ - 435 │ │ │ │ │ - 436 // get reference element │ │ │ │ │ - 437 const auto elmtseed = elmtInfo_.at(face.parent).p; │ │ │ │ │ - 438 const auto elmt = grid().entity(elmtseed); │ │ │ │ │ - 439 const Dune::GeometryType celltype = elmt.type(); │ │ │ │ │ - 440 const auto& re = Dune::ReferenceElements::general(celltype); │ │ │ │ │ - 441 for (unsigned int i = 0; i < subEntities_[index].nCorners(); ++i) │ │ │ │ │ - 442 corners[i] = re.position(face.corners[i].num,dim); │ │ │ │ │ - 443 │ │ │ │ │ - 444 return LocalGeometry(facetype, corners); │ │ │ │ │ - 445} │ │ │ │ │ - 446 │ │ │ │ │ - 447} // namespace GridGlue │ │ │ │ │ - 448 │ │ │ │ │ - 449} // namespace Dune │ │ │ │ │ - 450 │ │ │ │ │ - 451#endif // DUNE_GRIDGLUE_EXTRACTORS_EXTRACTOR_HH │ │ │ │ │ + 208} // namespace GridGlue │ │ │ │ │ + 209 │ │ │ │ │ + 210} // namespace Dune │ │ │ │ │ + 211 │ │ │ │ │ + 212#endif // DUNE_GRIDGLUE_EXTRACTORS_VTKSURFACEWRITER_HH │ │ │ │ │ Dune │ │ │ │ │ Definition: gridglue.hh:37 │ │ │ │ │ -Dune::GridGlue::Extractor │ │ │ │ │ -Provides codimension-independent methods for grid extraction. │ │ │ │ │ -Definition: extractor.hh:46 │ │ │ │ │ -Dune::GridGlue::Extractor::Vertex │ │ │ │ │ -GV::Traits::template Codim< dim >::Entity Vertex │ │ │ │ │ -Definition: extractor.hh:63 │ │ │ │ │ -Dune::GridGlue::Extractor::vtxInfo_ │ │ │ │ │ -VertexInfoMap vtxInfo_ │ │ │ │ │ -a map enabling faster access to vertices and coordinates │ │ │ │ │ -Definition: extractor.hh:216 │ │ │ │ │ -Dune::GridGlue::Extractor::grid │ │ │ │ │ -const Grid & grid() const │ │ │ │ │ -Definition: extractor.hh:368 │ │ │ │ │ -Dune::GridGlue::Extractor::CellMapper │ │ │ │ │ -MultipleCodimMultipleGeomTypeMapper< GridView, MCMGElementLayout > CellMapper │ │ │ │ │ -Definition: extractor.hh:74 │ │ │ │ │ -Dune::GridGlue::Extractor::element │ │ │ │ │ -Element element(unsigned int index) const │ │ │ │ │ -gets the parent element for a given face index, throws an exception if index │ │ │ │ │ -not valid │ │ │ │ │ -Definition: extractor.hh:380 │ │ │ │ │ -Dune::GridGlue::Extractor::indexInInside │ │ │ │ │ -int indexInInside(unsigned int index) const │ │ │ │ │ -gets the number face in the parent element │ │ │ │ │ -Definition: extractor.hh:345 │ │ │ │ │ -Dune::GridGlue::Extractor::LocalCoords │ │ │ │ │ -Dune::FieldVector< ctype, dim > LocalCoords │ │ │ │ │ -Definition: extractor.hh:61 │ │ │ │ │ -Dune::GridGlue::Extractor::geometryLocal │ │ │ │ │ -LocalGeometry geometryLocal(unsigned int index) const │ │ │ │ │ -Get geometry of the extracted face in element coordinates. │ │ │ │ │ -Definition: extractor.hh:428 │ │ │ │ │ -Dune::GridGlue::Extractor::dimworld │ │ │ │ │ -static constexpr auto dimworld │ │ │ │ │ -Definition: extractor.hh:50 │ │ │ │ │ -Dune::GridGlue::Extractor::Geometry │ │ │ │ │ -Dune::MultiLinearGeometry< ctype, dim-codim, dimworld > Geometry │ │ │ │ │ -Definition: extractor.hh:81 │ │ │ │ │ -Dune::GridGlue::Extractor::IndexType │ │ │ │ │ -int IndexType │ │ │ │ │ -Definition: extractor.hh:77 │ │ │ │ │ -Dune::GridGlue::Extractor::coords_ │ │ │ │ │ -std::vector< CoordinateInfo > coords_ │ │ │ │ │ -all information about the corner vertices of the extracted │ │ │ │ │ -Definition: extractor.hh:206 │ │ │ │ │ -Dune::GridGlue::Extractor::Element │ │ │ │ │ -GV::Traits::template Codim< 0 >::Entity Element │ │ │ │ │ -Definition: extractor.hh:66 │ │ │ │ │ -Dune::GridGlue::Extractor::gridView │ │ │ │ │ -const GridView & gridView() const │ │ │ │ │ -give access to the Dune::GridView where this Patch belongs to │ │ │ │ │ -Definition: extractor.hh:363 │ │ │ │ │ -Dune::GridGlue::Extractor::getFaces │ │ │ │ │ -void getFaces(std::vector< VertexVector > &faces) const │ │ │ │ │ -Get the corners of the extracted subentities. │ │ │ │ │ -Definition: extractor.hh:304 │ │ │ │ │ -Dune::GridGlue::Extractor::VertexVector │ │ │ │ │ -std::vector< unsigned int > VertexVector │ │ │ │ │ -Definition: extractor.hh:69 │ │ │ │ │ -Dune::GridGlue::Extractor::gv_ │ │ │ │ │ -const GridView gv_ │ │ │ │ │ -the grid object to extract the surface from │ │ │ │ │ -Definition: extractor.hh:201 │ │ │ │ │ -Dune::GridGlue::Extractor::subEntities_ │ │ │ │ │ -std::vector< SubEntityInfo > subEntities_ │ │ │ │ │ -all information about the extracted subEntities │ │ │ │ │ -Definition: extractor.hh:209 │ │ │ │ │ -Dune::GridGlue::Extractor::cube_corners │ │ │ │ │ -static constexpr int cube_corners │ │ │ │ │ -Definition: extractor.hh:54 │ │ │ │ │ -Dune::GridGlue::Extractor::vertex │ │ │ │ │ -Vertex vertex(unsigned int index) const │ │ │ │ │ -gets the vertex for a given coordinate index throws an exception if index not │ │ │ │ │ -valid │ │ │ │ │ -Definition: extractor.hh:396 │ │ │ │ │ -Dune::GridGlue::Extractor::codim │ │ │ │ │ -static constexpr auto codim │ │ │ │ │ -Definition: extractor.hh:52 │ │ │ │ │ -Dune::GridGlue::Extractor::Coords │ │ │ │ │ -Dune::FieldVector< ctype, dimworld > Coords │ │ │ │ │ -Definition: extractor.hh:60 │ │ │ │ │ -Dune::GridGlue::Extractor::getGeometryTypes │ │ │ │ │ -void getGeometryTypes(std::vector< Dune::GeometryType > &geometryTypes) const │ │ │ │ │ -Get the list of geometry types. │ │ │ │ │ -Definition: extractor.hh:293 │ │ │ │ │ -Dune::GridGlue::Extractor::VertexInfoMap │ │ │ │ │ -std::map< IndexType, VertexInfo > VertexInfoMap │ │ │ │ │ -Definition: extractor.hh:196 │ │ │ │ │ -Dune::GridGlue::Extractor::Grid │ │ │ │ │ -GridView::Grid Grid │ │ │ │ │ -Definition: extractor.hh:57 │ │ │ │ │ -Dune::GridGlue::Extractor::faceIndices │ │ │ │ │ -bool faceIndices(const Element &e, int &first, int &count) const │ │ │ │ │ -gets index of first subentity as well as the total number of subentities that │ │ │ │ │ -were extracted from thi... │ │ │ │ │ -Definition: extractor.hh:323 │ │ │ │ │ -Dune::GridGlue::Extractor::geometry │ │ │ │ │ -Geometry geometry(unsigned int index) const │ │ │ │ │ -Get world geometry of the extracted face. │ │ │ │ │ -Definition: extractor.hh:416 │ │ │ │ │ -Dune::GridGlue::Extractor::GridView │ │ │ │ │ -GV GridView │ │ │ │ │ -Definition: extractor.hh:56 │ │ │ │ │ -Dune::GridGlue::Extractor::nCoords │ │ │ │ │ -unsigned int nCoords() const │ │ │ │ │ -getter for the count of coordinates │ │ │ │ │ -Definition: extractor.hh:287 │ │ │ │ │ -Dune::GridGlue::Extractor::ctype │ │ │ │ │ -GV::Grid::ctype ctype │ │ │ │ │ -Definition: extractor.hh:59 │ │ │ │ │ -Dune::GridGlue::Extractor::ElementInfoMap │ │ │ │ │ -std::map< IndexType, ElementInfo > ElementInfoMap │ │ │ │ │ -Definition: extractor.hh:195 │ │ │ │ │ -Dune::GridGlue::Extractor::Extractor │ │ │ │ │ -Extractor(const GV &gv) │ │ │ │ │ -Constructor. │ │ │ │ │ -Definition: extractor.hh:235 │ │ │ │ │ -Dune::GridGlue::Extractor::getCoords │ │ │ │ │ -void getCoords(std::vector< Dune::FieldVector< ctype, dimworld > > &coords) │ │ │ │ │ -const │ │ │ │ │ -getter for the coordinates array │ │ │ │ │ -Definition: extractor.hh:275 │ │ │ │ │ -Dune::GridGlue::Extractor::cellMapper_ │ │ │ │ │ -CellMapper cellMapper_ │ │ │ │ │ -Definition: extractor.hh:225 │ │ │ │ │ -Dune::GridGlue::Extractor::ElementSeed │ │ │ │ │ -Element::EntitySeed ElementSeed │ │ │ │ │ -Definition: extractor.hh:67 │ │ │ │ │ -Dune::GridGlue::Extractor::VertexSeed │ │ │ │ │ -Vertex::EntitySeed VertexSeed │ │ │ │ │ -Definition: extractor.hh:64 │ │ │ │ │ -Dune::GridGlue::Extractor::elmtInfo_ │ │ │ │ │ -ElementInfoMap elmtInfo_ │ │ │ │ │ -a map enabling faster access to elements and faces │ │ │ │ │ -Definition: extractor.hh:223 │ │ │ │ │ -Dune::GridGlue::Extractor::clear │ │ │ │ │ -void clear() │ │ │ │ │ -delete everything build up so far and free the memory │ │ │ │ │ -Definition: extractor.hh:249 │ │ │ │ │ -Dune::GridGlue::Extractor::dim │ │ │ │ │ -static constexpr auto dim │ │ │ │ │ -Definition: extractor.hh:51 │ │ │ │ │ -Dune::GridGlue::Extractor::LocalGeometry │ │ │ │ │ -Dune::MultiLinearGeometry< ctype, dim-codim, dim > LocalGeometry │ │ │ │ │ -Definition: extractor.hh:82 │ │ │ │ │ -Dune::GridGlue::Extractor::CornerInfo │ │ │ │ │ -Helpful struct holding one index for the coordinate (vertex) to which it is │ │ │ │ │ -associated and the elemen... │ │ │ │ │ -Definition: extractor.hh:92 │ │ │ │ │ -Dune::GridGlue::Extractor::CornerInfo::idx │ │ │ │ │ -unsigned int idx │ │ │ │ │ -index of the vertex │ │ │ │ │ -Definition: extractor.hh:93 │ │ │ │ │ -Dune::GridGlue::Extractor::CornerInfo::num │ │ │ │ │ -unsigned int num │ │ │ │ │ -element corner │ │ │ │ │ -Definition: extractor.hh:94 │ │ │ │ │ -Dune::GridGlue::Extractor::CoordinateInfo │ │ │ │ │ -Definition: extractor.hh:98 │ │ │ │ │ -Dune::GridGlue::Extractor::CoordinateInfo::CoordinateInfo │ │ │ │ │ -CoordinateInfo(unsigned int index_, IndexType vtxindex_) │ │ │ │ │ -Definition: extractor.hh:102 │ │ │ │ │ -Dune::GridGlue::Extractor::CoordinateInfo::index │ │ │ │ │ -unsigned int index │ │ │ │ │ -the index of this coordinate (in internal storage scheme) // NEEDED?? │ │ │ │ │ -Definition: extractor.hh:113 │ │ │ │ │ -Dune::GridGlue::Extractor::CoordinateInfo::CoordinateInfo │ │ │ │ │ -CoordinateInfo() │ │ │ │ │ -Definition: extractor.hh:99 │ │ │ │ │ -Dune::GridGlue::Extractor::CoordinateInfo::coord │ │ │ │ │ -Coords coord │ │ │ │ │ -the coordinate │ │ │ │ │ -Definition: extractor.hh:110 │ │ │ │ │ -Dune::GridGlue::Extractor::CoordinateInfo::vtxindex │ │ │ │ │ -IndexType vtxindex │ │ │ │ │ -the index of the parent element (from index set) │ │ │ │ │ -Definition: extractor.hh:107 │ │ │ │ │ -Dune::GridGlue::Extractor::VertexInfo │ │ │ │ │ -simple struct holding a vertex pointer and an index │ │ │ │ │ -Definition: extractor.hh:120 │ │ │ │ │ -Dune::GridGlue::Extractor::VertexInfo::idx │ │ │ │ │ -unsigned int idx │ │ │ │ │ -Definition: extractor.hh:123 │ │ │ │ │ -Dune::GridGlue::Extractor::VertexInfo::VertexInfo │ │ │ │ │ -VertexInfo(unsigned int idx_, const Vertex &p_) │ │ │ │ │ -Definition: extractor.hh:121 │ │ │ │ │ -Dune::GridGlue::Extractor::VertexInfo::p │ │ │ │ │ -VertexSeed p │ │ │ │ │ -Definition: extractor.hh:124 │ │ │ │ │ -Dune::GridGlue::Extractor::ElementInfo │ │ │ │ │ -simple struct holding an element seed and an index │ │ │ │ │ -Definition: extractor.hh:132 │ │ │ │ │ -Dune::GridGlue::Extractor::ElementInfo::idx │ │ │ │ │ -unsigned int idx │ │ │ │ │ -the index of this element's first face in the internal list of extracted faces │ │ │ │ │ -Definition: extractor.hh:137 │ │ │ │ │ -Dune::GridGlue::Extractor::ElementInfo::faces │ │ │ │ │ -unsigned int faces │ │ │ │ │ -the number of extracted faces for this element │ │ │ │ │ -Definition: extractor.hh:140 │ │ │ │ │ -Dune::GridGlue::Extractor::ElementInfo::ElementInfo │ │ │ │ │ -ElementInfo(unsigned int idx_, const Element &p_, unsigned int f_) │ │ │ │ │ -Definition: extractor.hh:133 │ │ │ │ │ -Dune::GridGlue::Extractor::ElementInfo::p │ │ │ │ │ -ElementSeed p │ │ │ │ │ -the entity seed for the element │ │ │ │ │ -Definition: extractor.hh:143 │ │ │ │ │ -Dune::GridGlue::Extractor::SubEntityInfo │ │ │ │ │ -Holds some information about an element's subentity involved in a coupling. │ │ │ │ │ -Definition: extractor.hh:151 │ │ │ │ │ -Dune::GridGlue::Extractor::SubEntityInfo::nCorners │ │ │ │ │ -unsigned int nCorners() const │ │ │ │ │ -Definition: extractor.hh:171 │ │ │ │ │ -Dune::GridGlue::Extractor::SubEntityInfo::corners │ │ │ │ │ -CornerInfo corners[cube_corners] │ │ │ │ │ -the corner indices plus the numbers of the vertices in the parent element │ │ │ │ │ -Definition: extractor.hh:191 │ │ │ │ │ -Dune::GridGlue::Extractor::SubEntityInfo::parent │ │ │ │ │ -IndexType parent │ │ │ │ │ -the index of the parent element (from index set) │ │ │ │ │ -Definition: extractor.hh:177 │ │ │ │ │ -Dune::GridGlue::Extractor::SubEntityInfo::SubEntityInfo │ │ │ │ │ -SubEntityInfo(IndexType parent_, unsigned int num_in_parent_, const Dune:: │ │ │ │ │ -GeometryType &geometryType) │ │ │ │ │ -Definition: extractor.hh:166 │ │ │ │ │ -Dune::GridGlue::Extractor::SubEntityInfo::num_in_parent │ │ │ │ │ -unsigned int num_in_parent │ │ │ │ │ -the number of the face in the parent element │ │ │ │ │ -Definition: extractor.hh:180 │ │ │ │ │ -Dune::GridGlue::Extractor::SubEntityInfo::geometryType_ │ │ │ │ │ -Dune::GeometryType geometryType_ │ │ │ │ │ -The GeometryType of the subentity. │ │ │ │ │ -Definition: extractor.hh:183 │ │ │ │ │ -Dune::GridGlue::Extractor::SubEntityInfo::SubEntityInfo │ │ │ │ │ -SubEntityInfo() │ │ │ │ │ -Definition: extractor.hh:152 │ │ │ │ │ +Dune::GridGlue::VtkSurfaceWriter │ │ │ │ │ +Definition: vtksurfacewriter.hh:35 │ │ │ │ │ +Dune::GridGlue::VtkSurfaceWriter::writeCellData │ │ │ │ │ +void writeCellData(const std::vector< T > &data, const char *dataname, int dim, │ │ │ │ │ +std::ofstream &fos) │ │ │ │ │ +Definition: vtksurfacewriter.hh:176 │ │ │ │ │ +Dune::GridGlue::VtkSurfaceWriter::writePointData │ │ │ │ │ +void writePointData(const std::vector< T > &data, const char *dataname, int │ │ │ │ │ +dim, std::ofstream &fos) │ │ │ │ │ +Definition: vtksurfacewriter.hh:190 │ │ │ │ │ +Dune::GridGlue::VtkSurfaceWriter::writeSurfaceVertexData │ │ │ │ │ +void writeSurfaceVertexData(const std::vector< K > &coords, const std::vector< │ │ │ │ │ +unsigned int > &indices, int corners, const std::vector< T > &data, const char │ │ │ │ │ +*dataname, int dim) │ │ │ │ │ +Definition: vtksurfacewriter.hh:94 │ │ │ │ │ +Dune::GridGlue::VtkSurfaceWriter::setFilename │ │ │ │ │ +void setFilename(const char *name) │ │ │ │ │ +Definition: vtksurfacewriter.hh:45 │ │ │ │ │ +Dune::GridGlue::VtkSurfaceWriter::writeSurfaceElementData │ │ │ │ │ +void writeSurfaceElementData(const std::vector< K > &coords, const std::vector< │ │ │ │ │ +unsigned int > &indices, int corners, const std::vector< T > &data, const char │ │ │ │ │ +*dataname, int dim) │ │ │ │ │ +Definition: vtksurfacewriter.hh:73 │ │ │ │ │ +Dune::GridGlue::VtkSurfaceWriter::~VtkSurfaceWriter │ │ │ │ │ +~VtkSurfaceWriter() │ │ │ │ │ +Definition: vtksurfacewriter.hh:42 │ │ │ │ │ +Dune::GridGlue::VtkSurfaceWriter::VtkSurfaceWriter │ │ │ │ │ +VtkSurfaceWriter(const char *filename) │ │ │ │ │ +Definition: vtksurfacewriter.hh:39 │ │ │ │ │ +Dune::GridGlue::VtkSurfaceWriter::writeSurface │ │ │ │ │ +void writeSurface(const std::vector< K > &coords, const std::vector< unsigned │ │ │ │ │ +int > &indices, int corners, int dim) │ │ │ │ │ +Definition: vtksurfacewriter.hh:53 │ │ │ │ │ +Dune::GridGlue::VtkSurfaceWriter::writePoints │ │ │ │ │ +void writePoints(const std::vector< K > &coords, int dim, std::ofstream &fos) │ │ │ │ │ +Definition: vtksurfacewriter.hh:116 │ │ │ │ │ +Dune::GridGlue::VtkSurfaceWriter::writePolygons │ │ │ │ │ +void writePolygons(const std::vector< unsigned int > &indices, const int │ │ │ │ │ +*corners, int ncorners, int dim, std::ofstream &fos) │ │ │ │ │ +Definition: vtksurfacewriter.hh:129 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00056.html │ │ │ │ @@ -75,15 +75,15 @@ │ │ │ │ │ │ │ │

Mesh grid extractor base class. │ │ │ │ More...

│ │ │ │
#include <deque>
│ │ │ │ #include <functional>
│ │ │ │ #include <dune/common/deprecated.hh>
│ │ │ │ #include <dune/grid/common/mcmgmapper.hh>
│ │ │ │ -#include "extractor.hh"
│ │ │ │ +#include "extractor.hh"
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00056_source.html │ │ │ │ @@ -88,15 +88,15 @@ │ │ │ │
22
│ │ │ │
23#include <deque>
│ │ │ │
24#include <functional>
│ │ │ │
25
│ │ │ │
26#include <dune/common/deprecated.hh>
│ │ │ │
27#include <dune/grid/common/mcmgmapper.hh>
│ │ │ │
28
│ │ │ │ -
29#include "extractor.hh"
│ │ │ │ +
29#include "extractor.hh"
│ │ │ │
30
│ │ │ │
31namespace Dune {
│ │ │ │
32
│ │ │ │
33 namespace GridGlue {
│ │ │ │
34
│ │ │ │
38template<typename GV>
│ │ │ │
39class Codim0Extractor : public Extractor<GV,0>
│ │ │ │ @@ -292,15 +292,15 @@ │ │ │ │
234}
│ │ │ │
235
│ │ │ │
236} // namespace GridGlue
│ │ │ │
237
│ │ │ │
238} // namespace Dune
│ │ │ │
239
│ │ │ │
240#endif // DUNE_GRIDGLUE_EXTRACTORS_CODIM0EXTRACTOR_HH
│ │ │ │ -
extractor base class
│ │ │ │ +
extractor base class
│ │ │ │
Definition: gridglue.hh:37
│ │ │ │
Definition: codim0extractor.hh:40
│ │ │ │
bool & positiveNormalDirection()
Definition: codim0extractor.hh:75
│ │ │ │
Extractor< GV, 0 >::IndexType IndexType
Definition: codim0extractor.hh:49
│ │ │ │
const bool & positiveNormalDirection() const
Definition: codim0extractor.hh:76
│ │ │ │
GV::Traits::template Codim< dim >::Entity Vertex
Definition: codim0extractor.hh:51
│ │ │ │
Extractor< GV, 0 >::CoordinateInfo CoordinateInfo
Definition: codim0extractor.hh:59
│ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00059.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: vtksurfacewriter.hh File Reference │ │ │ │ +dune-grid-glue: extractor.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,42 +65,62 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
vtksurfacewriter.hh File Reference
│ │ │ │ +
extractor.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │ -

helper class for graphical output of grids in generic representation │ │ │ │ +

extractor base class │ │ │ │ More...

│ │ │ │ -
#include <fstream>
│ │ │ │ -#include <iomanip>
│ │ │ │ -#include <vector>
│ │ │ │ -#include <cstring>
│ │ │ │ -#include "../adapter/gridgluevtkwriter.hh"
│ │ │ │ +
#include <vector>
│ │ │ │ +#include <map>
│ │ │ │ +#include <algorithm>
│ │ │ │ +#include <dune/common/exceptions.hh>
│ │ │ │ +#include <dune/common/fvector.hh>
│ │ │ │ +#include <dune/common/version.hh>
│ │ │ │ +#include <dune/grid/common/geometry.hh>
│ │ │ │ +#include <dune/grid/common/grid.hh>
│ │ │ │ +#include <dune/grid/common/mcmgmapper.hh>
│ │ │ │ +#include <dune/geometry/multilineargeometry.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │

│ │ │ │ Classes

class  Dune::GridGlue::Codim0Extractor< GV >
 
│ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Classes

class  Dune::GridGlue::VtkSurfaceWriter
class  Dune::GridGlue::Extractor< GV, cd >
 Provides codimension-independent methods for grid extraction. More...
 
struct  Dune::GridGlue::Extractor< GV, cd >::CornerInfo
 Helpful struct holding one index for the coordinate (vertex) to which it is associated and the element's corner index;. More...
 
struct  Dune::GridGlue::Extractor< GV, cd >::CoordinateInfo
 
struct  Dune::GridGlue::Extractor< GV, cd >::VertexInfo
 simple struct holding a vertex pointer and an index More...
 
struct  Dune::GridGlue::Extractor< GV, cd >::ElementInfo
 simple struct holding an element seed and an index More...
 
struct  Dune::GridGlue::Extractor< GV, cd >::SubEntityInfo
 Holds some information about an element's subentity involved in a coupling. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
│ │ │ │

Detailed Description

│ │ │ │ -

helper class for graphical output of grids in generic representation

│ │ │ │ +

extractor base class

│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -6,28 +6,50 @@ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * extractors │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -vtksurfacewriter.hh File Reference │ │ │ │ │ -helper class for graphical output of grids in generic representation More... │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +extractor.hh File Reference │ │ │ │ │ +extractor base class More... │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include "../adapter/gridgluevtkwriter.hh" │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  Dune::GridGlue::VtkSurfaceWriter │ │ │ │ │ + class  Dune::GridGlue::Extractor<_GV,_cd_> │ │ │ │ │ +  Provides codimension-independent methods for grid extraction. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::GridGlue::Extractor<_GV,_cd_>::CornerInfo │ │ │ │ │ +  Helpful struct holding one index for the coordinate (vertex) to which │ │ │ │ │ + it is associated and the element's corner index;. More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::GridGlue::Extractor<_GV,_cd_>::CoordinateInfo │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::GridGlue::Extractor<_GV,_cd_>::VertexInfo │ │ │ │ │ +  simple struct holding a vertex pointer and an index More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::GridGlue::Extractor<_GV,_cd_>::ElementInfo │ │ │ │ │ +  simple struct holding an element seed and an index More... │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::GridGlue::Extractor<_GV,_cd_>::SubEntityInfo │ │ │ │ │ +  Holds some information about an element's subentity involved in a │ │ │ │ │ + coupling. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::GridGlue │ │ │ │ │   │ │ │ │ │ ***** Detailed Description ***** │ │ │ │ │ -helper class for graphical output of grids in generic representation │ │ │ │ │ +extractor base class │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00059_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: vtksurfacewriter.hh Source File │ │ │ │ +dune-grid-glue: extractor.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,236 +62,432 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
vtksurfacewriter.hh
│ │ │ │ +
extractor.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 © DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
4// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
│ │ │ │
5/*
│ │ │ │ -
6 * Filename: VtkSurfaceWriter.hh
│ │ │ │ +
6 * Filename: extractor.hh
│ │ │ │
7 * Version: 1.0
│ │ │ │ -
8 * Created on: Jan 16, 2009
│ │ │ │ -
9 * Author: Gerrit Buse
│ │ │ │ +
8 * Created on: Oct 05, 2009
│ │ │ │ +
9 * Author: Christian Engwer
│ │ │ │
10 * ---------------------------------
│ │ │ │
11 * Project: dune-grid-glue
│ │ │ │ -
12 * Description: helper class for graphical output of grids in generic representation
│ │ │ │ +
12 * Description: base class for all grid extractors
│ │ │ │
13 *
│ │ │ │
14 */
│ │ │ │ -
20#ifndef DUNE_GRIDGLUE_EXTRACTORS_VTKSURFACEWRITER_HH
│ │ │ │ -
21#define DUNE_GRIDGLUE_EXTRACTORS_VTKSURFACEWRITER_HH
│ │ │ │ +
20#ifndef DUNE_GRIDGLUE_EXTRACTORS_EXTRACTOR_HH
│ │ │ │ +
21#define DUNE_GRIDGLUE_EXTRACTORS_EXTRACTOR_HH
│ │ │ │
22
│ │ │ │ -
23#include <fstream>
│ │ │ │ -
24#include <iomanip>
│ │ │ │ -
25#include <vector>
│ │ │ │ -
26#include <cstring>
│ │ │ │ -
27
│ │ │ │ -
28#include "../adapter/gridgluevtkwriter.hh"
│ │ │ │ -
29
│ │ │ │ -
30namespace Dune {
│ │ │ │ -
31
│ │ │ │ -
32 namespace GridGlue {
│ │ │ │ +
23#include <vector>
│ │ │ │ +
24#include <map>
│ │ │ │ +
25#include <algorithm>
│ │ │ │ +
26#include <dune/common/exceptions.hh>
│ │ │ │ +
27#include <dune/common/fvector.hh>
│ │ │ │ +
28#include <dune/common/version.hh>
│ │ │ │ +
29#include <dune/grid/common/geometry.hh>
│ │ │ │ +
30#include <dune/grid/common/grid.hh>
│ │ │ │ +
31#include <dune/grid/common/mcmgmapper.hh>
│ │ │ │ +
32#include <dune/geometry/multilineargeometry.hh>
│ │ │ │
33
│ │ │ │ - │ │ │ │ -
35{
│ │ │ │ -
36public:
│ │ │ │ +
34namespace Dune {
│ │ │ │ +
35
│ │ │ │ +
36 namespace GridGlue {
│ │ │ │
37
│ │ │ │ -
38
│ │ │ │ -
39 VtkSurfaceWriter(const char* filename) : filename_(filename)
│ │ │ │ -
40 {}
│ │ │ │ -
41
│ │ │ │ - │ │ │ │ -
43 {}
│ │ │ │ -
44
│ │ │ │ -
45 void setFilename(const char* name)
│ │ │ │ -
46 {
│ │ │ │ -
47 if (std::strlen(name) > 0)
│ │ │ │ -
48 this->filename_ = name;
│ │ │ │ -
49 }
│ │ │ │ -
50
│ │ │ │ -
51
│ │ │ │ -
52 template<typename K>
│ │ │ │ -
53 void writeSurface(const std::vector<K>& coords, const std::vector<unsigned int>& indices, int corners, int dim)
│ │ │ │ -
54 {
│ │ │ │ -
55 std::ofstream fos;
│ │ │ │ -
56 char buffer[64];
│ │ │ │ -
57 sprintf(buffer, "%s.vtk", this->filename_);
│ │ │ │ -
58 fos.open(buffer);
│ │ │ │ -
59 fos << std::setprecision(8) << std::setw(1);
│ │ │ │ -
60 // write preamble
│ │ │ │ -
61 fos << "# vtk DataFile Version 2.0\nFilename: " << buffer << "\nASCII" << std::endl;
│ │ │ │ -
62 this->writePoints(coords, dim, fos);
│ │ │ │ -
63 const int polycount = indices.size()/corners;
│ │ │ │ -
64 int corner_count[polycount];
│ │ │ │ -
65 for (int i = 0; i < polycount; ++i)
│ │ │ │ -
66 corner_count[i] = corners;
│ │ │ │ -
67 this->writePolygons(indices, corner_count, polycount, dim, fos);
│ │ │ │ -
68 fos.close();
│ │ │ │ -
69 }
│ │ │ │ +
44template<typename GV, int cd>
│ │ │ │ + │ │ │ │ +
46{
│ │ │ │ +
47
│ │ │ │ +
48public:
│ │ │ │ +
49
│ │ │ │ +
50 static constexpr auto dimworld = GV::dimensionworld;
│ │ │ │ +
51 static constexpr auto dim = GV::dimension;
│ │ │ │ +
52 static constexpr auto codim = cd;
│ │ │ │ +
53
│ │ │ │ +
54 static constexpr int cube_corners = 1 << (dim-codim);
│ │ │ │ +
55
│ │ │ │ +
56 typedef GV GridView;
│ │ │ │ +
57 typedef typename GridView::Grid Grid;
│ │ │ │ +
58
│ │ │ │ +
59 typedef typename GV::Grid::ctype ctype;
│ │ │ │ +
60 typedef Dune::FieldVector<ctype, dimworld> Coords;
│ │ │ │ +
61 typedef Dune::FieldVector<ctype, dim> LocalCoords;
│ │ │ │ +
62
│ │ │ │ +
63 typedef typename GV::Traits::template Codim<dim>::Entity Vertex;
│ │ │ │ +
64 typedef typename Vertex::EntitySeed VertexSeed;
│ │ │ │ +
65
│ │ │ │ +
66 typedef typename GV::Traits::template Codim<0>::Entity Element;
│ │ │ │ +
67 typedef typename Element::EntitySeed ElementSeed;
│ │ │ │ +
68
│ │ │ │ +
69 typedef std::vector<unsigned int> VertexVector;
│ │ │ │
70
│ │ │ │ -
71
│ │ │ │ -
72 template<typename K, typename T>
│ │ │ │ -
73 void writeSurfaceElementData(const std::vector<K>& coords, const std::vector<unsigned int>& indices, int corners, const std::vector<T>& data, const char* dataname, int dim)
│ │ │ │ -
74 {
│ │ │ │ -
75 std::ofstream fos;
│ │ │ │ -
76 char buffer[64];
│ │ │ │ -
77 sprintf(buffer, "%s.vtk", this->filename_);
│ │ │ │ -
78 fos.open(buffer);
│ │ │ │ -
79 fos << std::setprecision(8) << std::setw(1);
│ │ │ │ -
80 // write preamble
│ │ │ │ -
81 fos << "# vtk DataFile Version 2.0\nFilename: " << buffer << "\nASCII" << std::endl;
│ │ │ │ -
82 this->writePoints(coords, dim, fos);
│ │ │ │ -
83 const int polycount = indices.size()/corners;
│ │ │ │ -
84 int corner_count[polycount];
│ │ │ │ -
85 for (int i = 0; i < polycount; ++i)
│ │ │ │ -
86 corner_count[i] = corners;
│ │ │ │ -
87 this->writePolygons(indices, corner_count, polycount, dim, fos);
│ │ │ │ -
88 this->writeCellData(data, dataname, dim, fos);
│ │ │ │ -
89 fos.close();
│ │ │ │ -
90 }
│ │ │ │ -
91
│ │ │ │ -
92
│ │ │ │ -
93 template<typename K, typename T>
│ │ │ │ -
94 void writeSurfaceVertexData(const std::vector<K>& coords, const std::vector<unsigned int>& indices, int corners, const std::vector<T>& data, const char* dataname, int dim)
│ │ │ │ -
95 {
│ │ │ │ -
96 std::ofstream fos;
│ │ │ │ -
97 char buffer[64];
│ │ │ │ -
98 sprintf(buffer, "%s.vtk", this->filename_);
│ │ │ │ -
99 fos.open(buffer);
│ │ │ │ -
100 fos << std::setprecision(8) << std::setw(1);
│ │ │ │ -
101 // write preamble
│ │ │ │ -
102 fos << "# vtk DataFile Version 2.0\nFilename: " << buffer << "\nASCII" << std::endl;
│ │ │ │ -
103 this->writePoints(coords, dim, fos);
│ │ │ │ -
104 const int polycount = indices.size()/corners;
│ │ │ │ -
105 int corner_count[polycount];
│ │ │ │ -
106 for (int i = 0; i < polycount; ++i)
│ │ │ │ -
107 corner_count[i] = corners;
│ │ │ │ -
108 this->writePolygons(indices, corner_count, polycount, dim, fos);
│ │ │ │ -
109 this->writePointData(data, dataname, dim, fos);
│ │ │ │ -
110 fos.close();
│ │ │ │ -
111 }
│ │ │ │ -
112
│ │ │ │ -
113protected:
│ │ │ │ -
114
│ │ │ │ -
115 template<typename K>
│ │ │ │ -
116 void writePoints(const std::vector<K>& coords, int dim, std::ofstream& fos)
│ │ │ │ -
117 {
│ │ │ │ -
118 fos << "DATASET POLYDATA\nPOINTS " << coords.size() << " " << TypeNames[Nametraits<K>::nameidx] << std::endl;
│ │ │ │ -
119 for (unsigned int i = 0; i < coords.size(); ++i)
│ │ │ │ -
120 {
│ │ │ │ -
121 fos << coords[i][0];
│ │ │ │ -
122 if (dim == 2)
│ │ │ │ -
123 fos << " " << coords[i][1] << " 0 \n" << coords[i][0] << " " << coords[i][1] << " 0.01" << std::endl;
│ │ │ │ -
124 else // dim == 3
│ │ │ │ -
125 fos << " " << coords[i][1] << " " << coords[i][2] << std::endl;
│ │ │ │ -
126 }
│ │ │ │ -
127 }
│ │ │ │ -
128
│ │ │ │ -
129 void writePolygons(const std::vector<unsigned int>& indices, const int* corners, int ncorners, int dim, std::ofstream& fos)
│ │ │ │ -
130 {
│ │ │ │ -
131 if (dim == 2)
│ │ │ │ -
132 {
│ │ │ │ -
133 fos << "POLYGONS " << indices.size()/2 << " " << 5*(indices.size() / 2) << std::endl;
│ │ │ │ -
134 for (unsigned int i = 0; i < indices.size(); i += 2)
│ │ │ │ -
135 fos << "4 " << 2*indices[i] << " " << 2*indices[i+1] << " " << 2*indices[i+1]+1 << " "<< 2*indices[i]+1 << std::endl;
│ │ │ │ -
136
│ │ │ │ -
137 // arbitrary shapes - ignored here!
│ │ │ │ -
138 // int sum = ncorners;
│ │ │ │ -
139 // for (int i = 0; i < ncorners; ++i)
│ │ │ │ -
140 // sum += (corners[i] > 2 ? corners[i] : 3);
│ │ │ │ -
141 //
│ │ │ │ -
142 // fos << "POLYGONS " << ncorners << " " << sum << std::endl;
│ │ │ │ -
143 // int index = 0;
│ │ │ │ -
144 // for (int i = 0; i < ncorners; ++i)
│ │ │ │ -
145 // {
│ │ │ │ -
146 // // write the first index twice if it is an egde
│ │ │ │ -
147 // // => triangle instead of edge - paraview can display it then
│ │ │ │ -
148 // if (corners[i] > 2)
│ │ │ │ -
149 // fos << corners[i];
│ │ │ │ -
150 // else
│ │ │ │ -
151 // fos << "3 " << indices[index];
│ │ │ │ -
152 //
│ │ │ │ -
153 // for (int j = 0; j < corners[i]; ++j)
│ │ │ │ -
154 // fos << " " << indices[index++];
│ │ │ │ -
155 // fos << std::endl;
│ │ │ │ -
156 // }
│ │ │ │ -
157 }
│ │ │ │ -
158 else
│ │ │ │ -
159 {
│ │ │ │ -
160 int sum = ncorners;
│ │ │ │ -
161 for (int i = 0; i < ncorners; ++i)
│ │ │ │ -
162 sum += corners[i];
│ │ │ │ -
163 fos << "POLYGONS " << ncorners << " " << sum << std::endl;
│ │ │ │ -
164 int index = 0;
│ │ │ │ -
165 for (int i = 0; i < ncorners; ++i)
│ │ │ │ -
166 {
│ │ │ │ -
167 fos << corners[i];
│ │ │ │ -
168 for (int j = 0; j < corners[i]; ++j)
│ │ │ │ -
169 fos << " " << indices[index++];
│ │ │ │ -
170 fos << std::endl;
│ │ │ │ -
171 }
│ │ │ │ -
172 }
│ │ │ │ -
173 }
│ │ │ │ -
174
│ │ │ │ -
175 template<typename T>
│ │ │ │ -
176 void writeCellData(const std::vector<T>& data, const char* dataname, int dim, std::ofstream& fos)
│ │ │ │ -
177 {
│ │ │ │ -
178 fos << "CELL_DATA " << data.size()*(dim == 2 ? 2 : 1) << std::endl;
│ │ │ │ -
179 fos << "SCALARS " << dataname << " " << TypeNames[Nametraits<T>::nameidx] << " 1" << std::endl;
│ │ │ │ -
180 fos << "LOOKUP_TABLE default" << std::endl;
│ │ │ │ -
181 for (unsigned int i = 0; i < data.size(); ++i)
│ │ │ │ -
182 {
│ │ │ │ -
183 fos << data[i] << std::endl;
│ │ │ │ -
184 if (dim == 2)
│ │ │ │ -
185 fos << data[i] << std::endl;
│ │ │ │ -
186 }
│ │ │ │ -
187 }
│ │ │ │ -
188
│ │ │ │ -
189 template<typename T>
│ │ │ │ -
190 void writePointData(const std::vector<T>& data, const char* dataname, int dim, std::ofstream& fos)
│ │ │ │ -
191 {
│ │ │ │ -
192 fos << "POINT_DATA " << data.size()*(dim == 2 ? 2 : 1) << std::endl;
│ │ │ │ -
193 fos << "SCALARS " << dataname << " " << TypeNames[Nametraits<T>::nameidx] << " 1" << std::endl;
│ │ │ │ -
194 fos << "LOOKUP_TABLE default" << std::endl;
│ │ │ │ -
195 for (unsigned int i = 0; i < data.size(); ++i)
│ │ │ │ -
196 {
│ │ │ │ -
197 fos << data[i] << std::endl;
│ │ │ │ -
198 if (dim == 2)
│ │ │ │ -
199 fos << data[i] << std::endl;
│ │ │ │ -
200 }
│ │ │ │ -
201 }
│ │ │ │ +
71#if DUNE_VERSION_NEWER(DUNE_GRID, 2, 6)
│ │ │ │ +
72 using CellMapper = MultipleCodimMultipleGeomTypeMapper<GridView>;
│ │ │ │ +
73#else
│ │ │ │ +
74 using CellMapper = MultipleCodimMultipleGeomTypeMapper<GridView, MCMGElementLayout>;
│ │ │ │ +
75#endif
│ │ │ │ +
76 // typedef typename CellMapper::IndexType IndexType;
│ │ │ │ +
77 typedef int IndexType;
│ │ │ │ +
78public:
│ │ │ │ +
79
│ │ │ │ +
80 // transformations
│ │ │ │ +
81 typedef Dune::MultiLinearGeometry<ctype, dim-codim, dimworld> Geometry;
│ │ │ │ +
82 typedef Dune::MultiLinearGeometry<ctype, dim-codim, dim> LocalGeometry;
│ │ │ │ +
83
│ │ │ │ +
84protected:
│ │ │ │ +
85 /************************** PRIVATE SUBCLASSES **********************/
│ │ │ │ +
86
│ │ │ │ + │ │ │ │ +
92 {
│ │ │ │ +
93 unsigned int idx : 28;
│ │ │ │ +
94 unsigned int num : 4;
│ │ │ │ +
95 };
│ │ │ │ +
96
│ │ │ │ + │ │ │ │ +
98 {
│ │ │ │ + │ │ │ │ +
100 {}
│ │ │ │ +
101
│ │ │ │ +
102 CoordinateInfo(unsigned int index_, IndexType vtxindex_)
│ │ │ │ +
103 : vtxindex(vtxindex_), index(index_)
│ │ │ │ +
104 {}
│ │ │ │ +
105
│ │ │ │ + │ │ │ │ +
108
│ │ │ │ + │ │ │ │ +
111
│ │ │ │ +
113 unsigned int index;
│ │ │ │ +
114 };
│ │ │ │ +
115
│ │ │ │ + │ │ │ │ +
120 {
│ │ │ │ +
121 VertexInfo(unsigned int idx_, const Vertex& p_) : idx(idx_), p(p_.seed())
│ │ │ │ +
122 {}
│ │ │ │ +
123 unsigned int idx;
│ │ │ │ + │ │ │ │ +
125 };
│ │ │ │ +
126
│ │ │ │ +
127
│ │ │ │ + │ │ │ │ +
132 {
│ │ │ │ +
133 ElementInfo(unsigned int idx_, const Element& p_, unsigned int f_) : idx(idx_), faces(f_), p(p_.seed())
│ │ │ │ +
134 {}
│ │ │ │ +
135
│ │ │ │ +
137 unsigned int idx : 28;
│ │ │ │ +
138
│ │ │ │ +
140 unsigned int faces : 4;
│ │ │ │ +
141
│ │ │ │ + │ │ │ │ +
144 };
│ │ │ │ +
145
│ │ │ │ +
146
│ │ │ │ + │ │ │ │ +
151 {
│ │ │ │ + │ │ │ │ +
153 /*
│ │ │ │ +
154 * TODO: move default value of `geometryType_` to member declaration
│ │ │ │ +
155 * when removing support for older dune-geometry
│ │ │ │ +
156 */
│ │ │ │ +
157#if DUNE_VERSION_NEWER(DUNE_GEOMETRY, 2, 6)
│ │ │ │ +
158 : geometryType_(GeometryTypes::simplex(dim-codim))
│ │ │ │ +
159 {}
│ │ │ │ +
160#else
│ │ │ │ +
161 {
│ │ │ │ +
162 geometryType_.makeSimplex(dim-codim);
│ │ │ │ +
163 }
│ │ │ │ +
164#endif
│ │ │ │ +
165
│ │ │ │ +
166 SubEntityInfo(IndexType parent_, unsigned int num_in_parent_,
│ │ │ │ +
167 const Dune::GeometryType& geometryType)
│ │ │ │ +
168 : parent(parent_), num_in_parent(num_in_parent_), geometryType_(geometryType)
│ │ │ │ +
169 {}
│ │ │ │ +
170
│ │ │ │ +
171 unsigned int nCorners() const
│ │ │ │ +
172 {
│ │ │ │ +
173 return Dune::ReferenceElements<ctype, dim-codim>::general(geometryType_).size(dim-codim);
│ │ │ │ +
174 }
│ │ │ │ +
175
│ │ │ │ + │ │ │ │ +
178
│ │ │ │ +
180 unsigned int num_in_parent : 3;
│ │ │ │ +
181
│ │ │ │ +
183 Dune::GeometryType geometryType_;
│ │ │ │ +
184
│ │ │ │ +
191 CornerInfo corners[cube_corners]; // sim = numer of vertices in a simplex
│ │ │ │ +
192 };
│ │ │ │ +
193
│ │ │ │ +
194
│ │ │ │ +
195 typedef std::map<IndexType, ElementInfo> ElementInfoMap;
│ │ │ │ +
196 typedef std::map<IndexType, VertexInfo> VertexInfoMap;
│ │ │ │ +
197
│ │ │ │ +
198 /************************** MEMBER VARIABLES ************************/
│ │ │ │ +
199
│ │ │ │ + │ │ │ │
202
│ │ │ │ -
203
│ │ │ │ -
204private:
│ │ │ │ -
205 const char* filename_;
│ │ │ │ -
206};
│ │ │ │ +
203 /* Geometrical and Topological Information */
│ │ │ │ +
204
│ │ │ │ +
206 std::vector<CoordinateInfo> coords_;
│ │ │ │
207
│ │ │ │ -
208} // namespace GridGlue
│ │ │ │ -
209
│ │ │ │ -
210} // namespace Dune
│ │ │ │ -
211
│ │ │ │ -
212#endif // DUNE_GRIDGLUE_EXTRACTORS_VTKSURFACEWRITER_HH
│ │ │ │ +
209 std::vector<SubEntityInfo> subEntities_;
│ │ │ │ +
210
│ │ │ │ + │ │ │ │ +
217
│ │ │ │ + │ │ │ │ +
224
│ │ │ │ + │ │ │ │ +
226
│ │ │ │ +
227public:
│ │ │ │ +
228
│ │ │ │ +
229 /* C O N S T R U C T O R S A N D D E S T R U C T O R S */
│ │ │ │ +
230
│ │ │ │ +
235 Extractor(const GV& gv)
│ │ │ │ +
236 : gv_(gv)
│ │ │ │ +
237#if DUNE_VERSION_NEWER(DUNE_GRID, 2, 6)
│ │ │ │ +
238 , cellMapper_(gv, mcmgElementLayout())
│ │ │ │ +
239#else
│ │ │ │ +
240 , cellMapper_(gv)
│ │ │ │ +
241#endif
│ │ │ │ +
242 {}
│ │ │ │ +
243
│ │ │ │ +
244 /* F U N C T I O N A L I T Y */
│ │ │ │ +
245
│ │ │ │ +
249 void clear()
│ │ │ │ +
250 {
│ │ │ │ +
251 // this is an inofficial way on how to free the memory allocated
│ │ │ │ +
252 // by a std::vector
│ │ │ │ +
253 {
│ │ │ │ +
254 std::vector<CoordinateInfo> dummy;
│ │ │ │ +
255 coords_.swap(dummy);
│ │ │ │ +
256 }
│ │ │ │ +
257 {
│ │ │ │ +
258 std::vector<SubEntityInfo> dummy;
│ │ │ │ +
259 subEntities_.swap(dummy);
│ │ │ │ +
260 }
│ │ │ │ +
261
│ │ │ │ +
262 // ...then clear the maps themselves, too
│ │ │ │ +
263 vtxInfo_.clear();
│ │ │ │ +
264 elmtInfo_.clear();
│ │ │ │ +
265 }
│ │ │ │ +
266
│ │ │ │ +
267
│ │ │ │ +
268 /* G E T T E R S */
│ │ │ │ +
269
│ │ │ │ +
275 void getCoords(std::vector<Dune::FieldVector<ctype, dimworld> >& coords) const
│ │ │ │ +
276 {
│ │ │ │ +
277 coords.resize(coords_.size());
│ │ │ │ +
278 for (unsigned int i = 0; i < coords_.size(); ++i)
│ │ │ │ +
279 coords[i] = coords_[i].coord;
│ │ │ │ +
280 }
│ │ │ │ +
281
│ │ │ │ +
282
│ │ │ │ +
287 unsigned int nCoords() const
│ │ │ │ +
288 {
│ │ │ │ +
289 return coords_.size();
│ │ │ │ +
290 }
│ │ │ │ +
291
│ │ │ │ +
293 void getGeometryTypes(std::vector<Dune::GeometryType>& geometryTypes) const
│ │ │ │ +
294 {
│ │ │ │ +
295 geometryTypes.resize(subEntities_.size());
│ │ │ │ +
296 for (size_t i=0; i<subEntities_.size(); i++)
│ │ │ │ +
297 geometryTypes[i] = subEntities_[i].geometryType_;
│ │ │ │ +
298 }
│ │ │ │ +
299
│ │ │ │ +
300
│ │ │ │ +
304 void getFaces(std::vector<VertexVector>& faces) const
│ │ │ │ +
305 {
│ │ │ │ +
306 faces.resize(subEntities_.size());
│ │ │ │ +
307 for (unsigned int i = 0; i < subEntities_.size(); ++i) {
│ │ │ │ +
308 faces[i].resize(subEntities_[i].nCorners());
│ │ │ │ +
309 for (unsigned int j = 0; j < subEntities_[i].nCorners(); ++j)
│ │ │ │ +
310 faces[i][j] = subEntities_[i].corners[j].idx;
│ │ │ │ +
311 }
│ │ │ │ +
312 }
│ │ │ │ +
313
│ │ │ │ +
314
│ │ │ │ +
323 bool faceIndices(const Element& e, int& first, int& count) const
│ │ │ │ +
324 {
│ │ │ │ +
325 typename ElementInfoMap::const_iterator it =
│ │ │ │ +
326 elmtInfo_.find(cellMapper_.map(e));
│ │ │ │ +
327 if (it == elmtInfo_.end())
│ │ │ │ +
328 {
│ │ │ │ +
329 first = -1;
│ │ │ │ +
330 count = 0;
│ │ │ │ +
331 return false;
│ │ │ │ +
332 }
│ │ │ │ +
333 // the iterator is valid, fill the out params
│ │ │ │ +
334 first = it->second.idx;
│ │ │ │ +
335 count = it->second.faces;
│ │ │ │ +
336 return true;
│ │ │ │ +
337 }
│ │ │ │ +
338
│ │ │ │ +
339
│ │ │ │ +
345 int indexInInside(unsigned int index) const
│ │ │ │ +
346 {
│ │ │ │ +
347 return index < subEntities_.size() ? subEntities_[index].num_in_parent : -1;
│ │ │ │ +
348 }
│ │ │ │ +
349
│ │ │ │ +
350 // /**
│ │ │ │ +
351 // * @brief tests that a given entry in the extraction set does have local couplings
│ │ │ │ +
352 // * @todo parallel interface
│ │ │ │ +
353 // */
│ │ │ │ +
354 // bool contains (unsigned int global, unsigned int & local) const
│ │ │ │ +
355 // {
│ │ │ │ +
356 // local = global;
│ │ │ │ +
357 // return true;
│ │ │ │ +
358 // }
│ │ │ │ +
359
│ │ │ │ +
363 const GridView & gridView() const
│ │ │ │ +
364 {
│ │ │ │ +
365 return gv_;
│ │ │ │ +
366 }
│ │ │ │ +
367
│ │ │ │ +
368 const Grid& grid() const
│ │ │ │ +
369 {
│ │ │ │ +
370 return gv_.grid();
│ │ │ │ +
371 }
│ │ │ │ +
372
│ │ │ │ +
379 Element
│ │ │ │ +
380 element(unsigned int index) const
│ │ │ │ +
381 {
│ │ │ │ +
382 if (index >= subEntities_.size())
│ │ │ │ +
383 DUNE_THROW(Dune::GridError, "invalid face index");
│ │ │ │ +
384 const ElementSeed seed = elmtInfo_.at(subEntities_[index].parent).p;
│ │ │ │ +
385 return grid().entity(seed);
│ │ │ │ +
386 }
│ │ │ │ +
387
│ │ │ │ +
388#if 1
│ │ │ │ +
395 Vertex
│ │ │ │ +
396 vertex(unsigned int index) const
│ │ │ │ +
397 {
│ │ │ │ +
398 if (index >= coords_.size())
│ │ │ │ +
399 DUNE_THROW(Dune::GridError, "invalid coordinate index");
│ │ │ │ +
400 const VertexSeed seed = vtxInfo_.at(coords_[index].vtxindex).p;
│ │ │ │ +
401 return grid().entity(seed);
│ │ │ │ +
402 }
│ │ │ │ +
403#endif
│ │ │ │ +
404
│ │ │ │ +
406 Geometry geometry(unsigned int index) const;
│ │ │ │ +
407
│ │ │ │ +
409 LocalGeometry geometryLocal(unsigned int index) const;
│ │ │ │ +
410
│ │ │ │ +
411};
│ │ │ │ +
412
│ │ │ │ +
413
│ │ │ │ +
415template<typename GV, int cd>
│ │ │ │ + │ │ │ │ +
417{
│ │ │ │ +
418 std::vector<Coords> corners(subEntities_[index].nCorners());
│ │ │ │ +
419 for (unsigned int i = 0; i < subEntities_[index].nCorners(); ++i)
│ │ │ │ +
420 corners[i] = coords_[subEntities_[index].corners[i].idx].coord;
│ │ │ │ +
421
│ │ │ │ +
422 return Geometry(subEntities_[index].geometryType_, corners);
│ │ │ │ +
423}
│ │ │ │ +
424
│ │ │ │ +
425
│ │ │ │ +
427template<typename GV, int cd>
│ │ │ │ + │ │ │ │ +
429{
│ │ │ │ +
430 std::vector<LocalCoords> corners(subEntities_[index].nCorners());
│ │ │ │ +
431
│ │ │ │ +
432 // get face info
│ │ │ │ +
433 const SubEntityInfo & face = subEntities_[index];
│ │ │ │ +
434 Dune::GeometryType facetype = subEntities_[index].geometryType_;
│ │ │ │ +
435
│ │ │ │ +
436 // get reference element
│ │ │ │ +
437 const auto elmtseed = elmtInfo_.at(face.parent).p;
│ │ │ │ +
438 const auto elmt = grid().entity(elmtseed);
│ │ │ │ +
439 const Dune::GeometryType celltype = elmt.type();
│ │ │ │ +
440 const auto& re = Dune::ReferenceElements<ctype, dim>::general(celltype);
│ │ │ │ +
441 for (unsigned int i = 0; i < subEntities_[index].nCorners(); ++i)
│ │ │ │ +
442 corners[i] = re.position(face.corners[i].num,dim);
│ │ │ │ +
443
│ │ │ │ +
444 return LocalGeometry(facetype, corners);
│ │ │ │ +
445}
│ │ │ │ +
446
│ │ │ │ +
447} // namespace GridGlue
│ │ │ │ +
448
│ │ │ │ +
449} // namespace Dune
│ │ │ │ +
450
│ │ │ │ +
451#endif // DUNE_GRIDGLUE_EXTRACTORS_EXTRACTOR_HH
│ │ │ │
Definition: gridglue.hh:37
│ │ │ │ -
Definition: vtksurfacewriter.hh:35
│ │ │ │ -
void writeCellData(const std::vector< T > &data, const char *dataname, int dim, std::ofstream &fos)
Definition: vtksurfacewriter.hh:176
│ │ │ │ -
void writePointData(const std::vector< T > &data, const char *dataname, int dim, std::ofstream &fos)
Definition: vtksurfacewriter.hh:190
│ │ │ │ -
void writeSurfaceVertexData(const std::vector< K > &coords, const std::vector< unsigned int > &indices, int corners, const std::vector< T > &data, const char *dataname, int dim)
Definition: vtksurfacewriter.hh:94
│ │ │ │ -
void setFilename(const char *name)
Definition: vtksurfacewriter.hh:45
│ │ │ │ -
void writeSurfaceElementData(const std::vector< K > &coords, const std::vector< unsigned int > &indices, int corners, const std::vector< T > &data, const char *dataname, int dim)
Definition: vtksurfacewriter.hh:73
│ │ │ │ -
~VtkSurfaceWriter()
Definition: vtksurfacewriter.hh:42
│ │ │ │ -
VtkSurfaceWriter(const char *filename)
Definition: vtksurfacewriter.hh:39
│ │ │ │ -
void writeSurface(const std::vector< K > &coords, const std::vector< unsigned int > &indices, int corners, int dim)
Definition: vtksurfacewriter.hh:53
│ │ │ │ -
void writePoints(const std::vector< K > &coords, int dim, std::ofstream &fos)
Definition: vtksurfacewriter.hh:116
│ │ │ │ -
void writePolygons(const std::vector< unsigned int > &indices, const int *corners, int ncorners, int dim, std::ofstream &fos)
Definition: vtksurfacewriter.hh:129
│ │ │ │ +
Provides codimension-independent methods for grid extraction.
Definition: extractor.hh:46
│ │ │ │ +
GV::Traits::template Codim< dim >::Entity Vertex
Definition: extractor.hh:63
│ │ │ │ +
VertexInfoMap vtxInfo_
a map enabling faster access to vertices and coordinates
Definition: extractor.hh:216
│ │ │ │ +
const Grid & grid() const
Definition: extractor.hh:368
│ │ │ │ +
MultipleCodimMultipleGeomTypeMapper< GridView, MCMGElementLayout > CellMapper
Definition: extractor.hh:74
│ │ │ │ +
Element element(unsigned int index) const
gets the parent element for a given face index, throws an exception if index not valid
Definition: extractor.hh:380
│ │ │ │ +
int indexInInside(unsigned int index) const
gets the number face in the parent element
Definition: extractor.hh:345
│ │ │ │ +
Dune::FieldVector< ctype, dim > LocalCoords
Definition: extractor.hh:61
│ │ │ │ +
LocalGeometry geometryLocal(unsigned int index) const
Get geometry of the extracted face in element coordinates.
Definition: extractor.hh:428
│ │ │ │ +
static constexpr auto dimworld
Definition: extractor.hh:50
│ │ │ │ +
Dune::MultiLinearGeometry< ctype, dim-codim, dimworld > Geometry
Definition: extractor.hh:81
│ │ │ │ +
int IndexType
Definition: extractor.hh:77
│ │ │ │ +
std::vector< CoordinateInfo > coords_
all information about the corner vertices of the extracted
Definition: extractor.hh:206
│ │ │ │ +
GV::Traits::template Codim< 0 >::Entity Element
Definition: extractor.hh:66
│ │ │ │ +
const GridView & gridView() const
give access to the Dune::GridView where this Patch belongs to
Definition: extractor.hh:363
│ │ │ │ +
void getFaces(std::vector< VertexVector > &faces) const
Get the corners of the extracted subentities.
Definition: extractor.hh:304
│ │ │ │ +
std::vector< unsigned int > VertexVector
Definition: extractor.hh:69
│ │ │ │ +
const GridView gv_
the grid object to extract the surface from
Definition: extractor.hh:201
│ │ │ │ +
std::vector< SubEntityInfo > subEntities_
all information about the extracted subEntities
Definition: extractor.hh:209
│ │ │ │ +
static constexpr int cube_corners
Definition: extractor.hh:54
│ │ │ │ +
Vertex vertex(unsigned int index) const
gets the vertex for a given coordinate index throws an exception if index not valid
Definition: extractor.hh:396
│ │ │ │ +
static constexpr auto codim
Definition: extractor.hh:52
│ │ │ │ +
Dune::FieldVector< ctype, dimworld > Coords
Definition: extractor.hh:60
│ │ │ │ +
void getGeometryTypes(std::vector< Dune::GeometryType > &geometryTypes) const
Get the list of geometry types.
Definition: extractor.hh:293
│ │ │ │ +
std::map< IndexType, VertexInfo > VertexInfoMap
Definition: extractor.hh:196
│ │ │ │ +
GridView::Grid Grid
Definition: extractor.hh:57
│ │ │ │ +
bool faceIndices(const Element &e, int &first, int &count) const
gets index of first subentity as well as the total number of subentities that were extracted from thi...
Definition: extractor.hh:323
│ │ │ │ +
Geometry geometry(unsigned int index) const
Get world geometry of the extracted face.
Definition: extractor.hh:416
│ │ │ │ +
GV GridView
Definition: extractor.hh:56
│ │ │ │ +
unsigned int nCoords() const
getter for the count of coordinates
Definition: extractor.hh:287
│ │ │ │ +
GV::Grid::ctype ctype
Definition: extractor.hh:59
│ │ │ │ +
std::map< IndexType, ElementInfo > ElementInfoMap
Definition: extractor.hh:195
│ │ │ │ +
Extractor(const GV &gv)
Constructor.
Definition: extractor.hh:235
│ │ │ │ +
void getCoords(std::vector< Dune::FieldVector< ctype, dimworld > > &coords) const
getter for the coordinates array
Definition: extractor.hh:275
│ │ │ │ +
CellMapper cellMapper_
Definition: extractor.hh:225
│ │ │ │ +
Element::EntitySeed ElementSeed
Definition: extractor.hh:67
│ │ │ │ +
Vertex::EntitySeed VertexSeed
Definition: extractor.hh:64
│ │ │ │ +
ElementInfoMap elmtInfo_
a map enabling faster access to elements and faces
Definition: extractor.hh:223
│ │ │ │ +
void clear()
delete everything build up so far and free the memory
Definition: extractor.hh:249
│ │ │ │ +
static constexpr auto dim
Definition: extractor.hh:51
│ │ │ │ +
Dune::MultiLinearGeometry< ctype, dim-codim, dim > LocalGeometry
Definition: extractor.hh:82
│ │ │ │ +
Helpful struct holding one index for the coordinate (vertex) to which it is associated and the elemen...
Definition: extractor.hh:92
│ │ │ │ +
unsigned int idx
index of the vertex
Definition: extractor.hh:93
│ │ │ │ +
unsigned int num
element corner
Definition: extractor.hh:94
│ │ │ │ + │ │ │ │ +
CoordinateInfo(unsigned int index_, IndexType vtxindex_)
Definition: extractor.hh:102
│ │ │ │ +
unsigned int index
the index of this coordinate (in internal storage scheme) // NEEDED??
Definition: extractor.hh:113
│ │ │ │ +
CoordinateInfo()
Definition: extractor.hh:99
│ │ │ │ +
Coords coord
the coordinate
Definition: extractor.hh:110
│ │ │ │ +
IndexType vtxindex
the index of the parent element (from index set)
Definition: extractor.hh:107
│ │ │ │ +
simple struct holding a vertex pointer and an index
Definition: extractor.hh:120
│ │ │ │ +
unsigned int idx
Definition: extractor.hh:123
│ │ │ │ +
VertexInfo(unsigned int idx_, const Vertex &p_)
Definition: extractor.hh:121
│ │ │ │ +
VertexSeed p
Definition: extractor.hh:124
│ │ │ │ +
simple struct holding an element seed and an index
Definition: extractor.hh:132
│ │ │ │ +
unsigned int idx
the index of this element's first face in the internal list of extracted faces
Definition: extractor.hh:137
│ │ │ │ +
unsigned int faces
the number of extracted faces for this element
Definition: extractor.hh:140
│ │ │ │ +
ElementInfo(unsigned int idx_, const Element &p_, unsigned int f_)
Definition: extractor.hh:133
│ │ │ │ +
ElementSeed p
the entity seed for the element
Definition: extractor.hh:143
│ │ │ │ +
Holds some information about an element's subentity involved in a coupling.
Definition: extractor.hh:151
│ │ │ │ +
unsigned int nCorners() const
Definition: extractor.hh:171
│ │ │ │ +
CornerInfo corners[cube_corners]
the corner indices plus the numbers of the vertices in the parent element
Definition: extractor.hh:191
│ │ │ │ +
IndexType parent
the index of the parent element (from index set)
Definition: extractor.hh:177
│ │ │ │ +
SubEntityInfo(IndexType parent_, unsigned int num_in_parent_, const Dune::GeometryType &geometryType)
Definition: extractor.hh:166
│ │ │ │ +
unsigned int num_in_parent
the number of the face in the parent element
Definition: extractor.hh:180
│ │ │ │ +
Dune::GeometryType geometryType_
The GeometryType of the subentity.
Definition: extractor.hh:183
│ │ │ │ +
SubEntityInfo()
Definition: extractor.hh:152
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,281 +5,608 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * extractors │ │ │ │ │ -vtksurfacewriter.hh │ │ │ │ │ +extractor.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 © DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 4// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only- │ │ │ │ │ with-dune-grid-glue-exception │ │ │ │ │ 5/* │ │ │ │ │ - 6 * Filename: VtkSurfaceWriter.hh │ │ │ │ │ + 6 * Filename: extractor.hh │ │ │ │ │ 7 * Version: 1.0 │ │ │ │ │ - 8 * Created on: Jan 16, 2009 │ │ │ │ │ - 9 * Author: Gerrit Buse │ │ │ │ │ + 8 * Created on: Oct 05, 2009 │ │ │ │ │ + 9 * Author: Christian Engwer │ │ │ │ │ 10 * --------------------------------- │ │ │ │ │ 11 * Project: dune-grid-glue │ │ │ │ │ - 12 * Description: helper class for graphical output of grids in generic │ │ │ │ │ -representation │ │ │ │ │ + 12 * Description: base class for all grid extractors │ │ │ │ │ 13 * │ │ │ │ │ 14 */ │ │ │ │ │ - 20#ifndef DUNE_GRIDGLUE_EXTRACTORS_VTKSURFACEWRITER_HH │ │ │ │ │ - 21#define DUNE_GRIDGLUE_EXTRACTORS_VTKSURFACEWRITER_HH │ │ │ │ │ + 20#ifndef DUNE_GRIDGLUE_EXTRACTORS_EXTRACTOR_HH │ │ │ │ │ + 21#define DUNE_GRIDGLUE_EXTRACTORS_EXTRACTOR_HH │ │ │ │ │ 22 │ │ │ │ │ - 23#include │ │ │ │ │ - 24#include │ │ │ │ │ - 25#include │ │ │ │ │ - 26#include │ │ │ │ │ - 27 │ │ │ │ │ - 28#include "../adapter/gridgluevtkwriter.hh" │ │ │ │ │ - 29 │ │ │ │ │ - 30namespace Dune { │ │ │ │ │ - 31 │ │ │ │ │ - 32 namespace GridGlue { │ │ │ │ │ + 23#include │ │ │ │ │ + 24#include │ │ │ │ │ + 25#include │ │ │ │ │ + 26#include │ │ │ │ │ + 27#include │ │ │ │ │ + 28#include │ │ │ │ │ + 29#include │ │ │ │ │ + 30#include │ │ │ │ │ + 31#include │ │ │ │ │ + 32#include │ │ │ │ │ 33 │ │ │ │ │ -34class VtkSurfaceWriter │ │ │ │ │ - 35{ │ │ │ │ │ - 36public: │ │ │ │ │ + 34namespace Dune { │ │ │ │ │ + 35 │ │ │ │ │ + 36 namespace GridGlue { │ │ │ │ │ 37 │ │ │ │ │ - 38 │ │ │ │ │ -39 VtkSurfaceWriter(const char* filename) : filename_(filename) │ │ │ │ │ - 40 {} │ │ │ │ │ - 41 │ │ │ │ │ -42 ~VtkSurfaceWriter() │ │ │ │ │ - 43 {} │ │ │ │ │ - 44 │ │ │ │ │ -45 void setFilename(const char* name) │ │ │ │ │ - 46 { │ │ │ │ │ - 47 if (std::strlen(name) > 0) │ │ │ │ │ - 48 this->filename_ = name; │ │ │ │ │ - 49 } │ │ │ │ │ - 50 │ │ │ │ │ - 51 │ │ │ │ │ - 52 template │ │ │ │ │ -53 void writeSurface(const std::vector& coords, const std::vector& indices, int corners, int dim) │ │ │ │ │ - 54 { │ │ │ │ │ - 55 std::ofstream fos; │ │ │ │ │ - 56 char buffer[64]; │ │ │ │ │ - 57 sprintf(buffer, "%s.vtk", this->filename_); │ │ │ │ │ - 58 fos.open(buffer); │ │ │ │ │ - 59 fos << std::setprecision(8) << std::setw(1); │ │ │ │ │ - 60 // write preamble │ │ │ │ │ - 61 fos << "# vtk DataFile Version 2.0\nFilename: " << buffer << "\nASCII" << │ │ │ │ │ -std::endl; │ │ │ │ │ - 62 this->writePoints(coords, dim, fos); │ │ │ │ │ - 63 const int polycount = indices.size()/corners; │ │ │ │ │ - 64 int corner_count[polycount]; │ │ │ │ │ - 65 for (int i = 0; i < polycount; ++i) │ │ │ │ │ - 66 corner_count[i] = corners; │ │ │ │ │ - 67 this->writePolygons(indices, corner_count, polycount, dim, fos); │ │ │ │ │ - 68 fos.close(); │ │ │ │ │ - 69 } │ │ │ │ │ + 44template │ │ │ │ │ +45class Extractor │ │ │ │ │ + 46{ │ │ │ │ │ + 47 │ │ │ │ │ + 48public: │ │ │ │ │ + 49 │ │ │ │ │ +50 static constexpr auto dimworld = GV::dimensionworld; │ │ │ │ │ +51 static constexpr auto dim = GV::dimension; │ │ │ │ │ +52 static constexpr auto codim = cd; │ │ │ │ │ + 53 │ │ │ │ │ +54 static constexpr int cube_corners = 1 << (dim-codim); │ │ │ │ │ + 55 │ │ │ │ │ +56 typedef GV GridView; │ │ │ │ │ +57 typedef typename GridView::Grid Grid; │ │ │ │ │ + 58 │ │ │ │ │ +59 typedef typename GV::Grid::ctype ctype; │ │ │ │ │ +60 typedef Dune::FieldVector Coords; │ │ │ │ │ +61 typedef Dune::FieldVector LocalCoords; │ │ │ │ │ + 62 │ │ │ │ │ +63 typedef typename GV::Traits::template Codim::Entity Vertex; │ │ │ │ │ +64 typedef typename Vertex::EntitySeed VertexSeed; │ │ │ │ │ + 65 │ │ │ │ │ +66 typedef typename GV::Traits::template Codim<0>::Entity Element; │ │ │ │ │ +67 typedef typename Element::EntitySeed ElementSeed; │ │ │ │ │ + 68 │ │ │ │ │ +69 typedef std::vector VertexVector; │ │ │ │ │ 70 │ │ │ │ │ - 71 │ │ │ │ │ - 72 template │ │ │ │ │ -73 void writeSurfaceElementData(const std::vector& coords, const std:: │ │ │ │ │ -vector& indices, int corners, const std::vector& data, const │ │ │ │ │ -char* dataname, int dim) │ │ │ │ │ - 74 { │ │ │ │ │ - 75 std::ofstream fos; │ │ │ │ │ - 76 char buffer[64]; │ │ │ │ │ - 77 sprintf(buffer, "%s.vtk", this->filename_); │ │ │ │ │ - 78 fos.open(buffer); │ │ │ │ │ - 79 fos << std::setprecision(8) << std::setw(1); │ │ │ │ │ - 80 // write preamble │ │ │ │ │ - 81 fos << "# vtk DataFile Version 2.0\nFilename: " << buffer << "\nASCII" << │ │ │ │ │ -std::endl; │ │ │ │ │ - 82 this->writePoints(coords, dim, fos); │ │ │ │ │ - 83 const int polycount = indices.size()/corners; │ │ │ │ │ - 84 int corner_count[polycount]; │ │ │ │ │ - 85 for (int i = 0; i < polycount; ++i) │ │ │ │ │ - 86 corner_count[i] = corners; │ │ │ │ │ - 87 this->writePolygons(indices, corner_count, polycount, dim, fos); │ │ │ │ │ - 88 this->writeCellData(data, dataname, dim, fos); │ │ │ │ │ - 89 fos.close(); │ │ │ │ │ - 90 } │ │ │ │ │ - 91 │ │ │ │ │ - 92 │ │ │ │ │ - 93 template │ │ │ │ │ -94 void writeSurfaceVertexData(const std::vector& coords, const std:: │ │ │ │ │ -vector& indices, int corners, const std::vector& data, const │ │ │ │ │ -char* dataname, int dim) │ │ │ │ │ - 95 { │ │ │ │ │ - 96 std::ofstream fos; │ │ │ │ │ - 97 char buffer[64]; │ │ │ │ │ - 98 sprintf(buffer, "%s.vtk", this->filename_); │ │ │ │ │ - 99 fos.open(buffer); │ │ │ │ │ - 100 fos << std::setprecision(8) << std::setw(1); │ │ │ │ │ - 101 // write preamble │ │ │ │ │ - 102 fos << "# vtk DataFile Version 2.0\nFilename: " << buffer << "\nASCII" << │ │ │ │ │ -std::endl; │ │ │ │ │ - 103 this->writePoints(coords, dim, fos); │ │ │ │ │ - 104 const int polycount = indices.size()/corners; │ │ │ │ │ - 105 int corner_count[polycount]; │ │ │ │ │ - 106 for (int i = 0; i < polycount; ++i) │ │ │ │ │ - 107 corner_count[i] = corners; │ │ │ │ │ - 108 this->writePolygons(indices, corner_count, polycount, dim, fos); │ │ │ │ │ - 109 this->writePointData(data, dataname, dim, fos); │ │ │ │ │ - 110 fos.close(); │ │ │ │ │ - 111 } │ │ │ │ │ - 112 │ │ │ │ │ - 113protected: │ │ │ │ │ - 114 │ │ │ │ │ - 115 template │ │ │ │ │ -116 void writePoints(const std::vector& coords, int dim, std::ofstream& fos) │ │ │ │ │ - 117 { │ │ │ │ │ - 118 fos << "DATASET POLYDATA\nPOINTS " << coords.size() << " " << TypeNames │ │ │ │ │ -[Nametraits::nameidx] << std::endl; │ │ │ │ │ - 119 for (unsigned int i = 0; i < coords.size(); ++i) │ │ │ │ │ + 71#if DUNE_VERSION_NEWER(DUNE_GRID, 2, 6) │ │ │ │ │ + 72 using CellMapper = MultipleCodimMultipleGeomTypeMapper; │ │ │ │ │ + 73#else │ │ │ │ │ +74 using CellMapper = MultipleCodimMultipleGeomTypeMapper; │ │ │ │ │ + 75#endif │ │ │ │ │ + 76 // typedef typename CellMapper::IndexType IndexType; │ │ │ │ │ +77 typedef int IndexType; │ │ │ │ │ + 78public: │ │ │ │ │ + 79 │ │ │ │ │ + 80 // transformations │ │ │ │ │ +81 typedef Dune::MultiLinearGeometry Geometry; │ │ │ │ │ +82 typedef Dune::MultiLinearGeometry LocalGeometry; │ │ │ │ │ + 83 │ │ │ │ │ + 84protected: │ │ │ │ │ + 85 /************************** PRIVATE SUBCLASSES **********************/ │ │ │ │ │ + 86 │ │ │ │ │ +91 struct CornerInfo │ │ │ │ │ + 92 { │ │ │ │ │ +93 unsigned int idx : 28; │ │ │ │ │ +94 unsigned int num : 4; │ │ │ │ │ + 95 }; │ │ │ │ │ + 96 │ │ │ │ │ +97 struct CoordinateInfo │ │ │ │ │ + 98 { │ │ │ │ │ +99 CoordinateInfo() │ │ │ │ │ + 100 {} │ │ │ │ │ + 101 │ │ │ │ │ +102 CoordinateInfo(unsigned int index_, IndexType vtxindex_) │ │ │ │ │ + 103 : vtxindex(vtxindex_), index(index_) │ │ │ │ │ + 104 {} │ │ │ │ │ + 105 │ │ │ │ │ +107 IndexType vtxindex; │ │ │ │ │ + 108 │ │ │ │ │ +110 Coords coord; │ │ │ │ │ + 111 │ │ │ │ │ +113 unsigned int index; │ │ │ │ │ + 114 }; │ │ │ │ │ + 115 │ │ │ │ │ +119 struct VertexInfo │ │ │ │ │ 120 { │ │ │ │ │ - 121 fos << coords[i][0]; │ │ │ │ │ - 122 if (dim == 2) │ │ │ │ │ - 123 fos << " " << coords[i][1] << " 0 \n" << coords[i][0] << " " << coords[i] │ │ │ │ │ -[1] << " 0.01" << std::endl; │ │ │ │ │ - 124 else // dim == 3 │ │ │ │ │ - 125 fos << " " << coords[i][1] << " " << coords[i][2] << std::endl; │ │ │ │ │ - 126 } │ │ │ │ │ - 127 } │ │ │ │ │ - 128 │ │ │ │ │ -129 void writePolygons(const std::vector& indices, const int* │ │ │ │ │ -corners, int ncorners, int dim, std::ofstream& fos) │ │ │ │ │ - 130 { │ │ │ │ │ - 131 if (dim == 2) │ │ │ │ │ +121 VertexInfo(unsigned int idx_, const Vertex& p_) : idx(idx_), p(p_.seed()) │ │ │ │ │ + 122 {} │ │ │ │ │ +123 unsigned int idx; │ │ │ │ │ +124 VertexSeed p; │ │ │ │ │ + 125 }; │ │ │ │ │ + 126 │ │ │ │ │ + 127 │ │ │ │ │ +131 struct ElementInfo │ │ │ │ │ 132 { │ │ │ │ │ - 133 fos << "POLYGONS " << indices.size()/2 << " " << 5*(indices.size() / 2) << │ │ │ │ │ -std::endl; │ │ │ │ │ - 134 for (unsigned int i = 0; i < indices.size(); i += 2) │ │ │ │ │ - 135 fos << "4 " << 2*indices[i] << " " << 2*indices[i+1] << " " << 2*indices │ │ │ │ │ -[i+1]+1 << " "<< 2*indices[i]+1 << std::endl; │ │ │ │ │ - 136 │ │ │ │ │ - 137 // arbitrary shapes - ignored here! │ │ │ │ │ - 138 // int sum = ncorners; │ │ │ │ │ - 139 // for (int i = 0; i < ncorners; ++i) │ │ │ │ │ - 140 // sum += (corners[i] > 2 ? corners[i] : 3); │ │ │ │ │ - 141 // │ │ │ │ │ - 142 // fos << "POLYGONS " << ncorners << " " << sum << std::endl; │ │ │ │ │ - 143 // int index = 0; │ │ │ │ │ - 144 // for (int i = 0; i < ncorners; ++i) │ │ │ │ │ - 145 // { │ │ │ │ │ - 146 // // write the first index twice if it is an egde │ │ │ │ │ - 147 // // => triangle instead of edge - paraview can display it then │ │ │ │ │ - 148 // if (corners[i] > 2) │ │ │ │ │ - 149 // fos << corners[i]; │ │ │ │ │ - 150 // else │ │ │ │ │ - 151 // fos << "3 " << indices[index]; │ │ │ │ │ - 152 // │ │ │ │ │ - 153 // for (int j = 0; j < corners[i]; ++j) │ │ │ │ │ - 154 // fos << " " << indices[index++]; │ │ │ │ │ - 155 // fos << std::endl; │ │ │ │ │ - 156 // } │ │ │ │ │ - 157 } │ │ │ │ │ - 158 else │ │ │ │ │ - 159 { │ │ │ │ │ - 160 int sum = ncorners; │ │ │ │ │ - 161 for (int i = 0; i < ncorners; ++i) │ │ │ │ │ - 162 sum += corners[i]; │ │ │ │ │ - 163 fos << "POLYGONS " << ncorners << " " << sum << std::endl; │ │ │ │ │ - 164 int index = 0; │ │ │ │ │ - 165 for (int i = 0; i < ncorners; ++i) │ │ │ │ │ - 166 { │ │ │ │ │ - 167 fos << corners[i]; │ │ │ │ │ - 168 for (int j = 0; j < corners[i]; ++j) │ │ │ │ │ - 169 fos << " " << indices[index++]; │ │ │ │ │ - 170 fos << std::endl; │ │ │ │ │ - 171 } │ │ │ │ │ - 172 } │ │ │ │ │ - 173 } │ │ │ │ │ - 174 │ │ │ │ │ - 175 template │ │ │ │ │ -176 void writeCellData(const std::vector& data, const char* dataname, int │ │ │ │ │ -dim, std::ofstream& fos) │ │ │ │ │ - 177 { │ │ │ │ │ - 178 fos << "CELL_DATA " << data.size()*(dim == 2 ? 2 : 1) << std::endl; │ │ │ │ │ - 179 fos << "SCALARS " << dataname << " " << TypeNames[Nametraits::nameidx] │ │ │ │ │ -<< " 1" << std::endl; │ │ │ │ │ - 180 fos << "LOOKUP_TABLE default" << std::endl; │ │ │ │ │ - 181 for (unsigned int i = 0; i < data.size(); ++i) │ │ │ │ │ - 182 { │ │ │ │ │ - 183 fos << data[i] << std::endl; │ │ │ │ │ - 184 if (dim == 2) │ │ │ │ │ - 185 fos << data[i] << std::endl; │ │ │ │ │ - 186 } │ │ │ │ │ - 187 } │ │ │ │ │ - 188 │ │ │ │ │ - 189 template │ │ │ │ │ -190 void writePointData(const std::vector& data, const char* dataname, int │ │ │ │ │ -dim, std::ofstream& fos) │ │ │ │ │ - 191 { │ │ │ │ │ - 192 fos << "POINT_DATA " << data.size()*(dim == 2 ? 2 : 1) << std::endl; │ │ │ │ │ - 193 fos << "SCALARS " << dataname << " " << TypeNames[Nametraits::nameidx] │ │ │ │ │ -<< " 1" << std::endl; │ │ │ │ │ - 194 fos << "LOOKUP_TABLE default" << std::endl; │ │ │ │ │ - 195 for (unsigned int i = 0; i < data.size(); ++i) │ │ │ │ │ - 196 { │ │ │ │ │ - 197 fos << data[i] << std::endl; │ │ │ │ │ - 198 if (dim == 2) │ │ │ │ │ - 199 fos << data[i] << std::endl; │ │ │ │ │ - 200 } │ │ │ │ │ - 201 } │ │ │ │ │ +133 ElementInfo(unsigned int idx_, const Element& p_, unsigned int f_) : idx │ │ │ │ │ +(idx_), faces(f_), p(p_.seed()) │ │ │ │ │ + 134 {} │ │ │ │ │ + 135 │ │ │ │ │ +137 unsigned int idx : 28; │ │ │ │ │ + 138 │ │ │ │ │ +140 unsigned int faces : 4; │ │ │ │ │ + 141 │ │ │ │ │ +143 ElementSeed p; │ │ │ │ │ + 144 }; │ │ │ │ │ + 145 │ │ │ │ │ + 146 │ │ │ │ │ +150 struct SubEntityInfo │ │ │ │ │ + 151 { │ │ │ │ │ +152 SubEntityInfo() │ │ │ │ │ + 153 /* │ │ │ │ │ + 154 * TODO: move default value of `geometryType_` to member declaration │ │ │ │ │ + 155 * when removing support for older dune-geometry │ │ │ │ │ + 156 */ │ │ │ │ │ + 157#if DUNE_VERSION_NEWER(DUNE_GEOMETRY, 2, 6) │ │ │ │ │ + 158 : geometryType_(GeometryTypes::simplex(dim-codim)) │ │ │ │ │ + 159 {} │ │ │ │ │ + 160#else │ │ │ │ │ + 161 { │ │ │ │ │ + 162 geometryType_.makeSimplex(dim-codim); │ │ │ │ │ + 163 } │ │ │ │ │ + 164#endif │ │ │ │ │ + 165 │ │ │ │ │ +166 SubEntityInfo(IndexType parent_, unsigned int num_in_parent_, │ │ │ │ │ + 167 const Dune::GeometryType& geometryType) │ │ │ │ │ + 168 : parent(parent_), num_in_parent(num_in_parent_), geometryType_ │ │ │ │ │ +(geometryType) │ │ │ │ │ + 169 {} │ │ │ │ │ + 170 │ │ │ │ │ +171 unsigned int nCorners() const │ │ │ │ │ + 172 { │ │ │ │ │ + 173 return Dune::ReferenceElements::general │ │ │ │ │ +(geometryType_).size(dim-codim); │ │ │ │ │ + 174 } │ │ │ │ │ + 175 │ │ │ │ │ +177 IndexType parent; │ │ │ │ │ + 178 │ │ │ │ │ +180 unsigned int num_in_parent : 3; │ │ │ │ │ + 181 │ │ │ │ │ +183 Dune::GeometryType geometryType_; │ │ │ │ │ + 184 │ │ │ │ │ +191 CornerInfo corners[cube_corners]; // sim = numer of vertices in a simplex │ │ │ │ │ + 192 }; │ │ │ │ │ + 193 │ │ │ │ │ + 194 │ │ │ │ │ +195 typedef std::map ElementInfoMap; │ │ │ │ │ +196 typedef std::map VertexInfoMap; │ │ │ │ │ + 197 │ │ │ │ │ + 198 /************************** MEMBER VARIABLES ************************/ │ │ │ │ │ + 199 │ │ │ │ │ +201 const GridView gv_; │ │ │ │ │ 202 │ │ │ │ │ - 203 │ │ │ │ │ - 204private: │ │ │ │ │ - 205 const char* filename_; │ │ │ │ │ - 206}; │ │ │ │ │ + 203 /* Geometrical and Topological Information */ │ │ │ │ │ + 204 │ │ │ │ │ +206 std::vector coords_; │ │ │ │ │ 207 │ │ │ │ │ - 208} // namespace GridGlue │ │ │ │ │ - 209 │ │ │ │ │ - 210} // namespace Dune │ │ │ │ │ - 211 │ │ │ │ │ - 212#endif // DUNE_GRIDGLUE_EXTRACTORS_VTKSURFACEWRITER_HH │ │ │ │ │ +209 std::vector subEntities_; │ │ │ │ │ + 210 │ │ │ │ │ +216 VertexInfoMap vtxInfo_; │ │ │ │ │ + 217 │ │ │ │ │ +223 ElementInfoMap elmtInfo_; │ │ │ │ │ + 224 │ │ │ │ │ +225 CellMapper cellMapper_; │ │ │ │ │ + 226 │ │ │ │ │ + 227public: │ │ │ │ │ + 228 │ │ │ │ │ + 229 /* C O N S T R U C T O R S A N D D E S T R U C T O R S */ │ │ │ │ │ + 230 │ │ │ │ │ +235 Extractor(const GV& gv) │ │ │ │ │ + 236 : gv_(gv) │ │ │ │ │ + 237#if DUNE_VERSION_NEWER(DUNE_GRID, 2, 6) │ │ │ │ │ + 238 , cellMapper_(gv, mcmgElementLayout()) │ │ │ │ │ + 239#else │ │ │ │ │ + 240 , cellMapper_(gv) │ │ │ │ │ + 241#endif │ │ │ │ │ + 242 {} │ │ │ │ │ + 243 │ │ │ │ │ + 244 /* F U N C T I O N A L I T Y */ │ │ │ │ │ + 245 │ │ │ │ │ +249 void clear() │ │ │ │ │ + 250 { │ │ │ │ │ + 251 // this is an inofficial way on how to free the memory allocated │ │ │ │ │ + 252 // by a std::vector │ │ │ │ │ + 253 { │ │ │ │ │ + 254 std::vector dummy; │ │ │ │ │ + 255 coords_.swap(dummy); │ │ │ │ │ + 256 } │ │ │ │ │ + 257 { │ │ │ │ │ + 258 std::vector dummy; │ │ │ │ │ + 259 subEntities_.swap(dummy); │ │ │ │ │ + 260 } │ │ │ │ │ + 261 │ │ │ │ │ + 262 // ...then clear the maps themselves, too │ │ │ │ │ + 263 vtxInfo_.clear(); │ │ │ │ │ + 264 elmtInfo_.clear(); │ │ │ │ │ + 265 } │ │ │ │ │ + 266 │ │ │ │ │ + 267 │ │ │ │ │ + 268 /* G E T T E R S */ │ │ │ │ │ + 269 │ │ │ │ │ +275 void getCoords(std::vector >& coords) │ │ │ │ │ +const │ │ │ │ │ + 276 { │ │ │ │ │ + 277 coords.resize(coords_.size()); │ │ │ │ │ + 278 for (unsigned int i = 0; i < coords_.size(); ++i) │ │ │ │ │ + 279 coords[i] = coords_[i].coord; │ │ │ │ │ + 280 } │ │ │ │ │ + 281 │ │ │ │ │ + 282 │ │ │ │ │ +287 unsigned int nCoords() const │ │ │ │ │ + 288 { │ │ │ │ │ + 289 return coords_.size(); │ │ │ │ │ + 290 } │ │ │ │ │ + 291 │ │ │ │ │ +293 void getGeometryTypes(std::vector& geometryTypes) const │ │ │ │ │ + 294 { │ │ │ │ │ + 295 geometryTypes.resize(subEntities_.size()); │ │ │ │ │ + 296 for (size_t i=0; i& faces) const │ │ │ │ │ + 305 { │ │ │ │ │ + 306 faces.resize(subEntities_.size()); │ │ │ │ │ + 307 for (unsigned int i = 0; i < subEntities_.size(); ++i) { │ │ │ │ │ + 308 faces[i].resize(subEntities_[i].nCorners()); │ │ │ │ │ + 309 for (unsigned int j = 0; j < subEntities_[i].nCorners(); ++j) │ │ │ │ │ + 310 faces[i][j] = subEntities_[i].corners[j].idx; │ │ │ │ │ + 311 } │ │ │ │ │ + 312 } │ │ │ │ │ + 313 │ │ │ │ │ + 314 │ │ │ │ │ +323 bool faceIndices(const Element& e, int& first, int& count) const │ │ │ │ │ + 324 { │ │ │ │ │ + 325 typename ElementInfoMap::const_iterator it = │ │ │ │ │ + 326 elmtInfo_.find(cellMapper_.map(e)); │ │ │ │ │ + 327 if (it == elmtInfo_.end()) │ │ │ │ │ + 328 { │ │ │ │ │ + 329 first = -1; │ │ │ │ │ + 330 count = 0; │ │ │ │ │ + 331 return false; │ │ │ │ │ + 332 } │ │ │ │ │ + 333 // the iterator is valid, fill the out params │ │ │ │ │ + 334 first = it->second.idx; │ │ │ │ │ + 335 count = it->second.faces; │ │ │ │ │ + 336 return true; │ │ │ │ │ + 337 } │ │ │ │ │ + 338 │ │ │ │ │ + 339 │ │ │ │ │ +345 int indexInInside(unsigned int index) const │ │ │ │ │ + 346 { │ │ │ │ │ + 347 return index < subEntities_.size() ? subEntities_[index].num_in_parent : - │ │ │ │ │ +1; │ │ │ │ │ + 348 } │ │ │ │ │ + 349 │ │ │ │ │ + 350 // /** │ │ │ │ │ + 351 // * @brief tests that a given entry in the extraction set does have local │ │ │ │ │ +couplings │ │ │ │ │ + 352 // * @todo parallel interface │ │ │ │ │ + 353 // */ │ │ │ │ │ + 354 // bool contains (unsigned int global, unsigned int & local) const │ │ │ │ │ + 355 // { │ │ │ │ │ + 356 // local = global; │ │ │ │ │ + 357 // return true; │ │ │ │ │ + 358 // } │ │ │ │ │ + 359 │ │ │ │ │ +363 const GridView & gridView() const │ │ │ │ │ + 364 { │ │ │ │ │ + 365 return gv_; │ │ │ │ │ + 366 } │ │ │ │ │ + 367 │ │ │ │ │ +368 const Grid& grid() const │ │ │ │ │ + 369 { │ │ │ │ │ + 370 return gv_.grid(); │ │ │ │ │ + 371 } │ │ │ │ │ + 372 │ │ │ │ │ + 379 Element │ │ │ │ │ +380 element(unsigned int index) const │ │ │ │ │ + 381 { │ │ │ │ │ + 382 if (index >= subEntities_.size()) │ │ │ │ │ + 383 DUNE_THROW(Dune::GridError, "invalid face index"); │ │ │ │ │ + 384 const ElementSeed seed = elmtInfo_.at(subEntities_[index].parent).p; │ │ │ │ │ + 385 return grid().entity(seed); │ │ │ │ │ + 386 } │ │ │ │ │ + 387 │ │ │ │ │ + 388#if 1 │ │ │ │ │ + 395 Vertex │ │ │ │ │ +396 vertex(unsigned int index) const │ │ │ │ │ + 397 { │ │ │ │ │ + 398 if (index >= coords_.size()) │ │ │ │ │ + 399 DUNE_THROW(Dune::GridError, "invalid coordinate index"); │ │ │ │ │ + 400 const VertexSeed seed = vtxInfo_.at(coords_[index].vtxindex).p; │ │ │ │ │ + 401 return grid().entity(seed); │ │ │ │ │ + 402 } │ │ │ │ │ + 403#endif │ │ │ │ │ + 404 │ │ │ │ │ +406 Geometry geometry(unsigned int index) const; │ │ │ │ │ + 407 │ │ │ │ │ +409 LocalGeometry geometryLocal(unsigned int index) const; │ │ │ │ │ + 410 │ │ │ │ │ + 411}; │ │ │ │ │ + 412 │ │ │ │ │ + 413 │ │ │ │ │ + 415template │ │ │ │ │ +416typename Extractor::Geometry Extractor::geometry(unsigned int │ │ │ │ │ +index) const │ │ │ │ │ + 417{ │ │ │ │ │ + 418 std::vector corners(subEntities_[index].nCorners()); │ │ │ │ │ + 419 for (unsigned int i = 0; i < subEntities_[index].nCorners(); ++i) │ │ │ │ │ + 420 corners[i] = coords_[subEntities_[index].corners[i].idx].coord; │ │ │ │ │ + 421 │ │ │ │ │ + 422 return Geometry(subEntities_[index].geometryType_, corners); │ │ │ │ │ + 423} │ │ │ │ │ + 424 │ │ │ │ │ + 425 │ │ │ │ │ + 427template │ │ │ │ │ +428typename Extractor::LocalGeometry Extractor::geometryLocal │ │ │ │ │ +(unsigned int index) const │ │ │ │ │ + 429{ │ │ │ │ │ + 430 std::vector corners(subEntities_[index].nCorners()); │ │ │ │ │ + 431 │ │ │ │ │ + 432 // get face info │ │ │ │ │ + 433 const SubEntityInfo & face = subEntities_[index]; │ │ │ │ │ + 434 Dune::GeometryType facetype = subEntities_[index].geometryType_; │ │ │ │ │ + 435 │ │ │ │ │ + 436 // get reference element │ │ │ │ │ + 437 const auto elmtseed = elmtInfo_.at(face.parent).p; │ │ │ │ │ + 438 const auto elmt = grid().entity(elmtseed); │ │ │ │ │ + 439 const Dune::GeometryType celltype = elmt.type(); │ │ │ │ │ + 440 const auto& re = Dune::ReferenceElements::general(celltype); │ │ │ │ │ + 441 for (unsigned int i = 0; i < subEntities_[index].nCorners(); ++i) │ │ │ │ │ + 442 corners[i] = re.position(face.corners[i].num,dim); │ │ │ │ │ + 443 │ │ │ │ │ + 444 return LocalGeometry(facetype, corners); │ │ │ │ │ + 445} │ │ │ │ │ + 446 │ │ │ │ │ + 447} // namespace GridGlue │ │ │ │ │ + 448 │ │ │ │ │ + 449} // namespace Dune │ │ │ │ │ + 450 │ │ │ │ │ + 451#endif // DUNE_GRIDGLUE_EXTRACTORS_EXTRACTOR_HH │ │ │ │ │ Dune │ │ │ │ │ Definition: gridglue.hh:37 │ │ │ │ │ -Dune::GridGlue::VtkSurfaceWriter │ │ │ │ │ -Definition: vtksurfacewriter.hh:35 │ │ │ │ │ -Dune::GridGlue::VtkSurfaceWriter::writeCellData │ │ │ │ │ -void writeCellData(const std::vector< T > &data, const char *dataname, int dim, │ │ │ │ │ -std::ofstream &fos) │ │ │ │ │ -Definition: vtksurfacewriter.hh:176 │ │ │ │ │ -Dune::GridGlue::VtkSurfaceWriter::writePointData │ │ │ │ │ -void writePointData(const std::vector< T > &data, const char *dataname, int │ │ │ │ │ -dim, std::ofstream &fos) │ │ │ │ │ -Definition: vtksurfacewriter.hh:190 │ │ │ │ │ -Dune::GridGlue::VtkSurfaceWriter::writeSurfaceVertexData │ │ │ │ │ -void writeSurfaceVertexData(const std::vector< K > &coords, const std::vector< │ │ │ │ │ -unsigned int > &indices, int corners, const std::vector< T > &data, const char │ │ │ │ │ -*dataname, int dim) │ │ │ │ │ -Definition: vtksurfacewriter.hh:94 │ │ │ │ │ -Dune::GridGlue::VtkSurfaceWriter::setFilename │ │ │ │ │ -void setFilename(const char *name) │ │ │ │ │ -Definition: vtksurfacewriter.hh:45 │ │ │ │ │ -Dune::GridGlue::VtkSurfaceWriter::writeSurfaceElementData │ │ │ │ │ -void writeSurfaceElementData(const std::vector< K > &coords, const std::vector< │ │ │ │ │ -unsigned int > &indices, int corners, const std::vector< T > &data, const char │ │ │ │ │ -*dataname, int dim) │ │ │ │ │ -Definition: vtksurfacewriter.hh:73 │ │ │ │ │ -Dune::GridGlue::VtkSurfaceWriter::~VtkSurfaceWriter │ │ │ │ │ -~VtkSurfaceWriter() │ │ │ │ │ -Definition: vtksurfacewriter.hh:42 │ │ │ │ │ -Dune::GridGlue::VtkSurfaceWriter::VtkSurfaceWriter │ │ │ │ │ -VtkSurfaceWriter(const char *filename) │ │ │ │ │ -Definition: vtksurfacewriter.hh:39 │ │ │ │ │ -Dune::GridGlue::VtkSurfaceWriter::writeSurface │ │ │ │ │ -void writeSurface(const std::vector< K > &coords, const std::vector< unsigned │ │ │ │ │ -int > &indices, int corners, int dim) │ │ │ │ │ -Definition: vtksurfacewriter.hh:53 │ │ │ │ │ -Dune::GridGlue::VtkSurfaceWriter::writePoints │ │ │ │ │ -void writePoints(const std::vector< K > &coords, int dim, std::ofstream &fos) │ │ │ │ │ -Definition: vtksurfacewriter.hh:116 │ │ │ │ │ -Dune::GridGlue::VtkSurfaceWriter::writePolygons │ │ │ │ │ -void writePolygons(const std::vector< unsigned int > &indices, const int │ │ │ │ │ -*corners, int ncorners, int dim, std::ofstream &fos) │ │ │ │ │ -Definition: vtksurfacewriter.hh:129 │ │ │ │ │ +Dune::GridGlue::Extractor │ │ │ │ │ +Provides codimension-independent methods for grid extraction. │ │ │ │ │ +Definition: extractor.hh:46 │ │ │ │ │ +Dune::GridGlue::Extractor::Vertex │ │ │ │ │ +GV::Traits::template Codim< dim >::Entity Vertex │ │ │ │ │ +Definition: extractor.hh:63 │ │ │ │ │ +Dune::GridGlue::Extractor::vtxInfo_ │ │ │ │ │ +VertexInfoMap vtxInfo_ │ │ │ │ │ +a map enabling faster access to vertices and coordinates │ │ │ │ │ +Definition: extractor.hh:216 │ │ │ │ │ +Dune::GridGlue::Extractor::grid │ │ │ │ │ +const Grid & grid() const │ │ │ │ │ +Definition: extractor.hh:368 │ │ │ │ │ +Dune::GridGlue::Extractor::CellMapper │ │ │ │ │ +MultipleCodimMultipleGeomTypeMapper< GridView, MCMGElementLayout > CellMapper │ │ │ │ │ +Definition: extractor.hh:74 │ │ │ │ │ +Dune::GridGlue::Extractor::element │ │ │ │ │ +Element element(unsigned int index) const │ │ │ │ │ +gets the parent element for a given face index, throws an exception if index │ │ │ │ │ +not valid │ │ │ │ │ +Definition: extractor.hh:380 │ │ │ │ │ +Dune::GridGlue::Extractor::indexInInside │ │ │ │ │ +int indexInInside(unsigned int index) const │ │ │ │ │ +gets the number face in the parent element │ │ │ │ │ +Definition: extractor.hh:345 │ │ │ │ │ +Dune::GridGlue::Extractor::LocalCoords │ │ │ │ │ +Dune::FieldVector< ctype, dim > LocalCoords │ │ │ │ │ +Definition: extractor.hh:61 │ │ │ │ │ +Dune::GridGlue::Extractor::geometryLocal │ │ │ │ │ +LocalGeometry geometryLocal(unsigned int index) const │ │ │ │ │ +Get geometry of the extracted face in element coordinates. │ │ │ │ │ +Definition: extractor.hh:428 │ │ │ │ │ +Dune::GridGlue::Extractor::dimworld │ │ │ │ │ +static constexpr auto dimworld │ │ │ │ │ +Definition: extractor.hh:50 │ │ │ │ │ +Dune::GridGlue::Extractor::Geometry │ │ │ │ │ +Dune::MultiLinearGeometry< ctype, dim-codim, dimworld > Geometry │ │ │ │ │ +Definition: extractor.hh:81 │ │ │ │ │ +Dune::GridGlue::Extractor::IndexType │ │ │ │ │ +int IndexType │ │ │ │ │ +Definition: extractor.hh:77 │ │ │ │ │ +Dune::GridGlue::Extractor::coords_ │ │ │ │ │ +std::vector< CoordinateInfo > coords_ │ │ │ │ │ +all information about the corner vertices of the extracted │ │ │ │ │ +Definition: extractor.hh:206 │ │ │ │ │ +Dune::GridGlue::Extractor::Element │ │ │ │ │ +GV::Traits::template Codim< 0 >::Entity Element │ │ │ │ │ +Definition: extractor.hh:66 │ │ │ │ │ +Dune::GridGlue::Extractor::gridView │ │ │ │ │ +const GridView & gridView() const │ │ │ │ │ +give access to the Dune::GridView where this Patch belongs to │ │ │ │ │ +Definition: extractor.hh:363 │ │ │ │ │ +Dune::GridGlue::Extractor::getFaces │ │ │ │ │ +void getFaces(std::vector< VertexVector > &faces) const │ │ │ │ │ +Get the corners of the extracted subentities. │ │ │ │ │ +Definition: extractor.hh:304 │ │ │ │ │ +Dune::GridGlue::Extractor::VertexVector │ │ │ │ │ +std::vector< unsigned int > VertexVector │ │ │ │ │ +Definition: extractor.hh:69 │ │ │ │ │ +Dune::GridGlue::Extractor::gv_ │ │ │ │ │ +const GridView gv_ │ │ │ │ │ +the grid object to extract the surface from │ │ │ │ │ +Definition: extractor.hh:201 │ │ │ │ │ +Dune::GridGlue::Extractor::subEntities_ │ │ │ │ │ +std::vector< SubEntityInfo > subEntities_ │ │ │ │ │ +all information about the extracted subEntities │ │ │ │ │ +Definition: extractor.hh:209 │ │ │ │ │ +Dune::GridGlue::Extractor::cube_corners │ │ │ │ │ +static constexpr int cube_corners │ │ │ │ │ +Definition: extractor.hh:54 │ │ │ │ │ +Dune::GridGlue::Extractor::vertex │ │ │ │ │ +Vertex vertex(unsigned int index) const │ │ │ │ │ +gets the vertex for a given coordinate index throws an exception if index not │ │ │ │ │ +valid │ │ │ │ │ +Definition: extractor.hh:396 │ │ │ │ │ +Dune::GridGlue::Extractor::codim │ │ │ │ │ +static constexpr auto codim │ │ │ │ │ +Definition: extractor.hh:52 │ │ │ │ │ +Dune::GridGlue::Extractor::Coords │ │ │ │ │ +Dune::FieldVector< ctype, dimworld > Coords │ │ │ │ │ +Definition: extractor.hh:60 │ │ │ │ │ +Dune::GridGlue::Extractor::getGeometryTypes │ │ │ │ │ +void getGeometryTypes(std::vector< Dune::GeometryType > &geometryTypes) const │ │ │ │ │ +Get the list of geometry types. │ │ │ │ │ +Definition: extractor.hh:293 │ │ │ │ │ +Dune::GridGlue::Extractor::VertexInfoMap │ │ │ │ │ +std::map< IndexType, VertexInfo > VertexInfoMap │ │ │ │ │ +Definition: extractor.hh:196 │ │ │ │ │ +Dune::GridGlue::Extractor::Grid │ │ │ │ │ +GridView::Grid Grid │ │ │ │ │ +Definition: extractor.hh:57 │ │ │ │ │ +Dune::GridGlue::Extractor::faceIndices │ │ │ │ │ +bool faceIndices(const Element &e, int &first, int &count) const │ │ │ │ │ +gets index of first subentity as well as the total number of subentities that │ │ │ │ │ +were extracted from thi... │ │ │ │ │ +Definition: extractor.hh:323 │ │ │ │ │ +Dune::GridGlue::Extractor::geometry │ │ │ │ │ +Geometry geometry(unsigned int index) const │ │ │ │ │ +Get world geometry of the extracted face. │ │ │ │ │ +Definition: extractor.hh:416 │ │ │ │ │ +Dune::GridGlue::Extractor::GridView │ │ │ │ │ +GV GridView │ │ │ │ │ +Definition: extractor.hh:56 │ │ │ │ │ +Dune::GridGlue::Extractor::nCoords │ │ │ │ │ +unsigned int nCoords() const │ │ │ │ │ +getter for the count of coordinates │ │ │ │ │ +Definition: extractor.hh:287 │ │ │ │ │ +Dune::GridGlue::Extractor::ctype │ │ │ │ │ +GV::Grid::ctype ctype │ │ │ │ │ +Definition: extractor.hh:59 │ │ │ │ │ +Dune::GridGlue::Extractor::ElementInfoMap │ │ │ │ │ +std::map< IndexType, ElementInfo > ElementInfoMap │ │ │ │ │ +Definition: extractor.hh:195 │ │ │ │ │ +Dune::GridGlue::Extractor::Extractor │ │ │ │ │ +Extractor(const GV &gv) │ │ │ │ │ +Constructor. │ │ │ │ │ +Definition: extractor.hh:235 │ │ │ │ │ +Dune::GridGlue::Extractor::getCoords │ │ │ │ │ +void getCoords(std::vector< Dune::FieldVector< ctype, dimworld > > &coords) │ │ │ │ │ +const │ │ │ │ │ +getter for the coordinates array │ │ │ │ │ +Definition: extractor.hh:275 │ │ │ │ │ +Dune::GridGlue::Extractor::cellMapper_ │ │ │ │ │ +CellMapper cellMapper_ │ │ │ │ │ +Definition: extractor.hh:225 │ │ │ │ │ +Dune::GridGlue::Extractor::ElementSeed │ │ │ │ │ +Element::EntitySeed ElementSeed │ │ │ │ │ +Definition: extractor.hh:67 │ │ │ │ │ +Dune::GridGlue::Extractor::VertexSeed │ │ │ │ │ +Vertex::EntitySeed VertexSeed │ │ │ │ │ +Definition: extractor.hh:64 │ │ │ │ │ +Dune::GridGlue::Extractor::elmtInfo_ │ │ │ │ │ +ElementInfoMap elmtInfo_ │ │ │ │ │ +a map enabling faster access to elements and faces │ │ │ │ │ +Definition: extractor.hh:223 │ │ │ │ │ +Dune::GridGlue::Extractor::clear │ │ │ │ │ +void clear() │ │ │ │ │ +delete everything build up so far and free the memory │ │ │ │ │ +Definition: extractor.hh:249 │ │ │ │ │ +Dune::GridGlue::Extractor::dim │ │ │ │ │ +static constexpr auto dim │ │ │ │ │ +Definition: extractor.hh:51 │ │ │ │ │ +Dune::GridGlue::Extractor::LocalGeometry │ │ │ │ │ +Dune::MultiLinearGeometry< ctype, dim-codim, dim > LocalGeometry │ │ │ │ │ +Definition: extractor.hh:82 │ │ │ │ │ +Dune::GridGlue::Extractor::CornerInfo │ │ │ │ │ +Helpful struct holding one index for the coordinate (vertex) to which it is │ │ │ │ │ +associated and the elemen... │ │ │ │ │ +Definition: extractor.hh:92 │ │ │ │ │ +Dune::GridGlue::Extractor::CornerInfo::idx │ │ │ │ │ +unsigned int idx │ │ │ │ │ +index of the vertex │ │ │ │ │ +Definition: extractor.hh:93 │ │ │ │ │ +Dune::GridGlue::Extractor::CornerInfo::num │ │ │ │ │ +unsigned int num │ │ │ │ │ +element corner │ │ │ │ │ +Definition: extractor.hh:94 │ │ │ │ │ +Dune::GridGlue::Extractor::CoordinateInfo │ │ │ │ │ +Definition: extractor.hh:98 │ │ │ │ │ +Dune::GridGlue::Extractor::CoordinateInfo::CoordinateInfo │ │ │ │ │ +CoordinateInfo(unsigned int index_, IndexType vtxindex_) │ │ │ │ │ +Definition: extractor.hh:102 │ │ │ │ │ +Dune::GridGlue::Extractor::CoordinateInfo::index │ │ │ │ │ +unsigned int index │ │ │ │ │ +the index of this coordinate (in internal storage scheme) // NEEDED?? │ │ │ │ │ +Definition: extractor.hh:113 │ │ │ │ │ +Dune::GridGlue::Extractor::CoordinateInfo::CoordinateInfo │ │ │ │ │ +CoordinateInfo() │ │ │ │ │ +Definition: extractor.hh:99 │ │ │ │ │ +Dune::GridGlue::Extractor::CoordinateInfo::coord │ │ │ │ │ +Coords coord │ │ │ │ │ +the coordinate │ │ │ │ │ +Definition: extractor.hh:110 │ │ │ │ │ +Dune::GridGlue::Extractor::CoordinateInfo::vtxindex │ │ │ │ │ +IndexType vtxindex │ │ │ │ │ +the index of the parent element (from index set) │ │ │ │ │ +Definition: extractor.hh:107 │ │ │ │ │ +Dune::GridGlue::Extractor::VertexInfo │ │ │ │ │ +simple struct holding a vertex pointer and an index │ │ │ │ │ +Definition: extractor.hh:120 │ │ │ │ │ +Dune::GridGlue::Extractor::VertexInfo::idx │ │ │ │ │ +unsigned int idx │ │ │ │ │ +Definition: extractor.hh:123 │ │ │ │ │ +Dune::GridGlue::Extractor::VertexInfo::VertexInfo │ │ │ │ │ +VertexInfo(unsigned int idx_, const Vertex &p_) │ │ │ │ │ +Definition: extractor.hh:121 │ │ │ │ │ +Dune::GridGlue::Extractor::VertexInfo::p │ │ │ │ │ +VertexSeed p │ │ │ │ │ +Definition: extractor.hh:124 │ │ │ │ │ +Dune::GridGlue::Extractor::ElementInfo │ │ │ │ │ +simple struct holding an element seed and an index │ │ │ │ │ +Definition: extractor.hh:132 │ │ │ │ │ +Dune::GridGlue::Extractor::ElementInfo::idx │ │ │ │ │ +unsigned int idx │ │ │ │ │ +the index of this element's first face in the internal list of extracted faces │ │ │ │ │ +Definition: extractor.hh:137 │ │ │ │ │ +Dune::GridGlue::Extractor::ElementInfo::faces │ │ │ │ │ +unsigned int faces │ │ │ │ │ +the number of extracted faces for this element │ │ │ │ │ +Definition: extractor.hh:140 │ │ │ │ │ +Dune::GridGlue::Extractor::ElementInfo::ElementInfo │ │ │ │ │ +ElementInfo(unsigned int idx_, const Element &p_, unsigned int f_) │ │ │ │ │ +Definition: extractor.hh:133 │ │ │ │ │ +Dune::GridGlue::Extractor::ElementInfo::p │ │ │ │ │ +ElementSeed p │ │ │ │ │ +the entity seed for the element │ │ │ │ │ +Definition: extractor.hh:143 │ │ │ │ │ +Dune::GridGlue::Extractor::SubEntityInfo │ │ │ │ │ +Holds some information about an element's subentity involved in a coupling. │ │ │ │ │ +Definition: extractor.hh:151 │ │ │ │ │ +Dune::GridGlue::Extractor::SubEntityInfo::nCorners │ │ │ │ │ +unsigned int nCorners() const │ │ │ │ │ +Definition: extractor.hh:171 │ │ │ │ │ +Dune::GridGlue::Extractor::SubEntityInfo::corners │ │ │ │ │ +CornerInfo corners[cube_corners] │ │ │ │ │ +the corner indices plus the numbers of the vertices in the parent element │ │ │ │ │ +Definition: extractor.hh:191 │ │ │ │ │ +Dune::GridGlue::Extractor::SubEntityInfo::parent │ │ │ │ │ +IndexType parent │ │ │ │ │ +the index of the parent element (from index set) │ │ │ │ │ +Definition: extractor.hh:177 │ │ │ │ │ +Dune::GridGlue::Extractor::SubEntityInfo::SubEntityInfo │ │ │ │ │ +SubEntityInfo(IndexType parent_, unsigned int num_in_parent_, const Dune:: │ │ │ │ │ +GeometryType &geometryType) │ │ │ │ │ +Definition: extractor.hh:166 │ │ │ │ │ +Dune::GridGlue::Extractor::SubEntityInfo::num_in_parent │ │ │ │ │ +unsigned int num_in_parent │ │ │ │ │ +the number of the face in the parent element │ │ │ │ │ +Definition: extractor.hh:180 │ │ │ │ │ +Dune::GridGlue::Extractor::SubEntityInfo::geometryType_ │ │ │ │ │ +Dune::GeometryType geometryType_ │ │ │ │ │ +The GeometryType of the subentity. │ │ │ │ │ +Definition: extractor.hh:183 │ │ │ │ │ +Dune::GridGlue::Extractor::SubEntityInfo::SubEntityInfo │ │ │ │ │ +SubEntityInfo() │ │ │ │ │ +Definition: extractor.hh:152 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00062.html │ │ │ │ @@ -71,21 +71,21 @@ │ │ │ │ Namespaces │ │ │ │
codim1extractor.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Grid extractor class for codim 1 subgrids. │ │ │ │ More...

│ │ │ │ -
#include "extractor.hh"
│ │ │ │ +
#include "extractor.hh"
│ │ │ │ #include <array>
│ │ │ │ #include <deque>
│ │ │ │ #include <functional>
│ │ │ │ #include <dune/common/deprecated.hh>
│ │ │ │ #include <dune/common/version.hh>
│ │ │ │ -#include <dune/grid-glue/common/crossproduct.hh>
│ │ │ │ +#include <dune/grid-glue/common/crossproduct.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00062_source.html │ │ │ │ @@ -82,23 +82,23 @@ │ │ │ │
11 * Project: dune-grid-glue
│ │ │ │
12 * Description: class for grid extractors extracting surface grids
│ │ │ │
13 *
│ │ │ │
14 */
│ │ │ │
20#ifndef DUNE_GRIDGLUE_EXTRACTORS_CODIM1EXTRACTOR_HH
│ │ │ │
21#define DUNE_GRIDGLUE_EXTRACTORS_CODIM1EXTRACTOR_HH
│ │ │ │
22
│ │ │ │ -
23#include "extractor.hh"
│ │ │ │ +
23#include "extractor.hh"
│ │ │ │
24
│ │ │ │
25#include <array>
│ │ │ │
26#include <deque>
│ │ │ │
27#include <functional>
│ │ │ │
28
│ │ │ │
29#include <dune/common/deprecated.hh>
│ │ │ │
30#include <dune/common/version.hh>
│ │ │ │ - │ │ │ │ + │ │ │ │
32
│ │ │ │
33namespace Dune {
│ │ │ │
34
│ │ │ │
35 namespace GridGlue {
│ │ │ │
36
│ │ │ │
40template<typename GV>
│ │ │ │
41class Codim1Extractor : public Extractor<GV,1>
│ │ │ │ @@ -428,16 +428,16 @@ │ │ │ │
384}
│ │ │ │
385
│ │ │ │
386} // namespace GridGlue
│ │ │ │
387
│ │ │ │
388} // namespace Dune
│ │ │ │
389
│ │ │ │
390#endif // DUNE_GRIDGLUE_EXTRACTORS_CODIM1EXTRACTOR_HH
│ │ │ │ - │ │ │ │ -
extractor base class
│ │ │ │ + │ │ │ │ +
extractor base class
│ │ │ │
Definition: gridglue.hh:37
│ │ │ │
IteratorRange<... > intersections(const GridGlue<... > &glue, const Reverse<... > &reverse=!reversed)
Iterate over all intersections of a GridGlue.
│ │ │ │
static Dune::FieldVector< T, dim > crossProduct(const Dune::FieldVector< T, dim > &a, const Dune::FieldVector< T, dim > &b)
compute cross product
Definition: crossproduct.hh:15
│ │ │ │
Definition: codim1extractor.hh:42
│ │ │ │
Extractor< GV, 1 >::IndexType IndexType
Definition: codim1extractor.hh:51
│ │ │ │
GV GridView
Definition: codim1extractor.hh:56
│ │ │ │
GV::Traits::template Codim< 0 >::Entity Element
Definition: codim1extractor.hh:62
│ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00065.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: merger.hh File Reference │ │ │ │ +dune-grid-glue: standardmerge.cc File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -63,39 +63,110 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Classes | │ │ │ │ -Namespaces
│ │ │ │ -
merger.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Macros | │ │ │ │ +Functions
│ │ │ │ +
standardmerge.cc File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <vector>
│ │ │ │ -#include <dune/common/fvector.hh>
│ │ │ │ -#include <dune/geometry/type.hh>
│ │ │ │ -#include <dune/grid-glue/merging/intersectionlist.hh>
│ │ │ │ -
│ │ │ │ -

Go to the source code of this file.

│ │ │ │ -

│ │ │ │ Classes

class  Dune::GridGlue::Codim1Extractor< GV >
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Classes

class  Dune::GridGlue::Merger< ctype, grid1Dim, grid2Dim, dimworld >
 Abstract base for all classes that take extracted grids and build sets of intersections. More...
 
│ │ │ │ +
#include "config.h"
│ │ │ │ +#include "standardmerge.hh"
│ │ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Macros

#define DECL
 
#define STANDARD_MERGE_INSTANTIATE(T, A, B, C)
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +Functions

 Dune::GridGlue::STANDARD_MERGE_INSTANTIATE (double, 1, 1, 1)
 
 Dune::GridGlue::STANDARD_MERGE_INSTANTIATE (double, 2, 2, 2)
 
 Dune::GridGlue::STANDARD_MERGE_INSTANTIATE (double, 3, 3, 3)
 
│ │ │ │ +

Macro Definition Documentation

│ │ │ │ + │ │ │ │ +

◆ DECL

│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
#define DECL
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │ + │ │ │ │ +

◆ STANDARD_MERGE_INSTANTIATE

│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
#define STANDARD_MERGE_INSTANTIATE( T,
 A,
 B,
 
)
│ │ │ │ +
│ │ │ │ +Value:
DECL template \
│ │ │ │ +
void StandardMerge<T,A,B,C>::build(const std::vector<Dune::FieldVector<T,C> >& grid1_coords, \
│ │ │ │ +
const std::vector<unsigned int>& grid1_elements, \
│ │ │ │ +
const std::vector<Dune::GeometryType>& grid1_element_types, \
│ │ │ │ +
const std::vector<Dune::FieldVector<T,C> >& grid2_coords, \
│ │ │ │ +
const std::vector<unsigned int>& grid2_elements, \
│ │ │ │ +
const std::vector<Dune::GeometryType>& grid2_element_types \
│ │ │ │ +
)
│ │ │ │ +
#define DECL
Definition: standardmerge.cc:12
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,27 +5,53 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * merging │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -merger.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -Go_to_the_source_code_of_this_file. │ │ │ │ │ - Classes │ │ │ │ │ -class  Dune::GridGlue::Merger<_ctype,_grid1Dim,_grid2Dim,_dimworld_> │ │ │ │ │ -  Abstract base for all classes that take extracted grids and build sets │ │ │ │ │ - of intersections. More... │ │ │ │ │ -  │ │ │ │ │ +Namespaces | Macros | Functions │ │ │ │ │ +standardmerge.cc File Reference │ │ │ │ │ +#include "config.h" │ │ │ │ │ +#include "standardmerge.hh" │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::GridGlue │ │ │ │ │   │ │ │ │ │ + Macros │ │ │ │ │ +#define DECL │ │ │ │ │ +  │ │ │ │ │ +#define STANDARD_MERGE_INSTANTIATE(T, A, B, C) │ │ │ │ │ +  │ │ │ │ │ + Functions │ │ │ │ │ + Dune::GridGlue::STANDARD_MERGE_INSTANTIATE (double, 1, 1, 1) │ │ │ │ │ +  │ │ │ │ │ + Dune::GridGlue::STANDARD_MERGE_INSTANTIATE (double, 2, 2, 2) │ │ │ │ │ +  │ │ │ │ │ + Dune::GridGlue::STANDARD_MERGE_INSTANTIATE (double, 3, 3, 3) │ │ │ │ │ +  │ │ │ │ │ +***** Macro Definition Documentation ***** │ │ │ │ │ +***** ◆ DECL ***** │ │ │ │ │ +#define DECL │ │ │ │ │ +***** ◆ STANDARD_MERGE_INSTANTIATE ***** │ │ │ │ │ +#define STANDARD_MERGE_INSTANTIATE (  T, │ │ │ │ │ +  A, │ │ │ │ │ +  B, │ │ │ │ │ +  C  │ │ │ │ │ + ) │ │ │ │ │ +Value: │ │ │ │ │ +DECL template \ │ │ │ │ │ +void StandardMerge::build(const std::vector >& │ │ │ │ │ +grid1_coords, \ │ │ │ │ │ +const std::vector& grid1_elements, \ │ │ │ │ │ +const std::vector& grid1_element_types, \ │ │ │ │ │ +const std::vector >& grid2_coords, \ │ │ │ │ │ +const std::vector& grid2_elements, \ │ │ │ │ │ +const std::vector& grid2_element_types \ │ │ │ │ │ +) │ │ │ │ │ +DECL │ │ │ │ │ +#define DECL │ │ │ │ │ +Definition: standardmerge.cc:12 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00068.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: intersectionlist.hh File Reference │ │ │ │ +dune-grid-glue: conformingmerge.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,43 +65,46 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
intersectionlist.hh File Reference
│ │ │ │ +
conformingmerge.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <array>
│ │ │ │ -#include <type_traits>
│ │ │ │ -#include <utility>
│ │ │ │ + │ │ │ │ +

Implementation of the Merger concept for conforming interfaces. │ │ │ │ +More...

│ │ │ │ +
#include <iomanip>
│ │ │ │ #include <vector>
│ │ │ │ +#include <algorithm>
│ │ │ │ +#include <bitset>
│ │ │ │ +#include <dune/common/fmatrix.hh>
│ │ │ │ #include <dune/common/fvector.hh>
│ │ │ │ +#include <dune/geometry/referenceelements.hh>
│ │ │ │ +#include <dune/grid-glue/merging/standardmerge.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::GridGlue::IntersectionListProvider< L0, L1 >
 
class  Dune::GridGlue::IntersectionList< Local0, Local1 >
 
class  Dune::GridGlue::SimplicialIntersectionListProvider< dim0, dim1 >
 
struct  Dune::GridGlue::SimplicialIntersectionListProvider< dim0, dim1 >::SimplicialIntersection
class  Dune::GridGlue::ConformingMerge< dim, dimworld, T >
 Implementation of the Merger concept for conforming interfaces. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
│ │ │ │ -
│ │ │ │ +

Detailed Description

│ │ │ │ +

Implementation of the Merger concept for conforming interfaces.

│ │ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -6,32 +6,32 @@ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * merging │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -intersectionlist.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +conformingmerge.hh File Reference │ │ │ │ │ +Implementation of the Merger concept for conforming interfaces. More... │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ - class  Dune::GridGlue::IntersectionListProvider<_L0,_L1_> │ │ │ │ │ -  │ │ │ │ │ - class  Dune::GridGlue::IntersectionList<_Local0,_Local1_> │ │ │ │ │ -  │ │ │ │ │ - class  Dune::GridGlue::SimplicialIntersectionListProvider<_dim0,_dim1_> │ │ │ │ │ -  │ │ │ │ │ -struct  Dune::GridGlue::SimplicialIntersectionListProvider<_dim0,_dim1_>:: │ │ │ │ │ - SimplicialIntersection │ │ │ │ │ +class  Dune::GridGlue::ConformingMerge<_dim,_dimworld,_T_> │ │ │ │ │ +  Implementation of the Merger concept for conforming interfaces. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::GridGlue │ │ │ │ │   │ │ │ │ │ +***** Detailed Description ***** │ │ │ │ │ +Implementation of the Merger concept for conforming interfaces. │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00068_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: intersectionlist.hh Source File │ │ │ │ +dune-grid-glue: conformingmerge.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,259 +62,216 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
intersectionlist.hh
│ │ │ │ +
conformingmerge.hh
│ │ │ │
│ │ │ │
│ │ │ │ -Go to the documentation of this file.
1// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │ -
2// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
│ │ │ │ -
3#ifndef DUNE_GRIDGLUE_MERGING_INTERSECTIONLIST_HH
│ │ │ │ -
4#define DUNE_GRIDGLUE_MERGING_INTERSECTIONLIST_HH 1
│ │ │ │ -
5
│ │ │ │ -
6#include <array>
│ │ │ │ -
7#include <type_traits>
│ │ │ │ -
8#include <utility>
│ │ │ │ -
9#include <vector>
│ │ │ │ -
10
│ │ │ │ -
11#include <dune/common/fvector.hh>
│ │ │ │ -
12
│ │ │ │ -
13namespace Dune {
│ │ │ │ -
14namespace GridGlue {
│ │ │ │ -
15
│ │ │ │ -
20template<typename L0, typename L1>
│ │ │ │ - │ │ │ │ -
22{
│ │ │ │ -
23public:
│ │ │ │ -
24
│ │ │ │ -
28 using Local0 = L0;
│ │ │ │ -
29
│ │ │ │ -
33 using Local1 = L1;
│ │ │ │ -
34
│ │ │ │ -
38 using Index = unsigned int;
│ │ │ │ +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 © DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │ +
4// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
│ │ │ │ +
5/*
│ │ │ │ +
6 * Filename: conformingmerge.hh
│ │ │ │ +
7 * Version: 1.0
│ │ │ │ +
8 * Created on: Sep 14, 2009
│ │ │ │ +
9 * Author: Oliver Sander
│ │ │ │ +
10 * ---------------------------------
│ │ │ │ +
11 * Project: dune-grid-glue
│ │ │ │ +
12 * Description: implementation of the Merger concept for conforming interfaces
│ │ │ │ +
13 *
│ │ │ │ +
14 */
│ │ │ │ +
21#ifndef DUNE_GRIDGLUE_MERGING_CONFORMINGMERGE_HH
│ │ │ │ +
22#define DUNE_GRIDGLUE_MERGING_CONFORMINGMERGE_HH
│ │ │ │ +
23
│ │ │ │ +
24#include <iomanip>
│ │ │ │ +
25#include <vector>
│ │ │ │ +
26#include <algorithm>
│ │ │ │ +
27#include <bitset>
│ │ │ │ +
28
│ │ │ │ +
29#include <dune/common/fmatrix.hh>
│ │ │ │ +
30#include <dune/common/fvector.hh>
│ │ │ │ +
31
│ │ │ │ +
32#include <dune/geometry/referenceelements.hh>
│ │ │ │ +
33
│ │ │ │ + │ │ │ │ +
35
│ │ │ │ +
36namespace Dune {
│ │ │ │ +
37
│ │ │ │ +
38 namespace GridGlue {
│ │ │ │
39
│ │ │ │ -
43 virtual std::size_t size() const = 0;
│ │ │ │ -
44
│ │ │ │ -
50 virtual std::size_t parents0(Index intersection) const = 0;
│ │ │ │ -
51
│ │ │ │ -
57 virtual std::size_t parents1(Index intersection) const = 0;
│ │ │ │ -
58
│ │ │ │ -
65 virtual Index parent0(Index intersection, unsigned index) const = 0;
│ │ │ │ -
66
│ │ │ │ -
73 virtual Index parent1(Index intersection, unsigned index) const = 0;
│ │ │ │ -
74
│ │ │ │ -
82 virtual Local0 corner0(Index intersection, unsigned corner, unsigned index) const = 0;
│ │ │ │ -
83
│ │ │ │ -
91 virtual Local1 corner1(Index intersection, unsigned corner, unsigned index) const = 0;
│ │ │ │ -
92};
│ │ │ │ -
93
│ │ │ │ -
94namespace Impl {
│ │ │ │ +
46template<int dim, int dimworld, typename T = double>
│ │ │ │ + │ │ │ │ +
48 : public StandardMerge<T,dim,dim,dimworld>
│ │ │ │ +
49{
│ │ │ │ +
50
│ │ │ │ +
51public:
│ │ │ │ +
52
│ │ │ │ +
53 /* E X P O R T E D T Y P E S A N D C O N S T A N T S */
│ │ │ │ +
54
│ │ │ │ +
56 typedef T ctype;
│ │ │ │ +
57
│ │ │ │ +
59 typedef Dune::FieldVector<T, dimworld> WorldCoords;
│ │ │ │ +
60
│ │ │ │ +
62 typedef Dune::FieldVector<T, dim> LocalCoords;
│ │ │ │ +
63
│ │ │ │ +
64private:
│ │ │ │ +
65
│ │ │ │ +
66 /* M E M B E R V A R I A B L E S */
│ │ │ │ +
67
│ │ │ │ +
69 T tolerance_;
│ │ │ │ +
70
│ │ │ │ +
71 typedef typename StandardMerge<T,dim,dim,dimworld>::SimplicialIntersection SimplicialIntersection;
│ │ │ │ +
72
│ │ │ │ +
77 void computeIntersections(const Dune::GeometryType& grid1ElementType,
│ │ │ │ +
78 const std::vector<Dune::FieldVector<T,dimworld> >& grid1ElementCorners,
│ │ │ │ +
79 std::bitset<(1<<dim)>& neighborIntersects1,
│ │ │ │ +
80 unsigned int grid1Index,
│ │ │ │ +
81 const Dune::GeometryType& grid2ElementType,
│ │ │ │ +
82 const std::vector<Dune::FieldVector<T,dimworld> >& grid2ElementCorners,
│ │ │ │ +
83 std::bitset<(1<<dim)>& neighborIntersects2,
│ │ │ │ +
84 unsigned int grid2Index,
│ │ │ │ +
85 std::vector<SimplicialIntersection>& intersections);
│ │ │ │ +
86
│ │ │ │ +
87public:
│ │ │ │ +
88
│ │ │ │ +
89 static constexpr T default_tolerance = 1e-4;
│ │ │ │ +
90
│ │ │ │ + │ │ │ │ +
92 tolerance_(tolerance)
│ │ │ │ +
93 {}
│ │ │ │ +
94};
│ │ │ │
95
│ │ │ │ -
96template<typename P, int I>
│ │ │ │ -
97struct IntersectionListLocal
│ │ │ │ -
98{};
│ │ │ │ -
99
│ │ │ │ -
100template<typename P>
│ │ │ │ -
101struct IntersectionListLocal<P, 0>
│ │ │ │ -
102{
│ │ │ │ -
103 static std::size_t parents(const P& p, typename P::Index intersection)
│ │ │ │ -
104 { return p.parents0(intersection); }
│ │ │ │ -
105
│ │ │ │ -
106 static typename P::Index parent(const P& p, typename P::Index intersection, unsigned index)
│ │ │ │ -
107 { return p.parent0(intersection, index); }
│ │ │ │ -
108
│ │ │ │ -
109 static typename P::Local0 corner(const P& p, typename P::Index intersection, unsigned corner, unsigned index)
│ │ │ │ -
110 { return p.corner0(intersection, corner, index); }
│ │ │ │ -
111};
│ │ │ │ -
112
│ │ │ │ -
113template<typename P>
│ │ │ │ -
114struct IntersectionListLocal<P, 1>
│ │ │ │ -
115{
│ │ │ │ -
116 static std::size_t parents(const P& p, typename P::Index intersection)
│ │ │ │ -
117 { return p.parents1(intersection); }
│ │ │ │ +
96template<int dim, int dimworld, typename T>
│ │ │ │ + │ │ │ │ +
98
│ │ │ │ +
99template<int dim, int dimworld, typename T>
│ │ │ │ +
100void ConformingMerge<dim, dimworld, T>::computeIntersections(const Dune::GeometryType& grid1ElementType,
│ │ │ │ +
101 const std::vector<Dune::FieldVector<T,dimworld> >& grid1ElementCorners,
│ │ │ │ +
102 std::bitset<(1<<dim)>& neighborIntersects1,
│ │ │ │ +
103 unsigned int grid1Index,
│ │ │ │ +
104 const Dune::GeometryType& grid2ElementType,
│ │ │ │ +
105 const std::vector<Dune::FieldVector<T,dimworld> >& grid2ElementCorners,
│ │ │ │ +
106 std::bitset<(1<<dim)>& neighborIntersects2,
│ │ │ │ +
107 unsigned int grid2Index,
│ │ │ │ +
108 std::vector<SimplicialIntersection>& intersections)
│ │ │ │ +
109{
│ │ │ │ +
110 this->counter++;
│ │ │ │ +
111
│ │ │ │ +
112 // A few consistency checks
│ │ │ │ +
113 assert((unsigned int)(Dune::ReferenceElements<T,dim>::general(grid1ElementType).size(dim)) == grid1ElementCorners.size());
│ │ │ │ +
114 assert((unsigned int)(Dune::ReferenceElements<T,dim>::general(grid2ElementType).size(dim)) == grid2ElementCorners.size());
│ │ │ │ +
115 // any intersection we may find will be the entire elements.
│ │ │ │ +
116 neighborIntersects1.reset();
│ │ │ │ +
117 neighborIntersects2.reset();
│ │ │ │
118
│ │ │ │ -
119 static typename P::Index parent(const P& p, typename P::Index intersection, unsigned index)
│ │ │ │ -
120 { return p.parent1(intersection, index); }
│ │ │ │ -
121
│ │ │ │ -
122 static typename P::Local1 corner(const P& p, typename P::Index intersection, unsigned corner, unsigned index)
│ │ │ │ -
123 { return p.corner1(intersection, corner, index); }
│ │ │ │ -
124};
│ │ │ │ -
125
│ │ │ │ -
126} /* namespace Impl */
│ │ │ │ +
119 // the intersection is either conforming or empty, hence the GeometryTypes have to match
│ │ │ │ +
120 if (grid1ElementType != grid2ElementType)
│ │ │ │ +
121 return;
│ │ │ │ +
122
│ │ │ │ +
123 // ////////////////////////////////////////////////////////////
│ │ │ │ +
124 // Find correspondences between the different corners
│ │ │ │ +
125 // ////////////////////////////////////////////////////////////
│ │ │ │ +
126 std::vector<int> other(grid1ElementCorners.size(), -1);
│ │ │ │
127
│ │ │ │ -
132template<typename Local0, typename Local1>
│ │ │ │ - │ │ │ │ -
134{
│ │ │ │ -
135public:
│ │ │ │ - │ │ │ │ -
137 using Index = typename Provider::Index;
│ │ │ │ +
128 for (unsigned int i=0; i<grid1ElementCorners.size(); i++) {
│ │ │ │ +
129
│ │ │ │ +
130 for (unsigned int j=0; j<grid2ElementCorners.size(); j++) {
│ │ │ │ +
131
│ │ │ │ +
132 if ( (grid1ElementCorners[i]-grid2ElementCorners[j]).two_norm() < tolerance_ ) {
│ │ │ │ +
133
│ │ │ │ +
134 other[i] = j;
│ │ │ │ +
135 break;
│ │ │ │ +
136
│ │ │ │ +
137 }
│ │ │ │
138
│ │ │ │ -
139 IntersectionList(const std::shared_ptr<Provider>& provider)
│ │ │ │ -
140 : impl_(provider)
│ │ │ │ -
141 {}
│ │ │ │ -
142
│ │ │ │ -
146 std::size_t size() const
│ │ │ │ -
147 { return impl_->size(); }
│ │ │ │ -
148
│ │ │ │ -
155 template<int I>
│ │ │ │ -
156 std::size_t parents(Index intersection) const
│ │ │ │ -
157 {
│ │ │ │ -
158 static_assert(I == 0 or I == 1, "I must be 0 or 1");
│ │ │ │ -
159 // TODO [C++17]: use `if constexpr` instead of indirection
│ │ │ │ -
160 return Impl::IntersectionListLocal<Provider, I>::parents(*impl_, intersection);
│ │ │ │ +
139 }
│ │ │ │ +
140
│ │ │ │ +
141 // No corresponding grid2 vertex found for this grid1 vertex
│ │ │ │ +
142 if (other[i] == -1)
│ │ │ │ +
143 return;
│ │ │ │ +
144
│ │ │ │ +
145 }
│ │ │ │ +
146
│ │ │ │ +
147 // ////////////////////////////////////////////////////////////
│ │ │ │ +
148 // Set up the new remote intersection
│ │ │ │ +
149 // ////////////////////////////////////////////////////////////
│ │ │ │ +
150
│ │ │ │ +
151 const auto& refElement = Dune::ReferenceElements<T,dim>::general(grid1ElementType);
│ │ │ │ +
152
│ │ │ │ +
154 if (grid1ElementType.isSimplex()) {
│ │ │ │ +
155
│ │ │ │ +
156 intersections.emplace_back(grid1Index, grid2Index);
│ │ │ │ +
157
│ │ │ │ +
158 for (int i=0; i<refElement.size(dim); i++) {
│ │ │ │ +
159 intersections.back().corners0[0][i] = refElement.position(i,dim);
│ │ │ │ +
160 intersections.back().corners1[0][i] = refElement.position(other[i],dim);
│ │ │ │
161 }
│ │ │ │
162
│ │ │ │ -
170 template<int I>
│ │ │ │ -
171 Index parent(Index intersection, unsigned index = 0) const
│ │ │ │ -
172 {
│ │ │ │ -
173 static_assert(I == 0 or I == 1, "I must be 0 or 1");
│ │ │ │ -
174 // TODO [C++17]: use `if constexpr` instead of indirection
│ │ │ │ -
175 return Impl::IntersectionListLocal<Provider, I>::parent(*impl_, intersection, index);
│ │ │ │ -
176 }
│ │ │ │ -
177
│ │ │ │ -
186 template<int I>
│ │ │ │ -
187 auto corner(Index intersection, unsigned corner, unsigned index = 0) const
│ │ │ │ -
188 {
│ │ │ │ -
189 static_assert(I == 0 or I == 1, "I must be 0 or 1");
│ │ │ │ -
190 // TODO [C++17]: use `if constexpr` instead of indirection
│ │ │ │ -
191 return Impl::IntersectionListLocal<Provider, I>::corner(*impl_, intersection, corner, index);
│ │ │ │ -
192 }
│ │ │ │ -
193
│ │ │ │ -
194private:
│ │ │ │ -
195 std::shared_ptr<Provider> impl_;
│ │ │ │ -
196};
│ │ │ │ +
163 } else if (dim == 2 && grid1ElementType.isQuadrilateral()) {
│ │ │ │ +
164
│ │ │ │ +
165 // split the quadrilateral into two triangles
│ │ │ │ +
166 const unsigned int subVertices[2][3] = {{0,1,3}, {0,3,2}};
│ │ │ │ +
167
│ │ │ │ +
168 for (int i=0; i<2; i++) {
│ │ │ │ +
169
│ │ │ │ +
170 SimplicialIntersection newSimplicialIntersection(grid1Index, grid2Index);
│ │ │ │ +
171
│ │ │ │ +
172 for (int j=0; j<dim+1; j++) {
│ │ │ │ +
173 newSimplicialIntersection.corners0[0][j] = refElement.position(subVertices[i][j],dim);
│ │ │ │ +
174 newSimplicialIntersection.corners1[0][j] = refElement.position(subVertices[i][other[j]],dim);
│ │ │ │ +
175 }
│ │ │ │ +
176
│ │ │ │ +
177 intersections.push_back(newSimplicialIntersection);
│ │ │ │ +
178
│ │ │ │ +
179 }
│ │ │ │ +
180
│ │ │ │ +
181 } else if (grid1ElementType.isHexahedron()) {
│ │ │ │ +
182
│ │ │ │ +
183 // split the hexahedron into five tetrahedra
│ │ │ │ +
184 // This can be removed if ever we allow Intersections that are not simplices
│ │ │ │ +
185 const unsigned int subVertices[5][4] = {{0,1,3,5}, {0,3,2,6}, {4,5,0,6}, {6,7,6,3}, {6,0,5,3}};
│ │ │ │ +
186
│ │ │ │ +
187 for (int i=0; i<5; i++) {
│ │ │ │ +
188
│ │ │ │ +
189 SimplicialIntersection newSimplicialIntersection(grid1Index, grid2Index);
│ │ │ │ +
190
│ │ │ │ +
191 for (int j=0; j<dim+1; j++) {
│ │ │ │ +
192 newSimplicialIntersection.corners0[0][j] = refElement.position(subVertices[i][j],dim);
│ │ │ │ +
193 newSimplicialIntersection.corners1[0][j] = refElement.position(subVertices[i][other[j]],dim);
│ │ │ │ +
194 }
│ │ │ │ +
195
│ │ │ │ +
196 intersections.push_back(newSimplicialIntersection);
│ │ │ │
197
│ │ │ │ -
204template<int dim0, int dim1>
│ │ │ │ - │ │ │ │ -
206 : public IntersectionListProvider< FieldVector<double, dim0>, FieldVector<double, dim1> >
│ │ │ │ -
207{
│ │ │ │ -
208 using Base = IntersectionListProvider< FieldVector<double, dim0>, FieldVector<double, dim1> >;
│ │ │ │ -
209
│ │ │ │ -
210public:
│ │ │ │ -
211 using Index = typename Base::Index;
│ │ │ │ -
212 using Local0 = FieldVector<double, dim0>;
│ │ │ │ -
213 using Local1 = FieldVector<double, dim1>;
│ │ │ │ -
214
│ │ │ │ -
215 template<int I>
│ │ │ │ -
216 using Local = std::conditional_t< I == 0, Local0, Local1 >;
│ │ │ │ -
217
│ │ │ │ - │ │ │ │ -
222 {
│ │ │ │ -
223 private:
│ │ │ │ -
224 static constexpr int intersectionDim = dim0 < dim1 ? dim0 : dim1;
│ │ │ │ -
225 static constexpr int nVertices = intersectionDim + 1;
│ │ │ │ -
226
│ │ │ │ -
227 public:
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
232 {}
│ │ │ │ -
233
│ │ │ │ -
237 template<int I>
│ │ │ │ -
238 using Corners = std::array<Local<I>, nVertices>;
│ │ │ │ -
239
│ │ │ │ -
243 std::vector< Corners<0> > corners0 = std::vector< Corners<0> >(1);
│ │ │ │ -
244
│ │ │ │ -
248 std::vector< Index > parents0 = std::vector< Index >(1);
│ │ │ │ -
249
│ │ │ │ -
253 std::vector< Corners<1> > corners1 = std::vector< Corners<1> >(1);
│ │ │ │ -
254
│ │ │ │ -
258 std::vector< Index > parents1 = std::vector< Index >(1);
│ │ │ │ -
259 };
│ │ │ │ -
260
│ │ │ │ - │ │ │ │ -
262 SimplicialIntersectionListProvider(std::vector<SimplicialIntersection>&& intersections)
│ │ │ │ -
263 : intersections_(std::move(intersections))
│ │ │ │ -
264 {}
│ │ │ │ -
265
│ │ │ │ - │ │ │ │ -
267 { return intersections_; }
│ │ │ │ -
268
│ │ │ │ -
269 std::size_t size() const override
│ │ │ │ -
270 { return intersections_.size(); }
│ │ │ │ -
271
│ │ │ │ -
272 std::size_t parents0(Index intersection) const override
│ │ │ │ -
273 { return intersections_[intersection].parents0.size(); }
│ │ │ │ -
274
│ │ │ │ -
275 std::size_t parents1(Index intersection) const override
│ │ │ │ -
276 { return intersections_[intersection].parents1.size(); }
│ │ │ │ -
277
│ │ │ │ -
278 Index parent0(Index intersection, unsigned index) const override
│ │ │ │ -
279 { return intersections_[intersection].parents0[index]; }
│ │ │ │ -
280
│ │ │ │ -
281 Index parent1(Index intersection, unsigned index) const override
│ │ │ │ -
282 { return intersections_[intersection].parents1[index]; }
│ │ │ │ -
283
│ │ │ │ -
284 Local0 corner0(Index intersection, unsigned corner, unsigned index) const override
│ │ │ │ -
285 { return intersections_[intersection].corners0[index][corner]; }
│ │ │ │ -
286
│ │ │ │ -
287 Local1 corner1(Index intersection, unsigned corner, unsigned index) const override
│ │ │ │ -
288 { return intersections_[intersection].corners1[index][corner]; }
│ │ │ │ -
289
│ │ │ │ -
290 void clear()
│ │ │ │ -
291 {
│ │ │ │ -
292 intersections_.clear();
│ │ │ │ -
293 }
│ │ │ │ -
294
│ │ │ │ -
295private:
│ │ │ │ -
296 std::vector<SimplicialIntersection> intersections_;
│ │ │ │ -
297};
│ │ │ │ -
298
│ │ │ │ -
299} /* namespace GridGlue */
│ │ │ │ -
300} /* namespace Dune */
│ │ │ │ -
301
│ │ │ │ -
302#endif
│ │ │ │ +
198 }
│ │ │ │ +
199
│ │ │ │ +
200 } else
│ │ │ │ +
201 DUNE_THROW(Dune::GridError, "Unsupported element type");
│ │ │ │ +
202
│ │ │ │ +
203}
│ │ │ │ +
204
│ │ │ │ +
205} // namespace GridGlue
│ │ │ │ +
206
│ │ │ │ +
207} // namespace Dune
│ │ │ │ +
208
│ │ │ │ +
209#endif // DUNE_GRIDGLUE_MERGING_CONFORMINGMERGE_HH
│ │ │ │ +
Common base class for many merger implementations: produce pairs of entities that may intersect.
│ │ │ │
Definition: gridglue.hh:37
│ │ │ │ -
Coordinate corner(unsigned c)
Definition: projection_impl.hh:24
│ │ │ │ -
Definition: intersectionlist.hh:22
│ │ │ │ -
virtual std::size_t parents0(Index intersection) const =0
│ │ │ │ -
virtual Local1 corner1(Index intersection, unsigned corner, unsigned index) const =0
│ │ │ │ -
unsigned int Index
Definition: intersectionlist.hh:38
│ │ │ │ -
virtual std::size_t size() const =0
│ │ │ │ -
L0 Local0
Definition: intersectionlist.hh:28
│ │ │ │ -
virtual Local0 corner0(Index intersection, unsigned corner, unsigned index) const =0
│ │ │ │ -
L1 Local1
Definition: intersectionlist.hh:33
│ │ │ │ -
virtual Index parent1(Index intersection, unsigned index) const =0
│ │ │ │ -
virtual std::size_t parents1(Index intersection) const =0
│ │ │ │ -
virtual Index parent0(Index intersection, unsigned index) const =0
│ │ │ │ -
Definition: intersectionlist.hh:134
│ │ │ │ -
Index parent(Index intersection, unsigned index=0) const
Definition: intersectionlist.hh:171
│ │ │ │ -
auto corner(Index intersection, unsigned corner, unsigned index=0) const
Definition: intersectionlist.hh:187
│ │ │ │ -
typename Provider::Index Index
Definition: intersectionlist.hh:137
│ │ │ │ -
IntersectionList(const std::shared_ptr< Provider > &provider)
Definition: intersectionlist.hh:139
│ │ │ │ -
std::size_t parents(Index intersection) const
Definition: intersectionlist.hh:156
│ │ │ │ -
std::size_t size() const
Definition: intersectionlist.hh:146
│ │ │ │ -
Definition: intersectionlist.hh:207
│ │ │ │ -
FieldVector< double, dim0 > Local0
Definition: intersectionlist.hh:212
│ │ │ │ -
auto & intersections()
Definition: intersectionlist.hh:266
│ │ │ │ -
SimplicialIntersectionListProvider(std::vector< SimplicialIntersection > &&intersections)
Definition: intersectionlist.hh:262
│ │ │ │ -
Local1 corner1(Index intersection, unsigned corner, unsigned index) const override
Definition: intersectionlist.hh:287
│ │ │ │ -
Local0 corner0(Index intersection, unsigned corner, unsigned index) const override
Definition: intersectionlist.hh:284
│ │ │ │ -
Index parent1(Index intersection, unsigned index) const override
Definition: intersectionlist.hh:281
│ │ │ │ -
typename Base::Index Index
Definition: intersectionlist.hh:211
│ │ │ │ -
std::conditional_t< I==0, Local0, Local1 > Local
Definition: intersectionlist.hh:216
│ │ │ │ - │ │ │ │ -
void clear()
Definition: intersectionlist.hh:290
│ │ │ │ -
std::size_t size() const override
Definition: intersectionlist.hh:269
│ │ │ │ -
FieldVector< double, dim1 > Local1
Definition: intersectionlist.hh:213
│ │ │ │ -
std::size_t parents1(Index intersection) const override
Definition: intersectionlist.hh:275
│ │ │ │ -
Index parent0(Index intersection, unsigned index) const override
Definition: intersectionlist.hh:278
│ │ │ │ -
std::size_t parents0(Index intersection) const override
Definition: intersectionlist.hh:272
│ │ │ │ - │ │ │ │ -
SimplicialIntersection(Index parent0, Index parent1)
Definition: intersectionlist.hh:229
│ │ │ │ -
std::array< Local< I >, nVertices > Corners
Definition: intersectionlist.hh:238
│ │ │ │ -
std::vector< Index > parents1
Definition: intersectionlist.hh:258
│ │ │ │ -
std::vector< Index > parents0
Definition: intersectionlist.hh:248
│ │ │ │ -
std::vector< Corners< 1 > > corners1
Definition: intersectionlist.hh:253
│ │ │ │ - │ │ │ │ -
std::vector< Corners< 0 > > corners0
Definition: intersectionlist.hh:243
│ │ │ │ +
IteratorRange<... > intersections(const GridGlue<... > &glue, const Reverse<... > &reverse=!reversed)
Iterate over all intersections of a GridGlue.
│ │ │ │ +
Implementation of the Merger concept for conforming interfaces.
Definition: conformingmerge.hh:49
│ │ │ │ +
Dune::FieldVector< T, dim > LocalCoords
the coordinate type used in this interface
Definition: conformingmerge.hh:62
│ │ │ │ +
Dune::FieldVector< T, dimworld > WorldCoords
the coordinate type used in this interface
Definition: conformingmerge.hh:59
│ │ │ │ +
static constexpr T default_tolerance
Definition: conformingmerge.hh:89
│ │ │ │ +
T ctype
the numeric type used in this interface
Definition: conformingmerge.hh:56
│ │ │ │ +
ConformingMerge(T tolerance=default_tolerance)
Definition: conformingmerge.hh:91
│ │ │ │ +
Common base class for many merger implementations: produce pairs of entities that may intersect.
Definition: standardmerge.hh:58
│ │ │ │ +
typename IntersectionListProvider::SimplicialIntersection SimplicialIntersection
Definition: standardmerge.hh:83
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,358 +5,254 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * merging │ │ │ │ │ -intersectionlist.hh │ │ │ │ │ +conformingmerge.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ - 1// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see 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 © DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ - 2// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only- │ │ │ │ │ + 4// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only- │ │ │ │ │ with-dune-grid-glue-exception │ │ │ │ │ - 3#ifndef DUNE_GRIDGLUE_MERGING_INTERSECTIONLIST_HH │ │ │ │ │ - 4#define DUNE_GRIDGLUE_MERGING_INTERSECTIONLIST_HH 1 │ │ │ │ │ - 5 │ │ │ │ │ - 6#include │ │ │ │ │ - 7#include │ │ │ │ │ - 8#include │ │ │ │ │ - 9#include │ │ │ │ │ - 10 │ │ │ │ │ - 11#include │ │ │ │ │ - 12 │ │ │ │ │ - 13namespace Dune { │ │ │ │ │ - 14namespace GridGlue { │ │ │ │ │ - 15 │ │ │ │ │ - 20template │ │ │ │ │ -21class IntersectionListProvider │ │ │ │ │ - 22{ │ │ │ │ │ - 23public: │ │ │ │ │ - 24 │ │ │ │ │ -28 using Local0 = L0; │ │ │ │ │ - 29 │ │ │ │ │ -33 using Local1 = L1; │ │ │ │ │ - 34 │ │ │ │ │ -38 using Index = unsigned int; │ │ │ │ │ + 5/* │ │ │ │ │ + 6 * Filename: conformingmerge.hh │ │ │ │ │ + 7 * Version: 1.0 │ │ │ │ │ + 8 * Created on: Sep 14, 2009 │ │ │ │ │ + 9 * Author: Oliver Sander │ │ │ │ │ + 10 * --------------------------------- │ │ │ │ │ + 11 * Project: dune-grid-glue │ │ │ │ │ + 12 * Description: implementation of the Merger concept for conforming │ │ │ │ │ +interfaces │ │ │ │ │ + 13 * │ │ │ │ │ + 14 */ │ │ │ │ │ + 21#ifndef DUNE_GRIDGLUE_MERGING_CONFORMINGMERGE_HH │ │ │ │ │ + 22#define DUNE_GRIDGLUE_MERGING_CONFORMINGMERGE_HH │ │ │ │ │ + 23 │ │ │ │ │ + 24#include │ │ │ │ │ + 25#include │ │ │ │ │ + 26#include │ │ │ │ │ + 27#include │ │ │ │ │ + 28 │ │ │ │ │ + 29#include │ │ │ │ │ + 30#include │ │ │ │ │ + 31 │ │ │ │ │ + 32#include │ │ │ │ │ + 33 │ │ │ │ │ + 34#include │ │ │ │ │ + 35 │ │ │ │ │ + 36namespace Dune { │ │ │ │ │ + 37 │ │ │ │ │ + 38 namespace GridGlue { │ │ │ │ │ 39 │ │ │ │ │ -43 virtual std::size_t size() const = 0; │ │ │ │ │ - 44 │ │ │ │ │ -50 virtual std::size_t parents0(Index intersection) const = 0; │ │ │ │ │ - 51 │ │ │ │ │ -57 virtual std::size_t parents1(Index intersection) const = 0; │ │ │ │ │ - 58 │ │ │ │ │ -65 virtual Index parent0(Index intersection, unsigned index) const = 0; │ │ │ │ │ - 66 │ │ │ │ │ -73 virtual Index parent1(Index intersection, unsigned index) const = 0; │ │ │ │ │ - 74 │ │ │ │ │ -82 virtual Local0 corner0(Index intersection, unsigned corner, unsigned index) │ │ │ │ │ -const = 0; │ │ │ │ │ - 83 │ │ │ │ │ -91 virtual Local1 corner1(Index intersection, unsigned corner, unsigned index) │ │ │ │ │ -const = 0; │ │ │ │ │ - 92}; │ │ │ │ │ - 93 │ │ │ │ │ - 94namespace Impl { │ │ │ │ │ + 46template │ │ │ │ │ +47class ConformingMerge │ │ │ │ │ + 48 : public StandardMerge │ │ │ │ │ + 49{ │ │ │ │ │ + 50 │ │ │ │ │ + 51public: │ │ │ │ │ + 52 │ │ │ │ │ + 53 /* E X P O R T E D T Y P E S A N D C O N S T A N T S */ │ │ │ │ │ + 54 │ │ │ │ │ +56 typedef T ctype; │ │ │ │ │ + 57 │ │ │ │ │ +59 typedef Dune::FieldVector WorldCoords; │ │ │ │ │ + 60 │ │ │ │ │ +62 typedef Dune::FieldVector LocalCoords; │ │ │ │ │ + 63 │ │ │ │ │ + 64private: │ │ │ │ │ + 65 │ │ │ │ │ + 66 /* M E M B E R V A R I A B L E S */ │ │ │ │ │ + 67 │ │ │ │ │ + 69 T tolerance_; │ │ │ │ │ + 70 │ │ │ │ │ + 71 typedef typename StandardMerge::SimplicialIntersection │ │ │ │ │ +SimplicialIntersection; │ │ │ │ │ + 72 │ │ │ │ │ + 77 void computeIntersections(const Dune::GeometryType& grid1ElementType, │ │ │ │ │ + 78 const std::vector >& grid1ElementCorners, │ │ │ │ │ + 79 std::bitset<(1<& neighborIntersects1, │ │ │ │ │ + 80 unsigned int grid1Index, │ │ │ │ │ + 81 const Dune::GeometryType& grid2ElementType, │ │ │ │ │ + 82 const std::vector >& grid2ElementCorners, │ │ │ │ │ + 83 std::bitset<(1<& neighborIntersects2, │ │ │ │ │ + 84 unsigned int grid2Index, │ │ │ │ │ + 85 std::vector& intersections); │ │ │ │ │ + 86 │ │ │ │ │ + 87public: │ │ │ │ │ + 88 │ │ │ │ │ +89 static constexpr T default_tolerance = 1e-4; │ │ │ │ │ + 90 │ │ │ │ │ +91 ConformingMerge(T tolerance = default_tolerance) : │ │ │ │ │ + 92 tolerance_(tolerance) │ │ │ │ │ + 93 {} │ │ │ │ │ + 94}; │ │ │ │ │ 95 │ │ │ │ │ - 96template │ │ │ │ │ - 97struct IntersectionListLocal │ │ │ │ │ - 98{}; │ │ │ │ │ - 99 │ │ │ │ │ - 100template │ │ │ │ │ - 101struct IntersectionListLocal │ │ │ │ │ - 102{ │ │ │ │ │ - 103 static std::size_t parents(const P& p, typename P::Index intersection) │ │ │ │ │ - 104 { return p.parents0(intersection); } │ │ │ │ │ - 105 │ │ │ │ │ - 106 static typename P::Index parent(const P& p, typename P::Index │ │ │ │ │ -intersection, unsigned index) │ │ │ │ │ - 107 { return p.parent0(intersection, index); } │ │ │ │ │ - 108 │ │ │ │ │ - 109 static typename P::Local0 corner(const P& p, typename P::Index │ │ │ │ │ -intersection, unsigned corner, unsigned index) │ │ │ │ │ - 110 { return p.corner0(intersection, corner, index); } │ │ │ │ │ - 111}; │ │ │ │ │ - 112 │ │ │ │ │ - 113template │ │ │ │ │ - 114struct IntersectionListLocal │ │ │ │ │ - 115{ │ │ │ │ │ - 116 static std::size_t parents(const P& p, typename P::Index intersection) │ │ │ │ │ - 117 { return p.parents1(intersection); } │ │ │ │ │ + 96template │ │ │ │ │ + 97constexpr T ConformingMerge::default_tolerance; │ │ │ │ │ + 98 │ │ │ │ │ + 99template │ │ │ │ │ + 100void ConformingMerge::computeIntersections(const Dune:: │ │ │ │ │ +GeometryType& grid1ElementType, │ │ │ │ │ + 101 const std::vector >& grid1ElementCorners, │ │ │ │ │ + 102 std::bitset<(1<& neighborIntersects1, │ │ │ │ │ + 103 unsigned int grid1Index, │ │ │ │ │ + 104 const Dune::GeometryType& grid2ElementType, │ │ │ │ │ + 105 const std::vector >& grid2ElementCorners, │ │ │ │ │ + 106 std::bitset<(1<& neighborIntersects2, │ │ │ │ │ + 107 unsigned int grid2Index, │ │ │ │ │ + 108 std::vector& intersections) │ │ │ │ │ + 109{ │ │ │ │ │ + 110 this->counter++; │ │ │ │ │ + 111 │ │ │ │ │ + 112 // A few consistency checks │ │ │ │ │ + 113 assert((unsigned int)(Dune::ReferenceElements::general │ │ │ │ │ +(grid1ElementType).size(dim)) == grid1ElementCorners.size()); │ │ │ │ │ + 114 assert((unsigned int)(Dune::ReferenceElements::general │ │ │ │ │ +(grid2ElementType).size(dim)) == grid2ElementCorners.size()); │ │ │ │ │ + 115 // any intersection we may find will be the entire elements. │ │ │ │ │ + 116 neighborIntersects1.reset(); │ │ │ │ │ + 117 neighborIntersects2.reset(); │ │ │ │ │ 118 │ │ │ │ │ - 119 static typename P::Index parent(const P& p, typename P::Index │ │ │ │ │ -intersection, unsigned index) │ │ │ │ │ - 120 { return p.parent1(intersection, index); } │ │ │ │ │ - 121 │ │ │ │ │ - 122 static typename P::Local1 corner(const P& p, typename P::Index │ │ │ │ │ -intersection, unsigned corner, unsigned index) │ │ │ │ │ - 123 { return p.corner1(intersection, corner, index); } │ │ │ │ │ - 124}; │ │ │ │ │ - 125 │ │ │ │ │ - 126} /* namespace Impl */ │ │ │ │ │ + 119 // the intersection is either conforming or empty, hence the GeometryTypes │ │ │ │ │ +have to match │ │ │ │ │ + 120 if (grid1ElementType != grid2ElementType) │ │ │ │ │ + 121 return; │ │ │ │ │ + 122 │ │ │ │ │ + 123 // //////////////////////////////////////////////////////////// │ │ │ │ │ + 124 // Find correspondences between the different corners │ │ │ │ │ + 125 // //////////////////////////////////////////////////////////// │ │ │ │ │ + 126 std::vector other(grid1ElementCorners.size(), -1); │ │ │ │ │ 127 │ │ │ │ │ - 132template │ │ │ │ │ -133class IntersectionList │ │ │ │ │ - 134{ │ │ │ │ │ - 135public: │ │ │ │ │ -136 using Provider = IntersectionListProvider; │ │ │ │ │ -137 using Index = typename Provider::Index; │ │ │ │ │ + 128 for (unsigned int i=0; i& provider) │ │ │ │ │ - 140 : impl_(provider) │ │ │ │ │ - 141 {} │ │ │ │ │ - 142 │ │ │ │ │ -146 std::size_t size() const │ │ │ │ │ - 147 { return impl_->size(); } │ │ │ │ │ - 148 │ │ │ │ │ - 155 template │ │ │ │ │ -156 std::size_t parents(Index intersection) const │ │ │ │ │ - 157 { │ │ │ │ │ - 158 static_assert(I == 0 or I == 1, "I must be 0 or 1"); │ │ │ │ │ - 159 // TODO [C++17]: use `if constexpr` instead of indirection │ │ │ │ │ - 160 return Impl::IntersectionListLocal::parents(*impl_, │ │ │ │ │ -intersection); │ │ │ │ │ + 139 } │ │ │ │ │ + 140 │ │ │ │ │ + 141 // No corresponding grid2 vertex found for this grid1 vertex │ │ │ │ │ + 142 if (other[i] == -1) │ │ │ │ │ + 143 return; │ │ │ │ │ + 144 │ │ │ │ │ + 145 } │ │ │ │ │ + 146 │ │ │ │ │ + 147 // //////////////////////////////////////////////////////////// │ │ │ │ │ + 148 // Set up the new remote intersection │ │ │ │ │ + 149 // //////////////////////////////////////////////////////////// │ │ │ │ │ + 150 │ │ │ │ │ + 151 const auto& refElement = Dune::ReferenceElements::general │ │ │ │ │ +(grid1ElementType); │ │ │ │ │ + 152 │ │ │ │ │ + 154 if (grid1ElementType.isSimplex()) { │ │ │ │ │ + 155 │ │ │ │ │ + 156 intersections.emplace_back(grid1Index, grid2Index); │ │ │ │ │ + 157 │ │ │ │ │ + 158 for (int i=0; i │ │ │ │ │ -171 Index parent(Index intersection, unsigned index = 0) const │ │ │ │ │ - 172 { │ │ │ │ │ - 173 static_assert(I == 0 or I == 1, "I must be 0 or 1"); │ │ │ │ │ - 174 // TODO [C++17]: use `if constexpr` instead of indirection │ │ │ │ │ - 175 return Impl::IntersectionListLocal::parent(*impl_, │ │ │ │ │ -intersection, index); │ │ │ │ │ - 176 } │ │ │ │ │ - 177 │ │ │ │ │ - 186 template │ │ │ │ │ -187 auto corner(Index intersection, unsigned corner, unsigned index = 0) const │ │ │ │ │ - 188 { │ │ │ │ │ - 189 static_assert(I == 0 or I == 1, "I must be 0 or 1"); │ │ │ │ │ - 190 // TODO [C++17]: use `if constexpr` instead of indirection │ │ │ │ │ - 191 return Impl::IntersectionListLocal::corner(*impl_, │ │ │ │ │ -intersection, corner, index); │ │ │ │ │ - 192 } │ │ │ │ │ - 193 │ │ │ │ │ - 194private: │ │ │ │ │ - 195 std::shared_ptr impl_; │ │ │ │ │ - 196}; │ │ │ │ │ + 163 } else if (dim == 2 && grid1ElementType.isQuadrilateral()) { │ │ │ │ │ + 164 │ │ │ │ │ + 165 // split the quadrilateral into two triangles │ │ │ │ │ + 166 const unsigned int subVertices[2][3] = {{0,1,3}, {0,3,2}}; │ │ │ │ │ + 167 │ │ │ │ │ + 168 for (int i=0; i<2; i++) { │ │ │ │ │ + 169 │ │ │ │ │ + 170 SimplicialIntersection newSimplicialIntersection(grid1Index, grid2Index); │ │ │ │ │ + 171 │ │ │ │ │ + 172 for (int j=0; j │ │ │ │ │ -205class SimplicialIntersectionListProvider final │ │ │ │ │ - 206 : public IntersectionListProvider< FieldVector, │ │ │ │ │ -FieldVector > │ │ │ │ │ - 207{ │ │ │ │ │ - 208 using Base = IntersectionListProvider<_FieldVector, │ │ │ │ │ -FieldVector >; │ │ │ │ │ - 209 │ │ │ │ │ - 210public: │ │ │ │ │ -211 using Index = typename Base::Index; │ │ │ │ │ -212 using Local0 = FieldVector; │ │ │ │ │ -213 using Local1 = FieldVector; │ │ │ │ │ - 214 │ │ │ │ │ - 215 template │ │ │ │ │ -216 using Local = std::conditional_t< I == 0, Local0, Local1 >; │ │ │ │ │ - 217 │ │ │ │ │ -221 struct SimplicialIntersection │ │ │ │ │ - 222 { │ │ │ │ │ - 223 private: │ │ │ │ │ - 224 static constexpr int intersectionDim = dim0 < dim1 ? dim0 : dim1; │ │ │ │ │ - 225 static constexpr int nVertices = intersectionDim + 1; │ │ │ │ │ - 226 │ │ │ │ │ - 227 public: │ │ │ │ │ -228 SimplicialIntersection() = default; │ │ │ │ │ -229 SimplicialIntersection(Index parent0, Index parent1) │ │ │ │ │ - 230 : parents0{parent0} │ │ │ │ │ - 231 , parents1{parent1} │ │ │ │ │ - 232 {} │ │ │ │ │ - 233 │ │ │ │ │ - 237 template │ │ │ │ │ -238 using Corners = std::array, nVertices>; │ │ │ │ │ - 239 │ │ │ │ │ -243 std::vector< Corners<0> > corners0 = std::vector< Corners<0> >(1); │ │ │ │ │ - 244 │ │ │ │ │ -248 std::vector< Index > parents0 = std::vector< Index >(1); │ │ │ │ │ - 249 │ │ │ │ │ -253 std::vector< Corners<1> > corners1 = std::vector< Corners<1> >(1); │ │ │ │ │ - 254 │ │ │ │ │ -258 std::vector< Index > parents1 = std::vector< Index >(1); │ │ │ │ │ - 259 }; │ │ │ │ │ - 260 │ │ │ │ │ -261 SimplicialIntersectionListProvider() = default; │ │ │ │ │ -262 SimplicialIntersectionListProvider(std::vector&& │ │ │ │ │ -intersections) │ │ │ │ │ - 263 : intersections_(std::move(intersections)) │ │ │ │ │ - 264 {} │ │ │ │ │ - 265 │ │ │ │ │ -266 auto& intersections() │ │ │ │ │ - 267 { return intersections_; } │ │ │ │ │ - 268 │ │ │ │ │ -269 std::size_t size() const override │ │ │ │ │ - 270 { return intersections_.size(); } │ │ │ │ │ - 271 │ │ │ │ │ -272 std::size_t parents0(Index intersection) const override │ │ │ │ │ - 273 { return intersections_[intersection].parents0.size(); } │ │ │ │ │ - 274 │ │ │ │ │ -275 std::size_t parents1(Index intersection) const override │ │ │ │ │ - 276 { return intersections_[intersection].parents1.size(); } │ │ │ │ │ - 277 │ │ │ │ │ -278 Index parent0(Index intersection, unsigned index) const override │ │ │ │ │ - 279 { return intersections_[intersection].parents0[index]; } │ │ │ │ │ - 280 │ │ │ │ │ -281 Index parent1(Index intersection, unsigned index) const override │ │ │ │ │ - 282 { return intersections_[intersection].parents1[index]; } │ │ │ │ │ - 283 │ │ │ │ │ -284 Local0 corner0(Index intersection, unsigned corner, unsigned index) const │ │ │ │ │ -override │ │ │ │ │ - 285 { return intersections_[intersection].corners0[index][corner]; } │ │ │ │ │ - 286 │ │ │ │ │ -287 Local1 corner1(Index intersection, unsigned corner, unsigned index) const │ │ │ │ │ -override │ │ │ │ │ - 288 { return intersections_[intersection].corners1[index][corner]; } │ │ │ │ │ - 289 │ │ │ │ │ -290 void clear() │ │ │ │ │ - 291 { │ │ │ │ │ - 292 intersections_.clear(); │ │ │ │ │ - 293 } │ │ │ │ │ - 294 │ │ │ │ │ - 295private: │ │ │ │ │ - 296 std::vector intersections_; │ │ │ │ │ - 297}; │ │ │ │ │ - 298 │ │ │ │ │ - 299} /* namespace GridGlue */ │ │ │ │ │ - 300} /* namespace Dune */ │ │ │ │ │ - 301 │ │ │ │ │ - 302#endif │ │ │ │ │ + 198 } │ │ │ │ │ + 199 │ │ │ │ │ + 200 } else │ │ │ │ │ + 201 DUNE_THROW(Dune::GridError, "Unsupported element type"); │ │ │ │ │ + 202 │ │ │ │ │ + 203} │ │ │ │ │ + 204 │ │ │ │ │ + 205} // namespace GridGlue │ │ │ │ │ + 206 │ │ │ │ │ + 207} // namespace Dune │ │ │ │ │ + 208 │ │ │ │ │ + 209#endif // DUNE_GRIDGLUE_MERGING_CONFORMINGMERGE_HH │ │ │ │ │ +standardmerge.hh │ │ │ │ │ +Common base class for many merger implementations: produce pairs of entities │ │ │ │ │ +that may intersect. │ │ │ │ │ Dune │ │ │ │ │ Definition: gridglue.hh:37 │ │ │ │ │ -Dune::GridGlue::ProjectionImplementation::corner │ │ │ │ │ -Coordinate corner(unsigned c) │ │ │ │ │ -Definition: projection_impl.hh:24 │ │ │ │ │ -Dune::GridGlue::IntersectionListProvider │ │ │ │ │ -Definition: intersectionlist.hh:22 │ │ │ │ │ -Dune::GridGlue::IntersectionListProvider::parents0 │ │ │ │ │ -virtual std::size_t parents0(Index intersection) const =0 │ │ │ │ │ -Dune::GridGlue::IntersectionListProvider::corner1 │ │ │ │ │ -virtual Local1 corner1(Index intersection, unsigned corner, unsigned index) │ │ │ │ │ -const =0 │ │ │ │ │ -Dune::GridGlue::IntersectionListProvider::Index │ │ │ │ │ -unsigned int Index │ │ │ │ │ -Definition: intersectionlist.hh:38 │ │ │ │ │ -Dune::GridGlue::IntersectionListProvider::size │ │ │ │ │ -virtual std::size_t size() const =0 │ │ │ │ │ -Dune::GridGlue::IntersectionListProvider::Local0 │ │ │ │ │ -L0 Local0 │ │ │ │ │ -Definition: intersectionlist.hh:28 │ │ │ │ │ -Dune::GridGlue::IntersectionListProvider::corner0 │ │ │ │ │ -virtual Local0 corner0(Index intersection, unsigned corner, unsigned index) │ │ │ │ │ -const =0 │ │ │ │ │ -Dune::GridGlue::IntersectionListProvider::Local1 │ │ │ │ │ -L1 Local1 │ │ │ │ │ -Definition: intersectionlist.hh:33 │ │ │ │ │ -Dune::GridGlue::IntersectionListProvider::parent1 │ │ │ │ │ -virtual Index parent1(Index intersection, unsigned index) const =0 │ │ │ │ │ -Dune::GridGlue::IntersectionListProvider::parents1 │ │ │ │ │ -virtual std::size_t parents1(Index intersection) const =0 │ │ │ │ │ -Dune::GridGlue::IntersectionListProvider::parent0 │ │ │ │ │ -virtual Index parent0(Index intersection, unsigned index) const =0 │ │ │ │ │ -Dune::GridGlue::IntersectionList │ │ │ │ │ -Definition: intersectionlist.hh:134 │ │ │ │ │ -Dune::GridGlue::IntersectionList::parent │ │ │ │ │ -Index parent(Index intersection, unsigned index=0) const │ │ │ │ │ -Definition: intersectionlist.hh:171 │ │ │ │ │ -Dune::GridGlue::IntersectionList::corner │ │ │ │ │ -auto corner(Index intersection, unsigned corner, unsigned index=0) const │ │ │ │ │ -Definition: intersectionlist.hh:187 │ │ │ │ │ -Dune::GridGlue::IntersectionList::Index │ │ │ │ │ -typename Provider::Index Index │ │ │ │ │ -Definition: intersectionlist.hh:137 │ │ │ │ │ -Dune::GridGlue::IntersectionList::IntersectionList │ │ │ │ │ -IntersectionList(const std::shared_ptr< Provider > &provider) │ │ │ │ │ -Definition: intersectionlist.hh:139 │ │ │ │ │ -Dune::GridGlue::IntersectionList::parents │ │ │ │ │ -std::size_t parents(Index intersection) const │ │ │ │ │ -Definition: intersectionlist.hh:156 │ │ │ │ │ -Dune::GridGlue::IntersectionList::size │ │ │ │ │ -std::size_t size() const │ │ │ │ │ -Definition: intersectionlist.hh:146 │ │ │ │ │ -Dune::GridGlue::SimplicialIntersectionListProvider │ │ │ │ │ -Definition: intersectionlist.hh:207 │ │ │ │ │ -Dune::GridGlue::SimplicialIntersectionListProvider::Local0 │ │ │ │ │ -FieldVector< double, dim0 > Local0 │ │ │ │ │ -Definition: intersectionlist.hh:212 │ │ │ │ │ -Dune::GridGlue::SimplicialIntersectionListProvider::intersections │ │ │ │ │ -auto & intersections() │ │ │ │ │ -Definition: intersectionlist.hh:266 │ │ │ │ │ -Dune::GridGlue::SimplicialIntersectionListProvider:: │ │ │ │ │ -SimplicialIntersectionListProvider │ │ │ │ │ -SimplicialIntersectionListProvider(std::vector< SimplicialIntersection > │ │ │ │ │ -&&intersections) │ │ │ │ │ -Definition: intersectionlist.hh:262 │ │ │ │ │ -Dune::GridGlue::SimplicialIntersectionListProvider::corner1 │ │ │ │ │ -Local1 corner1(Index intersection, unsigned corner, unsigned index) const │ │ │ │ │ -override │ │ │ │ │ -Definition: intersectionlist.hh:287 │ │ │ │ │ -Dune::GridGlue::SimplicialIntersectionListProvider::corner0 │ │ │ │ │ -Local0 corner0(Index intersection, unsigned corner, unsigned index) const │ │ │ │ │ -override │ │ │ │ │ -Definition: intersectionlist.hh:284 │ │ │ │ │ -Dune::GridGlue::SimplicialIntersectionListProvider::parent1 │ │ │ │ │ -Index parent1(Index intersection, unsigned index) const override │ │ │ │ │ -Definition: intersectionlist.hh:281 │ │ │ │ │ -Dune::GridGlue::SimplicialIntersectionListProvider::Index │ │ │ │ │ -typename Base::Index Index │ │ │ │ │ -Definition: intersectionlist.hh:211 │ │ │ │ │ -Dune::GridGlue::SimplicialIntersectionListProvider::Local │ │ │ │ │ -std::conditional_t< I==0, Local0, Local1 > Local │ │ │ │ │ -Definition: intersectionlist.hh:216 │ │ │ │ │ -Dune::GridGlue::SimplicialIntersectionListProvider:: │ │ │ │ │ -SimplicialIntersectionListProvider │ │ │ │ │ -SimplicialIntersectionListProvider()=default │ │ │ │ │ -Dune::GridGlue::SimplicialIntersectionListProvider::clear │ │ │ │ │ -void clear() │ │ │ │ │ -Definition: intersectionlist.hh:290 │ │ │ │ │ -Dune::GridGlue::SimplicialIntersectionListProvider::size │ │ │ │ │ -std::size_t size() const override │ │ │ │ │ -Definition: intersectionlist.hh:269 │ │ │ │ │ -Dune::GridGlue::SimplicialIntersectionListProvider::Local1 │ │ │ │ │ -FieldVector< double, dim1 > Local1 │ │ │ │ │ -Definition: intersectionlist.hh:213 │ │ │ │ │ -Dune::GridGlue::SimplicialIntersectionListProvider::parents1 │ │ │ │ │ -std::size_t parents1(Index intersection) const override │ │ │ │ │ -Definition: intersectionlist.hh:275 │ │ │ │ │ -Dune::GridGlue::SimplicialIntersectionListProvider::parent0 │ │ │ │ │ -Index parent0(Index intersection, unsigned index) const override │ │ │ │ │ -Definition: intersectionlist.hh:278 │ │ │ │ │ -Dune::GridGlue::SimplicialIntersectionListProvider::parents0 │ │ │ │ │ -std::size_t parents0(Index intersection) const override │ │ │ │ │ -Definition: intersectionlist.hh:272 │ │ │ │ │ -Dune::GridGlue::SimplicialIntersectionListProvider::SimplicialIntersection │ │ │ │ │ -Definition: intersectionlist.hh:222 │ │ │ │ │ -Dune::GridGlue::SimplicialIntersectionListProvider::SimplicialIntersection:: │ │ │ │ │ +Dune::GridGlue::intersections │ │ │ │ │ +IteratorRange<... > intersections(const GridGlue<... > &glue, const Reverse<... │ │ │ │ │ +> &reverse=!reversed) │ │ │ │ │ +Iterate over all intersections of a GridGlue. │ │ │ │ │ +Dune::GridGlue::ConformingMerge │ │ │ │ │ +Implementation of the Merger concept for conforming interfaces. │ │ │ │ │ +Definition: conformingmerge.hh:49 │ │ │ │ │ +Dune::GridGlue::ConformingMerge::LocalCoords │ │ │ │ │ +Dune::FieldVector< T, dim > LocalCoords │ │ │ │ │ +the coordinate type used in this interface │ │ │ │ │ +Definition: conformingmerge.hh:62 │ │ │ │ │ +Dune::GridGlue::ConformingMerge::WorldCoords │ │ │ │ │ +Dune::FieldVector< T, dimworld > WorldCoords │ │ │ │ │ +the coordinate type used in this interface │ │ │ │ │ +Definition: conformingmerge.hh:59 │ │ │ │ │ +Dune::GridGlue::ConformingMerge::default_tolerance │ │ │ │ │ +static constexpr T default_tolerance │ │ │ │ │ +Definition: conformingmerge.hh:89 │ │ │ │ │ +Dune::GridGlue::ConformingMerge::ctype │ │ │ │ │ +T ctype │ │ │ │ │ +the numeric type used in this interface │ │ │ │ │ +Definition: conformingmerge.hh:56 │ │ │ │ │ +Dune::GridGlue::ConformingMerge::ConformingMerge │ │ │ │ │ +ConformingMerge(T tolerance=default_tolerance) │ │ │ │ │ +Definition: conformingmerge.hh:91 │ │ │ │ │ +Dune::GridGlue::StandardMerge │ │ │ │ │ +Common base class for many merger implementations: produce pairs of entities │ │ │ │ │ +that may intersect. │ │ │ │ │ +Definition: standardmerge.hh:58 │ │ │ │ │ +Dune::GridGlue::StandardMerge::SimplicialIntersection │ │ │ │ │ +typename IntersectionListProvider::SimplicialIntersection │ │ │ │ │ SimplicialIntersection │ │ │ │ │ -SimplicialIntersection(Index parent0, Index parent1) │ │ │ │ │ -Definition: intersectionlist.hh:229 │ │ │ │ │ -Dune::GridGlue::SimplicialIntersectionListProvider::SimplicialIntersection:: │ │ │ │ │ -Corners │ │ │ │ │ -std::array< Local< I >, nVertices > Corners │ │ │ │ │ -Definition: intersectionlist.hh:238 │ │ │ │ │ -Dune::GridGlue::SimplicialIntersectionListProvider::SimplicialIntersection:: │ │ │ │ │ -parents1 │ │ │ │ │ -std::vector< Index > parents1 │ │ │ │ │ -Definition: intersectionlist.hh:258 │ │ │ │ │ -Dune::GridGlue::SimplicialIntersectionListProvider::SimplicialIntersection:: │ │ │ │ │ -parents0 │ │ │ │ │ -std::vector< Index > parents0 │ │ │ │ │ -Definition: intersectionlist.hh:248 │ │ │ │ │ -Dune::GridGlue::SimplicialIntersectionListProvider::SimplicialIntersection:: │ │ │ │ │ -corners1 │ │ │ │ │ -std::vector< Corners< 1 > > corners1 │ │ │ │ │ -Definition: intersectionlist.hh:253 │ │ │ │ │ -Dune::GridGlue::SimplicialIntersectionListProvider::SimplicialIntersection:: │ │ │ │ │ -SimplicialIntersection │ │ │ │ │ -SimplicialIntersection()=default │ │ │ │ │ -Dune::GridGlue::SimplicialIntersectionListProvider::SimplicialIntersection:: │ │ │ │ │ -corners0 │ │ │ │ │ -std::vector< Corners< 0 > > corners0 │ │ │ │ │ -Definition: intersectionlist.hh:243 │ │ │ │ │ +Definition: standardmerge.hh:83 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00071.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: contactmerge.hh File Reference │ │ │ │ +dune-grid-glue: overlappingmerge.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -65,54 +65,45 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces
│ │ │ │ -
contactmerge.hh File Reference
│ │ │ │ +
overlappingmerge.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ - │ │ │ │ -

Merge two grid boundary surfaces that may be a positive distance apart. │ │ │ │ -More...

│ │ │ │
#include <iostream>
│ │ │ │ -#include <fstream>
│ │ │ │ #include <iomanip>
│ │ │ │ #include <vector>
│ │ │ │ #include <algorithm>
│ │ │ │ -#include <limits>
│ │ │ │ -#include <memory>
│ │ │ │ -#include <functional>
│ │ │ │ +#include <dune/common/fmatrix.hh>
│ │ │ │ #include <dune/common/fvector.hh>
│ │ │ │ -#include <dune/common/exceptions.hh>
│ │ │ │ -#include <dune/common/bitsetvector.hh>
│ │ │ │ -#include <dune/common/deprecated.hh>
│ │ │ │ +#include <dune/geometry/referenceelements.hh>
│ │ │ │ +#include <dune/geometry/multilineargeometry.hh>
│ │ │ │ #include <dune/grid/common/grid.hh>
│ │ │ │ -#include <dune/grid-glue/merging/standardmerge.hh>
│ │ │ │ -#include <dune/grid-glue/gridglue.hh>
│ │ │ │ -#include "contactmerge.cc"
│ │ │ │ +#include <dune/grid-glue/merging/standardmerge.hh>
│ │ │ │ +#include <dune/grid-glue/merging/computeintersection.hh>
│ │ │ │ +#include "overlappingmerge.cc"
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::GridGlue::ContactMerge< dimworld, T >
 Merge two codimension-1 surfaces that may be a positive distance apart. More...
class  Dune::GridGlue::OverlappingMerge< dim1, dim2, dimworld, T >
 Computing overlapping grid intersections for grids of different dimensions. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
│ │ │ │ -

Detailed Description

│ │ │ │ -

Merge two grid boundary surfaces that may be a positive distance apart.

│ │ │ │ -
│ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -6,41 +6,34 @@ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * merging │ │ │ │ │ Classes | Namespaces │ │ │ │ │ -contactmerge.hh File Reference │ │ │ │ │ -Merge two grid boundary surfaces that may be a positive distance apart. More... │ │ │ │ │ +overlappingmerge.hh File Reference │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ #include │ │ │ │ │ #include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include "contactmerge.cc" │ │ │ │ │ +#include │ │ │ │ │ +#include "overlappingmerge.cc" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  Dune::GridGlue::ContactMerge<_dimworld,_T_> │ │ │ │ │ -  Merge two codimension-1 surfaces that may be a positive distance apart. │ │ │ │ │ - More... │ │ │ │ │ +class  Dune::GridGlue::OverlappingMerge<_dim1,_dim2,_dimworld,_T_> │ │ │ │ │ +  Computing overlapping grid intersections for grids of different │ │ │ │ │ + dimensions. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::GridGlue │ │ │ │ │   │ │ │ │ │ -***** Detailed Description ***** │ │ │ │ │ -Merge two grid boundary surfaces that may be a positive distance apart. │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00071_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: contactmerge.hh Source File │ │ │ │ +dune-grid-glue: overlappingmerge.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,217 +62,98 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
contactmerge.hh
│ │ │ │ +
overlappingmerge.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 © DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
4// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
│ │ │ │ -
10#ifndef DUNE_GRIDGLUE_MERGING_CONTACTMERGE_HH
│ │ │ │ -
11#define DUNE_GRIDGLUE_MERGING_CONTACTMERGE_HH
│ │ │ │ +
5#ifndef DUNE_GRIDGLUE_MERGING_OVERLAPPINGMERGE_HH
│ │ │ │ +
6#define DUNE_GRIDGLUE_MERGING_OVERLAPPINGMERGE_HH
│ │ │ │ +
7
│ │ │ │ +
8#include <iostream>
│ │ │ │ +
9#include <iomanip>
│ │ │ │ +
10#include <vector>
│ │ │ │ +
11#include <algorithm>
│ │ │ │
12
│ │ │ │ -
13
│ │ │ │ -
14#include <iostream>
│ │ │ │ -
15#include <fstream>
│ │ │ │ -
16#include <iomanip>
│ │ │ │ -
17#include <vector>
│ │ │ │ -
18#include <algorithm>
│ │ │ │ -
19#include <limits>
│ │ │ │ -
20#include <memory>
│ │ │ │ -
21#include <functional>
│ │ │ │ -
22
│ │ │ │ -
23#include <dune/common/fvector.hh>
│ │ │ │ -
24#include <dune/common/exceptions.hh>
│ │ │ │ -
25#include <dune/common/bitsetvector.hh>
│ │ │ │ -
26#include <dune/common/deprecated.hh>
│ │ │ │ -
27
│ │ │ │ -
28#include <dune/grid/common/grid.hh>
│ │ │ │ -
29
│ │ │ │ - │ │ │ │ - │ │ │ │ -
32
│ │ │ │ -
33namespace Dune {
│ │ │ │ -
34namespace GridGlue {
│ │ │ │ -
35
│ │ │ │ -
41template<int dimworld, typename T = double>
│ │ │ │ - │ │ │ │ -
43: public StandardMerge<T,dimworld-1,dimworld-1,dimworld>
│ │ │ │ -
44{
│ │ │ │ -
45 static constexpr int dim = dimworld-1;
│ │ │ │ -
46
│ │ │ │ -
47 static_assert( dim==1 || dim==2,
│ │ │ │ -
48 "ContactMerge yet only handles the cases dim==1 and dim==2!");
│ │ │ │ -
49
│ │ │ │ - │ │ │ │ -
51public:
│ │ │ │ -
52
│ │ │ │ -
53 /* E X P O R T E D T Y P E S A N D C O N S T A N T S */
│ │ │ │ +
13#include <dune/common/fmatrix.hh>
│ │ │ │ +
14#include <dune/common/fvector.hh>
│ │ │ │ +
15
│ │ │ │ +
16#include <dune/geometry/referenceelements.hh>
│ │ │ │ +
17#include <dune/geometry/multilineargeometry.hh>
│ │ │ │ +
18
│ │ │ │ +
19#include <dune/grid/common/grid.hh>
│ │ │ │ +
20
│ │ │ │ + │ │ │ │ + │ │ │ │ +
23
│ │ │ │ +
24namespace Dune {
│ │ │ │ +
25namespace GridGlue {
│ │ │ │ +
26
│ │ │ │ +
34template<int dim1, int dim2, int dimworld, typename T = double>
│ │ │ │ + │ │ │ │ +
36 : public StandardMerge<T,dim1,dim2,dimworld>
│ │ │ │ +
37{
│ │ │ │ +
38
│ │ │ │ +
39public:
│ │ │ │ +
40
│ │ │ │ +
41 /* E X P O R T E D T Y P E S A N D C O N S T A N T S */
│ │ │ │ +
42
│ │ │ │ +
44 typedef T ctype;
│ │ │ │ +
45
│ │ │ │ +
47 typedef Dune::FieldVector<T, dimworld> WorldCoords;
│ │ │ │ +
48
│ │ │ │ +
50 //typedef Dune::FieldVector<T, dim> LocalCoords;
│ │ │ │ +
51
│ │ │ │ + │ │ │ │ +
53 {}
│ │ │ │
54
│ │ │ │ -
56 typedef T ctype;
│ │ │ │ +
55protected:
│ │ │ │ + │ │ │ │
57
│ │ │ │ -
59 typedef Dune::FieldVector<T, dimworld> WorldCoords;
│ │ │ │ -
60
│ │ │ │ -
62 typedef Dune::FieldVector<T, dim> LocalCoords;
│ │ │ │ -
63
│ │ │ │ - │ │ │ │ -
73 ContactMerge(const T allowedOverlap=T(0),
│ │ │ │ -
74 std::function<WorldCoords(WorldCoords)> domainDirections=nullptr,
│ │ │ │ -
75 std::function<WorldCoords(WorldCoords)> targetDirections=nullptr,
│ │ │ │ - │ │ │ │ -
77 : domainDirections_(domainDirections), targetDirections_(targetDirections),
│ │ │ │ -
78 overlap_(allowedOverlap), type_(type)
│ │ │ │ -
79 {}
│ │ │ │ -
80
│ │ │ │ -
86 ContactMerge(const T allowedOverlap, ProjectionType type)
│ │ │ │ -
87 : overlap_(allowedOverlap),
│ │ │ │ -
88 type_(type)
│ │ │ │ -
89 {}
│ │ │ │ -
90
│ │ │ │ -
99 inline
│ │ │ │ -
100 void setSurfaceDirections(std::function<WorldCoords(WorldCoords)> domainDirections,
│ │ │ │ -
101 std::function<WorldCoords(WorldCoords)> targetDirections)
│ │ │ │ -
102 {
│ │ │ │ -
103 domainDirections_ = domainDirections;
│ │ │ │ -
104 targetDirections_ = targetDirections;
│ │ │ │ -
105 this->valid = false;
│ │ │ │ -
106 }
│ │ │ │ -
107
│ │ │ │ -
109 void setOverlap(T overlap)
│ │ │ │ -
110 {
│ │ │ │ -
111 overlap_ = overlap;
│ │ │ │ -
112 }
│ │ │ │ -
113
│ │ │ │ -
115 T getOverlap() const
│ │ │ │ -
116 {
│ │ │ │ -
117 return overlap_;
│ │ │ │ -
118 }
│ │ │ │ -
119
│ │ │ │ -
123 void minNormalAngle(T angle)
│ │ │ │ -
124 {
│ │ │ │ -
125 using std::cos;
│ │ │ │ -
126 maxNormalProduct_ = cos(angle);
│ │ │ │ -
127 }
│ │ │ │ -
128
│ │ │ │ - │ │ │ │ -
133 {
│ │ │ │ -
134 using std::acos;
│ │ │ │ -
135 return acos(maxNormalProduct_);
│ │ │ │ -
136 }
│ │ │ │ -
137
│ │ │ │ -
138protected:
│ │ │ │ -
139 typedef typename StandardMerge<T,dimworld-1,dimworld-1,dimworld>::SimplicialIntersection SimplicialIntersection;
│ │ │ │ -
140
│ │ │ │ -
141private:
│ │ │ │ -
145 std::function<WorldCoords(WorldCoords)> domainDirections_;
│ │ │ │ -
146 std::vector<WorldCoords> nodalDomainDirections_;
│ │ │ │ -
147
│ │ │ │ -
156 std::function<WorldCoords(WorldCoords)> targetDirections_;
│ │ │ │ -
157 std::vector<WorldCoords> nodalTargetDirections_;
│ │ │ │ -
158
│ │ │ │ -
160 T overlap_;
│ │ │ │ -
161
│ │ │ │ -
163 ProjectionType type_;
│ │ │ │ -
164
│ │ │ │ -
168 T maxNormalProduct_ = T(-0.1);
│ │ │ │ -
169
│ │ │ │ -
174 void computeIntersections(const Dune::GeometryType& grid1ElementType,
│ │ │ │ -
175 const std::vector<Dune::FieldVector<T,dimworld> >& grid1ElementCorners,
│ │ │ │ -
176 std::bitset<(1<<dim)>& neighborIntersects1,
│ │ │ │ -
177 unsigned int grid1Index,
│ │ │ │ -
178 const Dune::GeometryType& grid2ElementType,
│ │ │ │ -
179 const std::vector<Dune::FieldVector<T,dimworld> >& grid2ElementCorners,
│ │ │ │ -
180 std::bitset<(1<<dim)>& neighborIntersects2,
│ │ │ │ -
181 unsigned int grid2Index,
│ │ │ │ -
182 std::vector<SimplicialIntersection>& intersections) override;
│ │ │ │ -
183
│ │ │ │ -
187protected:
│ │ │ │ -
188 void build(const std::vector<Dune::FieldVector<T,dimworld> >& grid1Coords,
│ │ │ │ -
189 const std::vector<unsigned int>& grid1Elements,
│ │ │ │ -
190 const std::vector<Dune::GeometryType>& grid1ElementTypes,
│ │ │ │ -
191 const std::vector<Dune::FieldVector<T,dimworld> >& grid2Coords,
│ │ │ │ -
192 const std::vector<unsigned int>& grid2Elements,
│ │ │ │ -
193 const std::vector<Dune::GeometryType>& grid2ElementTypes) override
│ │ │ │ -
194 {
│ │ │ │ -
195 std::cout<<"ContactMerge building grid!\n";
│ │ │ │ -
196 // setup the nodal direction vectors
│ │ │ │ -
197 setupNodalDirections(grid1Coords, grid1Elements, grid1ElementTypes,
│ │ │ │ -
198 grid2Coords, grid2Elements, grid2ElementTypes);
│ │ │ │ -
199
│ │ │ │ -
200 Base::build(grid1Coords, grid1Elements, grid1ElementTypes,
│ │ │ │ -
201 grid2Coords, grid2Elements, grid2ElementTypes);
│ │ │ │ -
202
│ │ │ │ -
203 }
│ │ │ │ -
204
│ │ │ │ -
205private:
│ │ │ │ -
206
│ │ │ │ -
208 static LocalCoords localCornerCoords(int i, const Dune::GeometryType& gt)
│ │ │ │ -
209 {
│ │ │ │ -
210 const auto& ref = Dune::ReferenceElements<T,dim>::general(gt);
│ │ │ │ -
211 return ref.position(i,dim);
│ │ │ │ -
212 }
│ │ │ │ -
213
│ │ │ │ -
214protected:
│ │ │ │ -
215
│ │ │ │ -
217 void computeCyclicOrder(const std::vector<std::array<LocalCoords,2> >& polytopeCorners,
│ │ │ │ -
218 const LocalCoords& center, std::vector<int>& ordering) const;
│ │ │ │ -
219
│ │ │ │ -
221 void setupNodalDirections(const std::vector<WorldCoords>& coords1,
│ │ │ │ -
222 const std::vector<unsigned int>& elements1,
│ │ │ │ -
223 const std::vector<Dune::GeometryType>& elementTypes1,
│ │ │ │ -
224 const std::vector<WorldCoords>& coords2,
│ │ │ │ -
225 const std::vector<unsigned int>& elements2,
│ │ │ │ -
226 const std::vector<Dune::GeometryType>& elementTypes2);
│ │ │ │ -
227
│ │ │ │ -
229 void computeOuterNormalField(const std::vector<WorldCoords>& coords,
│ │ │ │ -
230 const std::vector<unsigned int>& elements,
│ │ │ │ -
231 const std::vector<Dune::GeometryType>& elementTypes,
│ │ │ │ -
232 std::vector<WorldCoords>& normals);
│ │ │ │ -
233
│ │ │ │ -
235 void removeDoubles(std::vector<std::array<LocalCoords,2> >& polytopeCorners);
│ │ │ │ -
236};
│ │ │ │ -
237
│ │ │ │ -
238} /* namespace GridGlue */
│ │ │ │ -
239} /* namespace Dune */
│ │ │ │ -
240
│ │ │ │ -
241#include "contactmerge.cc"
│ │ │ │ -
242
│ │ │ │ -
243#endif // DUNE_GRIDGLUE_MERGING_CONTACTMERGE_HH
│ │ │ │ -
Central component of the module implementing the coupling of two grids.
│ │ │ │ -
Common base class for many merger implementations: produce pairs of entities that may intersect.
│ │ │ │ - │ │ │ │ +
69 void computeIntersections(const Dune::GeometryType& grid1ElementType,
│ │ │ │ +
70 const std::vector<Dune::FieldVector<T,dimworld> >& grid1ElementCorners,
│ │ │ │ +
71 std::bitset<(1<<dim1)>& neighborIntersects1,
│ │ │ │ +
72 unsigned int grid1Index,
│ │ │ │ +
73 const Dune::GeometryType& grid2ElementType,
│ │ │ │ +
74 const std::vector<Dune::FieldVector<T,dimworld> >& grid2ElementCorners,
│ │ │ │ +
75 std::bitset<(1<<dim2)>& neighborIntersects2,
│ │ │ │ +
76 unsigned int grid2Index,
│ │ │ │ +
77 std::vector<SimplicialIntersection>& intersections);
│ │ │ │ +
78
│ │ │ │ +
79private:
│ │ │ │ +
80 bool inPlane(std::vector<FieldVector<T,dimworld> >& points);
│ │ │ │ +
81
│ │ │ │ +
82};
│ │ │ │ +
83
│ │ │ │ +
84} /* namespace Dune::GridGlue */
│ │ │ │ +
85} /* namespace Dune */
│ │ │ │ +
86
│ │ │ │ +
87#include "overlappingmerge.cc"
│ │ │ │ +
88
│ │ │ │ +
89
│ │ │ │ +
90#endif // DUNE_GRIDGLUE_MERGING_OVERLAPPINGMERGE_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ +
Common base class for many merger implementations: produce pairs of entities that may intersect.
│ │ │ │
Definition: gridglue.hh:37
│ │ │ │ -
Merge two codimension-1 surfaces that may be a positive distance apart.
Definition: contactmerge.hh:44
│ │ │ │ -
void computeCyclicOrder(const std::vector< std::array< LocalCoords, 2 > > &polytopeCorners, const LocalCoords &center, std::vector< int > &ordering) const
Order the corners of the intersection polytope in cyclic order.
Definition: contactmerge.cc:214
│ │ │ │ -
StandardMerge< T, dimworld-1, dimworld-1, dimworld >::SimplicialIntersection SimplicialIntersection
Definition: contactmerge.hh:139
│ │ │ │ -
void removeDoubles(std::vector< std::array< LocalCoords, 2 > > &polytopeCorners)
Remove all multiples.
Definition: contactmerge.cc:335
│ │ │ │ -
void setOverlap(T overlap)
Set the allowed overlap of the surfaces.
Definition: contactmerge.hh:109
│ │ │ │ -
Dune::FieldVector< T, dimworld > WorldCoords
the coordinate type used in this interface
Definition: contactmerge.hh:59
│ │ │ │ -
void setupNodalDirections(const std::vector< WorldCoords > &coords1, const std::vector< unsigned int > &elements1, const std::vector< Dune::GeometryType > &elementTypes1, const std::vector< WorldCoords > &coords2, const std::vector< unsigned int > &elements2, const std::vector< Dune::GeometryType > &elementTypes2)
Setup the direction vectors containing the directions for each vertex.
Definition: contactmerge.cc:269
│ │ │ │ -
void minNormalAngle(T angle)
set minimum angle in radians between normals at x and Φ(x)
Definition: contactmerge.hh:123
│ │ │ │ -
T ctype
the numeric type used in this interface
Definition: contactmerge.hh:56
│ │ │ │ -
ProjectionType
Type of the projection, closest point or outer normal projection.
Definition: contactmerge.hh:65
│ │ │ │ -
@ CLOSEST_POINT
Definition: contactmerge.hh:65
│ │ │ │ -
@ OUTER_NORMAL
Definition: contactmerge.hh:65
│ │ │ │ -
void computeOuterNormalField(const std::vector< WorldCoords > &coords, const std::vector< unsigned int > &elements, const std::vector< Dune::GeometryType > &elementTypes, std::vector< WorldCoords > &normals)
If no direction field was specified compute the outer normal field.
Definition: contactmerge.cc:296
│ │ │ │ -
T getOverlap() const
Get the allowed overlap of the surfaces.
Definition: contactmerge.hh:115
│ │ │ │ -
ContactMerge(const T allowedOverlap=T(0), std::function< WorldCoords(WorldCoords)> domainDirections=nullptr, std::function< WorldCoords(WorldCoords)> targetDirections=nullptr, ProjectionType type=OUTER_NORMAL)
Construct merger given overlap and possible projection directions.
Definition: contactmerge.hh:73
│ │ │ │ -
void setSurfaceDirections(std::function< WorldCoords(WorldCoords)> domainDirections, std::function< WorldCoords(WorldCoords)> targetDirections)
Set surface direction functions.
Definition: contactmerge.hh:100
│ │ │ │ -
void build(const std::vector< Dune::FieldVector< T, dimworld > > &grid1Coords, const std::vector< unsigned int > &grid1Elements, const std::vector< Dune::GeometryType > &grid1ElementTypes, const std::vector< Dune::FieldVector< T, dimworld > > &grid2Coords, const std::vector< unsigned int > &grid2Elements, const std::vector< Dune::GeometryType > &grid2ElementTypes) override
builds the merged grid
Definition: contactmerge.hh:188
│ │ │ │ -
ContactMerge(const T allowedOverlap, ProjectionType type)
Construct merger given overlap and type of the projection.
Definition: contactmerge.hh:86
│ │ │ │ -
T minNormalAngle() const
get minimum angle in radians between normals at x and Φ(x)
Definition: contactmerge.hh:132
│ │ │ │ -
Dune::FieldVector< T, dim > LocalCoords
the coordinate type used in this interface
Definition: contactmerge.hh:62
│ │ │ │ +
Computing overlapping grid intersections for grids of different dimensions.
Definition: overlappingmerge.hh:37
│ │ │ │ +
StandardMerge< T, dim1, dim2, dimworld >::SimplicialIntersection SimplicialIntersection
Definition: overlappingmerge.hh:56
│ │ │ │ +
OverlappingMerge()
the coordinate type used in this interface
Definition: overlappingmerge.hh:52
│ │ │ │ +
void computeIntersections(const Dune::GeometryType &grid1ElementType, const std::vector< Dune::FieldVector< T, dimworld > > &grid1ElementCorners, std::bitset<(1<< dim1)> &neighborIntersects1, unsigned int grid1Index, const Dune::GeometryType &grid2ElementType, const std::vector< Dune::FieldVector< T, dimworld > > &grid2ElementCorners, std::bitset<(1<< dim2)> &neighborIntersects2, unsigned int grid2Index, std::vector< SimplicialIntersection > &intersections)
Compute the intersection between two overlapping elements.
Definition: overlappingmerge.cc:34
│ │ │ │ +
Dune::FieldVector< T, dimworld > WorldCoords
the coordinate type used in this interface
Definition: overlappingmerge.hh:47
│ │ │ │ +
T ctype
the numeric type used in this interface
Definition: overlappingmerge.hh:44
│ │ │ │
Common base class for many merger implementations: produce pairs of entities that may intersect.
Definition: standardmerge.hh:58
│ │ │ │ -
void build(const std::vector< Dune::FieldVector< T, dimworld > > &grid1_Coords, const std::vector< unsigned int > &grid1_elements, const std::vector< Dune::GeometryType > &grid1_element_types, const std::vector< Dune::FieldVector< T, dimworld > > &grid2_coords, const std::vector< unsigned int > &grid2_elements, const std::vector< Dune::GeometryType > &grid2_element_types) override
builds the merged grid
Definition: standardmerge.hh:392
│ │ │ │ - │ │ │ │ +
typename IntersectionListProvider::SimplicialIntersection SimplicialIntersection
Definition: standardmerge.hh:83
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,308 +5,128 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * merging │ │ │ │ │ -contactmerge.hh │ │ │ │ │ +overlappingmerge.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 © DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 4// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only- │ │ │ │ │ with-dune-grid-glue-exception │ │ │ │ │ - 10#ifndef DUNE_GRIDGLUE_MERGING_CONTACTMERGE_HH │ │ │ │ │ - 11#define DUNE_GRIDGLUE_MERGING_CONTACTMERGE_HH │ │ │ │ │ + 5#ifndef DUNE_GRIDGLUE_MERGING_OVERLAPPINGMERGE_HH │ │ │ │ │ + 6#define DUNE_GRIDGLUE_MERGING_OVERLAPPINGMERGE_HH │ │ │ │ │ + 7 │ │ │ │ │ + 8#include │ │ │ │ │ + 9#include │ │ │ │ │ + 10#include │ │ │ │ │ + 11#include │ │ │ │ │ 12 │ │ │ │ │ - 13 │ │ │ │ │ - 14#include │ │ │ │ │ - 15#include │ │ │ │ │ - 16#include │ │ │ │ │ - 17#include │ │ │ │ │ - 18#include │ │ │ │ │ - 19#include │ │ │ │ │ - 20#include │ │ │ │ │ - 21#include │ │ │ │ │ - 22 │ │ │ │ │ - 23#include │ │ │ │ │ - 24#include │ │ │ │ │ - 25#include │ │ │ │ │ - 26#include │ │ │ │ │ - 27 │ │ │ │ │ - 28#include │ │ │ │ │ - 29 │ │ │ │ │ - 30#include │ │ │ │ │ - 31#include │ │ │ │ │ - 32 │ │ │ │ │ - 33namespace Dune { │ │ │ │ │ - 34namespace GridGlue { │ │ │ │ │ - 35 │ │ │ │ │ - 41template │ │ │ │ │ -42class ContactMerge │ │ │ │ │ - 43: public StandardMerge │ │ │ │ │ - 44{ │ │ │ │ │ - 45 static constexpr int dim = dimworld-1; │ │ │ │ │ - 46 │ │ │ │ │ - 47 static_assert( dim==1 || dim==2, │ │ │ │ │ - 48 "ContactMerge yet only handles the cases dim==1 and dim==2!"); │ │ │ │ │ - 49 │ │ │ │ │ - 50 typedef StandardMerge Base; │ │ │ │ │ - 51public: │ │ │ │ │ - 52 │ │ │ │ │ - 53 /* E X P O R T E D T Y P E S A N D C O N S T A N T S */ │ │ │ │ │ + 13#include │ │ │ │ │ + 14#include │ │ │ │ │ + 15 │ │ │ │ │ + 16#include │ │ │ │ │ + 17#include │ │ │ │ │ + 18 │ │ │ │ │ + 19#include │ │ │ │ │ + 20 │ │ │ │ │ + 21#include │ │ │ │ │ + 22#include │ │ │ │ │ + 23 │ │ │ │ │ + 24namespace Dune { │ │ │ │ │ + 25namespace GridGlue { │ │ │ │ │ + 26 │ │ │ │ │ + 34template │ │ │ │ │ +35class OverlappingMerge │ │ │ │ │ + 36 : public StandardMerge │ │ │ │ │ + 37{ │ │ │ │ │ + 38 │ │ │ │ │ + 39public: │ │ │ │ │ + 40 │ │ │ │ │ + 41 /* E X P O R T E D T Y P E S A N D C O N S T A N T S */ │ │ │ │ │ + 42 │ │ │ │ │ +44 typedef T ctype; │ │ │ │ │ + 45 │ │ │ │ │ +47 typedef Dune::FieldVector WorldCoords; │ │ │ │ │ + 48 │ │ │ │ │ + 50 //typedef Dune::FieldVector LocalCoords; │ │ │ │ │ + 51 │ │ │ │ │ +52 OverlappingMerge() │ │ │ │ │ + 53 {} │ │ │ │ │ 54 │ │ │ │ │ -56 typedef T ctype; │ │ │ │ │ + 55protected: │ │ │ │ │ +56 typedef typename StandardMerge::SimplicialIntersection │ │ │ │ │ +SimplicialIntersection; │ │ │ │ │ 57 │ │ │ │ │ -59 typedef Dune::FieldVector WorldCoords; │ │ │ │ │ - 60 │ │ │ │ │ -62 typedef Dune::FieldVector LocalCoords; │ │ │ │ │ - 63 │ │ │ │ │ -65 enum ProjectionType {OUTER_NORMAL, CLOSEST_POINT}; │ │ │ │ │ -73 ContactMerge(const T allowedOverlap=T(0), │ │ │ │ │ - 74 std::function domainDirections=nullptr, │ │ │ │ │ - 75 std::function targetDirections=nullptr, │ │ │ │ │ - 76 ProjectionType type = OUTER_NORMAL) │ │ │ │ │ - 77 : domainDirections_(domainDirections), targetDirections_(targetDirections), │ │ │ │ │ - 78 overlap_(allowedOverlap), type_(type) │ │ │ │ │ - 79 {} │ │ │ │ │ - 80 │ │ │ │ │ -86 ContactMerge(const T allowedOverlap, ProjectionType type) │ │ │ │ │ - 87 : overlap_(allowedOverlap), │ │ │ │ │ - 88 type_(type) │ │ │ │ │ - 89 {} │ │ │ │ │ - 90 │ │ │ │ │ - 99 inline │ │ │ │ │ -100 void setSurfaceDirections(std::function │ │ │ │ │ -domainDirections, │ │ │ │ │ - 101 std::function targetDirections) │ │ │ │ │ - 102 { │ │ │ │ │ - 103 domainDirections_ = domainDirections; │ │ │ │ │ - 104 targetDirections_ = targetDirections; │ │ │ │ │ - 105 this->valid = false; │ │ │ │ │ - 106 } │ │ │ │ │ - 107 │ │ │ │ │ -109 void setOverlap(T overlap) │ │ │ │ │ - 110 { │ │ │ │ │ - 111 overlap_ = overlap; │ │ │ │ │ - 112 } │ │ │ │ │ - 113 │ │ │ │ │ -115 T getOverlap() const │ │ │ │ │ - 116 { │ │ │ │ │ - 117 return overlap_; │ │ │ │ │ - 118 } │ │ │ │ │ - 119 │ │ │ │ │ -123 void minNormalAngle(T angle) │ │ │ │ │ - 124 { │ │ │ │ │ - 125 using std::cos; │ │ │ │ │ - 126 maxNormalProduct_ = cos(angle); │ │ │ │ │ - 127 } │ │ │ │ │ - 128 │ │ │ │ │ -132 T minNormalAngle() const │ │ │ │ │ - 133 { │ │ │ │ │ - 134 using std::acos; │ │ │ │ │ - 135 return acos(maxNormalProduct_); │ │ │ │ │ - 136 } │ │ │ │ │ - 137 │ │ │ │ │ - 138protected: │ │ │ │ │ -139 typedef typename StandardMerge:: │ │ │ │ │ -SimplicialIntersection SimplicialIntersection; │ │ │ │ │ - 140 │ │ │ │ │ - 141private: │ │ │ │ │ - 145 std::function domainDirections_; │ │ │ │ │ - 146 std::vector nodalDomainDirections_; │ │ │ │ │ - 147 │ │ │ │ │ - 156 std::function targetDirections_; │ │ │ │ │ - 157 std::vector nodalTargetDirections_; │ │ │ │ │ - 158 │ │ │ │ │ - 160 T overlap_; │ │ │ │ │ - 161 │ │ │ │ │ - 163 ProjectionType type_; │ │ │ │ │ - 164 │ │ │ │ │ - 168 T maxNormalProduct_ = T(-0.1); │ │ │ │ │ - 169 │ │ │ │ │ - 174 void computeIntersections(const Dune::GeometryType& grid1ElementType, │ │ │ │ │ - 175 const std::vector >& grid1ElementCorners, │ │ │ │ │ - 176 std::bitset<(1<& neighborIntersects1, │ │ │ │ │ - 177 unsigned int grid1Index, │ │ │ │ │ - 178 const Dune::GeometryType& grid2ElementType, │ │ │ │ │ - 179 const std::vector >& grid2ElementCorners, │ │ │ │ │ - 180 std::bitset<(1<& neighborIntersects2, │ │ │ │ │ - 181 unsigned int grid2Index, │ │ │ │ │ - 182 std::vector& intersections) override; │ │ │ │ │ - 183 │ │ │ │ │ - 187protected: │ │ │ │ │ -188 void build(const std::vector >& grid1Coords, │ │ │ │ │ - 189 const std::vector& grid1Elements, │ │ │ │ │ - 190 const std::vector& grid1ElementTypes, │ │ │ │ │ - 191 const std::vector >& grid2Coords, │ │ │ │ │ - 192 const std::vector& grid2Elements, │ │ │ │ │ - 193 const std::vector& grid2ElementTypes) override │ │ │ │ │ - 194 { │ │ │ │ │ - 195 std::cout<<"ContactMerge building grid!\n"; │ │ │ │ │ - 196 // setup the nodal direction vectors │ │ │ │ │ - 197 setupNodalDirections(grid1Coords, grid1Elements, grid1ElementTypes, │ │ │ │ │ - 198 grid2Coords, grid2Elements, grid2ElementTypes); │ │ │ │ │ - 199 │ │ │ │ │ - 200 Base::build(grid1Coords, grid1Elements, grid1ElementTypes, │ │ │ │ │ - 201 grid2Coords, grid2Elements, grid2ElementTypes); │ │ │ │ │ - 202 │ │ │ │ │ - 203 } │ │ │ │ │ - 204 │ │ │ │ │ - 205private: │ │ │ │ │ - 206 │ │ │ │ │ - 208 static LocalCoords localCornerCoords(int i, const Dune::GeometryType& gt) │ │ │ │ │ - 209 { │ │ │ │ │ - 210 const auto& ref = Dune::ReferenceElements::general(gt); │ │ │ │ │ - 211 return ref.position(i,dim); │ │ │ │ │ - 212 } │ │ │ │ │ - 213 │ │ │ │ │ - 214protected: │ │ │ │ │ - 215 │ │ │ │ │ - 217 void computeCyclicOrder(const std::vector >& │ │ │ │ │ -polytopeCorners, │ │ │ │ │ - 218 const LocalCoords& center, std::vector& ordering) const; │ │ │ │ │ - 219 │ │ │ │ │ - 221 void setupNodalDirections(const std::vector& coords1, │ │ │ │ │ - 222 const std::vector& elements1, │ │ │ │ │ - 223 const std::vector& elementTypes1, │ │ │ │ │ - 224 const std::vector& coords2, │ │ │ │ │ - 225 const std::vector& elements2, │ │ │ │ │ - 226 const std::vector& elementTypes2); │ │ │ │ │ - 227 │ │ │ │ │ - 229 void computeOuterNormalField(const std::vector& coords, │ │ │ │ │ - 230 const std::vector& elements, │ │ │ │ │ - 231 const std::vector& elementTypes, │ │ │ │ │ - 232 std::vector& normals); │ │ │ │ │ - 233 │ │ │ │ │ - 235 void removeDoubles(std::vector >& │ │ │ │ │ -polytopeCorners); │ │ │ │ │ - 236}; │ │ │ │ │ - 237 │ │ │ │ │ - 238} /* namespace GridGlue */ │ │ │ │ │ - 239} /* namespace Dune */ │ │ │ │ │ - 240 │ │ │ │ │ - 241#include "contactmerge.cc" │ │ │ │ │ - 242 │ │ │ │ │ - 243#endif // DUNE_GRIDGLUE_MERGING_CONTACTMERGE_HH │ │ │ │ │ -gridglue.hh │ │ │ │ │ -Central component of the module implementing the coupling of two grids. │ │ │ │ │ + 69 void computeIntersections(const Dune::GeometryType& grid1ElementType, │ │ │ │ │ + 70 const std::vector >& grid1ElementCorners, │ │ │ │ │ + 71 std::bitset<(1<& neighborIntersects1, │ │ │ │ │ + 72 unsigned int grid1Index, │ │ │ │ │ + 73 const Dune::GeometryType& grid2ElementType, │ │ │ │ │ + 74 const std::vector >& grid2ElementCorners, │ │ │ │ │ + 75 std::bitset<(1<& neighborIntersects2, │ │ │ │ │ + 76 unsigned int grid2Index, │ │ │ │ │ + 77 std::vector& intersections); │ │ │ │ │ + 78 │ │ │ │ │ + 79private: │ │ │ │ │ + 80 bool inPlane(std::vector >& points); │ │ │ │ │ + 81 │ │ │ │ │ + 82}; │ │ │ │ │ + 83 │ │ │ │ │ + 84} /* namespace Dune::GridGlue */ │ │ │ │ │ + 85} /* namespace Dune */ │ │ │ │ │ + 86 │ │ │ │ │ + 87#include "overlappingmerge.cc" │ │ │ │ │ + 88 │ │ │ │ │ + 89 │ │ │ │ │ + 90#endif // DUNE_GRIDGLUE_MERGING_OVERLAPPINGMERGE_HH │ │ │ │ │ +overlappingmerge.cc │ │ │ │ │ +computeintersection.hh │ │ │ │ │ standardmerge.hh │ │ │ │ │ Common base class for many merger implementations: produce pairs of entities │ │ │ │ │ that may intersect. │ │ │ │ │ -contactmerge.cc │ │ │ │ │ Dune │ │ │ │ │ Definition: gridglue.hh:37 │ │ │ │ │ -Dune::GridGlue::ContactMerge │ │ │ │ │ -Merge two codimension-1 surfaces that may be a positive distance apart. │ │ │ │ │ -Definition: contactmerge.hh:44 │ │ │ │ │ -Dune::GridGlue::ContactMerge::computeCyclicOrder │ │ │ │ │ -void computeCyclicOrder(const std::vector< std::array< LocalCoords, 2 > > │ │ │ │ │ -&polytopeCorners, const LocalCoords ¢er, std::vector< int > &ordering) │ │ │ │ │ -const │ │ │ │ │ -Order the corners of the intersection polytope in cyclic order. │ │ │ │ │ -Definition: contactmerge.cc:214 │ │ │ │ │ -Dune::GridGlue::ContactMerge::SimplicialIntersection │ │ │ │ │ -StandardMerge< T, dimworld-1, dimworld-1, dimworld >::SimplicialIntersection │ │ │ │ │ +Dune::GridGlue::OverlappingMerge │ │ │ │ │ +Computing overlapping grid intersections for grids of different dimensions. │ │ │ │ │ +Definition: overlappingmerge.hh:37 │ │ │ │ │ +Dune::GridGlue::OverlappingMerge::SimplicialIntersection │ │ │ │ │ +StandardMerge< T, dim1, dim2, dimworld >::SimplicialIntersection │ │ │ │ │ SimplicialIntersection │ │ │ │ │ -Definition: contactmerge.hh:139 │ │ │ │ │ -Dune::GridGlue::ContactMerge::removeDoubles │ │ │ │ │ -void removeDoubles(std::vector< std::array< LocalCoords, 2 > > │ │ │ │ │ -&polytopeCorners) │ │ │ │ │ -Remove all multiples. │ │ │ │ │ -Definition: contactmerge.cc:335 │ │ │ │ │ -Dune::GridGlue::ContactMerge::setOverlap │ │ │ │ │ -void setOverlap(T overlap) │ │ │ │ │ -Set the allowed overlap of the surfaces. │ │ │ │ │ -Definition: contactmerge.hh:109 │ │ │ │ │ -Dune::GridGlue::ContactMerge::WorldCoords │ │ │ │ │ +Definition: overlappingmerge.hh:56 │ │ │ │ │ +Dune::GridGlue::OverlappingMerge::OverlappingMerge │ │ │ │ │ +OverlappingMerge() │ │ │ │ │ +the coordinate type used in this interface │ │ │ │ │ +Definition: overlappingmerge.hh:52 │ │ │ │ │ +Dune::GridGlue::OverlappingMerge::computeIntersections │ │ │ │ │ +void computeIntersections(const Dune::GeometryType &grid1ElementType, const │ │ │ │ │ +std::vector< Dune::FieldVector< T, dimworld > > &grid1ElementCorners, std:: │ │ │ │ │ +bitset<(1<< dim1)> &neighborIntersects1, unsigned int grid1Index, const Dune:: │ │ │ │ │ +GeometryType &grid2ElementType, const std::vector< Dune::FieldVector< T, │ │ │ │ │ +dimworld > > &grid2ElementCorners, std::bitset<(1<< dim2)> │ │ │ │ │ +&neighborIntersects2, unsigned int grid2Index, std::vector< │ │ │ │ │ +SimplicialIntersection > &intersections) │ │ │ │ │ +Compute the intersection between two overlapping elements. │ │ │ │ │ +Definition: overlappingmerge.cc:34 │ │ │ │ │ +Dune::GridGlue::OverlappingMerge::WorldCoords │ │ │ │ │ Dune::FieldVector< T, dimworld > WorldCoords │ │ │ │ │ the coordinate type used in this interface │ │ │ │ │ -Definition: contactmerge.hh:59 │ │ │ │ │ -Dune::GridGlue::ContactMerge::setupNodalDirections │ │ │ │ │ -void setupNodalDirections(const std::vector< WorldCoords > &coords1, const │ │ │ │ │ -std::vector< unsigned int > &elements1, const std::vector< Dune::GeometryType > │ │ │ │ │ -&elementTypes1, const std::vector< WorldCoords > &coords2, const std::vector< │ │ │ │ │ -unsigned int > &elements2, const std::vector< Dune::GeometryType > │ │ │ │ │ -&elementTypes2) │ │ │ │ │ -Setup the direction vectors containing the directions for each vertex. │ │ │ │ │ -Definition: contactmerge.cc:269 │ │ │ │ │ -Dune::GridGlue::ContactMerge::minNormalAngle │ │ │ │ │ -void minNormalAngle(T angle) │ │ │ │ │ -set minimum angle in radians between normals at x and Φ(x) │ │ │ │ │ -Definition: contactmerge.hh:123 │ │ │ │ │ -Dune::GridGlue::ContactMerge::ctype │ │ │ │ │ +Definition: overlappingmerge.hh:47 │ │ │ │ │ +Dune::GridGlue::OverlappingMerge::ctype │ │ │ │ │ T ctype │ │ │ │ │ the numeric type used in this interface │ │ │ │ │ -Definition: contactmerge.hh:56 │ │ │ │ │ -Dune::GridGlue::ContactMerge::ProjectionType │ │ │ │ │ -ProjectionType │ │ │ │ │ -Type of the projection, closest point or outer normal projection. │ │ │ │ │ -Definition: contactmerge.hh:65 │ │ │ │ │ -Dune::GridGlue::ContactMerge::CLOSEST_POINT │ │ │ │ │ -@ CLOSEST_POINT │ │ │ │ │ -Definition: contactmerge.hh:65 │ │ │ │ │ -Dune::GridGlue::ContactMerge::OUTER_NORMAL │ │ │ │ │ -@ OUTER_NORMAL │ │ │ │ │ -Definition: contactmerge.hh:65 │ │ │ │ │ -Dune::GridGlue::ContactMerge::computeOuterNormalField │ │ │ │ │ -void computeOuterNormalField(const std::vector< WorldCoords > &coords, const │ │ │ │ │ -std::vector< unsigned int > &elements, const std::vector< Dune::GeometryType > │ │ │ │ │ -&elementTypes, std::vector< WorldCoords > &normals) │ │ │ │ │ -If no direction field was specified compute the outer normal field. │ │ │ │ │ -Definition: contactmerge.cc:296 │ │ │ │ │ -Dune::GridGlue::ContactMerge::getOverlap │ │ │ │ │ -T getOverlap() const │ │ │ │ │ -Get the allowed overlap of the surfaces. │ │ │ │ │ -Definition: contactmerge.hh:115 │ │ │ │ │ -Dune::GridGlue::ContactMerge::ContactMerge │ │ │ │ │ -ContactMerge(const T allowedOverlap=T(0), std::function< WorldCoords │ │ │ │ │ -(WorldCoords)> domainDirections=nullptr, std::function< WorldCoords │ │ │ │ │ -(WorldCoords)> targetDirections=nullptr, ProjectionType type=OUTER_NORMAL) │ │ │ │ │ -Construct merger given overlap and possible projection directions. │ │ │ │ │ -Definition: contactmerge.hh:73 │ │ │ │ │ -Dune::GridGlue::ContactMerge::setSurfaceDirections │ │ │ │ │ -void setSurfaceDirections(std::function< WorldCoords(WorldCoords)> │ │ │ │ │ -domainDirections, std::function< WorldCoords(WorldCoords)> targetDirections) │ │ │ │ │ -Set surface direction functions. │ │ │ │ │ -Definition: contactmerge.hh:100 │ │ │ │ │ -Dune::GridGlue::ContactMerge::build │ │ │ │ │ -void build(const std::vector< Dune::FieldVector< T, dimworld > > &grid1Coords, │ │ │ │ │ -const std::vector< unsigned int > &grid1Elements, const std::vector< Dune:: │ │ │ │ │ -GeometryType > &grid1ElementTypes, const std::vector< Dune::FieldVector< T, │ │ │ │ │ -dimworld > > &grid2Coords, const std::vector< unsigned int > &grid2Elements, │ │ │ │ │ -const std::vector< Dune::GeometryType > &grid2ElementTypes) override │ │ │ │ │ -builds the merged grid │ │ │ │ │ -Definition: contactmerge.hh:188 │ │ │ │ │ -Dune::GridGlue::ContactMerge::ContactMerge │ │ │ │ │ -ContactMerge(const T allowedOverlap, ProjectionType type) │ │ │ │ │ -Construct merger given overlap and type of the projection. │ │ │ │ │ -Definition: contactmerge.hh:86 │ │ │ │ │ -Dune::GridGlue::ContactMerge::minNormalAngle │ │ │ │ │ -T minNormalAngle() const │ │ │ │ │ -get minimum angle in radians between normals at x and Φ(x) │ │ │ │ │ -Definition: contactmerge.hh:132 │ │ │ │ │ -Dune::GridGlue::ContactMerge::LocalCoords │ │ │ │ │ -Dune::FieldVector< T, dim > LocalCoords │ │ │ │ │ -the coordinate type used in this interface │ │ │ │ │ -Definition: contactmerge.hh:62 │ │ │ │ │ +Definition: overlappingmerge.hh:44 │ │ │ │ │ Dune::GridGlue::StandardMerge │ │ │ │ │ Common base class for many merger implementations: produce pairs of entities │ │ │ │ │ that may intersect. │ │ │ │ │ Definition: standardmerge.hh:58 │ │ │ │ │ -Dune::GridGlue::StandardMerge::build │ │ │ │ │ -void build(const std::vector< Dune::FieldVector< T, dimworld > > &grid1_Coords, │ │ │ │ │ -const std::vector< unsigned int > &grid1_elements, const std::vector< Dune:: │ │ │ │ │ -GeometryType > &grid1_element_types, const std::vector< Dune::FieldVector< T, │ │ │ │ │ -dimworld > > &grid2_coords, const std::vector< unsigned int > &grid2_elements, │ │ │ │ │ -const std::vector< Dune::GeometryType > &grid2_element_types) override │ │ │ │ │ -builds the merged grid │ │ │ │ │ -Definition: standardmerge.hh:392 │ │ │ │ │ -Dune::GridGlue::StandardMerge<_double,_dimworld-1,_dimworld-1,_dimworld_>:: │ │ │ │ │ -valid │ │ │ │ │ -bool valid │ │ │ │ │ -Definition: standardmerge.hh:86 │ │ │ │ │ +Dune::GridGlue::StandardMerge::SimplicialIntersection │ │ │ │ │ +typename IntersectionListProvider::SimplicialIntersection │ │ │ │ │ +SimplicialIntersection │ │ │ │ │ +Definition: standardmerge.hh:83 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00074.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: standardmerge.cc File Reference │ │ │ │ +dune-grid-glue: contactmerge.cc File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -63,110 +63,28 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -Namespaces | │ │ │ │ -Macros | │ │ │ │ -Functions
│ │ │ │ -
standardmerge.cc File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
contactmerge.cc File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include "config.h"
│ │ │ │ -#include "standardmerge.hh"
│ │ │ │ +
#include <dune/grid-glue/common/crossproduct.hh>
│ │ │ │ +#include <dune/grid-glue/common/projection.hh>
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Macros

#define DECL
 
#define STANDARD_MERGE_INSTANTIATE(T, A, B, C)
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -Functions

 Dune::GridGlue::STANDARD_MERGE_INSTANTIATE (double, 1, 1, 1)
 
 Dune::GridGlue::STANDARD_MERGE_INSTANTIATE (double, 2, 2, 2)
 
 Dune::GridGlue::STANDARD_MERGE_INSTANTIATE (double, 3, 3, 3)
 
│ │ │ │ -

Macro Definition Documentation

│ │ │ │ - │ │ │ │ -

◆ DECL

│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
#define DECL
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │ - │ │ │ │ -

◆ STANDARD_MERGE_INSTANTIATE

│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
#define STANDARD_MERGE_INSTANTIATE( T,
 A,
 B,
 
)
│ │ │ │ -
│ │ │ │ -Value:
DECL template \
│ │ │ │ -
void StandardMerge<T,A,B,C>::build(const std::vector<Dune::FieldVector<T,C> >& grid1_coords, \
│ │ │ │ -
const std::vector<unsigned int>& grid1_elements, \
│ │ │ │ -
const std::vector<Dune::GeometryType>& grid1_element_types, \
│ │ │ │ -
const std::vector<Dune::FieldVector<T,C> >& grid2_coords, \
│ │ │ │ -
const std::vector<unsigned int>& grid2_elements, \
│ │ │ │ -
const std::vector<Dune::GeometryType>& grid2_element_types \
│ │ │ │ -
)
│ │ │ │ -
#define DECL
Definition: standardmerge.cc:12
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,53 +5,19 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * merging │ │ │ │ │ -Namespaces | Macros | Functions │ │ │ │ │ -standardmerge.cc File Reference │ │ │ │ │ -#include "config.h" │ │ │ │ │ -#include "standardmerge.hh" │ │ │ │ │ +Namespaces │ │ │ │ │ +contactmerge.cc File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::GridGlue │ │ │ │ │   │ │ │ │ │ - Macros │ │ │ │ │ -#define DECL │ │ │ │ │ -  │ │ │ │ │ -#define STANDARD_MERGE_INSTANTIATE(T, A, B, C) │ │ │ │ │ -  │ │ │ │ │ - Functions │ │ │ │ │ - Dune::GridGlue::STANDARD_MERGE_INSTANTIATE (double, 1, 1, 1) │ │ │ │ │ -  │ │ │ │ │ - Dune::GridGlue::STANDARD_MERGE_INSTANTIATE (double, 2, 2, 2) │ │ │ │ │ -  │ │ │ │ │ - Dune::GridGlue::STANDARD_MERGE_INSTANTIATE (double, 3, 3, 3) │ │ │ │ │ -  │ │ │ │ │ -***** Macro Definition Documentation ***** │ │ │ │ │ -***** ◆ DECL ***** │ │ │ │ │ -#define DECL │ │ │ │ │ -***** ◆ STANDARD_MERGE_INSTANTIATE ***** │ │ │ │ │ -#define STANDARD_MERGE_INSTANTIATE (  T, │ │ │ │ │ -  A, │ │ │ │ │ -  B, │ │ │ │ │ -  C  │ │ │ │ │ - ) │ │ │ │ │ -Value: │ │ │ │ │ -DECL template \ │ │ │ │ │ -void StandardMerge::build(const std::vector >& │ │ │ │ │ -grid1_coords, \ │ │ │ │ │ -const std::vector& grid1_elements, \ │ │ │ │ │ -const std::vector& grid1_element_types, \ │ │ │ │ │ -const std::vector >& grid2_coords, \ │ │ │ │ │ -const std::vector& grid2_elements, \ │ │ │ │ │ -const std::vector& grid2_element_types \ │ │ │ │ │ -) │ │ │ │ │ -DECL │ │ │ │ │ -#define DECL │ │ │ │ │ -Definition: standardmerge.cc:12 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00077.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: standardmerge.hh File Reference │ │ │ │ +dune-grid-glue: merger.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -64,139 +64,38 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Macros | │ │ │ │ -Functions
│ │ │ │ -
standardmerge.hh File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
merger.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ - │ │ │ │ -

Common base class for many merger implementations: produce pairs of entities that may intersect. │ │ │ │ -More...

│ │ │ │ -
#include <iostream>
│ │ │ │ -#include <iomanip>
│ │ │ │ -#include <vector>
│ │ │ │ -#include <stack>
│ │ │ │ -#include <set>
│ │ │ │ -#include <utility>
│ │ │ │ -#include <map>
│ │ │ │ -#include <memory>
│ │ │ │ -#include <algorithm>
│ │ │ │ +
#include <vector>
│ │ │ │ #include <dune/common/fvector.hh>
│ │ │ │ -#include <dune/common/bitsetvector.hh>
│ │ │ │ -#include <dune/common/stdstreams.hh>
│ │ │ │ -#include <dune/common/timer.hh>
│ │ │ │ -#include <dune/geometry/referenceelements.hh>
│ │ │ │ -#include <dune/grid/common/grid.hh>
│ │ │ │ -#include <dune/grid-glue/merging/intersectionlist.hh>
│ │ │ │ -#include <dune/grid-glue/merging/merger.hh>
│ │ │ │ -#include <dune/grid-glue/merging/computeintersection.hh>
│ │ │ │ +#include <dune/geometry/type.hh>
│ │ │ │ +#include <dune/grid-glue/merging/intersectionlist.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >
 Common base class for many merger implementations: produce pairs of entities that may intersect. More...
class  Dune::GridGlue::Merger< ctype, grid1Dim, grid2Dim, dimworld >
 Abstract base for all classes that take extracted grids and build sets of intersections. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -

│ │ │ │ -Macros

#define DECL   extern
 
#define STANDARD_MERGE_INSTANTIATE(T, A, B, C)
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -Functions

 Dune::GridGlue::STANDARD_MERGE_INSTANTIATE (double, 1, 1, 1)
 
 Dune::GridGlue::STANDARD_MERGE_INSTANTIATE (double, 2, 2, 2)
 
 Dune::GridGlue::STANDARD_MERGE_INSTANTIATE (double, 3, 3, 3)
 
│ │ │ │ -

Detailed Description

│ │ │ │ -

Common base class for many merger implementations: produce pairs of entities that may intersect.

│ │ │ │ -

Macro Definition Documentation

│ │ │ │ - │ │ │ │ -

◆ DECL

│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
#define DECL   extern
│ │ │ │ -
│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │ - │ │ │ │ -

◆ STANDARD_MERGE_INSTANTIATE

│ │ │ │ - │ │ │ │ -
│ │ │ │ -
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
#define STANDARD_MERGE_INSTANTIATE( T,
 A,
 B,
 
)
│ │ │ │ -
│ │ │ │ -Value:
DECL template \
│ │ │ │ -
void StandardMerge<T,A,B,C>::build(const std::vector<Dune::FieldVector<T,C> >& grid1Coords, \
│ │ │ │ -
const std::vector<unsigned int>& grid1_elements, \
│ │ │ │ -
const std::vector<Dune::GeometryType>& grid1_element_types, \
│ │ │ │ -
const std::vector<Dune::FieldVector<T,C> >& grid2Coords, \
│ │ │ │ -
const std::vector<unsigned int>& grid2_elements, \
│ │ │ │ -
const std::vector<Dune::GeometryType>& grid2_element_types \
│ │ │ │ -
)
│ │ │ │ -
#define DECL
Definition: standardmerge.hh:827
│ │ │ │ -
│ │ │ │ -
│ │ │ │ -
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,80 +5,27 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * merging │ │ │ │ │ -Classes | Namespaces | Macros | Functions │ │ │ │ │ -standardmerge.hh File Reference │ │ │ │ │ -Common base class for many merger implementations: produce pairs of entities │ │ │ │ │ -that may intersect. More... │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +merger.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. │ │ │ │ │ Classes │ │ │ │ │ -class  Dune::GridGlue::StandardMerge<_T,_grid1Dim,_grid2Dim,_dimworld_> │ │ │ │ │ -  Common base class for many merger implementations: produce pairs of │ │ │ │ │ - entities that may intersect. More... │ │ │ │ │ +class  Dune::GridGlue::Merger<_ctype,_grid1Dim,_grid2Dim,_dimworld_> │ │ │ │ │ +  Abstract base for all classes that take extracted grids and build sets │ │ │ │ │ + of intersections. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::GridGlue │ │ │ │ │   │ │ │ │ │ - Macros │ │ │ │ │ -#define DECL   extern │ │ │ │ │ -  │ │ │ │ │ -#define STANDARD_MERGE_INSTANTIATE(T, A, B, C) │ │ │ │ │ -  │ │ │ │ │ - Functions │ │ │ │ │ - Dune::GridGlue::STANDARD_MERGE_INSTANTIATE (double, 1, 1, 1) │ │ │ │ │ -  │ │ │ │ │ - Dune::GridGlue::STANDARD_MERGE_INSTANTIATE (double, 2, 2, 2) │ │ │ │ │ -  │ │ │ │ │ - Dune::GridGlue::STANDARD_MERGE_INSTANTIATE (double, 3, 3, 3) │ │ │ │ │ -  │ │ │ │ │ -***** Detailed Description ***** │ │ │ │ │ -Common base class for many merger implementations: produce pairs of entities │ │ │ │ │ -that may intersect. │ │ │ │ │ -***** Macro Definition Documentation ***** │ │ │ │ │ -***** ◆ DECL ***** │ │ │ │ │ -#define DECL   extern │ │ │ │ │ -***** ◆ STANDARD_MERGE_INSTANTIATE ***** │ │ │ │ │ -#define STANDARD_MERGE_INSTANTIATE (  T, │ │ │ │ │ -  A, │ │ │ │ │ -  B, │ │ │ │ │ -  C  │ │ │ │ │ - ) │ │ │ │ │ -Value: │ │ │ │ │ -DECL template \ │ │ │ │ │ -void StandardMerge::build(const std::vector >& │ │ │ │ │ -grid1Coords, \ │ │ │ │ │ -const std::vector& grid1_elements, \ │ │ │ │ │ -const std::vector& grid1_element_types, \ │ │ │ │ │ -const std::vector >& grid2Coords, \ │ │ │ │ │ -const std::vector& grid2_elements, \ │ │ │ │ │ -const std::vector& grid2_element_types \ │ │ │ │ │ -) │ │ │ │ │ -DECL │ │ │ │ │ -#define DECL │ │ │ │ │ -Definition: standardmerge.hh:827 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00077_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: standardmerge.hh Source File │ │ │ │ +dune-grid-glue: merger.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,835 +62,101 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ -
standardmerge.hh
│ │ │ │ +
merger.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 © DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
4// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
│ │ │ │ -
10#ifndef DUNE_GRIDGLUE_MERGING_STANDARDMERGE_HH
│ │ │ │ -
11#define DUNE_GRIDGLUE_MERGING_STANDARDMERGE_HH
│ │ │ │ +
5#ifndef DUNE_GRIDGLUE_MERGING_MERGER_HH
│ │ │ │ +
6#define DUNE_GRIDGLUE_MERGING_MERGER_HH
│ │ │ │ +
7
│ │ │ │ +
8#include <vector>
│ │ │ │ +
9
│ │ │ │ +
10#include <dune/common/fvector.hh>
│ │ │ │ +
11#include <dune/geometry/type.hh>
│ │ │ │
12
│ │ │ │ -
13
│ │ │ │ -
14#include <iostream>
│ │ │ │ -
15#include <iomanip>
│ │ │ │ -
16#include <vector>
│ │ │ │ -
17#include <stack>
│ │ │ │ -
18#include <set>
│ │ │ │ -
19#include <utility>
│ │ │ │ -
20#include <map>
│ │ │ │ -
21#include <memory>
│ │ │ │ -
22#include <algorithm>
│ │ │ │ -
23
│ │ │ │ -
24#include <dune/common/fvector.hh>
│ │ │ │ -
25#include <dune/common/bitsetvector.hh>
│ │ │ │ -
26#include <dune/common/stdstreams.hh>
│ │ │ │ -
27#include <dune/common/timer.hh>
│ │ │ │ -
28
│ │ │ │ -
29#include <dune/geometry/referenceelements.hh>
│ │ │ │ -
30#include <dune/grid/common/grid.hh>
│ │ │ │ -
31
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ +
14
│ │ │ │ +
15namespace Dune {
│ │ │ │ +
16namespace GridGlue {
│ │ │ │ +
17
│ │ │ │ +
25template <class ctype, int grid1Dim, int grid2Dim, int dimworld>
│ │ │ │ +
26class Merger
│ │ │ │ +
27{
│ │ │ │ +
28public:
│ │ │ │ +
29
│ │ │ │ +
31 typedef Dune::FieldVector<ctype, grid1Dim> Grid1Coords;
│ │ │ │ +
32
│ │ │ │ +
34 typedef Dune::FieldVector<ctype, grid2Dim> Grid2Coords;
│ │ │ │
35
│ │ │ │ -
36namespace Dune {
│ │ │ │ -
37namespace GridGlue {
│ │ │ │ +
37 typedef Dune::FieldVector<ctype, dimworld> WorldCoords;
│ │ │ │
38
│ │ │ │ -
55template<class T, int grid1Dim, int grid2Dim, int dimworld>
│ │ │ │ - │ │ │ │ -
57 : public Merger<T,grid1Dim,grid2Dim,dimworld>
│ │ │ │ -
58{
│ │ │ │ - │ │ │ │ + │ │ │ │ +
40
│ │ │ │ +
54 virtual void build(const std::vector<Dune::FieldVector<ctype,dimworld> >& grid1_coords,
│ │ │ │ +
55 const std::vector<unsigned int>& grid1_elements,
│ │ │ │ +
56 const std::vector<Dune::GeometryType>& grid1_element_types,
│ │ │ │ +
57 const std::vector<Dune::FieldVector<ctype,dimworld> >& grid2_coords,
│ │ │ │ +
58 const std::vector<unsigned int>& grid2_elements,
│ │ │ │ +
59 const std::vector<Dune::GeometryType>& grid2_element_types) = 0;
│ │ │ │
60
│ │ │ │ -
61public:
│ │ │ │ -
62
│ │ │ │ -
63 /* E X P O R T E D T Y P E S A N D C O N S T A N T S */
│ │ │ │ -
64
│ │ │ │ -
66 typedef T ctype;
│ │ │ │ -
67
│ │ │ │ - │ │ │ │ -
70
│ │ │ │ - │ │ │ │ -
73
│ │ │ │ - │ │ │ │ -
76
│ │ │ │ - │ │ │ │ -
78
│ │ │ │ -
79protected:
│ │ │ │ -
80
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
85
│ │ │ │ -
86 bool valid = false;
│ │ │ │ -
87
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
91 {}
│ │ │ │ -
92
│ │ │ │ -
93 virtual ~StandardMerge() = default;
│ │ │ │ -
94
│ │ │ │ -
99 virtual void computeIntersections(const Dune::GeometryType& grid1ElementType,
│ │ │ │ -
100 const std::vector<Dune::FieldVector<T,dimworld> >& grid1ElementCorners,
│ │ │ │ -
101 std::bitset<(1<<grid1Dim)>& neighborIntersects1,
│ │ │ │ -
102 unsigned int grid1Index,
│ │ │ │ -
103 const Dune::GeometryType& grid2ElementType,
│ │ │ │ -
104 const std::vector<Dune::FieldVector<T,dimworld> >& grid2ElementCorners,
│ │ │ │ -
105 std::bitset<(1<<grid2Dim)>& neighborIntersects2,
│ │ │ │ -
106 unsigned int grid2Index,
│ │ │ │ -
107 std::vector<SimplicialIntersection>& intersections) = 0;
│ │ │ │ -
108
│ │ │ │ -
112 bool computeIntersection(unsigned int candidate0, unsigned int candidate1,
│ │ │ │ -
113 const std::vector<Dune::FieldVector<T,dimworld> >& grid1Coords,
│ │ │ │ -
114 const std::vector<Dune::GeometryType>& grid1_element_types,
│ │ │ │ -
115 std::bitset<(1<<grid1Dim)>& neighborIntersects1,
│ │ │ │ -
116 const std::vector<Dune::FieldVector<T,dimworld> >& grid2Coords,
│ │ │ │ -
117 const std::vector<Dune::GeometryType>& grid2_element_types,
│ │ │ │ -
118 std::bitset<(1<<grid2Dim)>& neighborIntersects2,
│ │ │ │ -
119 bool insert = true);
│ │ │ │ -
120
│ │ │ │ -
121 /* M E M B E R V A R I A B L E S */
│ │ │ │ -
122
│ │ │ │ -
123 std::shared_ptr<IntersectionListProvider> intersectionListProvider_;
│ │ │ │ -
124 std::shared_ptr<IntersectionList> intersectionList_;
│ │ │ │ -
125
│ │ │ │ -
127 std::vector<std::vector<unsigned int> > grid1ElementCorners_;
│ │ │ │ -
128 std::vector<std::vector<unsigned int> > grid2ElementCorners_;
│ │ │ │ -
129
│ │ │ │ -
130 std::vector<std::vector<int> > elementNeighbors1_;
│ │ │ │ -
131 std::vector<std::vector<int> > elementNeighbors2_;
│ │ │ │ -
132
│ │ │ │ -
133public:
│ │ │ │ -
134
│ │ │ │ -
135 /* C O N C E P T I M P L E M E N T I N G I N T E R F A C E */
│ │ │ │ -
136
│ │ │ │ -
140 void build(const std::vector<Dune::FieldVector<T,dimworld> >& grid1_Coords,
│ │ │ │ -
141 const std::vector<unsigned int>& grid1_elements,
│ │ │ │ -
142 const std::vector<Dune::GeometryType>& grid1_element_types,
│ │ │ │ -
143 const std::vector<Dune::FieldVector<T,dimworld> >& grid2_coords,
│ │ │ │ -
144 const std::vector<unsigned int>& grid2_elements,
│ │ │ │ -
145 const std::vector<Dune::GeometryType>& grid2_element_types) override;
│ │ │ │ -
146
│ │ │ │ -
147
│ │ │ │ -
148 /* P R O B I N G T H E M E R G E D G R I D */
│ │ │ │ -
149
│ │ │ │ -
150 void clear() override
│ │ │ │ -
151 {
│ │ │ │ -
152 // Delete old internal data, from a possible previous run
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ -
156
│ │ │ │ -
157 valid = false;
│ │ │ │ -
158 }
│ │ │ │ -
159
│ │ │ │ -
160 std::shared_ptr<IntersectionList> intersectionList() const final
│ │ │ │ -
161 {
│ │ │ │ -
162 assert(valid);
│ │ │ │ -
163 return intersectionList_;
│ │ │ │ -
164 }
│ │ │ │ -
165
│ │ │ │ -
166 void enableFallback(bool fallback)
│ │ │ │ -
167 {
│ │ │ │ -
168 m_enableFallback = fallback;
│ │ │ │ -
169 }
│ │ │ │ -
170
│ │ │ │ -
171 void enableBruteForce(bool bruteForce)
│ │ │ │ -
172 {
│ │ │ │ -
173 m_enableBruteForce = bruteForce;
│ │ │ │ -
174 }
│ │ │ │ -
175
│ │ │ │ -
176private:
│ │ │ │ -
180 bool m_enableFallback = false;
│ │ │ │ -
181
│ │ │ │ -
185 bool m_enableBruteForce = false;
│ │ │ │ -
186
│ │ │ │ -
187 auto& intersections()
│ │ │ │ -
188 { return intersectionListProvider_->intersections(); }
│ │ │ │ -
189
│ │ │ │ -
191 template<typename V>
│ │ │ │ -
192 static void purge(V & v)
│ │ │ │ -
193 {
│ │ │ │ -
194 v.clear();
│ │ │ │ -
195 V v2(v);
│ │ │ │ -
196 v.swap(v2);
│ │ │ │ -
197 }
│ │ │ │ -
198
│ │ │ │ -
203 void generateSeed(std::vector<int>& seeds,
│ │ │ │ -
204 Dune::BitSetVector<1>& isHandled2,
│ │ │ │ -
205 std::stack<unsigned>& candidates2,
│ │ │ │ -
206 const std::vector<Dune::FieldVector<T, dimworld> >& grid1Coords,
│ │ │ │ -
207 const std::vector<Dune::GeometryType>& grid1_element_types,
│ │ │ │ -
208 const std::vector<Dune::FieldVector<T, dimworld> >& grid2Coords,
│ │ │ │ -
209 const std::vector<Dune::GeometryType>& grid2_element_types);
│ │ │ │ -
210
│ │ │ │ -
214 int insertIntersections(unsigned int candidate1, unsigned int candidate2,std::vector<SimplicialIntersection>& intersections);
│ │ │ │ -
215
│ │ │ │ -
219 int bruteForceSearch(int candidate1,
│ │ │ │ -
220 const std::vector<Dune::FieldVector<T,dimworld> >& grid1Coords,
│ │ │ │ -
221 const std::vector<Dune::GeometryType>& grid1_element_types,
│ │ │ │ -
222 const std::vector<Dune::FieldVector<T,dimworld> >& grid2Coords,
│ │ │ │ -
223 const std::vector<Dune::GeometryType>& grid2_element_types);
│ │ │ │ -
224
│ │ │ │ -
228 std::pair<bool, unsigned int>
│ │ │ │ -
229 intersectionIndex(unsigned int grid1Index, unsigned int grid2Index,
│ │ │ │ -
230 SimplicialIntersection& intersection);
│ │ │ │ -
231
│ │ │ │ -
235 template <int gridDim>
│ │ │ │ -
236 void computeNeighborsPerElement(const std::vector<Dune::GeometryType>& gridElementTypes,
│ │ │ │ -
237 const std::vector<std::vector<unsigned int> >& gridElementCorners,
│ │ │ │ -
238 std::vector<std::vector<int> >& elementNeighbors);
│ │ │ │ -
239
│ │ │ │ -
240 void buildAdvancingFront(
│ │ │ │ -
241 const std::vector<Dune::FieldVector<T,dimworld> >& grid1_Coords,
│ │ │ │ -
242 const std::vector<unsigned int>& grid1_elements,
│ │ │ │ -
243 const std::vector<Dune::GeometryType>& grid1_element_types,
│ │ │ │ -
244 const std::vector<Dune::FieldVector<T,dimworld> >& grid2_coords,
│ │ │ │ -
245 const std::vector<unsigned int>& grid2_elements,
│ │ │ │ -
246 const std::vector<Dune::GeometryType>& grid2_element_types
│ │ │ │ -
247 );
│ │ │ │ -
248
│ │ │ │ -
249 void buildBruteForce(
│ │ │ │ -
250 const std::vector<Dune::FieldVector<T,dimworld> >& grid1_Coords,
│ │ │ │ -
251 const std::vector<unsigned int>& grid1_elements,
│ │ │ │ -
252 const std::vector<Dune::GeometryType>& grid1_element_types,
│ │ │ │ -
253 const std::vector<Dune::FieldVector<T,dimworld> >& grid2_coords,
│ │ │ │ -
254 const std::vector<unsigned int>& grid2_elements,
│ │ │ │ -
255 const std::vector<Dune::GeometryType>& grid2_element_types
│ │ │ │ -
256 );
│ │ │ │ -
257};
│ │ │ │ -
258
│ │ │ │ -
259
│ │ │ │ -
260/* IMPLEMENTATION */
│ │ │ │ -
261
│ │ │ │ -
262template<typename T, int grid1Dim, int grid2Dim, int dimworld>
│ │ │ │ -
263bool StandardMerge<T,grid1Dim,grid2Dim,dimworld>::computeIntersection(unsigned int candidate0, unsigned int candidate1,
│ │ │ │ -
264 const std::vector<Dune::FieldVector<T,dimworld> >& grid1Coords,
│ │ │ │ -
265 const std::vector<Dune::GeometryType>& grid1_element_types,
│ │ │ │ -
266 std::bitset<(1<<grid1Dim)>& neighborIntersects1,
│ │ │ │ -
267 const std::vector<Dune::FieldVector<T,dimworld> >& grid2Coords,
│ │ │ │ -
268 const std::vector<Dune::GeometryType>& grid2_element_types,
│ │ │ │ -
269 std::bitset<(1<<grid2Dim)>& neighborIntersects2,
│ │ │ │ -
270 bool insert)
│ │ │ │ -
271{
│ │ │ │ -
272 // Select vertices of the grid1 element
│ │ │ │ -
273 int grid1NumVertices = grid1ElementCorners_[candidate0].size();
│ │ │ │ -
274 std::vector<Dune::FieldVector<T,dimworld> > grid1ElementCorners(grid1NumVertices);
│ │ │ │ -
275 for (int i=0; i<grid1NumVertices; i++)
│ │ │ │ -
276 grid1ElementCorners[i] = grid1Coords[grid1ElementCorners_[candidate0][i]];
│ │ │ │ -
277
│ │ │ │ -
278 // Select vertices of the grid2 element
│ │ │ │ -
279 int grid2NumVertices = grid2ElementCorners_[candidate1].size();
│ │ │ │ -
280 std::vector<Dune::FieldVector<T,dimworld> > grid2ElementCorners(grid2NumVertices);
│ │ │ │ -
281 for (int i=0; i<grid2NumVertices; i++)
│ │ │ │ -
282 grid2ElementCorners[i] = grid2Coords[grid2ElementCorners_[candidate1][i]];
│ │ │ │ -
283
│ │ │ │ -
284 // ///////////////////////////////////////////////////////
│ │ │ │ -
285 // Compute the intersection between the two elements
│ │ │ │ -
286 // ///////////////////////////////////////////////////////
│ │ │ │ -
287
│ │ │ │ -
288 std::vector<SimplicialIntersection> intersections(0);
│ │ │ │ -
289
│ │ │ │ -
290 // compute the intersections
│ │ │ │ -
291 computeIntersections(grid1_element_types[candidate0], grid1ElementCorners,
│ │ │ │ -
292 neighborIntersects1, candidate0,
│ │ │ │ -
293 grid2_element_types[candidate1], grid2ElementCorners,
│ │ │ │ -
294 neighborIntersects2, candidate1,
│ │ │ │ - │ │ │ │ -
296
│ │ │ │ -
297 // insert intersections if needed
│ │ │ │ -
298 if(insert && !intersections.empty())
│ │ │ │ -
299 insertIntersections(candidate0,candidate1,intersections);
│ │ │ │ -
300
│ │ │ │ -
301 // Have we found an intersection?
│ │ │ │ -
302 return !intersections.empty() || neighborIntersects1.any() || neighborIntersects2.any();
│ │ │ │ -
303
│ │ │ │ -
304}
│ │ │ │ -
305
│ │ │ │ -
306template<typename T, int grid1Dim, int grid2Dim, int dimworld>
│ │ │ │ - │ │ │ │ -
308 const std::vector<Dune::FieldVector<T,dimworld> >& grid1Coords,
│ │ │ │ -
309 const std::vector<Dune::GeometryType>& grid1_element_types,
│ │ │ │ -
310 const std::vector<Dune::FieldVector<T,dimworld> >& grid2Coords,
│ │ │ │ -
311 const std::vector<Dune::GeometryType>& grid2_element_types)
│ │ │ │ -
312{
│ │ │ │ -
313 std::bitset<(1<<grid1Dim)> neighborIntersects1;
│ │ │ │ -
314 std::bitset<(1<<grid2Dim)> neighborIntersects2;
│ │ │ │ -
315 for (std::size_t i=0; i<grid1_element_types.size(); i++) {
│ │ │ │ -
316
│ │ │ │ -
317 bool intersectionFound = computeIntersection(i, candidate1,
│ │ │ │ -
318 grid1Coords, grid1_element_types, neighborIntersects1,
│ │ │ │ -
319 grid2Coords, grid2_element_types, neighborIntersects2,
│ │ │ │ -
320 false);
│ │ │ │ -
321
│ │ │ │ -
322 // if there is an intersection, i is our new seed candidate on the grid1 side
│ │ │ │ -
323 if (intersectionFound)
│ │ │ │ -
324 return i;
│ │ │ │ -
325
│ │ │ │ -
326 }
│ │ │ │ -
327
│ │ │ │ -
328 return -1;
│ │ │ │ -
329}
│ │ │ │ -
330
│ │ │ │ -
331
│ │ │ │ -
332template<typename T, int grid1Dim, int grid2Dim, int dimworld>
│ │ │ │ -
333template<int gridDim>
│ │ │ │ -
334void StandardMerge<T,grid1Dim,grid2Dim,dimworld>::
│ │ │ │ -
335computeNeighborsPerElement(const std::vector<Dune::GeometryType>& gridElementTypes,
│ │ │ │ -
336 const std::vector<std::vector<unsigned int> >& gridElementCorners,
│ │ │ │ -
337 std::vector<std::vector<int> >& elementNeighbors)
│ │ │ │ -
338{
│ │ │ │ -
339 typedef std::vector<unsigned int> FaceType;
│ │ │ │ -
340 typedef std::map<FaceType, std::pair<unsigned int, unsigned int> > FaceSetType;
│ │ │ │ -
341
│ │ │ │ -
343 // First: grid 1
│ │ │ │ -
345 FaceSetType faces;
│ │ │ │ -
346 elementNeighbors.resize(gridElementTypes.size());
│ │ │ │ -
347
│ │ │ │ -
348 for (size_t i=0; i<gridElementTypes.size(); i++)
│ │ │ │ -
349 elementNeighbors[i].resize(Dune::ReferenceElements<T,gridDim>::general(gridElementTypes[i]).size(1), -1);
│ │ │ │ -
350
│ │ │ │ -
351 for (size_t i=0; i<gridElementTypes.size(); i++) { //iterate over all elements
│ │ │ │ -
352 const auto& refElement = Dune::ReferenceElements<T,gridDim>::general(gridElementTypes[i]);
│ │ │ │ -
353
│ │ │ │ -
354 for (size_t j=0; j<(size_t)refElement.size(1); j++) { // iterate over all faces of the element
│ │ │ │ -
355
│ │ │ │ -
356 FaceType face;
│ │ │ │ -
357 // extract element face
│ │ │ │ -
358 for (size_t k=0; k<(size_t)refElement.size(j,1,gridDim); k++)
│ │ │ │ -
359 face.push_back(gridElementCorners[i][refElement.subEntity(j,1,k,gridDim)]);
│ │ │ │ -
360
│ │ │ │ -
361 // sort the face vertices to get rid of twists and other permutations
│ │ │ │ -
362 std::sort(face.begin(), face.end());
│ │ │ │ -
363
│ │ │ │ -
364 typename FaceSetType::iterator faceHandle = faces.find(face);
│ │ │ │ -
365
│ │ │ │ -
366 if (faceHandle == faces.end()) {
│ │ │ │ -
367
│ │ │ │ -
368 // face has not been visited before
│ │ │ │ -
369 faces.insert(std::make_pair(face, std::make_pair(i,j)));
│ │ │ │ -
370
│ │ │ │ -
371 } else {
│ │ │ │ -
372
│ │ │ │ -
373 // face has been visited before: store the mutual neighbor information
│ │ │ │ -
374 elementNeighbors[i][j] = faceHandle->second.first;
│ │ │ │ -
375 elementNeighbors[faceHandle->second.first][faceHandle->second.second] = i;
│ │ │ │ -
376
│ │ │ │ -
377 faces.erase(faceHandle);
│ │ │ │ -
378
│ │ │ │ -
379 }
│ │ │ │ -
380
│ │ │ │ -
381 }
│ │ │ │ -
382
│ │ │ │ -
383 }
│ │ │ │ -
384}
│ │ │ │ -
385
│ │ │ │ -
386// /////////////////////////////////////////////////////////////////////
│ │ │ │ -
387// Compute the intersection of all pairs of elements
│ │ │ │ -
388// Linear algorithm by Gander and Japhet, Proc. of DD18
│ │ │ │ -
389// /////////////////////////////////////////////////////////////////////
│ │ │ │ -
390
│ │ │ │ -
391template<typename T, int grid1Dim, int grid2Dim, int dimworld>
│ │ │ │ -
392void StandardMerge<T,grid1Dim,grid2Dim,dimworld>::build(const std::vector<Dune::FieldVector<T,dimworld> >& grid1Coords,
│ │ │ │ -
393 const std::vector<unsigned int>& grid1_elements,
│ │ │ │ -
394 const std::vector<Dune::GeometryType>& grid1_element_types,
│ │ │ │ -
395 const std::vector<Dune::FieldVector<T,dimworld> >& grid2Coords,
│ │ │ │ -
396 const std::vector<unsigned int>& grid2_elements,
│ │ │ │ -
397 const std::vector<Dune::GeometryType>& grid2_element_types
│ │ │ │ -
398 )
│ │ │ │ -
399{
│ │ │ │ -
400
│ │ │ │ -
401 std::cout << "StandardMerge building merged grid..." << std::endl;
│ │ │ │ -
402 Dune::Timer watch;
│ │ │ │ -
403
│ │ │ │ -
404 clear();
│ │ │ │ -
405 // clear global intersection list
│ │ │ │ -
406 intersectionListProvider_->clear();
│ │ │ │ -
407 this->counter = 0;
│ │ │ │ -
408
│ │ │ │ -
409 // /////////////////////////////////////////////////////////////////////
│ │ │ │ -
410 // Copy element corners into a data structure with block-structure.
│ │ │ │ -
411 // This is not as efficient but a lot easier to use.
│ │ │ │ -
412 // We may think about efficiency later.
│ │ │ │ -
413 // /////////////////////////////////////////////////////////////////////
│ │ │ │ -
414
│ │ │ │ -
415 // first the grid1 side
│ │ │ │ -
416 grid1ElementCorners_.resize(grid1_element_types.size());
│ │ │ │ -
417
│ │ │ │ -
418 unsigned int grid1CornerCounter = 0;
│ │ │ │ -
419
│ │ │ │ -
420 for (std::size_t i=0; i<grid1_element_types.size(); i++) {
│ │ │ │ -
421
│ │ │ │ -
422 // Select vertices of the grid1 element
│ │ │ │ -
423 int numVertices = Dune::ReferenceElements<T,grid1Dim>::general(grid1_element_types[i]).size(grid1Dim);
│ │ │ │ -
424 grid1ElementCorners_[i].resize(numVertices);
│ │ │ │ -
425 for (int j=0; j<numVertices; j++)
│ │ │ │ -
426 grid1ElementCorners_[i][j] = grid1_elements[grid1CornerCounter++];
│ │ │ │ -
427
│ │ │ │ -
428 }
│ │ │ │ -
429
│ │ │ │ -
430 // then the grid2 side
│ │ │ │ -
431 grid2ElementCorners_.resize(grid2_element_types.size());
│ │ │ │ -
432
│ │ │ │ -
433 unsigned int grid2CornerCounter = 0;
│ │ │ │ -
434
│ │ │ │ -
435 for (std::size_t i=0; i<grid2_element_types.size(); i++) {
│ │ │ │ -
436
│ │ │ │ -
437 // Select vertices of the grid2 element
│ │ │ │ -
438 int numVertices = Dune::ReferenceElements<T,grid2Dim>::general(grid2_element_types[i]).size(grid2Dim);
│ │ │ │ -
439 grid2ElementCorners_[i].resize(numVertices);
│ │ │ │ -
440 for (int j=0; j<numVertices; j++)
│ │ │ │ -
441 grid2ElementCorners_[i][j] = grid2_elements[grid2CornerCounter++];
│ │ │ │ -
442
│ │ │ │ -
443 }
│ │ │ │ -
444
│ │ │ │ -
446 // Compute the face neighbors for each element
│ │ │ │ -
448
│ │ │ │ -
449 computeNeighborsPerElement<grid1Dim>(grid1_element_types, grid1ElementCorners_, elementNeighbors1_);
│ │ │ │ -
450 computeNeighborsPerElement<grid2Dim>(grid2_element_types, grid2ElementCorners_, elementNeighbors2_);
│ │ │ │ -
451
│ │ │ │ -
452 std::cout << "setup took " << watch.elapsed() << " seconds." << std::endl;
│ │ │ │ -
453
│ │ │ │ -
454 if (m_enableBruteForce)
│ │ │ │ -
455 buildBruteForce(grid1Coords, grid1_elements, grid1_element_types, grid2Coords, grid2_elements, grid2_element_types);
│ │ │ │ -
456 else
│ │ │ │ -
457 buildAdvancingFront(grid1Coords, grid1_elements, grid1_element_types, grid2Coords, grid2_elements, grid2_element_types);
│ │ │ │ -
458
│ │ │ │ -
459 valid = true;
│ │ │ │ -
460 std::cout << "intersection construction took " << watch.elapsed() << " seconds." << std::endl;
│ │ │ │ -
461}
│ │ │ │ -
462
│ │ │ │ -
463template<typename T, int grid1Dim, int grid2Dim, int dimworld>
│ │ │ │ - │ │ │ │ -
465 const std::vector<Dune::FieldVector<T,dimworld> >& grid1Coords,
│ │ │ │ -
466 const std::vector<unsigned int>& grid1_elements,
│ │ │ │ -
467 const std::vector<Dune::GeometryType>& grid1_element_types,
│ │ │ │ -
468 const std::vector<Dune::FieldVector<T,dimworld> >& grid2Coords,
│ │ │ │ -
469 const std::vector<unsigned int>& grid2_elements,
│ │ │ │ -
470 const std::vector<Dune::GeometryType>& grid2_element_types
│ │ │ │ -
471 )
│ │ │ │ -
472{
│ │ │ │ -
474 // Data structures for the advancing-front algorithm
│ │ │ │ -
476
│ │ │ │ -
477 std::stack<unsigned int> candidates1;
│ │ │ │ -
478 std::stack<unsigned int> candidates2;
│ │ │ │ -
479
│ │ │ │ -
480 std::vector<int> seeds(grid2_element_types.size(), -1);
│ │ │ │ -
481
│ │ │ │ -
482 // /////////////////////////////////////////////////////////////////////
│ │ │ │ -
483 // Do a brute-force search to find one pair of intersecting elements
│ │ │ │ -
484 // to start the advancing-front type algorithm with.
│ │ │ │ -
485 // /////////////////////////////////////////////////////////////////////
│ │ │ │ -
486
│ │ │ │ -
487 // Set flag if element has been handled
│ │ │ │ -
488 Dune::BitSetVector<1> isHandled2(grid2_element_types.size());
│ │ │ │ -
489
│ │ │ │ -
490 // Set flag if the element has been entered in the queue
│ │ │ │ -
491 Dune::BitSetVector<1> isCandidate2(grid2_element_types.size());
│ │ │ │ -
492
│ │ │ │ -
493 generateSeed(seeds, isHandled2, candidates2, grid1Coords, grid1_element_types, grid2Coords, grid2_element_types);
│ │ │ │ -
494
│ │ │ │ -
495 // /////////////////////////////////////////////////////////////////////
│ │ │ │ -
496 // Main loop
│ │ │ │ -
497 // /////////////////////////////////////////////////////////////////////
│ │ │ │ -
498
│ │ │ │ -
499 std::set<unsigned int> isHandled1;
│ │ │ │ -
500
│ │ │ │ -
501 std::set<unsigned int> isCandidate1;
│ │ │ │ -
502
│ │ │ │ -
503 while (!candidates2.empty()) {
│ │ │ │ -
504
│ │ │ │ -
505 // Get the next element on the grid2 side
│ │ │ │ -
506 unsigned int currentCandidate2 = candidates2.top();
│ │ │ │ -
507 int seed = seeds[currentCandidate2];
│ │ │ │ -
508 assert(seed >= 0);
│ │ │ │ -
509
│ │ │ │ -
510 candidates2.pop();
│ │ │ │ -
511 isHandled2[currentCandidate2] = true;
│ │ │ │ -
512
│ │ │ │ -
513 // Start advancing front algorithm on the grid1 side from the 'seed' element that
│ │ │ │ -
514 // we stored along with the current grid2 element
│ │ │ │ -
515 candidates1.push(seed);
│ │ │ │ -
516
│ │ │ │ -
517 isHandled1.clear();
│ │ │ │ -
518 isCandidate1.clear();
│ │ │ │ -
519
│ │ │ │ -
520 while (!candidates1.empty()) {
│ │ │ │ -
521
│ │ │ │ -
522 unsigned int currentCandidate1 = candidates1.top();
│ │ │ │ -
523 candidates1.pop();
│ │ │ │ -
524 isHandled1.insert(currentCandidate1);
│ │ │ │ -
525
│ │ │ │ -
526 // Test whether there is an intersection between currentCandidate0 and currentCandidate1
│ │ │ │ -
527 std::bitset<(1<<grid1Dim)> neighborIntersects1;
│ │ │ │ -
528 std::bitset<(1<<grid2Dim)> neighborIntersects2;
│ │ │ │ -
529 bool intersectionFound = computeIntersection(currentCandidate1, currentCandidate2,
│ │ │ │ -
530 grid1Coords,grid1_element_types, neighborIntersects1,
│ │ │ │ -
531 grid2Coords,grid2_element_types, neighborIntersects2);
│ │ │ │ -
532
│ │ │ │ -
533 for (size_t i=0; i<neighborIntersects2.size(); i++)
│ │ │ │ -
534 if (neighborIntersects2[i] && elementNeighbors2_[currentCandidate2][i] != -1)
│ │ │ │ -
535 seeds[elementNeighbors2_[currentCandidate2][i]] = currentCandidate1;
│ │ │ │ -
536
│ │ │ │ -
537 // add neighbors of candidate0 to the list of elements to be checked
│ │ │ │ -
538 if (intersectionFound) {
│ │ │ │ -
539
│ │ │ │ -
540 for (size_t i=0; i<elementNeighbors1_[currentCandidate1].size(); i++) {
│ │ │ │ -
541
│ │ │ │ -
542 int neighbor = elementNeighbors1_[currentCandidate1][i];
│ │ │ │ -
543
│ │ │ │ -
544 if (neighbor == -1) // do nothing at the grid boundary
│ │ │ │ -
545 continue;
│ │ │ │ -
546
│ │ │ │ -
547 if (isHandled1.find(neighbor) == isHandled1.end()
│ │ │ │ -
548 && isCandidate1.find(neighbor) == isCandidate1.end()) {
│ │ │ │ -
549 candidates1.push(neighbor);
│ │ │ │ -
550 isCandidate1.insert(neighbor);
│ │ │ │ -
551 }
│ │ │ │ -
552
│ │ │ │ -
553 }
│ │ │ │ -
554
│ │ │ │ -
555 }
│ │ │ │ -
556
│ │ │ │ -
557 }
│ │ │ │ -
558
│ │ │ │ -
559 // We have now found all intersections of elements in the grid1 side with currentCandidate2
│ │ │ │ -
560 // Now we add all neighbors of currentCandidate2 that have not been treated yet as new
│ │ │ │ -
561 // candidates.
│ │ │ │ -
562
│ │ │ │ -
563 // Do we have an unhandled neighbor with a seed?
│ │ │ │ -
564 bool seedFound = !candidates2.empty();
│ │ │ │ -
565 for (size_t i=0; i<elementNeighbors2_[currentCandidate2].size(); i++) {
│ │ │ │ -
566
│ │ │ │ -
567 int neighbor = elementNeighbors2_[currentCandidate2][i];
│ │ │ │ -
568
│ │ │ │ -
569 if (neighbor == -1) // do nothing at the grid boundary
│ │ │ │ -
570 continue;
│ │ │ │ -
571
│ │ │ │ -
572 // Add all unhandled intersecting neighbors to the queue
│ │ │ │ -
573 if (!isHandled2[neighbor][0] && !isCandidate2[neighbor][0] && seeds[neighbor]>-1) {
│ │ │ │ -
574
│ │ │ │ -
575 isCandidate2[neighbor][0] = true;
│ │ │ │ -
576 candidates2.push(neighbor);
│ │ │ │ -
577 seedFound = true;
│ │ │ │ -
578 }
│ │ │ │ -
579 }
│ │ │ │ -
580
│ │ │ │ -
581 if (seedFound || !m_enableFallback)
│ │ │ │ -
582 continue;
│ │ │ │ -
583
│ │ │ │ -
584 // There is no neighbor with a seed, so we need to be a bit more aggressive...
│ │ │ │ -
585 // get all neighbors of currentCandidate2, but not currentCandidate2 itself
│ │ │ │ -
586 for (size_t i=0; i<elementNeighbors2_[currentCandidate2].size(); i++) {
│ │ │ │ -
587
│ │ │ │ -
588 int neighbor = elementNeighbors2_[currentCandidate2][i];
│ │ │ │ -
589
│ │ │ │ -
590 if (neighbor == -1) // do nothing at the grid boundary
│ │ │ │ -
591 continue;
│ │ │ │ -
592
│ │ │ │ -
593 if (!isHandled2[neighbor][0] && !isCandidate2[neighbor][0]) {
│ │ │ │ -
594
│ │ │ │ -
595 // Get a seed element for the new grid2 element
│ │ │ │ -
596 // Look for an element on the grid1 side that intersects the new grid2 element.
│ │ │ │ -
597 int seed = -1;
│ │ │ │ -
598
│ │ │ │ -
599 // Look among the ones that have been tested during the last iteration.
│ │ │ │ -
600 for (typename std::set<unsigned int>::iterator seedIt = isHandled1.begin();
│ │ │ │ -
601 seedIt != isHandled1.end(); ++seedIt) {
│ │ │ │ -
602
│ │ │ │ -
603 std::bitset<(1<<grid1Dim)> neighborIntersects1;
│ │ │ │ -
604 std::bitset<(1<<grid2Dim)> neighborIntersects2;
│ │ │ │ -
605 bool intersectionFound = computeIntersection(*seedIt, neighbor,
│ │ │ │ -
606 grid1Coords, grid1_element_types, neighborIntersects1,
│ │ │ │ -
607 grid2Coords, grid2_element_types, neighborIntersects2,
│ │ │ │ -
608 false);
│ │ │ │ -
609
│ │ │ │ -
610 // if the intersection is nonempty, *seedIt is our new seed candidate on the grid1 side
│ │ │ │ -
611 if (intersectionFound) {
│ │ │ │ -
612 seed = *seedIt;
│ │ │ │ -
613 Dune::dwarn << "Algorithm entered first fallback method and found a new seed in the build algorithm." <<
│ │ │ │ -
614 "Probably, the neighborIntersects bitsets computed in computeIntersection specialization is wrong." << std::endl;
│ │ │ │ -
615 break;
│ │ │ │ -
616 }
│ │ │ │ -
617
│ │ │ │ -
618 }
│ │ │ │ -
619
│ │ │ │ -
620 if (seed < 0) {
│ │ │ │ -
621 // The fast method didn't find a grid1 element that intersects with
│ │ │ │ -
622 // the new grid2 candidate. We have to do a brute-force search.
│ │ │ │ -
623 seed = bruteForceSearch(neighbor,
│ │ │ │ -
624 grid1Coords,grid1_element_types,
│ │ │ │ -
625 grid2Coords,grid2_element_types);
│ │ │ │ -
626 Dune::dwarn << "Algorithm entered second fallback method. This probably should not happen." << std::endl;
│ │ │ │ -
627
│ │ │ │ -
628 }
│ │ │ │ -
629
│ │ │ │ -
630 // We have tried all we could: the candidate is 'handled' now
│ │ │ │ -
631 isCandidate2[neighbor] = true;
│ │ │ │ -
632
│ │ │ │ -
633 // still no seed? Then the new grid2 candidate isn't overlapped by anything
│ │ │ │ -
634 if (seed < 0)
│ │ │ │ -
635 continue;
│ │ │ │ -
636
│ │ │ │ -
637 // we have a seed now
│ │ │ │ -
638 candidates2.push(neighbor);
│ │ │ │ -
639 seeds[neighbor] = seed;
│ │ │ │ -
640 seedFound = true;
│ │ │ │ -
641
│ │ │ │ -
642 }
│ │ │ │ -
643
│ │ │ │ -
644 }
│ │ │ │ -
645
│ │ │ │ -
646 /* Do a brute-force search if there is still no seed:
│ │ │ │ -
647 * There might still be a disconnected region out there.
│ │ │ │ -
648 */
│ │ │ │ -
649 if (!seedFound && candidates2.empty()) {
│ │ │ │ -
650 generateSeed(seeds, isHandled2, candidates2, grid1Coords, grid1_element_types, grid2Coords, grid2_element_types);
│ │ │ │ -
651 }
│ │ │ │ -
652 }
│ │ │ │ -
653}
│ │ │ │ -
654
│ │ │ │ -
655template<typename T, int grid1Dim, int grid2Dim, int dimworld>
│ │ │ │ -
656void StandardMerge<T,grid1Dim,grid2Dim,dimworld>::buildBruteForce(
│ │ │ │ -
657 const std::vector<Dune::FieldVector<T,dimworld> >& grid1Coords,
│ │ │ │ -
658 const std::vector<unsigned int>& grid1_elements,
│ │ │ │ -
659 const std::vector<Dune::GeometryType>& grid1_element_types,
│ │ │ │ -
660 const std::vector<Dune::FieldVector<T,dimworld> >& grid2Coords,
│ │ │ │ -
661 const std::vector<unsigned int>& grid2_elements,
│ │ │ │ -
662 const std::vector<Dune::GeometryType>& grid2_element_types
│ │ │ │ -
663 )
│ │ │ │ -
664{
│ │ │ │ -
665 std::bitset<(1<<grid1Dim)> neighborIntersects1;
│ │ │ │ -
666 std::bitset<(1<<grid2Dim)> neighborIntersects2;
│ │ │ │ -
667
│ │ │ │ -
668 for (unsigned i = 0; i < grid1_element_types.size(); ++i) {
│ │ │ │ -
669 for (unsigned j = 0; j < grid2_element_types.size(); ++j) {
│ │ │ │ -
670 (void) computeIntersection(i, j,
│ │ │ │ -
671 grid1Coords, grid1_element_types, neighborIntersects1,
│ │ │ │ -
672 grid2Coords, grid2_element_types, neighborIntersects2);
│ │ │ │ -
673 }
│ │ │ │ -
674 }
│ │ │ │ -
675}
│ │ │ │ -
676
│ │ │ │ -
677template<typename T, int grid1Dim, int grid2Dim, int dimworld>
│ │ │ │ -
678void StandardMerge<T,grid1Dim,grid2Dim,dimworld>::generateSeed(std::vector<int>& seeds, Dune::BitSetVector<1>& isHandled2, std::stack<unsigned>& candidates2, const std::vector<Dune::FieldVector<T, dimworld> >& grid1Coords, const std::vector<Dune::GeometryType>& grid1_element_types, const std::vector<Dune::FieldVector<T, dimworld> >& grid2Coords, const std::vector<Dune::GeometryType>& grid2_element_types)
│ │ │ │ -
679{
│ │ │ │ -
680 for (std::size_t j=0; j<grid2_element_types.size(); j++) {
│ │ │ │ -
681
│ │ │ │ -
682 if (seeds[j] > 0 || isHandled2[j][0])
│ │ │ │ -
683 continue;
│ │ │ │ -
684
│ │ │ │ -
685 int seed = bruteForceSearch(j,grid1Coords,grid1_element_types,grid2Coords,grid2_element_types);
│ │ │ │ -
686
│ │ │ │ -
687 if (seed >= 0) {
│ │ │ │ -
688 candidates2.push(j); // the candidate and a seed for the candidate
│ │ │ │ -
689 seeds[j] = seed;
│ │ │ │ -
690 break;
│ │ │ │ -
691 } else // If the brute force search did not find any intersection we can skip this element
│ │ │ │ -
692 isHandled2[j] = true;
│ │ │ │ -
693 }
│ │ │ │ -
694}
│ │ │ │ -
695
│ │ │ │ -
696template<typename T, int grid1Dim, int grid2Dim, int dimworld>
│ │ │ │ -
697int StandardMerge<T,grid1Dim,grid2Dim,dimworld>::insertIntersections(unsigned int candidate1, unsigned int candidate2,
│ │ │ │ -
698 std::vector<SimplicialIntersection>& intersections)
│ │ │ │ -
699{
│ │ │ │ -
700 typedef typename std::vector<SimplicialIntersection>::size_type size_t;
│ │ │ │ -
701 int count = 0;
│ │ │ │ -
702
│ │ │ │ -
703 for (size_t i = 0; i < intersections.size(); ++i) {
│ │ │ │ -
704 // get the intersection index of the current intersection from intersections in this->intersections
│ │ │ │ -
705 bool found;
│ │ │ │ -
706 unsigned int index;
│ │ │ │ -
707 std::tie(found, index) = intersectionIndex(candidate1,candidate2,intersections[i]);
│ │ │ │ -
708
│ │ │ │ -
709 if (found && index >= this->intersections().size()) { //the intersection is not yet contained in this->intersections
│ │ │ │ -
710 this->intersections().push_back(intersections[i]); // insert
│ │ │ │ -
711
│ │ │ │ -
712 ++count;
│ │ │ │ -
713 } else if (found) {
│ │ │ │ -
714 auto& intersection = this->intersections()[index];
│ │ │ │ -
715
│ │ │ │ -
716 // insert each grid1 element and local representation of intersections[i] with parent candidate1
│ │ │ │ -
717 for (size_t j = 0; j < intersections[i].parents0.size(); ++j) {
│ │ │ │ -
718 intersection.parents0.push_back(candidate1);
│ │ │ │ -
719 intersection.corners0.push_back(intersections[i].corners0[j]);
│ │ │ │ -
720 }
│ │ │ │ -
721
│ │ │ │ -
722 // insert each grid2 element and local representation of intersections[i] with parent candidate2
│ │ │ │ -
723 for (size_t j = 0; j < intersections[i].parents1.size(); ++j) {
│ │ │ │ -
724 intersection.parents1.push_back(candidate2);
│ │ │ │ -
725 intersection.corners1.push_back(intersections[i].corners1[j]);
│ │ │ │ -
726 }
│ │ │ │ -
727
│ │ │ │ -
728 ++count;
│ │ │ │ -
729 } else {
│ │ │ │ -
730 Dune::dwarn << "Computed the same intersection twice!" << std::endl;
│ │ │ │ -
731 }
│ │ │ │ -
732 }
│ │ │ │ -
733 return count;
│ │ │ │ -
734}
│ │ │ │ -
735
│ │ │ │ -
736template<typename T, int grid1Dim, int grid2Dim, int dimworld>
│ │ │ │ -
737std::pair<bool, unsigned int>
│ │ │ │ -
738StandardMerge<T,grid1Dim,grid2Dim,dimworld>::intersectionIndex(unsigned int grid1Index, unsigned int grid2Index,
│ │ │ │ -
739 SimplicialIntersection& intersection) {
│ │ │ │ -
740
│ │ │ │ -
741
│ │ │ │ -
742 // return index in intersections_ if at least one local representation of a Simplicial Intersection (SI)
│ │ │ │ -
743 // of intersections_ is equal to the local representation of one element in intersections
│ │ │ │ -
744
│ │ │ │ -
745 std::size_t n_intersections = this->intersections().size();
│ │ │ │ -
746 if (grid1Dim == grid2Dim)
│ │ │ │ -
747 return {true, n_intersections};
│ │ │ │ -
748
│ │ │ │ -
749 T eps = 1e-10;
│ │ │ │ -
750
│ │ │ │ -
751 for (std::size_t i = 0; i < n_intersections; ++i) {
│ │ │ │ -
752
│ │ │ │ -
753 // compare the local representation of the subelements of the SI
│ │ │ │ -
754 for (std::size_t ei = 0; ei < this->intersections()[i].parents0.size(); ++ei) // merger subelement
│ │ │ │ -
755 {
│ │ │ │ -
756 if (this->intersections()[i].parents0[ei] == grid1Index)
│ │ │ │ -
757 {
│ │ │ │ -
758 for (std::size_t er = 0; er < intersection.parents0.size(); ++er) // list subelement
│ │ │ │ -
759 {
│ │ │ │ -
760 bool found_all = true;
│ │ │ │ -
761 // compare the local coordinate representations
│ │ │ │ -
762 for (std::size_t ci = 0; ci < this->intersections()[i].corners0[ei].size(); ++ci)
│ │ │ │ -
763 {
│ │ │ │ -
764 Dune::FieldVector<T,grid1Dim> ni = this->intersections()[i].corners0[ei][ci];
│ │ │ │ -
765 bool found_ni = false;
│ │ │ │ -
766 for (std::size_t cr = 0; cr < intersection.corners0[er].size(); ++cr)
│ │ │ │ -
767 {
│ │ │ │ -
768 Dune::FieldVector<T,grid1Dim> nr = intersection.corners0[er][cr];
│ │ │ │ -
769
│ │ │ │ -
770 found_ni = found_ni || ((ni-nr).infinity_norm() < eps);
│ │ │ │ -
771 if (found_ni)
│ │ │ │ -
772 break;
│ │ │ │ -
773 }
│ │ │ │ -
774 found_all = found_all && found_ni;
│ │ │ │ -
775
│ │ │ │ -
776 if (!found_ni)
│ │ │ │ -
777 break;
│ │ │ │ -
778 }
│ │ │ │ -
779
│ │ │ │ -
780 if (found_all && (this->intersections()[i].parents1[ei] != grid2Index))
│ │ │ │ -
781 return {true, i};
│ │ │ │ -
782 else if (found_all)
│ │ │ │ -
783 return {false, 0};
│ │ │ │ -
784 }
│ │ │ │ -
785 }
│ │ │ │ -
786 }
│ │ │ │ -
787
│ │ │ │ -
788 // compare the local representation of the subelements of the SI
│ │ │ │ -
789 for (std::size_t ei = 0; ei < this->intersections()[i].parents1.size(); ++ei) // merger subelement
│ │ │ │ -
790 {
│ │ │ │ -
791 if (this->intersections()[i].parents1[ei] == grid2Index)
│ │ │ │ -
792 {
│ │ │ │ -
793 for (std::size_t er = 0; er < intersection.parents1.size(); ++er) // list subelement
│ │ │ │ -
794 {
│ │ │ │ -
795 bool found_all = true;
│ │ │ │ -
796 // compare the local coordinate representations
│ │ │ │ -
797 for (std::size_t ci = 0; ci < this->intersections()[i].corners1[ei].size(); ++ci)
│ │ │ │ -
798 {
│ │ │ │ -
799 Dune::FieldVector<T,grid2Dim> ni = this->intersections()[i].corners1[ei][ci];
│ │ │ │ -
800 bool found_ni = false;
│ │ │ │ -
801 for (std::size_t cr = 0; cr < intersection.corners1[er].size(); ++cr)
│ │ │ │ -
802 {
│ │ │ │ -
803 Dune::FieldVector<T,grid2Dim> nr = intersection.corners1[er][cr];
│ │ │ │ -
804 found_ni = found_ni || ((ni-nr).infinity_norm() < eps);
│ │ │ │ -
805
│ │ │ │ -
806 if (found_ni)
│ │ │ │ -
807 break;
│ │ │ │ -
808 }
│ │ │ │ -
809 found_all = found_all && found_ni;
│ │ │ │ -
810
│ │ │ │ -
811 if (!found_ni)
│ │ │ │ -
812 break;
│ │ │ │ -
813 }
│ │ │ │ -
814
│ │ │ │ -
815 if (found_all && (this->intersections()[i].parents0[ei] != grid1Index))
│ │ │ │ -
816 return {true, i};
│ │ │ │ -
817 else if (found_all)
│ │ │ │ -
818 return {false, 0};
│ │ │ │ -
819 }
│ │ │ │ -
820 }
│ │ │ │ -
821 }
│ │ │ │ -
822 }
│ │ │ │ -
823
│ │ │ │ -
824 return {true, n_intersections};
│ │ │ │ -
825}
│ │ │ │ -
826
│ │ │ │ -
827#define DECL extern
│ │ │ │ -
828#define STANDARD_MERGE_INSTANTIATE(T,A,B,C) \
│ │ │ │ -
829 DECL template \
│ │ │ │ -
830 void StandardMerge<T,A,B,C>::build(const std::vector<Dune::FieldVector<T,C> >& grid1Coords, \
│ │ │ │ -
831 const std::vector<unsigned int>& grid1_elements, \
│ │ │ │ -
832 const std::vector<Dune::GeometryType>& grid1_element_types, \
│ │ │ │ -
833 const std::vector<Dune::FieldVector<T,C> >& grid2Coords, \
│ │ │ │ -
834 const std::vector<unsigned int>& grid2_elements, \
│ │ │ │ -
835 const std::vector<Dune::GeometryType>& grid2_element_types \
│ │ │ │ -
836 )
│ │ │ │ -
837
│ │ │ │ -
838STANDARD_MERGE_INSTANTIATE(double,1,1,1);
│ │ │ │ -
839STANDARD_MERGE_INSTANTIATE(double,2,2,2);
│ │ │ │ -
840STANDARD_MERGE_INSTANTIATE(double,3,3,3);
│ │ │ │ -
841#undef STANDARD_MERGE_INSTANTIATE
│ │ │ │ -
842#undef DECL
│ │ │ │ -
843
│ │ │ │ -
844} /* namespace GridGlue */
│ │ │ │ -
845} /* namespace Dune */
│ │ │ │ -
846
│ │ │ │ -
847#endif // DUNE_GRIDGLUE_MERGING_STANDARDMERGE_HH
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ +
64 unsigned int nSimplices() const
│ │ │ │ +
65 { return intersectionList()->size(); }
│ │ │ │ +
66
│ │ │ │ +
67 virtual void clear() = 0;
│ │ │ │ +
68
│ │ │ │ +
74 virtual std::shared_ptr<IntersectionList> intersectionList() const = 0;
│ │ │ │ +
75
│ │ │ │ +
79 template<int n>
│ │ │ │ +
80 unsigned int parents(unsigned int idx) const {
│ │ │ │ +
81 return intersectionList()->template parents<n>(idx);
│ │ │ │ +
82 }
│ │ │ │ +
83
│ │ │ │ +
90 template<int n>
│ │ │ │ +
91 unsigned int parent(unsigned int idx, unsigned int parId = 0) const
│ │ │ │ +
92 {
│ │ │ │ +
93 return intersectionList()->template parent<n>(idx, parId);
│ │ │ │ +
94 }
│ │ │ │ +
95
│ │ │ │ +
104 template<int n>
│ │ │ │ +
105 auto parentLocal(unsigned int idx, unsigned int corner, unsigned int parId = 0) const
│ │ │ │ +
106 {
│ │ │ │ +
107 return intersectionList()->template corner<n>(idx, corner, parId);
│ │ │ │ +
108 }
│ │ │ │ +
109
│ │ │ │ +
114 unsigned int counter;
│ │ │ │ +
115};
│ │ │ │ +
116
│ │ │ │ +
117} /* namespace GridGlue */
│ │ │ │ +
118} /* namespace Dune */
│ │ │ │ +
119
│ │ │ │ +
120#endif
│ │ │ │ + │ │ │ │
Definition: gridglue.hh:37
│ │ │ │ -
STANDARD_MERGE_INSTANTIATE(double, 1, 1, 1)
│ │ │ │ -
IteratorRange<... > intersections(const GridGlue<... > &glue, const Reverse<... > &reverse=!reversed)
Iterate over all intersections of a GridGlue.
│ │ │ │ -
Definition: intersectionlist.hh:207
│ │ │ │ - │ │ │ │ +
Coordinate corner(unsigned c)
Definition: projection_impl.hh:24
│ │ │ │ +
Definition: intersectionlist.hh:134
│ │ │ │
Abstract base for all classes that take extracted grids and build sets of intersections.
Definition: merger.hh:27
│ │ │ │ -
Dune::FieldVector< T, dimworld > WorldCoords
the coordinate type used in this interface
Definition: merger.hh:37
│ │ │ │ -
Dune::GridGlue::IntersectionList< Grid1Coords, Grid2Coords > IntersectionList
Definition: merger.hh:39
│ │ │ │ -
Dune::FieldVector< T, grid1Dim > Grid1Coords
the local coordinate type for the grid1 coordinates
Definition: merger.hh:31
│ │ │ │ -
Dune::FieldVector< T, grid2Dim > Grid2Coords
the local coordinate type for the grid2 coordinates
Definition: merger.hh:34
│ │ │ │ -
Common base class for many merger implementations: produce pairs of entities that may intersect.
Definition: standardmerge.hh:58
│ │ │ │ -
virtual void computeIntersections(const Dune::GeometryType &grid1ElementType, const std::vector< Dune::FieldVector< T, dimworld > > &grid1ElementCorners, std::bitset<(1<< grid1Dim)> &neighborIntersects1, unsigned int grid1Index, const Dune::GeometryType &grid2ElementType, const std::vector< Dune::FieldVector< T, dimworld > > &grid2ElementCorners, std::bitset<(1<< grid2Dim)> &neighborIntersects2, unsigned int grid2Index, std::vector< SimplicialIntersection > &intersections)=0
Compute the intersection between two overlapping elements.
│ │ │ │ -
std::shared_ptr< IntersectionList > intersectionList_
Definition: standardmerge.hh:124
│ │ │ │ -
typename Base::Grid1Coords Grid1Coords
Type used for local coordinates on the grid1 side.
Definition: standardmerge.hh:69
│ │ │ │ -
void enableFallback(bool fallback)
Definition: standardmerge.hh:166
│ │ │ │ -
std::vector< std::vector< int > > elementNeighbors2_
Definition: standardmerge.hh:131
│ │ │ │ -
std::vector< std::vector< int > > elementNeighbors1_
Definition: standardmerge.hh:130
│ │ │ │ -
T ctype
the numeric type used in this interface
Definition: standardmerge.hh:66
│ │ │ │ -
void clear() override
Definition: standardmerge.hh:150
│ │ │ │ -
typename Base::IntersectionList IntersectionList
Definition: standardmerge.hh:77
│ │ │ │ -
bool computeIntersection(unsigned int candidate0, unsigned int candidate1, const std::vector< Dune::FieldVector< T, dimworld > > &grid1Coords, const std::vector< Dune::GeometryType > &grid1_element_types, std::bitset<(1<< grid1Dim)> &neighborIntersects1, const std::vector< Dune::FieldVector< T, dimworld > > &grid2Coords, const std::vector< Dune::GeometryType > &grid2_element_types, std::bitset<(1<< grid2Dim)> &neighborIntersects2, bool insert=true)
Compute the intersection between two overlapping elements.
Definition: standardmerge.hh:263
│ │ │ │ -
void enableBruteForce(bool bruteForce)
Definition: standardmerge.hh:171
│ │ │ │ -
std::shared_ptr< IntersectionListProvider > intersectionListProvider_
Definition: standardmerge.hh:123
│ │ │ │ -
void build(const std::vector< Dune::FieldVector< T, dimworld > > &grid1_Coords, const std::vector< unsigned int > &grid1_elements, const std::vector< Dune::GeometryType > &grid1_element_types, const std::vector< Dune::FieldVector< T, dimworld > > &grid2_coords, const std::vector< unsigned int > &grid2_elements, const std::vector< Dune::GeometryType > &grid2_element_types) override
builds the merged grid
Definition: standardmerge.hh:392
│ │ │ │ -
std::vector< std::vector< unsigned int > > grid1ElementCorners_
Temporary internal data.
Definition: standardmerge.hh:127
│ │ │ │ -
std::vector< std::vector< unsigned int > > grid2ElementCorners_
Definition: standardmerge.hh:128
│ │ │ │ -
typename Base::Grid2Coords Grid2Coords
Type used for local coordinates on the grid2 side.
Definition: standardmerge.hh:72
│ │ │ │ -
std::shared_ptr< IntersectionList > intersectionList() const final
Definition: standardmerge.hh:160
│ │ │ │ -
virtual ~StandardMerge()=default
│ │ │ │ -
SimplicialIntersection RemoteSimplicialIntersection
Definition: standardmerge.hh:84
│ │ │ │ -
bool valid
Definition: standardmerge.hh:86
│ │ │ │ -
StandardMerge()
Definition: standardmerge.hh:88
│ │ │ │ -
typename IntersectionListProvider::SimplicialIntersection SimplicialIntersection
Definition: standardmerge.hh:83
│ │ │ │ -
typename Base::WorldCoords WorldCoords
the coordinate type used in this interface
Definition: standardmerge.hh:75
│ │ │ │ +
unsigned int parent(unsigned int idx, unsigned int parId=0) const
get index of grid-n's parent simplex for given merged grid simplex
Definition: merger.hh:91
│ │ │ │ +
virtual void clear()=0
│ │ │ │ +
Dune::FieldVector< ctype, dimworld > WorldCoords
the coordinate type used in this interface
Definition: merger.hh:37
│ │ │ │ +
Dune::FieldVector< ctype, grid1Dim > Grid1Coords
the local coordinate type for the grid1 coordinates
Definition: merger.hh:31
│ │ │ │ +
unsigned int counter
Counts the number of times the computeIntersection method has been called.
Definition: merger.hh:114
│ │ │ │ +
auto parentLocal(unsigned int idx, unsigned int corner, unsigned int parId=0) const
get the grid-n parent's simplex local coordinates for a particular merged grid simplex corner (parent...
Definition: merger.hh:105
│ │ │ │ +
virtual void build(const std::vector< Dune::FieldVector< ctype, dimworld > > &grid1_coords, const std::vector< unsigned int > &grid1_elements, const std::vector< Dune::GeometryType > &grid1_element_types, const std::vector< Dune::FieldVector< ctype, dimworld > > &grid2_coords, const std::vector< unsigned int > &grid2_elements, const std::vector< Dune::GeometryType > &grid2_element_types)=0
builds the merged grid
│ │ │ │ +
unsigned int nSimplices() const
get the number of simplices in the merged grid The indices are then in 0..nSimplices()-1
Definition: merger.hh:64
│ │ │ │ +
virtual std::shared_ptr< IntersectionList > intersectionList() const =0
│ │ │ │ +
unsigned int parents(unsigned int idx) const
Definition: merger.hh:80
│ │ │ │ +
Dune::FieldVector< ctype, grid2Dim > Grid2Coords
the local coordinate type for the grid2 coordinates
Definition: merger.hh:34
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,994 +5,143 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * merging │ │ │ │ │ -standardmerge.hh │ │ │ │ │ +merger.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 © DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 4// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only- │ │ │ │ │ with-dune-grid-glue-exception │ │ │ │ │ - 10#ifndef DUNE_GRIDGLUE_MERGING_STANDARDMERGE_HH │ │ │ │ │ - 11#define DUNE_GRIDGLUE_MERGING_STANDARDMERGE_HH │ │ │ │ │ + 5#ifndef DUNE_GRIDGLUE_MERGING_MERGER_HH │ │ │ │ │ + 6#define DUNE_GRIDGLUE_MERGING_MERGER_HH │ │ │ │ │ + 7 │ │ │ │ │ + 8#include │ │ │ │ │ + 9 │ │ │ │ │ + 10#include │ │ │ │ │ + 11#include │ │ │ │ │ 12 │ │ │ │ │ - 13 │ │ │ │ │ - 14#include │ │ │ │ │ - 15#include │ │ │ │ │ - 16#include │ │ │ │ │ - 17#include │ │ │ │ │ - 18#include │ │ │ │ │ - 19#include │ │ │ │ │ - 20#include │ │ │ │ │ - 21#include │ │ │ │ │ - 22#include │ │ │ │ │ - 23 │ │ │ │ │ - 24#include │ │ │ │ │ - 25#include │ │ │ │ │ - 26#include │ │ │ │ │ - 27#include │ │ │ │ │ - 28 │ │ │ │ │ - 29#include │ │ │ │ │ - 30#include │ │ │ │ │ - 31 │ │ │ │ │ - 32#include │ │ │ │ │ - 33#include │ │ │ │ │ - 34#include │ │ │ │ │ + 13#include │ │ │ │ │ + 14 │ │ │ │ │ + 15namespace Dune { │ │ │ │ │ + 16namespace GridGlue { │ │ │ │ │ + 17 │ │ │ │ │ + 25template │ │ │ │ │ +26class Merger │ │ │ │ │ + 27{ │ │ │ │ │ + 28public: │ │ │ │ │ + 29 │ │ │ │ │ +31 typedef Dune::FieldVector Grid1Coords; │ │ │ │ │ + 32 │ │ │ │ │ +34 typedef Dune::FieldVector Grid2Coords; │ │ │ │ │ 35 │ │ │ │ │ - 36namespace Dune { │ │ │ │ │ - 37namespace GridGlue { │ │ │ │ │ +37 typedef Dune::FieldVector WorldCoords; │ │ │ │ │ 38 │ │ │ │ │ - 55template │ │ │ │ │ -56class StandardMerge │ │ │ │ │ - 57 : public Merger │ │ │ │ │ - 58{ │ │ │ │ │ - 59 using Base = Merger; │ │ │ │ │ +39 using IntersectionList = Dune::GridGlue::IntersectionList; │ │ │ │ │ + 40 │ │ │ │ │ +54 virtual void build(const std::vector >& │ │ │ │ │ +grid1_coords, │ │ │ │ │ + 55 const std::vector& grid1_elements, │ │ │ │ │ + 56 const std::vector& grid1_element_types, │ │ │ │ │ + 57 const std::vector >& grid2_coords, │ │ │ │ │ + 58 const std::vector& grid2_elements, │ │ │ │ │ + 59 const std::vector& grid2_element_types) = 0; │ │ │ │ │ 60 │ │ │ │ │ - 61public: │ │ │ │ │ - 62 │ │ │ │ │ - 63 /* E X P O R T E D T Y P E S A N D C O N S T A N T S */ │ │ │ │ │ - 64 │ │ │ │ │ -66 typedef T ctype; │ │ │ │ │ - 67 │ │ │ │ │ -69 using Grid1Coords = typename Base::Grid1Coords; │ │ │ │ │ - 70 │ │ │ │ │ -72 using Grid2Coords = typename Base::Grid2Coords; │ │ │ │ │ - 73 │ │ │ │ │ -75 using WorldCoords = typename Base::WorldCoords; │ │ │ │ │ - 76 │ │ │ │ │ -77 using IntersectionList = typename Base::IntersectionList; │ │ │ │ │ - 78 │ │ │ │ │ - 79protected: │ │ │ │ │ - 80 │ │ │ │ │ -82 using IntersectionListProvider = │ │ │ │ │ -SimplicialIntersectionListProvider; │ │ │ │ │ -83 using SimplicialIntersection = typename IntersectionListProvider:: │ │ │ │ │ -SimplicialIntersection; │ │ │ │ │ -84 using RemoteSimplicialIntersection = SimplicialIntersection; │ │ │ │ │ - 85 │ │ │ │ │ -86 bool valid = false; │ │ │ │ │ - 87 │ │ │ │ │ -88 StandardMerge() │ │ │ │ │ - 89 : intersectionListProvider_(std::make_shared()) │ │ │ │ │ - 90 , intersectionList_(std::make_shared │ │ │ │ │ -(intersectionListProvider_)) │ │ │ │ │ - 91 {} │ │ │ │ │ - 92 │ │ │ │ │ -93 virtual ~StandardMerge() = default; │ │ │ │ │ - 94 │ │ │ │ │ -99 virtual void computeIntersections(const Dune::GeometryType& │ │ │ │ │ -grid1ElementType, │ │ │ │ │ - 100 const std::vector >& grid1ElementCorners, │ │ │ │ │ - 101 std::bitset<(1<& neighborIntersects1, │ │ │ │ │ - 102 unsigned int grid1Index, │ │ │ │ │ - 103 const Dune::GeometryType& grid2ElementType, │ │ │ │ │ - 104 const std::vector >& grid2ElementCorners, │ │ │ │ │ - 105 std::bitset<(1<& neighborIntersects2, │ │ │ │ │ - 106 unsigned int grid2Index, │ │ │ │ │ - 107 std::vector& intersections) = 0; │ │ │ │ │ - 108 │ │ │ │ │ -112 bool computeIntersection(unsigned int candidate0, unsigned int candidate1, │ │ │ │ │ - 113 const std::vector >& grid1Coords, │ │ │ │ │ - 114 const std::vector& grid1_element_types, │ │ │ │ │ - 115 std::bitset<(1<& neighborIntersects1, │ │ │ │ │ - 116 const std::vector >& grid2Coords, │ │ │ │ │ - 117 const std::vector& grid2_element_types, │ │ │ │ │ - 118 std::bitset<(1<& neighborIntersects2, │ │ │ │ │ - 119 bool insert = true); │ │ │ │ │ - 120 │ │ │ │ │ - 121 /* M E M B E R V A R I A B L E S */ │ │ │ │ │ - 122 │ │ │ │ │ -123 std::shared_ptr intersectionListProvider_; │ │ │ │ │ -124 std::shared_ptr intersectionList_; │ │ │ │ │ - 125 │ │ │ │ │ -127 std::vector > grid1ElementCorners_; │ │ │ │ │ -128 std::vector > grid2ElementCorners_; │ │ │ │ │ - 129 │ │ │ │ │ -130 std::vector > elementNeighbors1_; │ │ │ │ │ -131 std::vector > elementNeighbors2_; │ │ │ │ │ - 132 │ │ │ │ │ - 133public: │ │ │ │ │ - 134 │ │ │ │ │ - 135 /* C O N C E P T I M P L E M E N T I N G I N T E R F A C E */ │ │ │ │ │ - 136 │ │ │ │ │ -140 void build(const std::vector >& grid1_Coords, │ │ │ │ │ - 141 const std::vector& grid1_elements, │ │ │ │ │ - 142 const std::vector& grid1_element_types, │ │ │ │ │ - 143 const std::vector >& grid2_coords, │ │ │ │ │ - 144 const std::vector& grid2_elements, │ │ │ │ │ - 145 const std::vector& grid2_element_types) override; │ │ │ │ │ - 146 │ │ │ │ │ - 147 │ │ │ │ │ - 148 /* P R O B I N G T H E M E R G E D G R I D */ │ │ │ │ │ - 149 │ │ │ │ │ -150 void clear() override │ │ │ │ │ - 151 { │ │ │ │ │ - 152 // Delete old internal data, from a possible previous run │ │ │ │ │ - 153 intersectionListProvider_->clear(); │ │ │ │ │ - 154 purge(grid1ElementCorners_); │ │ │ │ │ - 155 purge(grid2ElementCorners_); │ │ │ │ │ - 156 │ │ │ │ │ - 157 valid = false; │ │ │ │ │ - 158 } │ │ │ │ │ - 159 │ │ │ │ │ -160 std::shared_ptr intersectionList() const final │ │ │ │ │ - 161 { │ │ │ │ │ - 162 assert(valid); │ │ │ │ │ - 163 return intersectionList_; │ │ │ │ │ - 164 } │ │ │ │ │ - 165 │ │ │ │ │ -166 void enableFallback(bool fallback) │ │ │ │ │ - 167 { │ │ │ │ │ - 168 m_enableFallback = fallback; │ │ │ │ │ - 169 } │ │ │ │ │ - 170 │ │ │ │ │ -171 void enableBruteForce(bool bruteForce) │ │ │ │ │ - 172 { │ │ │ │ │ - 173 m_enableBruteForce = bruteForce; │ │ │ │ │ - 174 } │ │ │ │ │ - 175 │ │ │ │ │ - 176private: │ │ │ │ │ - 180 bool m_enableFallback = false; │ │ │ │ │ - 181 │ │ │ │ │ - 185 bool m_enableBruteForce = false; │ │ │ │ │ - 186 │ │ │ │ │ - 187 auto& intersections() │ │ │ │ │ - 188 { return intersectionListProvider_->intersections(); } │ │ │ │ │ - 189 │ │ │ │ │ - 191 template │ │ │ │ │ - 192 static void purge(V & v) │ │ │ │ │ - 193 { │ │ │ │ │ - 194 v.clear(); │ │ │ │ │ - 195 V v2(v); │ │ │ │ │ - 196 v.swap(v2); │ │ │ │ │ - 197 } │ │ │ │ │ - 198 │ │ │ │ │ - 203 void generateSeed(std::vector& seeds, │ │ │ │ │ - 204 Dune::BitSetVector<1>& isHandled2, │ │ │ │ │ - 205 std::stack& candidates2, │ │ │ │ │ - 206 const std::vector >& grid1Coords, │ │ │ │ │ - 207 const std::vector& grid1_element_types, │ │ │ │ │ - 208 const std::vector >& grid2Coords, │ │ │ │ │ - 209 const std::vector& grid2_element_types); │ │ │ │ │ - 210 │ │ │ │ │ - 214 int insertIntersections(unsigned int candidate1, unsigned int │ │ │ │ │ -candidate2,std::vector& intersections); │ │ │ │ │ - 215 │ │ │ │ │ - 219 int bruteForceSearch(int candidate1, │ │ │ │ │ - 220 const std::vector >& grid1Coords, │ │ │ │ │ - 221 const std::vector& grid1_element_types, │ │ │ │ │ - 222 const std::vector >& grid2Coords, │ │ │ │ │ - 223 const std::vector& grid2_element_types); │ │ │ │ │ - 224 │ │ │ │ │ - 228 std::pair │ │ │ │ │ - 229 intersectionIndex(unsigned int grid1Index, unsigned int grid2Index, │ │ │ │ │ - 230 SimplicialIntersection& intersection); │ │ │ │ │ - 231 │ │ │ │ │ - 235 template │ │ │ │ │ - 236 void computeNeighborsPerElement(const std::vector& │ │ │ │ │ -gridElementTypes, │ │ │ │ │ - 237 const std::vector >& gridElementCorners, │ │ │ │ │ - 238 std::vector >& elementNeighbors); │ │ │ │ │ - 239 │ │ │ │ │ - 240 void buildAdvancingFront( │ │ │ │ │ - 241 const std::vector >& grid1_Coords, │ │ │ │ │ - 242 const std::vector& grid1_elements, │ │ │ │ │ - 243 const std::vector& grid1_element_types, │ │ │ │ │ - 244 const std::vector >& grid2_coords, │ │ │ │ │ - 245 const std::vector& grid2_elements, │ │ │ │ │ - 246 const std::vector& grid2_element_types │ │ │ │ │ - 247 ); │ │ │ │ │ - 248 │ │ │ │ │ - 249 void buildBruteForce( │ │ │ │ │ - 250 const std::vector >& grid1_Coords, │ │ │ │ │ - 251 const std::vector& grid1_elements, │ │ │ │ │ - 252 const std::vector& grid1_element_types, │ │ │ │ │ - 253 const std::vector >& grid2_coords, │ │ │ │ │ - 254 const std::vector& grid2_elements, │ │ │ │ │ - 255 const std::vector& grid2_element_types │ │ │ │ │ - 256 ); │ │ │ │ │ - 257}; │ │ │ │ │ - 258 │ │ │ │ │ - 259 │ │ │ │ │ - 260/* IMPLEMENTATION */ │ │ │ │ │ - 261 │ │ │ │ │ - 262template │ │ │ │ │ -263bool StandardMerge::computeIntersection │ │ │ │ │ -(unsigned int candidate0, unsigned int candidate1, │ │ │ │ │ - 264 const std::vector >& grid1Coords, │ │ │ │ │ - 265 const std::vector& grid1_element_types, │ │ │ │ │ - 266 std::bitset<(1<& neighborIntersects1, │ │ │ │ │ - 267 const std::vector >& grid2Coords, │ │ │ │ │ - 268 const std::vector& grid2_element_types, │ │ │ │ │ - 269 std::bitset<(1<& neighborIntersects2, │ │ │ │ │ - 270 bool insert) │ │ │ │ │ - 271{ │ │ │ │ │ - 272 // Select vertices of the grid1 element │ │ │ │ │ - 273 int grid1NumVertices = grid1ElementCorners_[candidate0].size(); │ │ │ │ │ - 274 std::vector > grid1ElementCorners │ │ │ │ │ -(grid1NumVertices); │ │ │ │ │ - 275 for (int i=0; i > grid2ElementCorners │ │ │ │ │ -(grid2NumVertices); │ │ │ │ │ - 281 for (int i=0; i intersections(0); │ │ │ │ │ - 289 │ │ │ │ │ - 290 // compute the intersections │ │ │ │ │ - 291 computeIntersections(grid1_element_types[candidate0], grid1ElementCorners, │ │ │ │ │ - 292 neighborIntersects1, candidate0, │ │ │ │ │ - 293 grid2_element_types[candidate1], grid2ElementCorners, │ │ │ │ │ - 294 neighborIntersects2, candidate1, │ │ │ │ │ - 295 intersections); │ │ │ │ │ - 296 │ │ │ │ │ - 297 // insert intersections if needed │ │ │ │ │ - 298 if(insert && !intersections.empty()) │ │ │ │ │ - 299 insertIntersections(candidate0,candidate1,intersections); │ │ │ │ │ - 300 │ │ │ │ │ - 301 // Have we found an intersection? │ │ │ │ │ - 302 return !intersections.empty() || neighborIntersects1.any() || │ │ │ │ │ -neighborIntersects2.any(); │ │ │ │ │ - 303 │ │ │ │ │ - 304} │ │ │ │ │ - 305 │ │ │ │ │ - 306template │ │ │ │ │ - 307int StandardMerge::bruteForceSearch(int │ │ │ │ │ -candidate1, │ │ │ │ │ - 308 const std::vector >& grid1Coords, │ │ │ │ │ - 309 const std::vector& grid1_element_types, │ │ │ │ │ - 310 const std::vector >& grid2Coords, │ │ │ │ │ - 311 const std::vector& grid2_element_types) │ │ │ │ │ - 312{ │ │ │ │ │ - 313 std::bitset<(1< neighborIntersects1; │ │ │ │ │ - 314 std::bitset<(1< neighborIntersects2; │ │ │ │ │ - 315 for (std::size_t i=0; i │ │ │ │ │ - 333template │ │ │ │ │ - 334void StandardMerge:: │ │ │ │ │ - 335computeNeighborsPerElement(const std::vector& │ │ │ │ │ -gridElementTypes, │ │ │ │ │ - 336 const std::vector >& gridElementCorners, │ │ │ │ │ - 337 std::vector >& elementNeighbors) │ │ │ │ │ - 338{ │ │ │ │ │ - 339 typedef std::vector FaceType; │ │ │ │ │ - 340 typedef std::map > │ │ │ │ │ -FaceSetType; │ │ │ │ │ - 341 │ │ │ │ │ - 343 // First: grid 1 │ │ │ │ │ - 345 FaceSetType faces; │ │ │ │ │ - 346 elementNeighbors.resize(gridElementTypes.size()); │ │ │ │ │ - 347 │ │ │ │ │ - 348 for (size_t i=0; i::general │ │ │ │ │ -(gridElementTypes[i]).size(1), -1); │ │ │ │ │ - 350 │ │ │ │ │ - 351 for (size_t i=0; i::general │ │ │ │ │ -(gridElementTypes[i]); │ │ │ │ │ - 353 │ │ │ │ │ - 354 for (size_t j=0; j<(size_t)refElement.size(1); j++) { // iterate over all │ │ │ │ │ -faces of the element │ │ │ │ │ - 355 │ │ │ │ │ - 356 FaceType face; │ │ │ │ │ - 357 // extract element face │ │ │ │ │ - 358 for (size_t k=0; k<(size_t)refElement.size(j,1,gridDim); k++) │ │ │ │ │ - 359 face.push_back(gridElementCorners[i][refElement.subEntity │ │ │ │ │ -(j,1,k,gridDim)]); │ │ │ │ │ - 360 │ │ │ │ │ - 361 // sort the face vertices to get rid of twists and other permutations │ │ │ │ │ - 362 std::sort(face.begin(), face.end()); │ │ │ │ │ - 363 │ │ │ │ │ - 364 typename FaceSetType::iterator faceHandle = faces.find(face); │ │ │ │ │ - 365 │ │ │ │ │ - 366 if (faceHandle == faces.end()) { │ │ │ │ │ - 367 │ │ │ │ │ - 368 // face has not been visited before │ │ │ │ │ - 369 faces.insert(std::make_pair(face, std::make_pair(i,j))); │ │ │ │ │ - 370 │ │ │ │ │ - 371 } else { │ │ │ │ │ - 372 │ │ │ │ │ - 373 // face has been visited before: store the mutual neighbor information │ │ │ │ │ - 374 elementNeighbors[i][j] = faceHandle->second.first; │ │ │ │ │ - 375 elementNeighbors[faceHandle->second.first][faceHandle->second.second] = i; │ │ │ │ │ - 376 │ │ │ │ │ - 377 faces.erase(faceHandle); │ │ │ │ │ - 378 │ │ │ │ │ - 379 } │ │ │ │ │ - 380 │ │ │ │ │ - 381 } │ │ │ │ │ - 382 │ │ │ │ │ - 383 } │ │ │ │ │ - 384} │ │ │ │ │ - 385 │ │ │ │ │ - 386// ///////////////////////////////////////////////////////////////////// │ │ │ │ │ - 387// Compute the intersection of all pairs of elements │ │ │ │ │ - 388// Linear algorithm by Gander and Japhet, Proc. of DD18 │ │ │ │ │ - 389// ///////////////////////////////////////////////////////////////////// │ │ │ │ │ - 390 │ │ │ │ │ - 391template │ │ │ │ │ -392void StandardMerge::build(const std:: │ │ │ │ │ -vector >& grid1Coords, │ │ │ │ │ - 393 const std::vector& grid1_elements, │ │ │ │ │ - 394 const std::vector& grid1_element_types, │ │ │ │ │ - 395 const std::vector >& grid2Coords, │ │ │ │ │ - 396 const std::vector& grid2_elements, │ │ │ │ │ - 397 const std::vector& grid2_element_types │ │ │ │ │ - 398 ) │ │ │ │ │ - 399{ │ │ │ │ │ - 400 │ │ │ │ │ - 401 std::cout << "StandardMerge building merged grid..." << std::endl; │ │ │ │ │ - 402 Dune::Timer watch; │ │ │ │ │ - 403 │ │ │ │ │ - 404 clear(); │ │ │ │ │ - 405 // clear global intersection list │ │ │ │ │ - 406 intersectionListProvider_->clear(); │ │ │ │ │ - 407 this->counter = 0; │ │ │ │ │ - 408 │ │ │ │ │ - 409 // ///////////////////////////////////////////////////////////////////// │ │ │ │ │ - 410 // Copy element corners into a data structure with block-structure. │ │ │ │ │ - 411 // This is not as efficient but a lot easier to use. │ │ │ │ │ - 412 // We may think about efficiency later. │ │ │ │ │ - 413 // ///////////////////////////////////////////////////////////////////// │ │ │ │ │ - 414 │ │ │ │ │ - 415 // first the grid1 side │ │ │ │ │ - 416 grid1ElementCorners_.resize(grid1_element_types.size()); │ │ │ │ │ - 417 │ │ │ │ │ - 418 unsigned int grid1CornerCounter = 0; │ │ │ │ │ - 419 │ │ │ │ │ - 420 for (std::size_t i=0; i::general │ │ │ │ │ -(grid1_element_types[i]).size(grid1Dim); │ │ │ │ │ - 424 grid1ElementCorners_[i].resize(numVertices); │ │ │ │ │ - 425 for (int j=0; j::general │ │ │ │ │ -(grid2_element_types[i]).size(grid2Dim); │ │ │ │ │ - 439 grid2ElementCorners_[i].resize(numVertices); │ │ │ │ │ - 440 for (int j=0; j(grid1_element_types, │ │ │ │ │ -grid1ElementCorners_, elementNeighbors1_); │ │ │ │ │ - 450 computeNeighborsPerElement(grid2_element_types, │ │ │ │ │ -grid2ElementCorners_, elementNeighbors2_); │ │ │ │ │ - 451 │ │ │ │ │ - 452 std::cout << "setup took " << watch.elapsed() << " seconds." << std::endl; │ │ │ │ │ - 453 │ │ │ │ │ - 454 if (m_enableBruteForce) │ │ │ │ │ - 455 buildBruteForce(grid1Coords, grid1_elements, grid1_element_types, │ │ │ │ │ -grid2Coords, grid2_elements, grid2_element_types); │ │ │ │ │ - 456 else │ │ │ │ │ - 457 buildAdvancingFront(grid1Coords, grid1_elements, grid1_element_types, │ │ │ │ │ -grid2Coords, grid2_elements, grid2_element_types); │ │ │ │ │ - 458 │ │ │ │ │ - 459 valid = true; │ │ │ │ │ - 460 std::cout << "intersection construction took " << watch.elapsed() << " │ │ │ │ │ -seconds." << std::endl; │ │ │ │ │ - 461} │ │ │ │ │ - 462 │ │ │ │ │ - 463template │ │ │ │ │ - 464void StandardMerge::buildAdvancingFront( │ │ │ │ │ - 465 const std::vector >& grid1Coords, │ │ │ │ │ - 466 const std::vector& grid1_elements, │ │ │ │ │ - 467 const std::vector& grid1_element_types, │ │ │ │ │ - 468 const std::vector >& grid2Coords, │ │ │ │ │ - 469 const std::vector& grid2_elements, │ │ │ │ │ - 470 const std::vector& grid2_element_types │ │ │ │ │ - 471 ) │ │ │ │ │ - 472{ │ │ │ │ │ - 474 // Data structures for the advancing-front algorithm │ │ │ │ │ - 476 │ │ │ │ │ - 477 std::stack candidates1; │ │ │ │ │ - 478 std::stack candidates2; │ │ │ │ │ - 479 │ │ │ │ │ - 480 std::vector seeds(grid2_element_types.size(), -1); │ │ │ │ │ - 481 │ │ │ │ │ - 482 // ///////////////////////////////////////////////////////////////////// │ │ │ │ │ - 483 // Do a brute-force search to find one pair of intersecting elements │ │ │ │ │ - 484 // to start the advancing-front type algorithm with. │ │ │ │ │ - 485 // ///////////////////////////////////////////////////////////////////// │ │ │ │ │ - 486 │ │ │ │ │ - 487 // Set flag if element has been handled │ │ │ │ │ - 488 Dune::BitSetVector<1> isHandled2(grid2_element_types.size()); │ │ │ │ │ - 489 │ │ │ │ │ - 490 // Set flag if the element has been entered in the queue │ │ │ │ │ - 491 Dune::BitSetVector<1> isCandidate2(grid2_element_types.size()); │ │ │ │ │ - 492 │ │ │ │ │ - 493 generateSeed(seeds, isHandled2, candidates2, grid1Coords, │ │ │ │ │ -grid1_element_types, grid2Coords, grid2_element_types); │ │ │ │ │ - 494 │ │ │ │ │ - 495 // ///////////////////////////////////////////////////////////////////// │ │ │ │ │ - 496 // Main loop │ │ │ │ │ - 497 // ///////////////////////////////////////////////////////////////////// │ │ │ │ │ - 498 │ │ │ │ │ - 499 std::set isHandled1; │ │ │ │ │ - 500 │ │ │ │ │ - 501 std::set isCandidate1; │ │ │ │ │ - 502 │ │ │ │ │ - 503 while (!candidates2.empty()) { │ │ │ │ │ - 504 │ │ │ │ │ - 505 // Get the next element on the grid2 side │ │ │ │ │ - 506 unsigned int currentCandidate2 = candidates2.top(); │ │ │ │ │ - 507 int seed = seeds[currentCandidate2]; │ │ │ │ │ - 508 assert(seed >= 0); │ │ │ │ │ - 509 │ │ │ │ │ - 510 candidates2.pop(); │ │ │ │ │ - 511 isHandled2[currentCandidate2] = true; │ │ │ │ │ - 512 │ │ │ │ │ - 513 // Start advancing front algorithm on the grid1 side from the 'seed' │ │ │ │ │ -element that │ │ │ │ │ - 514 // we stored along with the current grid2 element │ │ │ │ │ - 515 candidates1.push(seed); │ │ │ │ │ - 516 │ │ │ │ │ - 517 isHandled1.clear(); │ │ │ │ │ - 518 isCandidate1.clear(); │ │ │ │ │ - 519 │ │ │ │ │ - 520 while (!candidates1.empty()) { │ │ │ │ │ - 521 │ │ │ │ │ - 522 unsigned int currentCandidate1 = candidates1.top(); │ │ │ │ │ - 523 candidates1.pop(); │ │ │ │ │ - 524 isHandled1.insert(currentCandidate1); │ │ │ │ │ - 525 │ │ │ │ │ - 526 // Test whether there is an intersection between currentCandidate0 and │ │ │ │ │ -currentCandidate1 │ │ │ │ │ - 527 std::bitset<(1< neighborIntersects1; │ │ │ │ │ - 528 std::bitset<(1< neighborIntersects2; │ │ │ │ │ - 529 bool intersectionFound = computeIntersection(currentCandidate1, │ │ │ │ │ -currentCandidate2, │ │ │ │ │ - 530 grid1Coords,grid1_element_types, neighborIntersects1, │ │ │ │ │ - 531 grid2Coords,grid2_element_types, neighborIntersects2); │ │ │ │ │ - 532 │ │ │ │ │ - 533 for (size_t i=0; i-1) { │ │ │ │ │ - 574 │ │ │ │ │ - 575 isCandidate2[neighbor][0] = true; │ │ │ │ │ - 576 candidates2.push(neighbor); │ │ │ │ │ - 577 seedFound = true; │ │ │ │ │ - 578 } │ │ │ │ │ - 579 } │ │ │ │ │ - 580 │ │ │ │ │ - 581 if (seedFound || !m_enableFallback) │ │ │ │ │ - 582 continue; │ │ │ │ │ - 583 │ │ │ │ │ - 584 // There is no neighbor with a seed, so we need to be a bit more │ │ │ │ │ -aggressive... │ │ │ │ │ - 585 // get all neighbors of currentCandidate2, but not currentCandidate2 │ │ │ │ │ -itself │ │ │ │ │ - 586 for (size_t i=0; i::iterator seedIt = isHandled1.begin │ │ │ │ │ -(); │ │ │ │ │ - 601 seedIt != isHandled1.end(); ++seedIt) { │ │ │ │ │ - 602 │ │ │ │ │ - 603 std::bitset<(1< neighborIntersects1; │ │ │ │ │ - 604 std::bitset<(1< neighborIntersects2; │ │ │ │ │ - 605 bool intersectionFound = computeIntersection(*seedIt, neighbor, │ │ │ │ │ - 606 grid1Coords, grid1_element_types, neighborIntersects1, │ │ │ │ │ - 607 grid2Coords, grid2_element_types, neighborIntersects2, │ │ │ │ │ - 608 false); │ │ │ │ │ - 609 │ │ │ │ │ - 610 // if the intersection is nonempty, *seedIt is our new seed candidate on │ │ │ │ │ -the grid1 side │ │ │ │ │ - 611 if (intersectionFound) { │ │ │ │ │ - 612 seed = *seedIt; │ │ │ │ │ - 613 Dune::dwarn << "Algorithm entered first fallback method and found a new │ │ │ │ │ -seed in the build algorithm." << │ │ │ │ │ - 614 "Probably, the neighborIntersects bitsets computed in computeIntersection │ │ │ │ │ -specialization is wrong." << std::endl; │ │ │ │ │ - 615 break; │ │ │ │ │ - 616 } │ │ │ │ │ - 617 │ │ │ │ │ - 618 } │ │ │ │ │ - 619 │ │ │ │ │ - 620 if (seed < 0) { │ │ │ │ │ - 621 // The fast method didn't find a grid1 element that intersects with │ │ │ │ │ - 622 // the new grid2 candidate. We have to do a brute-force search. │ │ │ │ │ - 623 seed = bruteForceSearch(neighbor, │ │ │ │ │ - 624 grid1Coords,grid1_element_types, │ │ │ │ │ - 625 grid2Coords,grid2_element_types); │ │ │ │ │ - 626 Dune::dwarn << "Algorithm entered second fallback method. This probably │ │ │ │ │ -should not happen." << std::endl; │ │ │ │ │ - 627 │ │ │ │ │ - 628 } │ │ │ │ │ - 629 │ │ │ │ │ - 630 // We have tried all we could: the candidate is 'handled' now │ │ │ │ │ - 631 isCandidate2[neighbor] = true; │ │ │ │ │ - 632 │ │ │ │ │ - 633 // still no seed? Then the new grid2 candidate isn't overlapped by │ │ │ │ │ -anything │ │ │ │ │ - 634 if (seed < 0) │ │ │ │ │ - 635 continue; │ │ │ │ │ - 636 │ │ │ │ │ - 637 // we have a seed now │ │ │ │ │ - 638 candidates2.push(neighbor); │ │ │ │ │ - 639 seeds[neighbor] = seed; │ │ │ │ │ - 640 seedFound = true; │ │ │ │ │ - 641 │ │ │ │ │ - 642 } │ │ │ │ │ - 643 │ │ │ │ │ - 644 } │ │ │ │ │ - 645 │ │ │ │ │ - 646 /* Do a brute-force search if there is still no seed: │ │ │ │ │ - 647 * There might still be a disconnected region out there. │ │ │ │ │ - 648 */ │ │ │ │ │ - 649 if (!seedFound && candidates2.empty()) { │ │ │ │ │ - 650 generateSeed(seeds, isHandled2, candidates2, grid1Coords, │ │ │ │ │ -grid1_element_types, grid2Coords, grid2_element_types); │ │ │ │ │ - 651 } │ │ │ │ │ - 652 } │ │ │ │ │ - 653} │ │ │ │ │ - 654 │ │ │ │ │ - 655template │ │ │ │ │ - 656void StandardMerge::buildBruteForce( │ │ │ │ │ - 657 const std::vector >& grid1Coords, │ │ │ │ │ - 658 const std::vector& grid1_elements, │ │ │ │ │ - 659 const std::vector& grid1_element_types, │ │ │ │ │ - 660 const std::vector >& grid2Coords, │ │ │ │ │ - 661 const std::vector& grid2_elements, │ │ │ │ │ - 662 const std::vector& grid2_element_types │ │ │ │ │ - 663 ) │ │ │ │ │ - 664{ │ │ │ │ │ - 665 std::bitset<(1< neighborIntersects1; │ │ │ │ │ - 666 std::bitset<(1< neighborIntersects2; │ │ │ │ │ - 667 │ │ │ │ │ - 668 for (unsigned i = 0; i < grid1_element_types.size(); ++i) { │ │ │ │ │ - 669 for (unsigned j = 0; j < grid2_element_types.size(); ++j) { │ │ │ │ │ - 670 (void) computeIntersection(i, j, │ │ │ │ │ - 671 grid1Coords, grid1_element_types, neighborIntersects1, │ │ │ │ │ - 672 grid2Coords, grid2_element_types, neighborIntersects2); │ │ │ │ │ - 673 } │ │ │ │ │ - 674 } │ │ │ │ │ - 675} │ │ │ │ │ - 676 │ │ │ │ │ - 677template │ │ │ │ │ - 678void StandardMerge::generateSeed(std:: │ │ │ │ │ -vector& seeds, Dune::BitSetVector<1>& isHandled2, std::stack& │ │ │ │ │ -candidates2, const std::vector >& grid1Coords, │ │ │ │ │ -const std::vector& grid1_element_types, const std:: │ │ │ │ │ -vector >& grid2Coords, const std::vector& grid2_element_types) │ │ │ │ │ - 679{ │ │ │ │ │ - 680 for (std::size_t j=0; j 0 || isHandled2[j][0]) │ │ │ │ │ - 683 continue; │ │ │ │ │ - 684 │ │ │ │ │ - 685 int seed = bruteForceSearch │ │ │ │ │ -(j,grid1Coords,grid1_element_types,grid2Coords,grid2_element_types); │ │ │ │ │ - 686 │ │ │ │ │ - 687 if (seed >= 0) { │ │ │ │ │ - 688 candidates2.push(j); // the candidate and a seed for the candidate │ │ │ │ │ - 689 seeds[j] = seed; │ │ │ │ │ - 690 break; │ │ │ │ │ - 691 } else // If the brute force search did not find any intersection we can │ │ │ │ │ -skip this element │ │ │ │ │ - 692 isHandled2[j] = true; │ │ │ │ │ - 693 } │ │ │ │ │ - 694} │ │ │ │ │ - 695 │ │ │ │ │ - 696template │ │ │ │ │ - 697int StandardMerge::insertIntersections │ │ │ │ │ -(unsigned int candidate1, unsigned int candidate2, │ │ │ │ │ - 698 std::vector& intersections) │ │ │ │ │ - 699{ │ │ │ │ │ - 700 typedef typename std::vector::size_type size_t; │ │ │ │ │ - 701 int count = 0; │ │ │ │ │ - 702 │ │ │ │ │ - 703 for (size_t i = 0; i < intersections.size(); ++i) { │ │ │ │ │ - 704 // get the intersection index of the current intersection from │ │ │ │ │ -intersections in this->intersections │ │ │ │ │ - 705 bool found; │ │ │ │ │ - 706 unsigned int index; │ │ │ │ │ - 707 std::tie(found, index) = intersectionIndex │ │ │ │ │ -(candidate1,candidate2,intersections[i]); │ │ │ │ │ - 708 │ │ │ │ │ - 709 if (found && index >= this->intersections().size()) { //the intersection │ │ │ │ │ -is not yet contained in this->intersections │ │ │ │ │ - 710 this->intersections().push_back(intersections[i]); // insert │ │ │ │ │ - 711 │ │ │ │ │ - 712 ++count; │ │ │ │ │ - 713 } else if (found) { │ │ │ │ │ - 714 auto& intersection = this->intersections()[index]; │ │ │ │ │ - 715 │ │ │ │ │ - 716 // insert each grid1 element and local representation of intersections[i] │ │ │ │ │ -with parent candidate1 │ │ │ │ │ - 717 for (size_t j = 0; j < intersections[i].parents0.size(); ++j) { │ │ │ │ │ - 718 intersection.parents0.push_back(candidate1); │ │ │ │ │ - 719 intersection.corners0.push_back(intersections[i].corners0[j]); │ │ │ │ │ - 720 } │ │ │ │ │ - 721 │ │ │ │ │ - 722 // insert each grid2 element and local representation of intersections[i] │ │ │ │ │ -with parent candidate2 │ │ │ │ │ - 723 for (size_t j = 0; j < intersections[i].parents1.size(); ++j) { │ │ │ │ │ - 724 intersection.parents1.push_back(candidate2); │ │ │ │ │ - 725 intersection.corners1.push_back(intersections[i].corners1[j]); │ │ │ │ │ - 726 } │ │ │ │ │ - 727 │ │ │ │ │ - 728 ++count; │ │ │ │ │ - 729 } else { │ │ │ │ │ - 730 Dune::dwarn << "Computed the same intersection twice!" << std::endl; │ │ │ │ │ - 731 } │ │ │ │ │ - 732 } │ │ │ │ │ - 733 return count; │ │ │ │ │ - 734} │ │ │ │ │ - 735 │ │ │ │ │ - 736template │ │ │ │ │ - 737std::pair │ │ │ │ │ - 738StandardMerge::intersectionIndex(unsigned int │ │ │ │ │ -grid1Index, unsigned int grid2Index, │ │ │ │ │ - 739 SimplicialIntersection& intersection) { │ │ │ │ │ - 740 │ │ │ │ │ - 741 │ │ │ │ │ - 742 // return index in intersections_ if at least one local representation of │ │ │ │ │ -a Simplicial Intersection (SI) │ │ │ │ │ - 743 // of intersections_ is equal to the local representation of one element │ │ │ │ │ -in intersections │ │ │ │ │ - 744 │ │ │ │ │ - 745 std::size_t n_intersections = this->intersections().size(); │ │ │ │ │ - 746 if (grid1Dim == grid2Dim) │ │ │ │ │ - 747 return {true, n_intersections}; │ │ │ │ │ - 748 │ │ │ │ │ - 749 T eps = 1e-10; │ │ │ │ │ - 750 │ │ │ │ │ - 751 for (std::size_t i = 0; i < n_intersections; ++i) { │ │ │ │ │ - 752 │ │ │ │ │ - 753 // compare the local representation of the subelements of the SI │ │ │ │ │ - 754 for (std::size_t ei = 0; ei < this->intersections()[i].parents0.size(); │ │ │ │ │ -++ei) // merger subelement │ │ │ │ │ - 755 { │ │ │ │ │ - 756 if (this->intersections()[i].parents0[ei] == grid1Index) │ │ │ │ │ - 757 { │ │ │ │ │ - 758 for (std::size_t er = 0; er < intersection.parents0.size(); ++er) // list │ │ │ │ │ -subelement │ │ │ │ │ - 759 { │ │ │ │ │ - 760 bool found_all = true; │ │ │ │ │ - 761 // compare the local coordinate representations │ │ │ │ │ - 762 for (std::size_t ci = 0; ci < this->intersections()[i].corners0[ei].size │ │ │ │ │ -(); ++ci) │ │ │ │ │ - 763 { │ │ │ │ │ - 764 Dune::FieldVector ni = this->intersections()[i].corners0[ei] │ │ │ │ │ -[ci]; │ │ │ │ │ - 765 bool found_ni = false; │ │ │ │ │ - 766 for (std::size_t cr = 0; cr < intersection.corners0[er].size(); ++cr) │ │ │ │ │ - 767 { │ │ │ │ │ - 768 Dune::FieldVector nr = intersection.corners0[er][cr]; │ │ │ │ │ - 769 │ │ │ │ │ - 770 found_ni = found_ni || ((ni-nr).infinity_norm() < eps); │ │ │ │ │ - 771 if (found_ni) │ │ │ │ │ - 772 break; │ │ │ │ │ - 773 } │ │ │ │ │ - 774 found_all = found_all && found_ni; │ │ │ │ │ - 775 │ │ │ │ │ - 776 if (!found_ni) │ │ │ │ │ - 777 break; │ │ │ │ │ - 778 } │ │ │ │ │ - 779 │ │ │ │ │ - 780 if (found_all && (this->intersections()[i].parents1[ei] != grid2Index)) │ │ │ │ │ - 781 return {true, i}; │ │ │ │ │ - 782 else if (found_all) │ │ │ │ │ - 783 return {false, 0}; │ │ │ │ │ - 784 } │ │ │ │ │ - 785 } │ │ │ │ │ - 786 } │ │ │ │ │ - 787 │ │ │ │ │ - 788 // compare the local representation of the subelements of the SI │ │ │ │ │ - 789 for (std::size_t ei = 0; ei < this->intersections()[i].parents1.size(); │ │ │ │ │ -++ei) // merger subelement │ │ │ │ │ - 790 { │ │ │ │ │ - 791 if (this->intersections()[i].parents1[ei] == grid2Index) │ │ │ │ │ - 792 { │ │ │ │ │ - 793 for (std::size_t er = 0; er < intersection.parents1.size(); ++er) // list │ │ │ │ │ -subelement │ │ │ │ │ - 794 { │ │ │ │ │ - 795 bool found_all = true; │ │ │ │ │ - 796 // compare the local coordinate representations │ │ │ │ │ - 797 for (std::size_t ci = 0; ci < this->intersections()[i].corners1[ei].size │ │ │ │ │ -(); ++ci) │ │ │ │ │ - 798 { │ │ │ │ │ - 799 Dune::FieldVector ni = this->intersections()[i].corners1[ei] │ │ │ │ │ -[ci]; │ │ │ │ │ - 800 bool found_ni = false; │ │ │ │ │ - 801 for (std::size_t cr = 0; cr < intersection.corners1[er].size(); ++cr) │ │ │ │ │ - 802 { │ │ │ │ │ - 803 Dune::FieldVector nr = intersection.corners1[er][cr]; │ │ │ │ │ - 804 found_ni = found_ni || ((ni-nr).infinity_norm() < eps); │ │ │ │ │ - 805 │ │ │ │ │ - 806 if (found_ni) │ │ │ │ │ - 807 break; │ │ │ │ │ - 808 } │ │ │ │ │ - 809 found_all = found_all && found_ni; │ │ │ │ │ - 810 │ │ │ │ │ - 811 if (!found_ni) │ │ │ │ │ - 812 break; │ │ │ │ │ - 813 } │ │ │ │ │ - 814 │ │ │ │ │ - 815 if (found_all && (this->intersections()[i].parents0[ei] != grid1Index)) │ │ │ │ │ - 816 return {true, i}; │ │ │ │ │ - 817 else if (found_all) │ │ │ │ │ - 818 return {false, 0}; │ │ │ │ │ - 819 } │ │ │ │ │ - 820 } │ │ │ │ │ - 821 } │ │ │ │ │ - 822 } │ │ │ │ │ - 823 │ │ │ │ │ - 824 return {true, n_intersections}; │ │ │ │ │ - 825} │ │ │ │ │ - 826 │ │ │ │ │ -827#define DECL extern │ │ │ │ │ -828#define STANDARD_MERGE_INSTANTIATE(T,A,B,C) \ │ │ │ │ │ - 829 DECL template \ │ │ │ │ │ - 830 void StandardMerge::build(const std::vector >& grid1Coords, \ │ │ │ │ │ - 831 const std::vector& grid1_elements, \ │ │ │ │ │ - 832 const std::vector& grid1_element_types, \ │ │ │ │ │ - 833 const std::vector >& grid2Coords, \ │ │ │ │ │ - 834 const std::vector& grid2_elements, \ │ │ │ │ │ - 835 const std::vector& grid2_element_types \ │ │ │ │ │ - 836 ) │ │ │ │ │ - 837 │ │ │ │ │ - 838STANDARD_MERGE_INSTANTIATE(double,1,1,1); │ │ │ │ │ - 839STANDARD_MERGE_INSTANTIATE(double,2,2,2); │ │ │ │ │ - 840STANDARD_MERGE_INSTANTIATE(double,3,3,3); │ │ │ │ │ - 841#undef STANDARD_MERGE_INSTANTIATE │ │ │ │ │ - 842#undef DECL │ │ │ │ │ - 843 │ │ │ │ │ - 844} /* namespace GridGlue */ │ │ │ │ │ - 845} /* namespace Dune */ │ │ │ │ │ - 846 │ │ │ │ │ - 847#endif // DUNE_GRIDGLUE_MERGING_STANDARDMERGE_HH │ │ │ │ │ -merger.hh │ │ │ │ │ +64 unsigned int nSimplices() const │ │ │ │ │ + 65 { return intersectionList()->size(); } │ │ │ │ │ + 66 │ │ │ │ │ +67 virtual void clear() = 0; │ │ │ │ │ + 68 │ │ │ │ │ +74 virtual std::shared_ptr intersectionList() const = 0; │ │ │ │ │ + 75 │ │ │ │ │ + 79 template │ │ │ │ │ +80 unsigned int parents(unsigned int idx) const { │ │ │ │ │ + 81 return intersectionList()->template parents(idx); │ │ │ │ │ + 82 } │ │ │ │ │ + 83 │ │ │ │ │ + 90 template │ │ │ │ │ +91 unsigned int parent(unsigned int idx, unsigned int parId = 0) const │ │ │ │ │ + 92 { │ │ │ │ │ + 93 return intersectionList()->template parent(idx, parId); │ │ │ │ │ + 94 } │ │ │ │ │ + 95 │ │ │ │ │ + 104 template │ │ │ │ │ +105 auto parentLocal(unsigned int idx, unsigned int corner, unsigned int parId │ │ │ │ │ += 0) const │ │ │ │ │ + 106 { │ │ │ │ │ + 107 return intersectionList()->template corner(idx, corner, parId); │ │ │ │ │ + 108 } │ │ │ │ │ + 109 │ │ │ │ │ +114 unsigned int counter; │ │ │ │ │ + 115}; │ │ │ │ │ + 116 │ │ │ │ │ + 117} /* namespace GridGlue */ │ │ │ │ │ + 118} /* namespace Dune */ │ │ │ │ │ + 119 │ │ │ │ │ + 120#endif │ │ │ │ │ intersectionlist.hh │ │ │ │ │ -computeintersection.hh │ │ │ │ │ Dune │ │ │ │ │ Definition: gridglue.hh:37 │ │ │ │ │ -Dune::GridGlue::STANDARD_MERGE_INSTANTIATE │ │ │ │ │ -STANDARD_MERGE_INSTANTIATE(double, 1, 1, 1) │ │ │ │ │ -Dune::GridGlue::intersections │ │ │ │ │ -IteratorRange<... > intersections(const GridGlue<... > &glue, const Reverse<... │ │ │ │ │ -> &reverse=!reversed) │ │ │ │ │ -Iterate over all intersections of a GridGlue. │ │ │ │ │ -Dune::GridGlue::SimplicialIntersectionListProvider │ │ │ │ │ -Definition: intersectionlist.hh:207 │ │ │ │ │ -Dune::GridGlue::SimplicialIntersectionListProvider::SimplicialIntersection │ │ │ │ │ -Definition: intersectionlist.hh:222 │ │ │ │ │ +Dune::GridGlue::ProjectionImplementation::corner │ │ │ │ │ +Coordinate corner(unsigned c) │ │ │ │ │ +Definition: projection_impl.hh:24 │ │ │ │ │ +Dune::GridGlue::IntersectionList │ │ │ │ │ +Definition: intersectionlist.hh:134 │ │ │ │ │ Dune::GridGlue::Merger │ │ │ │ │ Abstract base for all classes that take extracted grids and build sets of │ │ │ │ │ intersections. │ │ │ │ │ Definition: merger.hh:27 │ │ │ │ │ -Dune::GridGlue::Merger<_T,_grid1Dim,_grid2Dim,_dimworld_>::WorldCoords │ │ │ │ │ -Dune::FieldVector< T, dimworld > WorldCoords │ │ │ │ │ +Dune::GridGlue::Merger::parent │ │ │ │ │ +unsigned int parent(unsigned int idx, unsigned int parId=0) const │ │ │ │ │ +get index of grid-n's parent simplex for given merged grid simplex │ │ │ │ │ +Definition: merger.hh:91 │ │ │ │ │ +Dune::GridGlue::Merger::clear │ │ │ │ │ +virtual void clear()=0 │ │ │ │ │ +Dune::GridGlue::Merger::WorldCoords │ │ │ │ │ +Dune::FieldVector< ctype, dimworld > WorldCoords │ │ │ │ │ the coordinate type used in this interface │ │ │ │ │ Definition: merger.hh:37 │ │ │ │ │ -Dune::GridGlue::Merger<_T,_grid1Dim,_grid2Dim,_dimworld_>::IntersectionList │ │ │ │ │ -Dune::GridGlue::IntersectionList< Grid1Coords, Grid2Coords > IntersectionList │ │ │ │ │ -Definition: merger.hh:39 │ │ │ │ │ -Dune::GridGlue::Merger<_T,_grid1Dim,_grid2Dim,_dimworld_>::Grid1Coords │ │ │ │ │ -Dune::FieldVector< T, grid1Dim > Grid1Coords │ │ │ │ │ +Dune::GridGlue::Merger::Grid1Coords │ │ │ │ │ +Dune::FieldVector< ctype, grid1Dim > Grid1Coords │ │ │ │ │ the local coordinate type for the grid1 coordinates │ │ │ │ │ Definition: merger.hh:31 │ │ │ │ │ -Dune::GridGlue::Merger<_T,_grid1Dim,_grid2Dim,_dimworld_>::Grid2Coords │ │ │ │ │ -Dune::FieldVector< T, grid2Dim > Grid2Coords │ │ │ │ │ +Dune::GridGlue::Merger::counter │ │ │ │ │ +unsigned int counter │ │ │ │ │ +Counts the number of times the computeIntersection method has been called. │ │ │ │ │ +Definition: merger.hh:114 │ │ │ │ │ +Dune::GridGlue::Merger::parentLocal │ │ │ │ │ +auto parentLocal(unsigned int idx, unsigned int corner, unsigned int parId=0) │ │ │ │ │ +const │ │ │ │ │ +get the grid-n parent's simplex local coordinates for a particular merged grid │ │ │ │ │ +simplex corner (parent... │ │ │ │ │ +Definition: merger.hh:105 │ │ │ │ │ +Dune::GridGlue::Merger::build │ │ │ │ │ +virtual void build(const std::vector< Dune::FieldVector< ctype, dimworld > > │ │ │ │ │ +&grid1_coords, const std::vector< unsigned int > &grid1_elements, const std:: │ │ │ │ │ +vector< Dune::GeometryType > &grid1_element_types, const std::vector< Dune:: │ │ │ │ │ +FieldVector< ctype, dimworld > > &grid2_coords, const std::vector< unsigned int │ │ │ │ │ +> &grid2_elements, const std::vector< Dune::GeometryType > │ │ │ │ │ +&grid2_element_types)=0 │ │ │ │ │ +builds the merged grid │ │ │ │ │ +Dune::GridGlue::Merger::nSimplices │ │ │ │ │ +unsigned int nSimplices() const │ │ │ │ │ +get the number of simplices in the merged grid The indices are then in │ │ │ │ │ +0..nSimplices()-1 │ │ │ │ │ +Definition: merger.hh:64 │ │ │ │ │ +Dune::GridGlue::Merger::intersectionList │ │ │ │ │ +virtual std::shared_ptr< IntersectionList > intersectionList() const =0 │ │ │ │ │ +Dune::GridGlue::Merger::parents │ │ │ │ │ +unsigned int parents(unsigned int idx) const │ │ │ │ │ +Definition: merger.hh:80 │ │ │ │ │ +Dune::GridGlue::Merger::Grid2Coords │ │ │ │ │ +Dune::FieldVector< ctype, grid2Dim > Grid2Coords │ │ │ │ │ the local coordinate type for the grid2 coordinates │ │ │ │ │ Definition: merger.hh:34 │ │ │ │ │ -Dune::GridGlue::StandardMerge │ │ │ │ │ -Common base class for many merger implementations: produce pairs of entities │ │ │ │ │ -that may intersect. │ │ │ │ │ -Definition: standardmerge.hh:58 │ │ │ │ │ -Dune::GridGlue::StandardMerge::computeIntersections │ │ │ │ │ -virtual void computeIntersections(const Dune::GeometryType &grid1ElementType, │ │ │ │ │ -const std::vector< Dune::FieldVector< T, dimworld > > &grid1ElementCorners, │ │ │ │ │ -std::bitset<(1<< grid1Dim)> &neighborIntersects1, unsigned int grid1Index, │ │ │ │ │ -const Dune::GeometryType &grid2ElementType, const std::vector< Dune:: │ │ │ │ │ -FieldVector< T, dimworld > > &grid2ElementCorners, std::bitset<(1<< grid2Dim)> │ │ │ │ │ -&neighborIntersects2, unsigned int grid2Index, std::vector< │ │ │ │ │ -SimplicialIntersection > &intersections)=0 │ │ │ │ │ -Compute the intersection between two overlapping elements. │ │ │ │ │ -Dune::GridGlue::StandardMerge::intersectionList_ │ │ │ │ │ -std::shared_ptr< IntersectionList > intersectionList_ │ │ │ │ │ -Definition: standardmerge.hh:124 │ │ │ │ │ -Dune::GridGlue::StandardMerge::Grid1Coords │ │ │ │ │ -typename Base::Grid1Coords Grid1Coords │ │ │ │ │ -Type used for local coordinates on the grid1 side. │ │ │ │ │ -Definition: standardmerge.hh:69 │ │ │ │ │ -Dune::GridGlue::StandardMerge::enableFallback │ │ │ │ │ -void enableFallback(bool fallback) │ │ │ │ │ -Definition: standardmerge.hh:166 │ │ │ │ │ -Dune::GridGlue::StandardMerge::elementNeighbors2_ │ │ │ │ │ -std::vector< std::vector< int > > elementNeighbors2_ │ │ │ │ │ -Definition: standardmerge.hh:131 │ │ │ │ │ -Dune::GridGlue::StandardMerge::elementNeighbors1_ │ │ │ │ │ -std::vector< std::vector< int > > elementNeighbors1_ │ │ │ │ │ -Definition: standardmerge.hh:130 │ │ │ │ │ -Dune::GridGlue::StandardMerge::ctype │ │ │ │ │ -T ctype │ │ │ │ │ -the numeric type used in this interface │ │ │ │ │ -Definition: standardmerge.hh:66 │ │ │ │ │ -Dune::GridGlue::StandardMerge::clear │ │ │ │ │ -void clear() override │ │ │ │ │ -Definition: standardmerge.hh:150 │ │ │ │ │ -Dune::GridGlue::StandardMerge::IntersectionList │ │ │ │ │ -typename Base::IntersectionList IntersectionList │ │ │ │ │ -Definition: standardmerge.hh:77 │ │ │ │ │ -Dune::GridGlue::StandardMerge::computeIntersection │ │ │ │ │ -bool computeIntersection(unsigned int candidate0, unsigned int candidate1, │ │ │ │ │ -const std::vector< Dune::FieldVector< T, dimworld > > &grid1Coords, const std:: │ │ │ │ │ -vector< Dune::GeometryType > &grid1_element_types, std::bitset<(1<< grid1Dim)> │ │ │ │ │ -&neighborIntersects1, const std::vector< Dune::FieldVector< T, dimworld > > │ │ │ │ │ -&grid2Coords, const std::vector< Dune::GeometryType > &grid2_element_types, │ │ │ │ │ -std::bitset<(1<< grid2Dim)> &neighborIntersects2, bool insert=true) │ │ │ │ │ -Compute the intersection between two overlapping elements. │ │ │ │ │ -Definition: standardmerge.hh:263 │ │ │ │ │ -Dune::GridGlue::StandardMerge::enableBruteForce │ │ │ │ │ -void enableBruteForce(bool bruteForce) │ │ │ │ │ -Definition: standardmerge.hh:171 │ │ │ │ │ -Dune::GridGlue::StandardMerge::intersectionListProvider_ │ │ │ │ │ -std::shared_ptr< IntersectionListProvider > intersectionListProvider_ │ │ │ │ │ -Definition: standardmerge.hh:123 │ │ │ │ │ -Dune::GridGlue::StandardMerge::build │ │ │ │ │ -void build(const std::vector< Dune::FieldVector< T, dimworld > > &grid1_Coords, │ │ │ │ │ -const std::vector< unsigned int > &grid1_elements, const std::vector< Dune:: │ │ │ │ │ -GeometryType > &grid1_element_types, const std::vector< Dune::FieldVector< T, │ │ │ │ │ -dimworld > > &grid2_coords, const std::vector< unsigned int > &grid2_elements, │ │ │ │ │ -const std::vector< Dune::GeometryType > &grid2_element_types) override │ │ │ │ │ -builds the merged grid │ │ │ │ │ -Definition: standardmerge.hh:392 │ │ │ │ │ -Dune::GridGlue::StandardMerge::grid1ElementCorners_ │ │ │ │ │ -std::vector< std::vector< unsigned int > > grid1ElementCorners_ │ │ │ │ │ -Temporary internal data. │ │ │ │ │ -Definition: standardmerge.hh:127 │ │ │ │ │ -Dune::GridGlue::StandardMerge::grid2ElementCorners_ │ │ │ │ │ -std::vector< std::vector< unsigned int > > grid2ElementCorners_ │ │ │ │ │ -Definition: standardmerge.hh:128 │ │ │ │ │ -Dune::GridGlue::StandardMerge::Grid2Coords │ │ │ │ │ -typename Base::Grid2Coords Grid2Coords │ │ │ │ │ -Type used for local coordinates on the grid2 side. │ │ │ │ │ -Definition: standardmerge.hh:72 │ │ │ │ │ -Dune::GridGlue::StandardMerge::intersectionList │ │ │ │ │ -std::shared_ptr< IntersectionList > intersectionList() const final │ │ │ │ │ -Definition: standardmerge.hh:160 │ │ │ │ │ -Dune::GridGlue::StandardMerge::~StandardMerge │ │ │ │ │ -virtual ~StandardMerge()=default │ │ │ │ │ -Dune::GridGlue::StandardMerge::RemoteSimplicialIntersection │ │ │ │ │ -SimplicialIntersection RemoteSimplicialIntersection │ │ │ │ │ -Definition: standardmerge.hh:84 │ │ │ │ │ -Dune::GridGlue::StandardMerge::valid │ │ │ │ │ -bool valid │ │ │ │ │ -Definition: standardmerge.hh:86 │ │ │ │ │ -Dune::GridGlue::StandardMerge::StandardMerge │ │ │ │ │ -StandardMerge() │ │ │ │ │ -Definition: standardmerge.hh:88 │ │ │ │ │ -Dune::GridGlue::StandardMerge::SimplicialIntersection │ │ │ │ │ -typename IntersectionListProvider::SimplicialIntersection │ │ │ │ │ -SimplicialIntersection │ │ │ │ │ -Definition: standardmerge.hh:83 │ │ │ │ │ -Dune::GridGlue::StandardMerge::WorldCoords │ │ │ │ │ -typename Base::WorldCoords WorldCoords │ │ │ │ │ -the coordinate type used in this interface │ │ │ │ │ -Definition: standardmerge.hh:75 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00083.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: overlappingmerge.hh File Reference │ │ │ │ +dune-grid-glue: simplexintersection.cc File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -64,45 +64,66 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
overlappingmerge.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Functions
│ │ │ │ +
simplexintersection.cc File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <iostream>
│ │ │ │ -#include <iomanip>
│ │ │ │ -#include <vector>
│ │ │ │ -#include <algorithm>
│ │ │ │ -#include <dune/common/fmatrix.hh>
│ │ │ │ -#include <dune/common/fvector.hh>
│ │ │ │ -#include <dune/geometry/referenceelements.hh>
│ │ │ │ -#include <dune/geometry/multilineargeometry.hh>
│ │ │ │ -#include <dune/grid/common/grid.hh>
│ │ │ │ -#include <dune/grid-glue/merging/standardmerge.hh>
│ │ │ │ -#include <dune/grid-glue/merging/computeintersection.hh>
│ │ │ │ -#include "overlappingmerge.cc"
│ │ │ │ -
│ │ │ │ -

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::GridGlue::OverlappingMerge< dim1, dim2, dimworld, T >
 Computing overlapping grid intersections for grids of different dimensions. More...
class  Dune::GridGlue::SimplexMethod< dimWorld, dim1, dim2, T >
 
class  Dune::GridGlue::SimplexMethod< dimWorld, 0, 0, T >
 
class  Dune::GridGlue::SimplexMethod< dimWorld, 0, 1, T >
 
class  Dune::GridGlue::SimplexMethod< dimWorld, 0, 2, T >
 
class  Dune::GridGlue::SimplexMethod< dimWorld, 0, 3, T >
 
class  Dune::GridGlue::SimplexMethod< dimWorld, 1, 1, T >
 
class  Dune::GridGlue::SimplexMethod< dimWorld, 1, 2, T >
 
class  Dune::GridGlue::SimplexMethod< dimWorld, 1, 3, T >
 
class  Dune::GridGlue::SimplexMethod< dimWorld, 2, 2, T >
 
class  Dune::GridGlue::SimplexMethod< dimWorld, 2, 3, T >
 
class  Dune::GridGlue::SimplexMethod< dimWorld, 3, 3, T >
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +Functions

template<int dimworld, typename T >
void Dune::GridGlue::simplexSubdivision (std::integral_constant< int, 0 >, const std::vector< Dune::FieldVector< T, dimworld > > &elementCorners, std::vector< std::vector< unsigned int > > &subElements, std::vector< std::vector< int > > &faceIds)
 
template<int dimworld, typename T >
void Dune::GridGlue::simplexSubdivision (std::integral_constant< int, 1 >, const std::vector< Dune::FieldVector< T, dimworld > > &elementCorners, std::vector< std::vector< unsigned int > > &subElements, std::vector< std::vector< int > > &faceIds)
 
template<int dimworld, typename T >
void Dune::GridGlue::simplexSubdivision (std::integral_constant< int, 2 >, const std::vector< Dune::FieldVector< T, dimworld > > &elementCorners, std::vector< std::vector< unsigned int > > &subElements, std::vector< std::vector< int > > &faceIds)
 
template<int dimworld, typename T >
void Dune::GridGlue::simplexSubdivision (std::integral_constant< int, 3 >, const std::vector< Dune::FieldVector< T, dimworld > > &elementCorners, std::vector< std::vector< unsigned int > > &subElements, std::vector< std::vector< int > > &faceIds)
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,35 +5,65 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * merging │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -overlappingmerge.hh File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ -#include "overlappingmerge.cc" │ │ │ │ │ -Go_to_the_source_code_of_this_file. │ │ │ │ │ +Classes | Namespaces | Functions │ │ │ │ │ +simplexintersection.cc File Reference │ │ │ │ │ Classes │ │ │ │ │ -class  Dune::GridGlue::OverlappingMerge<_dim1,_dim2,_dimworld,_T_> │ │ │ │ │ -  Computing overlapping grid intersections for grids of different │ │ │ │ │ - dimensions. More... │ │ │ │ │ +class  Dune::GridGlue::SimplexMethod<_dimWorld,_dim1,_dim2,_T_> │ │ │ │ │ +  │ │ │ │ │ +class  Dune::GridGlue::SimplexMethod<_dimWorld,_0,_0,_T_> │ │ │ │ │ +  │ │ │ │ │ +class  Dune::GridGlue::SimplexMethod<_dimWorld,_0,_1,_T_> │ │ │ │ │ +  │ │ │ │ │ +class  Dune::GridGlue::SimplexMethod<_dimWorld,_0,_2,_T_> │ │ │ │ │ +  │ │ │ │ │ +class  Dune::GridGlue::SimplexMethod<_dimWorld,_0,_3,_T_> │ │ │ │ │ +  │ │ │ │ │ +class  Dune::GridGlue::SimplexMethod<_dimWorld,_1,_1,_T_> │ │ │ │ │ +  │ │ │ │ │ +class  Dune::GridGlue::SimplexMethod<_dimWorld,_1,_2,_T_> │ │ │ │ │ +  │ │ │ │ │ +class  Dune::GridGlue::SimplexMethod<_dimWorld,_1,_3,_T_> │ │ │ │ │ +  │ │ │ │ │ +class  Dune::GridGlue::SimplexMethod<_dimWorld,_2,_2,_T_> │ │ │ │ │ +  │ │ │ │ │ +class  Dune::GridGlue::SimplexMethod<_dimWorld,_2,_3,_T_> │ │ │ │ │ +  │ │ │ │ │ +class  Dune::GridGlue::SimplexMethod<_dimWorld,_3,_3,_T_> │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::GridGlue │ │ │ │ │   │ │ │ │ │ + Functions │ │ │ │ │ +template │ │ │ │ │ +void Dune::GridGlue::simplexSubdivision (std::integral_constant< int, 0 >, │ │ │ │ │ + const std::vector< Dune::FieldVector< T, dimworld > > &elementCorners, │ │ │ │ │ + std::vector< std::vector< unsigned int > > &subElements, std::vector< │ │ │ │ │ + std::vector< int > > &faceIds) │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +void Dune::GridGlue::simplexSubdivision (std::integral_constant< int, 1 >, │ │ │ │ │ + const std::vector< Dune::FieldVector< T, dimworld > > &elementCorners, │ │ │ │ │ + std::vector< std::vector< unsigned int > > &subElements, std::vector< │ │ │ │ │ + std::vector< int > > &faceIds) │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +void Dune::GridGlue::simplexSubdivision (std::integral_constant< int, 2 >, │ │ │ │ │ + const std::vector< Dune::FieldVector< T, dimworld > > &elementCorners, │ │ │ │ │ + std::vector< std::vector< unsigned int > > &subElements, std::vector< │ │ │ │ │ + std::vector< int > > &faceIds) │ │ │ │ │ +  │ │ │ │ │ +template │ │ │ │ │ +void Dune::GridGlue::simplexSubdivision (std::integral_constant< int, 3 >, │ │ │ │ │ + const std::vector< Dune::FieldVector< T, dimworld > > &elementCorners, │ │ │ │ │ + std::vector< std::vector< unsigned int > > &subElements, std::vector< │ │ │ │ │ + std::vector< int > > &faceIds) │ │ │ │ │ +  │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00086.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: simplexintersection.cc File Reference │ │ │ │ +dune-grid-glue: computeintersection.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -66,64 +66,44 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ Namespaces | │ │ │ │ Functions
│ │ │ │ -
simplexintersection.cc File Reference
│ │ │ │ +
computeintersection.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ +
#include <dune/common/fvector.hh>
│ │ │ │ +#include <dune/common/fmatrix.hh>
│ │ │ │ +#include "simplexintersection.cc"
│ │ │ │ +#include "computeintersection.cc"
│ │ │ │ +
│ │ │ │ +

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::GridGlue::SimplexMethod< dimWorld, dim1, dim2, T >
 
class  Dune::GridGlue::SimplexMethod< dimWorld, 0, 0, T >
 
class  Dune::GridGlue::SimplexMethod< dimWorld, 0, 1, T >
 
class  Dune::GridGlue::SimplexMethod< dimWorld, 0, 2, T >
 
class  Dune::GridGlue::SimplexMethod< dimWorld, 0, 3, T >
 
class  Dune::GridGlue::SimplexMethod< dimWorld, 1, 1, T >
 
class  Dune::GridGlue::SimplexMethod< dimWorld, 1, 2, T >
 
class  Dune::GridGlue::SimplexMethod< dimWorld, 1, 3, T >
 
class  Dune::GridGlue::SimplexMethod< dimWorld, 2, 2, T >
 
class  Dune::GridGlue::SimplexMethod< dimWorld, 2, 3, T >
class  Dune::GridGlue::ComputationMethod< dimWorld, dim1, dim2, T >
 
class  Dune::GridGlue::SimplexMethod< dimWorld, 3, 3, T >
class  Dune::GridGlue::IntersectionComputation< CM >
 Intersection computation method for two elements of arbitrary dimension. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
│ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ Functions

template<int dimworld, typename T >
void Dune::GridGlue::simplexSubdivision (std::integral_constant< int, 0 >, const std::vector< Dune::FieldVector< T, dimworld > > &elementCorners, std::vector< std::vector< unsigned int > > &subElements, std::vector< std::vector< int > > &faceIds)
 
template<int dimworld, typename T >
void Dune::GridGlue::simplexSubdivision (std::integral_constant< int, 1 >, const std::vector< Dune::FieldVector< T, dimworld > > &elementCorners, std::vector< std::vector< unsigned int > > &subElements, std::vector< std::vector< int > > &faceIds)
 
template<int dimworld, typename T >
void Dune::GridGlue::simplexSubdivision (std::integral_constant< int, 2 >, const std::vector< Dune::FieldVector< T, dimworld > > &elementCorners, std::vector< std::vector< unsigned int > > &subElements, std::vector< std::vector< int > > &faceIds)
 
template<int dimworld, typename T >
void Dune::GridGlue::simplexSubdivision (std::integral_constant< int, 3 >, const std::vector< Dune::FieldVector< T, dimworld > > &elementCorners, std::vector< std::vector< unsigned int > > &subElements, std::vector< std::vector< int > > &faceIds)
 
template<class V >
int Dune::GridGlue::insertPoint (const V p, std::vector< V > &P)
 
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -6,64 +6,32 @@ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * merging │ │ │ │ │ Classes | Namespaces | Functions │ │ │ │ │ -simplexintersection.cc File Reference │ │ │ │ │ +computeintersection.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include "simplexintersection.cc" │ │ │ │ │ +#include "computeintersection.cc" │ │ │ │ │ +Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  Dune::GridGlue::SimplexMethod<_dimWorld,_dim1,_dim2,_T_> │ │ │ │ │ +class  Dune::GridGlue::ComputationMethod<_dimWorld,_dim1,_dim2,_T_> │ │ │ │ │   │ │ │ │ │ -class  Dune::GridGlue::SimplexMethod<_dimWorld,_0,_0,_T_> │ │ │ │ │ -  │ │ │ │ │ -class  Dune::GridGlue::SimplexMethod<_dimWorld,_0,_1,_T_> │ │ │ │ │ -  │ │ │ │ │ -class  Dune::GridGlue::SimplexMethod<_dimWorld,_0,_2,_T_> │ │ │ │ │ -  │ │ │ │ │ -class  Dune::GridGlue::SimplexMethod<_dimWorld,_0,_3,_T_> │ │ │ │ │ -  │ │ │ │ │ -class  Dune::GridGlue::SimplexMethod<_dimWorld,_1,_1,_T_> │ │ │ │ │ -  │ │ │ │ │ -class  Dune::GridGlue::SimplexMethod<_dimWorld,_1,_2,_T_> │ │ │ │ │ -  │ │ │ │ │ -class  Dune::GridGlue::SimplexMethod<_dimWorld,_1,_3,_T_> │ │ │ │ │ -  │ │ │ │ │ -class  Dune::GridGlue::SimplexMethod<_dimWorld,_2,_2,_T_> │ │ │ │ │ -  │ │ │ │ │ -class  Dune::GridGlue::SimplexMethod<_dimWorld,_2,_3,_T_> │ │ │ │ │ -  │ │ │ │ │ -class  Dune::GridGlue::SimplexMethod<_dimWorld,_3,_3,_T_> │ │ │ │ │ +class  Dune::GridGlue::IntersectionComputation<_CM_> │ │ │ │ │ +  Intersection computation method for two elements of arbitrary │ │ │ │ │ + dimension. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::GridGlue │ │ │ │ │   │ │ │ │ │ Functions │ │ │ │ │ -template │ │ │ │ │ -void Dune::GridGlue::simplexSubdivision (std::integral_constant< int, 0 >, │ │ │ │ │ - const std::vector< Dune::FieldVector< T, dimworld > > &elementCorners, │ │ │ │ │ - std::vector< std::vector< unsigned int > > &subElements, std::vector< │ │ │ │ │ - std::vector< int > > &faceIds) │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -void Dune::GridGlue::simplexSubdivision (std::integral_constant< int, 1 >, │ │ │ │ │ - const std::vector< Dune::FieldVector< T, dimworld > > &elementCorners, │ │ │ │ │ - std::vector< std::vector< unsigned int > > &subElements, std::vector< │ │ │ │ │ - std::vector< int > > &faceIds) │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -void Dune::GridGlue::simplexSubdivision (std::integral_constant< int, 2 >, │ │ │ │ │ - const std::vector< Dune::FieldVector< T, dimworld > > &elementCorners, │ │ │ │ │ - std::vector< std::vector< unsigned int > > &subElements, std::vector< │ │ │ │ │ - std::vector< int > > &faceIds) │ │ │ │ │ -  │ │ │ │ │ -template │ │ │ │ │ -void Dune::GridGlue::simplexSubdivision (std::integral_constant< int, 3 >, │ │ │ │ │ - const std::vector< Dune::FieldVector< T, dimworld > > &elementCorners, │ │ │ │ │ - std::vector< std::vector< unsigned int > > &subElements, std::vector< │ │ │ │ │ - std::vector< int > > &faceIds) │ │ │ │ │ +template │ │ │ │ │ +int Dune::GridGlue::insertPoint (const V p, std::vector< V > &P) │ │ │ │ │   │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00089.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: computeintersection.hh File Reference │ │ │ │ +dune-grid-glue: contactmerge.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -64,47 +64,55 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces | │ │ │ │ -Functions
│ │ │ │ -
computeintersection.hh File Reference
│ │ │ │ +Namespaces
│ │ │ │ +
contactmerge.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ -
#include <dune/common/fvector.hh>
│ │ │ │ -#include <dune/common/fmatrix.hh>
│ │ │ │ -#include "simplexintersection.cc"
│ │ │ │ -#include "computeintersection.cc"
│ │ │ │ + │ │ │ │ +

Merge two grid boundary surfaces that may be a positive distance apart. │ │ │ │ +More...

│ │ │ │ +
#include <iostream>
│ │ │ │ +#include <fstream>
│ │ │ │ +#include <iomanip>
│ │ │ │ +#include <vector>
│ │ │ │ +#include <algorithm>
│ │ │ │ +#include <limits>
│ │ │ │ +#include <memory>
│ │ │ │ +#include <functional>
│ │ │ │ +#include <dune/common/fvector.hh>
│ │ │ │ +#include <dune/common/exceptions.hh>
│ │ │ │ +#include <dune/common/bitsetvector.hh>
│ │ │ │ +#include <dune/common/deprecated.hh>
│ │ │ │ +#include <dune/grid/common/grid.hh>
│ │ │ │ +#include <dune/grid-glue/merging/standardmerge.hh>
│ │ │ │ +#include <dune/grid-glue/gridglue.hh>
│ │ │ │ +#include "contactmerge.cc"
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::GridGlue::ComputationMethod< dimWorld, dim1, dim2, T >
 
class  Dune::GridGlue::IntersectionComputation< CM >
 Intersection computation method for two elements of arbitrary dimension. More...
class  Dune::GridGlue::ContactMerge< dimworld, T >
 Merge two codimension-1 surfaces that may be a positive distance apart. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
│ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │

│ │ │ │ -Functions

template<class V >
int Dune::GridGlue::insertPoint (const V p, std::vector< V > &P)
 
│ │ │ │ -
│ │ │ │ +

Detailed Description

│ │ │ │ +

Merge two grid boundary surfaces that may be a positive distance apart.

│ │ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,33 +5,42 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * merging │ │ │ │ │ -Classes | Namespaces | Functions │ │ │ │ │ -computeintersection.hh File Reference │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +contactmerge.hh File Reference │ │ │ │ │ +Merge two grid boundary surfaces that may be a positive distance apart. More... │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ #include │ │ │ │ │ -#include │ │ │ │ │ -#include "simplexintersection.cc" │ │ │ │ │ -#include "computeintersection.cc" │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include "contactmerge.cc" │ │ │ │ │ Go_to_the_source_code_of_this_file. │ │ │ │ │ Classes │ │ │ │ │ -class  Dune::GridGlue::ComputationMethod<_dimWorld,_dim1,_dim2,_T_> │ │ │ │ │ -  │ │ │ │ │ -class  Dune::GridGlue::IntersectionComputation<_CM_> │ │ │ │ │ -  Intersection computation method for two elements of arbitrary │ │ │ │ │ - dimension. More... │ │ │ │ │ +class  Dune::GridGlue::ContactMerge<_dimworld,_T_> │ │ │ │ │ +  Merge two codimension-1 surfaces that may be a positive distance apart. │ │ │ │ │ + More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::GridGlue │ │ │ │ │   │ │ │ │ │ - Functions │ │ │ │ │ -template │ │ │ │ │ -int Dune::GridGlue::insertPoint (const V p, std::vector< V > &P) │ │ │ │ │ -  │ │ │ │ │ +***** Detailed Description ***** │ │ │ │ │ +Merge two grid boundary surfaces that may be a positive distance apart. │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00089_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: computeintersection.hh Source File │ │ │ │ +dune-grid-glue: contactmerge.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,182 +62,217 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
computeintersection.hh
│ │ │ │ +
contactmerge.hh
│ │ │ │
│ │ │ │
│ │ │ │ -Go to the documentation of this file.
1// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │ -
2// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
│ │ │ │ -
3#ifndef DUNE_GRIDGLUE_MERGING_COMPUTEINTERSECTION_HH
│ │ │ │ -
4#define DUNE_GRIDGLUE_MERGING_COMPUTEINTERSECTION_HH
│ │ │ │ -
5
│ │ │ │ -
6#include <dune/common/fvector.hh>
│ │ │ │ -
7#include <dune/common/fmatrix.hh>
│ │ │ │ -
8
│ │ │ │ -
9namespace Dune {
│ │ │ │ -
10namespace GridGlue {
│ │ │ │ -
11
│ │ │ │ -
12template<int dimWorld, int dim1, int dim2, typename T = double>
│ │ │ │ - │ │ │ │ -
14public:
│ │ │ │ -
15 typedef FieldVector<T, dimWorld> Vector;
│ │ │ │ -
16 static const int grid1Dimension = dim1;
│ │ │ │ -
17 static const int grid2Dimension = dim2;
│ │ │ │ -
18 static const int intersectionDimension = (dim1 < dim2)?(dim1):(dim2);
│ │ │ │ -
19
│ │ │ │ -
20 static bool computeIntersectionPoints(const std::vector<Vector> X,
│ │ │ │ -
21 const std::vector<Vector> Y,
│ │ │ │ -
22 std::vector<std::vector<int> >& SX,
│ │ │ │ -
23 std::vector<std::vector<int> >& SY,
│ │ │ │ -
24 std::vector<Vector>& P);
│ │ │ │ -
25 static void grid1_subdivisions(const std::vector<Vector> elementCorners,
│ │ │ │ -
26 std::vector<std::vector<unsigned int> >& subElements,
│ │ │ │ -
27 std::vector<std::vector<int> >& faceIds);
│ │ │ │ -
28 static void grid2_subdivisions(const std::vector<Vector> elementCorners,
│ │ │ │ -
29 std::vector<std::vector<unsigned int> >& subElements,
│ │ │ │ -
30 std::vector<std::vector<int> >& faceIds);
│ │ │ │ -
31};
│ │ │ │ +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 © DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │ +
4// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
│ │ │ │ +
10#ifndef DUNE_GRIDGLUE_MERGING_CONTACTMERGE_HH
│ │ │ │ +
11#define DUNE_GRIDGLUE_MERGING_CONTACTMERGE_HH
│ │ │ │ +
12
│ │ │ │ +
13
│ │ │ │ +
14#include <iostream>
│ │ │ │ +
15#include <fstream>
│ │ │ │ +
16#include <iomanip>
│ │ │ │ +
17#include <vector>
│ │ │ │ +
18#include <algorithm>
│ │ │ │ +
19#include <limits>
│ │ │ │ +
20#include <memory>
│ │ │ │ +
21#include <functional>
│ │ │ │ +
22
│ │ │ │ +
23#include <dune/common/fvector.hh>
│ │ │ │ +
24#include <dune/common/exceptions.hh>
│ │ │ │ +
25#include <dune/common/bitsetvector.hh>
│ │ │ │ +
26#include <dune/common/deprecated.hh>
│ │ │ │ +
27
│ │ │ │ +
28#include <dune/grid/common/grid.hh>
│ │ │ │ +
29
│ │ │ │ + │ │ │ │ + │ │ │ │
32
│ │ │ │ -
38template<class CM>
│ │ │ │ - │ │ │ │ -
40private:
│ │ │ │ -
41 typedef typename CM::Vector V;
│ │ │ │ -
42 const int dimWorld = V::dimension;
│ │ │ │ -
43 const int dim1 = CM::grid1Dimension;
│ │ │ │ -
44 const int dim2 = CM::grid2Dimension;
│ │ │ │ -
45public:
│ │ │ │ -
59 static bool computeIntersection(const std::vector<V>& X,
│ │ │ │ -
60 const std::vector<V>& Y,
│ │ │ │ -
61 std::vector<std::vector<int> >& SX,
│ │ │ │ -
62 std::vector<std::vector<int> >& SY,
│ │ │ │ -
63 std::vector<V>& P);
│ │ │ │ -
64
│ │ │ │ -
74 template<int isDim, int dW>
│ │ │ │ -
75 static void orderPoints(const V& centroid,
│ │ │ │ -
76 const std::vector<std::vector<int> >& SX,
│ │ │ │ -
77 const std::vector<std::vector<int> >& SY,
│ │ │ │ -
78 const std::vector<V>& P,
│ │ │ │ -
79 std::vector<std::vector<int> >& H)
│ │ │ │ -
80 {
│ │ │ │ -
81 if (isDim > 1)
│ │ │ │ -
82 orderPoints_(std::integral_constant<int,isDim>(),std::integral_constant<int,dW>(),
│ │ │ │ -
83 centroid, SX, SY, P,H);
│ │ │ │ -
84 }
│ │ │ │ -
85
│ │ │ │ -
86private:
│ │ │ │ -
87 static void orderPoints_(std::integral_constant<int,1>,
│ │ │ │ -
88 std::integral_constant<int,1>,
│ │ │ │ -
89 const V& centroid,
│ │ │ │ -
90 const std::vector<std::vector<int> >& SX,
│ │ │ │ -
91 const std::vector<std::vector<int> >& SY,
│ │ │ │ -
92 const std::vector<V>& P,
│ │ │ │ -
93 std::vector<std::vector<int> >& H) {}
│ │ │ │ -
94 static void orderPoints_(std::integral_constant<int,1>,
│ │ │ │ -
95 std::integral_constant<int,2>,
│ │ │ │ -
96 const V& centroid,
│ │ │ │ -
97 const std::vector<std::vector<int> >& SX,
│ │ │ │ -
98 const std::vector<std::vector<int> >& SY,
│ │ │ │ -
99 const std::vector<V>& P,
│ │ │ │ -
100 std::vector<std::vector<int> >& H) {}
│ │ │ │ -
101 static void orderPoints_(std::integral_constant<int,1>,
│ │ │ │ -
102 std::integral_constant<int,3>,
│ │ │ │ -
103 const V& centroid,
│ │ │ │ -
104 const std::vector<std::vector<int> >& SX,
│ │ │ │ -
105 const std::vector<std::vector<int> >& SY,
│ │ │ │ -
106 const std::vector<V>& P,
│ │ │ │ -
107 std::vector<std::vector<int> >& H) {}
│ │ │ │ -
108 static void orderPoints_(std::integral_constant<int,2>,
│ │ │ │ -
109 std::integral_constant<int,2>,
│ │ │ │ -
110 const V& centroid,
│ │ │ │ -
111 const std::vector<std::vector<int> >& SX,
│ │ │ │ -
112 const std::vector<std::vector<int> >& SY,
│ │ │ │ -
113 const std::vector<V>& P,
│ │ │ │ -
114 std::vector<std::vector<int> >& H);
│ │ │ │ -
115 static void orderPoints_(std::integral_constant<int,2>,
│ │ │ │ -
116 std::integral_constant<int,3>,
│ │ │ │ -
117 const V& centroid,
│ │ │ │ -
118 const std::vector<std::vector<int> >& SX,
│ │ │ │ -
119 const std::vector<std::vector<int> >& SY,
│ │ │ │ -
120 const std::vector<V>& P,
│ │ │ │ -
121 std::vector<std::vector<int> >& H);
│ │ │ │ -
122 static void orderPoints_(std::integral_constant<int,3>,
│ │ │ │ -
123 std::integral_constant<int,3>,
│ │ │ │ -
124 const V& centroid,
│ │ │ │ -
125 const std::vector<std::vector<int> >& SX,
│ │ │ │ -
126 const std::vector<std::vector<int> >& SY,
│ │ │ │ -
127 const std::vector<V>& P,
│ │ │ │ -
128 std::vector<std::vector<int> > & H);
│ │ │ │ -
129
│ │ │ │ -
137 static void orderPointsCC(std::integral_constant<int,2>,
│ │ │ │ -
138 const V& centroid,
│ │ │ │ -
139 std::vector<int> &id,
│ │ │ │ -
140 const std::vector<V>& P);
│ │ │ │ -
141 static void orderPointsCC(std::integral_constant<int,3>,
│ │ │ │ -
142 const V& centroid,
│ │ │ │ -
143 std::vector<int> &id,
│ │ │ │ -
144 const std::vector<V>& P);
│ │ │ │ -
145
│ │ │ │ -
150 static void removeDuplicates( std::vector<int> & p);
│ │ │ │ -
151
│ │ │ │ -
159 static bool newFace3D(const std::vector<int>& id,
│ │ │ │ -
160 const std::vector<std::vector<int> >& H);
│ │ │ │ -
161};
│ │ │ │ -
162
│ │ │ │ -
163template<class V>
│ │ │ │ -
164inline int insertPoint(const V p, std::vector<V>& P)
│ │ │ │ -
165{
│ │ │ │ -
166 double eps= 1e-8; // tolerance for identical nodes
│ │ │ │ -
167 std::size_t k=0 ;
│ │ │ │ -
168
│ │ │ │ -
169 if (P.size()>0) {
│ │ │ │ -
170
│ │ │ │ -
171 while ((k<P.size())&&
│ │ │ │ -
172 ((p - P[k]).infinity_norm()>eps*(P[k].infinity_norm()) &&
│ │ │ │ -
173 (p - P[k]).infinity_norm()>eps*(p.infinity_norm())) &&
│ │ │ │ -
174 !(p.infinity_norm() < eps && P[k].infinity_norm() <eps &&
│ │ │ │ -
175 (p - P[k]).infinity_norm() < eps))
│ │ │ │ -
176 k++ ;
│ │ │ │ -
177
│ │ │ │ -
178 if (k>=P.size())
│ │ │ │ -
179 P.push_back(p) ; // new node is not contained in P
│ │ │ │ -
180
│ │ │ │ -
181 }
│ │ │ │ -
182 else
│ │ │ │ -
183 P.push_back(p);
│ │ │ │ -
184
│ │ │ │ -
185 return k ;
│ │ │ │ -
186}
│ │ │ │ -
187
│ │ │ │ -
188
│ │ │ │ -
189} /* namespace Dune::GridGlue */
│ │ │ │ -
190} /* namespace Dune */
│ │ │ │ -
191
│ │ │ │ -
192#include "simplexintersection.cc"
│ │ │ │ -
193#include "computeintersection.cc"
│ │ │ │ -
194
│ │ │ │ -
195#endif
│ │ │ │ - │ │ │ │ - │ │ │ │ +
33namespace Dune {
│ │ │ │ +
34namespace GridGlue {
│ │ │ │ +
35
│ │ │ │ +
41template<int dimworld, typename T = double>
│ │ │ │ + │ │ │ │ +
43: public StandardMerge<T,dimworld-1,dimworld-1,dimworld>
│ │ │ │ +
44{
│ │ │ │ +
45 static constexpr int dim = dimworld-1;
│ │ │ │ +
46
│ │ │ │ +
47 static_assert( dim==1 || dim==2,
│ │ │ │ +
48 "ContactMerge yet only handles the cases dim==1 and dim==2!");
│ │ │ │ +
49
│ │ │ │ + │ │ │ │ +
51public:
│ │ │ │ +
52
│ │ │ │ +
53 /* E X P O R T E D T Y P E S A N D C O N S T A N T S */
│ │ │ │ +
54
│ │ │ │ +
56 typedef T ctype;
│ │ │ │ +
57
│ │ │ │ +
59 typedef Dune::FieldVector<T, dimworld> WorldCoords;
│ │ │ │ +
60
│ │ │ │ +
62 typedef Dune::FieldVector<T, dim> LocalCoords;
│ │ │ │ +
63
│ │ │ │ + │ │ │ │ +
73 ContactMerge(const T allowedOverlap=T(0),
│ │ │ │ +
74 std::function<WorldCoords(WorldCoords)> domainDirections=nullptr,
│ │ │ │ +
75 std::function<WorldCoords(WorldCoords)> targetDirections=nullptr,
│ │ │ │ + │ │ │ │ +
77 : domainDirections_(domainDirections), targetDirections_(targetDirections),
│ │ │ │ +
78 overlap_(allowedOverlap), type_(type)
│ │ │ │ +
79 {}
│ │ │ │ +
80
│ │ │ │ +
86 ContactMerge(const T allowedOverlap, ProjectionType type)
│ │ │ │ +
87 : overlap_(allowedOverlap),
│ │ │ │ +
88 type_(type)
│ │ │ │ +
89 {}
│ │ │ │ +
90
│ │ │ │ +
99 inline
│ │ │ │ +
100 void setSurfaceDirections(std::function<WorldCoords(WorldCoords)> domainDirections,
│ │ │ │ +
101 std::function<WorldCoords(WorldCoords)> targetDirections)
│ │ │ │ +
102 {
│ │ │ │ +
103 domainDirections_ = domainDirections;
│ │ │ │ +
104 targetDirections_ = targetDirections;
│ │ │ │ +
105 this->valid = false;
│ │ │ │ +
106 }
│ │ │ │ +
107
│ │ │ │ +
109 void setOverlap(T overlap)
│ │ │ │ +
110 {
│ │ │ │ +
111 overlap_ = overlap;
│ │ │ │ +
112 }
│ │ │ │ +
113
│ │ │ │ +
115 T getOverlap() const
│ │ │ │ +
116 {
│ │ │ │ +
117 return overlap_;
│ │ │ │ +
118 }
│ │ │ │ +
119
│ │ │ │ +
123 void minNormalAngle(T angle)
│ │ │ │ +
124 {
│ │ │ │ +
125 using std::cos;
│ │ │ │ +
126 maxNormalProduct_ = cos(angle);
│ │ │ │ +
127 }
│ │ │ │ +
128
│ │ │ │ + │ │ │ │ +
133 {
│ │ │ │ +
134 using std::acos;
│ │ │ │ +
135 return acos(maxNormalProduct_);
│ │ │ │ +
136 }
│ │ │ │ +
137
│ │ │ │ +
138protected:
│ │ │ │ +
139 typedef typename StandardMerge<T,dimworld-1,dimworld-1,dimworld>::SimplicialIntersection SimplicialIntersection;
│ │ │ │ +
140
│ │ │ │ +
141private:
│ │ │ │ +
145 std::function<WorldCoords(WorldCoords)> domainDirections_;
│ │ │ │ +
146 std::vector<WorldCoords> nodalDomainDirections_;
│ │ │ │ +
147
│ │ │ │ +
156 std::function<WorldCoords(WorldCoords)> targetDirections_;
│ │ │ │ +
157 std::vector<WorldCoords> nodalTargetDirections_;
│ │ │ │ +
158
│ │ │ │ +
160 T overlap_;
│ │ │ │ +
161
│ │ │ │ +
163 ProjectionType type_;
│ │ │ │ +
164
│ │ │ │ +
168 T maxNormalProduct_ = T(-0.1);
│ │ │ │ +
169
│ │ │ │ +
174 void computeIntersections(const Dune::GeometryType& grid1ElementType,
│ │ │ │ +
175 const std::vector<Dune::FieldVector<T,dimworld> >& grid1ElementCorners,
│ │ │ │ +
176 std::bitset<(1<<dim)>& neighborIntersects1,
│ │ │ │ +
177 unsigned int grid1Index,
│ │ │ │ +
178 const Dune::GeometryType& grid2ElementType,
│ │ │ │ +
179 const std::vector<Dune::FieldVector<T,dimworld> >& grid2ElementCorners,
│ │ │ │ +
180 std::bitset<(1<<dim)>& neighborIntersects2,
│ │ │ │ +
181 unsigned int grid2Index,
│ │ │ │ +
182 std::vector<SimplicialIntersection>& intersections) override;
│ │ │ │ +
183
│ │ │ │ +
187protected:
│ │ │ │ +
188 void build(const std::vector<Dune::FieldVector<T,dimworld> >& grid1Coords,
│ │ │ │ +
189 const std::vector<unsigned int>& grid1Elements,
│ │ │ │ +
190 const std::vector<Dune::GeometryType>& grid1ElementTypes,
│ │ │ │ +
191 const std::vector<Dune::FieldVector<T,dimworld> >& grid2Coords,
│ │ │ │ +
192 const std::vector<unsigned int>& grid2Elements,
│ │ │ │ +
193 const std::vector<Dune::GeometryType>& grid2ElementTypes) override
│ │ │ │ +
194 {
│ │ │ │ +
195 std::cout<<"ContactMerge building grid!\n";
│ │ │ │ +
196 // setup the nodal direction vectors
│ │ │ │ +
197 setupNodalDirections(grid1Coords, grid1Elements, grid1ElementTypes,
│ │ │ │ +
198 grid2Coords, grid2Elements, grid2ElementTypes);
│ │ │ │ +
199
│ │ │ │ +
200 Base::build(grid1Coords, grid1Elements, grid1ElementTypes,
│ │ │ │ +
201 grid2Coords, grid2Elements, grid2ElementTypes);
│ │ │ │ +
202
│ │ │ │ +
203 }
│ │ │ │ +
204
│ │ │ │ +
205private:
│ │ │ │ +
206
│ │ │ │ +
208 static LocalCoords localCornerCoords(int i, const Dune::GeometryType& gt)
│ │ │ │ +
209 {
│ │ │ │ +
210 const auto& ref = Dune::ReferenceElements<T,dim>::general(gt);
│ │ │ │ +
211 return ref.position(i,dim);
│ │ │ │ +
212 }
│ │ │ │ +
213
│ │ │ │ +
214protected:
│ │ │ │ +
215
│ │ │ │ +
217 void computeCyclicOrder(const std::vector<std::array<LocalCoords,2> >& polytopeCorners,
│ │ │ │ +
218 const LocalCoords& center, std::vector<int>& ordering) const;
│ │ │ │ +
219
│ │ │ │ +
221 void setupNodalDirections(const std::vector<WorldCoords>& coords1,
│ │ │ │ +
222 const std::vector<unsigned int>& elements1,
│ │ │ │ +
223 const std::vector<Dune::GeometryType>& elementTypes1,
│ │ │ │ +
224 const std::vector<WorldCoords>& coords2,
│ │ │ │ +
225 const std::vector<unsigned int>& elements2,
│ │ │ │ +
226 const std::vector<Dune::GeometryType>& elementTypes2);
│ │ │ │ +
227
│ │ │ │ +
229 void computeOuterNormalField(const std::vector<WorldCoords>& coords,
│ │ │ │ +
230 const std::vector<unsigned int>& elements,
│ │ │ │ +
231 const std::vector<Dune::GeometryType>& elementTypes,
│ │ │ │ +
232 std::vector<WorldCoords>& normals);
│ │ │ │ +
233
│ │ │ │ +
235 void removeDoubles(std::vector<std::array<LocalCoords,2> >& polytopeCorners);
│ │ │ │ +
236};
│ │ │ │ +
237
│ │ │ │ +
238} /* namespace GridGlue */
│ │ │ │ +
239} /* namespace Dune */
│ │ │ │ +
240
│ │ │ │ +
241#include "contactmerge.cc"
│ │ │ │ +
242
│ │ │ │ +
243#endif // DUNE_GRIDGLUE_MERGING_CONTACTMERGE_HH
│ │ │ │ +
Central component of the module implementing the coupling of two grids.
│ │ │ │ + │ │ │ │ +
Common base class for many merger implementations: produce pairs of entities that may intersect.
│ │ │ │
Definition: gridglue.hh:37
│ │ │ │ -
int insertPoint(const V p, std::vector< V > &P)
Definition: computeintersection.hh:164
│ │ │ │ -
Definition: computeintersection.hh:13
│ │ │ │ -
static void grid2_subdivisions(const std::vector< Vector > elementCorners, std::vector< std::vector< unsigned int > > &subElements, std::vector< std::vector< int > > &faceIds)
│ │ │ │ -
static bool computeIntersectionPoints(const std::vector< Vector > X, const std::vector< Vector > Y, std::vector< std::vector< int > > &SX, std::vector< std::vector< int > > &SY, std::vector< Vector > &P)
│ │ │ │ -
FieldVector< T, dimWorld > Vector
Definition: computeintersection.hh:15
│ │ │ │ -
static const int grid1Dimension
Definition: computeintersection.hh:16
│ │ │ │ -
static void grid1_subdivisions(const std::vector< Vector > elementCorners, std::vector< std::vector< unsigned int > > &subElements, std::vector< std::vector< int > > &faceIds)
│ │ │ │ -
static const int grid2Dimension
Definition: computeintersection.hh:17
│ │ │ │ -
static const int intersectionDimension
Definition: computeintersection.hh:18
│ │ │ │ -
Intersection computation method for two elements of arbitrary dimension.
Definition: computeintersection.hh:39
│ │ │ │ -
static void orderPoints(const V &centroid, const std::vector< std::vector< int > > &SX, const std::vector< std::vector< int > > &SY, const std::vector< V > &P, std::vector< std::vector< int > > &H)
Order Points in the point list P face-wise such that a subsimplex subdivision can be constructed.
Definition: computeintersection.hh:75
│ │ │ │ -
static bool computeIntersection(const std::vector< V > &X, const std::vector< V > &Y, std::vector< std::vector< int > > &SX, std::vector< std::vector< int > > &SY, std::vector< V > &P)
Compute the intersection of two elements X and Y Compute the intersection of two elements X and Y,...
Definition: computeintersection.cc:14
│ │ │ │ +
Merge two codimension-1 surfaces that may be a positive distance apart.
Definition: contactmerge.hh:44
│ │ │ │ +
void computeCyclicOrder(const std::vector< std::array< LocalCoords, 2 > > &polytopeCorners, const LocalCoords &center, std::vector< int > &ordering) const
Order the corners of the intersection polytope in cyclic order.
Definition: contactmerge.cc:214
│ │ │ │ +
StandardMerge< T, dimworld-1, dimworld-1, dimworld >::SimplicialIntersection SimplicialIntersection
Definition: contactmerge.hh:139
│ │ │ │ +
void removeDoubles(std::vector< std::array< LocalCoords, 2 > > &polytopeCorners)
Remove all multiples.
Definition: contactmerge.cc:335
│ │ │ │ +
void setOverlap(T overlap)
Set the allowed overlap of the surfaces.
Definition: contactmerge.hh:109
│ │ │ │ +
Dune::FieldVector< T, dimworld > WorldCoords
the coordinate type used in this interface
Definition: contactmerge.hh:59
│ │ │ │ +
void setupNodalDirections(const std::vector< WorldCoords > &coords1, const std::vector< unsigned int > &elements1, const std::vector< Dune::GeometryType > &elementTypes1, const std::vector< WorldCoords > &coords2, const std::vector< unsigned int > &elements2, const std::vector< Dune::GeometryType > &elementTypes2)
Setup the direction vectors containing the directions for each vertex.
Definition: contactmerge.cc:269
│ │ │ │ +
void minNormalAngle(T angle)
set minimum angle in radians between normals at x and Φ(x)
Definition: contactmerge.hh:123
│ │ │ │ +
T ctype
the numeric type used in this interface
Definition: contactmerge.hh:56
│ │ │ │ +
ProjectionType
Type of the projection, closest point or outer normal projection.
Definition: contactmerge.hh:65
│ │ │ │ +
@ CLOSEST_POINT
Definition: contactmerge.hh:65
│ │ │ │ +
@ OUTER_NORMAL
Definition: contactmerge.hh:65
│ │ │ │ +
void computeOuterNormalField(const std::vector< WorldCoords > &coords, const std::vector< unsigned int > &elements, const std::vector< Dune::GeometryType > &elementTypes, std::vector< WorldCoords > &normals)
If no direction field was specified compute the outer normal field.
Definition: contactmerge.cc:296
│ │ │ │ +
T getOverlap() const
Get the allowed overlap of the surfaces.
Definition: contactmerge.hh:115
│ │ │ │ +
ContactMerge(const T allowedOverlap=T(0), std::function< WorldCoords(WorldCoords)> domainDirections=nullptr, std::function< WorldCoords(WorldCoords)> targetDirections=nullptr, ProjectionType type=OUTER_NORMAL)
Construct merger given overlap and possible projection directions.
Definition: contactmerge.hh:73
│ │ │ │ +
void setSurfaceDirections(std::function< WorldCoords(WorldCoords)> domainDirections, std::function< WorldCoords(WorldCoords)> targetDirections)
Set surface direction functions.
Definition: contactmerge.hh:100
│ │ │ │ +
void build(const std::vector< Dune::FieldVector< T, dimworld > > &grid1Coords, const std::vector< unsigned int > &grid1Elements, const std::vector< Dune::GeometryType > &grid1ElementTypes, const std::vector< Dune::FieldVector< T, dimworld > > &grid2Coords, const std::vector< unsigned int > &grid2Elements, const std::vector< Dune::GeometryType > &grid2ElementTypes) override
builds the merged grid
Definition: contactmerge.hh:188
│ │ │ │ +
ContactMerge(const T allowedOverlap, ProjectionType type)
Construct merger given overlap and type of the projection.
Definition: contactmerge.hh:86
│ │ │ │ +
T minNormalAngle() const
get minimum angle in radians between normals at x and Φ(x)
Definition: contactmerge.hh:132
│ │ │ │ +
Dune::FieldVector< T, dim > LocalCoords
the coordinate type used in this interface
Definition: contactmerge.hh:62
│ │ │ │ +
Common base class for many merger implementations: produce pairs of entities that may intersect.
Definition: standardmerge.hh:58
│ │ │ │ +
void build(const std::vector< Dune::FieldVector< T, dimworld > > &grid1_Coords, const std::vector< unsigned int > &grid1_elements, const std::vector< Dune::GeometryType > &grid1_element_types, const std::vector< Dune::FieldVector< T, dimworld > > &grid2_coords, const std::vector< unsigned int > &grid2_elements, const std::vector< Dune::GeometryType > &grid2_element_types) override
builds the merged grid
Definition: standardmerge.hh:392
│ │ │ │ + │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,215 +5,308 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * merging │ │ │ │ │ -computeintersection.hh │ │ │ │ │ +contactmerge.hh │ │ │ │ │ Go_to_the_documentation_of_this_file. │ │ │ │ │ - 1// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see 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 © DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ - 2// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only- │ │ │ │ │ + 4// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only- │ │ │ │ │ with-dune-grid-glue-exception │ │ │ │ │ - 3#ifndef DUNE_GRIDGLUE_MERGING_COMPUTEINTERSECTION_HH │ │ │ │ │ - 4#define DUNE_GRIDGLUE_MERGING_COMPUTEINTERSECTION_HH │ │ │ │ │ - 5 │ │ │ │ │ - 6#include │ │ │ │ │ - 7#include │ │ │ │ │ - 8 │ │ │ │ │ - 9namespace Dune { │ │ │ │ │ - 10namespace GridGlue { │ │ │ │ │ - 11 │ │ │ │ │ - 12template │ │ │ │ │ -13class ComputationMethod { │ │ │ │ │ - 14public: │ │ │ │ │ -15 typedef FieldVector Vector; │ │ │ │ │ -16 static const int grid1Dimension = dim1; │ │ │ │ │ -17 static const int grid2Dimension = dim2; │ │ │ │ │ -18 static const int intersectionDimension = (dim1 < dim2)?(dim1):(dim2); │ │ │ │ │ - 19 │ │ │ │ │ -20 static bool computeIntersectionPoints(const std::vector X, │ │ │ │ │ - 21 const std::vector Y, │ │ │ │ │ - 22 std::vector >& SX, │ │ │ │ │ - 23 std::vector >& SY, │ │ │ │ │ - 24 std::vector& P); │ │ │ │ │ -25 static void grid1_subdivisions(const std::vector elementCorners, │ │ │ │ │ - 26 std::vector >& subElements, │ │ │ │ │ - 27 std::vector >& faceIds); │ │ │ │ │ -28 static void grid2_subdivisions(const std::vector elementCorners, │ │ │ │ │ - 29 std::vector >& subElements, │ │ │ │ │ - 30 std::vector >& faceIds); │ │ │ │ │ - 31}; │ │ │ │ │ + 10#ifndef DUNE_GRIDGLUE_MERGING_CONTACTMERGE_HH │ │ │ │ │ + 11#define DUNE_GRIDGLUE_MERGING_CONTACTMERGE_HH │ │ │ │ │ + 12 │ │ │ │ │ + 13 │ │ │ │ │ + 14#include │ │ │ │ │ + 15#include │ │ │ │ │ + 16#include │ │ │ │ │ + 17#include │ │ │ │ │ + 18#include │ │ │ │ │ + 19#include │ │ │ │ │ + 20#include │ │ │ │ │ + 21#include │ │ │ │ │ + 22 │ │ │ │ │ + 23#include │ │ │ │ │ + 24#include │ │ │ │ │ + 25#include │ │ │ │ │ + 26#include │ │ │ │ │ + 27 │ │ │ │ │ + 28#include │ │ │ │ │ + 29 │ │ │ │ │ + 30#include │ │ │ │ │ + 31#include │ │ │ │ │ 32 │ │ │ │ │ - 38template │ │ │ │ │ -39class IntersectionComputation { │ │ │ │ │ - 40private: │ │ │ │ │ - 41 typedef typename CM::Vector V; │ │ │ │ │ - 42 const int dimWorld = V::dimension; │ │ │ │ │ - 43 const int dim1 = CM::grid1Dimension; │ │ │ │ │ - 44 const int dim2 = CM::grid2Dimension; │ │ │ │ │ - 45public: │ │ │ │ │ - 59 static bool computeIntersection(const std::vector& X, │ │ │ │ │ - 60 const std::vector& Y, │ │ │ │ │ - 61 std::vector >& SX, │ │ │ │ │ - 62 std::vector >& SY, │ │ │ │ │ - 63 std::vector& P); │ │ │ │ │ - 64 │ │ │ │ │ - 74 template │ │ │ │ │ -75 static void orderPoints(const V& centroid, │ │ │ │ │ - 76 const std::vector >& SX, │ │ │ │ │ - 77 const std::vector >& SY, │ │ │ │ │ - 78 const std::vector& P, │ │ │ │ │ - 79 std::vector >& H) │ │ │ │ │ - 80 { │ │ │ │ │ - 81 if (isDim > 1) │ │ │ │ │ - 82 orderPoints_(std::integral_constant(),std:: │ │ │ │ │ -integral_constant(), │ │ │ │ │ - 83 centroid, SX, SY, P,H); │ │ │ │ │ - 84 } │ │ │ │ │ - 85 │ │ │ │ │ - 86private: │ │ │ │ │ - 87 static void orderPoints_(std::integral_constant, │ │ │ │ │ - 88 std::integral_constant, │ │ │ │ │ - 89 const V& centroid, │ │ │ │ │ - 90 const std::vector >& SX, │ │ │ │ │ - 91 const std::vector >& SY, │ │ │ │ │ - 92 const std::vector& P, │ │ │ │ │ - 93 std::vector >& H) {} │ │ │ │ │ - 94 static void orderPoints_(std::integral_constant, │ │ │ │ │ - 95 std::integral_constant, │ │ │ │ │ - 96 const V& centroid, │ │ │ │ │ - 97 const std::vector >& SX, │ │ │ │ │ - 98 const std::vector >& SY, │ │ │ │ │ - 99 const std::vector& P, │ │ │ │ │ - 100 std::vector >& H) {} │ │ │ │ │ - 101 static void orderPoints_(std::integral_constant, │ │ │ │ │ - 102 std::integral_constant, │ │ │ │ │ - 103 const V& centroid, │ │ │ │ │ - 104 const std::vector >& SX, │ │ │ │ │ - 105 const std::vector >& SY, │ │ │ │ │ - 106 const std::vector& P, │ │ │ │ │ - 107 std::vector >& H) {} │ │ │ │ │ - 108 static void orderPoints_(std::integral_constant, │ │ │ │ │ - 109 std::integral_constant, │ │ │ │ │ - 110 const V& centroid, │ │ │ │ │ - 111 const std::vector >& SX, │ │ │ │ │ - 112 const std::vector >& SY, │ │ │ │ │ - 113 const std::vector& P, │ │ │ │ │ - 114 std::vector >& H); │ │ │ │ │ - 115 static void orderPoints_(std::integral_constant, │ │ │ │ │ - 116 std::integral_constant, │ │ │ │ │ - 117 const V& centroid, │ │ │ │ │ - 118 const std::vector >& SX, │ │ │ │ │ - 119 const std::vector >& SY, │ │ │ │ │ - 120 const std::vector& P, │ │ │ │ │ - 121 std::vector >& H); │ │ │ │ │ - 122 static void orderPoints_(std::integral_constant, │ │ │ │ │ - 123 std::integral_constant, │ │ │ │ │ - 124 const V& centroid, │ │ │ │ │ - 125 const std::vector >& SX, │ │ │ │ │ - 126 const std::vector >& SY, │ │ │ │ │ - 127 const std::vector& P, │ │ │ │ │ - 128 std::vector > & H); │ │ │ │ │ - 129 │ │ │ │ │ - 137 static void orderPointsCC(std::integral_constant, │ │ │ │ │ - 138 const V& centroid, │ │ │ │ │ - 139 std::vector &id, │ │ │ │ │ - 140 const std::vector& P); │ │ │ │ │ - 141 static void orderPointsCC(std::integral_constant, │ │ │ │ │ - 142 const V& centroid, │ │ │ │ │ - 143 std::vector &id, │ │ │ │ │ - 144 const std::vector& P); │ │ │ │ │ - 145 │ │ │ │ │ - 150 static void removeDuplicates( std::vector & p); │ │ │ │ │ - 151 │ │ │ │ │ - 159 static bool newFace3D(const std::vector& id, │ │ │ │ │ - 160 const std::vector >& H); │ │ │ │ │ - 161}; │ │ │ │ │ - 162 │ │ │ │ │ - 163template │ │ │ │ │ -164inline int insertPoint(const V p, std::vector& P) │ │ │ │ │ - 165{ │ │ │ │ │ - 166 double eps= 1e-8; // tolerance for identical nodes │ │ │ │ │ - 167 std::size_t k=0 ; │ │ │ │ │ - 168 │ │ │ │ │ - 169 if (P.size()>0) { │ │ │ │ │ - 170 │ │ │ │ │ - 171 while ((keps*(P[k].infinity_norm()) && │ │ │ │ │ - 173 (p - P[k]).infinity_norm()>eps*(p.infinity_norm())) && │ │ │ │ │ - 174 !(p.infinity_norm() < eps && P[k].infinity_norm() =P.size()) │ │ │ │ │ - 179 P.push_back(p) ; // new node is not contained in P │ │ │ │ │ - 180 │ │ │ │ │ - 181 } │ │ │ │ │ - 182 else │ │ │ │ │ - 183 P.push_back(p); │ │ │ │ │ - 184 │ │ │ │ │ - 185 return k ; │ │ │ │ │ - 186} │ │ │ │ │ - 187 │ │ │ │ │ - 188 │ │ │ │ │ - 189} /* namespace Dune::GridGlue */ │ │ │ │ │ - 190} /* namespace Dune */ │ │ │ │ │ - 191 │ │ │ │ │ - 192#include "simplexintersection.cc" │ │ │ │ │ - 193#include "computeintersection.cc" │ │ │ │ │ - 194 │ │ │ │ │ - 195#endif │ │ │ │ │ -simplexintersection.cc │ │ │ │ │ -computeintersection.cc │ │ │ │ │ + 33namespace Dune { │ │ │ │ │ + 34namespace GridGlue { │ │ │ │ │ + 35 │ │ │ │ │ + 41template │ │ │ │ │ +42class ContactMerge │ │ │ │ │ + 43: public StandardMerge │ │ │ │ │ + 44{ │ │ │ │ │ + 45 static constexpr int dim = dimworld-1; │ │ │ │ │ + 46 │ │ │ │ │ + 47 static_assert( dim==1 || dim==2, │ │ │ │ │ + 48 "ContactMerge yet only handles the cases dim==1 and dim==2!"); │ │ │ │ │ + 49 │ │ │ │ │ + 50 typedef StandardMerge Base; │ │ │ │ │ + 51public: │ │ │ │ │ + 52 │ │ │ │ │ + 53 /* E X P O R T E D T Y P E S A N D C O N S T A N T S */ │ │ │ │ │ + 54 │ │ │ │ │ +56 typedef T ctype; │ │ │ │ │ + 57 │ │ │ │ │ +59 typedef Dune::FieldVector WorldCoords; │ │ │ │ │ + 60 │ │ │ │ │ +62 typedef Dune::FieldVector LocalCoords; │ │ │ │ │ + 63 │ │ │ │ │ +65 enum ProjectionType {OUTER_NORMAL, CLOSEST_POINT}; │ │ │ │ │ +73 ContactMerge(const T allowedOverlap=T(0), │ │ │ │ │ + 74 std::function domainDirections=nullptr, │ │ │ │ │ + 75 std::function targetDirections=nullptr, │ │ │ │ │ + 76 ProjectionType type = OUTER_NORMAL) │ │ │ │ │ + 77 : domainDirections_(domainDirections), targetDirections_(targetDirections), │ │ │ │ │ + 78 overlap_(allowedOverlap), type_(type) │ │ │ │ │ + 79 {} │ │ │ │ │ + 80 │ │ │ │ │ +86 ContactMerge(const T allowedOverlap, ProjectionType type) │ │ │ │ │ + 87 : overlap_(allowedOverlap), │ │ │ │ │ + 88 type_(type) │ │ │ │ │ + 89 {} │ │ │ │ │ + 90 │ │ │ │ │ + 99 inline │ │ │ │ │ +100 void setSurfaceDirections(std::function │ │ │ │ │ +domainDirections, │ │ │ │ │ + 101 std::function targetDirections) │ │ │ │ │ + 102 { │ │ │ │ │ + 103 domainDirections_ = domainDirections; │ │ │ │ │ + 104 targetDirections_ = targetDirections; │ │ │ │ │ + 105 this->valid = false; │ │ │ │ │ + 106 } │ │ │ │ │ + 107 │ │ │ │ │ +109 void setOverlap(T overlap) │ │ │ │ │ + 110 { │ │ │ │ │ + 111 overlap_ = overlap; │ │ │ │ │ + 112 } │ │ │ │ │ + 113 │ │ │ │ │ +115 T getOverlap() const │ │ │ │ │ + 116 { │ │ │ │ │ + 117 return overlap_; │ │ │ │ │ + 118 } │ │ │ │ │ + 119 │ │ │ │ │ +123 void minNormalAngle(T angle) │ │ │ │ │ + 124 { │ │ │ │ │ + 125 using std::cos; │ │ │ │ │ + 126 maxNormalProduct_ = cos(angle); │ │ │ │ │ + 127 } │ │ │ │ │ + 128 │ │ │ │ │ +132 T minNormalAngle() const │ │ │ │ │ + 133 { │ │ │ │ │ + 134 using std::acos; │ │ │ │ │ + 135 return acos(maxNormalProduct_); │ │ │ │ │ + 136 } │ │ │ │ │ + 137 │ │ │ │ │ + 138protected: │ │ │ │ │ +139 typedef typename StandardMerge:: │ │ │ │ │ +SimplicialIntersection SimplicialIntersection; │ │ │ │ │ + 140 │ │ │ │ │ + 141private: │ │ │ │ │ + 145 std::function domainDirections_; │ │ │ │ │ + 146 std::vector nodalDomainDirections_; │ │ │ │ │ + 147 │ │ │ │ │ + 156 std::function targetDirections_; │ │ │ │ │ + 157 std::vector nodalTargetDirections_; │ │ │ │ │ + 158 │ │ │ │ │ + 160 T overlap_; │ │ │ │ │ + 161 │ │ │ │ │ + 163 ProjectionType type_; │ │ │ │ │ + 164 │ │ │ │ │ + 168 T maxNormalProduct_ = T(-0.1); │ │ │ │ │ + 169 │ │ │ │ │ + 174 void computeIntersections(const Dune::GeometryType& grid1ElementType, │ │ │ │ │ + 175 const std::vector >& grid1ElementCorners, │ │ │ │ │ + 176 std::bitset<(1<& neighborIntersects1, │ │ │ │ │ + 177 unsigned int grid1Index, │ │ │ │ │ + 178 const Dune::GeometryType& grid2ElementType, │ │ │ │ │ + 179 const std::vector >& grid2ElementCorners, │ │ │ │ │ + 180 std::bitset<(1<& neighborIntersects2, │ │ │ │ │ + 181 unsigned int grid2Index, │ │ │ │ │ + 182 std::vector& intersections) override; │ │ │ │ │ + 183 │ │ │ │ │ + 187protected: │ │ │ │ │ +188 void build(const std::vector >& grid1Coords, │ │ │ │ │ + 189 const std::vector& grid1Elements, │ │ │ │ │ + 190 const std::vector& grid1ElementTypes, │ │ │ │ │ + 191 const std::vector >& grid2Coords, │ │ │ │ │ + 192 const std::vector& grid2Elements, │ │ │ │ │ + 193 const std::vector& grid2ElementTypes) override │ │ │ │ │ + 194 { │ │ │ │ │ + 195 std::cout<<"ContactMerge building grid!\n"; │ │ │ │ │ + 196 // setup the nodal direction vectors │ │ │ │ │ + 197 setupNodalDirections(grid1Coords, grid1Elements, grid1ElementTypes, │ │ │ │ │ + 198 grid2Coords, grid2Elements, grid2ElementTypes); │ │ │ │ │ + 199 │ │ │ │ │ + 200 Base::build(grid1Coords, grid1Elements, grid1ElementTypes, │ │ │ │ │ + 201 grid2Coords, grid2Elements, grid2ElementTypes); │ │ │ │ │ + 202 │ │ │ │ │ + 203 } │ │ │ │ │ + 204 │ │ │ │ │ + 205private: │ │ │ │ │ + 206 │ │ │ │ │ + 208 static LocalCoords localCornerCoords(int i, const Dune::GeometryType& gt) │ │ │ │ │ + 209 { │ │ │ │ │ + 210 const auto& ref = Dune::ReferenceElements::general(gt); │ │ │ │ │ + 211 return ref.position(i,dim); │ │ │ │ │ + 212 } │ │ │ │ │ + 213 │ │ │ │ │ + 214protected: │ │ │ │ │ + 215 │ │ │ │ │ + 217 void computeCyclicOrder(const std::vector >& │ │ │ │ │ +polytopeCorners, │ │ │ │ │ + 218 const LocalCoords& center, std::vector& ordering) const; │ │ │ │ │ + 219 │ │ │ │ │ + 221 void setupNodalDirections(const std::vector& coords1, │ │ │ │ │ + 222 const std::vector& elements1, │ │ │ │ │ + 223 const std::vector& elementTypes1, │ │ │ │ │ + 224 const std::vector& coords2, │ │ │ │ │ + 225 const std::vector& elements2, │ │ │ │ │ + 226 const std::vector& elementTypes2); │ │ │ │ │ + 227 │ │ │ │ │ + 229 void computeOuterNormalField(const std::vector& coords, │ │ │ │ │ + 230 const std::vector& elements, │ │ │ │ │ + 231 const std::vector& elementTypes, │ │ │ │ │ + 232 std::vector& normals); │ │ │ │ │ + 233 │ │ │ │ │ + 235 void removeDoubles(std::vector >& │ │ │ │ │ +polytopeCorners); │ │ │ │ │ + 236}; │ │ │ │ │ + 237 │ │ │ │ │ + 238} /* namespace GridGlue */ │ │ │ │ │ + 239} /* namespace Dune */ │ │ │ │ │ + 240 │ │ │ │ │ + 241#include "contactmerge.cc" │ │ │ │ │ + 242 │ │ │ │ │ + 243#endif // DUNE_GRIDGLUE_MERGING_CONTACTMERGE_HH │ │ │ │ │ +gridglue.hh │ │ │ │ │ +Central component of the module implementing the coupling of two grids. │ │ │ │ │ +contactmerge.cc │ │ │ │ │ +standardmerge.hh │ │ │ │ │ +Common base class for many merger implementations: produce pairs of entities │ │ │ │ │ +that may intersect. │ │ │ │ │ Dune │ │ │ │ │ Definition: gridglue.hh:37 │ │ │ │ │ -Dune::GridGlue::insertPoint │ │ │ │ │ -int insertPoint(const V p, std::vector< V > &P) │ │ │ │ │ -Definition: computeintersection.hh:164 │ │ │ │ │ -Dune::GridGlue::ComputationMethod │ │ │ │ │ -Definition: computeintersection.hh:13 │ │ │ │ │ -Dune::GridGlue::ComputationMethod::grid2_subdivisions │ │ │ │ │ -static void grid2_subdivisions(const std::vector< Vector > elementCorners, │ │ │ │ │ -std::vector< std::vector< unsigned int > > &subElements, std::vector< std:: │ │ │ │ │ -vector< int > > &faceIds) │ │ │ │ │ -Dune::GridGlue::ComputationMethod::computeIntersectionPoints │ │ │ │ │ -static bool computeIntersectionPoints(const std::vector< Vector > X, const │ │ │ │ │ -std::vector< Vector > Y, std::vector< std::vector< int > > &SX, std::vector< │ │ │ │ │ -std::vector< int > > &SY, std::vector< Vector > &P) │ │ │ │ │ -Dune::GridGlue::ComputationMethod::Vector │ │ │ │ │ -FieldVector< T, dimWorld > Vector │ │ │ │ │ -Definition: computeintersection.hh:15 │ │ │ │ │ -Dune::GridGlue::ComputationMethod::grid1Dimension │ │ │ │ │ -static const int grid1Dimension │ │ │ │ │ -Definition: computeintersection.hh:16 │ │ │ │ │ -Dune::GridGlue::ComputationMethod::grid1_subdivisions │ │ │ │ │ -static void grid1_subdivisions(const std::vector< Vector > elementCorners, │ │ │ │ │ -std::vector< std::vector< unsigned int > > &subElements, std::vector< std:: │ │ │ │ │ -vector< int > > &faceIds) │ │ │ │ │ -Dune::GridGlue::ComputationMethod::grid2Dimension │ │ │ │ │ -static const int grid2Dimension │ │ │ │ │ -Definition: computeintersection.hh:17 │ │ │ │ │ -Dune::GridGlue::ComputationMethod::intersectionDimension │ │ │ │ │ -static const int intersectionDimension │ │ │ │ │ -Definition: computeintersection.hh:18 │ │ │ │ │ -Dune::GridGlue::IntersectionComputation │ │ │ │ │ -Intersection computation method for two elements of arbitrary dimension. │ │ │ │ │ -Definition: computeintersection.hh:39 │ │ │ │ │ -Dune::GridGlue::IntersectionComputation::orderPoints │ │ │ │ │ -static void orderPoints(const V ¢roid, const std::vector< std::vector< int │ │ │ │ │ -> > &SX, const std::vector< std::vector< int > > &SY, const std::vector< V > │ │ │ │ │ -&P, std::vector< std::vector< int > > &H) │ │ │ │ │ -Order Points in the point list P face-wise such that a subsimplex subdivision │ │ │ │ │ -can be constructed. │ │ │ │ │ -Definition: computeintersection.hh:75 │ │ │ │ │ -Dune::GridGlue::IntersectionComputation::computeIntersection │ │ │ │ │ -static bool computeIntersection(const std::vector< V > &X, const std::vector< V │ │ │ │ │ -> &Y, std::vector< std::vector< int > > &SX, std::vector< std::vector< int > > │ │ │ │ │ -&SY, std::vector< V > &P) │ │ │ │ │ -Compute the intersection of two elements X and Y Compute the intersection of │ │ │ │ │ -two elements X and Y,... │ │ │ │ │ -Definition: computeintersection.cc:14 │ │ │ │ │ +Dune::GridGlue::ContactMerge │ │ │ │ │ +Merge two codimension-1 surfaces that may be a positive distance apart. │ │ │ │ │ +Definition: contactmerge.hh:44 │ │ │ │ │ +Dune::GridGlue::ContactMerge::computeCyclicOrder │ │ │ │ │ +void computeCyclicOrder(const std::vector< std::array< LocalCoords, 2 > > │ │ │ │ │ +&polytopeCorners, const LocalCoords ¢er, std::vector< int > &ordering) │ │ │ │ │ +const │ │ │ │ │ +Order the corners of the intersection polytope in cyclic order. │ │ │ │ │ +Definition: contactmerge.cc:214 │ │ │ │ │ +Dune::GridGlue::ContactMerge::SimplicialIntersection │ │ │ │ │ +StandardMerge< T, dimworld-1, dimworld-1, dimworld >::SimplicialIntersection │ │ │ │ │ +SimplicialIntersection │ │ │ │ │ +Definition: contactmerge.hh:139 │ │ │ │ │ +Dune::GridGlue::ContactMerge::removeDoubles │ │ │ │ │ +void removeDoubles(std::vector< std::array< LocalCoords, 2 > > │ │ │ │ │ +&polytopeCorners) │ │ │ │ │ +Remove all multiples. │ │ │ │ │ +Definition: contactmerge.cc:335 │ │ │ │ │ +Dune::GridGlue::ContactMerge::setOverlap │ │ │ │ │ +void setOverlap(T overlap) │ │ │ │ │ +Set the allowed overlap of the surfaces. │ │ │ │ │ +Definition: contactmerge.hh:109 │ │ │ │ │ +Dune::GridGlue::ContactMerge::WorldCoords │ │ │ │ │ +Dune::FieldVector< T, dimworld > WorldCoords │ │ │ │ │ +the coordinate type used in this interface │ │ │ │ │ +Definition: contactmerge.hh:59 │ │ │ │ │ +Dune::GridGlue::ContactMerge::setupNodalDirections │ │ │ │ │ +void setupNodalDirections(const std::vector< WorldCoords > &coords1, const │ │ │ │ │ +std::vector< unsigned int > &elements1, const std::vector< Dune::GeometryType > │ │ │ │ │ +&elementTypes1, const std::vector< WorldCoords > &coords2, const std::vector< │ │ │ │ │ +unsigned int > &elements2, const std::vector< Dune::GeometryType > │ │ │ │ │ +&elementTypes2) │ │ │ │ │ +Setup the direction vectors containing the directions for each vertex. │ │ │ │ │ +Definition: contactmerge.cc:269 │ │ │ │ │ +Dune::GridGlue::ContactMerge::minNormalAngle │ │ │ │ │ +void minNormalAngle(T angle) │ │ │ │ │ +set minimum angle in radians between normals at x and Φ(x) │ │ │ │ │ +Definition: contactmerge.hh:123 │ │ │ │ │ +Dune::GridGlue::ContactMerge::ctype │ │ │ │ │ +T ctype │ │ │ │ │ +the numeric type used in this interface │ │ │ │ │ +Definition: contactmerge.hh:56 │ │ │ │ │ +Dune::GridGlue::ContactMerge::ProjectionType │ │ │ │ │ +ProjectionType │ │ │ │ │ +Type of the projection, closest point or outer normal projection. │ │ │ │ │ +Definition: contactmerge.hh:65 │ │ │ │ │ +Dune::GridGlue::ContactMerge::CLOSEST_POINT │ │ │ │ │ +@ CLOSEST_POINT │ │ │ │ │ +Definition: contactmerge.hh:65 │ │ │ │ │ +Dune::GridGlue::ContactMerge::OUTER_NORMAL │ │ │ │ │ +@ OUTER_NORMAL │ │ │ │ │ +Definition: contactmerge.hh:65 │ │ │ │ │ +Dune::GridGlue::ContactMerge::computeOuterNormalField │ │ │ │ │ +void computeOuterNormalField(const std::vector< WorldCoords > &coords, const │ │ │ │ │ +std::vector< unsigned int > &elements, const std::vector< Dune::GeometryType > │ │ │ │ │ +&elementTypes, std::vector< WorldCoords > &normals) │ │ │ │ │ +If no direction field was specified compute the outer normal field. │ │ │ │ │ +Definition: contactmerge.cc:296 │ │ │ │ │ +Dune::GridGlue::ContactMerge::getOverlap │ │ │ │ │ +T getOverlap() const │ │ │ │ │ +Get the allowed overlap of the surfaces. │ │ │ │ │ +Definition: contactmerge.hh:115 │ │ │ │ │ +Dune::GridGlue::ContactMerge::ContactMerge │ │ │ │ │ +ContactMerge(const T allowedOverlap=T(0), std::function< WorldCoords │ │ │ │ │ +(WorldCoords)> domainDirections=nullptr, std::function< WorldCoords │ │ │ │ │ +(WorldCoords)> targetDirections=nullptr, ProjectionType type=OUTER_NORMAL) │ │ │ │ │ +Construct merger given overlap and possible projection directions. │ │ │ │ │ +Definition: contactmerge.hh:73 │ │ │ │ │ +Dune::GridGlue::ContactMerge::setSurfaceDirections │ │ │ │ │ +void setSurfaceDirections(std::function< WorldCoords(WorldCoords)> │ │ │ │ │ +domainDirections, std::function< WorldCoords(WorldCoords)> targetDirections) │ │ │ │ │ +Set surface direction functions. │ │ │ │ │ +Definition: contactmerge.hh:100 │ │ │ │ │ +Dune::GridGlue::ContactMerge::build │ │ │ │ │ +void build(const std::vector< Dune::FieldVector< T, dimworld > > &grid1Coords, │ │ │ │ │ +const std::vector< unsigned int > &grid1Elements, const std::vector< Dune:: │ │ │ │ │ +GeometryType > &grid1ElementTypes, const std::vector< Dune::FieldVector< T, │ │ │ │ │ +dimworld > > &grid2Coords, const std::vector< unsigned int > &grid2Elements, │ │ │ │ │ +const std::vector< Dune::GeometryType > &grid2ElementTypes) override │ │ │ │ │ +builds the merged grid │ │ │ │ │ +Definition: contactmerge.hh:188 │ │ │ │ │ +Dune::GridGlue::ContactMerge::ContactMerge │ │ │ │ │ +ContactMerge(const T allowedOverlap, ProjectionType type) │ │ │ │ │ +Construct merger given overlap and type of the projection. │ │ │ │ │ +Definition: contactmerge.hh:86 │ │ │ │ │ +Dune::GridGlue::ContactMerge::minNormalAngle │ │ │ │ │ +T minNormalAngle() const │ │ │ │ │ +get minimum angle in radians between normals at x and Φ(x) │ │ │ │ │ +Definition: contactmerge.hh:132 │ │ │ │ │ +Dune::GridGlue::ContactMerge::LocalCoords │ │ │ │ │ +Dune::FieldVector< T, dim > LocalCoords │ │ │ │ │ +the coordinate type used in this interface │ │ │ │ │ +Definition: contactmerge.hh:62 │ │ │ │ │ +Dune::GridGlue::StandardMerge │ │ │ │ │ +Common base class for many merger implementations: produce pairs of entities │ │ │ │ │ +that may intersect. │ │ │ │ │ +Definition: standardmerge.hh:58 │ │ │ │ │ +Dune::GridGlue::StandardMerge::build │ │ │ │ │ +void build(const std::vector< Dune::FieldVector< T, dimworld > > &grid1_Coords, │ │ │ │ │ +const std::vector< unsigned int > &grid1_elements, const std::vector< Dune:: │ │ │ │ │ +GeometryType > &grid1_element_types, const std::vector< Dune::FieldVector< T, │ │ │ │ │ +dimworld > > &grid2_coords, const std::vector< unsigned int > &grid2_elements, │ │ │ │ │ +const std::vector< Dune::GeometryType > &grid2_element_types) override │ │ │ │ │ +builds the merged grid │ │ │ │ │ +Definition: standardmerge.hh:392 │ │ │ │ │ +Dune::GridGlue::StandardMerge<_double,_dimworld-1,_dimworld-1,_dimworld_>:: │ │ │ │ │ +valid │ │ │ │ │ +bool valid │ │ │ │ │ +Definition: standardmerge.hh:86 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00095.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: conformingmerge.hh File Reference │ │ │ │ +dune-grid-glue: standardmerge.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -64,47 +64,139 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ Classes | │ │ │ │ -Namespaces
│ │ │ │ -
conformingmerge.hh File Reference
│ │ │ │ +Namespaces | │ │ │ │ +Macros | │ │ │ │ +Functions
│ │ │ │ +
standardmerge.hh File Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

Implementation of the Merger concept for conforming interfaces. │ │ │ │ +

Common base class for many merger implementations: produce pairs of entities that may intersect. │ │ │ │ More...

│ │ │ │ -
#include <iomanip>
│ │ │ │ +
#include <iostream>
│ │ │ │ +#include <iomanip>
│ │ │ │ #include <vector>
│ │ │ │ +#include <stack>
│ │ │ │ +#include <set>
│ │ │ │ +#include <utility>
│ │ │ │ +#include <map>
│ │ │ │ +#include <memory>
│ │ │ │ #include <algorithm>
│ │ │ │ -#include <bitset>
│ │ │ │ -#include <dune/common/fmatrix.hh>
│ │ │ │ #include <dune/common/fvector.hh>
│ │ │ │ +#include <dune/common/bitsetvector.hh>
│ │ │ │ +#include <dune/common/stdstreams.hh>
│ │ │ │ +#include <dune/common/timer.hh>
│ │ │ │ #include <dune/geometry/referenceelements.hh>
│ │ │ │ -#include <dune/grid-glue/merging/standardmerge.hh>
│ │ │ │ +#include <dune/grid/common/grid.hh>
│ │ │ │ +#include <dune/grid-glue/merging/intersectionlist.hh>
│ │ │ │ +#include <dune/grid-glue/merging/merger.hh>
│ │ │ │ +#include <dune/grid-glue/merging/computeintersection.hh>
│ │ │ │
│ │ │ │

Go to the source code of this file.

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

│ │ │ │ Classes

class  Dune::GridGlue::ConformingMerge< dim, dimworld, T >
 Implementation of the Merger concept for conforming interfaces. More...
class  Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >
 Common base class for many merger implementations: produce pairs of entities that may intersect. More...
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +

│ │ │ │ +Macros

#define DECL   extern
 
#define STANDARD_MERGE_INSTANTIATE(T, A, B, C)
 
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │

│ │ │ │ +Functions

 Dune::GridGlue::STANDARD_MERGE_INSTANTIATE (double, 1, 1, 1)
 
 Dune::GridGlue::STANDARD_MERGE_INSTANTIATE (double, 2, 2, 2)
 
 Dune::GridGlue::STANDARD_MERGE_INSTANTIATE (double, 3, 3, 3)
 
│ │ │ │

Detailed Description

│ │ │ │ -

Implementation of the Merger concept for conforming interfaces.

│ │ │ │ -
│ │ │ │ +

Common base class for many merger implementations: produce pairs of entities that may intersect.

│ │ │ │ +

Macro Definition Documentation

│ │ │ │ + │ │ │ │ +

◆ DECL

│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
#define DECL   extern
│ │ │ │ +
│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │ + │ │ │ │ +

◆ STANDARD_MERGE_INSTANTIATE

│ │ │ │ + │ │ │ │ +
│ │ │ │ +
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
#define STANDARD_MERGE_INSTANTIATE( T,
 A,
 B,
 
)
│ │ │ │ +
│ │ │ │ +Value:
DECL template \
│ │ │ │ +
void StandardMerge<T,A,B,C>::build(const std::vector<Dune::FieldVector<T,C> >& grid1Coords, \
│ │ │ │ +
const std::vector<unsigned int>& grid1_elements, \
│ │ │ │ +
const std::vector<Dune::GeometryType>& grid1_element_types, \
│ │ │ │ +
const std::vector<Dune::FieldVector<T,C> >& grid2Coords, \
│ │ │ │ +
const std::vector<unsigned int>& grid2_elements, \
│ │ │ │ +
const std::vector<Dune::GeometryType>& grid2_element_types \
│ │ │ │ +
)
│ │ │ │ +
#define DECL
Definition: standardmerge.hh:827
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ +
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,33 +5,80 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * merging │ │ │ │ │ -Classes | Namespaces │ │ │ │ │ -conformingmerge.hh File Reference │ │ │ │ │ -Implementation of the Merger concept for conforming interfaces. More... │ │ │ │ │ +Classes | Namespaces | Macros | Functions │ │ │ │ │ +standardmerge.hh File Reference │ │ │ │ │ +Common base class for many merger implementations: produce pairs of entities │ │ │ │ │ +that may intersect. More... │ │ │ │ │ +#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::GridGlue::ConformingMerge<_dim,_dimworld,_T_> │ │ │ │ │ -  Implementation of the Merger concept for conforming interfaces. More... │ │ │ │ │ +class  Dune::GridGlue::StandardMerge<_T,_grid1Dim,_grid2Dim,_dimworld_> │ │ │ │ │ +  Common base class for many merger implementations: produce pairs of │ │ │ │ │ + entities that may intersect. More... │ │ │ │ │   │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::GridGlue │ │ │ │ │   │ │ │ │ │ + Macros │ │ │ │ │ +#define DECL   extern │ │ │ │ │ +  │ │ │ │ │ +#define STANDARD_MERGE_INSTANTIATE(T, A, B, C) │ │ │ │ │ +  │ │ │ │ │ + Functions │ │ │ │ │ + Dune::GridGlue::STANDARD_MERGE_INSTANTIATE (double, 1, 1, 1) │ │ │ │ │ +  │ │ │ │ │ + Dune::GridGlue::STANDARD_MERGE_INSTANTIATE (double, 2, 2, 2) │ │ │ │ │ +  │ │ │ │ │ + Dune::GridGlue::STANDARD_MERGE_INSTANTIATE (double, 3, 3, 3) │ │ │ │ │ +  │ │ │ │ │ ***** Detailed Description ***** │ │ │ │ │ -Implementation of the Merger concept for conforming interfaces. │ │ │ │ │ +Common base class for many merger implementations: produce pairs of entities │ │ │ │ │ +that may intersect. │ │ │ │ │ +***** Macro Definition Documentation ***** │ │ │ │ │ +***** ◆ DECL ***** │ │ │ │ │ +#define DECL   extern │ │ │ │ │ +***** ◆ STANDARD_MERGE_INSTANTIATE ***** │ │ │ │ │ +#define STANDARD_MERGE_INSTANTIATE (  T, │ │ │ │ │ +  A, │ │ │ │ │ +  B, │ │ │ │ │ +  C  │ │ │ │ │ + ) │ │ │ │ │ +Value: │ │ │ │ │ +DECL template \ │ │ │ │ │ +void StandardMerge::build(const std::vector >& │ │ │ │ │ +grid1Coords, \ │ │ │ │ │ +const std::vector& grid1_elements, \ │ │ │ │ │ +const std::vector& grid1_element_types, \ │ │ │ │ │ +const std::vector >& grid2Coords, \ │ │ │ │ │ +const std::vector& grid2_elements, \ │ │ │ │ │ +const std::vector& grid2_element_types \ │ │ │ │ │ +) │ │ │ │ │ +DECL │ │ │ │ │ +#define DECL │ │ │ │ │ +Definition: standardmerge.hh:827 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00095_source.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: conformingmerge.hh Source File │ │ │ │ +dune-grid-glue: standardmerge.hh Source File │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -62,216 +62,835 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -
conformingmerge.hh
│ │ │ │ +
standardmerge.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 © DUNE Project contributors, see file LICENSE.md in module root
│ │ │ │
4// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
│ │ │ │ -
5/*
│ │ │ │ -
6 * Filename: conformingmerge.hh
│ │ │ │ -
7 * Version: 1.0
│ │ │ │ -
8 * Created on: Sep 14, 2009
│ │ │ │ -
9 * Author: Oliver Sander
│ │ │ │ -
10 * ---------------------------------
│ │ │ │ -
11 * Project: dune-grid-glue
│ │ │ │ -
12 * Description: implementation of the Merger concept for conforming interfaces
│ │ │ │ -
13 *
│ │ │ │ -
14 */
│ │ │ │ -
21#ifndef DUNE_GRIDGLUE_MERGING_CONFORMINGMERGE_HH
│ │ │ │ -
22#define DUNE_GRIDGLUE_MERGING_CONFORMINGMERGE_HH
│ │ │ │ +
10#ifndef DUNE_GRIDGLUE_MERGING_STANDARDMERGE_HH
│ │ │ │ +
11#define DUNE_GRIDGLUE_MERGING_STANDARDMERGE_HH
│ │ │ │ +
12
│ │ │ │ +
13
│ │ │ │ +
14#include <iostream>
│ │ │ │ +
15#include <iomanip>
│ │ │ │ +
16#include <vector>
│ │ │ │ +
17#include <stack>
│ │ │ │ +
18#include <set>
│ │ │ │ +
19#include <utility>
│ │ │ │ +
20#include <map>
│ │ │ │ +
21#include <memory>
│ │ │ │ +
22#include <algorithm>
│ │ │ │
23
│ │ │ │ -
24#include <iomanip>
│ │ │ │ -
25#include <vector>
│ │ │ │ -
26#include <algorithm>
│ │ │ │ -
27#include <bitset>
│ │ │ │ +
24#include <dune/common/fvector.hh>
│ │ │ │ +
25#include <dune/common/bitsetvector.hh>
│ │ │ │ +
26#include <dune/common/stdstreams.hh>
│ │ │ │ +
27#include <dune/common/timer.hh>
│ │ │ │
28
│ │ │ │ -
29#include <dune/common/fmatrix.hh>
│ │ │ │ -
30#include <dune/common/fvector.hh>
│ │ │ │ +
29#include <dune/geometry/referenceelements.hh>
│ │ │ │ +
30#include <dune/grid/common/grid.hh>
│ │ │ │
31
│ │ │ │ -
32#include <dune/geometry/referenceelements.hh>
│ │ │ │ -
33
│ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
35
│ │ │ │
36namespace Dune {
│ │ │ │ -
37
│ │ │ │ -
38 namespace GridGlue {
│ │ │ │ -
39
│ │ │ │ -
46template<int dim, int dimworld, typename T = double>
│ │ │ │ - │ │ │ │ -
48 : public StandardMerge<T,dim,dim,dimworld>
│ │ │ │ -
49{
│ │ │ │ -
50
│ │ │ │ -
51public:
│ │ │ │ -
52
│ │ │ │ -
53 /* E X P O R T E D T Y P E S A N D C O N S T A N T S */
│ │ │ │ -
54
│ │ │ │ -
56 typedef T ctype;
│ │ │ │ -
57
│ │ │ │ -
59 typedef Dune::FieldVector<T, dimworld> WorldCoords;
│ │ │ │ +
37namespace GridGlue {
│ │ │ │ +
38
│ │ │ │ +
55template<class T, int grid1Dim, int grid2Dim, int dimworld>
│ │ │ │ + │ │ │ │ +
57 : public Merger<T,grid1Dim,grid2Dim,dimworld>
│ │ │ │ +
58{
│ │ │ │ + │ │ │ │
60
│ │ │ │ -
62 typedef Dune::FieldVector<T, dim> LocalCoords;
│ │ │ │ -
63
│ │ │ │ -
64private:
│ │ │ │ -
65
│ │ │ │ -
66 /* M E M B E R V A R I A B L E S */
│ │ │ │ +
61public:
│ │ │ │ +
62
│ │ │ │ +
63 /* E X P O R T E D T Y P E S A N D C O N S T A N T S */
│ │ │ │ +
64
│ │ │ │ +
66 typedef T ctype;
│ │ │ │
67
│ │ │ │ -
69 T tolerance_;
│ │ │ │ + │ │ │ │
70
│ │ │ │ -
71 typedef typename StandardMerge<T,dim,dim,dimworld>::SimplicialIntersection SimplicialIntersection;
│ │ │ │ -
72
│ │ │ │ -
77 void computeIntersections(const Dune::GeometryType& grid1ElementType,
│ │ │ │ -
78 const std::vector<Dune::FieldVector<T,dimworld> >& grid1ElementCorners,
│ │ │ │ -
79 std::bitset<(1<<dim)>& neighborIntersects1,
│ │ │ │ -
80 unsigned int grid1Index,
│ │ │ │ -
81 const Dune::GeometryType& grid2ElementType,
│ │ │ │ -
82 const std::vector<Dune::FieldVector<T,dimworld> >& grid2ElementCorners,
│ │ │ │ -
83 std::bitset<(1<<dim)>& neighborIntersects2,
│ │ │ │ -
84 unsigned int grid2Index,
│ │ │ │ -
85 std::vector<SimplicialIntersection>& intersections);
│ │ │ │ -
86
│ │ │ │ -
87public:
│ │ │ │ -
88
│ │ │ │ -
89 static constexpr T default_tolerance = 1e-4;
│ │ │ │ -
90
│ │ │ │ - │ │ │ │ -
92 tolerance_(tolerance)
│ │ │ │ -
93 {}
│ │ │ │ -
94};
│ │ │ │ -
95
│ │ │ │ -
96template<int dim, int dimworld, typename T>
│ │ │ │ - │ │ │ │ -
98
│ │ │ │ -
99template<int dim, int dimworld, typename T>
│ │ │ │ -
100void ConformingMerge<dim, dimworld, T>::computeIntersections(const Dune::GeometryType& grid1ElementType,
│ │ │ │ -
101 const std::vector<Dune::FieldVector<T,dimworld> >& grid1ElementCorners,
│ │ │ │ -
102 std::bitset<(1<<dim)>& neighborIntersects1,
│ │ │ │ -
103 unsigned int grid1Index,
│ │ │ │ -
104 const Dune::GeometryType& grid2ElementType,
│ │ │ │ -
105 const std::vector<Dune::FieldVector<T,dimworld> >& grid2ElementCorners,
│ │ │ │ -
106 std::bitset<(1<<dim)>& neighborIntersects2,
│ │ │ │ -
107 unsigned int grid2Index,
│ │ │ │ -
108 std::vector<SimplicialIntersection>& intersections)
│ │ │ │ -
109{
│ │ │ │ -
110 this->counter++;
│ │ │ │ -
111
│ │ │ │ -
112 // A few consistency checks
│ │ │ │ -
113 assert((unsigned int)(Dune::ReferenceElements<T,dim>::general(grid1ElementType).size(dim)) == grid1ElementCorners.size());
│ │ │ │ -
114 assert((unsigned int)(Dune::ReferenceElements<T,dim>::general(grid2ElementType).size(dim)) == grid2ElementCorners.size());
│ │ │ │ -
115 // any intersection we may find will be the entire elements.
│ │ │ │ -
116 neighborIntersects1.reset();
│ │ │ │ -
117 neighborIntersects2.reset();
│ │ │ │ -
118
│ │ │ │ -
119 // the intersection is either conforming or empty, hence the GeometryTypes have to match
│ │ │ │ -
120 if (grid1ElementType != grid2ElementType)
│ │ │ │ -
121 return;
│ │ │ │ + │ │ │ │ +
73
│ │ │ │ + │ │ │ │ +
76
│ │ │ │ + │ │ │ │ +
78
│ │ │ │ +
79protected:
│ │ │ │ +
80
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
85
│ │ │ │ +
86 bool valid = false;
│ │ │ │ +
87
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
91 {}
│ │ │ │ +
92
│ │ │ │ +
93 virtual ~StandardMerge() = default;
│ │ │ │ +
94
│ │ │ │ +
99 virtual void computeIntersections(const Dune::GeometryType& grid1ElementType,
│ │ │ │ +
100 const std::vector<Dune::FieldVector<T,dimworld> >& grid1ElementCorners,
│ │ │ │ +
101 std::bitset<(1<<grid1Dim)>& neighborIntersects1,
│ │ │ │ +
102 unsigned int grid1Index,
│ │ │ │ +
103 const Dune::GeometryType& grid2ElementType,
│ │ │ │ +
104 const std::vector<Dune::FieldVector<T,dimworld> >& grid2ElementCorners,
│ │ │ │ +
105 std::bitset<(1<<grid2Dim)>& neighborIntersects2,
│ │ │ │ +
106 unsigned int grid2Index,
│ │ │ │ +
107 std::vector<SimplicialIntersection>& intersections) = 0;
│ │ │ │ +
108
│ │ │ │ +
112 bool computeIntersection(unsigned int candidate0, unsigned int candidate1,
│ │ │ │ +
113 const std::vector<Dune::FieldVector<T,dimworld> >& grid1Coords,
│ │ │ │ +
114 const std::vector<Dune::GeometryType>& grid1_element_types,
│ │ │ │ +
115 std::bitset<(1<<grid1Dim)>& neighborIntersects1,
│ │ │ │ +
116 const std::vector<Dune::FieldVector<T,dimworld> >& grid2Coords,
│ │ │ │ +
117 const std::vector<Dune::GeometryType>& grid2_element_types,
│ │ │ │ +
118 std::bitset<(1<<grid2Dim)>& neighborIntersects2,
│ │ │ │ +
119 bool insert = true);
│ │ │ │ +
120
│ │ │ │ +
121 /* M E M B E R V A R I A B L E S */
│ │ │ │
122
│ │ │ │ -
123 // ////////////////////////////////////////////////////////////
│ │ │ │ -
124 // Find correspondences between the different corners
│ │ │ │ -
125 // ////////////////////////////////////////////////////////////
│ │ │ │ -
126 std::vector<int> other(grid1ElementCorners.size(), -1);
│ │ │ │ -
127
│ │ │ │ -
128 for (unsigned int i=0; i<grid1ElementCorners.size(); i++) {
│ │ │ │ +
123 std::shared_ptr<IntersectionListProvider> intersectionListProvider_;
│ │ │ │ +
124 std::shared_ptr<IntersectionList> intersectionList_;
│ │ │ │ +
125
│ │ │ │ +
127 std::vector<std::vector<unsigned int> > grid1ElementCorners_;
│ │ │ │ +
128 std::vector<std::vector<unsigned int> > grid2ElementCorners_;
│ │ │ │
129
│ │ │ │ -
130 for (unsigned int j=0; j<grid2ElementCorners.size(); j++) {
│ │ │ │ -
131
│ │ │ │ -
132 if ( (grid1ElementCorners[i]-grid2ElementCorners[j]).two_norm() < tolerance_ ) {
│ │ │ │ -
133
│ │ │ │ -
134 other[i] = j;
│ │ │ │ -
135 break;
│ │ │ │ +
130 std::vector<std::vector<int> > elementNeighbors1_;
│ │ │ │ +
131 std::vector<std::vector<int> > elementNeighbors2_;
│ │ │ │ +
132
│ │ │ │ +
133public:
│ │ │ │ +
134
│ │ │ │ +
135 /* C O N C E P T I M P L E M E N T I N G I N T E R F A C E */
│ │ │ │
136
│ │ │ │ -
137 }
│ │ │ │ -
138
│ │ │ │ -
139 }
│ │ │ │ -
140
│ │ │ │ -
141 // No corresponding grid2 vertex found for this grid1 vertex
│ │ │ │ -
142 if (other[i] == -1)
│ │ │ │ -
143 return;
│ │ │ │ -
144
│ │ │ │ -
145 }
│ │ │ │ +
140 void build(const std::vector<Dune::FieldVector<T,dimworld> >& grid1_Coords,
│ │ │ │ +
141 const std::vector<unsigned int>& grid1_elements,
│ │ │ │ +
142 const std::vector<Dune::GeometryType>& grid1_element_types,
│ │ │ │ +
143 const std::vector<Dune::FieldVector<T,dimworld> >& grid2_coords,
│ │ │ │ +
144 const std::vector<unsigned int>& grid2_elements,
│ │ │ │ +
145 const std::vector<Dune::GeometryType>& grid2_element_types) override;
│ │ │ │
146
│ │ │ │ -
147 // ////////////////////////////////////////////////////////////
│ │ │ │ -
148 // Set up the new remote intersection
│ │ │ │ -
149 // ////////////////////////////////////////////////////////////
│ │ │ │ -
150
│ │ │ │ -
151 const auto& refElement = Dune::ReferenceElements<T,dim>::general(grid1ElementType);
│ │ │ │ -
152
│ │ │ │ -
154 if (grid1ElementType.isSimplex()) {
│ │ │ │ -
155
│ │ │ │ -
156 intersections.emplace_back(grid1Index, grid2Index);
│ │ │ │ -
157
│ │ │ │ -
158 for (int i=0; i<refElement.size(dim); i++) {
│ │ │ │ -
159 intersections.back().corners0[0][i] = refElement.position(i,dim);
│ │ │ │ -
160 intersections.back().corners1[0][i] = refElement.position(other[i],dim);
│ │ │ │ -
161 }
│ │ │ │ -
162
│ │ │ │ -
163 } else if (dim == 2 && grid1ElementType.isQuadrilateral()) {
│ │ │ │ -
164
│ │ │ │ -
165 // split the quadrilateral into two triangles
│ │ │ │ -
166 const unsigned int subVertices[2][3] = {{0,1,3}, {0,3,2}};
│ │ │ │ -
167
│ │ │ │ -
168 for (int i=0; i<2; i++) {
│ │ │ │ -
169
│ │ │ │ -
170 SimplicialIntersection newSimplicialIntersection(grid1Index, grid2Index);
│ │ │ │ -
171
│ │ │ │ -
172 for (int j=0; j<dim+1; j++) {
│ │ │ │ -
173 newSimplicialIntersection.corners0[0][j] = refElement.position(subVertices[i][j],dim);
│ │ │ │ -
174 newSimplicialIntersection.corners1[0][j] = refElement.position(subVertices[i][other[j]],dim);
│ │ │ │ -
175 }
│ │ │ │ -
176
│ │ │ │ -
177 intersections.push_back(newSimplicialIntersection);
│ │ │ │ -
178
│ │ │ │ -
179 }
│ │ │ │ -
180
│ │ │ │ -
181 } else if (grid1ElementType.isHexahedron()) {
│ │ │ │ -
182
│ │ │ │ -
183 // split the hexahedron into five tetrahedra
│ │ │ │ -
184 // This can be removed if ever we allow Intersections that are not simplices
│ │ │ │ -
185 const unsigned int subVertices[5][4] = {{0,1,3,5}, {0,3,2,6}, {4,5,0,6}, {6,7,6,3}, {6,0,5,3}};
│ │ │ │ +
147
│ │ │ │ +
148 /* P R O B I N G T H E M E R G E D G R I D */
│ │ │ │ +
149
│ │ │ │ +
150 void clear() override
│ │ │ │ +
151 {
│ │ │ │ +
152 // Delete old internal data, from a possible previous run
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ +
156
│ │ │ │ +
157 valid = false;
│ │ │ │ +
158 }
│ │ │ │ +
159
│ │ │ │ +
160 std::shared_ptr<IntersectionList> intersectionList() const final
│ │ │ │ +
161 {
│ │ │ │ +
162 assert(valid);
│ │ │ │ +
163 return intersectionList_;
│ │ │ │ +
164 }
│ │ │ │ +
165
│ │ │ │ +
166 void enableFallback(bool fallback)
│ │ │ │ +
167 {
│ │ │ │ +
168 m_enableFallback = fallback;
│ │ │ │ +
169 }
│ │ │ │ +
170
│ │ │ │ +
171 void enableBruteForce(bool bruteForce)
│ │ │ │ +
172 {
│ │ │ │ +
173 m_enableBruteForce = bruteForce;
│ │ │ │ +
174 }
│ │ │ │ +
175
│ │ │ │ +
176private:
│ │ │ │ +
180 bool m_enableFallback = false;
│ │ │ │ +
181
│ │ │ │ +
185 bool m_enableBruteForce = false;
│ │ │ │
186
│ │ │ │ -
187 for (int i=0; i<5; i++) {
│ │ │ │ -
188
│ │ │ │ -
189 SimplicialIntersection newSimplicialIntersection(grid1Index, grid2Index);
│ │ │ │ -
190
│ │ │ │ -
191 for (int j=0; j<dim+1; j++) {
│ │ │ │ -
192 newSimplicialIntersection.corners0[0][j] = refElement.position(subVertices[i][j],dim);
│ │ │ │ -
193 newSimplicialIntersection.corners1[0][j] = refElement.position(subVertices[i][other[j]],dim);
│ │ │ │ -
194 }
│ │ │ │ -
195
│ │ │ │ -
196 intersections.push_back(newSimplicialIntersection);
│ │ │ │ -
197
│ │ │ │ -
198 }
│ │ │ │ -
199
│ │ │ │ -
200 } else
│ │ │ │ -
201 DUNE_THROW(Dune::GridError, "Unsupported element type");
│ │ │ │ -
202
│ │ │ │ -
203}
│ │ │ │ -
204
│ │ │ │ -
205} // namespace GridGlue
│ │ │ │ -
206
│ │ │ │ -
207} // namespace Dune
│ │ │ │ -
208
│ │ │ │ -
209#endif // DUNE_GRIDGLUE_MERGING_CONFORMINGMERGE_HH
│ │ │ │ -
Common base class for many merger implementations: produce pairs of entities that may intersect.
│ │ │ │ +
187 auto& intersections()
│ │ │ │ +
188 { return intersectionListProvider_->intersections(); }
│ │ │ │ +
189
│ │ │ │ +
191 template<typename V>
│ │ │ │ +
192 static void purge(V & v)
│ │ │ │ +
193 {
│ │ │ │ +
194 v.clear();
│ │ │ │ +
195 V v2(v);
│ │ │ │ +
196 v.swap(v2);
│ │ │ │ +
197 }
│ │ │ │ +
198
│ │ │ │ +
203 void generateSeed(std::vector<int>& seeds,
│ │ │ │ +
204 Dune::BitSetVector<1>& isHandled2,
│ │ │ │ +
205 std::stack<unsigned>& candidates2,
│ │ │ │ +
206 const std::vector<Dune::FieldVector<T, dimworld> >& grid1Coords,
│ │ │ │ +
207 const std::vector<Dune::GeometryType>& grid1_element_types,
│ │ │ │ +
208 const std::vector<Dune::FieldVector<T, dimworld> >& grid2Coords,
│ │ │ │ +
209 const std::vector<Dune::GeometryType>& grid2_element_types);
│ │ │ │ +
210
│ │ │ │ +
214 int insertIntersections(unsigned int candidate1, unsigned int candidate2,std::vector<SimplicialIntersection>& intersections);
│ │ │ │ +
215
│ │ │ │ +
219 int bruteForceSearch(int candidate1,
│ │ │ │ +
220 const std::vector<Dune::FieldVector<T,dimworld> >& grid1Coords,
│ │ │ │ +
221 const std::vector<Dune::GeometryType>& grid1_element_types,
│ │ │ │ +
222 const std::vector<Dune::FieldVector<T,dimworld> >& grid2Coords,
│ │ │ │ +
223 const std::vector<Dune::GeometryType>& grid2_element_types);
│ │ │ │ +
224
│ │ │ │ +
228 std::pair<bool, unsigned int>
│ │ │ │ +
229 intersectionIndex(unsigned int grid1Index, unsigned int grid2Index,
│ │ │ │ +
230 SimplicialIntersection& intersection);
│ │ │ │ +
231
│ │ │ │ +
235 template <int gridDim>
│ │ │ │ +
236 void computeNeighborsPerElement(const std::vector<Dune::GeometryType>& gridElementTypes,
│ │ │ │ +
237 const std::vector<std::vector<unsigned int> >& gridElementCorners,
│ │ │ │ +
238 std::vector<std::vector<int> >& elementNeighbors);
│ │ │ │ +
239
│ │ │ │ +
240 void buildAdvancingFront(
│ │ │ │ +
241 const std::vector<Dune::FieldVector<T,dimworld> >& grid1_Coords,
│ │ │ │ +
242 const std::vector<unsigned int>& grid1_elements,
│ │ │ │ +
243 const std::vector<Dune::GeometryType>& grid1_element_types,
│ │ │ │ +
244 const std::vector<Dune::FieldVector<T,dimworld> >& grid2_coords,
│ │ │ │ +
245 const std::vector<unsigned int>& grid2_elements,
│ │ │ │ +
246 const std::vector<Dune::GeometryType>& grid2_element_types
│ │ │ │ +
247 );
│ │ │ │ +
248
│ │ │ │ +
249 void buildBruteForce(
│ │ │ │ +
250 const std::vector<Dune::FieldVector<T,dimworld> >& grid1_Coords,
│ │ │ │ +
251 const std::vector<unsigned int>& grid1_elements,
│ │ │ │ +
252 const std::vector<Dune::GeometryType>& grid1_element_types,
│ │ │ │ +
253 const std::vector<Dune::FieldVector<T,dimworld> >& grid2_coords,
│ │ │ │ +
254 const std::vector<unsigned int>& grid2_elements,
│ │ │ │ +
255 const std::vector<Dune::GeometryType>& grid2_element_types
│ │ │ │ +
256 );
│ │ │ │ +
257};
│ │ │ │ +
258
│ │ │ │ +
259
│ │ │ │ +
260/* IMPLEMENTATION */
│ │ │ │ +
261
│ │ │ │ +
262template<typename T, int grid1Dim, int grid2Dim, int dimworld>
│ │ │ │ +
263bool StandardMerge<T,grid1Dim,grid2Dim,dimworld>::computeIntersection(unsigned int candidate0, unsigned int candidate1,
│ │ │ │ +
264 const std::vector<Dune::FieldVector<T,dimworld> >& grid1Coords,
│ │ │ │ +
265 const std::vector<Dune::GeometryType>& grid1_element_types,
│ │ │ │ +
266 std::bitset<(1<<grid1Dim)>& neighborIntersects1,
│ │ │ │ +
267 const std::vector<Dune::FieldVector<T,dimworld> >& grid2Coords,
│ │ │ │ +
268 const std::vector<Dune::GeometryType>& grid2_element_types,
│ │ │ │ +
269 std::bitset<(1<<grid2Dim)>& neighborIntersects2,
│ │ │ │ +
270 bool insert)
│ │ │ │ +
271{
│ │ │ │ +
272 // Select vertices of the grid1 element
│ │ │ │ +
273 int grid1NumVertices = grid1ElementCorners_[candidate0].size();
│ │ │ │ +
274 std::vector<Dune::FieldVector<T,dimworld> > grid1ElementCorners(grid1NumVertices);
│ │ │ │ +
275 for (int i=0; i<grid1NumVertices; i++)
│ │ │ │ +
276 grid1ElementCorners[i] = grid1Coords[grid1ElementCorners_[candidate0][i]];
│ │ │ │ +
277
│ │ │ │ +
278 // Select vertices of the grid2 element
│ │ │ │ +
279 int grid2NumVertices = grid2ElementCorners_[candidate1].size();
│ │ │ │ +
280 std::vector<Dune::FieldVector<T,dimworld> > grid2ElementCorners(grid2NumVertices);
│ │ │ │ +
281 for (int i=0; i<grid2NumVertices; i++)
│ │ │ │ +
282 grid2ElementCorners[i] = grid2Coords[grid2ElementCorners_[candidate1][i]];
│ │ │ │ +
283
│ │ │ │ +
284 // ///////////////////////////////////////////////////////
│ │ │ │ +
285 // Compute the intersection between the two elements
│ │ │ │ +
286 // ///////////////////////////////////////////////////////
│ │ │ │ +
287
│ │ │ │ +
288 std::vector<SimplicialIntersection> intersections(0);
│ │ │ │ +
289
│ │ │ │ +
290 // compute the intersections
│ │ │ │ +
291 computeIntersections(grid1_element_types[candidate0], grid1ElementCorners,
│ │ │ │ +
292 neighborIntersects1, candidate0,
│ │ │ │ +
293 grid2_element_types[candidate1], grid2ElementCorners,
│ │ │ │ +
294 neighborIntersects2, candidate1,
│ │ │ │ + │ │ │ │ +
296
│ │ │ │ +
297 // insert intersections if needed
│ │ │ │ +
298 if(insert && !intersections.empty())
│ │ │ │ +
299 insertIntersections(candidate0,candidate1,intersections);
│ │ │ │ +
300
│ │ │ │ +
301 // Have we found an intersection?
│ │ │ │ +
302 return !intersections.empty() || neighborIntersects1.any() || neighborIntersects2.any();
│ │ │ │ +
303
│ │ │ │ +
304}
│ │ │ │ +
305
│ │ │ │ +
306template<typename T, int grid1Dim, int grid2Dim, int dimworld>
│ │ │ │ + │ │ │ │ +
308 const std::vector<Dune::FieldVector<T,dimworld> >& grid1Coords,
│ │ │ │ +
309 const std::vector<Dune::GeometryType>& grid1_element_types,
│ │ │ │ +
310 const std::vector<Dune::FieldVector<T,dimworld> >& grid2Coords,
│ │ │ │ +
311 const std::vector<Dune::GeometryType>& grid2_element_types)
│ │ │ │ +
312{
│ │ │ │ +
313 std::bitset<(1<<grid1Dim)> neighborIntersects1;
│ │ │ │ +
314 std::bitset<(1<<grid2Dim)> neighborIntersects2;
│ │ │ │ +
315 for (std::size_t i=0; i<grid1_element_types.size(); i++) {
│ │ │ │ +
316
│ │ │ │ +
317 bool intersectionFound = computeIntersection(i, candidate1,
│ │ │ │ +
318 grid1Coords, grid1_element_types, neighborIntersects1,
│ │ │ │ +
319 grid2Coords, grid2_element_types, neighborIntersects2,
│ │ │ │ +
320 false);
│ │ │ │ +
321
│ │ │ │ +
322 // if there is an intersection, i is our new seed candidate on the grid1 side
│ │ │ │ +
323 if (intersectionFound)
│ │ │ │ +
324 return i;
│ │ │ │ +
325
│ │ │ │ +
326 }
│ │ │ │ +
327
│ │ │ │ +
328 return -1;
│ │ │ │ +
329}
│ │ │ │ +
330
│ │ │ │ +
331
│ │ │ │ +
332template<typename T, int grid1Dim, int grid2Dim, int dimworld>
│ │ │ │ +
333template<int gridDim>
│ │ │ │ +
334void StandardMerge<T,grid1Dim,grid2Dim,dimworld>::
│ │ │ │ +
335computeNeighborsPerElement(const std::vector<Dune::GeometryType>& gridElementTypes,
│ │ │ │ +
336 const std::vector<std::vector<unsigned int> >& gridElementCorners,
│ │ │ │ +
337 std::vector<std::vector<int> >& elementNeighbors)
│ │ │ │ +
338{
│ │ │ │ +
339 typedef std::vector<unsigned int> FaceType;
│ │ │ │ +
340 typedef std::map<FaceType, std::pair<unsigned int, unsigned int> > FaceSetType;
│ │ │ │ +
341
│ │ │ │ +
343 // First: grid 1
│ │ │ │ +
345 FaceSetType faces;
│ │ │ │ +
346 elementNeighbors.resize(gridElementTypes.size());
│ │ │ │ +
347
│ │ │ │ +
348 for (size_t i=0; i<gridElementTypes.size(); i++)
│ │ │ │ +
349 elementNeighbors[i].resize(Dune::ReferenceElements<T,gridDim>::general(gridElementTypes[i]).size(1), -1);
│ │ │ │ +
350
│ │ │ │ +
351 for (size_t i=0; i<gridElementTypes.size(); i++) { //iterate over all elements
│ │ │ │ +
352 const auto& refElement = Dune::ReferenceElements<T,gridDim>::general(gridElementTypes[i]);
│ │ │ │ +
353
│ │ │ │ +
354 for (size_t j=0; j<(size_t)refElement.size(1); j++) { // iterate over all faces of the element
│ │ │ │ +
355
│ │ │ │ +
356 FaceType face;
│ │ │ │ +
357 // extract element face
│ │ │ │ +
358 for (size_t k=0; k<(size_t)refElement.size(j,1,gridDim); k++)
│ │ │ │ +
359 face.push_back(gridElementCorners[i][refElement.subEntity(j,1,k,gridDim)]);
│ │ │ │ +
360
│ │ │ │ +
361 // sort the face vertices to get rid of twists and other permutations
│ │ │ │ +
362 std::sort(face.begin(), face.end());
│ │ │ │ +
363
│ │ │ │ +
364 typename FaceSetType::iterator faceHandle = faces.find(face);
│ │ │ │ +
365
│ │ │ │ +
366 if (faceHandle == faces.end()) {
│ │ │ │ +
367
│ │ │ │ +
368 // face has not been visited before
│ │ │ │ +
369 faces.insert(std::make_pair(face, std::make_pair(i,j)));
│ │ │ │ +
370
│ │ │ │ +
371 } else {
│ │ │ │ +
372
│ │ │ │ +
373 // face has been visited before: store the mutual neighbor information
│ │ │ │ +
374 elementNeighbors[i][j] = faceHandle->second.first;
│ │ │ │ +
375 elementNeighbors[faceHandle->second.first][faceHandle->second.second] = i;
│ │ │ │ +
376
│ │ │ │ +
377 faces.erase(faceHandle);
│ │ │ │ +
378
│ │ │ │ +
379 }
│ │ │ │ +
380
│ │ │ │ +
381 }
│ │ │ │ +
382
│ │ │ │ +
383 }
│ │ │ │ +
384}
│ │ │ │ +
385
│ │ │ │ +
386// /////////////////////////////////////////////////////////////////////
│ │ │ │ +
387// Compute the intersection of all pairs of elements
│ │ │ │ +
388// Linear algorithm by Gander and Japhet, Proc. of DD18
│ │ │ │ +
389// /////////////////////////////////////////////////////////////////////
│ │ │ │ +
390
│ │ │ │ +
391template<typename T, int grid1Dim, int grid2Dim, int dimworld>
│ │ │ │ +
392void StandardMerge<T,grid1Dim,grid2Dim,dimworld>::build(const std::vector<Dune::FieldVector<T,dimworld> >& grid1Coords,
│ │ │ │ +
393 const std::vector<unsigned int>& grid1_elements,
│ │ │ │ +
394 const std::vector<Dune::GeometryType>& grid1_element_types,
│ │ │ │ +
395 const std::vector<Dune::FieldVector<T,dimworld> >& grid2Coords,
│ │ │ │ +
396 const std::vector<unsigned int>& grid2_elements,
│ │ │ │ +
397 const std::vector<Dune::GeometryType>& grid2_element_types
│ │ │ │ +
398 )
│ │ │ │ +
399{
│ │ │ │ +
400
│ │ │ │ +
401 std::cout << "StandardMerge building merged grid..." << std::endl;
│ │ │ │ +
402 Dune::Timer watch;
│ │ │ │ +
403
│ │ │ │ +
404 clear();
│ │ │ │ +
405 // clear global intersection list
│ │ │ │ +
406 intersectionListProvider_->clear();
│ │ │ │ +
407 this->counter = 0;
│ │ │ │ +
408
│ │ │ │ +
409 // /////////////////////////////////////////////////////////////////////
│ │ │ │ +
410 // Copy element corners into a data structure with block-structure.
│ │ │ │ +
411 // This is not as efficient but a lot easier to use.
│ │ │ │ +
412 // We may think about efficiency later.
│ │ │ │ +
413 // /////////////////////////////////////////////////////////////////////
│ │ │ │ +
414
│ │ │ │ +
415 // first the grid1 side
│ │ │ │ +
416 grid1ElementCorners_.resize(grid1_element_types.size());
│ │ │ │ +
417
│ │ │ │ +
418 unsigned int grid1CornerCounter = 0;
│ │ │ │ +
419
│ │ │ │ +
420 for (std::size_t i=0; i<grid1_element_types.size(); i++) {
│ │ │ │ +
421
│ │ │ │ +
422 // Select vertices of the grid1 element
│ │ │ │ +
423 int numVertices = Dune::ReferenceElements<T,grid1Dim>::general(grid1_element_types[i]).size(grid1Dim);
│ │ │ │ +
424 grid1ElementCorners_[i].resize(numVertices);
│ │ │ │ +
425 for (int j=0; j<numVertices; j++)
│ │ │ │ +
426 grid1ElementCorners_[i][j] = grid1_elements[grid1CornerCounter++];
│ │ │ │ +
427
│ │ │ │ +
428 }
│ │ │ │ +
429
│ │ │ │ +
430 // then the grid2 side
│ │ │ │ +
431 grid2ElementCorners_.resize(grid2_element_types.size());
│ │ │ │ +
432
│ │ │ │ +
433 unsigned int grid2CornerCounter = 0;
│ │ │ │ +
434
│ │ │ │ +
435 for (std::size_t i=0; i<grid2_element_types.size(); i++) {
│ │ │ │ +
436
│ │ │ │ +
437 // Select vertices of the grid2 element
│ │ │ │ +
438 int numVertices = Dune::ReferenceElements<T,grid2Dim>::general(grid2_element_types[i]).size(grid2Dim);
│ │ │ │ +
439 grid2ElementCorners_[i].resize(numVertices);
│ │ │ │ +
440 for (int j=0; j<numVertices; j++)
│ │ │ │ +
441 grid2ElementCorners_[i][j] = grid2_elements[grid2CornerCounter++];
│ │ │ │ +
442
│ │ │ │ +
443 }
│ │ │ │ +
444
│ │ │ │ +
446 // Compute the face neighbors for each element
│ │ │ │ +
448
│ │ │ │ +
449 computeNeighborsPerElement<grid1Dim>(grid1_element_types, grid1ElementCorners_, elementNeighbors1_);
│ │ │ │ +
450 computeNeighborsPerElement<grid2Dim>(grid2_element_types, grid2ElementCorners_, elementNeighbors2_);
│ │ │ │ +
451
│ │ │ │ +
452 std::cout << "setup took " << watch.elapsed() << " seconds." << std::endl;
│ │ │ │ +
453
│ │ │ │ +
454 if (m_enableBruteForce)
│ │ │ │ +
455 buildBruteForce(grid1Coords, grid1_elements, grid1_element_types, grid2Coords, grid2_elements, grid2_element_types);
│ │ │ │ +
456 else
│ │ │ │ +
457 buildAdvancingFront(grid1Coords, grid1_elements, grid1_element_types, grid2Coords, grid2_elements, grid2_element_types);
│ │ │ │ +
458
│ │ │ │ +
459 valid = true;
│ │ │ │ +
460 std::cout << "intersection construction took " << watch.elapsed() << " seconds." << std::endl;
│ │ │ │ +
461}
│ │ │ │ +
462
│ │ │ │ +
463template<typename T, int grid1Dim, int grid2Dim, int dimworld>
│ │ │ │ + │ │ │ │ +
465 const std::vector<Dune::FieldVector<T,dimworld> >& grid1Coords,
│ │ │ │ +
466 const std::vector<unsigned int>& grid1_elements,
│ │ │ │ +
467 const std::vector<Dune::GeometryType>& grid1_element_types,
│ │ │ │ +
468 const std::vector<Dune::FieldVector<T,dimworld> >& grid2Coords,
│ │ │ │ +
469 const std::vector<unsigned int>& grid2_elements,
│ │ │ │ +
470 const std::vector<Dune::GeometryType>& grid2_element_types
│ │ │ │ +
471 )
│ │ │ │ +
472{
│ │ │ │ +
474 // Data structures for the advancing-front algorithm
│ │ │ │ +
476
│ │ │ │ +
477 std::stack<unsigned int> candidates1;
│ │ │ │ +
478 std::stack<unsigned int> candidates2;
│ │ │ │ +
479
│ │ │ │ +
480 std::vector<int> seeds(grid2_element_types.size(), -1);
│ │ │ │ +
481
│ │ │ │ +
482 // /////////////////////////////////////////////////////////////////////
│ │ │ │ +
483 // Do a brute-force search to find one pair of intersecting elements
│ │ │ │ +
484 // to start the advancing-front type algorithm with.
│ │ │ │ +
485 // /////////////////////////////////////////////////////////////////////
│ │ │ │ +
486
│ │ │ │ +
487 // Set flag if element has been handled
│ │ │ │ +
488 Dune::BitSetVector<1> isHandled2(grid2_element_types.size());
│ │ │ │ +
489
│ │ │ │ +
490 // Set flag if the element has been entered in the queue
│ │ │ │ +
491 Dune::BitSetVector<1> isCandidate2(grid2_element_types.size());
│ │ │ │ +
492
│ │ │ │ +
493 generateSeed(seeds, isHandled2, candidates2, grid1Coords, grid1_element_types, grid2Coords, grid2_element_types);
│ │ │ │ +
494
│ │ │ │ +
495 // /////////////////////////////////////////////////////////////////////
│ │ │ │ +
496 // Main loop
│ │ │ │ +
497 // /////////////////////////////////////////////////////////////////////
│ │ │ │ +
498
│ │ │ │ +
499 std::set<unsigned int> isHandled1;
│ │ │ │ +
500
│ │ │ │ +
501 std::set<unsigned int> isCandidate1;
│ │ │ │ +
502
│ │ │ │ +
503 while (!candidates2.empty()) {
│ │ │ │ +
504
│ │ │ │ +
505 // Get the next element on the grid2 side
│ │ │ │ +
506 unsigned int currentCandidate2 = candidates2.top();
│ │ │ │ +
507 int seed = seeds[currentCandidate2];
│ │ │ │ +
508 assert(seed >= 0);
│ │ │ │ +
509
│ │ │ │ +
510 candidates2.pop();
│ │ │ │ +
511 isHandled2[currentCandidate2] = true;
│ │ │ │ +
512
│ │ │ │ +
513 // Start advancing front algorithm on the grid1 side from the 'seed' element that
│ │ │ │ +
514 // we stored along with the current grid2 element
│ │ │ │ +
515 candidates1.push(seed);
│ │ │ │ +
516
│ │ │ │ +
517 isHandled1.clear();
│ │ │ │ +
518 isCandidate1.clear();
│ │ │ │ +
519
│ │ │ │ +
520 while (!candidates1.empty()) {
│ │ │ │ +
521
│ │ │ │ +
522 unsigned int currentCandidate1 = candidates1.top();
│ │ │ │ +
523 candidates1.pop();
│ │ │ │ +
524 isHandled1.insert(currentCandidate1);
│ │ │ │ +
525
│ │ │ │ +
526 // Test whether there is an intersection between currentCandidate0 and currentCandidate1
│ │ │ │ +
527 std::bitset<(1<<grid1Dim)> neighborIntersects1;
│ │ │ │ +
528 std::bitset<(1<<grid2Dim)> neighborIntersects2;
│ │ │ │ +
529 bool intersectionFound = computeIntersection(currentCandidate1, currentCandidate2,
│ │ │ │ +
530 grid1Coords,grid1_element_types, neighborIntersects1,
│ │ │ │ +
531 grid2Coords,grid2_element_types, neighborIntersects2);
│ │ │ │ +
532
│ │ │ │ +
533 for (size_t i=0; i<neighborIntersects2.size(); i++)
│ │ │ │ +
534 if (neighborIntersects2[i] && elementNeighbors2_[currentCandidate2][i] != -1)
│ │ │ │ +
535 seeds[elementNeighbors2_[currentCandidate2][i]] = currentCandidate1;
│ │ │ │ +
536
│ │ │ │ +
537 // add neighbors of candidate0 to the list of elements to be checked
│ │ │ │ +
538 if (intersectionFound) {
│ │ │ │ +
539
│ │ │ │ +
540 for (size_t i=0; i<elementNeighbors1_[currentCandidate1].size(); i++) {
│ │ │ │ +
541
│ │ │ │ +
542 int neighbor = elementNeighbors1_[currentCandidate1][i];
│ │ │ │ +
543
│ │ │ │ +
544 if (neighbor == -1) // do nothing at the grid boundary
│ │ │ │ +
545 continue;
│ │ │ │ +
546
│ │ │ │ +
547 if (isHandled1.find(neighbor) == isHandled1.end()
│ │ │ │ +
548 && isCandidate1.find(neighbor) == isCandidate1.end()) {
│ │ │ │ +
549 candidates1.push(neighbor);
│ │ │ │ +
550 isCandidate1.insert(neighbor);
│ │ │ │ +
551 }
│ │ │ │ +
552
│ │ │ │ +
553 }
│ │ │ │ +
554
│ │ │ │ +
555 }
│ │ │ │ +
556
│ │ │ │ +
557 }
│ │ │ │ +
558
│ │ │ │ +
559 // We have now found all intersections of elements in the grid1 side with currentCandidate2
│ │ │ │ +
560 // Now we add all neighbors of currentCandidate2 that have not been treated yet as new
│ │ │ │ +
561 // candidates.
│ │ │ │ +
562
│ │ │ │ +
563 // Do we have an unhandled neighbor with a seed?
│ │ │ │ +
564 bool seedFound = !candidates2.empty();
│ │ │ │ +
565 for (size_t i=0; i<elementNeighbors2_[currentCandidate2].size(); i++) {
│ │ │ │ +
566
│ │ │ │ +
567 int neighbor = elementNeighbors2_[currentCandidate2][i];
│ │ │ │ +
568
│ │ │ │ +
569 if (neighbor == -1) // do nothing at the grid boundary
│ │ │ │ +
570 continue;
│ │ │ │ +
571
│ │ │ │ +
572 // Add all unhandled intersecting neighbors to the queue
│ │ │ │ +
573 if (!isHandled2[neighbor][0] && !isCandidate2[neighbor][0] && seeds[neighbor]>-1) {
│ │ │ │ +
574
│ │ │ │ +
575 isCandidate2[neighbor][0] = true;
│ │ │ │ +
576 candidates2.push(neighbor);
│ │ │ │ +
577 seedFound = true;
│ │ │ │ +
578 }
│ │ │ │ +
579 }
│ │ │ │ +
580
│ │ │ │ +
581 if (seedFound || !m_enableFallback)
│ │ │ │ +
582 continue;
│ │ │ │ +
583
│ │ │ │ +
584 // There is no neighbor with a seed, so we need to be a bit more aggressive...
│ │ │ │ +
585 // get all neighbors of currentCandidate2, but not currentCandidate2 itself
│ │ │ │ +
586 for (size_t i=0; i<elementNeighbors2_[currentCandidate2].size(); i++) {
│ │ │ │ +
587
│ │ │ │ +
588 int neighbor = elementNeighbors2_[currentCandidate2][i];
│ │ │ │ +
589
│ │ │ │ +
590 if (neighbor == -1) // do nothing at the grid boundary
│ │ │ │ +
591 continue;
│ │ │ │ +
592
│ │ │ │ +
593 if (!isHandled2[neighbor][0] && !isCandidate2[neighbor][0]) {
│ │ │ │ +
594
│ │ │ │ +
595 // Get a seed element for the new grid2 element
│ │ │ │ +
596 // Look for an element on the grid1 side that intersects the new grid2 element.
│ │ │ │ +
597 int seed = -1;
│ │ │ │ +
598
│ │ │ │ +
599 // Look among the ones that have been tested during the last iteration.
│ │ │ │ +
600 for (typename std::set<unsigned int>::iterator seedIt = isHandled1.begin();
│ │ │ │ +
601 seedIt != isHandled1.end(); ++seedIt) {
│ │ │ │ +
602
│ │ │ │ +
603 std::bitset<(1<<grid1Dim)> neighborIntersects1;
│ │ │ │ +
604 std::bitset<(1<<grid2Dim)> neighborIntersects2;
│ │ │ │ +
605 bool intersectionFound = computeIntersection(*seedIt, neighbor,
│ │ │ │ +
606 grid1Coords, grid1_element_types, neighborIntersects1,
│ │ │ │ +
607 grid2Coords, grid2_element_types, neighborIntersects2,
│ │ │ │ +
608 false);
│ │ │ │ +
609
│ │ │ │ +
610 // if the intersection is nonempty, *seedIt is our new seed candidate on the grid1 side
│ │ │ │ +
611 if (intersectionFound) {
│ │ │ │ +
612 seed = *seedIt;
│ │ │ │ +
613 Dune::dwarn << "Algorithm entered first fallback method and found a new seed in the build algorithm." <<
│ │ │ │ +
614 "Probably, the neighborIntersects bitsets computed in computeIntersection specialization is wrong." << std::endl;
│ │ │ │ +
615 break;
│ │ │ │ +
616 }
│ │ │ │ +
617
│ │ │ │ +
618 }
│ │ │ │ +
619
│ │ │ │ +
620 if (seed < 0) {
│ │ │ │ +
621 // The fast method didn't find a grid1 element that intersects with
│ │ │ │ +
622 // the new grid2 candidate. We have to do a brute-force search.
│ │ │ │ +
623 seed = bruteForceSearch(neighbor,
│ │ │ │ +
624 grid1Coords,grid1_element_types,
│ │ │ │ +
625 grid2Coords,grid2_element_types);
│ │ │ │ +
626 Dune::dwarn << "Algorithm entered second fallback method. This probably should not happen." << std::endl;
│ │ │ │ +
627
│ │ │ │ +
628 }
│ │ │ │ +
629
│ │ │ │ +
630 // We have tried all we could: the candidate is 'handled' now
│ │ │ │ +
631 isCandidate2[neighbor] = true;
│ │ │ │ +
632
│ │ │ │ +
633 // still no seed? Then the new grid2 candidate isn't overlapped by anything
│ │ │ │ +
634 if (seed < 0)
│ │ │ │ +
635 continue;
│ │ │ │ +
636
│ │ │ │ +
637 // we have a seed now
│ │ │ │ +
638 candidates2.push(neighbor);
│ │ │ │ +
639 seeds[neighbor] = seed;
│ │ │ │ +
640 seedFound = true;
│ │ │ │ +
641
│ │ │ │ +
642 }
│ │ │ │ +
643
│ │ │ │ +
644 }
│ │ │ │ +
645
│ │ │ │ +
646 /* Do a brute-force search if there is still no seed:
│ │ │ │ +
647 * There might still be a disconnected region out there.
│ │ │ │ +
648 */
│ │ │ │ +
649 if (!seedFound && candidates2.empty()) {
│ │ │ │ +
650 generateSeed(seeds, isHandled2, candidates2, grid1Coords, grid1_element_types, grid2Coords, grid2_element_types);
│ │ │ │ +
651 }
│ │ │ │ +
652 }
│ │ │ │ +
653}
│ │ │ │ +
654
│ │ │ │ +
655template<typename T, int grid1Dim, int grid2Dim, int dimworld>
│ │ │ │ +
656void StandardMerge<T,grid1Dim,grid2Dim,dimworld>::buildBruteForce(
│ │ │ │ +
657 const std::vector<Dune::FieldVector<T,dimworld> >& grid1Coords,
│ │ │ │ +
658 const std::vector<unsigned int>& grid1_elements,
│ │ │ │ +
659 const std::vector<Dune::GeometryType>& grid1_element_types,
│ │ │ │ +
660 const std::vector<Dune::FieldVector<T,dimworld> >& grid2Coords,
│ │ │ │ +
661 const std::vector<unsigned int>& grid2_elements,
│ │ │ │ +
662 const std::vector<Dune::GeometryType>& grid2_element_types
│ │ │ │ +
663 )
│ │ │ │ +
664{
│ │ │ │ +
665 std::bitset<(1<<grid1Dim)> neighborIntersects1;
│ │ │ │ +
666 std::bitset<(1<<grid2Dim)> neighborIntersects2;
│ │ │ │ +
667
│ │ │ │ +
668 for (unsigned i = 0; i < grid1_element_types.size(); ++i) {
│ │ │ │ +
669 for (unsigned j = 0; j < grid2_element_types.size(); ++j) {
│ │ │ │ +
670 (void) computeIntersection(i, j,
│ │ │ │ +
671 grid1Coords, grid1_element_types, neighborIntersects1,
│ │ │ │ +
672 grid2Coords, grid2_element_types, neighborIntersects2);
│ │ │ │ +
673 }
│ │ │ │ +
674 }
│ │ │ │ +
675}
│ │ │ │ +
676
│ │ │ │ +
677template<typename T, int grid1Dim, int grid2Dim, int dimworld>
│ │ │ │ +
678void StandardMerge<T,grid1Dim,grid2Dim,dimworld>::generateSeed(std::vector<int>& seeds, Dune::BitSetVector<1>& isHandled2, std::stack<unsigned>& candidates2, const std::vector<Dune::FieldVector<T, dimworld> >& grid1Coords, const std::vector<Dune::GeometryType>& grid1_element_types, const std::vector<Dune::FieldVector<T, dimworld> >& grid2Coords, const std::vector<Dune::GeometryType>& grid2_element_types)
│ │ │ │ +
679{
│ │ │ │ +
680 for (std::size_t j=0; j<grid2_element_types.size(); j++) {
│ │ │ │ +
681
│ │ │ │ +
682 if (seeds[j] > 0 || isHandled2[j][0])
│ │ │ │ +
683 continue;
│ │ │ │ +
684
│ │ │ │ +
685 int seed = bruteForceSearch(j,grid1Coords,grid1_element_types,grid2Coords,grid2_element_types);
│ │ │ │ +
686
│ │ │ │ +
687 if (seed >= 0) {
│ │ │ │ +
688 candidates2.push(j); // the candidate and a seed for the candidate
│ │ │ │ +
689 seeds[j] = seed;
│ │ │ │ +
690 break;
│ │ │ │ +
691 } else // If the brute force search did not find any intersection we can skip this element
│ │ │ │ +
692 isHandled2[j] = true;
│ │ │ │ +
693 }
│ │ │ │ +
694}
│ │ │ │ +
695
│ │ │ │ +
696template<typename T, int grid1Dim, int grid2Dim, int dimworld>
│ │ │ │ +
697int StandardMerge<T,grid1Dim,grid2Dim,dimworld>::insertIntersections(unsigned int candidate1, unsigned int candidate2,
│ │ │ │ +
698 std::vector<SimplicialIntersection>& intersections)
│ │ │ │ +
699{
│ │ │ │ +
700 typedef typename std::vector<SimplicialIntersection>::size_type size_t;
│ │ │ │ +
701 int count = 0;
│ │ │ │ +
702
│ │ │ │ +
703 for (size_t i = 0; i < intersections.size(); ++i) {
│ │ │ │ +
704 // get the intersection index of the current intersection from intersections in this->intersections
│ │ │ │ +
705 bool found;
│ │ │ │ +
706 unsigned int index;
│ │ │ │ +
707 std::tie(found, index) = intersectionIndex(candidate1,candidate2,intersections[i]);
│ │ │ │ +
708
│ │ │ │ +
709 if (found && index >= this->intersections().size()) { //the intersection is not yet contained in this->intersections
│ │ │ │ +
710 this->intersections().push_back(intersections[i]); // insert
│ │ │ │ +
711
│ │ │ │ +
712 ++count;
│ │ │ │ +
713 } else if (found) {
│ │ │ │ +
714 auto& intersection = this->intersections()[index];
│ │ │ │ +
715
│ │ │ │ +
716 // insert each grid1 element and local representation of intersections[i] with parent candidate1
│ │ │ │ +
717 for (size_t j = 0; j < intersections[i].parents0.size(); ++j) {
│ │ │ │ +
718 intersection.parents0.push_back(candidate1);
│ │ │ │ +
719 intersection.corners0.push_back(intersections[i].corners0[j]);
│ │ │ │ +
720 }
│ │ │ │ +
721
│ │ │ │ +
722 // insert each grid2 element and local representation of intersections[i] with parent candidate2
│ │ │ │ +
723 for (size_t j = 0; j < intersections[i].parents1.size(); ++j) {
│ │ │ │ +
724 intersection.parents1.push_back(candidate2);
│ │ │ │ +
725 intersection.corners1.push_back(intersections[i].corners1[j]);
│ │ │ │ +
726 }
│ │ │ │ +
727
│ │ │ │ +
728 ++count;
│ │ │ │ +
729 } else {
│ │ │ │ +
730 Dune::dwarn << "Computed the same intersection twice!" << std::endl;
│ │ │ │ +
731 }
│ │ │ │ +
732 }
│ │ │ │ +
733 return count;
│ │ │ │ +
734}
│ │ │ │ +
735
│ │ │ │ +
736template<typename T, int grid1Dim, int grid2Dim, int dimworld>
│ │ │ │ +
737std::pair<bool, unsigned int>
│ │ │ │ +
738StandardMerge<T,grid1Dim,grid2Dim,dimworld>::intersectionIndex(unsigned int grid1Index, unsigned int grid2Index,
│ │ │ │ +
739 SimplicialIntersection& intersection) {
│ │ │ │ +
740
│ │ │ │ +
741
│ │ │ │ +
742 // return index in intersections_ if at least one local representation of a Simplicial Intersection (SI)
│ │ │ │ +
743 // of intersections_ is equal to the local representation of one element in intersections
│ │ │ │ +
744
│ │ │ │ +
745 std::size_t n_intersections = this->intersections().size();
│ │ │ │ +
746 if (grid1Dim == grid2Dim)
│ │ │ │ +
747 return {true, n_intersections};
│ │ │ │ +
748
│ │ │ │ +
749 T eps = 1e-10;
│ │ │ │ +
750
│ │ │ │ +
751 for (std::size_t i = 0; i < n_intersections; ++i) {
│ │ │ │ +
752
│ │ │ │ +
753 // compare the local representation of the subelements of the SI
│ │ │ │ +
754 for (std::size_t ei = 0; ei < this->intersections()[i].parents0.size(); ++ei) // merger subelement
│ │ │ │ +
755 {
│ │ │ │ +
756 if (this->intersections()[i].parents0[ei] == grid1Index)
│ │ │ │ +
757 {
│ │ │ │ +
758 for (std::size_t er = 0; er < intersection.parents0.size(); ++er) // list subelement
│ │ │ │ +
759 {
│ │ │ │ +
760 bool found_all = true;
│ │ │ │ +
761 // compare the local coordinate representations
│ │ │ │ +
762 for (std::size_t ci = 0; ci < this->intersections()[i].corners0[ei].size(); ++ci)
│ │ │ │ +
763 {
│ │ │ │ +
764 Dune::FieldVector<T,grid1Dim> ni = this->intersections()[i].corners0[ei][ci];
│ │ │ │ +
765 bool found_ni = false;
│ │ │ │ +
766 for (std::size_t cr = 0; cr < intersection.corners0[er].size(); ++cr)
│ │ │ │ +
767 {
│ │ │ │ +
768 Dune::FieldVector<T,grid1Dim> nr = intersection.corners0[er][cr];
│ │ │ │ +
769
│ │ │ │ +
770 found_ni = found_ni || ((ni-nr).infinity_norm() < eps);
│ │ │ │ +
771 if (found_ni)
│ │ │ │ +
772 break;
│ │ │ │ +
773 }
│ │ │ │ +
774 found_all = found_all && found_ni;
│ │ │ │ +
775
│ │ │ │ +
776 if (!found_ni)
│ │ │ │ +
777 break;
│ │ │ │ +
778 }
│ │ │ │ +
779
│ │ │ │ +
780 if (found_all && (this->intersections()[i].parents1[ei] != grid2Index))
│ │ │ │ +
781 return {true, i};
│ │ │ │ +
782 else if (found_all)
│ │ │ │ +
783 return {false, 0};
│ │ │ │ +
784 }
│ │ │ │ +
785 }
│ │ │ │ +
786 }
│ │ │ │ +
787
│ │ │ │ +
788 // compare the local representation of the subelements of the SI
│ │ │ │ +
789 for (std::size_t ei = 0; ei < this->intersections()[i].parents1.size(); ++ei) // merger subelement
│ │ │ │ +
790 {
│ │ │ │ +
791 if (this->intersections()[i].parents1[ei] == grid2Index)
│ │ │ │ +
792 {
│ │ │ │ +
793 for (std::size_t er = 0; er < intersection.parents1.size(); ++er) // list subelement
│ │ │ │ +
794 {
│ │ │ │ +
795 bool found_all = true;
│ │ │ │ +
796 // compare the local coordinate representations
│ │ │ │ +
797 for (std::size_t ci = 0; ci < this->intersections()[i].corners1[ei].size(); ++ci)
│ │ │ │ +
798 {
│ │ │ │ +
799 Dune::FieldVector<T,grid2Dim> ni = this->intersections()[i].corners1[ei][ci];
│ │ │ │ +
800 bool found_ni = false;
│ │ │ │ +
801 for (std::size_t cr = 0; cr < intersection.corners1[er].size(); ++cr)
│ │ │ │ +
802 {
│ │ │ │ +
803 Dune::FieldVector<T,grid2Dim> nr = intersection.corners1[er][cr];
│ │ │ │ +
804 found_ni = found_ni || ((ni-nr).infinity_norm() < eps);
│ │ │ │ +
805
│ │ │ │ +
806 if (found_ni)
│ │ │ │ +
807 break;
│ │ │ │ +
808 }
│ │ │ │ +
809 found_all = found_all && found_ni;
│ │ │ │ +
810
│ │ │ │ +
811 if (!found_ni)
│ │ │ │ +
812 break;
│ │ │ │ +
813 }
│ │ │ │ +
814
│ │ │ │ +
815 if (found_all && (this->intersections()[i].parents0[ei] != grid1Index))
│ │ │ │ +
816 return {true, i};
│ │ │ │ +
817 else if (found_all)
│ │ │ │ +
818 return {false, 0};
│ │ │ │ +
819 }
│ │ │ │ +
820 }
│ │ │ │ +
821 }
│ │ │ │ +
822 }
│ │ │ │ +
823
│ │ │ │ +
824 return {true, n_intersections};
│ │ │ │ +
825}
│ │ │ │ +
826
│ │ │ │ +
827#define DECL extern
│ │ │ │ +
828#define STANDARD_MERGE_INSTANTIATE(T,A,B,C) \
│ │ │ │ +
829 DECL template \
│ │ │ │ +
830 void StandardMerge<T,A,B,C>::build(const std::vector<Dune::FieldVector<T,C> >& grid1Coords, \
│ │ │ │ +
831 const std::vector<unsigned int>& grid1_elements, \
│ │ │ │ +
832 const std::vector<Dune::GeometryType>& grid1_element_types, \
│ │ │ │ +
833 const std::vector<Dune::FieldVector<T,C> >& grid2Coords, \
│ │ │ │ +
834 const std::vector<unsigned int>& grid2_elements, \
│ │ │ │ +
835 const std::vector<Dune::GeometryType>& grid2_element_types \
│ │ │ │ +
836 )
│ │ │ │ +
837
│ │ │ │ +
838STANDARD_MERGE_INSTANTIATE(double,1,1,1);
│ │ │ │ +
839STANDARD_MERGE_INSTANTIATE(double,2,2,2);
│ │ │ │ +
840STANDARD_MERGE_INSTANTIATE(double,3,3,3);
│ │ │ │ +
841#undef STANDARD_MERGE_INSTANTIATE
│ │ │ │ +
842#undef DECL
│ │ │ │ +
843
│ │ │ │ +
844} /* namespace GridGlue */
│ │ │ │ +
845} /* namespace Dune */
│ │ │ │ +
846
│ │ │ │ +
847#endif // DUNE_GRIDGLUE_MERGING_STANDARDMERGE_HH
│ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │
Definition: gridglue.hh:37
│ │ │ │ +
STANDARD_MERGE_INSTANTIATE(double, 1, 1, 1)
│ │ │ │
IteratorRange<... > intersections(const GridGlue<... > &glue, const Reverse<... > &reverse=!reversed)
Iterate over all intersections of a GridGlue.
│ │ │ │ -
Implementation of the Merger concept for conforming interfaces.
Definition: conformingmerge.hh:49
│ │ │ │ -
Dune::FieldVector< T, dim > LocalCoords
the coordinate type used in this interface
Definition: conformingmerge.hh:62
│ │ │ │ -
Dune::FieldVector< T, dimworld > WorldCoords
the coordinate type used in this interface
Definition: conformingmerge.hh:59
│ │ │ │ -
static constexpr T default_tolerance
Definition: conformingmerge.hh:89
│ │ │ │ -
T ctype
the numeric type used in this interface
Definition: conformingmerge.hh:56
│ │ │ │ -
ConformingMerge(T tolerance=default_tolerance)
Definition: conformingmerge.hh:91
│ │ │ │ +
Definition: intersectionlist.hh:207
│ │ │ │ + │ │ │ │ +
Abstract base for all classes that take extracted grids and build sets of intersections.
Definition: merger.hh:27
│ │ │ │ +
Dune::FieldVector< T, dimworld > WorldCoords
the coordinate type used in this interface
Definition: merger.hh:37
│ │ │ │ +
Dune::GridGlue::IntersectionList< Grid1Coords, Grid2Coords > IntersectionList
Definition: merger.hh:39
│ │ │ │ +
Dune::FieldVector< T, grid1Dim > Grid1Coords
the local coordinate type for the grid1 coordinates
Definition: merger.hh:31
│ │ │ │ +
Dune::FieldVector< T, grid2Dim > Grid2Coords
the local coordinate type for the grid2 coordinates
Definition: merger.hh:34
│ │ │ │
Common base class for many merger implementations: produce pairs of entities that may intersect.
Definition: standardmerge.hh:58
│ │ │ │ +
virtual void computeIntersections(const Dune::GeometryType &grid1ElementType, const std::vector< Dune::FieldVector< T, dimworld > > &grid1ElementCorners, std::bitset<(1<< grid1Dim)> &neighborIntersects1, unsigned int grid1Index, const Dune::GeometryType &grid2ElementType, const std::vector< Dune::FieldVector< T, dimworld > > &grid2ElementCorners, std::bitset<(1<< grid2Dim)> &neighborIntersects2, unsigned int grid2Index, std::vector< SimplicialIntersection > &intersections)=0
Compute the intersection between two overlapping elements.
│ │ │ │ +
std::shared_ptr< IntersectionList > intersectionList_
Definition: standardmerge.hh:124
│ │ │ │ +
typename Base::Grid1Coords Grid1Coords
Type used for local coordinates on the grid1 side.
Definition: standardmerge.hh:69
│ │ │ │ +
void enableFallback(bool fallback)
Definition: standardmerge.hh:166
│ │ │ │ +
std::vector< std::vector< int > > elementNeighbors2_
Definition: standardmerge.hh:131
│ │ │ │ +
std::vector< std::vector< int > > elementNeighbors1_
Definition: standardmerge.hh:130
│ │ │ │ +
T ctype
the numeric type used in this interface
Definition: standardmerge.hh:66
│ │ │ │ +
void clear() override
Definition: standardmerge.hh:150
│ │ │ │ +
typename Base::IntersectionList IntersectionList
Definition: standardmerge.hh:77
│ │ │ │ +
bool computeIntersection(unsigned int candidate0, unsigned int candidate1, const std::vector< Dune::FieldVector< T, dimworld > > &grid1Coords, const std::vector< Dune::GeometryType > &grid1_element_types, std::bitset<(1<< grid1Dim)> &neighborIntersects1, const std::vector< Dune::FieldVector< T, dimworld > > &grid2Coords, const std::vector< Dune::GeometryType > &grid2_element_types, std::bitset<(1<< grid2Dim)> &neighborIntersects2, bool insert=true)
Compute the intersection between two overlapping elements.
Definition: standardmerge.hh:263
│ │ │ │ +
void enableBruteForce(bool bruteForce)
Definition: standardmerge.hh:171
│ │ │ │ +
std::shared_ptr< IntersectionListProvider > intersectionListProvider_
Definition: standardmerge.hh:123
│ │ │ │ +
void build(const std::vector< Dune::FieldVector< T, dimworld > > &grid1_Coords, const std::vector< unsigned int > &grid1_elements, const std::vector< Dune::GeometryType > &grid1_element_types, const std::vector< Dune::FieldVector< T, dimworld > > &grid2_coords, const std::vector< unsigned int > &grid2_elements, const std::vector< Dune::GeometryType > &grid2_element_types) override
builds the merged grid
Definition: standardmerge.hh:392
│ │ │ │ +
std::vector< std::vector< unsigned int > > grid1ElementCorners_
Temporary internal data.
Definition: standardmerge.hh:127
│ │ │ │ +
std::vector< std::vector< unsigned int > > grid2ElementCorners_
Definition: standardmerge.hh:128
│ │ │ │ +
typename Base::Grid2Coords Grid2Coords
Type used for local coordinates on the grid2 side.
Definition: standardmerge.hh:72
│ │ │ │ +
std::shared_ptr< IntersectionList > intersectionList() const final
Definition: standardmerge.hh:160
│ │ │ │ +
virtual ~StandardMerge()=default
│ │ │ │ +
SimplicialIntersection RemoteSimplicialIntersection
Definition: standardmerge.hh:84
│ │ │ │ +
bool valid
Definition: standardmerge.hh:86
│ │ │ │ +
StandardMerge()
Definition: standardmerge.hh:88
│ │ │ │
typename IntersectionListProvider::SimplicialIntersection SimplicialIntersection
Definition: standardmerge.hh:83
│ │ │ │ +
typename Base::WorldCoords WorldCoords
the coordinate type used in this interface
Definition: standardmerge.hh:75
│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,254 +5,994 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * merging │ │ │ │ │ -conformingmerge.hh │ │ │ │ │ +standardmerge.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 © DUNE Project contributors, see file │ │ │ │ │ LICENSE.md in module root │ │ │ │ │ 4// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only- │ │ │ │ │ with-dune-grid-glue-exception │ │ │ │ │ - 5/* │ │ │ │ │ - 6 * Filename: conformingmerge.hh │ │ │ │ │ - 7 * Version: 1.0 │ │ │ │ │ - 8 * Created on: Sep 14, 2009 │ │ │ │ │ - 9 * Author: Oliver Sander │ │ │ │ │ - 10 * --------------------------------- │ │ │ │ │ - 11 * Project: dune-grid-glue │ │ │ │ │ - 12 * Description: implementation of the Merger concept for conforming │ │ │ │ │ -interfaces │ │ │ │ │ - 13 * │ │ │ │ │ - 14 */ │ │ │ │ │ - 21#ifndef DUNE_GRIDGLUE_MERGING_CONFORMINGMERGE_HH │ │ │ │ │ - 22#define DUNE_GRIDGLUE_MERGING_CONFORMINGMERGE_HH │ │ │ │ │ + 10#ifndef DUNE_GRIDGLUE_MERGING_STANDARDMERGE_HH │ │ │ │ │ + 11#define DUNE_GRIDGLUE_MERGING_STANDARDMERGE_HH │ │ │ │ │ + 12 │ │ │ │ │ + 13 │ │ │ │ │ + 14#include │ │ │ │ │ + 15#include │ │ │ │ │ + 16#include │ │ │ │ │ + 17#include │ │ │ │ │ + 18#include │ │ │ │ │ + 19#include │ │ │ │ │ + 20#include │ │ │ │ │ + 21#include │ │ │ │ │ + 22#include │ │ │ │ │ 23 │ │ │ │ │ - 24#include │ │ │ │ │ - 25#include │ │ │ │ │ - 26#include │ │ │ │ │ - 27#include │ │ │ │ │ + 24#include │ │ │ │ │ + 25#include │ │ │ │ │ + 26#include │ │ │ │ │ + 27#include │ │ │ │ │ 28 │ │ │ │ │ - 29#include │ │ │ │ │ - 30#include │ │ │ │ │ + 29#include │ │ │ │ │ + 30#include │ │ │ │ │ 31 │ │ │ │ │ - 32#include │ │ │ │ │ - 33 │ │ │ │ │ - 34#include │ │ │ │ │ + 32#include │ │ │ │ │ + 33#include │ │ │ │ │ + 34#include │ │ │ │ │ 35 │ │ │ │ │ 36namespace Dune { │ │ │ │ │ - 37 │ │ │ │ │ - 38 namespace GridGlue { │ │ │ │ │ - 39 │ │ │ │ │ - 46template │ │ │ │ │ -47class ConformingMerge │ │ │ │ │ - 48 : public StandardMerge │ │ │ │ │ - 49{ │ │ │ │ │ - 50 │ │ │ │ │ - 51public: │ │ │ │ │ - 52 │ │ │ │ │ - 53 /* E X P O R T E D T Y P E S A N D C O N S T A N T S */ │ │ │ │ │ - 54 │ │ │ │ │ -56 typedef T ctype; │ │ │ │ │ - 57 │ │ │ │ │ -59 typedef Dune::FieldVector WorldCoords; │ │ │ │ │ + 37namespace GridGlue { │ │ │ │ │ + 38 │ │ │ │ │ + 55template │ │ │ │ │ +56class StandardMerge │ │ │ │ │ + 57 : public Merger │ │ │ │ │ + 58{ │ │ │ │ │ + 59 using Base = Merger; │ │ │ │ │ 60 │ │ │ │ │ -62 typedef Dune::FieldVector LocalCoords; │ │ │ │ │ - 63 │ │ │ │ │ - 64private: │ │ │ │ │ - 65 │ │ │ │ │ - 66 /* M E M B E R V A R I A B L E S */ │ │ │ │ │ + 61public: │ │ │ │ │ + 62 │ │ │ │ │ + 63 /* E X P O R T E D T Y P E S A N D C O N S T A N T S */ │ │ │ │ │ + 64 │ │ │ │ │ +66 typedef T ctype; │ │ │ │ │ 67 │ │ │ │ │ - 69 T tolerance_; │ │ │ │ │ +69 using Grid1Coords = typename Base::Grid1Coords; │ │ │ │ │ 70 │ │ │ │ │ - 71 typedef typename StandardMerge::SimplicialIntersection │ │ │ │ │ +72 using Grid2Coords = typename Base::Grid2Coords; │ │ │ │ │ + 73 │ │ │ │ │ +75 using WorldCoords = typename Base::WorldCoords; │ │ │ │ │ + 76 │ │ │ │ │ +77 using IntersectionList = typename Base::IntersectionList; │ │ │ │ │ + 78 │ │ │ │ │ + 79protected: │ │ │ │ │ + 80 │ │ │ │ │ +82 using IntersectionListProvider = │ │ │ │ │ +SimplicialIntersectionListProvider; │ │ │ │ │ +83 using SimplicialIntersection = typename IntersectionListProvider:: │ │ │ │ │ SimplicialIntersection; │ │ │ │ │ - 72 │ │ │ │ │ - 77 void computeIntersections(const Dune::GeometryType& grid1ElementType, │ │ │ │ │ - 78 const std::vector >& grid1ElementCorners, │ │ │ │ │ - 79 std::bitset<(1<& neighborIntersects1, │ │ │ │ │ - 80 unsigned int grid1Index, │ │ │ │ │ - 81 const Dune::GeometryType& grid2ElementType, │ │ │ │ │ - 82 const std::vector >& grid2ElementCorners, │ │ │ │ │ - 83 std::bitset<(1<& neighborIntersects2, │ │ │ │ │ - 84 unsigned int grid2Index, │ │ │ │ │ - 85 std::vector& intersections); │ │ │ │ │ - 86 │ │ │ │ │ - 87public: │ │ │ │ │ - 88 │ │ │ │ │ -89 static constexpr T default_tolerance = 1e-4; │ │ │ │ │ - 90 │ │ │ │ │ -91 ConformingMerge(T tolerance = default_tolerance) : │ │ │ │ │ - 92 tolerance_(tolerance) │ │ │ │ │ - 93 {} │ │ │ │ │ - 94}; │ │ │ │ │ - 95 │ │ │ │ │ - 96template │ │ │ │ │ - 97constexpr T ConformingMerge::default_tolerance; │ │ │ │ │ - 98 │ │ │ │ │ - 99template │ │ │ │ │ - 100void ConformingMerge::computeIntersections(const Dune:: │ │ │ │ │ -GeometryType& grid1ElementType, │ │ │ │ │ - 101 const std::vector >& grid1ElementCorners, │ │ │ │ │ - 102 std::bitset<(1<& neighborIntersects1, │ │ │ │ │ - 103 unsigned int grid1Index, │ │ │ │ │ - 104 const Dune::GeometryType& grid2ElementType, │ │ │ │ │ - 105 const std::vector >& grid2ElementCorners, │ │ │ │ │ - 106 std::bitset<(1<& neighborIntersects2, │ │ │ │ │ - 107 unsigned int grid2Index, │ │ │ │ │ - 108 std::vector& intersections) │ │ │ │ │ - 109{ │ │ │ │ │ - 110 this->counter++; │ │ │ │ │ - 111 │ │ │ │ │ - 112 // A few consistency checks │ │ │ │ │ - 113 assert((unsigned int)(Dune::ReferenceElements::general │ │ │ │ │ -(grid1ElementType).size(dim)) == grid1ElementCorners.size()); │ │ │ │ │ - 114 assert((unsigned int)(Dune::ReferenceElements::general │ │ │ │ │ -(grid2ElementType).size(dim)) == grid2ElementCorners.size()); │ │ │ │ │ - 115 // any intersection we may find will be the entire elements. │ │ │ │ │ - 116 neighborIntersects1.reset(); │ │ │ │ │ - 117 neighborIntersects2.reset(); │ │ │ │ │ - 118 │ │ │ │ │ - 119 // the intersection is either conforming or empty, hence the GeometryTypes │ │ │ │ │ -have to match │ │ │ │ │ - 120 if (grid1ElementType != grid2ElementType) │ │ │ │ │ - 121 return; │ │ │ │ │ +84 using RemoteSimplicialIntersection = SimplicialIntersection; │ │ │ │ │ + 85 │ │ │ │ │ +86 bool valid = false; │ │ │ │ │ + 87 │ │ │ │ │ +88 StandardMerge() │ │ │ │ │ + 89 : intersectionListProvider_(std::make_shared()) │ │ │ │ │ + 90 , intersectionList_(std::make_shared │ │ │ │ │ +(intersectionListProvider_)) │ │ │ │ │ + 91 {} │ │ │ │ │ + 92 │ │ │ │ │ +93 virtual ~StandardMerge() = default; │ │ │ │ │ + 94 │ │ │ │ │ +99 virtual void computeIntersections(const Dune::GeometryType& │ │ │ │ │ +grid1ElementType, │ │ │ │ │ + 100 const std::vector >& grid1ElementCorners, │ │ │ │ │ + 101 std::bitset<(1<& neighborIntersects1, │ │ │ │ │ + 102 unsigned int grid1Index, │ │ │ │ │ + 103 const Dune::GeometryType& grid2ElementType, │ │ │ │ │ + 104 const std::vector >& grid2ElementCorners, │ │ │ │ │ + 105 std::bitset<(1<& neighborIntersects2, │ │ │ │ │ + 106 unsigned int grid2Index, │ │ │ │ │ + 107 std::vector& intersections) = 0; │ │ │ │ │ + 108 │ │ │ │ │ +112 bool computeIntersection(unsigned int candidate0, unsigned int candidate1, │ │ │ │ │ + 113 const std::vector >& grid1Coords, │ │ │ │ │ + 114 const std::vector& grid1_element_types, │ │ │ │ │ + 115 std::bitset<(1<& neighborIntersects1, │ │ │ │ │ + 116 const std::vector >& grid2Coords, │ │ │ │ │ + 117 const std::vector& grid2_element_types, │ │ │ │ │ + 118 std::bitset<(1<& neighborIntersects2, │ │ │ │ │ + 119 bool insert = true); │ │ │ │ │ + 120 │ │ │ │ │ + 121 /* M E M B E R V A R I A B L E S */ │ │ │ │ │ 122 │ │ │ │ │ - 123 // //////////////////////////////////////////////////////////// │ │ │ │ │ - 124 // Find correspondences between the different corners │ │ │ │ │ - 125 // //////////////////////////////////////////////////////////// │ │ │ │ │ - 126 std::vector other(grid1ElementCorners.size(), -1); │ │ │ │ │ - 127 │ │ │ │ │ - 128 for (unsigned int i=0; i intersectionListProvider_; │ │ │ │ │ +124 std::shared_ptr intersectionList_; │ │ │ │ │ + 125 │ │ │ │ │ +127 std::vector > grid1ElementCorners_; │ │ │ │ │ +128 std::vector > grid2ElementCorners_; │ │ │ │ │ 129 │ │ │ │ │ - 130 for (unsigned int j=0; j > elementNeighbors1_; │ │ │ │ │ +131 std::vector > elementNeighbors2_; │ │ │ │ │ + 132 │ │ │ │ │ + 133public: │ │ │ │ │ + 134 │ │ │ │ │ + 135 /* C O N C E P T I M P L E M E N T I N G I N T E R F A C E */ │ │ │ │ │ 136 │ │ │ │ │ - 137 } │ │ │ │ │ - 138 │ │ │ │ │ - 139 } │ │ │ │ │ - 140 │ │ │ │ │ - 141 // No corresponding grid2 vertex found for this grid1 vertex │ │ │ │ │ - 142 if (other[i] == -1) │ │ │ │ │ - 143 return; │ │ │ │ │ - 144 │ │ │ │ │ - 145 } │ │ │ │ │ +140 void build(const std::vector >& grid1_Coords, │ │ │ │ │ + 141 const std::vector& grid1_elements, │ │ │ │ │ + 142 const std::vector& grid1_element_types, │ │ │ │ │ + 143 const std::vector >& grid2_coords, │ │ │ │ │ + 144 const std::vector& grid2_elements, │ │ │ │ │ + 145 const std::vector& grid2_element_types) override; │ │ │ │ │ 146 │ │ │ │ │ - 147 // //////////////////////////////////////////////////////////// │ │ │ │ │ - 148 // Set up the new remote intersection │ │ │ │ │ - 149 // //////////////////////////////////////////////////////////// │ │ │ │ │ - 150 │ │ │ │ │ - 151 const auto& refElement = Dune::ReferenceElements::general │ │ │ │ │ -(grid1ElementType); │ │ │ │ │ - 152 │ │ │ │ │ - 154 if (grid1ElementType.isSimplex()) { │ │ │ │ │ - 155 │ │ │ │ │ - 156 intersections.emplace_back(grid1Index, grid2Index); │ │ │ │ │ - 157 │ │ │ │ │ - 158 for (int i=0; iclear(); │ │ │ │ │ + 154 purge(grid1ElementCorners_); │ │ │ │ │ + 155 purge(grid2ElementCorners_); │ │ │ │ │ + 156 │ │ │ │ │ + 157 valid = false; │ │ │ │ │ + 158 } │ │ │ │ │ + 159 │ │ │ │ │ +160 std::shared_ptr intersectionList() const final │ │ │ │ │ + 161 { │ │ │ │ │ + 162 assert(valid); │ │ │ │ │ + 163 return intersectionList_; │ │ │ │ │ + 164 } │ │ │ │ │ + 165 │ │ │ │ │ +166 void enableFallback(bool fallback) │ │ │ │ │ + 167 { │ │ │ │ │ + 168 m_enableFallback = fallback; │ │ │ │ │ + 169 } │ │ │ │ │ + 170 │ │ │ │ │ +171 void enableBruteForce(bool bruteForce) │ │ │ │ │ + 172 { │ │ │ │ │ + 173 m_enableBruteForce = bruteForce; │ │ │ │ │ + 174 } │ │ │ │ │ + 175 │ │ │ │ │ + 176private: │ │ │ │ │ + 180 bool m_enableFallback = false; │ │ │ │ │ + 181 │ │ │ │ │ + 185 bool m_enableBruteForce = false; │ │ │ │ │ 186 │ │ │ │ │ - 187 for (int i=0; i<5; i++) { │ │ │ │ │ - 188 │ │ │ │ │ - 189 SimplicialIntersection newSimplicialIntersection(grid1Index, grid2Index); │ │ │ │ │ - 190 │ │ │ │ │ - 191 for (int j=0; jintersections(); } │ │ │ │ │ + 189 │ │ │ │ │ + 191 template │ │ │ │ │ + 192 static void purge(V & v) │ │ │ │ │ + 193 { │ │ │ │ │ + 194 v.clear(); │ │ │ │ │ + 195 V v2(v); │ │ │ │ │ + 196 v.swap(v2); │ │ │ │ │ + 197 } │ │ │ │ │ + 198 │ │ │ │ │ + 203 void generateSeed(std::vector& seeds, │ │ │ │ │ + 204 Dune::BitSetVector<1>& isHandled2, │ │ │ │ │ + 205 std::stack& candidates2, │ │ │ │ │ + 206 const std::vector >& grid1Coords, │ │ │ │ │ + 207 const std::vector& grid1_element_types, │ │ │ │ │ + 208 const std::vector >& grid2Coords, │ │ │ │ │ + 209 const std::vector& grid2_element_types); │ │ │ │ │ + 210 │ │ │ │ │ + 214 int insertIntersections(unsigned int candidate1, unsigned int │ │ │ │ │ +candidate2,std::vector& intersections); │ │ │ │ │ + 215 │ │ │ │ │ + 219 int bruteForceSearch(int candidate1, │ │ │ │ │ + 220 const std::vector >& grid1Coords, │ │ │ │ │ + 221 const std::vector& grid1_element_types, │ │ │ │ │ + 222 const std::vector >& grid2Coords, │ │ │ │ │ + 223 const std::vector& grid2_element_types); │ │ │ │ │ + 224 │ │ │ │ │ + 228 std::pair │ │ │ │ │ + 229 intersectionIndex(unsigned int grid1Index, unsigned int grid2Index, │ │ │ │ │ + 230 SimplicialIntersection& intersection); │ │ │ │ │ + 231 │ │ │ │ │ + 235 template │ │ │ │ │ + 236 void computeNeighborsPerElement(const std::vector& │ │ │ │ │ +gridElementTypes, │ │ │ │ │ + 237 const std::vector >& gridElementCorners, │ │ │ │ │ + 238 std::vector >& elementNeighbors); │ │ │ │ │ + 239 │ │ │ │ │ + 240 void buildAdvancingFront( │ │ │ │ │ + 241 const std::vector >& grid1_Coords, │ │ │ │ │ + 242 const std::vector& grid1_elements, │ │ │ │ │ + 243 const std::vector& grid1_element_types, │ │ │ │ │ + 244 const std::vector >& grid2_coords, │ │ │ │ │ + 245 const std::vector& grid2_elements, │ │ │ │ │ + 246 const std::vector& grid2_element_types │ │ │ │ │ + 247 ); │ │ │ │ │ + 248 │ │ │ │ │ + 249 void buildBruteForce( │ │ │ │ │ + 250 const std::vector >& grid1_Coords, │ │ │ │ │ + 251 const std::vector& grid1_elements, │ │ │ │ │ + 252 const std::vector& grid1_element_types, │ │ │ │ │ + 253 const std::vector >& grid2_coords, │ │ │ │ │ + 254 const std::vector& grid2_elements, │ │ │ │ │ + 255 const std::vector& grid2_element_types │ │ │ │ │ + 256 ); │ │ │ │ │ + 257}; │ │ │ │ │ + 258 │ │ │ │ │ + 259 │ │ │ │ │ + 260/* IMPLEMENTATION */ │ │ │ │ │ + 261 │ │ │ │ │ + 262template │ │ │ │ │ +263bool StandardMerge::computeIntersection │ │ │ │ │ +(unsigned int candidate0, unsigned int candidate1, │ │ │ │ │ + 264 const std::vector >& grid1Coords, │ │ │ │ │ + 265 const std::vector& grid1_element_types, │ │ │ │ │ + 266 std::bitset<(1<& neighborIntersects1, │ │ │ │ │ + 267 const std::vector >& grid2Coords, │ │ │ │ │ + 268 const std::vector& grid2_element_types, │ │ │ │ │ + 269 std::bitset<(1<& neighborIntersects2, │ │ │ │ │ + 270 bool insert) │ │ │ │ │ + 271{ │ │ │ │ │ + 272 // Select vertices of the grid1 element │ │ │ │ │ + 273 int grid1NumVertices = grid1ElementCorners_[candidate0].size(); │ │ │ │ │ + 274 std::vector > grid1ElementCorners │ │ │ │ │ +(grid1NumVertices); │ │ │ │ │ + 275 for (int i=0; i > grid2ElementCorners │ │ │ │ │ +(grid2NumVertices); │ │ │ │ │ + 281 for (int i=0; i intersections(0); │ │ │ │ │ + 289 │ │ │ │ │ + 290 // compute the intersections │ │ │ │ │ + 291 computeIntersections(grid1_element_types[candidate0], grid1ElementCorners, │ │ │ │ │ + 292 neighborIntersects1, candidate0, │ │ │ │ │ + 293 grid2_element_types[candidate1], grid2ElementCorners, │ │ │ │ │ + 294 neighborIntersects2, candidate1, │ │ │ │ │ + 295 intersections); │ │ │ │ │ + 296 │ │ │ │ │ + 297 // insert intersections if needed │ │ │ │ │ + 298 if(insert && !intersections.empty()) │ │ │ │ │ + 299 insertIntersections(candidate0,candidate1,intersections); │ │ │ │ │ + 300 │ │ │ │ │ + 301 // Have we found an intersection? │ │ │ │ │ + 302 return !intersections.empty() || neighborIntersects1.any() || │ │ │ │ │ +neighborIntersects2.any(); │ │ │ │ │ + 303 │ │ │ │ │ + 304} │ │ │ │ │ + 305 │ │ │ │ │ + 306template │ │ │ │ │ + 307int StandardMerge::bruteForceSearch(int │ │ │ │ │ +candidate1, │ │ │ │ │ + 308 const std::vector >& grid1Coords, │ │ │ │ │ + 309 const std::vector& grid1_element_types, │ │ │ │ │ + 310 const std::vector >& grid2Coords, │ │ │ │ │ + 311 const std::vector& grid2_element_types) │ │ │ │ │ + 312{ │ │ │ │ │ + 313 std::bitset<(1< neighborIntersects1; │ │ │ │ │ + 314 std::bitset<(1< neighborIntersects2; │ │ │ │ │ + 315 for (std::size_t i=0; i │ │ │ │ │ + 333template │ │ │ │ │ + 334void StandardMerge:: │ │ │ │ │ + 335computeNeighborsPerElement(const std::vector& │ │ │ │ │ +gridElementTypes, │ │ │ │ │ + 336 const std::vector >& gridElementCorners, │ │ │ │ │ + 337 std::vector >& elementNeighbors) │ │ │ │ │ + 338{ │ │ │ │ │ + 339 typedef std::vector FaceType; │ │ │ │ │ + 340 typedef std::map > │ │ │ │ │ +FaceSetType; │ │ │ │ │ + 341 │ │ │ │ │ + 343 // First: grid 1 │ │ │ │ │ + 345 FaceSetType faces; │ │ │ │ │ + 346 elementNeighbors.resize(gridElementTypes.size()); │ │ │ │ │ + 347 │ │ │ │ │ + 348 for (size_t i=0; i::general │ │ │ │ │ +(gridElementTypes[i]).size(1), -1); │ │ │ │ │ + 350 │ │ │ │ │ + 351 for (size_t i=0; i::general │ │ │ │ │ +(gridElementTypes[i]); │ │ │ │ │ + 353 │ │ │ │ │ + 354 for (size_t j=0; j<(size_t)refElement.size(1); j++) { // iterate over all │ │ │ │ │ +faces of the element │ │ │ │ │ + 355 │ │ │ │ │ + 356 FaceType face; │ │ │ │ │ + 357 // extract element face │ │ │ │ │ + 358 for (size_t k=0; k<(size_t)refElement.size(j,1,gridDim); k++) │ │ │ │ │ + 359 face.push_back(gridElementCorners[i][refElement.subEntity │ │ │ │ │ +(j,1,k,gridDim)]); │ │ │ │ │ + 360 │ │ │ │ │ + 361 // sort the face vertices to get rid of twists and other permutations │ │ │ │ │ + 362 std::sort(face.begin(), face.end()); │ │ │ │ │ + 363 │ │ │ │ │ + 364 typename FaceSetType::iterator faceHandle = faces.find(face); │ │ │ │ │ + 365 │ │ │ │ │ + 366 if (faceHandle == faces.end()) { │ │ │ │ │ + 367 │ │ │ │ │ + 368 // face has not been visited before │ │ │ │ │ + 369 faces.insert(std::make_pair(face, std::make_pair(i,j))); │ │ │ │ │ + 370 │ │ │ │ │ + 371 } else { │ │ │ │ │ + 372 │ │ │ │ │ + 373 // face has been visited before: store the mutual neighbor information │ │ │ │ │ + 374 elementNeighbors[i][j] = faceHandle->second.first; │ │ │ │ │ + 375 elementNeighbors[faceHandle->second.first][faceHandle->second.second] = i; │ │ │ │ │ + 376 │ │ │ │ │ + 377 faces.erase(faceHandle); │ │ │ │ │ + 378 │ │ │ │ │ + 379 } │ │ │ │ │ + 380 │ │ │ │ │ + 381 } │ │ │ │ │ + 382 │ │ │ │ │ + 383 } │ │ │ │ │ + 384} │ │ │ │ │ + 385 │ │ │ │ │ + 386// ///////////////////////////////////////////////////////////////////// │ │ │ │ │ + 387// Compute the intersection of all pairs of elements │ │ │ │ │ + 388// Linear algorithm by Gander and Japhet, Proc. of DD18 │ │ │ │ │ + 389// ///////////////////////////////////////////////////////////////////// │ │ │ │ │ + 390 │ │ │ │ │ + 391template │ │ │ │ │ +392void StandardMerge::build(const std:: │ │ │ │ │ +vector >& grid1Coords, │ │ │ │ │ + 393 const std::vector& grid1_elements, │ │ │ │ │ + 394 const std::vector& grid1_element_types, │ │ │ │ │ + 395 const std::vector >& grid2Coords, │ │ │ │ │ + 396 const std::vector& grid2_elements, │ │ │ │ │ + 397 const std::vector& grid2_element_types │ │ │ │ │ + 398 ) │ │ │ │ │ + 399{ │ │ │ │ │ + 400 │ │ │ │ │ + 401 std::cout << "StandardMerge building merged grid..." << std::endl; │ │ │ │ │ + 402 Dune::Timer watch; │ │ │ │ │ + 403 │ │ │ │ │ + 404 clear(); │ │ │ │ │ + 405 // clear global intersection list │ │ │ │ │ + 406 intersectionListProvider_->clear(); │ │ │ │ │ + 407 this->counter = 0; │ │ │ │ │ + 408 │ │ │ │ │ + 409 // ///////////////////////////////////////////////////////////////////// │ │ │ │ │ + 410 // Copy element corners into a data structure with block-structure. │ │ │ │ │ + 411 // This is not as efficient but a lot easier to use. │ │ │ │ │ + 412 // We may think about efficiency later. │ │ │ │ │ + 413 // ///////////////////////////////////////////////////////////////////// │ │ │ │ │ + 414 │ │ │ │ │ + 415 // first the grid1 side │ │ │ │ │ + 416 grid1ElementCorners_.resize(grid1_element_types.size()); │ │ │ │ │ + 417 │ │ │ │ │ + 418 unsigned int grid1CornerCounter = 0; │ │ │ │ │ + 419 │ │ │ │ │ + 420 for (std::size_t i=0; i::general │ │ │ │ │ +(grid1_element_types[i]).size(grid1Dim); │ │ │ │ │ + 424 grid1ElementCorners_[i].resize(numVertices); │ │ │ │ │ + 425 for (int j=0; j::general │ │ │ │ │ +(grid2_element_types[i]).size(grid2Dim); │ │ │ │ │ + 439 grid2ElementCorners_[i].resize(numVertices); │ │ │ │ │ + 440 for (int j=0; j(grid1_element_types, │ │ │ │ │ +grid1ElementCorners_, elementNeighbors1_); │ │ │ │ │ + 450 computeNeighborsPerElement(grid2_element_types, │ │ │ │ │ +grid2ElementCorners_, elementNeighbors2_); │ │ │ │ │ + 451 │ │ │ │ │ + 452 std::cout << "setup took " << watch.elapsed() << " seconds." << std::endl; │ │ │ │ │ + 453 │ │ │ │ │ + 454 if (m_enableBruteForce) │ │ │ │ │ + 455 buildBruteForce(grid1Coords, grid1_elements, grid1_element_types, │ │ │ │ │ +grid2Coords, grid2_elements, grid2_element_types); │ │ │ │ │ + 456 else │ │ │ │ │ + 457 buildAdvancingFront(grid1Coords, grid1_elements, grid1_element_types, │ │ │ │ │ +grid2Coords, grid2_elements, grid2_element_types); │ │ │ │ │ + 458 │ │ │ │ │ + 459 valid = true; │ │ │ │ │ + 460 std::cout << "intersection construction took " << watch.elapsed() << " │ │ │ │ │ +seconds." << std::endl; │ │ │ │ │ + 461} │ │ │ │ │ + 462 │ │ │ │ │ + 463template │ │ │ │ │ + 464void StandardMerge::buildAdvancingFront( │ │ │ │ │ + 465 const std::vector >& grid1Coords, │ │ │ │ │ + 466 const std::vector& grid1_elements, │ │ │ │ │ + 467 const std::vector& grid1_element_types, │ │ │ │ │ + 468 const std::vector >& grid2Coords, │ │ │ │ │ + 469 const std::vector& grid2_elements, │ │ │ │ │ + 470 const std::vector& grid2_element_types │ │ │ │ │ + 471 ) │ │ │ │ │ + 472{ │ │ │ │ │ + 474 // Data structures for the advancing-front algorithm │ │ │ │ │ + 476 │ │ │ │ │ + 477 std::stack candidates1; │ │ │ │ │ + 478 std::stack candidates2; │ │ │ │ │ + 479 │ │ │ │ │ + 480 std::vector seeds(grid2_element_types.size(), -1); │ │ │ │ │ + 481 │ │ │ │ │ + 482 // ///////////////////////////////////////////////////////////////////// │ │ │ │ │ + 483 // Do a brute-force search to find one pair of intersecting elements │ │ │ │ │ + 484 // to start the advancing-front type algorithm with. │ │ │ │ │ + 485 // ///////////////////////////////////////////////////////////////////// │ │ │ │ │ + 486 │ │ │ │ │ + 487 // Set flag if element has been handled │ │ │ │ │ + 488 Dune::BitSetVector<1> isHandled2(grid2_element_types.size()); │ │ │ │ │ + 489 │ │ │ │ │ + 490 // Set flag if the element has been entered in the queue │ │ │ │ │ + 491 Dune::BitSetVector<1> isCandidate2(grid2_element_types.size()); │ │ │ │ │ + 492 │ │ │ │ │ + 493 generateSeed(seeds, isHandled2, candidates2, grid1Coords, │ │ │ │ │ +grid1_element_types, grid2Coords, grid2_element_types); │ │ │ │ │ + 494 │ │ │ │ │ + 495 // ///////////////////////////////////////////////////////////////////// │ │ │ │ │ + 496 // Main loop │ │ │ │ │ + 497 // ///////////////////////////////////////////////////////////////////// │ │ │ │ │ + 498 │ │ │ │ │ + 499 std::set isHandled1; │ │ │ │ │ + 500 │ │ │ │ │ + 501 std::set isCandidate1; │ │ │ │ │ + 502 │ │ │ │ │ + 503 while (!candidates2.empty()) { │ │ │ │ │ + 504 │ │ │ │ │ + 505 // Get the next element on the grid2 side │ │ │ │ │ + 506 unsigned int currentCandidate2 = candidates2.top(); │ │ │ │ │ + 507 int seed = seeds[currentCandidate2]; │ │ │ │ │ + 508 assert(seed >= 0); │ │ │ │ │ + 509 │ │ │ │ │ + 510 candidates2.pop(); │ │ │ │ │ + 511 isHandled2[currentCandidate2] = true; │ │ │ │ │ + 512 │ │ │ │ │ + 513 // Start advancing front algorithm on the grid1 side from the 'seed' │ │ │ │ │ +element that │ │ │ │ │ + 514 // we stored along with the current grid2 element │ │ │ │ │ + 515 candidates1.push(seed); │ │ │ │ │ + 516 │ │ │ │ │ + 517 isHandled1.clear(); │ │ │ │ │ + 518 isCandidate1.clear(); │ │ │ │ │ + 519 │ │ │ │ │ + 520 while (!candidates1.empty()) { │ │ │ │ │ + 521 │ │ │ │ │ + 522 unsigned int currentCandidate1 = candidates1.top(); │ │ │ │ │ + 523 candidates1.pop(); │ │ │ │ │ + 524 isHandled1.insert(currentCandidate1); │ │ │ │ │ + 525 │ │ │ │ │ + 526 // Test whether there is an intersection between currentCandidate0 and │ │ │ │ │ +currentCandidate1 │ │ │ │ │ + 527 std::bitset<(1< neighborIntersects1; │ │ │ │ │ + 528 std::bitset<(1< neighborIntersects2; │ │ │ │ │ + 529 bool intersectionFound = computeIntersection(currentCandidate1, │ │ │ │ │ +currentCandidate2, │ │ │ │ │ + 530 grid1Coords,grid1_element_types, neighborIntersects1, │ │ │ │ │ + 531 grid2Coords,grid2_element_types, neighborIntersects2); │ │ │ │ │ + 532 │ │ │ │ │ + 533 for (size_t i=0; i-1) { │ │ │ │ │ + 574 │ │ │ │ │ + 575 isCandidate2[neighbor][0] = true; │ │ │ │ │ + 576 candidates2.push(neighbor); │ │ │ │ │ + 577 seedFound = true; │ │ │ │ │ + 578 } │ │ │ │ │ + 579 } │ │ │ │ │ + 580 │ │ │ │ │ + 581 if (seedFound || !m_enableFallback) │ │ │ │ │ + 582 continue; │ │ │ │ │ + 583 │ │ │ │ │ + 584 // There is no neighbor with a seed, so we need to be a bit more │ │ │ │ │ +aggressive... │ │ │ │ │ + 585 // get all neighbors of currentCandidate2, but not currentCandidate2 │ │ │ │ │ +itself │ │ │ │ │ + 586 for (size_t i=0; i::iterator seedIt = isHandled1.begin │ │ │ │ │ +(); │ │ │ │ │ + 601 seedIt != isHandled1.end(); ++seedIt) { │ │ │ │ │ + 602 │ │ │ │ │ + 603 std::bitset<(1< neighborIntersects1; │ │ │ │ │ + 604 std::bitset<(1< neighborIntersects2; │ │ │ │ │ + 605 bool intersectionFound = computeIntersection(*seedIt, neighbor, │ │ │ │ │ + 606 grid1Coords, grid1_element_types, neighborIntersects1, │ │ │ │ │ + 607 grid2Coords, grid2_element_types, neighborIntersects2, │ │ │ │ │ + 608 false); │ │ │ │ │ + 609 │ │ │ │ │ + 610 // if the intersection is nonempty, *seedIt is our new seed candidate on │ │ │ │ │ +the grid1 side │ │ │ │ │ + 611 if (intersectionFound) { │ │ │ │ │ + 612 seed = *seedIt; │ │ │ │ │ + 613 Dune::dwarn << "Algorithm entered first fallback method and found a new │ │ │ │ │ +seed in the build algorithm." << │ │ │ │ │ + 614 "Probably, the neighborIntersects bitsets computed in computeIntersection │ │ │ │ │ +specialization is wrong." << std::endl; │ │ │ │ │ + 615 break; │ │ │ │ │ + 616 } │ │ │ │ │ + 617 │ │ │ │ │ + 618 } │ │ │ │ │ + 619 │ │ │ │ │ + 620 if (seed < 0) { │ │ │ │ │ + 621 // The fast method didn't find a grid1 element that intersects with │ │ │ │ │ + 622 // the new grid2 candidate. We have to do a brute-force search. │ │ │ │ │ + 623 seed = bruteForceSearch(neighbor, │ │ │ │ │ + 624 grid1Coords,grid1_element_types, │ │ │ │ │ + 625 grid2Coords,grid2_element_types); │ │ │ │ │ + 626 Dune::dwarn << "Algorithm entered second fallback method. This probably │ │ │ │ │ +should not happen." << std::endl; │ │ │ │ │ + 627 │ │ │ │ │ + 628 } │ │ │ │ │ + 629 │ │ │ │ │ + 630 // We have tried all we could: the candidate is 'handled' now │ │ │ │ │ + 631 isCandidate2[neighbor] = true; │ │ │ │ │ + 632 │ │ │ │ │ + 633 // still no seed? Then the new grid2 candidate isn't overlapped by │ │ │ │ │ +anything │ │ │ │ │ + 634 if (seed < 0) │ │ │ │ │ + 635 continue; │ │ │ │ │ + 636 │ │ │ │ │ + 637 // we have a seed now │ │ │ │ │ + 638 candidates2.push(neighbor); │ │ │ │ │ + 639 seeds[neighbor] = seed; │ │ │ │ │ + 640 seedFound = true; │ │ │ │ │ + 641 │ │ │ │ │ + 642 } │ │ │ │ │ + 643 │ │ │ │ │ + 644 } │ │ │ │ │ + 645 │ │ │ │ │ + 646 /* Do a brute-force search if there is still no seed: │ │ │ │ │ + 647 * There might still be a disconnected region out there. │ │ │ │ │ + 648 */ │ │ │ │ │ + 649 if (!seedFound && candidates2.empty()) { │ │ │ │ │ + 650 generateSeed(seeds, isHandled2, candidates2, grid1Coords, │ │ │ │ │ +grid1_element_types, grid2Coords, grid2_element_types); │ │ │ │ │ + 651 } │ │ │ │ │ + 652 } │ │ │ │ │ + 653} │ │ │ │ │ + 654 │ │ │ │ │ + 655template │ │ │ │ │ + 656void StandardMerge::buildBruteForce( │ │ │ │ │ + 657 const std::vector >& grid1Coords, │ │ │ │ │ + 658 const std::vector& grid1_elements, │ │ │ │ │ + 659 const std::vector& grid1_element_types, │ │ │ │ │ + 660 const std::vector >& grid2Coords, │ │ │ │ │ + 661 const std::vector& grid2_elements, │ │ │ │ │ + 662 const std::vector& grid2_element_types │ │ │ │ │ + 663 ) │ │ │ │ │ + 664{ │ │ │ │ │ + 665 std::bitset<(1< neighborIntersects1; │ │ │ │ │ + 666 std::bitset<(1< neighborIntersects2; │ │ │ │ │ + 667 │ │ │ │ │ + 668 for (unsigned i = 0; i < grid1_element_types.size(); ++i) { │ │ │ │ │ + 669 for (unsigned j = 0; j < grid2_element_types.size(); ++j) { │ │ │ │ │ + 670 (void) computeIntersection(i, j, │ │ │ │ │ + 671 grid1Coords, grid1_element_types, neighborIntersects1, │ │ │ │ │ + 672 grid2Coords, grid2_element_types, neighborIntersects2); │ │ │ │ │ + 673 } │ │ │ │ │ + 674 } │ │ │ │ │ + 675} │ │ │ │ │ + 676 │ │ │ │ │ + 677template │ │ │ │ │ + 678void StandardMerge::generateSeed(std:: │ │ │ │ │ +vector& seeds, Dune::BitSetVector<1>& isHandled2, std::stack& │ │ │ │ │ +candidates2, const std::vector >& grid1Coords, │ │ │ │ │ +const std::vector& grid1_element_types, const std:: │ │ │ │ │ +vector >& grid2Coords, const std::vector& grid2_element_types) │ │ │ │ │ + 679{ │ │ │ │ │ + 680 for (std::size_t j=0; j 0 || isHandled2[j][0]) │ │ │ │ │ + 683 continue; │ │ │ │ │ + 684 │ │ │ │ │ + 685 int seed = bruteForceSearch │ │ │ │ │ +(j,grid1Coords,grid1_element_types,grid2Coords,grid2_element_types); │ │ │ │ │ + 686 │ │ │ │ │ + 687 if (seed >= 0) { │ │ │ │ │ + 688 candidates2.push(j); // the candidate and a seed for the candidate │ │ │ │ │ + 689 seeds[j] = seed; │ │ │ │ │ + 690 break; │ │ │ │ │ + 691 } else // If the brute force search did not find any intersection we can │ │ │ │ │ +skip this element │ │ │ │ │ + 692 isHandled2[j] = true; │ │ │ │ │ + 693 } │ │ │ │ │ + 694} │ │ │ │ │ + 695 │ │ │ │ │ + 696template │ │ │ │ │ + 697int StandardMerge::insertIntersections │ │ │ │ │ +(unsigned int candidate1, unsigned int candidate2, │ │ │ │ │ + 698 std::vector& intersections) │ │ │ │ │ + 699{ │ │ │ │ │ + 700 typedef typename std::vector::size_type size_t; │ │ │ │ │ + 701 int count = 0; │ │ │ │ │ + 702 │ │ │ │ │ + 703 for (size_t i = 0; i < intersections.size(); ++i) { │ │ │ │ │ + 704 // get the intersection index of the current intersection from │ │ │ │ │ +intersections in this->intersections │ │ │ │ │ + 705 bool found; │ │ │ │ │ + 706 unsigned int index; │ │ │ │ │ + 707 std::tie(found, index) = intersectionIndex │ │ │ │ │ +(candidate1,candidate2,intersections[i]); │ │ │ │ │ + 708 │ │ │ │ │ + 709 if (found && index >= this->intersections().size()) { //the intersection │ │ │ │ │ +is not yet contained in this->intersections │ │ │ │ │ + 710 this->intersections().push_back(intersections[i]); // insert │ │ │ │ │ + 711 │ │ │ │ │ + 712 ++count; │ │ │ │ │ + 713 } else if (found) { │ │ │ │ │ + 714 auto& intersection = this->intersections()[index]; │ │ │ │ │ + 715 │ │ │ │ │ + 716 // insert each grid1 element and local representation of intersections[i] │ │ │ │ │ +with parent candidate1 │ │ │ │ │ + 717 for (size_t j = 0; j < intersections[i].parents0.size(); ++j) { │ │ │ │ │ + 718 intersection.parents0.push_back(candidate1); │ │ │ │ │ + 719 intersection.corners0.push_back(intersections[i].corners0[j]); │ │ │ │ │ + 720 } │ │ │ │ │ + 721 │ │ │ │ │ + 722 // insert each grid2 element and local representation of intersections[i] │ │ │ │ │ +with parent candidate2 │ │ │ │ │ + 723 for (size_t j = 0; j < intersections[i].parents1.size(); ++j) { │ │ │ │ │ + 724 intersection.parents1.push_back(candidate2); │ │ │ │ │ + 725 intersection.corners1.push_back(intersections[i].corners1[j]); │ │ │ │ │ + 726 } │ │ │ │ │ + 727 │ │ │ │ │ + 728 ++count; │ │ │ │ │ + 729 } else { │ │ │ │ │ + 730 Dune::dwarn << "Computed the same intersection twice!" << std::endl; │ │ │ │ │ + 731 } │ │ │ │ │ + 732 } │ │ │ │ │ + 733 return count; │ │ │ │ │ + 734} │ │ │ │ │ + 735 │ │ │ │ │ + 736template │ │ │ │ │ + 737std::pair │ │ │ │ │ + 738StandardMerge::intersectionIndex(unsigned int │ │ │ │ │ +grid1Index, unsigned int grid2Index, │ │ │ │ │ + 739 SimplicialIntersection& intersection) { │ │ │ │ │ + 740 │ │ │ │ │ + 741 │ │ │ │ │ + 742 // return index in intersections_ if at least one local representation of │ │ │ │ │ +a Simplicial Intersection (SI) │ │ │ │ │ + 743 // of intersections_ is equal to the local representation of one element │ │ │ │ │ +in intersections │ │ │ │ │ + 744 │ │ │ │ │ + 745 std::size_t n_intersections = this->intersections().size(); │ │ │ │ │ + 746 if (grid1Dim == grid2Dim) │ │ │ │ │ + 747 return {true, n_intersections}; │ │ │ │ │ + 748 │ │ │ │ │ + 749 T eps = 1e-10; │ │ │ │ │ + 750 │ │ │ │ │ + 751 for (std::size_t i = 0; i < n_intersections; ++i) { │ │ │ │ │ + 752 │ │ │ │ │ + 753 // compare the local representation of the subelements of the SI │ │ │ │ │ + 754 for (std::size_t ei = 0; ei < this->intersections()[i].parents0.size(); │ │ │ │ │ +++ei) // merger subelement │ │ │ │ │ + 755 { │ │ │ │ │ + 756 if (this->intersections()[i].parents0[ei] == grid1Index) │ │ │ │ │ + 757 { │ │ │ │ │ + 758 for (std::size_t er = 0; er < intersection.parents0.size(); ++er) // list │ │ │ │ │ +subelement │ │ │ │ │ + 759 { │ │ │ │ │ + 760 bool found_all = true; │ │ │ │ │ + 761 // compare the local coordinate representations │ │ │ │ │ + 762 for (std::size_t ci = 0; ci < this->intersections()[i].corners0[ei].size │ │ │ │ │ +(); ++ci) │ │ │ │ │ + 763 { │ │ │ │ │ + 764 Dune::FieldVector ni = this->intersections()[i].corners0[ei] │ │ │ │ │ +[ci]; │ │ │ │ │ + 765 bool found_ni = false; │ │ │ │ │ + 766 for (std::size_t cr = 0; cr < intersection.corners0[er].size(); ++cr) │ │ │ │ │ + 767 { │ │ │ │ │ + 768 Dune::FieldVector nr = intersection.corners0[er][cr]; │ │ │ │ │ + 769 │ │ │ │ │ + 770 found_ni = found_ni || ((ni-nr).infinity_norm() < eps); │ │ │ │ │ + 771 if (found_ni) │ │ │ │ │ + 772 break; │ │ │ │ │ + 773 } │ │ │ │ │ + 774 found_all = found_all && found_ni; │ │ │ │ │ + 775 │ │ │ │ │ + 776 if (!found_ni) │ │ │ │ │ + 777 break; │ │ │ │ │ + 778 } │ │ │ │ │ + 779 │ │ │ │ │ + 780 if (found_all && (this->intersections()[i].parents1[ei] != grid2Index)) │ │ │ │ │ + 781 return {true, i}; │ │ │ │ │ + 782 else if (found_all) │ │ │ │ │ + 783 return {false, 0}; │ │ │ │ │ + 784 } │ │ │ │ │ + 785 } │ │ │ │ │ + 786 } │ │ │ │ │ + 787 │ │ │ │ │ + 788 // compare the local representation of the subelements of the SI │ │ │ │ │ + 789 for (std::size_t ei = 0; ei < this->intersections()[i].parents1.size(); │ │ │ │ │ +++ei) // merger subelement │ │ │ │ │ + 790 { │ │ │ │ │ + 791 if (this->intersections()[i].parents1[ei] == grid2Index) │ │ │ │ │ + 792 { │ │ │ │ │ + 793 for (std::size_t er = 0; er < intersection.parents1.size(); ++er) // list │ │ │ │ │ +subelement │ │ │ │ │ + 794 { │ │ │ │ │ + 795 bool found_all = true; │ │ │ │ │ + 796 // compare the local coordinate representations │ │ │ │ │ + 797 for (std::size_t ci = 0; ci < this->intersections()[i].corners1[ei].size │ │ │ │ │ +(); ++ci) │ │ │ │ │ + 798 { │ │ │ │ │ + 799 Dune::FieldVector ni = this->intersections()[i].corners1[ei] │ │ │ │ │ +[ci]; │ │ │ │ │ + 800 bool found_ni = false; │ │ │ │ │ + 801 for (std::size_t cr = 0; cr < intersection.corners1[er].size(); ++cr) │ │ │ │ │ + 802 { │ │ │ │ │ + 803 Dune::FieldVector nr = intersection.corners1[er][cr]; │ │ │ │ │ + 804 found_ni = found_ni || ((ni-nr).infinity_norm() < eps); │ │ │ │ │ + 805 │ │ │ │ │ + 806 if (found_ni) │ │ │ │ │ + 807 break; │ │ │ │ │ + 808 } │ │ │ │ │ + 809 found_all = found_all && found_ni; │ │ │ │ │ + 810 │ │ │ │ │ + 811 if (!found_ni) │ │ │ │ │ + 812 break; │ │ │ │ │ + 813 } │ │ │ │ │ + 814 │ │ │ │ │ + 815 if (found_all && (this->intersections()[i].parents0[ei] != grid1Index)) │ │ │ │ │ + 816 return {true, i}; │ │ │ │ │ + 817 else if (found_all) │ │ │ │ │ + 818 return {false, 0}; │ │ │ │ │ + 819 } │ │ │ │ │ + 820 } │ │ │ │ │ + 821 } │ │ │ │ │ + 822 } │ │ │ │ │ + 823 │ │ │ │ │ + 824 return {true, n_intersections}; │ │ │ │ │ + 825} │ │ │ │ │ + 826 │ │ │ │ │ +827#define DECL extern │ │ │ │ │ +828#define STANDARD_MERGE_INSTANTIATE(T,A,B,C) \ │ │ │ │ │ + 829 DECL template \ │ │ │ │ │ + 830 void StandardMerge::build(const std::vector >& grid1Coords, \ │ │ │ │ │ + 831 const std::vector& grid1_elements, \ │ │ │ │ │ + 832 const std::vector& grid1_element_types, \ │ │ │ │ │ + 833 const std::vector >& grid2Coords, \ │ │ │ │ │ + 834 const std::vector& grid2_elements, \ │ │ │ │ │ + 835 const std::vector& grid2_element_types \ │ │ │ │ │ + 836 ) │ │ │ │ │ + 837 │ │ │ │ │ + 838STANDARD_MERGE_INSTANTIATE(double,1,1,1); │ │ │ │ │ + 839STANDARD_MERGE_INSTANTIATE(double,2,2,2); │ │ │ │ │ + 840STANDARD_MERGE_INSTANTIATE(double,3,3,3); │ │ │ │ │ + 841#undef STANDARD_MERGE_INSTANTIATE │ │ │ │ │ + 842#undef DECL │ │ │ │ │ + 843 │ │ │ │ │ + 844} /* namespace GridGlue */ │ │ │ │ │ + 845} /* namespace Dune */ │ │ │ │ │ + 846 │ │ │ │ │ + 847#endif // DUNE_GRIDGLUE_MERGING_STANDARDMERGE_HH │ │ │ │ │ +merger.hh │ │ │ │ │ +computeintersection.hh │ │ │ │ │ +intersectionlist.hh │ │ │ │ │ Dune │ │ │ │ │ Definition: gridglue.hh:37 │ │ │ │ │ +Dune::GridGlue::STANDARD_MERGE_INSTANTIATE │ │ │ │ │ +STANDARD_MERGE_INSTANTIATE(double, 1, 1, 1) │ │ │ │ │ Dune::GridGlue::intersections │ │ │ │ │ IteratorRange<... > intersections(const GridGlue<... > &glue, const Reverse<... │ │ │ │ │ > &reverse=!reversed) │ │ │ │ │ Iterate over all intersections of a GridGlue. │ │ │ │ │ -Dune::GridGlue::ConformingMerge │ │ │ │ │ -Implementation of the Merger concept for conforming interfaces. │ │ │ │ │ -Definition: conformingmerge.hh:49 │ │ │ │ │ -Dune::GridGlue::ConformingMerge::LocalCoords │ │ │ │ │ -Dune::FieldVector< T, dim > LocalCoords │ │ │ │ │ -the coordinate type used in this interface │ │ │ │ │ -Definition: conformingmerge.hh:62 │ │ │ │ │ -Dune::GridGlue::ConformingMerge::WorldCoords │ │ │ │ │ +Dune::GridGlue::SimplicialIntersectionListProvider │ │ │ │ │ +Definition: intersectionlist.hh:207 │ │ │ │ │ +Dune::GridGlue::SimplicialIntersectionListProvider::SimplicialIntersection │ │ │ │ │ +Definition: intersectionlist.hh:222 │ │ │ │ │ +Dune::GridGlue::Merger │ │ │ │ │ +Abstract base for all classes that take extracted grids and build sets of │ │ │ │ │ +intersections. │ │ │ │ │ +Definition: merger.hh:27 │ │ │ │ │ +Dune::GridGlue::Merger<_T,_grid1Dim,_grid2Dim,_dimworld_>::WorldCoords │ │ │ │ │ Dune::FieldVector< T, dimworld > WorldCoords │ │ │ │ │ the coordinate type used in this interface │ │ │ │ │ -Definition: conformingmerge.hh:59 │ │ │ │ │ -Dune::GridGlue::ConformingMerge::default_tolerance │ │ │ │ │ -static constexpr T default_tolerance │ │ │ │ │ -Definition: conformingmerge.hh:89 │ │ │ │ │ -Dune::GridGlue::ConformingMerge::ctype │ │ │ │ │ -T ctype │ │ │ │ │ -the numeric type used in this interface │ │ │ │ │ -Definition: conformingmerge.hh:56 │ │ │ │ │ -Dune::GridGlue::ConformingMerge::ConformingMerge │ │ │ │ │ -ConformingMerge(T tolerance=default_tolerance) │ │ │ │ │ -Definition: conformingmerge.hh:91 │ │ │ │ │ +Definition: merger.hh:37 │ │ │ │ │ +Dune::GridGlue::Merger<_T,_grid1Dim,_grid2Dim,_dimworld_>::IntersectionList │ │ │ │ │ +Dune::GridGlue::IntersectionList< Grid1Coords, Grid2Coords > IntersectionList │ │ │ │ │ +Definition: merger.hh:39 │ │ │ │ │ +Dune::GridGlue::Merger<_T,_grid1Dim,_grid2Dim,_dimworld_>::Grid1Coords │ │ │ │ │ +Dune::FieldVector< T, grid1Dim > Grid1Coords │ │ │ │ │ +the local coordinate type for the grid1 coordinates │ │ │ │ │ +Definition: merger.hh:31 │ │ │ │ │ +Dune::GridGlue::Merger<_T,_grid1Dim,_grid2Dim,_dimworld_>::Grid2Coords │ │ │ │ │ +Dune::FieldVector< T, grid2Dim > Grid2Coords │ │ │ │ │ +the local coordinate type for the grid2 coordinates │ │ │ │ │ +Definition: merger.hh:34 │ │ │ │ │ Dune::GridGlue::StandardMerge │ │ │ │ │ Common base class for many merger implementations: produce pairs of entities │ │ │ │ │ that may intersect. │ │ │ │ │ Definition: standardmerge.hh:58 │ │ │ │ │ +Dune::GridGlue::StandardMerge::computeIntersections │ │ │ │ │ +virtual void computeIntersections(const Dune::GeometryType &grid1ElementType, │ │ │ │ │ +const std::vector< Dune::FieldVector< T, dimworld > > &grid1ElementCorners, │ │ │ │ │ +std::bitset<(1<< grid1Dim)> &neighborIntersects1, unsigned int grid1Index, │ │ │ │ │ +const Dune::GeometryType &grid2ElementType, const std::vector< Dune:: │ │ │ │ │ +FieldVector< T, dimworld > > &grid2ElementCorners, std::bitset<(1<< grid2Dim)> │ │ │ │ │ +&neighborIntersects2, unsigned int grid2Index, std::vector< │ │ │ │ │ +SimplicialIntersection > &intersections)=0 │ │ │ │ │ +Compute the intersection between two overlapping elements. │ │ │ │ │ +Dune::GridGlue::StandardMerge::intersectionList_ │ │ │ │ │ +std::shared_ptr< IntersectionList > intersectionList_ │ │ │ │ │ +Definition: standardmerge.hh:124 │ │ │ │ │ +Dune::GridGlue::StandardMerge::Grid1Coords │ │ │ │ │ +typename Base::Grid1Coords Grid1Coords │ │ │ │ │ +Type used for local coordinates on the grid1 side. │ │ │ │ │ +Definition: standardmerge.hh:69 │ │ │ │ │ +Dune::GridGlue::StandardMerge::enableFallback │ │ │ │ │ +void enableFallback(bool fallback) │ │ │ │ │ +Definition: standardmerge.hh:166 │ │ │ │ │ +Dune::GridGlue::StandardMerge::elementNeighbors2_ │ │ │ │ │ +std::vector< std::vector< int > > elementNeighbors2_ │ │ │ │ │ +Definition: standardmerge.hh:131 │ │ │ │ │ +Dune::GridGlue::StandardMerge::elementNeighbors1_ │ │ │ │ │ +std::vector< std::vector< int > > elementNeighbors1_ │ │ │ │ │ +Definition: standardmerge.hh:130 │ │ │ │ │ +Dune::GridGlue::StandardMerge::ctype │ │ │ │ │ +T ctype │ │ │ │ │ +the numeric type used in this interface │ │ │ │ │ +Definition: standardmerge.hh:66 │ │ │ │ │ +Dune::GridGlue::StandardMerge::clear │ │ │ │ │ +void clear() override │ │ │ │ │ +Definition: standardmerge.hh:150 │ │ │ │ │ +Dune::GridGlue::StandardMerge::IntersectionList │ │ │ │ │ +typename Base::IntersectionList IntersectionList │ │ │ │ │ +Definition: standardmerge.hh:77 │ │ │ │ │ +Dune::GridGlue::StandardMerge::computeIntersection │ │ │ │ │ +bool computeIntersection(unsigned int candidate0, unsigned int candidate1, │ │ │ │ │ +const std::vector< Dune::FieldVector< T, dimworld > > &grid1Coords, const std:: │ │ │ │ │ +vector< Dune::GeometryType > &grid1_element_types, std::bitset<(1<< grid1Dim)> │ │ │ │ │ +&neighborIntersects1, const std::vector< Dune::FieldVector< T, dimworld > > │ │ │ │ │ +&grid2Coords, const std::vector< Dune::GeometryType > &grid2_element_types, │ │ │ │ │ +std::bitset<(1<< grid2Dim)> &neighborIntersects2, bool insert=true) │ │ │ │ │ +Compute the intersection between two overlapping elements. │ │ │ │ │ +Definition: standardmerge.hh:263 │ │ │ │ │ +Dune::GridGlue::StandardMerge::enableBruteForce │ │ │ │ │ +void enableBruteForce(bool bruteForce) │ │ │ │ │ +Definition: standardmerge.hh:171 │ │ │ │ │ +Dune::GridGlue::StandardMerge::intersectionListProvider_ │ │ │ │ │ +std::shared_ptr< IntersectionListProvider > intersectionListProvider_ │ │ │ │ │ +Definition: standardmerge.hh:123 │ │ │ │ │ +Dune::GridGlue::StandardMerge::build │ │ │ │ │ +void build(const std::vector< Dune::FieldVector< T, dimworld > > &grid1_Coords, │ │ │ │ │ +const std::vector< unsigned int > &grid1_elements, const std::vector< Dune:: │ │ │ │ │ +GeometryType > &grid1_element_types, const std::vector< Dune::FieldVector< T, │ │ │ │ │ +dimworld > > &grid2_coords, const std::vector< unsigned int > &grid2_elements, │ │ │ │ │ +const std::vector< Dune::GeometryType > &grid2_element_types) override │ │ │ │ │ +builds the merged grid │ │ │ │ │ +Definition: standardmerge.hh:392 │ │ │ │ │ +Dune::GridGlue::StandardMerge::grid1ElementCorners_ │ │ │ │ │ +std::vector< std::vector< unsigned int > > grid1ElementCorners_ │ │ │ │ │ +Temporary internal data. │ │ │ │ │ +Definition: standardmerge.hh:127 │ │ │ │ │ +Dune::GridGlue::StandardMerge::grid2ElementCorners_ │ │ │ │ │ +std::vector< std::vector< unsigned int > > grid2ElementCorners_ │ │ │ │ │ +Definition: standardmerge.hh:128 │ │ │ │ │ +Dune::GridGlue::StandardMerge::Grid2Coords │ │ │ │ │ +typename Base::Grid2Coords Grid2Coords │ │ │ │ │ +Type used for local coordinates on the grid2 side. │ │ │ │ │ +Definition: standardmerge.hh:72 │ │ │ │ │ +Dune::GridGlue::StandardMerge::intersectionList │ │ │ │ │ +std::shared_ptr< IntersectionList > intersectionList() const final │ │ │ │ │ +Definition: standardmerge.hh:160 │ │ │ │ │ +Dune::GridGlue::StandardMerge::~StandardMerge │ │ │ │ │ +virtual ~StandardMerge()=default │ │ │ │ │ +Dune::GridGlue::StandardMerge::RemoteSimplicialIntersection │ │ │ │ │ +SimplicialIntersection RemoteSimplicialIntersection │ │ │ │ │ +Definition: standardmerge.hh:84 │ │ │ │ │ +Dune::GridGlue::StandardMerge::valid │ │ │ │ │ +bool valid │ │ │ │ │ +Definition: standardmerge.hh:86 │ │ │ │ │ +Dune::GridGlue::StandardMerge::StandardMerge │ │ │ │ │ +StandardMerge() │ │ │ │ │ +Definition: standardmerge.hh:88 │ │ │ │ │ Dune::GridGlue::StandardMerge::SimplicialIntersection │ │ │ │ │ typename IntersectionListProvider::SimplicialIntersection │ │ │ │ │ SimplicialIntersection │ │ │ │ │ Definition: standardmerge.hh:83 │ │ │ │ │ +Dune::GridGlue::StandardMerge::WorldCoords │ │ │ │ │ +typename Base::WorldCoords WorldCoords │ │ │ │ │ +the coordinate type used in this interface │ │ │ │ │ +Definition: standardmerge.hh:75 │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ │ │ Generated by [doxygen] 1.9.4 │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00098.html │ │ │ │ @@ -1,15 +1,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ -dune-grid-glue: contactmerge.cc File Reference │ │ │ │ +dune-grid-glue: intersectionlist.hh File Reference │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -63,21 +63,38 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │ +Classes | │ │ │ │ Namespaces
│ │ │ │ -
contactmerge.cc File Reference
│ │ │ │ +
intersectionlist.hh File Reference
│ │ │ │
│ │ │ │
│ │ │ │ -
#include <dune/grid-glue/common/crossproduct.hh>
│ │ │ │ -#include <dune/grid-glue/common/projection.hh>
│ │ │ │ -
│ │ │ │ +
#include <array>
│ │ │ │ +#include <type_traits>
│ │ │ │ +#include <utility>
│ │ │ │ +#include <vector>
│ │ │ │ +#include <dune/common/fvector.hh>
│ │ │ │ +
│ │ │ │ +

Go to the source code of this file.

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

│ │ │ │ +Classes

class  Dune::GridGlue::IntersectionListProvider< L0, L1 >
 
class  Dune::GridGlue::IntersectionList< Local0, Local1 >
 
class  Dune::GridGlue::SimplicialIntersectionListProvider< dim0, dim1 >
 
struct  Dune::GridGlue::SimplicialIntersectionListProvider< dim0, dim1 >::SimplicialIntersection
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
│ │ │ │ ├── html2text {} │ │ │ │ │ @@ -5,18 +5,32 @@ │ │ │ │ │ │ │ │ │ │ dune-grid-glue 2.9 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ * dune │ │ │ │ │ * grid-glue │ │ │ │ │ * merging │ │ │ │ │ -Namespaces │ │ │ │ │ -contactmerge.cc File Reference │ │ │ │ │ -#include │ │ │ │ │ -#include │ │ │ │ │ +Classes | Namespaces │ │ │ │ │ +intersectionlist.hh File Reference │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +#include │ │ │ │ │ +Go_to_the_source_code_of_this_file. │ │ │ │ │ + Classes │ │ │ │ │ + class  Dune::GridGlue::IntersectionListProvider<_L0,_L1_> │ │ │ │ │ +  │ │ │ │ │ + class  Dune::GridGlue::IntersectionList<_Local0,_Local1_> │ │ │ │ │ +  │ │ │ │ │ + class  Dune::GridGlue::SimplicialIntersectionListProvider<_dim0,_dim1_> │ │ │ │ │ +  │ │ │ │ │ +struct  Dune::GridGlue::SimplicialIntersectionListProvider<_dim0,_dim1_>:: │ │ │ │ │ + SimplicialIntersection │ │ │ │ │ +  │ │ │ │ │ Namespaces │ │ │ │ │ namespace  Dune │ │ │ │ │   │ │ │ │ │ namespace  Dune::GridGlue │ │ │ │ │   │ │ │ │ │ │ │ │ │ │ =============================================================================== │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00101.html │ │ │ │ @@ -62,15 +62,15 @@ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
Todo List
│ │ │ │
│ │ │ │
│ │ │ │
│ │ │ │ -
Member CheckMPIStatus (A, B)
│ │ │ │ +
Member CheckMPIStatus (A, B)
│ │ │ │
Implement MPI Status check with exception handling
│ │ │ │
Class Dune::GridGlue::GridGlue< P0, P1 >
│ │ │ │
adapt member names according to style guide
│ │ │ │
Member Dune::GridGlue::GridGlue< P0, P1 >::communicate (Dune::GridGlue::CommDataHandle< DataHandleImp, DataTypeImp > &data, Dune::InterfaceType iftype, Dune::CommunicationDirection dir) const
│ │ │ │

fix mixed communication: seq->par use commSeq, par->seq use commPar

│ │ │ │

│ │ │ │

add directed version communicate<FROM,TO, DH,DT>(data,iftype,dir)

│ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00926.html │ │ │ │ @@ -1520,16 +1520,16 @@ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following files: │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00930.html │ │ │ │ @@ -76,15 +76,15 @@ │ │ │ │
Dune::GridGlue::IntersectionData< P0, P1 > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

storage class for Dune::GridGlue::Intersection related data │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/adapter/intersection.hh>

│ │ │ │ +

#include <dune/grid-glue/adapter/intersection.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -633,15 +633,15 @@ │ │ │ │ │ │ │ │

Dimension of the intersection.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
The documentation for this class was generated from the following files: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00934.html │ │ │ │ @@ -74,15 +74,15 @@ │ │ │ │
Dune::GridGlue::Intersection< P0, P1, I, O > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

The intersection of two entities of the two patches of a GridGlue. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/adapter/intersection.hh>

│ │ │ │ +

#include <dune/grid-glue/adapter/intersection.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::GridGlue::Intersection< P0, P1, I, O >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -1074,15 +1074,15 @@ │ │ │ │ │ │ │ │

outside patch

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following files: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00942.html │ │ │ │ @@ -70,15 +70,15 @@ │ │ │ │ Public Types | │ │ │ │ Public Member Functions | │ │ │ │ List of all members │ │ │ │
Dune::GridGlue::IntersectionIndexSet< P0, P1 > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/adapter/intersectionindexset.hh>

│ │ │ │ +

#include <dune/grid-glue/adapter/intersectionindexset.hh>

│ │ │ │

│ │ │ │ Public Types

typedef ::Dune::GridGlue::GridGlue< P0, P1 > GridGlue
 
typedef GridGlue::IndexType IndexType
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -192,15 +192,15 @@ │ │ │ │ │ │ │ │

Return total number of intersections.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
The documentation for this class was generated from the following files: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00946.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::GridGlue::GridGlueAmiraWriter Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Write remote intersections to a AmiraMesh file for debugging purposes. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/adapter/gridglueamirawriter.hh>

│ │ │ │ +

#include <dune/grid-glue/adapter/gridglueamirawriter.hh>

│ │ │ │

│ │ │ │ Public Types

typedef GridGlue::IndexType IndexType
 The type used for the indices. More...
 
typedef size_t SizeType
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Static Public Member Functions

template<typename Glue >
static void write (const Glue &glue, const std::string &path, int appendix=1)
 
│ │ │ │ @@ -128,15 +128,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00950.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
│ │ │ │ Public Member Functions | │ │ │ │ List of all members
│ │ │ │
Dune::GridGlue::GlobalId Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/adapter/gridgluecommunicate.hh>

│ │ │ │ +

#include <dune/grid-glue/adapter/gridgluecommunicate.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::GridGlue::GlobalId:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -194,15 +194,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00954.html │ │ │ │ @@ -74,15 +74,15 @@ │ │ │ │
Dune::GridGlue::CommDataHandle< DataHandleImp, DataTypeImp > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

describes the features of a data handle for communication in parallel runs using the GridGlue::communicate methods. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/adapter/gridgluecommunicate.hh>

│ │ │ │ +

#include <dune/grid-glue/adapter/gridgluecommunicate.hh>

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

│ │ │ │ Public Types

typedef DataTypeImp DataType
 data type of data to communicate More...
 
│ │ │ │ @@ -308,15 +308,15 @@ │ │ │ │
│ │ │ │
│ │ │ │

how many objects of type DataType have to be sent for a given intersection Note: Both sender and receiver side need to know this size.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00958.html │ │ │ │ @@ -71,15 +71,15 @@ │ │ │ │ Public Member Functions | │ │ │ │ Public Attributes | │ │ │ │ List of all members │ │ │ │
Dune::GridGlue::StreamingMessageBuffer< DT > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/adapter/gridgluecommunicate.hh>

│ │ │ │ +

#include <dune/grid-glue/adapter/gridgluecommunicate.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::GridGlue::StreamingMessageBuffer< DT >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -333,15 +333,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00962.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::GridGlue::CommunicationOperator< dir > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

forward gather scatter to user defined CommInfo class │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/adapter/gridgluecommunicate.hh>

│ │ │ │ +

#include <dune/grid-glue/adapter/gridgluecommunicate.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -190,15 +190,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Static Public Member Functions

template<class CommInfo >
static const CommInfo::DataTypegather (const CommInfo &commInfo, size_t i, size_t j=0)
 
template<class CommInfo >
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00966.html │ │ │ │ @@ -74,15 +74,15 @@ │ │ │ │
Dune::GridGlue::CommInfo< GG, DataHandleImp, DataTypeImp > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

collects all GridGlue data requried for communication │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/adapter/gridgluecommunicate.hh>

│ │ │ │ +

#include <dune/grid-glue/adapter/gridgluecommunicate.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -283,15 +283,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

typedef DataTypeImp value_type
 
typedef GG GridGlue
 
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00970.html │ │ │ │ @@ -73,15 +73,15 @@ │ │ │ │
Dune::CommPolicy< ::Dune::GridGlue::CommInfo< GG, DataHandleImp, DataTypeImp > > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

specialization of the CommPolicy struct, required for the ParallelIndexsets │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/adapter/gridgluecommunicate.hh>

│ │ │ │ +

#include <dune/grid-glue/adapter/gridgluecommunicate.hh>

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

Get the number of objects at an intersection.

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00974.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::GridGlue::GridGlueVtkWriter Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Write remote intersections to a vtk file for debugging purposes. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/adapter/gridgluevtkwriter.hh>

│ │ │ │ +

#include <dune/grid-glue/adapter/gridgluevtkwriter.hh>

│ │ │ │

│ │ │ │ Public Types

typedef ::Dune::GridGlue::CommInfo< GG, DataHandleImp, DataTypeImp > Type
 The type of the GridGlueCommInfo. More...
 
typedef DataTypeImp IndexedType
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Static Public Member Functions

template<typename Glue >
static void write (const Glue &glue, const std::string &filenameTrunk)
 
│ │ │ │ @@ -122,15 +122,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00982.html │ │ │ │ @@ -70,15 +70,15 @@ │ │ │ │ Public Types | │ │ │ │ Static Public Attributes | │ │ │ │ List of all members │ │ │ │
Dune::GridGlue::IntersectionTraits< P0, P1, inside, outside > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/adapter/intersection.hh>

│ │ │ │ +

#include <dune/grid-glue/adapter/intersection.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -386,15 +386,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Types

using GridGlue = ::Dune::GridGlue::GridGlue< P0, P1 >
 
using IntersectionData = Dune::GridGlue::IntersectionData< P0, P1 >
 
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00986.html │ │ │ │ @@ -71,15 +71,15 @@ │ │ │ │ Public Member Functions | │ │ │ │ Related Functions | │ │ │ │ List of all members │ │ │ │
Dune::GridGlue::Reverse< reverse > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/adapter/rangegenerators.hh>

│ │ │ │ +

#include <dune/grid-glue/adapter/rangegenerators.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::GridGlue::Reverse< reverse >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -174,15 +174,15 @@ │ │ │ │ │ │ │ │
│ │ │ │

Static tag representing reversal of in- and outside of intersections.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00990.html │ │ │ │ @@ -69,15 +69,15 @@ │ │ │ │
│ │ │ │ Public Member Functions | │ │ │ │ List of all members
│ │ │ │
Dune::GridGlue::AreaWriterImplementation::FacetLayout< dimgrid > Struct Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/common/areawriter_impl.hh>

│ │ │ │ +

#include <dune/grid-glue/common/areawriter_impl.hh>

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

│ │ │ │ Public Member Functions

bool contains (Dune::GeometryType gt) const
 
│ │ │ │

Member Function Documentation

│ │ │ │ @@ -106,15 +106,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00994.html │ │ │ │ @@ -75,15 +75,15 @@ │ │ │ │
Dune::GridGlue::Projection< Coordinate > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Projection of a line (triangle) on another line (triangle). │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/common/projection.hh>

│ │ │ │ +

#include <dune/grid-glue/common/projection.hh>

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

│ │ │ │ Classes

struct  EdgeIntersection
 Intersection between two edges of a triangle. More...
 
│ │ │ │ @@ -485,15 +485,15 @@ │ │ │ │ │ │ │ │

maximum number of edge-edge intersections

│ │ │ │

See also \seealso edgeIntersections()

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
The documentation for this class was generated from the following files: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a00998.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::GridGlue::Projection< Coordinate >::EdgeIntersection Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Intersection between two edges of a triangle. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/common/projection.hh>

│ │ │ │ +

#include <dune/grid-glue/common/projection.hh>

│ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -126,15 +126,15 @@ │ │ │ │ │ │ │ │

Local coordinates of intersection and distance along normals.

│ │ │ │

Local coordinate of intersection point in barycentric coordinates with respect to image and preimage triangle.

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01038.html │ │ │ │ @@ -77,15 +77,15 @@ │ │ │ │
Dune::GridGlue::Extractor< GV, cd > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Provides codimension-independent methods for grid extraction. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/extractors/extractor.hh>

│ │ │ │ +

#include <dune/grid-glue/extractors/extractor.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::GridGlue::Extractor< GV, cd >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -1219,15 +1219,15 @@ │ │ │ │ │ │ │ │

a map enabling faster access to vertices and coordinates

│ │ │ │

Maps a vertex' index (from index set) to an object holding the locally associated index of the vertex' coordinate in coords_ and an entity pointer to the codim<dim> entity.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01042.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::GridGlue::Extractor< GV, cd >::CornerInfo Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Helpful struct holding one index for the coordinate (vertex) to which it is associated and the element's corner index;. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/extractors/extractor.hh>

│ │ │ │ +

#include <dune/grid-glue/extractors/extractor.hh>

│ │ │ │

│ │ │ │ Public Attributes

std::array< unsigned, 2 > edge
 Edge numbers in image and preimage triangle. More...
 
std::array< Coordinate, 2 > local
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -124,15 +124,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

element corner

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01046.html │ │ │ │ @@ -70,15 +70,15 @@ │ │ │ │ Public Member Functions | │ │ │ │ Public Attributes | │ │ │ │ List of all members │ │ │ │
Dune::GridGlue::Extractor< GV, cd >::CoordinateInfo Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/extractors/extractor.hh>

│ │ │ │ +

#include <dune/grid-glue/extractors/extractor.hh>

│ │ │ │

│ │ │ │ Public Attributes

unsigned int idx: 28
 index of the vertex More...
 
unsigned int num: 4
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -213,15 +213,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

the index of the parent element (from index set)

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01050.html │ │ │ │ @@ -73,15 +73,15 @@ │ │ │ │
Dune::GridGlue::Extractor< GV, cd >::VertexInfo Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

simple struct holding a vertex pointer and an index │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/extractors/extractor.hh>

│ │ │ │ +

#include <dune/grid-glue/extractors/extractor.hh>

│ │ │ │

│ │ │ │ Public Member Functions

 CoordinateInfo ()
 
 CoordinateInfo (unsigned int index_, IndexType vtxindex_)
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

 VertexInfo (unsigned int idx_, const Vertex &p_)
 
│ │ │ │ │ │ │ │

│ │ │ │ @@ -163,15 +163,15 @@ │ │ │ │

│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01054.html │ │ │ │ @@ -73,15 +73,15 @@ │ │ │ │
Dune::GridGlue::Extractor< GV, cd >::ElementInfo Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

simple struct holding an element seed and an index │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/extractors/extractor.hh>

│ │ │ │ +

#include <dune/grid-glue/extractors/extractor.hh>

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

│ │ │ │ Public Member Functions

 ElementInfo (unsigned int idx_, const Element &p_, unsigned int f_)
 
│ │ │ │ │ │ │ │

│ │ │ │ @@ -196,15 +196,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

the entity seed for the element

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01058.html │ │ │ │ @@ -73,15 +73,15 @@ │ │ │ │
Dune::GridGlue::Extractor< GV, cd >::SubEntityInfo Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Holds some information about an element's subentity involved in a coupling. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/extractors/extractor.hh>

│ │ │ │ +

#include <dune/grid-glue/extractors/extractor.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -277,15 +277,15 @@ │ │ │ │
│ │ │ │ │ │ │ │

the index of the parent element (from index set)

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01062.html │ │ │ │ @@ -70,15 +70,15 @@ │ │ │ │ Public Member Functions | │ │ │ │ Protected Member Functions | │ │ │ │ List of all members │ │ │ │
Dune::GridGlue::VtkSurfaceWriter Class Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/extractors/vtksurfacewriter.hh>

│ │ │ │ +

#include <dune/grid-glue/extractors/vtksurfacewriter.hh>

│ │ │ │

│ │ │ │ Public Member Functions

 SubEntityInfo ()
 
 SubEntityInfo (IndexType parent_, unsigned int num_in_parent_, const Dune::GeometryType &geometryType)
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -556,15 +556,15 @@ │ │ │ │ │ │ │ │

│ │ │ │ Public Member Functions

 VtkSurfaceWriter (const char *filename)
 
 ~VtkSurfaceWriter ()
 
│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01066.html │ │ │ │ @@ -71,15 +71,15 @@ │ │ │ │ Static Public Member Functions | │ │ │ │ Static Public Attributes | │ │ │ │ List of all members │ │ │ │
Dune::GridGlue::ComputationMethod< dimWorld, dim1, dim2, T > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/merging/computeintersection.hh>

│ │ │ │ +

#include <dune/grid-glue/merging/computeintersection.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::GridGlue::ComputationMethod< dimWorld, dim1, dim2, T >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -362,15 +362,15 @@ │ │ │ │

│ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01070.html │ │ │ │ @@ -72,15 +72,15 @@ │ │ │ │
Dune::GridGlue::IntersectionComputation< CM > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Intersection computation method for two elements of arbitrary dimension. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/merging/computeintersection.hh>

│ │ │ │ +

#include <dune/grid-glue/merging/computeintersection.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -241,15 +241,15 @@ │ │ │ │

│ │ │ │ Static Public Member Functions

static bool computeIntersection (const std::vector< V > &X, const std::vector< V > &Y, std::vector< std::vector< int > > &SX, std::vector< std::vector< int > > &SY, std::vector< V > &P)
 Compute the intersection of two elements X and Y Compute the intersection of two elements X and Y, where X is of dimension dim1 and Y is of dimension dim2 and return a vector P containing the corner points of the intersection polyhedron. More...
 
template<int isDim, int dW>
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following files: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01074.html │ │ │ │ @@ -78,15 +78,15 @@ │ │ │ │
Dune::GridGlue::ConformingMerge< dim, dimworld, T > Class Template Referenceabstract
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Implementation of the Merger concept for conforming interfaces. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/merging/conformingmerge.hh>

│ │ │ │ +

#include <dune/grid-glue/merging/conformingmerge.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::GridGlue::ConformingMerge< dim, dimworld, T >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -1189,15 +1189,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01078.html │ │ │ │ @@ -77,15 +77,15 @@ │ │ │ │
Dune::GridGlue::ContactMerge< dimworld, T > Class Template Referenceabstract
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Merge two codimension-1 surfaces that may be a positive distance apart. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/merging/contactmerge.hh>

│ │ │ │ +

#include <dune/grid-glue/merging/contactmerge.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::GridGlue::ContactMerge< dimworld, T >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -1757,16 +1757,16 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following files: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01082.html │ │ │ │ @@ -70,15 +70,15 @@ │ │ │ │ Public Types | │ │ │ │ Public Member Functions | │ │ │ │ List of all members │ │ │ │
Dune::GridGlue::IntersectionListProvider< L0, L1 > Class Template Referenceabstract
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/merging/intersectionlist.hh>

│ │ │ │ +

#include <dune/grid-glue/merging/intersectionlist.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::GridGlue::IntersectionListProvider< L0, L1 >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -481,15 +481,15 @@ │ │ │ │

number of intersections in the merged grid

│ │ │ │ │ │ │ │

Implemented in Dune::GridGlue::SimplicialIntersectionListProvider< dim0, dim1 >.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01098.html │ │ │ │ @@ -70,15 +70,15 @@ │ │ │ │ Public Types | │ │ │ │ Public Member Functions | │ │ │ │ List of all members │ │ │ │
Dune::GridGlue::IntersectionList< Local0, Local1 > Class Template Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/merging/intersectionlist.hh>

│ │ │ │ +

#include <dune/grid-glue/merging/intersectionlist.hh>

│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -354,15 +354,15 @@ │ │ │ │

│ │ │ │ Public Types

using Provider = IntersectionListProvider< Local0, Local1 >
 
using Index = typename Provider::Index
 
│ │ │ │
│ │ │ │

number of intersections in the merged grid

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01102.html │ │ │ │ @@ -71,15 +71,15 @@ │ │ │ │ Public Types | │ │ │ │ Public Member Functions | │ │ │ │ List of all members │ │ │ │
Dune::GridGlue::SimplicialIntersectionListProvider< dim0, dim1 > Class Template Referencefinal
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/merging/intersectionlist.hh>

│ │ │ │ +

#include <dune/grid-glue/merging/intersectionlist.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::GridGlue::SimplicialIntersectionListProvider< dim0, dim1 >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -624,15 +624,15 @@ │ │ │ │

number of intersections in the merged grid

│ │ │ │ │ │ │ │

Implements Dune::GridGlue::IntersectionListProvider< FieldVector< double, dim0 >, FieldVector< double, dim1 > >.

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01106.html │ │ │ │ @@ -71,15 +71,15 @@ │ │ │ │ Public Member Functions | │ │ │ │ Public Attributes | │ │ │ │ List of all members │ │ │ │
Dune::GridGlue::SimplicialIntersectionListProvider< dim0, dim1 >::SimplicialIntersection Struct Reference
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/merging/intersectionlist.hh>

│ │ │ │ +

#include <dune/grid-glue/merging/intersectionlist.hh>

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

│ │ │ │ Public Types

template<int I>
using Corners = std::array< Local< I >, nVertices >
 
│ │ │ │ @@ -256,15 +256,15 @@ │ │ │ │
│ │ │ │
│ │ │ │

list of parent entities for embeddings into the second grid

│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this struct was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01110.html │ │ │ │ @@ -74,15 +74,15 @@ │ │ │ │
Dune::GridGlue::Merger< ctype, grid1Dim, grid2Dim, dimworld > Class Template Referenceabstract
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Abstract base for all classes that take extracted grids and build sets of intersections. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/merging/merger.hh>

│ │ │ │ +

#include <dune/grid-glue/merging/merger.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::GridGlue::Merger< ctype, grid1Dim, grid2Dim, dimworld >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -557,15 +557,15 @@ │ │ │ │ │ │ │ │

Counts the number of times the computeIntersection method has been called.

│ │ │ │

Used temporarily to speed up the implementation

│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01114.html │ │ │ │ @@ -77,15 +77,15 @@ │ │ │ │
Dune::GridGlue::OverlappingMerge< dim1, dim2, dimworld, T > Class Template Referenceabstract
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Computing overlapping grid intersections for grids of different dimensions. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/merging/overlappingmerge.hh>

│ │ │ │ +

#include <dune/grid-glue/merging/overlappingmerge.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::GridGlue::OverlappingMerge< dim1, dim2, dimworld, T >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -1262,15 +1262,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following files: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01118.html │ │ │ │ @@ -484,15 +484,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01122.html │ │ │ │ @@ -484,15 +484,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01126.html │ │ │ │ @@ -484,15 +484,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01130.html │ │ │ │ @@ -484,15 +484,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01134.html │ │ │ │ @@ -484,15 +484,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01138.html │ │ │ │ @@ -484,15 +484,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01142.html │ │ │ │ @@ -484,15 +484,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01146.html │ │ │ │ @@ -484,15 +484,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01150.html │ │ │ │ @@ -484,15 +484,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01154.html │ │ │ │ @@ -484,15 +484,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01158.html │ │ │ │ @@ -484,15 +484,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/a01162.html │ │ │ │ @@ -77,15 +77,15 @@ │ │ │ │
Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld > Class Template Referenceabstract
│ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │

Common base class for many merger implementations: produce pairs of entities that may intersect. │ │ │ │ More...

│ │ │ │ │ │ │ │ -

#include <dune/grid-glue/merging/standardmerge.hh>

│ │ │ │ +

#include <dune/grid-glue/merging/standardmerge.hh>

│ │ │ │
│ │ │ │ Inheritance diagram for Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >:
│ │ │ │
│ │ │ │
Inheritance graph
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -1136,15 +1136,15 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │
│ │ │ │
The documentation for this class was generated from the following file: │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_000000_000001.html │ │ │ │ @@ -62,14 +62,14 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -

adapter → common Relation

File in dune/grid-glue/adapterIncludes file in dune/grid-glue/common
gridglue.ccringcomm.hh
│ │ │ │ +

adapter → common Relation

File in dune/grid-glue/adapterIncludes file in dune/grid-glue/common
gridglue.ccringcomm.hh
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_000003_000000.html │ │ │ │ @@ -62,14 +62,14 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -

extractors → adapter Relation

File in dune/grid-glue/extractorsIncludes file in dune/grid-glue/adapter
vtksurfacewriter.hhgridgluevtkwriter.hh
│ │ │ │ +

extractors → adapter Relation

File in dune/grid-glue/extractorsIncludes file in dune/grid-glue/adapter
vtksurfacewriter.hhgridgluevtkwriter.hh
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_000003_000001.html │ │ │ │ @@ -62,14 +62,14 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -

extractors → common Relation

File in dune/grid-glue/extractorsIncludes file in dune/grid-glue/common
codim1extractor.hhcrossproduct.hh
│ │ │ │ +

extractors → common Relation

File in dune/grid-glue/extractorsIncludes file in dune/grid-glue/common
codim1extractor.hhcrossproduct.hh
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_000004_000000.html │ │ │ │ @@ -62,14 +62,14 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ +

grid-glue → adapter Relation

File in dune/grid-glueIncludes file in dune/grid-glue/adapter
gridglue.hhgridglue.cc
gridglue.hhgridgluecommunicate.hh
gridglue.hhintersection.hh
gridglue.hhintersectionindexset.hh
gridglue.hhintersectioniterator.hh
gridglue.hhrangegenerators.hh
extractors / vtksurfacewriter.hhgridgluevtkwriter.hh
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_000004_000005.html │ │ │ │ @@ -62,14 +62,14 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -

grid-glue → merging Relation

File in dune/grid-glueIncludes file in dune/grid-glue/merging
gridglue.hhmerger.hh
│ │ │ │ +

grid-glue → merging Relation

File in dune/grid-glueIncludes file in dune/grid-glue/merging
gridglue.hhmerger.hh
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_000005_000001.html │ │ │ │ @@ -62,14 +62,14 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ -

merging → common Relation

File in dune/grid-glue/mergingIncludes file in dune/grid-glue/common
contactmerge.cccrossproduct.hh
contactmerge.ccprojection.hh
│ │ │ │ +

merging → common Relation

File in dune/grid-glue/mergingIncludes file in dune/grid-glue/common
contactmerge.cccrossproduct.hh
contactmerge.ccprojection.hh
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_0d8f660a135565b225f6b14e80c278b4.html │ │ │ │ @@ -81,38 +81,38 @@ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Files

file  computeintersection.cc
 
file  computeintersection.hh [code]
file  computeintersection.hh [code]
 
file  conformingmerge.hh [code]
 Implementation of the Merger concept for conforming interfaces.
file  conformingmerge.hh [code]
 Implementation of the Merger concept for conforming interfaces.
 
file  contactmerge.cc
file  contactmerge.cc
 
file  contactmerge.hh [code]
 Merge two grid boundary surfaces that may be a positive distance apart.
file  contactmerge.hh [code]
 Merge two grid boundary surfaces that may be a positive distance apart.
 
file  intersectionlist.hh [code]
file  intersectionlist.hh [code]
 
file  merger.hh [code]
file  merger.hh [code]
 
file  overlappingmerge.cc
 
file  overlappingmerge.hh [code]
file  overlappingmerge.hh [code]
 
file  simplexintersection.cc
file  simplexintersection.cc
 
file  standardmerge.cc
file  standardmerge.cc
 
file  standardmerge.hh [code]
 Common base class for many merger implementations: produce pairs of entities that may intersect.
file  standardmerge.hh [code]
 Common base class for many merger implementations: produce pairs of entities that may intersect.
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_1b444a177590012656060e8a0bca20fc.html │ │ │ │ @@ -79,36 +79,36 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Files

file  gridglue.cc
file  gridglue.cc
 
file  adapter/gridglue.hh [code]
 
file  gridglueamirawriter.hh [code]
 Write all remote intersections to a AmiraMesh file.
file  gridglueamirawriter.hh [code]
 Write all remote intersections to a AmiraMesh file.
 
file  gridgluecommunicate.hh [code]
 Describes the parallel communication interface class for Dune::GridGlue.
file  gridgluecommunicate.hh [code]
 Describes the parallel communication interface class for Dune::GridGlue.
 
file  gridgluevtkwriter.hh [code]
 Write all remote intersections to a vtk file for debugging.
file  gridgluevtkwriter.hh [code]
 Write all remote intersections to a vtk file for debugging.
 
file  intersection.hh [code]
 Model of the Intersection concept provided by GridGlue.
file  intersection.hh [code]
 Model of the Intersection concept provided by GridGlue.
 
file  intersectionindexset.hh [code]
file  intersectionindexset.hh [code]
 
file  intersectioniterator.hh [code]
 Implement iterators over GridGlue intersections.
 
file  rangegenerators.hh [code]
file  rangegenerators.hh [code]
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_65f347cff0208f20f00d27c542208238.html │ │ │ │ @@ -77,29 +77,29 @@ │ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │

│ │ │ │ Files

file  areawriter.hh [code]
file  areawriter.hh [code]
 
file  areawriter_impl.hh [code]
file  areawriter_impl.hh [code]
 
file  crossproduct.hh [code]
file  crossproduct.hh [code]
 
file  projection.hh [code]
file  projection.hh [code]
 
file  projection_impl.hh [code]
 
file  projectionwriter.hh [code]
file  projectionwriter.hh [code]
 
file  projectionwriter_impl.hh [code]
file  projectionwriter_impl.hh [code]
 
file  ringcomm.hh [code]
file  ringcomm.hh [code]
 
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_eaad0bdad6fc03850e65b1fdad9faad4.html │ │ │ │ @@ -87,19 +87,19 @@ │ │ │ │ Files │ │ │ │ file  codim0extractor.hh [code] │ │ │ │  Mesh grid extractor base class.
│ │ │ │   │ │ │ │ file  codim1extractor.hh [code] │ │ │ │  Grid extractor class for codim 1 subgrids.
│ │ │ │   │ │ │ │ -file  extractor.hh [code] │ │ │ │ - extractor base class
│ │ │ │ +file  extractor.hh [code] │ │ │ │ + extractor base class
│ │ │ │   │ │ │ │ -file  vtksurfacewriter.hh [code] │ │ │ │ - helper class for graphical output of grids in generic representation
│ │ │ │ +file  vtksurfacewriter.hh [code] │ │ │ │ + helper class for graphical output of grids in generic representation
│ │ │ │   │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/dune-grid-glue.tag.gz │ │ │ │ ├── dune-grid-glue.tag │ │ │ │ │ ├── dune-grid-glue.tag │ │ │ │ │ │ @@ -1,38 +1,38 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ gridglue.cc │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/adapter/ │ │ │ │ │ │ - a00005.html │ │ │ │ │ │ - intersection.hh │ │ │ │ │ │ + a00008.html │ │ │ │ │ │ + intersection.hh │ │ │ │ │ │ ../gridglue.hh │ │ │ │ │ │ - ../common/ringcomm.hh │ │ │ │ │ │ + ../common/ringcomm.hh │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ │ │ │ │ │ │ void │ │ │ │ │ │ printVector │ │ │ │ │ │ a00104.html │ │ │ │ │ │ ac943b51eb586602f1cfd101f30562e10 │ │ │ │ │ │ (const std::vector< T > &v, std::string name, int rank) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ gridglueamirawriter.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/adapter/ │ │ │ │ │ │ - a00023.html │ │ │ │ │ │ + a00026.html │ │ │ │ │ │ Dune::GridGlue::GridGlueAmiraWriter │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ gridgluecommunicate.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/adapter/ │ │ │ │ │ │ - a00020.html │ │ │ │ │ │ + a00017.html │ │ │ │ │ │ Dune::GridGlue::GlobalId │ │ │ │ │ │ Dune::GridGlue::CommDataHandle │ │ │ │ │ │ Dune::GridGlue::StreamingMessageBuffer │ │ │ │ │ │ Dune::GridGlue::CommunicationOperator │ │ │ │ │ │ Dune::GridGlue::CommInfo │ │ │ │ │ │ Dune::CommPolicy< ::Dune::GridGlue::CommInfo< GG, DataHandleImp, DataTypeImp > > │ │ │ │ │ │ Dune │ │ │ │ │ │ @@ -65,44 +65,44 @@ │ │ │ │ │ │ ae6bb46e80d5b6cbe71801fce426c311b │ │ │ │ │ │ (std::ostream &os, const GlobalId &id) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ gridgluevtkwriter.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/adapter/ │ │ │ │ │ │ - a00008.html │ │ │ │ │ │ + a00020.html │ │ │ │ │ │ dune/grid-glue/gridglue.hh │ │ │ │ │ │ Dune::GridGlue::GridGlueVtkWriter │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ intersection.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/adapter/ │ │ │ │ │ │ - a00017.html │ │ │ │ │ │ + a00014.html │ │ │ │ │ │ dune/grid-glue/gridglue.hh │ │ │ │ │ │ Dune::GridGlue::IntersectionData │ │ │ │ │ │ Dune::GridGlue::IntersectionTraits │ │ │ │ │ │ Dune::GridGlue::Intersection │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ │ │ │ │ │ │ #define │ │ │ │ │ │ ONLY_SIMPLEX_INTERSECTIONS │ │ │ │ │ │ - a00017.html │ │ │ │ │ │ + a00014.html │ │ │ │ │ │ aac752eae6e9ad7d1e576f1fe3f7c8a6b │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ intersectionindexset.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/adapter/ │ │ │ │ │ │ - a00014.html │ │ │ │ │ │ + a00023.html │ │ │ │ │ │ dune/grid-glue/gridglue.hh │ │ │ │ │ │ - dune/grid-glue/adapter/intersection.hh │ │ │ │ │ │ + dune/grid-glue/adapter/intersection.hh │ │ │ │ │ │ Dune::GridGlue::IntersectionIndexSet │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ intersectioniterator.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/adapter/ │ │ │ │ │ │ @@ -111,31 +111,31 @@ │ │ │ │ │ │ Dune::GridGlue::IntersectionIterator │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ rangegenerators.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/adapter/ │ │ │ │ │ │ - a00026.html │ │ │ │ │ │ + a00005.html │ │ │ │ │ │ Dune::GridGlue::Reverse │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ │ │ │ │ │ │ IteratorRange<... > │ │ │ │ │ │ intersections │ │ │ │ │ │ a00104.html │ │ │ │ │ │ ac6a31e555010d279de506e730906a26e │ │ │ │ │ │ (const GridGlue<... > &glue, const Reverse<... > &reverse=!reversed) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ areawriter.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/common/ │ │ │ │ │ │ - a00050.html │ │ │ │ │ │ - areawriter_impl.hh │ │ │ │ │ │ + a00029.html │ │ │ │ │ │ + areawriter_impl.hh │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ │ │ │ │ │ │ void │ │ │ │ │ │ write_glue_area_vtk │ │ │ │ │ │ a00104.html │ │ │ │ │ │ a16ccdbde4466d3073eab2a0f25d78f4e │ │ │ │ │ │ @@ -155,15 +155,15 @@ │ │ │ │ │ │ ab4463688255524d5d7433ae6af851884 │ │ │ │ │ │ (const Glue &glue, const std::string &base) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ areawriter_impl.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/common/ │ │ │ │ │ │ - a00029.html │ │ │ │ │ │ + a00050.html │ │ │ │ │ │ Dune::GridGlue::AreaWriterImplementation::FacetLayout │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ Dune::GridGlue::AreaWriterImplementation │ │ │ │ │ │ │ │ │ │ │ │ void │ │ │ │ │ │ write_facet_geometry │ │ │ │ │ │ @@ -192,29 +192,29 @@ │ │ │ │ │ │ ab4463688255524d5d7433ae6af851884 │ │ │ │ │ │ (const Glue &glue, const std::string &base) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ crossproduct.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/common/ │ │ │ │ │ │ - a00035.html │ │ │ │ │ │ + a00047.html │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ │ │ │ │ │ │ static Dune::FieldVector< T, dim > │ │ │ │ │ │ crossProduct │ │ │ │ │ │ a00104.html │ │ │ │ │ │ acbf555ac0358f96454a5f22dd4ac4de2 │ │ │ │ │ │ (const Dune::FieldVector< T, dim > &a, const Dune::FieldVector< T, dim > &b) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ projection.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/common/ │ │ │ │ │ │ - a00044.html │ │ │ │ │ │ + a00032.html │ │ │ │ │ │ projection_impl.hh │ │ │ │ │ │ Dune::GridGlue::Projection │ │ │ │ │ │ Dune::GridGlue::Projection::EdgeIntersection │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ @@ -259,17 +259,17 @@ │ │ │ │ │ │ a870cd1d1b2cb9d977ceab3032db9dca6 │ │ │ │ │ │ (const Coordinate &x, const Field &epsilon) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ projectionwriter.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/common/ │ │ │ │ │ │ - a00038.html │ │ │ │ │ │ - dune/grid-glue/common/projection.hh │ │ │ │ │ │ - projectionwriter_impl.hh │ │ │ │ │ │ + a00035.html │ │ │ │ │ │ + dune/grid-glue/common/projection.hh │ │ │ │ │ │ + projectionwriter_impl.hh │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ │ │ │ │ │ │ void │ │ │ │ │ │ write │ │ │ │ │ │ a00104.html │ │ │ │ │ │ a4dcc05f4b64a511b2e9548e371e140a7 │ │ │ │ │ │ @@ -289,15 +289,15 @@ │ │ │ │ │ │ ace9cbed627c90927e36d71a65a5498a3 │ │ │ │ │ │ (const Projection< Coordinate > &projection, const Corners &corners, const Normals &normals) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ projectionwriter_impl.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/common/ │ │ │ │ │ │ - a00032.html │ │ │ │ │ │ + a00044.html │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ Dune::GridGlue::ProjectionWriterImplementation │ │ │ │ │ │ │ │ │ │ │ │ void │ │ │ │ │ │ write_points │ │ │ │ │ │ a00107.html │ │ │ │ │ │ @@ -353,21 +353,21 @@ │ │ │ │ │ │ ace9cbed627c90927e36d71a65a5498a3 │ │ │ │ │ │ (const Projection< Coordinate > &projection, const Corners &corners, const Normals &normals) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ringcomm.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/common/ │ │ │ │ │ │ - a00047.html │ │ │ │ │ │ + a00038.html │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::Parallel │ │ │ │ │ │ │ │ │ │ │ │ #define │ │ │ │ │ │ CheckMPIStatus │ │ │ │ │ │ - a00047.html │ │ │ │ │ │ + a00038.html │ │ │ │ │ │ a1a95f4074572a7a9e13bcb072afef070 │ │ │ │ │ │ (A, B) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ void │ │ │ │ │ │ MPI_AllApply │ │ │ │ │ │ a00108.html │ │ │ │ │ │ @@ -375,84 +375,84 @@ │ │ │ │ │ │ (MPI_Comm mpicomm, OP &&op, const Args &... data) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ codim0extractor.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/extractors/ │ │ │ │ │ │ a00056.html │ │ │ │ │ │ - extractor.hh │ │ │ │ │ │ + extractor.hh │ │ │ │ │ │ Dune::GridGlue::Codim0Extractor │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ codim1extractor.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/extractors/ │ │ │ │ │ │ a00062.html │ │ │ │ │ │ - extractor.hh │ │ │ │ │ │ - dune/grid-glue/common/crossproduct.hh │ │ │ │ │ │ + extractor.hh │ │ │ │ │ │ + dune/grid-glue/common/crossproduct.hh │ │ │ │ │ │ Dune::GridGlue::Codim1Extractor │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ extractor.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/extractors/ │ │ │ │ │ │ - a00053.html │ │ │ │ │ │ + a00059.html │ │ │ │ │ │ Dune::GridGlue::Extractor │ │ │ │ │ │ Dune::GridGlue::Extractor::CornerInfo │ │ │ │ │ │ Dune::GridGlue::Extractor::CoordinateInfo │ │ │ │ │ │ Dune::GridGlue::Extractor::VertexInfo │ │ │ │ │ │ Dune::GridGlue::Extractor::ElementInfo │ │ │ │ │ │ Dune::GridGlue::Extractor::SubEntityInfo │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ vtksurfacewriter.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/extractors/ │ │ │ │ │ │ - a00059.html │ │ │ │ │ │ - ../adapter/gridgluevtkwriter.hh │ │ │ │ │ │ + a00053.html │ │ │ │ │ │ + ../adapter/gridgluevtkwriter.hh │ │ │ │ │ │ Dune::GridGlue::VtkSurfaceWriter │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ adapter/gridglue.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/adapter/ │ │ │ │ │ │ a01963.html │ │ │ │ │ │ dune/grid-glue/gridglue.hh │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ gridglue.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/ │ │ │ │ │ │ a00002.html │ │ │ │ │ │ - adapter/gridgluecommunicate.hh │ │ │ │ │ │ - dune/grid-glue/merging/merger.hh │ │ │ │ │ │ - adapter/rangegenerators.hh │ │ │ │ │ │ - adapter/gridglue.cc │ │ │ │ │ │ - adapter/intersection.hh │ │ │ │ │ │ + adapter/gridgluecommunicate.hh │ │ │ │ │ │ + dune/grid-glue/merging/merger.hh │ │ │ │ │ │ + adapter/rangegenerators.hh │ │ │ │ │ │ + adapter/gridglue.cc │ │ │ │ │ │ + adapter/intersection.hh │ │ │ │ │ │ adapter/intersectioniterator.hh │ │ │ │ │ │ - adapter/intersectionindexset.hh │ │ │ │ │ │ + adapter/intersectionindexset.hh │ │ │ │ │ │ Dune::GridGlue::GridGlue │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ computeintersection.cc │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/merging/ │ │ │ │ │ │ a00092.html │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ computeintersection.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/merging/ │ │ │ │ │ │ - a00089.html │ │ │ │ │ │ - simplexintersection.cc │ │ │ │ │ │ + a00086.html │ │ │ │ │ │ + simplexintersection.cc │ │ │ │ │ │ computeintersection.cc │ │ │ │ │ │ Dune::GridGlue::ComputationMethod │ │ │ │ │ │ Dune::GridGlue::IntersectionComputation │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ │ │ │ │ │ │ int │ │ │ │ │ │ @@ -461,56 +461,56 @@ │ │ │ │ │ │ a273266aab32afadee15bb5fcf71aa4ca │ │ │ │ │ │ (const V p, std::vector< V > &P) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ conformingmerge.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/merging/ │ │ │ │ │ │ - a00095.html │ │ │ │ │ │ - dune/grid-glue/merging/standardmerge.hh │ │ │ │ │ │ + a00068.html │ │ │ │ │ │ + dune/grid-glue/merging/standardmerge.hh │ │ │ │ │ │ Dune::GridGlue::ConformingMerge │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ contactmerge.cc │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/merging/ │ │ │ │ │ │ - a00098.html │ │ │ │ │ │ - dune/grid-glue/common/crossproduct.hh │ │ │ │ │ │ - dune/grid-glue/common/projection.hh │ │ │ │ │ │ + a00074.html │ │ │ │ │ │ + dune/grid-glue/common/crossproduct.hh │ │ │ │ │ │ + dune/grid-glue/common/projection.hh │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ contactmerge.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/merging/ │ │ │ │ │ │ - a00071.html │ │ │ │ │ │ - dune/grid-glue/merging/standardmerge.hh │ │ │ │ │ │ + a00089.html │ │ │ │ │ │ + dune/grid-glue/merging/standardmerge.hh │ │ │ │ │ │ dune/grid-glue/gridglue.hh │ │ │ │ │ │ - contactmerge.cc │ │ │ │ │ │ + contactmerge.cc │ │ │ │ │ │ Dune::GridGlue::ContactMerge │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ intersectionlist.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/merging/ │ │ │ │ │ │ - a00068.html │ │ │ │ │ │ + a00098.html │ │ │ │ │ │ Dune::GridGlue::IntersectionListProvider │ │ │ │ │ │ Dune::GridGlue::IntersectionList │ │ │ │ │ │ Dune::GridGlue::SimplicialIntersectionListProvider │ │ │ │ │ │ Dune::GridGlue::SimplicialIntersectionListProvider::SimplicialIntersection │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ merger.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/merging/ │ │ │ │ │ │ - a00065.html │ │ │ │ │ │ - dune/grid-glue/merging/intersectionlist.hh │ │ │ │ │ │ + a00077.html │ │ │ │ │ │ + dune/grid-glue/merging/intersectionlist.hh │ │ │ │ │ │ Dune::GridGlue::Merger │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ overlappingmerge.cc │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/merging/ │ │ │ │ │ │ @@ -524,26 +524,26 @@ │ │ │ │ │ │ ad63267c6d27a8f09d98506419b206db8 │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ overlappingmerge.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/merging/ │ │ │ │ │ │ - a00083.html │ │ │ │ │ │ - dune/grid-glue/merging/standardmerge.hh │ │ │ │ │ │ - dune/grid-glue/merging/computeintersection.hh │ │ │ │ │ │ + a00071.html │ │ │ │ │ │ + dune/grid-glue/merging/standardmerge.hh │ │ │ │ │ │ + dune/grid-glue/merging/computeintersection.hh │ │ │ │ │ │ overlappingmerge.cc │ │ │ │ │ │ Dune::GridGlue::OverlappingMerge │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ simplexintersection.cc │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/merging/ │ │ │ │ │ │ - a00086.html │ │ │ │ │ │ + a00083.html │ │ │ │ │ │ Dune::GridGlue::SimplexMethod │ │ │ │ │ │ Dune::GridGlue::SimplexMethod< dimWorld, 0, 0, T > │ │ │ │ │ │ Dune::GridGlue::SimplexMethod< dimWorld, 0, 1, T > │ │ │ │ │ │ Dune::GridGlue::SimplexMethod< dimWorld, 0, 2, T > │ │ │ │ │ │ Dune::GridGlue::SimplexMethod< dimWorld, 0, 3, T > │ │ │ │ │ │ Dune::GridGlue::SimplexMethod< dimWorld, 1, 1, T > │ │ │ │ │ │ Dune::GridGlue::SimplexMethod< dimWorld, 1, 2, T > │ │ │ │ │ │ @@ -581,29 +581,29 @@ │ │ │ │ │ │ a697e604ca453c314141e6b4c5efe3eab │ │ │ │ │ │ (std::integral_constant< int, 3 >, const std::vector< Dune::FieldVector< T, dimworld > > &elementCorners, std::vector< std::vector< unsigned int > > &subElements, std::vector< std::vector< int > > &faceIds) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ standardmerge.cc │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/merging/ │ │ │ │ │ │ - a00074.html │ │ │ │ │ │ - standardmerge.hh │ │ │ │ │ │ + a00065.html │ │ │ │ │ │ + standardmerge.hh │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ │ │ │ │ │ │ #define │ │ │ │ │ │ DECL │ │ │ │ │ │ - a00074.html │ │ │ │ │ │ + a00065.html │ │ │ │ │ │ ad5c7ca0181fea7823b37d06d5f61e9cd │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ #define │ │ │ │ │ │ STANDARD_MERGE_INSTANTIATE │ │ │ │ │ │ - a00074.html │ │ │ │ │ │ + a00065.html │ │ │ │ │ │ a4a2b0f7fb92723749fc6d5cca82a4297 │ │ │ │ │ │ (T, A, B, C) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ STANDARD_MERGE_INSTANTIATE │ │ │ │ │ │ a00104.html │ │ │ │ │ │ @@ -624,32 +624,32 @@ │ │ │ │ │ │ aa1057477f7967001ea15f5928e90f84c │ │ │ │ │ │ (double, 3, 3, 3) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ standardmerge.hh │ │ │ │ │ │ /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/merging/ │ │ │ │ │ │ - a00077.html │ │ │ │ │ │ - dune/grid-glue/merging/intersectionlist.hh │ │ │ │ │ │ - dune/grid-glue/merging/merger.hh │ │ │ │ │ │ - dune/grid-glue/merging/computeintersection.hh │ │ │ │ │ │ + a00095.html │ │ │ │ │ │ + dune/grid-glue/merging/intersectionlist.hh │ │ │ │ │ │ + dune/grid-glue/merging/merger.hh │ │ │ │ │ │ + dune/grid-glue/merging/computeintersection.hh │ │ │ │ │ │ Dune::GridGlue::StandardMerge │ │ │ │ │ │ Dune │ │ │ │ │ │ Dune::GridGlue │ │ │ │ │ │ │ │ │ │ │ │ #define │ │ │ │ │ │ DECL │ │ │ │ │ │ - a00077.html │ │ │ │ │ │ + a00095.html │ │ │ │ │ │ ad5c7ca0181fea7823b37d06d5f61e9cd │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ #define │ │ │ │ │ │ STANDARD_MERGE_INSTANTIATE │ │ │ │ │ │ - a00077.html │ │ │ │ │ │ + a00095.html │ │ │ │ │ │ a4a2b0f7fb92723749fc6d5cca82a4297 │ │ │ │ │ │ (T, A, B, C) │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ STANDARD_MERGE_INSTANTIATE │ │ │ │ │ │ a00104.html │ │ │ ├── ./usr/share/doc/libdune-grid-glue-doc/doxygen/files.html │ │ │ │ @@ -66,50 +66,50 @@ │ │ │ │ │ │ │ │
│ │ │ │
Here is a list of all files with brief descriptions:
│ │ │ │
[detail level 1234]
│ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ - │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ + │ │ │ │ │ │ │ │
  dune
  grid-glue
  adapter
 gridglue.cc
 gridglue.cc
 adapter/gridglue.hh
 gridglueamirawriter.hhWrite all remote intersections to a AmiraMesh file
 gridgluecommunicate.hhDescribes the parallel communication interface class for Dune::GridGlue
 gridgluevtkwriter.hhWrite all remote intersections to a vtk file for debugging
 intersection.hhModel of the Intersection concept provided by GridGlue
 intersectionindexset.hh
 gridglueamirawriter.hhWrite all remote intersections to a AmiraMesh file
 gridgluecommunicate.hhDescribes the parallel communication interface class for Dune::GridGlue
 gridgluevtkwriter.hhWrite all remote intersections to a vtk file for debugging
 intersection.hhModel of the Intersection concept provided by GridGlue
 intersectionindexset.hh
 intersectioniterator.hhImplement iterators over GridGlue intersections
 rangegenerators.hh
 rangegenerators.hh
  common
 areawriter.hh
 areawriter_impl.hh
 crossproduct.hh
 projection.hh
 areawriter.hh
 areawriter_impl.hh
 crossproduct.hh
 projection.hh
 projection_impl.hh
 projectionwriter.hh
 projectionwriter_impl.hh
 ringcomm.hh
 projectionwriter.hh
 projectionwriter_impl.hh
 ringcomm.hh
  extractors
 codim0extractor.hhMesh grid extractor base class
 codim1extractor.hhGrid extractor class for codim 1 subgrids
 extractor.hhExtractor base class
 vtksurfacewriter.hhHelper class for graphical output of grids in generic representation
 extractor.hhExtractor base class
 vtksurfacewriter.hhHelper class for graphical output of grids in generic representation
  merging
 computeintersection.cc
 computeintersection.hh
 conformingmerge.hhImplementation of the Merger concept for conforming interfaces
 contactmerge.cc
 contactmerge.hhMerge two grid boundary surfaces that may be a positive distance apart
 intersectionlist.hh
 merger.hh
 computeintersection.hh
 conformingmerge.hhImplementation of the Merger concept for conforming interfaces
 contactmerge.cc
 contactmerge.hhMerge two grid boundary surfaces that may be a positive distance apart
 intersectionlist.hh
 merger.hh
 overlappingmerge.cc
 overlappingmerge.hh
 simplexintersection.cc
 standardmerge.cc
 standardmerge.hhCommon base class for many merger implementations: produce pairs of entities that may intersect
 overlappingmerge.hh
 simplexintersection.cc
 standardmerge.cc
 standardmerge.hhCommon base class for many merger implementations: produce pairs of entities that may intersect
 gridglue.hhCentral component of the module implementing the coupling of two grids
│ │ │ │
│ │ │ │
│ │ │ │ │ │ │ │