{"diffoscope-json-version": 1, "source1": "/srv/reproducible-results/rbuild-debian/r-b-build.yvOIOubo/b1/dune-grid-glue_2.9.0-3_i386.changes", "source2": "/srv/reproducible-results/rbuild-debian/r-b-build.yvOIOubo/b2/dune-grid-glue_2.9.0-3_i386.changes", "unified_diff": null, "details": [{"source1": "Files", "source2": "Files", "unified_diff": "@@ -1,4 +1,4 @@\n \n 8eb8933d43c65d6e39b4a0963f0d38ee 882488 debug optional libdune-grid-glue-dev-dbgsym_2.9.0-3_i386.deb\n 4914c3a299201ca850d147e763eecb2e 109232 libdevel optional libdune-grid-glue-dev_2.9.0-3_i386.deb\n- 7af0d6928c26806f52edb112ff65cf23 772948 doc optional libdune-grid-glue-doc_2.9.0-3_all.deb\n+ 4422cb4ad50a2cf20423b708fe0c94e5 773008 doc optional libdune-grid-glue-doc_2.9.0-3_all.deb\n"}, {"source1": "libdune-grid-glue-doc_2.9.0-3_all.deb", "source2": "libdune-grid-glue-doc_2.9.0-3_all.deb", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -1,3 +1,3 @@\n -rw-r--r-- 0 0 0 4 2023-01-13 13:23:40.000000 debian-binary\n--rw-r--r-- 0 0 0 7220 2023-01-13 13:23:40.000000 control.tar.xz\n--rw-r--r-- 0 0 0 765536 2023-01-13 13:23:40.000000 data.tar.xz\n+-rw-r--r-- 0 0 0 7224 2023-01-13 13:23:40.000000 control.tar.xz\n+-rw-r--r-- 0 0 0 765592 2023-01-13 13:23:40.000000 data.tar.xz\n"}, {"source1": "control.tar.xz", "source2": "control.tar.xz", "unified_diff": null, "details": [{"source1": "control.tar", "source2": "control.tar", "unified_diff": null, "details": [{"source1": "./md5sums", "source2": "./md5sums", "unified_diff": null, "details": [{"source1": "./md5sums", "source2": "./md5sums", "comments": ["Files differ"], "unified_diff": null}, {"source1": "line order", "source2": "line order", "unified_diff": "@@ -1,15 +1,15 @@\n usr/share/doc/libdune-grid-glue-doc/changelog.Debian.gz\n usr/share/doc/libdune-grid-glue-doc/changelog.gz\n usr/share/doc/libdune-grid-glue-doc/copyright\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00002.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00002_source.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00005.html\n+usr/share/doc/libdune-grid-glue-doc/doxygen/a00005_source.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00008.html\n-usr/share/doc/libdune-grid-glue-doc/doxygen/a00008_source.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00011.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00011_source.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00014.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00014_source.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00017.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00017_source.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00020.html\n@@ -39,32 +39,32 @@\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00056.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00056_source.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00059.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00059_source.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00062.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00062_source.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00065.html\n-usr/share/doc/libdune-grid-glue-doc/doxygen/a00065_source.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00068.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00068_source.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00071.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00071_source.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00074.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00077.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00077_source.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00080.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00083.html\n-usr/share/doc/libdune-grid-glue-doc/doxygen/a00083_source.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00086.html\n+usr/share/doc/libdune-grid-glue-doc/doxygen/a00086_source.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00089.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00089_source.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00092.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00095.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00095_source.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00098.html\n+usr/share/doc/libdune-grid-glue-doc/doxygen/a00098_source.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00101.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00103.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00104.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00105.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00106.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00107.html\n usr/share/doc/libdune-grid-glue-doc/doxygen/a00108.html\n"}]}]}]}, {"source1": "data.tar.xz", "source2": "data.tar.xz", "unified_diff": null, "details": [{"source1": "data.tar", "source2": "data.tar", "unified_diff": null, "details": [{"source1": "file list", "source2": "file list", "unified_diff": "@@ -5,72 +5,72 @@\n drwxr-xr-x 0 root (0) root (0) 0 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/\n -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\n -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\n -rw-r--r-- 0 root (0) root (0) 2569 2023-01-12 15:07:38.000000 ./usr/share/doc/libdune-grid-glue-doc/copyright\n drwxr-xr-x 0 root (0) root (0) 0 2023-01-13 13:23:40.000000 ./usr/share/doc/libdune-grid-glue-doc/doxygen/\n -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\n -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\n--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\n--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\n--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\n+-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\n+-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\n+-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\n -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\n -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\n--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\n--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\n--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\n--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\n--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\n--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\n--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\n--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\n--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\n--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\n--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\n--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\n--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\n--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\n--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\n--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\n--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\n--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\n+-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\n+-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\n+-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\n+-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\n+-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\n+-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\n+-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\n+-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\n+-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\n+-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\n+-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\n+-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\n+-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\n+-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\n+-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\n+-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\n+-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\n+-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\n -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\n -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\n--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\n--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\n--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\n--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\n--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\n--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\n--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\n--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\n+-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\n+-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\n+-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\n+-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\n+-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\n+-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\n+-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\n+-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\n -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\n -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\n--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\n--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\n+-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\n+-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\n -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\n -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\n--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\n--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\n--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\n--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\n--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\n--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\n--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\n--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\n--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\n+-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\n+-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\n+-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\n+-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\n+-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\n+-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\n+-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\n+-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\n -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\n--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\n--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\n--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\n--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\n--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\n+-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\n+-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\n+-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\n+-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\n+-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\n -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\n--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\n--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\n--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\n+-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\n+-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\n+-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\n+-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\n -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\n -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\n -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\n -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\n -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\n -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\n -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\n@@ -222,15 +222,15 @@\n -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\n -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\n -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\n -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\n -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\n -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\n -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\n--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\n+-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\n -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\n -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\n -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\n -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\n -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\n -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\n -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\n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00002.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00002.html", "unified_diff": "@@ -80,28 +80,28 @@\n #include <type_traits>
\n #include <dune/common/deprecated.hh>
\n #include <dune/common/exceptions.hh>
\n #include <dune/common/iteratorfacades.hh>
\n #include <dune/common/promotiontraits.hh>
\n #include <dune/common/shared_ptr.hh>
\n #include <dune/common/stdstreams.hh>
\n-#include "adapter/gridgluecommunicate.hh"
\n-#include <dune/grid-glue/merging/merger.hh>
\n+#include "adapter/gridgluecommunicate.hh"
\n+#include <dune/grid-glue/merging/merger.hh>
\n #include <dune/common/parallel/mpitraits.hh>
\n #include <dune/common/parallel/mpicommunication.hh>
\n #include <dune/common/parallel/indexset.hh>
\n #include <dune/common/parallel/plocalindex.hh>
\n #include <dune/common/parallel/remoteindices.hh>
\n #include <dune/common/parallel/communicator.hh>
\n #include <dune/common/parallel/interface.hh>
\n-#include "adapter/rangegenerators.hh"
\n-#include "adapter/gridglue.cc"
\n-#include "adapter/intersection.hh"
\n+#include "adapter/rangegenerators.hh"
\n+#include "adapter/gridglue.cc"
\n+#include "adapter/intersection.hh"
\n #include "adapter/intersectioniterator.hh"
\n-#include "adapter/intersectionindexset.hh"
\n+#include "adapter/intersectionindexset.hh"
\n \n

Go to the source code of this file.

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

\n Classes

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

Go to the source code of this file.

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

\n+Classes

struct  Dune::GridGlue::Reverse< reverse >
 
\n \n \n \n \n \n

\n Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
\n \n-\n-\n-\n+\n+\n+\n+\n

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

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

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

Go to the source code of this file.

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

\n-Classes

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

\n Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
\n+\n+\n+\n+\n

\n+Functions

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

Detailed Description

\n-

Write all remote intersections to a vtk file for debugging.

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

Model of the Intersection concept provided by GridGlue. \n+More...

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

Go to the source code of this file.

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

\n Classes

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

\n Namespaces

namespace  Dune
 
namespace  Dune::GridGlue
 
\n+\n+\n+\n

\n+Macros

#define ONLY_SIMPLEX_INTERSECTIONS
 
\n+

Detailed Description

\n+

Model of the Intersection concept provided by GridGlue.

\n+
Author
Christian Engwer
\n+

Macro Definition Documentation

\n+\n+

◆ ONLY_SIMPLEX_INTERSECTIONS

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

    Model of the Intersection concept provided by GridGlue. \n+

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

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

    Go to the source code of this file.

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

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::GridGlue
     
    \n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+

    \n-Macros

    #define ONLY_SIMPLEX_INTERSECTIONS
     

    \n+Typedefs

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

    \n+Functions

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

    Detailed Description

    \n-

    Model of the Intersection concept provided by GridGlue.

    \n+

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

    \n
    Author
    Christian Engwer
    \n-

    Macro Definition Documentation

    \n-\n-

    ◆ ONLY_SIMPLEX_INTERSECTIONS

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

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

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

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

    Go to the source code of this file.

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

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::GridGlue
     
    \n-\n-\n-\n-\n-\n-\n-\n-

    \n-Typedefs

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

    \n-Functions

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

    Detailed Description

    \n-

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

    \n-
    Author
    Christian Engwer
    \n+

    Write all remote intersections to a vtk file for debugging.

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

    Write all remote intersections to a AmiraMesh file. \n-More...

    \n-
    #include <fstream>
    \n-#include <sstream>
    \n-#include <type_traits>
    \n+\n

    Go to the source code of this file.

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

    \n Classes

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::GridGlue
     
    \n-

    Detailed Description

    \n-

    Write all remote intersections to a AmiraMesh file.

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

    Write all remote intersections to a AmiraMesh file. \n+More...

    \n+
    #include <fstream>
    \n+#include <sstream>
    \n+#include <type_traits>
    \n
    \n

    Go to the source code of this file.

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

    \n Classes

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::GridGlue
     
    \n-\n-\n-\n-\n-\n

    \n-Functions

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

    Detailed Description

    \n+

    Write all remote intersections to a AmiraMesh file.

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

    Go to the source code of this file.

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

    \n-Classes

    struct  Dune::GridGlue::AreaWriterImplementation::FacetLayout< dimgrid >
     
    \n \n \n \n \n \n-\n-\n

    \n Namespaces

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

    Go to the source code of this file.

    \n

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

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::GridGlue
     
    namespace  Dune::GridGlue::ProjectionWriterImplementation
     
    \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n

    \n-Functions

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

    Go to the source code of this file.

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::GridGlue
     
    \n \n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n

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

    Go to the source code of this file.

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::GridGlue
    namespace  Dune::Parallel
     
    \n+\n+\n+\n+

    \n+Macros

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

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

    Macro Definition Documentation

    \n+\n+

    ◆ CheckMPIStatus

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

    Go to the source code of this file.

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

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::GridGlue
     
    namespace  Dune::GridGlue::ProjectionWriterImplementation
     
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n

    \n+Functions

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

    Go to the source code of this file.

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::Parallel
    namespace  Dune::GridGlue
     
    \n-\n-\n-\n-

    \n-Macros

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

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

    Macro Definition Documentation

    \n-\n-

    ◆ CheckMPIStatus

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

    Go to the source code of this file.

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

    \n+Classes

    struct  Dune::GridGlue::AreaWriterImplementation::FacetLayout< dimgrid >
     
    \n \n \n \n \n \n+\n+\n

    \n Namespaces

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

    extractor base class \n+

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

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

    Go to the source code of this file.

    \n

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

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::GridGlue
     
    \n

    Detailed Description

    \n-

    extractor base class

    \n+

    helper class for graphical output of grids in generic representation

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

    Mesh grid extractor base class. \n More...

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

    Go to the source code of this file.

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

    helper class for graphical output of grids in generic representation \n+

    extractor base class \n More...

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

    Go to the source code of this file.

    \n

    \n Classes

    class  Dune::GridGlue::Codim0Extractor< GV >
     
    \n \n-\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n \n

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::GridGlue
     
    \n

    Detailed Description

    \n-

    helper class for graphical output of grids in generic representation

    \n+

    extractor base class

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

    Grid extractor class for codim 1 subgrids. \n More...

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

    Go to the source code of this file.

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

    Go to the source code of this file.

    \n-

    \n Classes

    class  Dune::GridGlue::Codim1Extractor< GV >
     
    \n-\n-\n-\n-\n-

    \n-Classes

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::GridGlue
     
    \n+\n+\n+\n+\n+\n+

    \n+Macros

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

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

    Macro Definition Documentation

    \n+\n+

    ◆ DECL

    \n+\n+
    \n+
    \n+ \n+ \n+ \n+ \n+
    #define DECL
    \n+
    \n+\n+
    \n+
    \n+\n+

    ◆ STANDARD_MERGE_INSTANTIATE

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

    Implementation of the Merger concept for conforming interfaces. \n+More...

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

    Go to the source code of this file.

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

    \n Classes

    class  Dune::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...
     
    \n \n \n \n \n \n

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::GridGlue
     
    \n-
    \n+

    Detailed Description

    \n+

    Implementation of the Merger concept for conforming interfaces.

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

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

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

    Go to the source code of this file.

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

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::GridGlue
     
    \n-

    Detailed Description

    \n-

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

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::GridGlue
     
    \n-\n-\n-\n-\n-\n-

    \n-Macros

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

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

    Macro Definition Documentation

    \n-\n-

    ◆ DECL

    \n-\n-
    \n-
    \n- \n- \n- \n- \n-
    #define DECL
    \n-
    \n-\n-
    \n-
    \n-\n-

    ◆ STANDARD_MERGE_INSTANTIATE

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

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

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

    Go to the source code of this file.

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

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::GridGlue
     
    \n-\n-\n-\n-\n-\n-

    \n-Macros

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

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

    Detailed Description

    \n-

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

    \n-

    Macro Definition Documentation

    \n-\n-

    ◆ DECL

    \n-\n-
    \n-
    \n- \n- \n- \n- \n-
    #define DECL   extern
    \n-
    \n-\n-
    \n-
    \n-\n-

    ◆ STANDARD_MERGE_INSTANTIATE

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

    Go to the source code of this file.

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

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::GridGlue
     
    \n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n

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

    Go to the source code of this file.

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

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::GridGlue
     
    \n \n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n+\n+\n+\n

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

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

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

    Go to the source code of this file.

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

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::GridGlue
     
    \n-\n-\n-\n-\n

    \n-Functions

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

    Detailed Description

    \n+

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

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

    Implementation of the Merger concept for conforming interfaces. \n+

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

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

    Go to the source code of this file.

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

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

    \n Namespaces

    namespace  Dune
     
    namespace  Dune::GridGlue
     
    \n+\n+\n+\n+\n+\n+

    \n+Macros

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

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

    Detailed Description

    \n-

    Implementation of the Merger concept for conforming interfaces.

    \n-
    \n+

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

    \n+

    Macro Definition Documentation

    \n+\n+

    ◆ DECL

    \n+\n+
    \n+
    \n+ \n+ \n+ \n+ \n+
    #define DECL   extern
    \n+
    \n+\n+
    \n+
    \n+\n+

    ◆ STANDARD_MERGE_INSTANTIATE

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

    Go to the source code of this file.

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

    \n+Classes

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

    \n Namespaces

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

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

    \n

    \n

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

    \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00926.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00926.html", "unified_diff": "@@ -1520,16 +1520,16 @@\n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following files:\n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00930.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00930.html", "unified_diff": "@@ -76,15 +76,15 @@\n
    Dune::GridGlue::IntersectionData< P0, P1 > Class Template Reference
    \n \n
    \n \n

    storage class for Dune::GridGlue::Intersection related data \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -633,15 +633,15 @@\n \n

    Dimension of the intersection.

    \n \n \n \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00934.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00934.html", "unified_diff": "@@ -74,15 +74,15 @@\n
    Dune::GridGlue::Intersection< P0, P1, I, O > Class Template Reference
    \n \n
    \n \n

    The intersection of two entities of the two patches of a GridGlue. \n More...

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::GridGlue::Intersection< P0, P1, I, O >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -1074,15 +1074,15 @@\n \n

    outside patch

    \n \n
    \n
    \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00942.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00942.html", "unified_diff": "@@ -70,15 +70,15 @@\n Public Types |\n Public Member Functions |\n List of all members\n
    Dune::GridGlue::IntersectionIndexSet< P0, P1 > Class Template Reference
    \n \n

    \n Public Types

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

    Return total number of intersections.

    \n \n \n \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00946.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00946.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::GridGlue::GridGlueAmiraWriter Class Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n

    \n Public Types

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

    \n Static Public Member Functions

    template<typename Glue >
    static void write (const Glue &glue, const std::string &path, int appendix=1)
     
    \n@@ -128,15 +128,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00950.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00950.html", "unified_diff": "@@ -69,15 +69,15 @@\n \n
    Dune::GridGlue::GlobalId Struct Reference
    \n \n
    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::GridGlue::GlobalId:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -194,15 +194,15 @@\n \n \n \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00954.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00954.html", "unified_diff": "@@ -74,15 +74,15 @@\n
    Dune::GridGlue::CommDataHandle< DataHandleImp, DataTypeImp > Class Template Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

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

    \n Public Types

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

    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.

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

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::GridGlue::StreamingMessageBuffer< DT >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -333,15 +333,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00962.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00962.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::GridGlue::CommunicationOperator< dir > Class Template Reference
    \n \n
    \n \n

    forward gather scatter to user defined CommInfo class \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -190,15 +190,15 @@\n \n

    \n Static Public Member Functions

    template<class CommInfo >
    static const CommInfo::DataTypegather (const CommInfo &commInfo, size_t i, size_t j=0)
     
    template<class CommInfo >
    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00966.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00966.html", "unified_diff": "@@ -74,15 +74,15 @@\n
    Dune::GridGlue::CommInfo< GG, DataHandleImp, DataTypeImp > Struct Template Reference
    \n \n
    \n \n

    collects all GridGlue data requried for communication \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -283,15 +283,15 @@\n \n

    \n Public Types

    typedef DataTypeImp value_type
     
    typedef GG GridGlue
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00970.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00970.html", "unified_diff": "@@ -73,15 +73,15 @@\n
    Dune::CommPolicy< ::Dune::GridGlue::CommInfo< GG, DataHandleImp, DataTypeImp > > Struct Template Reference
    \n \n
    \n \n

    specialization of the CommPolicy struct, required for the ParallelIndexsets \n More...

    \n \n-

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

    \n+

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

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

    Get the number of objects at an intersection.

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00974.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00974.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::GridGlue::GridGlueVtkWriter Class Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n

    \n Public Types

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

    \n Static Public Member Functions

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

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

    \n+

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

    \n \n \n \n \n \n \n@@ -386,15 +386,15 @@\n \n

    \n Public Types

    using GridGlue = ::Dune::GridGlue::GridGlue< P0, P1 >
     
    using IntersectionData = Dune::GridGlue::IntersectionData< P0, P1 >
     
    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00986.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00986.html", "unified_diff": "@@ -71,15 +71,15 @@\n Public Member Functions |\n Related Functions |\n List of all members \n
    Dune::GridGlue::Reverse< reverse > Struct Template Reference
    \n \n
    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::GridGlue::Reverse< reverse >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -174,15 +174,15 @@\n \n
    \n

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

    \n \n
    \n
    \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00990.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00990.html", "unified_diff": "@@ -69,15 +69,15 @@\n \n
    Dune::GridGlue::AreaWriterImplementation::FacetLayout< dimgrid > Struct Template Reference
    \n \n
    \n \n-

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

    \n+

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

    \n \n \n \n \n

    \n Public Member Functions

    bool contains (Dune::GeometryType gt) const
     
    \n

    Member Function Documentation

    \n@@ -106,15 +106,15 @@\n \n \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00994.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00994.html", "unified_diff": "@@ -75,15 +75,15 @@\n
    Dune::GridGlue::Projection< Coordinate > Class Template Reference
    \n \n
    \n \n

    Projection of a line (triangle) on another line (triangle). \n More...

    \n \n-

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

    \n+

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

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

    \n Classes

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

    maximum number of edge-edge intersections

    \n

    See also \\seealso edgeIntersections()

    \n \n \n \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00998.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00998.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::GridGlue::Projection< Coordinate >::EdgeIntersection Struct Reference
    \n \n
    \n \n

    Intersection between two edges of a triangle. \n More...

    \n \n-

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

    \n+

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

    \n
    \n \n \n \n \n \n@@ -126,15 +126,15 @@\n \n

    Local coordinates of intersection and distance along normals.

    \n

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

    \n \n \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01038.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01038.html", "unified_diff": "@@ -77,15 +77,15 @@\n
    Dune::GridGlue::Extractor< GV, cd > Class Template Reference
    \n \n
    \n \n

    Provides codimension-independent methods for grid extraction. \n More...

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::GridGlue::Extractor< GV, cd >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -1219,15 +1219,15 @@\n \n

    a map enabling faster access to vertices and coordinates

    \n

    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.

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01042.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01042.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::GridGlue::Extractor< GV, cd >::CornerInfo Struct Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n

    \n Public Attributes

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

    element corner

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01046.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01046.html", "unified_diff": "@@ -70,15 +70,15 @@\n Public Member Functions |\n Public Attributes |\n List of all members\n
    Dune::GridGlue::Extractor< GV, cd >::CoordinateInfo Struct Reference
    \n \n

    \n Public Attributes

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

    the index of the parent element (from index set)

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01050.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01050.html", "unified_diff": "@@ -73,15 +73,15 @@\n
    Dune::GridGlue::Extractor< GV, cd >::VertexInfo Struct Reference
    \n \n
    \n \n

    simple struct holding a vertex pointer and an index \n More...

    \n \n-

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

    \n+

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

    \n

    \n Public Member Functions

     CoordinateInfo ()
     
     CoordinateInfo (unsigned int index_, IndexType vtxindex_)
     
    \n \n \n \n

    \n Public Member Functions

     VertexInfo (unsigned int idx_, const Vertex &p_)
     
    \n \n

    \n@@ -163,15 +163,15 @@\n

    \n
    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01054.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01054.html", "unified_diff": "@@ -73,15 +73,15 @@\n
    Dune::GridGlue::Extractor< GV, cd >::ElementInfo Struct Reference
    \n \n
    \n \n

    simple struct holding an element seed and an index \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n

    \n Public Member Functions

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

    \n@@ -196,15 +196,15 @@\n
    \n \n

    the entity seed for the element

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01058.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01058.html", "unified_diff": "@@ -73,15 +73,15 @@\n
    Dune::GridGlue::Extractor< GV, cd >::SubEntityInfo Struct Reference
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -277,15 +277,15 @@\n
    \n \n

    the index of the parent element (from index set)

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01062.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01062.html", "unified_diff": "@@ -70,15 +70,15 @@\n Public Member Functions |\n Protected Member Functions |\n List of all members\n
    Dune::GridGlue::VtkSurfaceWriter Class Reference
    \n \n

    \n Public Member Functions

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

    \n Public Member Functions

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

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::GridGlue::ComputationMethod< dimWorld, dim1, dim2, T >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -362,15 +362,15 @@\n

    \n
    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01070.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01070.html", "unified_diff": "@@ -72,15 +72,15 @@\n
    Dune::GridGlue::IntersectionComputation< CM > Class Template Reference
    \n \n
    \n \n

    Intersection computation method for two elements of arbitrary dimension. \n More...

    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -241,15 +241,15 @@\n

    \n 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>
    \n \n \n \n
    \n \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01074.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01074.html", "unified_diff": "@@ -78,15 +78,15 @@\n
    Dune::GridGlue::ConformingMerge< dim, dimworld, T > Class Template Referenceabstract
    \n \n
    \n \n

    Implementation of the Merger concept for conforming interfaces. \n More...

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::GridGlue::ConformingMerge< dim, dimworld, T >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -1189,15 +1189,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01078.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01078.html", "unified_diff": "@@ -77,15 +77,15 @@\n
    Dune::GridGlue::ContactMerge< dimworld, T > Class Template Referenceabstract
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::GridGlue::ContactMerge< dimworld, T >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -1757,16 +1757,16 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following files:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01082.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01082.html", "unified_diff": "@@ -70,15 +70,15 @@\n Public Types |\n Public Member Functions |\n List of all members \n
    Dune::GridGlue::IntersectionListProvider< L0, L1 > Class Template Referenceabstract
    \n \n
    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::GridGlue::IntersectionListProvider< L0, L1 >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -481,15 +481,15 @@\n

    number of intersections in the merged grid

    \n \n

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

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01098.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01098.html", "unified_diff": "@@ -70,15 +70,15 @@\n Public Types |\n Public Member Functions |\n List of all members \n
    Dune::GridGlue::IntersectionList< Local0, Local1 > Class Template Reference
    \n \n
    \n \n-

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

    \n+

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

    \n \n \n \n \n \n \n@@ -354,15 +354,15 @@\n

    \n Public Types

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

    number of intersections in the merged grid

    \n \n
    \n \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01102.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01102.html", "unified_diff": "@@ -71,15 +71,15 @@\n Public Types |\n Public Member Functions |\n List of all members \n
    Dune::GridGlue::SimplicialIntersectionListProvider< dim0, dim1 > Class Template Referencefinal
    \n \n
    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::GridGlue::SimplicialIntersectionListProvider< dim0, dim1 >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -624,15 +624,15 @@\n

    number of intersections in the merged grid

    \n \n

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

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01106.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01106.html", "unified_diff": "@@ -71,15 +71,15 @@\n Public Member Functions |\n Public Attributes |\n List of all members \n
    Dune::GridGlue::SimplicialIntersectionListProvider< dim0, dim1 >::SimplicialIntersection Struct Reference
    \n \n
    \n \n-

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

    \n+

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

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

    \n Public Types

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

    list of parent entities for embeddings into the second grid

    \n \n
    \n \n
    The documentation for this struct was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01110.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01110.html", "unified_diff": "@@ -74,15 +74,15 @@\n
    Dune::GridGlue::Merger< ctype, grid1Dim, grid2Dim, dimworld > Class Template Referenceabstract
    \n \n
    \n \n

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

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::GridGlue::Merger< ctype, grid1Dim, grid2Dim, dimworld >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -557,15 +557,15 @@\n \n

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

    \n

    Used temporarily to speed up the implementation

    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01114.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a01114.html", "unified_diff": "@@ -77,15 +77,15 @@\n
    Dune::GridGlue::OverlappingMerge< dim1, dim2, dimworld, T > Class Template Referenceabstract
    \n \n
    \n \n

    Computing overlapping grid intersections for grids of different dimensions. \n More...

    \n \n-

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

    \n+

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

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

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

    \n \n-

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

    \n+

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

    \n
    \n Inheritance diagram for Dune::GridGlue::StandardMerge< T, grid1Dim, grid2Dim, dimworld >:
    \n
    \n
    \"Inheritance
    \n \n \"\"\n \"\"\n@@ -1136,15 +1136,15 @@\n \n \n
    \n \n
    \n
    \n
    The documentation for this class was generated from the following file:\n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_000000_000001.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_000000_000001.html", "unified_diff": "@@ -62,14 +62,14 @@\n \n \n \n
    \n-

    adapter → common Relation

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

    adapter → common Relation

    File in dune/grid-glue/adapterIncludes file in dune/grid-glue/common
    gridglue.ccringcomm.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_000003_000000.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_000003_000000.html", "unified_diff": "@@ -62,14 +62,14 @@\n \n \n \n
    \n-

    extractors → adapter Relation

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

    extractors → adapter Relation

    File in dune/grid-glue/extractorsIncludes file in dune/grid-glue/adapter
    vtksurfacewriter.hhgridgluevtkwriter.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_000003_000001.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_000003_000001.html", "unified_diff": "@@ -62,14 +62,14 @@\n \n \n \n
    \n-

    extractors → common Relation

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

    extractors → common Relation

    File in dune/grid-glue/extractorsIncludes file in dune/grid-glue/common
    codim1extractor.hhcrossproduct.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_000004_000000.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_000004_000000.html", "unified_diff": "@@ -62,14 +62,14 @@\n \n
    \n \n
    \n \n \n+

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

    grid-glue → merging Relation

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

    grid-glue → merging Relation

    File in dune/grid-glueIncludes file in dune/grid-glue/merging
    gridglue.hhmerger.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_000005_000001.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_000005_000001.html", "unified_diff": "@@ -62,14 +62,14 @@\n \n \n \n
    \n-

    merging → common Relation

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

    merging → common Relation

    File in dune/grid-glue/mergingIncludes file in dune/grid-glue/common
    contactmerge.cccrossproduct.hh
    contactmerge.ccprojection.hh
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_0d8f660a135565b225f6b14e80c278b4.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_0d8f660a135565b225f6b14e80c278b4.html", "unified_diff": "@@ -81,38 +81,38 @@\n
    \n \n \n \n \n \n-\n+\n \n-\n-\n+\n+\n \n-\n+\n \n-\n-\n+\n+\n \n-\n+\n \n-\n+\n \n \n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n-\n+\n+\n \n

    \n Files

    file  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.
     
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_1b444a177590012656060e8a0bca20fc.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_1b444a177590012656060e8a0bca20fc.html", "unified_diff": "@@ -79,36 +79,36 @@\n \"\"\n \"\"\n
    \n \n \n \n-\n+\n \n \n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n-\n-\n+\n+\n \n-\n+\n \n \n \n \n-\n+\n \n

    \n Files

    file  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]
     
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_65f347cff0208f20f00d27c542208238.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_65f347cff0208f20f00d27c542208238.html", "unified_diff": "@@ -77,29 +77,29 @@\n \"\"\n \"\"\n
    \n \n \n \n-\n+\n \n-\n+\n \n-\n+\n \n-\n+\n \n \n \n-\n+\n \n-\n+\n \n-\n+\n \n

    \n 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]
     
    \n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_eaad0bdad6fc03850e65b1fdad9faad4.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/dir_eaad0bdad6fc03850e65b1fdad9faad4.html", "unified_diff": "@@ -87,19 +87,19 @@\n Files\n file  codim0extractor.hh [code]\n  Mesh grid extractor base class.
    \n  \n file  codim1extractor.hh [code]\n  Grid extractor class for codim 1 subgrids.
    \n  \n-file  extractor.hh [code]\n- extractor base class
    \n+file  extractor.hh [code]\n+ extractor base class
    \n  \n-file  vtksurfacewriter.hh [code]\n- helper class for graphical output of grids in generic representation
    \n+file  vtksurfacewriter.hh [code]\n+ helper class for graphical output of grids in generic representation
    \n  \n \n \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/dune-grid-glue.tag.gz", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/dune-grid-glue.tag.gz", "unified_diff": null, "details": [{"source1": "dune-grid-glue.tag", "source2": "dune-grid-glue.tag", "unified_diff": null, "details": [{"source1": "dune-grid-glue.tag", "source2": "dune-grid-glue.tag", "unified_diff": "@@ -1,38 +1,38 @@\n \n \n \n gridglue.cc\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/adapter/\n- a00005.html\n- intersection.hh\n+ a00008.html\n+ intersection.hh\n ../gridglue.hh\n- ../common/ringcomm.hh\n+ ../common/ringcomm.hh\n Dune\n Dune::GridGlue\n \n void\n printVector\n a00104.html\n ac943b51eb586602f1cfd101f30562e10\n (const std::vector< T > &v, std::string name, int rank)\n \n \n \n gridglueamirawriter.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/adapter/\n- a00023.html\n+ a00026.html\n Dune::GridGlue::GridGlueAmiraWriter\n Dune\n Dune::GridGlue\n \n \n gridgluecommunicate.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/adapter/\n- a00020.html\n+ a00017.html\n Dune::GridGlue::GlobalId\n Dune::GridGlue::CommDataHandle\n Dune::GridGlue::StreamingMessageBuffer\n Dune::GridGlue::CommunicationOperator\n Dune::GridGlue::CommInfo\n Dune::CommPolicy< ::Dune::GridGlue::CommInfo< GG, DataHandleImp, DataTypeImp > >\n Dune\n@@ -65,44 +65,44 @@\n ae6bb46e80d5b6cbe71801fce426c311b\n (std::ostream &os, const GlobalId &id)\n \n \n \n gridgluevtkwriter.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/adapter/\n- a00008.html\n+ a00020.html\n dune/grid-glue/gridglue.hh\n Dune::GridGlue::GridGlueVtkWriter\n Dune\n Dune::GridGlue\n \n \n intersection.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/adapter/\n- a00017.html\n+ a00014.html\n dune/grid-glue/gridglue.hh\n Dune::GridGlue::IntersectionData\n Dune::GridGlue::IntersectionTraits\n Dune::GridGlue::Intersection\n Dune\n Dune::GridGlue\n \n #define\n ONLY_SIMPLEX_INTERSECTIONS\n- a00017.html\n+ a00014.html\n aac752eae6e9ad7d1e576f1fe3f7c8a6b\n \n \n \n \n intersectionindexset.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/adapter/\n- a00014.html\n+ a00023.html\n dune/grid-glue/gridglue.hh\n- dune/grid-glue/adapter/intersection.hh\n+ dune/grid-glue/adapter/intersection.hh\n Dune::GridGlue::IntersectionIndexSet\n Dune\n Dune::GridGlue\n \n \n intersectioniterator.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/adapter/\n@@ -111,31 +111,31 @@\n Dune::GridGlue::IntersectionIterator\n Dune\n Dune::GridGlue\n \n \n rangegenerators.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/adapter/\n- a00026.html\n+ a00005.html\n Dune::GridGlue::Reverse\n Dune\n Dune::GridGlue\n \n IteratorRange<... >\n intersections\n a00104.html\n ac6a31e555010d279de506e730906a26e\n (const GridGlue<... > &glue, const Reverse<... > &reverse=!reversed)\n \n \n \n areawriter.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/common/\n- a00050.html\n- areawriter_impl.hh\n+ a00029.html\n+ areawriter_impl.hh\n Dune\n Dune::GridGlue\n \n void\n write_glue_area_vtk\n a00104.html\n a16ccdbde4466d3073eab2a0f25d78f4e\n@@ -155,15 +155,15 @@\n ab4463688255524d5d7433ae6af851884\n (const Glue &glue, const std::string &base)\n \n \n \n areawriter_impl.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/common/\n- a00029.html\n+ a00050.html\n Dune::GridGlue::AreaWriterImplementation::FacetLayout\n Dune\n Dune::GridGlue\n Dune::GridGlue::AreaWriterImplementation\n \n void\n write_facet_geometry\n@@ -192,29 +192,29 @@\n ab4463688255524d5d7433ae6af851884\n (const Glue &glue, const std::string &base)\n \n \n \n crossproduct.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/common/\n- a00035.html\n+ a00047.html\n Dune\n Dune::GridGlue\n \n static Dune::FieldVector< T, dim >\n crossProduct\n a00104.html\n acbf555ac0358f96454a5f22dd4ac4de2\n (const Dune::FieldVector< T, dim > &a, const Dune::FieldVector< T, dim > &b)\n \n \n \n projection.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/common/\n- a00044.html\n+ a00032.html\n projection_impl.hh\n Dune::GridGlue::Projection\n Dune::GridGlue::Projection::EdgeIntersection\n Dune\n Dune::GridGlue\n \n \n@@ -259,17 +259,17 @@\n a870cd1d1b2cb9d977ceab3032db9dca6\n (const Coordinate &x, const Field &epsilon)\n \n \n \n projectionwriter.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/common/\n- a00038.html\n- dune/grid-glue/common/projection.hh\n- projectionwriter_impl.hh\n+ a00035.html\n+ dune/grid-glue/common/projection.hh\n+ projectionwriter_impl.hh\n Dune\n Dune::GridGlue\n \n void\n write\n a00104.html\n a4dcc05f4b64a511b2e9548e371e140a7\n@@ -289,15 +289,15 @@\n ace9cbed627c90927e36d71a65a5498a3\n (const Projection< Coordinate > &projection, const Corners &corners, const Normals &normals)\n \n \n \n projectionwriter_impl.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/common/\n- a00032.html\n+ a00044.html\n Dune\n Dune::GridGlue\n Dune::GridGlue::ProjectionWriterImplementation\n \n void\n write_points\n a00107.html\n@@ -353,21 +353,21 @@\n ace9cbed627c90927e36d71a65a5498a3\n (const Projection< Coordinate > &projection, const Corners &corners, const Normals &normals)\n \n \n \n ringcomm.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/common/\n- a00047.html\n+ a00038.html\n Dune\n Dune::Parallel\n \n #define\n CheckMPIStatus\n- a00047.html\n+ a00038.html\n a1a95f4074572a7a9e13bcb072afef070\n (A, B)\n \n \n void\n MPI_AllApply\n a00108.html\n@@ -375,84 +375,84 @@\n (MPI_Comm mpicomm, OP &&op, const Args &... data)\n \n \n \n codim0extractor.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/extractors/\n a00056.html\n- extractor.hh\n+ extractor.hh\n Dune::GridGlue::Codim0Extractor\n Dune\n Dune::GridGlue\n \n \n codim1extractor.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/extractors/\n a00062.html\n- extractor.hh\n- dune/grid-glue/common/crossproduct.hh\n+ extractor.hh\n+ dune/grid-glue/common/crossproduct.hh\n Dune::GridGlue::Codim1Extractor\n Dune\n Dune::GridGlue\n \n \n extractor.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/extractors/\n- a00053.html\n+ a00059.html\n Dune::GridGlue::Extractor\n Dune::GridGlue::Extractor::CornerInfo\n Dune::GridGlue::Extractor::CoordinateInfo\n Dune::GridGlue::Extractor::VertexInfo\n Dune::GridGlue::Extractor::ElementInfo\n Dune::GridGlue::Extractor::SubEntityInfo\n Dune\n Dune::GridGlue\n \n \n vtksurfacewriter.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/extractors/\n- a00059.html\n- ../adapter/gridgluevtkwriter.hh\n+ a00053.html\n+ ../adapter/gridgluevtkwriter.hh\n Dune::GridGlue::VtkSurfaceWriter\n Dune\n Dune::GridGlue\n \n \n adapter/gridglue.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/adapter/\n a01963.html\n dune/grid-glue/gridglue.hh\n \n \n gridglue.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/\n a00002.html\n- adapter/gridgluecommunicate.hh\n- dune/grid-glue/merging/merger.hh\n- adapter/rangegenerators.hh\n- adapter/gridglue.cc\n- adapter/intersection.hh\n+ adapter/gridgluecommunicate.hh\n+ dune/grid-glue/merging/merger.hh\n+ adapter/rangegenerators.hh\n+ adapter/gridglue.cc\n+ adapter/intersection.hh\n adapter/intersectioniterator.hh\n- adapter/intersectionindexset.hh\n+ adapter/intersectionindexset.hh\n Dune::GridGlue::GridGlue\n Dune\n Dune::GridGlue\n \n \n computeintersection.cc\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/merging/\n a00092.html\n Dune\n Dune::GridGlue\n \n \n computeintersection.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/merging/\n- a00089.html\n- simplexintersection.cc\n+ a00086.html\n+ simplexintersection.cc\n computeintersection.cc\n Dune::GridGlue::ComputationMethod\n Dune::GridGlue::IntersectionComputation\n Dune\n Dune::GridGlue\n \n int\n@@ -461,56 +461,56 @@\n a273266aab32afadee15bb5fcf71aa4ca\n (const V p, std::vector< V > &P)\n \n \n \n conformingmerge.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/merging/\n- a00095.html\n- dune/grid-glue/merging/standardmerge.hh\n+ a00068.html\n+ dune/grid-glue/merging/standardmerge.hh\n Dune::GridGlue::ConformingMerge\n Dune\n Dune::GridGlue\n \n \n contactmerge.cc\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/merging/\n- a00098.html\n- dune/grid-glue/common/crossproduct.hh\n- dune/grid-glue/common/projection.hh\n+ a00074.html\n+ dune/grid-glue/common/crossproduct.hh\n+ dune/grid-glue/common/projection.hh\n Dune\n Dune::GridGlue\n \n \n contactmerge.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/merging/\n- a00071.html\n- dune/grid-glue/merging/standardmerge.hh\n+ a00089.html\n+ dune/grid-glue/merging/standardmerge.hh\n dune/grid-glue/gridglue.hh\n- contactmerge.cc\n+ contactmerge.cc\n Dune::GridGlue::ContactMerge\n Dune\n Dune::GridGlue\n \n \n intersectionlist.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/merging/\n- a00068.html\n+ a00098.html\n Dune::GridGlue::IntersectionListProvider\n Dune::GridGlue::IntersectionList\n Dune::GridGlue::SimplicialIntersectionListProvider\n Dune::GridGlue::SimplicialIntersectionListProvider::SimplicialIntersection\n Dune\n Dune::GridGlue\n \n \n merger.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/merging/\n- a00065.html\n- dune/grid-glue/merging/intersectionlist.hh\n+ a00077.html\n+ dune/grid-glue/merging/intersectionlist.hh\n Dune::GridGlue::Merger\n Dune\n Dune::GridGlue\n \n \n overlappingmerge.cc\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/merging/\n@@ -524,26 +524,26 @@\n ad63267c6d27a8f09d98506419b206db8\n \n \n \n \n overlappingmerge.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/merging/\n- a00083.html\n- dune/grid-glue/merging/standardmerge.hh\n- dune/grid-glue/merging/computeintersection.hh\n+ a00071.html\n+ dune/grid-glue/merging/standardmerge.hh\n+ dune/grid-glue/merging/computeintersection.hh\n overlappingmerge.cc\n Dune::GridGlue::OverlappingMerge\n Dune\n Dune::GridGlue\n \n \n simplexintersection.cc\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/merging/\n- a00086.html\n+ a00083.html\n Dune::GridGlue::SimplexMethod\n Dune::GridGlue::SimplexMethod< dimWorld, 0, 0, T >\n Dune::GridGlue::SimplexMethod< dimWorld, 0, 1, T >\n Dune::GridGlue::SimplexMethod< dimWorld, 0, 2, T >\n Dune::GridGlue::SimplexMethod< dimWorld, 0, 3, T >\n Dune::GridGlue::SimplexMethod< dimWorld, 1, 1, T >\n Dune::GridGlue::SimplexMethod< dimWorld, 1, 2, T >\n@@ -581,29 +581,29 @@\n a697e604ca453c314141e6b4c5efe3eab\n (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)\n \n \n \n standardmerge.cc\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/merging/\n- a00074.html\n- standardmerge.hh\n+ a00065.html\n+ standardmerge.hh\n Dune\n Dune::GridGlue\n \n #define\n DECL\n- a00074.html\n+ a00065.html\n ad5c7ca0181fea7823b37d06d5f61e9cd\n \n \n \n #define\n STANDARD_MERGE_INSTANTIATE\n- a00074.html\n+ a00065.html\n a4a2b0f7fb92723749fc6d5cca82a4297\n (T, A, B, C)\n \n \n \n STANDARD_MERGE_INSTANTIATE\n a00104.html\n@@ -624,32 +624,32 @@\n aa1057477f7967001ea15f5928e90f84c\n (double, 3, 3, 3)\n \n \n \n standardmerge.hh\n /build/reproducible-path/dune-grid-glue-2.9.0/dune/grid-glue/merging/\n- a00077.html\n- dune/grid-glue/merging/intersectionlist.hh\n- dune/grid-glue/merging/merger.hh\n- dune/grid-glue/merging/computeintersection.hh\n+ a00095.html\n+ dune/grid-glue/merging/intersectionlist.hh\n+ dune/grid-glue/merging/merger.hh\n+ dune/grid-glue/merging/computeintersection.hh\n Dune::GridGlue::StandardMerge\n Dune\n Dune::GridGlue\n \n #define\n DECL\n- a00077.html\n+ a00095.html\n ad5c7ca0181fea7823b37d06d5f61e9cd\n \n \n \n #define\n STANDARD_MERGE_INSTANTIATE\n- a00077.html\n+ a00095.html\n a4a2b0f7fb92723749fc6d5cca82a4297\n (T, A, B, C)\n \n \n \n STANDARD_MERGE_INSTANTIATE\n a00104.html\n"}]}]}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/files.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/files.html", "unified_diff": "@@ -66,50 +66,50 @@\n \n
    \n
    Here is a list of all files with brief descriptions:
    \n
    [detail level 1234]
    \n \n \n \n-\n+\n \n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n \n-\n+\n \n-\n-\n-\n-\n+\n+\n+\n+\n \n-\n-\n-\n+\n+\n+\n \n \n \n-\n-\n+\n+\n \n \n-\n-\n-\n-\n-\n-\n+\n+\n+\n+\n+\n+\n \n-\n-\n-\n-\n+\n+\n+\n+\n \n
      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
    \n
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/globals.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/globals.html", "unified_diff": "@@ -59,19 +59,19 @@\n \n \n \n
    \n
    Here is a list of all file members with links to the files they belong to:
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/globals_defs.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/globals_defs.html", "unified_diff": "@@ -59,19 +59,19 @@\n \n \n \n
    \n  \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n"}, {"source1": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00065_source.html", "source2": "./usr/share/doc/libdune-grid-glue-doc/doxygen/a00005_source.html", "comments": ["Files 24% similar despite different names"], "unified_diff": "@@ -1,15 +1,15 @@\n \n \n \n \n \n \n \n-dune-grid-glue: merger.hh Source File\n+dune-grid-glue: rangegenerators.hh Source File\n \n \n \n \n \n \n \n@@ -58,105 +58,78 @@\n \n \n \n \n \n
    \n-
    merger.hh
    \n+
    rangegenerators.hh
    \n
    \n
    \n-Go to the documentation of this file.
    1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
    \n-
    2// vi: set et ts=4 sw=2 sts=2:
    \n-
    3// SPDX-FileCopyrightInfo: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n-
    4// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
    \n-
    5#ifndef DUNE_GRIDGLUE_MERGING_MERGER_HH
    \n-
    6#define DUNE_GRIDGLUE_MERGING_MERGER_HH
    \n+Go to the documentation of this file.
    1// SPDX-FileCopyrightInfo: Copyright \u00a9 DUNE Project contributors, see file LICENSE.md in module root
    \n+
    2// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-with-dune-grid-glue-exception
    \n+
    3#ifndef DUNE_GRIDGLUE_ADAPTER_RANGEGENERATORS_HH
    \n+
    4#define DUNE_GRIDGLUE_ADAPTER_RANGEGENERATORS_HH
    \n+
    5
    \n+
    6#include <dune/common/iteratorrange.hh>
    \n
    7
    \n-
    8#include <vector>
    \n-
    9
    \n-
    10#include <dune/common/fvector.hh>
    \n-
    11#include <dune/geometry/type.hh>
    \n-
    12
    \n-\n-
    14
    \n-
    15namespace Dune {
    \n-
    16namespace GridGlue {
    \n-
    17
    \n-
    25template <class ctype, int grid1Dim, int grid2Dim, int dimworld>
    \n-
    26class Merger
    \n-
    27{
    \n-
    28public:
    \n-
    29
    \n-
    31 typedef Dune::FieldVector<ctype, grid1Dim> Grid1Coords;
    \n+
    8namespace Dune {
    \n+
    9namespace GridGlue {
    \n+
    10
    \n+
    14template<bool reverse>
    \n+
    15struct Reverse
    \n+
    16 : std::integral_constant<bool, reverse>
    \n+
    17{
    \n+
    18 typedef Reverse type;
    \n+
    19
    \n+
    20 constexpr
    \n+\n+
    22 { return {}; }
    \n+
    23};
    \n+
    24
    \n+
    25#ifdef DOXYGEN
    \n+
    26
    \n+\n
    32
    \n-
    34 typedef Dune::FieldVector<ctype, grid2Dim> Grid2Coords;
    \n-
    35
    \n-
    37 typedef Dune::FieldVector<ctype, dimworld> WorldCoords;
    \n-
    38
    \n-\n-
    40
    \n-
    54 virtual void build(const std::vector<Dune::FieldVector<ctype,dimworld> >& grid1_coords,
    \n-
    55 const std::vector<unsigned int>& grid1_elements,
    \n-
    56 const std::vector<Dune::GeometryType>& grid1_element_types,
    \n-
    57 const std::vector<Dune::FieldVector<ctype,dimworld> >& grid2_coords,
    \n-
    58 const std::vector<unsigned int>& grid2_elements,
    \n-
    59 const std::vector<Dune::GeometryType>& grid2_element_types) = 0;
    \n-
    60
    \n-
    64 unsigned int nSimplices() const
    \n-
    65 { return intersectionList()->size(); }
    \n-
    66
    \n-
    67 virtual void clear() = 0;
    \n-
    68
    \n-
    74 virtual std::shared_ptr<IntersectionList> intersectionList() const = 0;
    \n+
    66template<...>
    \n+
    67IteratorRange<...>
    \n+
    68intersections(const GridGlue<...>& glue, const Reverse<...>& reverse = !reversed);
    \n+
    69
    \n+
    70#else
    \n+
    71
    \n+
    72namespace {
    \n+
    73const Reverse<true> reversed = {};
    \n+
    74} /* namespace */
    \n
    75
    \n-
    79 template<int n>
    \n-
    80 unsigned int parents(unsigned int idx) const {
    \n-
    81 return intersectionList()->template parents<n>(idx);
    \n-
    82 }
    \n+
    76template<typename P0, typename P1, bool reverse = false>
    \n+
    77IteratorRange< typename GridGlue<P0, P1>::template IntersectionIterator<reverse ? 1 : 0> >
    \n+
    78intersections(const GridGlue<P0, P1>& glue, const Reverse<reverse>& = {})
    \n+
    79{
    \n+
    80 const static int side = reverse ? 1 : 0;
    \n+
    81 return {glue.template ibegin<side>(), glue.template iend<side>()};
    \n+
    82}
    \n
    83
    \n-
    90 template<int n>
    \n-
    91 unsigned int parent(unsigned int idx, unsigned int parId = 0) const
    \n-
    92 {
    \n-
    93 return intersectionList()->template parent<n>(idx, parId);
    \n-
    94 }
    \n-
    95
    \n-
    104 template<int n>
    \n-
    105 auto parentLocal(unsigned int idx, unsigned int corner, unsigned int parId = 0) const
    \n-
    106 {
    \n-
    107 return intersectionList()->template corner<n>(idx, corner, parId);
    \n-
    108 }
    \n-
    109
    \n-
    114 unsigned int counter;
    \n-
    115};
    \n-
    116
    \n-
    117} /* namespace GridGlue */
    \n-
    118} /* namespace Dune */
    \n-
    119
    \n-
    120#endif
    \n-\n+
    84#endif // DOXYGEN
    \n+
    85
    \n+
    86} /* namespace GridGlue */
    \n+
    87} /* namespace Dune */
    \n+
    88
    \n+
    89#endif
    \n
    Definition: gridglue.hh:37
    \n-
    Coordinate corner(unsigned c)
    Definition: projection_impl.hh:24
    \n-
    Definition: intersectionlist.hh:134
    \n-
    Abstract base for all classes that take extracted grids and build sets of intersections.
    Definition: merger.hh:27
    \n-
    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
    \n-
    virtual void clear()=0
    \n-
    Dune::FieldVector< ctype, dimworld > WorldCoords
    the coordinate type used in this interface
    Definition: merger.hh:37
    \n-
    Dune::FieldVector< ctype, grid1Dim > Grid1Coords
    the local coordinate type for the grid1 coordinates
    Definition: merger.hh:31
    \n-
    unsigned int counter
    Counts the number of times the computeIntersection method has been called.
    Definition: merger.hh:114
    \n-
    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
    \n-
    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
    \n-
    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
    \n-
    virtual std::shared_ptr< IntersectionList > intersectionList() const =0
    \n-
    unsigned int parents(unsigned int idx) const
    Definition: merger.hh:80
    \n-
    Dune::FieldVector< ctype, grid2Dim > Grid2Coords
    the local coordinate type for the grid2 coordinates
    Definition: merger.hh:34
    \n+
    IteratorRange<... > intersections(const GridGlue<... > &glue, const Reverse<... > &reverse=!reversed)
    Iterate over all intersections of a GridGlue.
    \n+
    sequential adapter to couple two grids at specified close together boundaries
    Definition: gridglue.hh:67
    \n+
    IteratorRange<... > intersections(const GridGlue<... > &glue, const Reverse<... > &reverse=!reversed)
    Iterate over all intersections of a GridGlue.
    \n+
    Definition: rangegenerators.hh:17
    \n+
    const Reverse< true > reversed
    Definition: rangegenerators.hh:31
    \n+
    Reverse type
    Definition: rangegenerators.hh:18
    \n+
    constexpr Reverse<!reverse > operator!() const
    Definition: rangegenerators.hh:21
    \n
    \n \n
    \n Generated by \"doxygen\"/ 1.9.4\n
    \n \n \n", "details": [{"source1": "html2text {}", "source2": "html2text {}", "unified_diff": "@@ -4,144 +4,90 @@\n \n \n dune-grid-glue\u00a02.9\n \n \n * dune\n * grid-glue\n- * merging\n-merger.hh\n+ * adapter\n+rangegenerators.hh\n Go_to_the_documentation_of_this_file.\n- 1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-\n- 2// vi: set et ts=4 sw=2 sts=2:\n- 3// SPDX-FileCopyrightInfo: Copyright \u00a9 DUNE Project contributors, see file\n+ 1// SPDX-FileCopyrightInfo: Copyright \u00a9 DUNE Project contributors, see file\n LICENSE.md in module root\n- 4// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-\n+ 2// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-GPL-2.0-only-\n with-dune-grid-glue-exception\n- 5#ifndef DUNE_GRIDGLUE_MERGING_MERGER_HH\n- 6#define DUNE_GRIDGLUE_MERGING_MERGER_HH\n+ 3#ifndef DUNE_GRIDGLUE_ADAPTER_RANGEGENERATORS_HH\n+ 4#define DUNE_GRIDGLUE_ADAPTER_RANGEGENERATORS_HH\n+ 5\n+ 6#include \n 7\n- 8#include \n- 9\n- 10#include \n- 11#include \n- 12\n- 13#include \n- 14\n- 15namespace Dune {\n- 16namespace GridGlue {\n- 17\n- 25template \n-26class Merger\n- 27{\n- 28public:\n- 29\n-31 typedef Dune::FieldVector Grid1Coords;\n+ 8namespace Dune {\n+ 9namespace GridGlue {\n+ 10\n+ 14template\n+15struct Reverse\n+ 16 : std::integral_constant\n+ 17{\n+18 typedef Reverse type;\n+ 19\n+ 20 constexpr\n+21 Reverse operator!() const\n+ 22 { return {}; }\n+ 23};\n+ 24\n+ 25#ifdef DOXYGEN\n+ 26\n+31const Reverse reversed;\n 32\n-34 typedef Dune::FieldVector Grid2Coords;\n- 35\n-37 typedef Dune::FieldVector WorldCoords;\n- 38\n-39 using IntersectionList = Dune::GridGlue::IntersectionList;\n- 40\n-54 virtual void build(const std::vector >&\n-grid1_coords,\n- 55 const std::vector& grid1_elements,\n- 56 const std::vector& grid1_element_types,\n- 57 const std::vector >& grid2_coords,\n- 58 const std::vector& grid2_elements,\n- 59 const std::vector& grid2_element_types) = 0;\n- 60\n-64 unsigned int nSimplices() const\n- 65 { return intersectionList()->size(); }\n- 66\n-67 virtual void clear() = 0;\n- 68\n-74 virtual std::shared_ptr intersectionList() const = 0;\n+ 66template<...>\n+ 67IteratorRange<...>\n+68intersections(const GridGlue<...>& glue, const Reverse<...>& reverse =\n+!reversed);\n+ 69\n+ 70#else\n+ 71\n+ 72namespace {\n+ 73const Reverse reversed = {};\n+ 74} /* namespace */\n 75\n- 79 template\n-80 unsigned int parents(unsigned int idx) const {\n- 81 return intersectionList()->template parents(idx);\n- 82 }\n+ 76template\n+ 77IteratorRange< typename GridGlue::template\n+IntersectionIterator >\n+ 78intersections(const GridGlue& glue, const Reverse& = {})\n+ 79{\n+ 80 const static int side = reverse ? 1 : 0;\n+ 81 return {glue.template ibegin(), glue.template iend()};\n+ 82}\n 83\n- 90 template\n-91 unsigned int parent(unsigned int idx, unsigned int parId = 0) const\n- 92 {\n- 93 return intersectionList()->template parent(idx, parId);\n- 94 }\n- 95\n- 104 template\n-105 auto parentLocal(unsigned int idx, unsigned int corner, unsigned int parId\n-= 0) const\n- 106 {\n- 107 return intersectionList()->template corner(idx, corner, parId);\n- 108 }\n- 109\n-114 unsigned int counter;\n- 115};\n- 116\n- 117} /* namespace GridGlue */\n- 118} /* namespace Dune */\n- 119\n- 120#endif\n-intersectionlist.hh\n+ 84#endif // DOXYGEN\n+ 85\n+ 86} /* namespace GridGlue */\n+ 87} /* namespace Dune */\n+ 88\n+ 89#endif\n Dune\n Definition: gridglue.hh:37\n-Dune::GridGlue::ProjectionImplementation::corner\n-Coordinate corner(unsigned c)\n-Definition: projection_impl.hh:24\n-Dune::GridGlue::IntersectionList\n-Definition: intersectionlist.hh:134\n-Dune::GridGlue::Merger\n-Abstract base for all classes that take extracted grids and build sets of\n-intersections.\n-Definition: merger.hh:27\n-Dune::GridGlue::Merger::parent\n-unsigned int parent(unsigned int idx, unsigned int parId=0) const\n-get index of grid-n's parent simplex for given merged grid simplex\n-Definition: merger.hh:91\n-Dune::GridGlue::Merger::clear\n-virtual void clear()=0\n-Dune::GridGlue::Merger::WorldCoords\n-Dune::FieldVector< ctype, dimworld > WorldCoords\n-the coordinate type used in this interface\n-Definition: merger.hh:37\n-Dune::GridGlue::Merger::Grid1Coords\n-Dune::FieldVector< ctype, grid1Dim > Grid1Coords\n-the local coordinate type for the grid1 coordinates\n-Definition: merger.hh:31\n-Dune::GridGlue::Merger::counter\n-unsigned int counter\n-Counts the number of times the computeIntersection method has been called.\n-Definition: merger.hh:114\n-Dune::GridGlue::Merger::parentLocal\n-auto parentLocal(unsigned int idx, unsigned int corner, unsigned int parId=0)\n-const\n-get the grid-n parent's simplex local coordinates for a particular merged grid\n-simplex corner (parent...\n-Definition: merger.hh:105\n-Dune::GridGlue::Merger::build\n-virtual void build(const std::vector< Dune::FieldVector< ctype, dimworld > >\n-&grid1_coords, const std::vector< unsigned int > &grid1_elements, const std::\n-vector< Dune::GeometryType > &grid1_element_types, const std::vector< Dune::\n-FieldVector< ctype, dimworld > > &grid2_coords, const std::vector< unsigned int\n-> &grid2_elements, const std::vector< Dune::GeometryType >\n-&grid2_element_types)=0\n-builds the merged grid\n-Dune::GridGlue::Merger::nSimplices\n-unsigned int nSimplices() const\n-get the number of simplices in the merged grid The indices are then in\n-0..nSimplices()-1\n-Definition: merger.hh:64\n-Dune::GridGlue::Merger::intersectionList\n-virtual std::shared_ptr< IntersectionList > intersectionList() const =0\n-Dune::GridGlue::Merger::parents\n-unsigned int parents(unsigned int idx) const\n-Definition: merger.hh:80\n-Dune::GridGlue::Merger::Grid2Coords\n-Dune::FieldVector< ctype, grid2Dim > Grid2Coords\n-the local coordinate type for the grid2 coordinates\n-Definition: merger.hh:34\n+Dune::GridGlue::intersections\n+IteratorRange<... > intersections(const GridGlue<... > &glue, const Reverse<...\n+> &reverse=!reversed)\n+Iterate over all intersections of a GridGlue.\n+Dune::GridGlue::GridGlue\n+sequential adapter to couple two grids at specified close together boundaries\n+Definition: gridglue.hh:67\n+Dune::GridGlue::GridGlue::intersections\n+IteratorRange<... > intersections(const GridGlue<... > &glue, const Reverse<...\n+> &reverse=!reversed)\n+Iterate over all intersections of a GridGlue.\n+Dune::GridGlue::Reverse\n+Definition: rangegenerators.hh:17\n+Dune::GridGlue::Reverse::reversed\n+const Reverse< true > reversed\n+Definition: rangegenerators.hh:31\n+Dune::GridGlue::Reverse::type\n+Reverse type\n+Definition: rangegenerators.hh:18\n+Dune::GridGlue::Reverse::operator!\n+constexpr Reverse operator!() const\n+Definition: rangegenerators.hh:21\n \n ===============================================================================\n Generated by\u00a0[doxygen] 1.9.4\n"}]}]}]}]}]}